/* ============================================================================
   政启汇科技 · 企业政策智配智能体
   视觉方向：红白（red & white editorial）
   —— 纯白承纸，正红作印，墨黑正文，灰阶做精密刻度。
   —— 只用一种品牌色：朱红。其余全部交给白、灰、极细的分隔线。
   —— 质感来自三件事：极窄的明度阶梯、极细的分隔线、极稳的缓动节奏。
   —— 动效原则：整页一次性编排入场，组件内的微交互只做 120–240ms 的收放。
   ========================================================================= */

:root {
  /* 底面与墨色 */
  --paper: #f5f2f1;
  --paper-2: #efecea;
  --paper-3: #e7e2e0;
  --surface: #ffffff;
  --surface-2: #fcfbfa;
  --surface-3: #f7f4f3;

  --ink: #1a1a1b;
  --ink-2: #3b393a;
  --ink-3: #575455;
  --muted: #7a7574;
  --faint: #9d9897;

  --line: #e9e4e1;
  --line-2: #f1edeb;
  --line-3: #f7f4f3;

  /* 品牌色：与 LOGO 印章一致的正红 */
  --red: #b3261e;
  --red-deep: #8a1b15;
  --red-bright: #cc342a;
  --red-soft: #fdeeec;
  --red-glow: rgba(179, 38, 30, 0.14);

  /* 中性深色（原藏青降级为暖灰，保留变量名以兼容既有规则） */
  --navy: #2b2625;
  --navy-2: #3a3331;
  --navy-3: #4a423f;

  /* 赭金（仅用于「待补齐」这类语义强调，不做装饰色） */
  --gold: #a2622a;
  --gold-soft: #fbf0e4;
  --gold-line: #ecdcc8;

  --green: #1d6a4b;
  --green-soft: #e7f1ea;
  --green-line: #cfe2d5;

  --amber: #8a5a12;
  --amber-soft: #fbf1da;
  --amber-line: #ecdcb9;

  --blue: #2a587f;
  --blue-soft: #e8eff6;
  --blue-line: #d2e0ec;

  /* 尺寸与阴影 */
  --radius-lg: 22px;
  --radius: 15px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --shadow-xs: 0 1px 2px rgba(25, 28, 33, 0.04);
  --shadow-sm: 0 1px 2px rgba(25, 28, 33, 0.04), 0 6px 14px -10px rgba(25, 28, 33, 0.18);
  --shadow: 0 1px 2px rgba(25, 28, 33, 0.05), 0 10px 24px -18px rgba(25, 28, 33, 0.28);
  --shadow-md: 0 2px 6px rgba(25, 28, 33, 0.06), 0 18px 40px -24px rgba(25, 28, 33, 0.34);
  --shadow-lg: 0 4px 12px rgba(25, 28, 33, 0.08), 0 32px 64px -32px rgba(25, 28, 33, 0.42);
  --shadow-ink: 0 18px 40px -26px rgba(26, 26, 27, 0.5);

  /* 节奏 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.64, 1);
  --dur-1: 140ms;
  --dur-2: 220ms;
  --dur-3: 340ms;
  --dur-4: 520ms;

  /* 字体：中文走系统高质量黑体，数字与英文走衬线（报表气质） */
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
    "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman",
    "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

/* 纸面微纹理：两层极淡的径向渐变，避免大色块的塑料感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1200px 600px at 12% -10%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(179, 38, 30, 0.05), transparent 65%);
}

[hidden],
.hidden {
  display: none !important;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

strong,
b {
  font-weight: 600;
}

::selection {
  background: rgba(179, 38, 30, 0.16);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid rgba(179, 38, 30, 0.42);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 滚动条：细、哑光、悬停才显色 */
* {
  scrollbar-width: thin;
  scrollbar-color: #d9d1c1 transparent;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d9d1c1;
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
  transition: background var(--dur-2) var(--ease);
}

::-webkit-scrollbar-thumb:hover {
  background: #c6bca8;
  background-clip: content-box;
}

/* ============================ 应用骨架 ============================ */

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---------------- 侧栏 ---------------- */
.sidebar {
  width: 236px;
  flex: 0 0 236px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 24px;
  color: var(--ink-2);
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 30;
  overflow: hidden;
}

/* 侧栏顶端一道正红细线，与 LOGO 印章同位呼应 */
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-bright) 38%, rgba(179, 38, 30, 0) 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 22px;
}

/* 用户提供的印章 LOGO：原样呈现，不加底色装饰 */
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  letter-spacing: 0;
}

