/* ============================================================
   制度智审 · 高保真原型共享设计系统
   Design System for "制度智审" SaaS prototype
   华夏基石品牌识别 · 华夏红 / 墨黑 / 中性灰
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* 华夏基石品牌色 */
  --brand-from: #e31b23;
  --brand-to: #e31b23;
  --brand: #e31b23;
  --brand-strong: #b81219;
  --brand-gradient: #e31b23;
  --brand-soft: #fff0f1;
  --brand-soft-2: #fff7f7;

  /* 布局背景 */
  --page-bg: #f3f4f1;
  --sidebar-bg: #ffffff;
  --surface: #ffffff;             /* 卡片/正文白底 */
  --surface-2: #f6f7f5;           /* 次级面板 */
  --hover: #f1f5f3;               /* 行/项 hover */

  /* 文字 */
  --text: #343a3d;                /* 正文主色 */
  --text-strong: #2b3032;         /* 标题 */
  --muted: #7f898b;               /* 次要说明 */
  --muted-2: #a5adae;             /* 更浅占位 */

  /* 描边 */
  --border: #e2e5e1;
  --border-strong: #d4d9d5;
  --border-dashed: #bdc6c2;

  /* 语义色 */
  --ok: #16a34a;
  --ok-bg: #e4f7ec;
  --ok-border: #b9ecca;
  --warn: #d97a00;
  --warn-bg: #fdf0d8;
  --warn-border: #f6d9a1;
  --danger: #ef4444;
  --danger-bg: #fdeaea;
  --danger-border: #f7c4c4;
  --info: #2563eb;
  --info-bg: #eaf1ff;

  /* 业务领域彩签 */
  --tag-invest: #2563eb;    --tag-invest-bg: #e7efff;
  --tag-purchase: #b85f00;  --tag-purchase-bg: #fff1dc;
  --tag-finance: #0891b2;   --tag-finance-bg: #e0f5fa;
  --tag-compliance: #16a34a;--tag-compliance-bg: #e4f7ec;
  --tag-general: #64748b;   --tag-general-bg: #eef1f6;
  --tag-hr: #db2777;        --tag-hr-bg: #fdeaf4;
  --tag-legal: #d97706;     --tag-legal-bg: #fdf0d8;

  /* 圆角 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(20, 30, 60, .05);
  --shadow: 0 4px 16px rgba(20, 30, 60, .06);
  --shadow-md: 0 8px 28px rgba(20, 30, 60, .09);
  --shadow-brand: 0 6px 16px rgba(227, 27, 35, .2);

  /* 间距刻度 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* 字号 */
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-base: 15px;
  --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 26px;

  /* 尺寸 */
  --sidebar-w: 232px;
  --header-h: 60px;
}

/* ---------- 2. Base / Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--text-strong); font-weight: 700; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d7dbe6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c2c8d6; }
::-webkit-scrollbar-track { background: transparent; }

/* 通用图标 */
.icon {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none; vertical-align: middle;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------- 3. App Shell / 两栏布局 ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

/* ----- 侧栏 ----- */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 8px 16px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; text-decoration: none; }
.brand-lockup:hover { text-decoration: none; }
.brand-wordmark { width: 78px; height: 52px; object-fit: contain; flex: none; }
.brand-product-name { padding-left: 9px; border-left: 1px solid #d7d9d5; color: #242124; font-size: 13px; font-weight: 800; white-space: nowrap; }
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--brand-gradient);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.brand-logo .icon { width: 20px; height: 20px; }
.brand-name {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--text-strong);
}

