/* ============================================================
   贵州民航 · 采购文件智能审查与历史价格对标平台
   Enterprise UI Design Language · 进取 · 开拓 · 引领
   浅色主工作区 + 深色导航 + 蓝色关键交互 + 中性灰承载信息
   ============================================================ */

:root {
  /* ---- 品牌主色（取自标志：深海军蓝 / 亮蓝 / 橙）---- */
  --brand-600: #1461c6;       /* 主操作、选中状态、核心数据 */
  --brand-700: #0f4ca0;       /* Hover、强调按钮 */
  --brand-800: #0b3a82;       /* Active、深压态 */
  --brand-100: #e6effc;       /* 浅色选中背景 */
  --sky-500: #1e9ce8;         /* 大尺寸图形、图表线条 */
  --sky-700: #0c6fa8;         /* 小尺寸图标、状态文字 */
  --ember-600: #e0700f;       /* 标志橙：进展 / 强调，小面积使用 */
  --ember-100: #fdf1e3;

  /* ---- 深色结构色 ---- */
  --midnight-950: #07111f;
  --navy-900: #0b2242;
  --navy-800: #14355e;

  /* ---- 中性色（Canvas → Surface → Surface 2）---- */
  --canvas: #ffffff;
  --surface: #f5f7fa;
  --surface-2: #edf1f5;
  --ink: #101828;
  --ink-soft: #344054;
  --ink-faint: #667085;
  --border: #dde3ea;
  --border-strong: #c4cdd8;

  /* ---- 兼容别名：保持既有组件样式可用 ---- */
  --paper: var(--surface);
  --paper-raise: var(--canvas);
  --paper-inset: var(--surface-2);
  --hairline: var(--border);
  --hairline-strong: var(--border-strong);
  --accent: var(--brand-600);
  --accent-strong: var(--brand-700);
  --accent-soft: var(--brand-100);
  --seal: #d64545;            /* 危险 / 不可忽略的结论 */
  --seal-soft: #fcecec;
  --gold: var(--ember-600);

  /* ---- 风险与状态色 ---- */
  --risk-critical: #d64545;
  --risk-critical-bg: #fcecec;
  --risk-high: #c2701a;
  --risk-high-bg: #fbf1e3;
  --risk-mid: #8f7415;
  --risk-mid-bg: #f7f3e1;
  --risk-low: #667085;
  --risk-low-bg: #edf1f5;
  --ok: #149b68;
  --ok-bg: #e4f5ee;
  --warn: #d98a00;

  /* ---- 图表分类色板 ---- */
  --chart-1: #1461c6;
  --chart-2: #0e9888;
  --chart-3: #7a5af8;
  --chart-4: #d98a00;
  --chart-5: #c2508d;
  --chart-6: #98a2b3;

  /* ---- 字体：仅使用系统字体 ---- */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: var(--sans);
  --num: var(--sans);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- 形状与层级 ---- */
  --radius: 10px;             /* 普通卡片 */
  --radius-sm: 6px;           /* 按钮、输入框 */
  --radius-tag: 4px;          /* 标签 */
  --radius-pop: 12px;         /* 浮层、对话框 */
  --shadow-pop: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-overlay: 0 8px 24px rgba(16, 24, 40, 0.12);
  --shadow-card: none;

  /* ---- 动效 ---- */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-micro: 140ms;
  --dur-switch: 200ms;
  --dur-page: 280ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--brand-100); }

a { color: var(--brand-600); text-decoration: none; }