.brand-mark img,
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.brand-text strong {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-text span {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 -4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 13.5px;
  color: #6d6867;
  letter-spacing: 0.01em;
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  opacity: 0.9;
  transition: transform var(--dur-2) var(--ease-spring);
}

.nav-item:hover {
  color: var(--red);
  background: var(--red-soft);
}

.nav-item:hover svg {
  transform: translateY(-1px) scale(1.04);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(100deg, var(--red) 0%, var(--red-bright) 100%);
  box-shadow: 0 10px 22px -14px rgba(179, 38, 30, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nav-item.active::before {
  content: none;
}

@keyframes bar-draw {
  from {
    height: 4px;
    opacity: 0;
  }
  to {
    height: 18px;
    opacity: 1;
  }
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  background: var(--red);
  box-shadow: 0 4px 10px -6px rgba(179, 38, 30, 0.9);
}

.nav-item.active .nav-badge {
  background: #fff;
  color: var(--red);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.side-stat {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.side-note {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--faint);
}

/* ---------------- 主区域 ---------------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 32px 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.84));
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 12px 24px -24px rgba(26, 26, 27, 0.35);
}

.topbar-left h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* 页面滚动后顶栏收紧投影，像纸页被抬起一角 */
.topbar.is-scrolled {
  border-bottom-color: var(--paper-3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 16px 28px -26px rgba(26, 26, 27, 0.4);
}

.topbar-left p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  color: var(--ink-2);
  max-width: 320px;
  animation: pill-in var(--dur-3) var(--ease) both;
}

@keyframes pill-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.client-pill .dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 106, 75, 0.14);
}

.client-pill #clientName {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-pill em {
  font-style: normal;
  padding-left: 9px;
  border-left: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 视图容器与入场编排 ---------------- */
.view {
  padding: 24px 32px 64px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

/* 整页一次性编排：仅在路由切换时（.view.anim）播放，筛选项内部重绘不重复入场 */
.view.anim > * {
  animation: rise var(--dur-4) var(--ease) both;
}

.view.anim > *:nth-child(1) { animation-delay: 0ms; }
.view.anim > *:nth-child(2) { animation-delay: 45ms; }
.view.anim > *:nth-child(3) { animation-delay: 90ms; }
.view.anim > *:nth-child(4) { animation-delay: 130ms; }
.view.anim > *:nth-child(5) { animation-delay: 165ms; }
.view.anim > *:nth-child(6) { animation-delay: 195ms; }
.view.anim > *:nth-child(7) { animation-delay: 220ms; }
.view.anim > *:nth-child(n + 8) { animation-delay: 240ms; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.card + .card {
  margin-top: 16px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.card-head h2,
.card-head h3 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.45;
}

.card-head p {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ============================ 按钮 ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease),
    background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
  will-change: transform;
}

.btn:active {
  transform: translateY(1px) scale(0.988);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(170deg, var(--red-bright), var(--red) 58%, var(--red-deep));
  box-shadow: 0 10px 22px -14px rgba(179, 38, 30, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -16px rgba(179, 38, 30, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn.ghost {
  color: var(--ink-2);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}

.btn.ghost:hover {
  border-color: #cfc6b4;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn.quiet {
  color: var(--muted);
  background: transparent;
}

.btn.quiet:hover {
  color: var(--red);
  background: rgba(179, 38, 30, 0.06);
}

.btn.danger {
  color: var(--red-deep);
  border-color: #e8cbc6;
  background: #fffdfc;
}

.btn.danger:hover {
  background: var(--red-soft);
  border-color: #dfb3ab;
}

.btn.sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn.tiny {
  padding: 3px 9px;
  font-size: 11.5px;
  border-radius: 6px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

/* ============================ 徽标 ============================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

.badge.eligible {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green-line);
}

.badge.held {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: var(--blue-line);
}

.badge.gap {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: var(--amber-line);
}

.badge.unknown {
  color: var(--muted);
  background: var(--surface-3);
  border-color: var(--line-2);
}

.badge.ineligible {
  color: var(--red-deep);
  background: var(--red-soft);
  border-color: #ecd0ca;
}

.badge.line {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-2);
}

.badge.level {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink-3);
  font-weight: 400;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

/* ============================ 标签页 ============================ */

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--paper-2);
  box-shadow: inset 0 1px 2px rgba(25, 28, 33, 0.04);
}

.tabs button {
  position: relative;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease);
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button.active {
  color: var(--ink);
  font-weight: 600;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(25, 28, 33, 0.08), 0 6px 14px -12px rgba(25, 28, 33, 0.5);
}

.tabs button em {
  font-style: normal;
  margin-left: 5px;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.tabs button.active em {
  color: var(--red);
}

.page-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-tabs .tabs {
  background: var(--surface);
  border-color: var(--line);
}

/* ============================ 表单 ============================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.field > label b {
  color: var(--red);
  margin-left: 2px;
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 1px rgba(25, 28, 33, 0.03);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
    background var(--dur-2) var(--ease);
  appearance: none;
}

select {
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, #8d8577 50%),
    linear-gradient(135deg, #8d8577 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

input::placeholder,
textarea::placeholder {
  color: #b3b7be;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #d6cebd;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #c8a99f;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.09), inset 0 1px 1px rgba(25, 28, 33, 0.02);
  background: #fff;
}

input[type="date"] {
  min-height: 37px;
  font-variant-numeric: tabular-nums;
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  accent-color: var(--red);
  cursor: pointer;
}

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

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

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

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

.chip {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-3);
  cursor: pointer;
  transition: all var(--dur-2) var(--ease);
}

.chip:hover {
  border-color: #cbb3a9;
  color: var(--red);
  transform: translateY(-1px);
}

.chip.on {
  color: var(--red-deep);
  background: var(--red-soft);
  border-color: #e6c2ba;
  box-shadow: inset 0 0 0 1px rgba(179, 38, 30, 0.08);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line-2);
}

/* ============================ 统计卡 ============================ */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  --accent: var(--red);
  --accent-ink: var(--red-deep);
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease);
}

.stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 55%, #fff), var(--accent));
  opacity: 0.85;
}

/* 卡片内极淡的角部光晕，制造「纸面微凹」的高级感 */
.stat-card::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 7%, transparent), transparent 68%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #d9d1c0;
  box-shadow: var(--shadow-md);
}

.stat-card .k {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.stat-card .v {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums lining-nums;
}

.stat-card .v small {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}

.stat-card .d {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
}

.stat-card.green {
  --accent: var(--green);
  --accent-ink: #276b4f;
}

.stat-card.gold {
  --accent: var(--gold);
  --accent-ink: #8a5a1f;
}

.stat-card.blue {
  --accent: var(--blue);
  --accent-ink: #3a6382;
}

/* 行内统计（报告/抽屉里的小指标） */
.stat-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.stat-inline > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat-inline b {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.stat-inline span {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ============================ 客户画像 ============================ */

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.paste-box {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-sm);
}

.paste-box textarea {
  min-height: 88px;
  background: var(--surface);
}

.paste-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.hit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.hit {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  animation: hit-in var(--dur-2) var(--ease-spring) both;
}

.hit.miss {
  color: var(--muted);
  background: var(--surface-3);
  border-color: var(--line-2);
}

@keyframes hit-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

.form-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.form-section h3::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, #c9564a, var(--red));
}

/* 财务三年数据：网格布局（历史上为避免 Chromium 解析输入框表格插入游离逗号） */
.fin-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fin-head,
.fin-row {
  display: grid;
  grid-template-columns: 58px repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.fin-head span {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.fin-year {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.fin-row input {
  padding: 7px 9px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* 右列面板 */
.side-panel {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.completeness {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ring {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.ring circle {
  fill: none;
  stroke-width: 7;
}

.ring .bg {
  stroke: var(--line-2);
}

.ring .fg {
  stroke: var(--red);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset var(--dur-4) var(--ease);
}

.ring text {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}

.missing-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  font-size: 12.5px;
  color: var(--ink-2);
}

.missing-list li {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.missing-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--amber);
  transform: translateY(-2px);
}

.missing-list li.ok::before {
  background: var(--green);
}

.sample-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sample-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--dur-2) var(--ease);
}

.sample-item:hover {
  border-color: #d2bcae;
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.sample-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sample-item span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ============================ 智能匹配 ============================ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .spacer {
  flex: 1;
}

.toolbar input[type="search"] {
  width: 220px;
}

.toolbar select {
  width: auto;
  min-width: 118px;
}

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

.pcard {
  --accent: var(--amber);
  --accent-line: rgba(172, 133, 68, 0.32);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease);
}

/* 卡片入场：同行错峰，像被风依次掀开（只随整页入场播放） */
.view.anim .match-list > .pcard {
  animation: rise var(--dur-4) var(--ease) both;
}

.view.anim .match-list > .pcard:nth-child(3n + 1) { animation-delay: 40ms; }
.view.anim .match-list > .pcard:nth-child(3n + 2) { animation-delay: 80ms; }
.view.anim .match-list > .pcard:nth-child(3n + 3) { animation-delay: 120ms; }

.pcard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 45%, #fff), var(--accent));
}

.pcard::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px 140px at 100% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease);
  pointer-events: none;
}

.pcard:hover {
  transform: translateY(-3px);
  border-color: #d6cfc0;
  box-shadow: var(--shadow-md);
}

.pcard:hover::after {
  opacity: 1;
}

.pcard.v-eligible {
  --accent: #2c7a55;
}

.pcard.v-gap {
  --accent: #b58733;
}

.pcard.v-held {
  --accent: #2f6a9c;
}

.pcard.v-unknown {
  --accent: #9aa1ac;
}

.pcard.v-ineligible {
  --accent: #c08880;
}

.pcard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pcard-top h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.pcard .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.pcard .benefit {
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}

.pcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--muted);
}