.sidebar__nav {
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #4a5163;
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-item .icon { color: #9198ab; transition: color .15s; }
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}
.nav-item.active .icon { color: var(--brand); }
/* 高亮左侧竖条 */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.product-nav-item { min-height: 42px; padding: 8px 10px; gap: 9px; }
.product-nav-divider { height: 1px; margin: 8px 10px; background: var(--border); }
.nav-code {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #758091;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.nav-code--icon .icon { width: 15px; height: 15px; }
.product-nav-item.active .nav-code {
  border-color: transparent;
  background: transparent;
  color: var(--brand);
}
.shell-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  transform: translate(-50%, 12px);
  opacity: 0;
  padding: 10px 16px;
  border: 1px solid #d8dee9;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .2);
  font-size: 13px;
  transition: opacity .2s, transform .2s;
}
.shell-toast.show { opacity: 1; transform: translate(-50%, 0); }
.shell-toast.ok { background: #12685f; }
.shell-toast.warn { background: #9a5b10; }

/* 历史对话 */
.sidebar__section-label {
  padding: 16px 16px 8px;
  font-size: var(--fs-xs);
  color: var(--muted-2);
  font-weight: 600;
  letter-spacing: .5px;
}
.history {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}
.history-item {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #5b6274;
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s;
}
.history-item:hover { background: var(--hover); color: var(--text); }

.sidebar__footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ----- 主区 ----- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.main__inner {
  flex: 1;
  padding: 28px 40px 48px;
  max-width: 1400px;
  width: 100%;
}
.main--flush { }
.main--flush .main__inner { padding: 0; max-width: none; }

/* 顶栏 / 页面标题 */
.page-title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  margin-bottom: 22px;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-subtitle { color: var(--muted); font-size: var(--fs-md); margin-top: 4px; }

.section-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 26px 0 16px;
}
.section-title:first-child { margin-top: 0; }

/* ---------- 4. Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card--flat { box-shadow: none; }
.card--pad-lg { padding: 28px; }
.card__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card__sub { color: var(--muted); font-size: var(--fs-sm); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }

.btn-primary {
  background: var(--brand-gradient);
  border: 1px solid var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
  border-radius: var(--radius-sm);
  padding: 0 22px;
}
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); box-shadow: 0 8px 20px rgba(0, 91, 142, .25); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--brand);
}
.btn-ghost:hover { background: var(--brand-soft); }

.btn-soft {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand);
}
.btn-soft:hover { background: #d8edf2; }

.btn-danger { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); }
.btn-danger:hover { background: #fbe0e0; }

.btn-sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-lg { height: 46px; padding: 0 34px; font-size: var(--fs-lg); }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }

/* 图标操作按钮(表格行) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn .icon { width: 17px; height: 17px; }

/* ---------- 6. Tags 业务领域彩签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.6;
  background: var(--tag-general-bg);
  color: var(--tag-general);
  white-space: nowrap;
}
.tag-invest     { background: var(--tag-invest-bg);     color: var(--tag-invest); }
.tag-purchase   { background: var(--tag-purchase-bg);   color: var(--tag-purchase); }
.tag-finance    { background: var(--tag-finance-bg);    color: var(--tag-finance); }
.tag-compliance { background: var(--tag-compliance-bg); color: var(--tag-compliance); }
.tag-general    { background: var(--tag-general-bg);    color: var(--tag-general); }
.tag-hr         { background: var(--tag-hr-bg);         color: var(--tag-hr); }
.tag-legal      { background: var(--tag-legal-bg);      color: var(--tag-legal); }

/* ---------- 7. Status 徽章 ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.4;
}
.status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-active    { background: var(--ok-bg);    color: var(--ok); }
.status-revising  { background: var(--warn-bg);  color: var(--warn); }
.status-abolished { background: #eef0f4;          color: #97a0b2; }

/* ---------- 8. 冲突徽章 ---------- */
.badge-conflict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.badge-conflict .icon { width: 17px; height: 17px; }
.badge-conflict.warn   { color: var(--warn); }
.badge-conflict.danger { color: var(--danger); }
.badge-conflict.ok     { color: var(--ok); }

/* 计数小圆点 */
.count-dot {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--danger); color: #fff;
  font-size: 12px; font-weight: 700;
}
.count-dot.warn { background: var(--warn); }
.count-dot.ok   { background: var(--ok); }
.count-dot.soft { background: var(--brand-soft); color: var(--brand); }

/* ---------- 9. Table ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
}
.table thead th {
  text-align: left;
  padding: 15px 20px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr.is-active { background: var(--brand-soft-2); }
.table .cell-title { font-weight: 600; color: var(--text-strong); }
.table .cell-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.table .cell-actions { display: flex; gap: 4px; }
.table-foot {
  padding: 14px 4px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ---------- 10. Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.field-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.field-row .field-label { text-align: left; }

.input, .select, .textarea {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.input::placeholder { color: var(--muted-2); }
.input:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,91,255,.12);
}
.textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 90px; line-height: 1.6; }

/* 自定义下拉 .select */
.select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--surface-2);
  border-color: var(--border);
  user-select: none;
  padding-right: 38px;
  min-width: 150px;
}
.select::after {
  content: "";
  position: absolute; right: 14px; top: 50%;
  width: 8px; height: 8px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  transition: transform .18s;
}
.select.open::after { transform: translateY(-30%) rotate(225deg); }
.select__value { color: var(--text); flex: 1; }
.select__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 40;
  display: none;
}
.select.open .select__menu { display: block; }
.select__option {
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-md);
  color: var(--text);
  cursor: pointer;
}
.select__option:hover { background: var(--brand-soft); color: var(--brand); }
.select__option.selected { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 搜索框 */
.searchbox {
  position: relative;
  display: flex;
  align-items: center;
}
.searchbox .icon {
  position: absolute; left: 14px; color: var(--muted-2);
}
.searchbox .input { padding-left: 40px; }

/* 制度类型选择卡 */
.choice-group { display: flex; gap: 14px; flex-wrap: wrap; }
.choice {
  padding: 13px 30px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.choice:hover { border-color: var(--brand); }
.choice.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: 0 0 0 3px rgba(59,91,255,.08);
}

/* ---------- 11. Dropzone 拖拽上传 ---------- */
.dropzone {
  border: 1.5px dashed var(--border-dashed);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcff 0%, #f7f9ff 100%);
  padding: 54px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft-2);
}
.dropzone__icon {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  color: var(--brand);
}
.dropzone__icon .icon { width: 46px; height: 46px; stroke-width: 1.5; }
.dropzone__title { font-size: var(--fs-lg); font-weight: 700; color: var(--text-strong); }
.dropzone__hint { color: var(--muted); font-size: var(--fs-sm); margin-top: 8px; }
/* 已上传文件条 */
.file-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--brand-soft-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.file-chip .icon { color: var(--brand); }
.file-chip__remove { margin-left: 6px; color: var(--muted); cursor: pointer; }