a:hover { color: var(--brand-700); }

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 金额 / 计量 / 百分比 / 表列数字：等宽数字 */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 编码 / ID / 规则号 / 模板号：等宽，便于扫读比对 */
.code {
  font-family: var(--mono);
  font-size: 0.92em;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- 顶部导航 ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav.is-drawer-open {
  z-index: 200;
}

.site-nav__inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

/* 品牌标记：简形几何 SVG，主题色 currentColor → --accent */
.brand-seal,
.site-nav__seal {
  width: 24px;
  height: 24px;
  color: var(--brand-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
  background: transparent;
  line-height: 0;
}

.brand-seal svg,
.site-nav__seal svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-seal--lg {
  width: 36px;
  height: 36px;
}

.site-nav__seal { color: #fff; }

.brand-seal--muted {
  color: var(--ink-soft);
}

.site-nav__name { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; }
.site-nav__sub { font-size: 12px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.06em; }

.site-nav__links { display: flex; align-items: center; gap: 2px; flex: 1; }

.site-nav__link {
  position: relative;
  padding: 7px 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease);
}

.site-nav__link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.site-nav__link.is-active {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
}

.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -10px;
  height: 2px;
  background: var(--sky-500);
}

.site-nav__link.is-planned { color: rgba(255, 255, 255, 0.38); cursor: default; }
.site-nav__link.is-planned:hover { background: none; color: rgba(255, 255, 255, 0.38); }

.site-nav__link.is-planned .dot {
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  color: var(--gold);
  vertical-align: super;
}

.site-nav__role {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.site-nav__role-label {
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.site-nav__role-select {
  font-family: var(--sans);
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  max-width: 160px;
  cursor: pointer;
}

.site-nav__role-select option { color: var(--ink); background: var(--canvas); }

.site-nav__role-select:focus-visible {
  outline: 2px solid var(--sky-500);
  outline-offset: 2px;
}

.site-nav__drawer-role {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.site-nav__reset {
  display: block;
  width: 100%;
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  background: var(--canvas);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}

.site-nav__reset:hover {
  border-color: var(--seal);
  color: var(--seal);
}

.site-nav__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.site-nav__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 汉堡按钮 / 抽屉：桌面隐藏 */
.site-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin-left: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  flex-shrink: 0;
}

.site-nav__toggle-bar {
  display: block;
  height: 1.5px;
  width: 100%;
  background: #fff;
  border-radius: 1px;
  transition: transform var(--dur-switch) var(--ease), opacity var(--dur-switch) var(--ease);
}

.site-nav__toggle.is-open .site-nav__toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.site-nav__toggle.is-open .site-nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-nav__toggle.is-open .site-nav__toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.site-nav__backdrop {
  display: none;
}

.site-nav__drawer {
  display: none;
}

body.nav-drawer-open {
  overflow: hidden;
}

/* ---------- 布局工具类 ---------- */

.page { max-width: 1480px; margin: 0 auto; padding: 24px 24px 56px; }

@media (min-width: 1440px) {
  .page { padding: 24px 32px 56px; }
}

.card {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hairline-b { border-bottom: 1px solid var(--hairline); }

/* ---------- 页头 ---------- */

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

.page-head__crumb { font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; }
.page-head__crumb b { color: var(--ink-soft); font-weight: 400; }

.page-head__title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-head__meta { display: flex; gap: 20px; margin-top: 8px; font-size: 13px; color: var(--ink-faint); flex-wrap: wrap; }
.page-head__meta b { font-weight: 600; color: var(--ink-soft); }
.page-head__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- 徽章 / 标签 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-tag);
  border: 1px solid;
  line-height: 1.5;
  white-space: nowrap;
}

.tag--critical { color: #b02a2a;              background: var(--risk-critical-bg); border-color: rgba(214, 69, 69, 0.32); }
.tag--high     { color: var(--risk-high);     background: var(--risk-high-bg);     border-color: rgba(194, 112, 26, 0.32); }
.tag--mid      { color: var(--risk-mid);      background: var(--risk-mid-bg);      border-color: rgba(143, 116, 21, 0.32); }
.tag--low      { color: var(--risk-low);      background: var(--risk-low-bg);      border-color: var(--border-strong); }
.tag--ok       { color: #0f7d54;              background: var(--ok-bg);            border-color: rgba(20, 155, 104, 0.32); }
.tag--accent   { color: var(--brand-700);     background: var(--accent-soft);      border-color: rgba(20, 97, 198, 0.28); }
.tag--plain    { color: var(--ink-soft);      background: var(--surface-2);        border-color: var(--border); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--canvas);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--dur-micro) var(--ease), border-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}

.btn:hover { background: var(--surface); color: var(--ink); }
.btn:active { background: var(--surface-2); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

.btn--primary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn--primary:active { background: var(--brand-800); border-color: var(--brand-800); }

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

.btn--sm { font-size: 12.5px; min-height: 36px; padding: 0 12px; }

/* ---------- 表格 ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.45; }

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-2);
  white-space: nowrap;
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table tbody tr { transition: background var(--dur-micro) var(--ease); }
.table tbody tr:hover { background: var(--surface); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- 置信度 ---------- */

.conf { display: inline-flex; align-items: center; gap: 7px; }

.conf__bar {
  width: 44px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.conf__fill { height: 100%; border-radius: 2px; background: var(--brand-600); transition: width var(--dur-page) var(--ease); }
.conf__fill.is-warn { background: var(--risk-high); }
.conf__val { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
}

.site-footer__link {
  color: var(--ink-faint);
}

.site-footer__link:hover {
  color: var(--brand-600);
}

.site-footer__link[aria-current="page"] {
  color: var(--brand-700);
  font-weight: 600;
}

/* ---------- AI 辅助面板 ---------- */

.ai-panel {
  margin-top: 18px;
  margin-bottom: 22px;
  overflow: hidden;
}

.ai-panel[hidden] { display: none !important; }

.ai-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.ai-panel__head::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand-600);
  flex-shrink: 0;
}

.ai-panel__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.ai-panel__status {
  font-size: 12px;
  color: var(--ink-faint);
}

.ai-panel__head .grow { flex: 1; }

.ai-panel__key-toggle {
  flex-shrink: 0;
}

.ai-panel__key-toggle.is-custom {
  border-color: rgba(20, 97, 198, 0.35);
  color: var(--brand-700);
  background: var(--accent-soft);
}

.ai-panel__key-toggle.is-open {
  border-color: var(--brand-600);
  color: var(--brand-700);
}

.ai-panel__key {
  display: flex;
  align-items: flex-start;
  gap: 10px 14px;
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}

.ai-panel__key[hidden] { display: none !important; }

.ai-panel__key-main {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.ai-panel__key-input {
  width: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  min-height: 36px;
}

.ai-panel__key-input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(20, 97, 198, 0.14);
}

.ai-panel__key-input::placeholder {
  font-family: var(--sans);
  color: var(--ink-faint);
}

.ai-panel__key-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.ai-panel__key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 18px;
}

.ai-panel__focus {
  display: flex;
  align-items: flex-start;
  gap: 10px 12px;
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  flex-wrap: wrap;
}

.ai-panel__focus-label {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 9px;
}

.ai-panel__focus-main {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-panel__focus-input {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  min-height: 36px;
}

.ai-panel__focus-input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(20, 97, 198, 0.14);
}

.ai-panel__focus-input::placeholder {
  color: var(--ink-faint);
}

.ai-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-chip {
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: var(--radius-tag);
  border: 1px solid var(--border-strong);
  background: var(--canvas);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease);
  line-height: 1.5;
}