.score-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.score-bar {
  position: relative;
  width: 54px;
  height: 4px;
  border-radius: 4px;
  background: var(--line-2);
  overflow: hidden;
}

.score-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, #fff), var(--accent));
  animation: grow-x var(--dur-4) var(--ease) both;
  transform-origin: left center;
}

@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
}

.gap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gap-tag {
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

/* ============================ 抽屉 ============================ */

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(12, 22, 34, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: mask-in var(--dur-3) var(--ease) both;
}

@keyframes mask-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: min(760px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: -30px 0 70px -40px rgba(12, 22, 34, 0.7), -1px 0 0 var(--line);
  animation: drawer-in var(--dur-3) var(--ease) both;
}

@keyframes drawer-in {
  from {
    transform: translateX(28px) scale(0.996);
    opacity: 0;
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px 16px;
  background: linear-gradient(180deg, var(--surface), rgba(255, 255, 255, 0.86));
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: 0.01em;
}

.drawer-head .sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 20px 24px 48px;
}

/* 条件对照：用网格而不是 <table>，窄抽屉里三列也不会互相挤掉 */
.cond-table {
  display: flex;
  flex-direction: column;
  font-size: 12.6px;
}

.cond-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, 140px) minmax(56px, 96px);
  gap: 0 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}

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

.cond-row.cond-head {
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.cond-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.cond-item-body {
  flex: 1;
  min-width: 0;
}

.cond-val {
  padding-top: 1px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cond-val.expected {
  color: var(--muted);
}

.cond-mark {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.cond-mark.pass {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
}

.cond-mark.fail {
  color: var(--red-deep);
  background: var(--red-soft);
  border: 1px solid #ecd0ca;
}

.cond-mark.unknown {
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
}

.cond-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cond-label .txt {
  flex: 1;
  line-height: 1.6;
}

.cond-label .tag {
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}

.cond-detail {
  margin-top: 3px;
  font-size: 11.8px;
  color: var(--muted);
  line-height: 1.6;
}

.cond-detail.fail {
  color: var(--red-deep);
}

/* 补齐方案卡 */
.rem-card {
  position: relative;
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.rem-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--red-bright), var(--red));
}

.rem-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
}

.rem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.rem-meta span {
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--surface-3);
  border: 1px solid var(--line-3);
}

.rem-actions ol {
  padding-left: 18px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.78;
  color: var(--ink-2);
}

.rem-actions ol li::marker {
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.rem-tips {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--red-soft);
  border: 1px solid #f3d9d5;
}

/* 有序清单（材料/流程） */
.list-clean {
  display: flex;
  flex-direction: column;
  gap: 7px;
  list-style: none;
  font-size: 12.8px;
  color: var(--ink-2);
}

.list-clean li {
  display: flex;
  gap: 8px;
  line-height: 1.65;
}

.list-clean .idx {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}

/* ============================ 申报计划（甘特） ============================ */

.gantt {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gantt-scroll {
  overflow-x: auto;
}

.gantt-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.gantt-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 6px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: linear-gradient(180deg, #fbf9f4, var(--surface-3));
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.gantt-table th.rowhead {
  width: 232px;
  padding-left: 16px;
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 3;
  border-right: 1px solid var(--line);
}

.gantt-table td {
  position: relative;
  height: 42px;
  padding: 0;
  border-bottom: 1px solid var(--line-2);
}

.gantt-table tr:last-child td {
  border-bottom: 0;
}

.gantt-table td.rowhead {
  position: sticky;
  left: 0;
  z-index: 2;
  padding: 7px 14px 7px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  transition: background var(--dur-2) var(--ease);
}

.gantt-table tr:hover td.rowhead {
  background: var(--surface-2);
}

.rowhead .t {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.3px;
  line-height: 1.38;
  color: var(--ink);
}

.rowhead .s {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
}

.cell {
  border-left: 1px solid #f2eee4;
}

.cell.today {
  background: rgba(255, 246, 226, 0.66);
}

/* 条：用 clip-path 生长，文字不会被压扁 */
.bar {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 1px 2px rgba(25, 28, 33, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  animation: bar-grow var(--dur-4) var(--ease) both;
}

@keyframes bar-grow {
  from {
    clip-path: inset(0 100% 0 0 round 5px);
    opacity: 0.4;
  }
  to {
    clip-path: inset(0 0 0 0 round 5px);
    opacity: 1;
  }
}

.bar.submit {
  background: linear-gradient(180deg, #b54436, var(--red));
}

.bar.prepare {
  background: linear-gradient(180deg, #5c8cba, #4b7bab);
}

.bar.remediate {
  color: #4a3712;
  background: repeating-linear-gradient(45deg, #d2a763 0 6px, #c89a52 6px 12px);
}

.bar.beyond {
  color: #4d5560;
  background: #d5d9df;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fbf9f4, #f8f5ee);
  font-size: 11.5px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

/* 任务清单 */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease);
}

.action-item:hover {
  border-color: #d8d0bf;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.action-item .a-body {
  flex: 1;
  min-width: 0;
}

.action-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.action-item p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.action-item.done strong {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 500;
}

/* ============================ 表格 ============================ */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: linear-gradient(180deg, #fbf9f4, var(--surface-3));
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-2);
  transition: background var(--dur-2) var(--ease);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  cursor: pointer;
  transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.table tbody tr:hover td {
  background: var(--surface-2);
}

.table tbody tr:hover {
  box-shadow: inset 3px 0 0 rgba(179, 38, 30, 0.24);
}

.table td.nowrap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table .name {
  font-weight: 500;
  line-height: 1.45;
}

.table .sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.table td.num {
  font-family: var(--serif);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.table tr.inactive {
  color: var(--faint);
}

.table .actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.table .badge.level {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

/* ============================ 诊断报告 ============================ */

.report {
  max-width: 980px;
  margin: 0 auto;
  padding: 46px 52px 54px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

.report-head h1 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.report-head .meta {
  text-align: right;
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}

.report h2 {
  margin: 34px 0 14px;
  padding-left: 10px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-left: 3px solid var(--red);
}

.report h3 {
  margin: 20px 0 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.report p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-2);
}

.report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.3px;
}

.report th,
.report td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.report th {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface-3);
}

.report .kv {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 20px;
}

.report .kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  font-size: 12.5px;
  border-bottom: 1px dotted var(--line);
}

.report .kv > div > span {
  color: var(--muted);
  white-space: nowrap;
}

.report .kv > div > b {
  flex: 1;
  text-align: right;
  font-weight: 500;
}

.report .disclaimer {
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--muted);
}

/* ============================ 提示条 ============================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: #f6f8fb;
  background: linear-gradient(180deg, #253444, #18242f);
  box-shadow: 0 18px 40px -22px rgba(12, 20, 30, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translate(-50%, 16px) scale(0.98);
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-spring);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.toast.err {
  background: linear-gradient(180deg, #a03a2d, #7d231a);
  box-shadow: 0 18px 40px -22px rgba(125, 35, 26, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* 骨架屏 */
.skeleton {
  border-radius: 6px;
  background: linear-gradient(100deg, var(--surface-3) 30%, #fbf8f1 50%, var(--surface-3) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.3s var(--ease-in-out) infinite;
}

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

/* ============================ 工具类 ============================ */

.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; }
.mt24 { margin-top: 24px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; }

.progress-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.progress-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.progress-dots i.on {
  background: var(--red);
}

/* ============================ 客户台账 / 提醒 ============================ */

.rem-group + .rem-group {
  margin-top: 18px;
}

.rem-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
}

.rem-group-head h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.rem-group-head span {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rem-item {
  position: relative;
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease);
}

.rem-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
}

.rem-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: #d9d1c0;
}