/* ---------- 12. 三栏审查布局 ---------- */
.review {
  display: grid;
  grid-template-columns: 248px minmax(0,1fr) 320px;
  height: calc(100vh);
  background: var(--surface);
}
.review__toc {
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  overflow-y: auto;
  background: var(--surface-2);
}
.review__doc {
  overflow-y: auto;
  padding: 34px 56px 80px;
}
.review__panel {
  border-left: 1px solid var(--border);
  padding: 18px 16px;
  overflow-y: auto;
  background: var(--surface-2);
}
/* 目录项 */
.toc-item {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: #565d70;
  font-size: var(--fs-md);
  cursor: pointer;
  transition: background .12s;
}
.toc-item:hover { background: var(--hover); }
.toc-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 文档正文 */
.doc-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 26px; }
.doc-h2 { font-size: var(--fs-xl); font-weight: 700; text-align: center; margin: 30px 0 16px; }
.doc-p { margin-bottom: 14px; line-height: 1.9; text-indent: 2em; color: #2b3140; }
/* 命中问题高亮段落 */
.doc-flag {
  border-left: 3px solid var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin-bottom: 14px;
  line-height: 1.9;
  font-weight: 500;
  cursor: pointer;
}
.doc-flag.warn { border-left-color: var(--warn); background: var(--warn-bg); color: #b56d0a; }
.doc-flag.active { box-shadow: 0 0 0 2px rgba(239,68,68,.25); }

/* 右侧发现卡 */
.finding {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.finding:hover { box-shadow: var(--shadow); }
.finding.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,91,255,.1); }
.finding__label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: 700; margin-bottom: 8px;
}
.finding__label .icon { width: 15px; height: 15px; }
.finding--danger .finding__label { color: var(--danger); }
.finding--warn   .finding__label { color: var(--warn); }
.finding--info   .finding__label { color: var(--brand); }
.finding__body { font-size: var(--fs-sm); color: #59607080; color: #5a6172; line-height: 1.7; }
.finding__ref {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: var(--fs-xs);
}
.finding__ref-label { display:flex; align-items:center; gap:5px; color: var(--muted); margin-bottom: 4px; }
.finding__ref-link { color: var(--brand); font-weight: 600; }

/* ---------- 13. Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--header-h);
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.toolbar__group { display: flex; align-items: center; gap: 2px; }
.toolbar__divider { width: 1px; height: 22px; background: var(--border); margin: 0 8px; }
.toolbar__spacer { flex: 1; }
.tool-btn {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 34px; padding: 0 8px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  color: #4a5163; font-size: var(--fs-md); font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.tool-btn:hover { background: var(--hover); }
.tool-btn.active { background: var(--brand-soft); color: var(--brand); }
.tool-btn .icon { width: 17px; height: 17px; }

/* ---------- 14. Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 11px 18px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 15. Progress Steps ---------- */
.steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-strong);
  z-index: 0;
}
.step__dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  color: var(--muted);
  font-size: var(--fs-sm); font-weight: 700;
  position: relative; z-index: 1;
}
.step__label { margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.step.done .step__dot { background: var(--brand-gradient); border-color: transparent; color: #fff; }
.step.done:not(:last-child)::after { background: var(--brand); }
.step.active .step__dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px rgba(59,91,255,.12); }
.step.active .step__label { color: var(--brand); font-weight: 700; }

/* ---------- 16. Timeline 时间线 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before {
  content: ""; position: absolute; left: -26px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand);
}
.timeline-item.done::before { background: var(--brand); }
.timeline-item.muted::before { border-color: var(--border-strong); }
.timeline__time { font-size: var(--fs-xs); color: var(--muted); }
.timeline__title { font-weight: 600; color: var(--text-strong); margin: 2px 0 4px; }
.timeline__desc { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- 17. Kanban 看板 ---------- */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(268px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban__col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kanban__col-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: var(--fs-md); color: var(--text-strong);
  padding: 0 2px 4px;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  padding: 13px;
  cursor: grab;
  transition: box-shadow .15s, transform .1s;
}
.kanban-card:hover { box-shadow: var(--shadow); }
.kanban-card__title { font-weight: 600; font-size: var(--fs-md); margin-bottom: 8px; }
.kanban-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-gradient); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}