.ai-chip:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
}

.ai-chip.is-on {
  border-color: rgba(20, 97, 198, 0.45);
  background: var(--accent-soft);
  color: var(--brand-700);
  font-weight: 600;
}

.ai-panel__focus > .btn {
  margin-top: 2px;
  flex-shrink: 0;
}

.ai-panel__body {
  padding: 16px 20px 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
  text-align: left;
  min-height: 72px;
}

.ai-panel__text p {
  margin: 0 0 0.75em;
}

.ai-panel__text p:last-child { margin-bottom: 0; }

.ai-panel__text .ai-md__h,
.ai-panel__text h2,
.ai-panel__text h3,
.ai-panel__text h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 1em 0 0.45em;
  line-height: 1.4;
}

.ai-panel__text .ai-md__h:first-child,
.ai-panel__text h2:first-child,
.ai-panel__text h3:first-child,
.ai-panel__text h4:first-child {
  margin-top: 0;
}

.ai-panel__text ul,
.ai-panel__text ol {
  margin: 0.25em 0 0.85em;
  padding-left: 1.35em;
  text-align: left;
}

.ai-panel__text li {
  margin: 0.25em 0;
  padding-left: 0.15em;
  line-height: 1.65;
}

.ai-panel__text li::marker {
  color: var(--ink-faint);
}

