:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --ink: #1f252b;
  --muted: #65717d;
  --line: #dfe4e8;
  --blue: #2868d8;
  --green: #17855f;
  --amber: #b46b09;
  --coral: #c94d3f;
  --teal: #0f7f8a;
  --violet: #7161c9;
  --shadow: 0 14px 34px rgba(32, 42, 54, 0.08);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 12px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #1f252b;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-nav a {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: #38424c;
}

.side-nav a:hover,
.side-nav a.active {
  background: #eef3ff;
  color: var(--blue);
}

.side-nav svg,
.icon-button svg,
.text-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.side-note {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
}

.side-note span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.side-note strong {
  display: block;
  margin-top: 6px;
}

.side-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 16px;
}

.top-actions,
.section-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-actions {
  flex-wrap: wrap;
}

.icon-button,
.text-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #2d3843;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  cursor: pointer;
}

.icon-button.primary {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
}

.text-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(32, 42, 54, 0.08);
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.section-head {
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.grid-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.operation-panel,
.scoreboard article,
.stage-card,
.department-card,
.reminder-card,
.timeline-item,
.exception-card,
.link-card,
.asset-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.operation-panel {
  padding: 18px;
}

.status-pill,
.chip,
.risk-level,
.time-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.active {
  color: var(--green);
  background: #e7f6ef;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
}

input:focus,
select:focus {
  outline: 2px solid #bcd4ff;
  border-color: var(--blue);
}

.next-action {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: #fff6e8;
  border: 1px solid #f0d5aa;
}

.next-action svg {
  width: 24px;
  height: 24px;
  color: var(--amber);
}

.next-action span {
  display: block;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scoreboard article {
  padding: 16px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.scoreboard span {
  font-size: 34px;
  font-weight: 850;
  color: #1f252b;
}

.scoreboard p {
  margin: 0;
  color: var(--muted);
}

.reminder-grid,
.flow-grid,
.department-board,
.exception-grid,
.link-grid,
.asset-checks {
  display: grid;
  gap: 12px;
}

.reminder-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reminder-card {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  padding: 14px;
  min-height: 156px;
}

.reminder-card input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--green);
}

.reminder-card.done {
  background: #f2faf5;
  border-color: #b7dfc6;
}

.reminder-card strong {
  display: block;
  margin-bottom: 6px;
}

.reminder-meta,
.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  background: #eef3f6;
  color: #46535f;
}

.chip.owner {
  background: #eaf3ff;
  color: #2559aa;
}

.chip.deadline {
  background: #fff3dc;
  color: var(--amber);
}

.chip.risk {
  background: #fdeceb;
  color: var(--coral);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.timeline-item {
  padding: 14px;
  min-height: 190px;
  border-top: 4px solid var(--blue);
}

.timeline-item[data-tone="green"] {
  border-top-color: var(--green);
}

.timeline-item[data-tone="amber"] {
  border-top-color: var(--amber);
}

.timeline-item[data-tone="coral"] {
  border-top-color: var(--coral);
}

.timeline-item h3 {
  margin-bottom: 8px;
}

.timeline-item p,
.reminder-card p,
.stage-card p,
.department-card p,
.exception-card p,
.asset-item p,
.link-card p {
  margin: 0;
  color: var(--muted);
}

.time-state {
  margin-top: 12px;
  background: #edf2f6;
  color: #52606c;
}

.time-state.due {
  background: #fff2d6;
  color: var(--amber);
}

.time-state.overdue {
  background: #fdeceb;
  color: var(--coral);
}

.flow-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stage-card {
  padding: 16px;
  min-height: 248px;
  border-left: 4px solid var(--teal);
}

.stage-card:nth-child(3n + 1) {
  border-left-color: var(--blue);
}

.stage-card:nth-child(3n + 2) {
  border-left-color: var(--green);
}

.stage-card h3 {
  margin-bottom: 8px;
}

.stage-number {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stage-card ul,
.plain-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #3c4650;
}

.stage-card li,
.plain-list li {
  margin: 6px 0;
}

.department-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.department-card {
  padding: 14px;
  min-height: 170px;
}

.department-card h3 {
  margin-bottom: 10px;
}

.department-card .mini-list {
  display: grid;
  gap: 7px;
}

.mini-list span {
  display: block;
  padding-left: 12px;
  border-left: 3px solid var(--line);
  color: #3d4751;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}

.metric-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.metric-row {
  display: grid;
  grid-template-columns: 110px 1fr 1.25fr;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-row span,
.metric-row p {
  margin: 0;
  padding: 12px;
}

.metric-row span {
  font-weight: 800;
  background: #f4f7f8;
}

.metric-row p + p {
  border-left: 1px solid var(--line);
}

.asset-checks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-item {
  padding: 14px;
  min-height: 130px;
}

.mindmap {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.mindmap img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: contain;
  background: #fbfcfd;
}

.mindmap figcaption {
  padding: 12px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.exception-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.exception-card {
  padding: 14px;
  min-height: 168px;
  border-top: 4px solid var(--coral);
}

.risk-level {
  margin-bottom: 10px;
  background: #fdeceb;
  color: var(--coral);
}

.link-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.link-card {
  padding: 16px;
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.link-card a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--blue);
  font-weight: 800;
}

.link-card svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 1180px) {
  .control-grid,
  .department-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reminder-grid,
  .flow-grid,
  .exception-grid,
  .link-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-hero,
  .split-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .control-grid,
  .scoreboard,
  .reminder-grid,
  .flow-grid,
  .department-board,
  .exception-grid,
  .link-grid,
  .timeline,
  .asset-checks {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .metric-row p + p {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
