:root {
  --bg: #f6f8f4;
  --surface: #f3f5f1;
  --surface-soft: #fafbf9;
  --surface-strong: #e7ebe3;
  --ink: #141910;
  --muted: #4f554b;
  --line: #d3d8cf;
  --primary: #406c07;
  --primary-strong: #2b5100;
  --accent: #bc4f00;
  --success: #247c3a;
  --warning: #d08600;
  --danger: #c5372f;
  --info: #0077ac;
  --white: #ffffff;
  --radius: 10px;
  --focus: 0 0 0 3px #b5d79a;
  --shadow-card: 0 1px 2px rgba(19,26,13,0.07), 0 4px 8px rgba(19,26,13,0.05);
  --shadow-popover: 0 2px 6px rgba(0,0,0,0.12), 0 8px 14px rgba(0,0,0,0.1);
  --risk-bg: #fff9f8;
  --risk-line: #e6867a;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--white);
  opacity: 1;
  visibility: visible;
  transition: none;
}

.loader-seen .page-loader {
  display: none;
}

.page-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(280px, 100%);
  padding: 0;
  background: transparent;
}

.loader-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
}

.loader-mark::before,
.loader-mark::after {
  content: none;
}

.loader-mark img {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0,57,92,0.14);
}

.loader-copy {
  display: grid;
  gap: 6px;
  text-align: center;
}

.loader-copy strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
}

.loader-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.loader-rail {
  position: relative;
  display: block;
  width: 176px;
  height: 10px;
  margin-top: 2px;
  overflow: hidden;
}

.loader-rail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 2px;
  border-radius: 999px;
  background: #d8dcd4;
}

.loader-rail::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 54px;
  height: 2px;
  border-radius: 999px;
  background: #006ba4;
  animation: loader-scan 1400ms cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader-rail i {
  display: none;
}