.rem-item .body {
  flex: 1;
  min-width: 0;
}

.rem-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.rem-item p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.rem-item .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.rem-item .side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.rem-item .due {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.rem-item .days {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rem-item .days.late {
  color: var(--red-deep);
  font-weight: 500;
}

.rem-item .days.soon {
  color: #a4681f;
  font-weight: 500;
}

.rem-item.u-overdue {
  background: #fffbfa;
  border-color: #ecd6d0;
}

.rem-item.u-overdue::before {
  background: var(--red);
}

.rem-item.u-week::before {
  background: #c0803a;
}

.rem-item.u-month::before {
  background: var(--blue);
}

.rem-item.done {
  opacity: 0.55;
}

.rem-item.done strong {
  text-decoration: line-through;
  font-weight: 500;
}

/* ---------------- 批量初筛 ---------------- */

.drop-zone {
  padding: 26px 20px;
  text-align: center;
  border: 1.5px dashed #cfc7b6;
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}

.drop-zone:hover,
.drop-zone.drag {
  border-color: #c08a7c;
  background: var(--red-soft);
}

.drop-zone strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step-num {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(160deg, var(--red), var(--red-deep));
  box-shadow: 0 4px 10px -6px rgba(179, 38, 30, 0.8);
  font-variant-numeric: tabular-nums;
}

.step-head h2 {
  font-size: 14px;
  font-weight: 600;
}

.step-head p {
  font-size: 12px;
  color: var(--muted);
}

.preview-table {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

.preview-table th {
  position: sticky;
  top: 0;
  padding: 7px 10px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
}

.preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-2);
}

.col-flag {
  margin-left: 4px;
  font-size: 10.5px;
  color: var(--muted);
}

.col-flag.bad {
  color: var(--amber);
}

/* ---------------- 待审政策 / 抓取源 ---------------- */

.pending-item {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}

.pending-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: #d9d1c0;
}

.pending-item.adopted {
  border-left: 3px solid var(--green);
}

.pending-item.ignored {
  opacity: 0.55;
  border-left: 3px solid var(--faint);
}

.pending-item h4 {
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
}

.pending-item .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.pending-item .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}

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

.switch {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 21px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--line);
  border: 1px solid #dfd7c7;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(25, 28, 33, 0.24);
  transition: transform var(--dur-2) var(--ease-spring);
}

.switch.on {
  background: var(--green);
  border-color: var(--green);
}

.switch.on::after {
  transform: translateX(17px);
}

.source-row .info {
  flex: 1;
  min-width: 0;
}

.source-row .info strong {
  font-size: 13px;
  font-weight: 600;
}

.source-row .info p {
  font-size: 11.5px;
  color: var(--muted);
}

.source-row input[type="text"] {
  margin-top: 6px;
  padding: 6px 9px;
  font-size: 12px;
}

/* 内联提示 */
.inline-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #6f5a29;
  background: var(--red-soft);
  border: 1px solid #eadfc4;
}

.inline-note.info {
  color: #2f5273;
  background: #eff4f9;
  border-color: #d9e4ef;
}

.inline-note.warn {
  color: var(--red-deep);
  background: #fdf2ef;
  border-color: #f0d3cc;
}

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

.kpi-mini.auto {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.kpi-mini > div {
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.kpi-mini b {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.kpi-mini span {
  font-size: 11.5px;
  color: var(--muted);
}

/* ============================ 登录 / 初始化 ============================ */

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 520px at 6% -10%, rgba(179, 38, 30, 0.09), transparent 62%),
    radial-gradient(760px 460px at 100% 110%, rgba(179, 38, 30, 0.06), transparent 60%),
    var(--paper);
}

.auth-shell {
  position: relative;
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 50px 100px -50px rgba(120, 22, 16, 0.45), 0 2px 6px rgba(26, 26, 27, 0.05);
  animation: auth-in var(--dur-4) var(--ease) both;
}

@keyframes auth-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
  }
}

/* 左侧品牌面：整块正红，白字、白线、白点，把 LOGO 印章放在白色圆角印章框里 */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 52px 46px;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(520px 320px at 0% 0%, rgba(255, 255, 255, 0.16), transparent 70%),
    linear-gradient(158deg, var(--red-bright) 0%, var(--red) 46%, var(--red-deep) 100%);
  border-radius: 19px 0 0 19px;
  overflow: hidden;
}

/* 红色印面上的极淡印章纹理（同心圆），呼应 LOGO 的圆环 */
.auth-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.auth-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.55);
}

.auth-mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.auth-brand h1 {
  margin-top: 26px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
}