.ai-panel__text strong {
  color: var(--ink);
  font-weight: 600;
}

.ai-panel__text code.code {
  font-size: 0.92em;
}

.ai-panel__placeholder {
  color: var(--ink-faint);
  text-align: center;
  padding: 12px 0;
}

.ai-panel__placeholder--err { color: var(--seal); text-align: left; }

.ai-panel.is-loading .ai-panel__body {
  background: linear-gradient(90deg, transparent, rgba(20, 97, 198, 0.05), transparent);
  background-size: 200% 100%;
  animation: ai-shimmer 1.2s ease infinite;
}

@keyframes ai-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.ai-panel__foot {
  padding: 0 20px 16px;
  font-size: 12px;
  color: var(--ink-faint);
}

.ai-panel__cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--brand-600);
  opacity: 0.75;
  animation: ai-cursor-blink 0.9s step-end infinite;
}

@keyframes ai-cursor-blink {
  50% { opacity: 0; }
}

.ai-panel.is-streaming .ai-panel__body {
  min-height: 96px;
}

/* ---------- 小工具 ---------- */

.muted { color: var(--ink-faint); }
.soft { color: var(--ink-soft); }
.seal-text { color: var(--seal); }
.nowrap { white-space: nowrap; }

/* 航向母题：横向方向条，表达“正在推进” */
.lead-bar {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-600), var(--sky-500));
}

.divider-v { width: 1px; align-self: stretch; background: var(--border); }

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-tag);
  padding: 0 5px;
  color: var(--ink-soft);
  background: var(--canvas);
}

button.kbd--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  margin: 0 1px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  color: var(--ink-soft);
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-tag);
  transition: border-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease), background var(--dur-micro) var(--ease);
}

button.kbd--btn:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
  background: var(--accent-soft);
}

button.kbd--btn:active {
  border-bottom-width: 1px;
  transform: translateY(1px);
}

button.kbd--btn:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

button.kbd--btn:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* 淡入：短促、有方向 */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.rise { animation: rise-in var(--dur-page) var(--ease) both; }
.rise-1 { animation-delay: 0.04s; }
.rise-2 { animation-delay: 0.08s; }
.rise-3 { animation-delay: 0.12s; }

/* ---------- 状态标签 ---------- */

.tag--status-review { color: var(--brand-700); background: var(--accent-soft); border-color: rgba(20, 97, 198, 0.28); }
.tag--status-parsing { color: var(--risk-high); background: var(--risk-high-bg); border-color: rgba(194, 112, 26, 0.32); }
.tag--status-wait { color: var(--risk-mid); background: var(--risk-mid-bg); border-color: rgba(143, 116, 21, 0.32); }
.tag--status-done { color: #0f7d54; background: var(--ok-bg); border-color: rgba(20, 155, 104, 0.32); }

/* ---------- 表单控件 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

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

.field select,
.field input {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-height: 36px;
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(20, 97, 198, 0.14);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.filter-bar__actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* Collapsible filters (mobile-first toggle; always open on desktop) */
.filter-panel { border-bottom: 1px solid var(--border); }

.filter-panel__toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 16px;
  border: none;
  background: var(--surface-2);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.filter-panel__toggle-meta {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-faint);
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel__chevron {
  font-size: 12px;
  color: var(--ink-faint);
  transition: transform var(--dur-micro) var(--ease);
}

.filter-panel.is-open .filter-panel__chevron {
  transform: rotate(180deg);
}

.filter-panel__body.filter-bar {
  border-bottom: none;
}

.section-card { margin-bottom: 20px; overflow: hidden; }

.section-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.section-card__title { font-size: 18px; font-weight: 600; line-height: 1.4; }
.section-card__head .grow { flex: 1; }

.section-card__body { padding: 16px 20px 20px; }

.empty-hint {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.table-wrap[data-scroll-hint]::after {
  content: none;
}

/* Mobile card list (shown under 900px when paired with .table-wrap--desktop) */
.mobile-card-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 16px;
}

.mobile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--canvas);
}