@keyframes loader-scan {
  0% {
    transform: translateX(-58px);
  }

  100% {
    transform: translateX(180px);
  }
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.primary-button,
.link-button,
.role-switch a {
  min-height: 38px;
  border-radius: 8px;
}

button,
.primary-button {
  border: 0;
  background: var(--primary);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

button:hover,
.primary-button:hover {
  background: var(--primary-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.danger-button,
.resume-button {
  border: 0;
  color: var(--white);
  padding: 0 16px;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #a12721;
}

.resume-button {
  background: var(--info);
}

.resume-button:hover {
  background: #005c8f;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 11px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.04);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7), 0 4px 8px rgba(0,26,0,0.04);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.kicker {
  margin: 0 0 3px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.role-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.role-switch a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.role-switch a.is-current {
  background: var(--ink);
  color: var(--white);
}

.page-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.app-main {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 14px clamp(12px, 2.5vw, 32px) 40px;
}

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #98c99e;
  border-radius: 8px;
  background: #e5f8e7;
  color: #064118;
  font-weight: 800;
}

.save-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  min-width: 92px;
  padding: 10px 14px;
  border: 1px solid #abcfaf;
  border-radius: 9px;
  background: var(--white);
  color: #0a441a;
  box-shadow: var(--shadow-popover);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.save-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toolbar,
.metrics,
.phase-overview,
.project-card,
.attention-panel,
.edit-panel,
.project-list,
.timeline-shell,
.quick-start,
.attention-list,
.reminder-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(520px, auto);
  gap: 16px;
  align-items: end;
  padding: 16px;
  margin-bottom: 16px;
}

.filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.filters select {
  width: 170px;
  min-width: 150px;
}

.check-filter {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--ink);
}

.check-filter input {
  width: auto;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 16px;
}

.metrics article {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.metrics article:last-child {
  border-right: 0;
}

.metrics span,
.metrics small {
  display: block;
  color: var(--muted);
}

.metrics strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 30px;
  line-height: 1;
}

.danger-text {
  color: var(--danger);
}

.phase-overview {
  padding: 16px;
  margin-bottom: 16px;
  background: var(--surface);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
}

.phase-cell {
  display: grid;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-decoration: none;
}

.phase-cell span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.phase-cell strong {
  align-self: end;
  font-size: 24px;
}

.timeline-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 16px;
}

.primary-view {
  min-height: calc(100vh - 116px);
}

.timeline-shell.primary-view {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.primary-view .timeline-table {
  gap: 10px;
}

.compact-tools {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
}

.compact-search {
  display: grid;
  grid-template-columns: auto 180px;
  align-items: center;
  gap: 8px;
}

.compact-search input {
  min-height: 34px;
  padding-block: 7px;
}

.compact-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.export-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.focus-strip article {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: 0 1px 2px rgba(18,18,18,0.05);
}

.focus-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.focus-strip strong {
  font-size: 24px;
  line-height: 1;
}

.focus-strip .is-danger {
  border-color: var(--risk-line);
  background: var(--risk-bg);
}

.focus-strip .is-warning {
  border-color: #e3ac64;
  background: #fff6e8;
}

.leader-ops {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 10px;
  margin-bottom: 12px;
}

.attention-list,
.reminder-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 12px;
}

.mini-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.mini-heading strong {
  font-size: 14px;
}

.mini-heading span,
.quiet-line,
.qr-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quiet-line {
  margin: 0;
}

.attention-row {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.attention-row:first-of-type {
  border-top: 0;
}

.attention-row strong {
  font-size: 13px;
}

.attention-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.attention-row:hover strong {
  color: var(--primary-strong);
}

.reminder-box textarea {
  min-height: 92px;
  padding: 8px;
  font-size: 12px;
  resize: vertical;
}

.reminder-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.reminder-actions button,
.reminder-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.reminder-actions button {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.qr-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.qr-line img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.timeline-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #969a93;
}

.legend-dot.is-done {
  background: var(--success);
}

.legend-dot.is-active {
  background: var(--info);
}

.legend-dot.is-blocked {
  background: var(--danger);
}

.timeline-table {
  display: grid;
  gap: 8px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0;
  min-height: 112px;
  border: 1px solid #d0d4cc;
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
  scroll-margin-top: 86px;
  box-shadow: var(--shadow-card);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.timeline-row:target {
  border-color: #759958;
  box-shadow: 0 0 0 3px #d8e7cc;
}

.timeline-row.has-risk {
  border-color: var(--risk-line);
  background: var(--white);
}

.leader-note-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 10px 14px 12px 250px;
  border-top: 1px solid var(--line);
  background: #f5f8f3;
}

.leader-note-panel[hidden] {
  display: none;
}

.leader-note-panel strong {
  font-size: 13px;
}

.leader-note-panel p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.timeline-project {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.timeline-project strong {
  font-size: 16px;
  line-height: 1.35;
}

.timeline-project span,
.timeline-project em,
.timeline-project small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.timeline-project b {
  color: inherit;
  font-weight: 800;
}

.timeline-project small {
  display: block;
  line-height: 1.35;
  font-weight: 700;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.project-actions button,
.project-info-trigger {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.project-actions button:hover,
.project-info-trigger:hover {
  border-color: #a0b68f;
  background: #eaf1e5;
}

.editable-field {
  border-radius: 5px;
  cursor: text;
}

.editable-field:hover {
  background: #e1ecd8;
  color: var(--primary-strong);
}

.timeline-scroll {
  overflow: visible;
}

.timeline-scroll.is-dragging {
  user-select: none;
}

.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  min-height: 116px;
  align-items: center;
  padding: 8px 10px;
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  top: 60px;
  height: 3px;
  border-radius: 999px;
  background: #c7cdc1;
}

.timeline-point {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-items: center;
  grid-template-rows: 40px 28px 26px;
  gap: 2px;
  min-width: 0;
  min-height: 96px;
  color: var(--ink);
}

.timeline-point::before {
  content: none;
}

.timeline-point::after {
  content: none;
}

.timeline-point.label-top {
  grid-template-rows: 40px 28px 26px;
}

.timeline-point.label-bottom {
  grid-template-rows: 40px 28px 26px;
}

.timeline-label,
.timeline-date {
  max-width: 100%;
  text-align: center;
  line-height: 1.25;
}

.timeline-label {
  align-self: end;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.18;
  text-wrap: balance;
}

.label-short {
  display: none;
}

.timeline-date {
  align-self: start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  min-height: 16px;
}

.timeline-node {
  display: block;
  position: relative;
  z-index: 1;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 3px solid #b5beae;
  border-radius: 50%;
  background: #e6ebe3;
  box-shadow: 0 0 0 3px var(--white), 0 1px 2px rgba(19,19,12,0.16);
}

.timeline-point.is-done .timeline-node {
  border-color: #76c382;
  background: var(--success);
}

.timeline-point.is-active .timeline-node {
  border-color: #64aedc;
  background: var(--info);
}

.timeline-point.is-blocked .timeline-node {
  border-color: #f08f83;
  background: var(--danger);
}

.timeline-node.has-note::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(17,22,11,0.18);
}

.timeline-form,
.timeline-edit-point {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: default;
}

.node-form {
  margin: 0;
}

.timeline-form .timeline-node,
.node-form .timeline-node {
  cursor: pointer;
  padding: 0;
  min-height: 26px;
}

.timeline-form .timeline-node:hover,
.node-form .timeline-node:hover {
  box-shadow: 0 0 0 4px #c0dbac;
  transform: none;
}

.editable .timeline-edit-point .timeline-label {
  cursor: pointer;
}

.editable .timeline-edit-point:hover .timeline-label {
  color: var(--primary-strong);
}

.editable .timeline-edit-point:hover {
  background: #f2f7ef;
  border-radius: 7px;
}

.stage-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.stage-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 38px;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid #ced3c9;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.editable-date {
  cursor: text;
}

.editable-date.is-empty {
  color: #647557;
  border-style: dashed;
}

.note-edit-trigger.has-value {
  border-color: #e29b76;
  background: #fff1e7;
  color: #683110;
}

.editable .stage-tool:hover {
  background: #e1ecd8;
  color: var(--primary-strong);
}

.inline-date-input {
  width: 82px;
  min-height: 28px;
  padding: 2px 4px;
  font-size: 12px;
  text-align: center;
}

.inline-text-input {
  width: 100%;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.inline-textarea {
  min-height: 54px;
  resize: vertical;
}

.note-popover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.24);
}

.note-popover[hidden] {
  display: none;
}

.note-card {
  width: min(480px, 100%);
  padding: 16px;
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-popover);
}