/* ---------- 18. Drawer 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(18,21,31,.34);
  opacity: 0; visibility: hidden;
  transition: opacity .2s;
  z-index: 90;
}
.drawer-mask.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 92vw;
  background: var(--surface);
  box-shadow: -12px 0 40px rgba(20,30,60,.16);
  transform: translateX(100%);
  transition: transform .24s cubic-bezier(.4,0,.2,1);
  z-index: 91;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.drawer__title { font-size: var(--fs-lg); font-weight: 700; }
.drawer__body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer__foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 19. Utilities ---------- */
.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card__value { font-size: 30px; font-weight: 800; color: var(--text-strong); line-height: 1.1; }
.stat-card__label { font-size: var(--fs-sm); color: var(--muted); }
.stat-card__trend { font-size: var(--fs-xs); font-weight: 600; }
.stat-card__trend.up { color: var(--ok); }
.stat-card__trend.down { color: var(--danger); }

.divider { height: 1px; background: var(--border); border: none; margin: 20px 0; }
.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty .icon { width: 48px; height: 48px; color: var(--muted-2); margin-bottom: 12px; }

.list-user {
  display: flex; align-items: center; gap: 10px;
}
.list-user .avatar { width: 34px; height: 34px; font-size: 13px; }
.list-user__name { font-weight: 600; font-size: var(--fs-md); }
.list-user__sub { font-size: var(--fs-xs); color: var(--muted); }

/* 间距/排版工具类 */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-brand { color: var(--brand); }
.text-ok { color: var(--ok); } .text-warn { color: var(--warn); } .text-danger { color: var(--danger); }
.w-full { width: 100%; }

/* 工具栏容器(列表页筛选条) */
.filterbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 22px;
}
.filterbar .searchbox { flex: 1; min-width: 220px; }
.filterbar .field { flex: none; }

/* 响应式收窄 */
@media (max-width: 1100px) {
  .review { grid-template-columns: 200px 1fr; }
  .review__panel { display: none; }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .main__inner { padding: 20px 18px 40px; }
  .review { grid-template-columns: 1fr; }
  .review__toc { display: none; }
}

.mobile-nav-trigger,
.mobile-nav-close,
.mobile-nav-scrim { display: none; }

@media (max-width: 820px) {
  .mobile-nav-trigger { display: inline-flex; }
  .sidebar.mobile-open .mobile-nav-close { display: inline-grid; margin-left: auto; }
  .sidebar.mobile-open {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1201;
    width: min(286px, 86vw);
    height: 100dvh;
    box-shadow: 18px 0 44px rgba(31, 36, 48, .18);
  }
  .mobile-nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 1200;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(24, 30, 42, .38);
  }
  body.mobile-nav-open { overflow: hidden; }
  body.mobile-nav-open .mobile-nav-scrim { display: block; }
}