.mobile-card.is-excluded {
  opacity: 0.55;
}

.mobile-card.is-excluded .mobile-card__title {
  text-decoration: line-through;
}

.mobile-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 10px;
  margin-bottom: 6px;
}

.mobile-card__title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
}

.mobile-card__code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
}

.mobile-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.mobile-card__meta b {
  font-weight: 600;
  color: var(--ink);
}

.mobile-card__note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--risk-high);
  line-height: 1.45;
}

.mobile-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mobile-card__actions .btn {
  flex: 1 1 auto;
  min-width: 96px;
}

.row-link { color: var(--ink); font-weight: 600; }
.row-link:hover { color: var(--brand-700); }

.pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.pill-tab {
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 12px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}

.pill-tab:hover { color: var(--ink); background: var(--canvas); }
.pill-tab.is-on {
  background: var(--canvas);
  border-color: var(--border-strong);
  color: var(--brand-700);
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--navy-900);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-switch) var(--ease), transform var(--dur-switch) var(--ease);
  z-index: 1200;
  box-shadow: var(--shadow-overlay);
}

.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 移动端 / 窄屏 ---------- */

@media (max-width: 900px) {
  .page {
    padding: 16px 14px 48px;
  }

  .page-head__title { font-size: 22px; }

  /* 导航：汉堡 + 抽屉菜单 */
  .site-nav__inner {
    height: 52px;
    padding: 0 12px;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .site-nav__brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    align-items: center;
  }

  .site-nav__name {
    font-size: 15px;
    white-space: nowrap;
  }

  .site-nav__sub {
    display: none;
  }

  .site-nav__links--desktop {
    display: none;
  }

  .site-nav__user {
    display: none;
  }

  .site-nav__toggle {
    display: inline-flex;
    margin-left: 0;
    min-width: 44px;
    min-height: 44px;
  }

  .site-nav__drawer-close {
    min-width: 44px;
    min-height: 44px;
  }

  /* 遮罩 / 抽屉挂在 body 上，不依赖 .site-nav 子选择器 */
  .site-nav__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 240;
    background: rgba(7, 17, 31, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.nav-drawer-open .site-nav__backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav__backdrop[hidden] {
    display: none !important;
  }

  .site-nav__drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 250;
    width: min(300px, 86vw);
    height: 100%;
    max-height: 100dvh;
    /* 实色底，避免任何半透明合成 */
    background-color: #ffffff;
    background-color: var(--canvas);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-overlay);
    transform: translateX(100%);
    transition: transform var(--dur-page) var(--ease);
    padding: 0 0 env(safe-area-inset-bottom, 0);
    isolation: isolate;
  }

  body.nav-drawer-open .site-nav__drawer {
    transform: translateX(0);
  }

  .site-nav__drawer[hidden] {
    display: none !important;
  }

  body.nav-drawer-open .site-nav__drawer[hidden] {
    display: flex !important;
  }

  .site-nav__drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background-color: #edf1f5;
    background-color: var(--surface-2);
    flex-shrink: 0;
  }

  .site-nav__drawer-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
  }

  .site-nav__drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: var(--ink-soft);
    cursor: pointer;
    border-radius: var(--radius-sm);
  }

  .site-nav__drawer-close:hover {
    background: var(--surface);
    color: var(--ink);
  }

  .site-nav__drawer-links {
    display: flex;
    flex-direction: column;
    padding: 10px 10px 16px;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
    background-color: #ffffff;
    background-color: var(--canvas);
  }

  .site-nav__link--drawer {
    display: block;
    padding: 11px 12px;
    font-size: 14px;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    white-space: normal;
  }

  .site-nav__link--drawer:hover {
    background: var(--surface);
    color: var(--ink);
  }

  .site-nav__link--drawer.is-active {
    color: var(--brand-700);
    font-weight: 600;
    background: var(--accent-soft);
    box-shadow: inset 3px 0 0 var(--brand-600);
  }

  .site-nav__link--drawer.is-active::after {
    display: none;
  }

  .site-nav__drawer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--ink-soft);
    background-color: #ffffff;
    background-color: var(--canvas);
    flex-shrink: 0;
  }

  .site-nav__drawer-foot {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 16px 18px;
    border-top: 1px solid var(--border);
    background-color: #edf1f5;
    background-color: var(--surface-2);
    flex-shrink: 0;
  }

  .site-nav__drawer-foot a {
    font-size: 12.5px;
    color: var(--ink-faint);
    padding: 6px 0;
  }

  .site-nav__drawer-foot a:hover {
    color: var(--brand-600);
  }

  /* 页头 */
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-head__title {
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-head__meta {
    gap: 8px 14px;
    font-size: 12.5px;
  }

  .page-head__actions {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .page-head__actions .btn {
    flex: 1 1 calc(50% - 4px);
    text-align: center;
    justify-content: center;
    min-height: 44px;
  }

  .page-head__actions .btn--primary {
    flex: 1 1 100%;
  }

  /* Collapsible filters on mobile */
  .filter-panel__toggle {
    display: flex;
  }

  .filter-panel:not(.is-open) .filter-panel__body {
    display: none;
  }

  .filter-panel.is-open .filter-panel__body {
    display: flex;
  }

  .filter-bar__actions {
    margin-left: 0;
    width: 100%;
  }

  .filter-bar__actions .btn {
    flex: 1;
    min-height: 44px;
  }

  /* Desktop tables → card lists on mobile */
  .table-wrap--desktop {
    display: none;
  }

  .mobile-card-list {
    display: flex;
  }

  /* 表格横向滚动（未切换为卡片的表） */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0 0 8px;
    position: relative;
  }

  .table-wrap[data-scroll-hint]::before {
    content: attr(data-scroll-hint);
    display: block;
    font-size: 11.5px;
    color: var(--ink-faint);
    padding: 8px 14px 0;
  }

  .table {
    min-width: 640px;
    font-size: 12.5px;
  }

  .table th,
  .table td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .table td:not(.num):not(.nowrap):not(.code) {
    white-space: normal;
    min-width: 100px;
    max-width: 220px;
  }

  .pill-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 6px;
    padding: 10px 12px;
  }

  .pill-tab {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .btn {
    min-height: 44px;
  }

  .btn--sm {
    min-height: 40px;
  }

  button.kbd--btn {
    min-width: 40px;
    min-height: 40px;
  }

  .field select,
  .field input {
    min-height: 44px;
  }

  /* AI 面板 */
  .ai-panel__focus {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-panel__focus-label {
    margin-top: 0;
  }

  .ai-panel__focus > .btn {
    margin-top: 0;
    width: 100%;
  }

  .ai-panel__key {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-panel__key-actions {
    margin-top: 0;
  }

  .ai-panel__key-actions .btn {
    flex: 1;
  }

  .ai-panel__head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .ai-panel__body {
    padding: 14px 14px 16px;
  }

  .site-footer {
    padding: 18px 14px 28px;
    font-size: 11.5px;
    line-height: 1.7;
  }

  .card {
    max-width: 100%;
  }

  .btn {
    white-space: nowrap;
  }

  .pkg-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    font-size: 13.5px;
  }

  .toast {
    left: 12px;
    right: 12px;
    transform: translateY(8px);
    width: auto;
    text-align: center;
  }

  .toast.is-show {
    transform: translateY(0);
  }
}

.pkg-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 20px;
  font-size: 13.5px;
}

@media (max-width: 480px) {
  .page-head__title {
    font-size: 20px;
  }

  .site-nav__name {
    font-size: 14.5px;
  }

  .page-head__actions .btn {
    flex: 1 1 100%;
  }

  .pkg-detail-grid {
    grid-template-columns: 1fr;
  }

  .ai-panel__chips {
    gap: 5px;
  }

  .ai-chip {
    font-size: 11.5px;
    padding: 6px 12px;
    min-height: 36px;
  }

  .mobile-card__actions .btn {
    flex: 1 1 100%;
  }
}
