:root {
  --ink: #191615;
  --muted: #6d6864;
  --line: #e6e0dc;
  --paper: #fffdfb;
  --surface: #ffffff;
  --rose: #b9545d;
  --rose-dark: #88353e;
  --sage: #6e8376;
  --blue: #506f8e;
  --gold: #b2894c;
  --black: #111111;
  --soft-rose: #f7e8e9;
  --soft-sage: #eaf0ec;
  --soft-blue: #e9f0f6;
  --soft-gold: #f6efe3;
  --shadow: 0 16px 40px rgba(29, 24, 20, 0.08);
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #fffaf8;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--black);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
}

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

.toc {
  display: grid;
  gap: 6px;
}

.toc a {
  color: var(--ink);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.toc a:hover,
.toc a.active {
  background: var(--soft-rose);
  color: var(--rose-dark);
}

.main {
  padding: 28px 32px 64px;
  max-width: 1440px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}

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

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: 24px;
}

h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
}

.search-box input {
  width: 260px;
  border: 0;
  outline: 0;
  color: var(--ink);
}


.source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 122px;
  height: 42px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--black);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.source-button:hover {
  background: var(--rose-dark);
}
.update-pill {
  min-width: 142px;
  height: 42px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--soft-sage);
  color: var(--sage);
}

.update-pill span {
  color: var(--muted);
}

.section {
  scroll-margin-top: 24px;
  padding: 34px 0 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.section-note {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.taxonomy-card,
.sop-card,
.phrase-card,
.kanban-column,
.workflow-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.metric-card {
  padding: 18px;
  min-height: 112px;
}

.metric-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
}

.metric-label {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.metric-trend {
  margin-top: 6px;
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 700;
}

.split-panel {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  padding: 20px;
  margin-top: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 70px;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.bar-label {
  font-size: 13px;
  color: var(--ink);
}

.bar-track {
  height: 9px;
  background: #f1eeeb;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--blue));
}

.bar-value {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.priority-list {
  display: grid;
  gap: 10px;
}

.priority-item {
  padding: 12px;
  background: #fbf8f6;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.taxonomy-card {
  padding: 16px;
}

.taxonomy-card h3 {
  color: var(--rose-dark);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.workflow-card {
  padding: 18px;
  border-top: 4px solid var(--rose);
}

.workflow-card:nth-child(2) {
  border-top-color: var(--blue);
}

.workflow-card:nth-child(3) {
  border-top-color: var(--sage);
}

.workflow-card p,
.workflow-card li {
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.workflow-card ul {
  padding-left: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
}

.chip.active {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}

.sop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sop-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  min-height: 204px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.sop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.sop-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.sop-id {
  color: var(--rose-dark);
  font-weight: 800;
  font-size: 12px;
}

.sop-type {
  color: var(--muted);
  font-size: 12px;
}

.sop-card h3 {
  margin: 0;
  line-height: 1.35;
}

.sop-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.sop-route {
  align-self: end;
  color: var(--sage);
  font-size: 13px;
  font-weight: 800;
}

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

.phrase-card {
  padding: 16px;
}

.phrase-card textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
}

.copy-button {
  margin-top: 10px;
  border: 0;
  background: var(--black);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kanban-column {
  padding: 14px;
  min-height: 260px;
}

.kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.count-badge {
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--soft-gold);
  color: var(--gold);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.kanban-card {
  border: 1px solid var(--line);
  background: #fbf8f6;
  border-radius: 6px;
  padding: 11px;
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.update-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  padding: 18px;
}

.panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 14px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 22, 21, 0.32);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(640px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
}

.drawer-body {
  overflow: auto;
  padding: 22px 24px 32px;
}

.detail-block {
  margin-bottom: 22px;
}

.detail-block h3 {
  color: var(--rose-dark);
}

.detail-block ul {
  margin: 0;
  padding-left: 20px;
}

.detail-block li {
  margin: 7px 0;
  color: var(--muted);
  line-height: 1.65;
}

.script-box {
  white-space: pre-wrap;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbf8f6;
  border-radius: 6px;
  color: var(--ink);
  line-height: 1.6;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .metric-grid,
  .taxonomy-grid,
  .sop-grid,
  .kanban,
  .update-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main {
    padding: 22px 16px 48px;
  }

  .topbar,
  .section-head,
  .top-actions,
  .split-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-box input {
    width: 100%;
  }

  .metric-grid,
  .taxonomy-grid,
  .workflow,
  .sop-grid,
  .phrase-layout,
  .kanban,
  .update-grid,
  .toc {
    grid-template-columns: 1fr;
  }
}