.auth-sub {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.66);
}

.auth-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 38px;
  list-style: none;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.84);
}

.auth-points li {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.auth-points li::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-2px);
}

.auth-foot {
  margin-top: auto;
  padding-top: 26px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 42px;
}

.auth-card h2 {
  position: relative;
  padding-bottom: 14px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

/* 标题下一道极短红色刻线，是整套视觉里的「装裱签名」 */
.auth-card h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--red), rgba(179, 38, 30, 0.16));
}

.auth-hint {
  margin-top: 12px;
  margin-bottom: 24px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.auth-card input {
  padding: 10px 12px;
  font-size: 13.5px;
}

.auth-btn {
  margin-top: 6px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(170deg, var(--red-bright), var(--red) 58%, var(--red-deep));
  box-shadow: 0 12px 26px -16px rgba(179, 38, 30, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px -18px rgba(179, 38, 30, 1), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.auth-btn:active {
  transform: translateY(0) scale(0.99);
}

.auth-error {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--red-deep);
  background: var(--red-soft);
  border: 1px solid #ecd0ca;
}

.auth-loading {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

/* ============================ 用户菜单 ============================ */

.user-wrap {
  position: relative;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.user-chip:hover {
  border-color: #d5cbb8;
  box-shadow: var(--shadow-sm);
}

.avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(160deg, var(--red-bright), var(--red));
}

.user-chip .role {
  padding-left: 7px;
  border-left: 1px solid var(--line-2);
  font-size: 10.5px;
  color: var(--muted);
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: menu-in var(--dur-2) var(--ease) both;
  transform-origin: top right;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
}

.user-menu button {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 12.8px;
  text-align: left;
  color: var(--ink-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.user-menu button:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.user-menu .sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--line-2);
}

.user-menu .danger {
  color: var(--red-deep);
}

/* ============================ 响应式 ============================ */

@media (max-width: 1240px) {
  .match-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 76px;
    flex-basis: 76px;
    padding: 18px 10px 14px;
  }

  .brand {
    justify-content: center;
    padding: 2px 0 18px;
  }

  .brand-text,
  .nav-item span,
  .sidebar-foot {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 10px 0;
  }

  .nav-item.active::before {
    left: -10px;
  }

  .nav-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 0;
    padding: 0 4px;
    font-size: 9px;
  }

  .view {
    padding: 18px 20px 56px;
  }

  .topbar {
    padding: 14px 20px;
  }

  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-panel {
    position: static;
  }

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

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

  .span-3 {
    grid-column: span 2;
  }

  .report {
    padding: 34px 30px 38px;
  }
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 460px;
  }

  .auth-brand {
    border-radius: 20px 20px 0 0;
    padding: 34px 30px;
  }

  .auth-points,
  .auth-foot {
    display: none;
  }

  .auth-card {
    padding: 32px 28px 38px;
  }
}

@media (max-width: 720px) {
  .match-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .fin-head {
    display: none;
  }

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

  .fin-year {
    grid-column: 1 / -1;
    margin-top: 6px;
    font-weight: 600;
  }

  .form-grid,
  .form-grid.two {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

  .stat-row {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .topbar-right .btn.ghost {
    display: none;
  }

  .report {
    padding: 24px 18px 30px;
  }

  .report .kv {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-pill em {
    display: none;
  }

  .view > * {
    animation-duration: var(--dur-3);
  }
}

/* ============================ 动效降级 ============================ */

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

/* ============================ 打印 ============================ */

@page {
  size: A4;
  margin: 16mm 14mm;
}

@media print {
  body {
    background: #fff;
    font-size: 10.5pt;
    color: #000;
  }

  body::before {
    display: none;
  }

  .sidebar,
  .topbar,
  .toast,
  .drawer,
  .drawer-mask,
  .no-print {
    display: none !important;
  }

  .app {
    display: block;
  }

  .view {
    padding: 0;
    max-width: none;
  }

  .view > * {
    animation: none !important;
  }

  .report {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    max-width: none;
  }

  .card,
  .table-wrap,
  .gantt,
  .stat-card {
    box-shadow: none;
    break-inside: avoid;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  table {
    break-inside: auto;
  }

  tr {
    break-inside: avoid;
  }

  .print-only {
    display: block !important;
  }
}

/* 全站顶部正红压线：像信笺抬头的第一道红线，把所有页面统一成同一个品牌语境 */
body::after {
  content: "";
  position: fixed;
  z-index: 45;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-bright) 42%, rgba(179, 38, 30, 0.12) 100%);
}

/* 小节标签用品牌红，把红色纪律性地带到内容层 */
.section-label {
  color: var(--red);
  letter-spacing: 0.14em;
}

/* 首张统计卡（可申报）加极淡红晕，其余留白 */
.stat-row .stat-card:first-child {
  background: linear-gradient(180deg, #ffffff, #fff9f8);
}

@media print {
  /* 打印/导出 PDF 时不带顶部红色压线，保持纸质报告的干净抬头 */
  body::after {
    display: none;
  }
}

/* ==========================================================================
   CRM：销售管道 / 跟进时间线 / 营销分析
   ========================================================================== */

/* 管道看板：横向滚动，每列一个阶段 */
.pipeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(232px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipe-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.pipe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 6px;
}

.pipe-head b {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

.pipe-empty {
  padding: 22px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

.pipe-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}

.pipe-card:hover {
  transform: translateY(-1px);
  border-color: var(--red-glow);
  box-shadow: var(--shadow-sm);
}

.pipe-card .nm {
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.4;
}

.pipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.pipe-meta.late { color: var(--red-deep); }
.pipe-meta.soon { color: var(--gold); }

.pipe-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 2px;
}

/* 漏斗 */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 40px 70px;
  align-items: center;
  gap: 10px;
  font-size: 12.3px;
}

.funnel-label { color: var(--ink-2); }

.funnel-bar {
  height: 9px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
}

.funnel-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--red-bright));
}

.funnel-num {
  font-family: var(--serif);
  font-size: 15px;
  text-align: right;
  color: var(--ink);
}

.funnel-amt {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
}

/* 营销两栏 */
.marketing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
}

/* 活动卡片 */
.camp-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.camp-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.camp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.camp-head strong { font-size: 13px; line-height: 1.45; }

.camp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.camp-stat {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
}

.camp-stat b {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.camp-stat span { font-size: 11px; color: var(--muted); }

.camp-actions {
  display: flex;
  justify-content: flex-end;
}

/* 跟进时间线 */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 2px;
}

.tl-item {
  position: relative;
  margin-left: 5px;
  padding: 0 0 14px 18px;
  border-left: 1px solid var(--line-2);
}