.note-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.note-card p {
  margin-bottom: 12px;
  color: var(--muted);
}

.note-card textarea {
  width: 100%;
}

.note-card form {
  display: grid;
  gap: 10px;
}

.project-card-modal {
  width: min(560px, 100%);
}

.project-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.note-actions button[type="button"] {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.minor-actions {
  margin: 0;
}

.minor-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.row-tools {
  grid-column: 1 / -1;
  padding: 8px 16px 12px;
  border-top: 1px solid var(--line);
}

.row-tools summary {
  color: var(--primary-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.detail-form {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-wide {
  grid-column: span 2;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.date-grid label {
  min-width: 0;
}

.date-grid input {
  padding-inline: 6px;
  font-size: 12px;
}

.current-note {
  margin-top: 12px;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.detail-actions button {
  padding-inline: 18px;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.project-board {
  min-width: 0;
}

.project-card {
  padding: 18px;
  margin-bottom: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.project-card:hover {
  border-color: #99ac8b;
  box-shadow: var(--shadow-card);
}

.project-card.has-risk {
  border-color: var(--risk-line);
  background: var(--risk-bg);
}

.project-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-head p,
.summary,
.card-actions span,
.muted {
  color: var(--muted);
}

.summary {
  margin-bottom: 14px;
  max-width: 78ch;
}

.project-progress {
  display: grid;
  place-items: center;
  width: 82px;
  height: 60px;
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.project-progress strong {
  font-size: 20px;
}

.project-progress span {
  color: var(--muted);
  font-size: 12px;
}

.priority,
.status-pill,
.risk-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.priority-高,
.risk-label {
  background: var(--danger);
  color: var(--white);
}

.priority-中 {
  background: var(--accent);
  color: var(--white);
}

.priority-低 {
  background: #d1e4d3;
  color: #0a3b17;
}

.current-line {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.status-pill.is-pending {
  background: #dfe3dc;
  color: #343a30;
}

.status-pill.is-active {
  background: var(--info);
  color: var(--white);
}

.status-pill.is-done {
  background: var(--success);
  color: var(--white);
}

.status-pill.is-blocked {
  background: var(--danger);
  color: var(--white);
}

.stage-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(104px, 1fr));
  gap: 6px;
  padding-top: 4px;
  overflow-x: auto;
}

.stage-step {
  position: relative;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stage-step .dot {
  display: block;
  width: 10px;
  height: 10px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: #82897d;
}

.stage-step.is-active .dot {
  background: var(--info);
}

.stage-step.is-done .dot {
  background: var(--success);
}

.stage-step.is-blocked .dot {
  background: var(--danger);
}

.stage-name,
.stage-date {
  display: block;
}

.stage-name {
  font-size: 12px;
  font-weight: 800;
}

.stage-date {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 14px;
}

.quick-actions button {
  min-width: 128px;
  padding: 0 16px;
}

.card-actions a {
  color: var(--primary-strong);
  font-weight: 800;
}

.attention-panel {
  align-self: start;
  padding: 16px;
  position: sticky;
  top: 92px;
}

.attention-item {
  display: grid;
  gap: 3px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.attention-item span {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.department-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.quick-start,
.editor-share-panel,
.operator-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.quick-start {
  padding: 18px;
  margin-bottom: 16px;
}

.editor-share-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  margin-bottom: 16px;
}

.editor-share-copy {
  min-width: 0;
}

.editor-share-copy textarea {
  min-height: 70px;
  padding: 8px;
  font-size: 12px;
  resize: vertical;
}

.editor-share-qr {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.editor-share-qr img {
  width: 76px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.editor-share-qr span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.quick-create {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.quick-create .primary-button {
  padding-inline: 18px;
}

.operator-board {
  display: grid;
  gap: 12px;
}

.operator-card {
  padding: 18px;
}

.operator-card.has-risk {
  border-color: var(--risk-line);
  background: var(--risk-bg);
}

.operator-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 16px;
  align-items: center;
}

.operator-main p {
  margin-bottom: 0;
  color: var(--muted);
}

.big-stage {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface);
}

.big-stage span,
.big-stage em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.big-stage strong {
  font-size: 18px;
}

.operator-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.operator-actions button {
  min-height: 56px;
  font-size: 16px;
}

.operator-actions .resume-button {
  grid-column: 1 / -1;
}

.done-banner {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #daf3dc;
  color: #0a441a;
  font-weight: 900;
  text-align: center;
}

.compact-details {
  margin-top: 14px;
}

.compact-details summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 900;
}

.compact-details .stage-rail {
  margin-top: 10px;
}

.delete-row {
  margin-top: 10px;
  text-align: right;
}

.delete-row button {
  min-height: 34px;
  background: transparent;
  color: var(--danger);
}

.edit-panel,
.project-list {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide {
  grid-column: span 3;
}

.stage-editor {
  margin-top: 20px;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.mini-progress {
  border-radius: 999px;
  background: var(--surface);
  padding: 7px 11px;
  color: var(--muted);
  font-weight: 800;
}

.mini-progress span {
  color: var(--primary-strong);
}

.stage-row {
  display: grid;
  grid-template-columns: 160px 170px minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
  margin: 0 0 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stage-row legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 900;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.form-actions .primary-button {
  padding: 0 18px;
}

.project-list {
  align-self: start;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.list-item.is-selected {
  margin-inline: -10px;
  padding-inline: 10px;
  border-radius: 8px;
  background: var(--surface);
}

.list-item a {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-decoration: none;
}

.list-item span {
  color: var(--muted);
  font-size: 13px;
}

.list-item button {
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
  color: var(--danger);
}

[data-project-card][hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .toolbar,
  .board-layout,
  .department-layout,
  .leader-ops,
  .editor-share-panel {
    grid-template-columns: 1fr;
  }

  .focus-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .attention-panel {
    position: static;
  }

  .phase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid .wide {
    grid-column: span 2;
  }

  .stage-row {
    grid-template-columns: 1fr 1fr;
  }

  .quick-create,
  .operator-main,
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .date-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stage-note {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
    background: var(--surface);
  }

  .app-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px 12px 10px;
    background: var(--surface-soft);
    box-shadow: 0 1px 0 var(--line);
  }

  .app-header .kicker {
    margin-bottom: 1px;
    font-size: 12px;
  }

  .app-header h1 {
    font-size: 19px;
  }

  .app-main {
    padding: 10px 10px 28px;
  }

  .role-switch,
  .page-badge {
    width: 100%;
  }

  .page-badge,
  .role-switch a {
    flex: 1;
    justify-content: center;
  }

  .flash {
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  .save-toast {
    right: 12px;
    bottom: 12px;
  }

  .timeline-shell,
  .quick-start,
  .editor-share-panel {
    padding: 10px;
    border-radius: 10px;
    background: var(--white);
  }

  .editor-share-panel {
    gap: 10px;
    margin-bottom: 10px;
  }

  .editor-share-copy textarea {
    min-height: 74px;
  }

  .editor-share-qr {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .editor-share-qr img {
    width: 58px;
    height: 58px;
  }

  .primary-view {
    min-height: auto;
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .section-heading {
    order: 0;
    margin-bottom: 10px;
  }

  .section-heading h2 {
    font-size: 17px;
  }

  .section-heading p {
    font-size: 12px;
  }

  .compact-tools {
    width: 100%;
    gap: 7px;
  }

  .compact-search {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .compact-search input {
    min-height: 38px;
  }

  .compact-search span {
    display: none;
  }

  .compact-stats {
    width: 100%;
    gap: 6px;
    font-size: 12px;
  }

  .compact-stats span {
    flex: 1;
    min-width: 78px;
    padding: 6px 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    text-align: center;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .focus-strip {
    order: 1;
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
  }

  .focus-strip article {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: 6px 6px;
    border-radius: 7px;
    box-shadow: none;
  }

  .focus-strip strong {
    font-size: 18px;
  }

  .focus-strip span {
    overflow: hidden;
    font-size: 11px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mini-heading {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }

  .metrics article {
    border-bottom: 1px solid var(--line);
  }

  .leader-ops {
    order: 5;
    display: none;
    gap: 8px;
    margin-bottom: 10px;
  }

  .attention-list,
  .reminder-box {
    padding: 10px;
  }

  .reminder-box textarea {
    min-height: 74px;
  }

  .reminder-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .reminder-actions button,
  .reminder-actions a {
    min-height: 38px;
  }

  .qr-line {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .qr-line img {
    width: 54px;
    height: 54px;
  }

  .timeline-legend {
    order: 4;
    display: none;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
  }

  .timeline-table {
    order: 2;
  }

  .project-head,
  .section-heading,
  .editor-head,
  .card-actions {
    align-items: start;
    flex-direction: column;
  }

  .project-progress {
    width: 100%;
    height: 52px;
  }

  .form-grid,
  .stage-row,
  .quick-create,
  .operator-main,
  .operator-actions,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-wide {
    grid-column: auto;
  }

  .date-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-create {
    gap: 9px;
  }

  .quick-create label,
  .note-card label {
    gap: 5px;
  }

  .quick-create input,
  .quick-create button,
  .note-card input,
  .note-card textarea,
  .note-actions button {
    min-height: 44px;
  }

  .timeline-row {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 10px;
    background: var(--white);
  }

  .timeline-project {
    gap: 5px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--white);
  }

  .timeline-project strong {
    font-size: 15px;
  }

  .timeline-project span,
  .timeline-project em,
  .timeline-project small {
    font-size: 12px;
  }

  .project-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .project-actions button,
  .project-actions form,
  .project-info-trigger,
  .minor-actions button {
    width: 100%;
  }

  .project-actions button,
  .project-info-trigger,
  .minor-actions button {
    min-height: 38px;
    border-radius: 7px;
  }

  .leader-note-panel {
    margin: 0;
    padding: 10px 12px 12px;
    background: #f6f9f3;
  }

  .timeline-track {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 0;
    align-items: stretch;
  }

  .timeline-track::before {
    content: none;
  }

  .timeline-point {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    justify-items: stretch;
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
    min-height: 58px;
    padding: 9px 12px;
    border-top: 1px solid var(--line);
  }

  .timeline-point::before {
    content: "";
    position: absolute;
    left: 28px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #c7cdc1;
  }

  .timeline-point:first-child::before {
    top: 50%;
  }

  .timeline-point:last-child::before {
    bottom: 50%;
  }

  .timeline-point.label-top,
  .timeline-point.label-bottom {
    grid-template-rows: auto auto;
  }

  .timeline-label,
  .timeline-date {
    max-width: 100%;
    text-align: left;
  }

  .timeline-label {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 13px;
    line-height: 1.25;
  }

  .timeline-date {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    min-height: 17px;
    color: var(--muted);
    font-size: 12px;
  }

  .node-form {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 40px;
    align-self: center;
  }

  .timeline-node,
  .timeline-form .timeline-node,
  .node-form .timeline-node {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    border-width: 3px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--white);
  }

  .timeline-node.has-note::after {
    right: -5px;
    top: -5px;
  }

  .timeline-point:not(.timeline-edit-point) .timeline-node {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: center;
  }

  .timeline-point:not(.timeline-edit-point) .timeline-date {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    min-width: 38px;
    color: var(--ink);
    font-weight: 900;
    text-align: right;
  }

  .timeline-edit-point {
    grid-template-columns: 34px minmax(0, 1fr) minmax(120px, auto);
    min-height: 66px;
  }

  .timeline-edit-point .timeline-label {
    font-size: 13px;
  }

  .timeline-edit-point .stage-tools {
    grid-column: 3;
    grid-row: 1 / span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(54px, 1fr));
    gap: 6px;
    width: auto;
    align-self: center;
  }

  .timeline-edit-point .timeline-date {
    display: none;
  }

  .stage-tool {
    min-width: 0;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
  }

  .primary-view .label-full {
    display: none;
  }

  .primary-view .label-short {
    display: inline;
  }

  .primary-view .timeline-row {
    min-height: 0;
  }

  .primary-view .timeline-project {
    padding: 10px 12px;
  }

  .primary-view .timeline-project small {
    display: none;
  }

  .primary-view .timeline-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    min-height: 78px;
    padding: 6px 8px 7px;
    align-items: center;
    background: var(--surface-soft);
  }

  .primary-view .timeline-track::before {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    top: 40px;
    height: 2px;
    border-radius: 999px;
    background: var(--line);
  }

  .primary-view .timeline-point,
  .primary-view .timeline-point.label-top,
  .primary-view .timeline-point.label-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 18px 28px 17px;
    justify-items: center;
    align-items: center;
    gap: 0;
    min-height: 70px;
    padding: 2px 1px;
    border-top: 0;
  }

  .primary-view .timeline-point::before {
    content: none;
  }

  .primary-view .timeline-label {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
  }

  .primary-view .timeline-point:not(.timeline-edit-point) .timeline-node {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    justify-self: center;
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    box-shadow: 0 0 0 3px var(--surface-soft), 0 1px 2px rgba(19,19,12,0.16);
  }

  .primary-view .timeline-point:not(.timeline-edit-point) .timeline-date {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
    justify-self: center;
    min-width: 0;
    color: var(--ink);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
  }

  .row-tools {
    padding: 8px 12px 11px;
  }

  .row-tools summary {
    min-height: 36px;
    display: flex;
    align-items: center;
  }

  .note-popover {
    place-items: end center;
    padding: 0;
    background: rgba(0,0,0,0.34);
  }

  .note-card,
  .project-card-modal {
    width: 100%;
    max-height: 88vh;
    overflow: auto;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    border-radius: 14px 14px 0 0;
    box-shadow: var(--shadow-popover);
  }

  .project-modal-grid {
    grid-template-columns: 1fr;
  }

  .note-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .form-grid .wide,
  .stage-note {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }

  .loader-mark::before,
  .loader-mark::after,
  .loader-mark img,
  .loader-rail::after,
  .loader-rail i {
    animation: none !important;
  }
}