.tl-item:last-child { padding-bottom: 2px; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.tl-body {
  margin: 5px 0 0;
  font-size: 12.8px;
  line-height: 1.65;
  color: var(--ink-2);
}

.tl-next {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--gold);
}

/* 抽屉里的销售信息五列 */
.crm-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 12px;
}

@media (max-width: 1240px) {
  .marketing-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .crm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .crm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funnel-row { grid-template-columns: 68px minmax(0, 1fr) 32px; }
  .funnel-amt { display: none; }
  .camp-stat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* —— CRM 细节修正 —— */
.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  overflow-x: visible;
  padding-bottom: 4px;
}

.pipeline.lost-row {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

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

.crm-grid input[type="date"] {
  padding-right: 4px;
  font-size: 12.3px;
}

@media (max-width: 1240px) {
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .pipeline { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   财务回款（合同 / 开票 / 回款 / 应收）
   ========================================================================== */

.fin-kpi {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.fin-kpi-item {
  position: relative;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  animation: kpiIn 0.5s var(--ease) both;
}

.fin-kpi-item:nth-child(2) { animation-delay: 40ms; }
.fin-kpi-item:nth-child(3) { animation-delay: 80ms; }
.fin-kpi-item:nth-child(4) { animation-delay: 120ms; }
.fin-kpi-item:nth-child(5) { animation-delay: 160ms; }
.fin-kpi-item:nth-child(6) { animation-delay: 200ms; }

.fin-kpi-item::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, rgba(179, 38, 30, 0.15) 100%);
  opacity: 0.85;
}

.fin-kpi-item span {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.fin-kpi-item b {
  display: block;
  margin: 6px 0 4px;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.fin-kpi-item em {
  font-style: normal;
  font-size: 11px;
  color: var(--faint);
}

.fin-kpi-item.accent {
  background: linear-gradient(180deg, #fff, #fff8f7);
  border-color: #f3dedb;
}

.fin-kpi-item.accent b {
  color: var(--red);
}

.fin-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
}

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

.fin-aging {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 4px 0 2px;
}

.age-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 48px 76px;
  align-items: center;
  gap: 10px;
}

.age-label {
  font-size: 12.5px;
  color: var(--ink-3);
}

.age-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.age-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ink-3), var(--ink-2));
  transform-origin: left center;
  animation: growX 0.7s var(--ease) both;
}

.age-bar.due i {
  background: linear-gradient(90deg, var(--red), var(--red-bright));
}

.age-num {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.age-amt {
  font-size: 12.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.fin-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 10px 0 0;
}

.fin-month {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.mbars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 104px;
  width: 100%;
  justify-content: center;
}

.mbars i {
  display: block;
  width: 11px;
  min-height: 2px;
  border-radius: 4px 4px 2px 2px;
  transform-origin: bottom center;
  animation: growY 0.72s var(--ease) both;
}

.mbars .recv {
  background: linear-gradient(180deg, var(--red-bright), var(--red));
}

.mbars .inv {
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.mlabel {
  font-size: 11.5px;
  color: var(--muted);
}

.mval {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fin-table tbody tr {
  transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.fin-table tbody tr:hover {
  background: linear-gradient(90deg, #fff8f7 0%, var(--surface-3) 60%);
  box-shadow: inset 2px 0 0 var(--red);
}

.fin-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.fin-progress.lg {
  height: 8px;
  margin-top: 12px;
}

.fin-progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--red), var(--red-bright));
  transform-origin: left center;
  animation: growX 0.8s var(--ease) both;
}

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

.fin-num {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.fin-num span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.fin-num b {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.fin-num.due {
  border-color: #f3dedb;
  background: var(--red-soft);
}

.fin-num.due b {
  color: var(--red);
}

.fin-pay-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fin-pay-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.fin-pay-list li:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pay-at {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.pay-amt {
  font-size: 13px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  min-width: 64px;
}

.sub.late,
.num.late {
  color: var(--red);
}

/* 骨架屏 */
.fin-skeleton {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sk-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.sk-card {
  height: 84px;
  border-radius: var(--radius);
}

.sk-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
}

.sk-block {
  height: 190px;
  border-radius: var(--radius);
}

.sk-block.tall {
  height: 260px;
}

.shimmer {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}

.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@keyframes kpiIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes growX {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes growY {
  from { transform: scaleY(0); opacity: 0.5; }
  to { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 1240px) {
  .fin-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fin-grid, .fin-grid.two, .sk-grid { grid-template-columns: minmax(0, 1fr); }
  .fin-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .fin-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-months { gap: 6px; }
  .mbars i { width: 7px; }
  .age-row { grid-template-columns: 76px minmax(0, 1fr) 40px 62px; }
}

/* ==========================================================================
   商务质感精修：页签、卡片、按钮、表格的微交互
   ========================================================================== */

/* 页签：选中态转品牌红，切换更顺 */
.tabs button.active {
  color: var(--red-deep);
  background: linear-gradient(180deg, #fff, #fffafa);
  box-shadow: 0 1px 2px rgba(25, 28, 33, 0.06), 0 8px 18px -14px rgba(179, 38, 30, 0.45),
    inset 0 0 0 1px #f3dedb;
}

.tabs button {
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}

.tabs button:active {
  transform: scale(0.985);
}

/* 按钮：按压回弹 + 主按钮光泽更克制 */
.btn {
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn.primary:hover {
  box-shadow: 0 10px 22px -14px rgba(179, 38, 30, 0.9);
}

/* 卡片：分层阴影，hover 轻微抬起（仅数据卡） */
.fin-kpi-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(26, 26, 27, 0.05), 0 14px 30px -20px rgba(26, 26, 27, 0.28);
}

.fin-kpi-item {
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

/* 表格行：hover 才出现左侧红条，避免整页花 */
.table tbody tr {
  transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.table tbody tr:hover {
  background: var(--surface-3);
  box-shadow: inset 2px 0 0 rgba(179, 38, 30, 0.55);
}

/* 抽屉内滚动更顺 */
.drawer-body {
  scroll-behavior: smooth;
}

/* 减少动效时，全部归零 */
@media (prefers-reduced-motion: reduce) {
  .fin-kpi-item,
  .age-bar i,
  .mbars i,
  .fin-progress i,
  .shimmer::after {
    animation: none !important;
  }
  .fin-kpi-item:hover,
  .fin-pay-list li:hover,
  .btn:active,
  .tabs button:active {
    transform: none;
  }
  .drawer-body {
    scroll-behavior: auto;
  }
}

/* 财务图表微调：柱更实、加淡网格基线 */
.fin-months {
  background-image: linear-gradient(180deg, transparent 0, transparent calc(100% - 1px), var(--line-2) 100%);
}

.mbars {
  height: 96px;
  gap: 5px;
}

.mbars i {
  width: 15px;
}

.mval {
  min-height: 14px;
}

/* KPI 数值带单位时字距收紧一点，避免「41.7%」贴边 */
.fin-kpi-item b {
  white-space: nowrap;
}

/* ==========================================================================
   高端商务质感 · 精修层（数字排版 / 图表骨架 / 表面材质 / 交互反馈）
   ========================================================================== */

/* —— 1. 数字排版：主数值大、单位小且下沉，全站等宽数字 —— */
.fin-kpi-item b {
  font-size: 27px;
  letter-spacing: -0.022em;
  line-height: 1.15;
  font-feature-settings: "tnum" 1;
}

.fin-kpi-item b small {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-left: 3px;
  color: var(--muted);
  font-feature-settings: normal;
}

.fin-kpi-item.accent b small {
  color: rgba(179, 38, 30, 0.62);
}

.fin-kpi-item span {
  letter-spacing: 0.06em;
  font-size: 11.5px;
}

.fin-kpi-item em {
  letter-spacing: 0.01em;
}

.fin-num b,
.table td,
.fin-table td {
  font-feature-settings: "tnum" 1;
}

/* —— 2. 账龄：中性灰为「未到期」、红为逾期，轨道带内阴影 —— */
.age-bar {
  background: #f3efed;
  box-shadow: inset 0 1px 2px rgba(26, 26, 27, 0.07);
  height: 9px;
}

.age-bar i {
  background: linear-gradient(90deg, #b8b2ae, #948c88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset;
}

.age-bar.due i {
  background: linear-gradient(90deg, var(--red), var(--red-bright));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.age-row {
  transition: transform var(--dur-2) var(--ease);
}

.age-row:hover {
  transform: translateX(2px);
}

.age-row:hover .age-amt {
  color: var(--ink);
}

/* —— 3. 月度柱状：给每个月一条淡轨道 + 顶部分段网格，稀疏数据也有结构 —— */
.mbars {
  height: 116px;
  position: relative;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent 28px,
    rgba(26, 26, 27, 0.045) 28px,
    rgba(26, 26, 27, 0.045) 29px
  );
}

.mbars i {
  width: 15px;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 1px 2px rgba(26, 26, 27, 0.08);
}

.mbars .inv {
  background: linear-gradient(180deg, #ffffff, #f1edea);
  border: 1px solid #e6e0dc;
  border-bottom: none;
}

.fin-month {
  position: relative;
}

.fin-month + .fin-month::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  bottom: 22px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2) 30%, var(--line-2) 70%, transparent);
}

.mlabel {
  letter-spacing: 0.04em;
}

.mval {
  color: var(--ink-3);
  letter-spacing: 0.01em;
}

/* —— 4. 表面材质：卡片层次更「纸感」，分割线更细 —— */
.card {
  border-color: #e8e2de;
  box-shadow: 0 1px 2px rgba(26, 26, 27, 0.035), 0 12px 28px -24px rgba(26, 26, 27, 0.22);
}

.card-head {
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 12px;
}

.card-head h2 {
  letter-spacing: -0.012em;
  font-weight: 650;
}

.card-head p {
  letter-spacing: 0.005em;
}

/* 表头：更克制的字重与字距，长表不吵 */
.table thead th,
.fin-table thead th {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #fbfaf9;
}

.table tbody td {
  letter-spacing: 0.002em;
}

/* 行 hover 用位移配合底色，形成「滑动感」 */
.table tbody tr:hover td:first-child,
.fin-table tbody tr:hover td:first-child {
  padding-left: 12px;
}

.table tbody td:first-child,
.fin-table tbody td:first-child {
  transition: padding-left var(--dur-2) var(--ease);
}

/* —— 5. 按钮与页签：按下回弹、主按钮红晕加深 —— */
.btn {
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease),
    background-color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn.primary {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 18px -12px rgba(179, 38, 30, 0.85);
}

.btn.primary:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 12px 24px -12px rgba(179, 38, 30, 1);
}

.tabs button,
.page-tabs button {
  transition: color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease),
    box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}

/* —— 6. 抽屉：进入曲线更「沉」，内部卡片更贴边 —— */
.drawer .drawer-body > .card + .card,
.drawer .drawer-body > .card + .fin-block {
  margin-top: 14px;
}

/* —— 7. 打印：去掉图表网格与阴影，保持纸面干净 —— */
@media print {
  .card {
    box-shadow: none;
  }
  .mbars {
    background-image: none;
    border-bottom-color: #ddd;
  }
}

/* 列表：副标题单行省略，避免行高被撑成三行 */
.table td > .sub,
.table td > .small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table td {
  overflow: hidden;
}

/* 月度柱状：0 值不占高度（去掉早先的 min-height 假柱） */
.mbars i {
  min-height: 0;
}

/* 用户管理：角色权限对照表 + 角色下拉 */
.perm-table td.yes {
  color: var(--red-deep);
  font-weight: 600;
}

.perm-table td.no {
  color: var(--faint);
}

.role-select {
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}

.role-select:hover:not(:disabled) {
  border-color: #d9b3ae;
}

.role-select:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.role-select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* ===== AI 解析 / 查重 ===== */
.ai-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff, var(--surface-3));
}
.ai-bar .hint { font-size: 12px; }

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  white-space: nowrap;
}
.ai-chip.on {
  color: var(--red-deep);
  border-color: #f0d3cf;
  background: var(--red-soft);
}
.ai-chip.off { color: var(--amber-ink, #8a5a12); border-color: #f0e2c8; background: #fdf7ec; }

.pending-item .draft-preview {
  margin: 8px 0 2px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  padding: 0 12px;
}
.pending-item .draft-preview summary {
  cursor: pointer;
  padding: 7px 0;
  font-size: 12.2px;
  color: var(--ink-2);
  list-style: none;
}
.pending-item .draft-preview summary::-webkit-details-marker { display: none; }
.pending-item .draft-preview summary::before {
  content: "▸";
  margin-right: 6px;
  color: var(--red);
  display: inline-block;
  transition: transform var(--dur-2) var(--ease);
}
.pending-item .draft-preview[open] summary::before { transform: rotate(90deg); }
.draft-body { padding: 2px 0 12px; }
.draft-line { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.draft-conds { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.draft-conds li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  padding: 5px 9px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
}
.draft-conds .cond-label { color: var(--ink-2); }
.draft-conds .cond-target { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.dedupe-group {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
  background: var(--surface-2);
}
.dedupe-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dedupe-head b { font-size: 13px; letter-spacing: -0.01em; }
.dedupe-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dedupe-group li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
}
.dedupe-group .dedupe-name { font-weight: 600; color: var(--ink); }
.dedupe-group .link { color: var(--red-deep); font-size: 12px; }

.ai-test {
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  border: 1px solid var(--line-2);
}
.ai-test.ok { color: #1c6b3f; background: #eef8f1; border-color: #d5ecd9; }
.ai-test.err { color: var(--red-deep); background: var(--red-soft); border-color: #f0d3cf; }

@media (max-width: 720px) {
  .ai-bar { align-items: flex-start; }
}

/* 抽屉内的表单节奏：字段之间留白，标签稍深，提示贴紧字段 */
.drawer-body .field {
  margin-bottom: 15px;
}
.drawer-body .field > label {
  font-size: 12.3px;
  color: var(--ink-2);
  letter-spacing: 0.005em;
}
.drawer-body .field > .hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
}
.drawer-body .paste-actions {
  margin-top: 4px;
}

/* ============================================================
   客户门户（企业账号登录后使用，独立于内部工作台）
   ============================================================ */

.portal-body {
  background: var(--paper);
  min-height: 100vh;
  padding-bottom: 60px;
}

.portal-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.portal-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: var(--red);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px -10px rgba(179, 38, 30, 0.7);
}

.portal-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.portal-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-brand-text strong {
  font-size: 15.5px;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-brand-text small {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.portal-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-user {
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}

.portal-hint {
  font-size: 11.5px;
  color: var(--red);
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--red-soft);
  border: 1px solid #f3d9d5;
}

.portal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.portal-tab {
  appearance: none;
  border: 0;
  background: none;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  white-space: nowrap;
}

.portal-tab:hover {
  color: var(--ink);
}

.portal-tab.active {
  color: var(--red-deep);
  border-bottom-color: var(--red);
  font-weight: 600;
}

.portal-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal-main.anim > * {
  animation: rise var(--dur-3) var(--ease) both;
}

.portal-loading,
.portal-empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.portal-actions .field.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.portal-actions .field.inline input {
  width: 96px;
}

/* 统计条 */
.pstat-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.pstat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs), var(--shadow-sm);
}

.pstat b {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.pstat span {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.pstat.accent {
  background: linear-gradient(160deg, #fff 0%, #fff8f7 100%);
  border-color: #f3dedb;
}

.pstat.accent b {
  color: var(--red);
}

/* 企业信息表单 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.info-grid .field {
  margin-bottom: 0;
}

.field-block {
  margin-top: 14px;
}

.field-title {
  display: block;
  font-size: 12.3px;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.field-title em {
  font-style: normal;
  color: var(--muted);
  font-size: 11.5px;
  margin-left: 4px;
}

.sr-label {
  display: none;
}

.table.compact th,
.table.compact td {
  padding: 8px 10px;
}

.table.compact input {
  width: 100%;
  min-width: 64px;
  padding: 7px 8px;
  font-size: 12.5px;
  border-radius: var(--radius-xs);
}

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

/* 融资记录 */
.funding-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funding-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
}

.fr-badge {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red-deep);
  border: 1px solid #f3d9d5;
  white-space: nowrap;
}

.fr-main {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.fr-meta {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funding-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--line);
}

.funding-form .field {
  margin-bottom: 0;
}

/* 匹配卡片 */
.pm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pm-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 14px 16px;
  border-left: 3px solid var(--line-2);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}

.pm-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pm-card.eligible {
  border-left-color: var(--green);
}

.pm-card.gap {
  border-left-color: var(--amber);
}

.pm-card.held {
  border-left-color: var(--red);
}

.pm-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pm-card h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 600;
}

.pm-tag {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.pm-amt {
  margin: 8px 0 4px;
  font-size: 15px;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.pm-meta {
  margin: 2px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.pm-card footer {
  margin-top: 8px;
}

.pm-state {
  font-size: 11.5px;
  color: var(--ink-2);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-3);
}

.gap-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* 申报进度 */
.stage-badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.stage-badge.approved,
.stage-badge.funded {
  background: var(--green-soft);
  color: var(--green);
  border-color: #cfe8dc;
}

.stage-badge.rejected {
  background: var(--red-soft);
  color: var(--red-deep);
  border-color: #f3d9d5;
}

.stage-badge.submitted,
.stage-badge.accepted {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: #d6e4f2;
}

.table select[data-decl-stage] {
  padding: 5px 8px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  margin-right: 6px;
}

/* 消息与提醒 */
.notice-list,
.pt-rem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notice-item {
  display: flex;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-2);
}

.notice-item:last-child {
  border-bottom: 0;
}

.notice-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  margin-top: 7px;
  flex: 0 0 7px;
}

.notice-item.unread .notice-dot {
  background: var(--red);
}

.notice-body {
  flex: 1;
  min-width: 0;
}

.notice-title {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 600;
}

.notice-item.read .notice-title {
  font-weight: 500;
  color: var(--ink-2);
}

.notice-meta,
.notice-reason {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.notice-time {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}

.pt-rem {
  display: grid;
  grid-template-columns: 96px 1fr 150px;
  gap: 10px;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
}

.pt-rem:last-child {
  border-bottom: 0;
}

.pt-rem-type {
  font-size: 11.5px;
  color: var(--ink-2);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  text-align: center;
}

.pt-rem.overdue .pt-rem-type {
  background: var(--red-soft);
  color: var(--red-deep);
}

.pt-rem-title {
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pt-rem-date {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pt-rem.overdue .pt-rem-date {
  color: var(--red);
}

.dot {
  font-style: normal;
  font-size: 11.5px;
  color: var(--red);
  margin-left: 8px;
}

/* 响应式 */
@media (max-width: 1100px) {
  .pstat-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .funding-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .portal-top {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .portal-tabs {
    padding: 0 16px;
  }
  .portal-main {
    padding: 16px;
  }
  .pstat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .info-cols,
  .pm-grid,
  .info-grid,
  .info-grid.two {
    grid-template-columns: minmax(0, 1fr);
  }
  .pt-rem {
    grid-template-columns: 80px 1fr;
  }
  .pt-rem-date {
    grid-column: 2;
    text-align: left;
  }
}

@media print {
  .portal-top,
  .portal-tabs {
    display: none;
  }
}

.decl-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.decl-actions select[data-decl-stage] {
  padding: 5px 8px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  min-width: 128px;
  text-align: left;
}

/* 企业信息表单里的字段级提示（企查查自动补全状态等） */
.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  font-style: normal;
}

.info-grid .field-hint {
  max-width: 100%;
}

.switch-line {
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  background: var(--paper);
}

.switch-line input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--red);
}
