/* 询盘工作台 · 暖纸色界面 */
:root {
  color-scheme: light;
  --bg: #f4f2ec;
  --surface: #fffefb;
  --surface-2: #f9f7f2;
  --ink: #1f1e1b;
  --ink-2: #3d3b36;
  --muted: #75716a;
  --line: #e5e1d7;
  --line-strong: #d6d1c4;
  --accent: #c15f3c;
  --accent-hover: #a94f30;
  --accent-soft: #f7e8e0;
  --accent-ink: #8c3f22;
  --ok: #4c7a58;  --ok-soft: #e7efe6;
  --warn: #9a640f; --warn-soft: #f9eedb;
  --danger: #b4412d; --danger-soft: #f8e2dc;
  --info: #4d6b88; --info-soft: #e5ecf3;
  --done: #6f6c66; --done-soft: #eeece6;
  --shadow-sm: 0 1px 2px rgba(31, 30, 27, .05);
  --shadow: 0 1px 2px rgba(31, 30, 27, .04), 0 6px 20px -8px rgba(31, 30, 27, .12);
  --shadow-lg: 0 24px 80px -20px rgba(31, 30, 27, .35);
  --radius: 14px;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #1c1b19;
    --surface: #262522;
    --surface-2: #2d2c28;
    --ink: #f0ede6;
    --ink-2: #d9d5cc;
    --muted: #a19c92;
    --line: #38362f;
    --line-strong: #4a473f;
    --accent: #d9774f;
    --accent-hover: #e48a63;
    --accent-soft: #3b2a22;
    --accent-ink: #f0a585;
    --ok: #8dbb98;  --ok-soft: #26332a;
    --warn: #e0b064; --warn-soft: #3a2f1c;
    --danger: #ec8b78; --danger-soft: #3d2420;
    --info: #9bb6d1; --info-soft: #232e3a;
    --done: #a8a49b; --done-soft: #302f2b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 80px -20px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(28px, 4.4vw, 38px); line-height: 1.15; }
h2 { font-size: 19px; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 640; line-height: 1.35; color: var(--ink); }
p { line-height: 1.65; color: var(--muted); }
small, .muted { color: var(--muted); font-size: 13px; }
a { color: var(--accent-ink); }
::selection { background: var(--accent-soft); }

/* ——— 顶栏 ——— */
header {
  position: sticky; top: 0; z-index: 3;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar, main { max-width: 1040px; margin: auto; padding-inline: 28px; }
.bar { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--serif); font-size: 18px; font-weight: 600; white-space: nowrap;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.account { display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 14px; }
.account .who { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; font-weight: 560; }
.account button { min-height: 34px; padding: 6px 11px; font-size: 13px; border-color: transparent; background: transparent; color: var(--muted); }
.account button:hover { background: var(--surface-2); color: var(--ink); }

/* ——— 头像 ——— */
.avatar {
  flex: none; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-weight: 650; font-size: 15px; letter-spacing: 0;
  background: var(--tone-soft, var(--accent-soft)); color: var(--tone, var(--accent-ink));
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.tone-0 { --tone: #a4512f; --tone-soft: #f6e4da; }
.tone-1 { --tone: #4c7a58; --tone-soft: #e3ede2; }
.tone-2 { --tone: #4d6b88; --tone-soft: #e2eaf2; }
.tone-3 { --tone: #8a6a1f; --tone-soft: #f4ead2; }
.tone-4 { --tone: #7a5a86; --tone-soft: #ede4f0; }
@media (prefers-color-scheme: dark) {
  .tone-0 { --tone: #f0a585; --tone-soft: #3b2a22; }
  .tone-1 { --tone: #8dbb98; --tone-soft: #26332a; }
  .tone-2 { --tone: #9bb6d1; --tone-soft: #232e3a; }
  .tone-3 { --tone: #e0c27a; --tone-soft: #3a311c; }
  .tone-4 { --tone: #c9a9d4; --tone-soft: #33283a; }
}

/* ——— 主体 ——— */
main { padding-top: 40px; padding-bottom: 72px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.eyebrow { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; letter-spacing: .02em; }
.hero p { margin-top: 8px; font-size: 15px; }

/* ——— 按钮 ——— */
button, .button {
  font: inherit; font-size: 14px; font-weight: 560;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink-2);
  padding: 9px 14px; min-height: 40px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-align: center; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
button:hover, .button:hover { background: var(--surface-2); border-color: var(--muted); }
button:active, .button:active { transform: translateY(1px); }
.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(140, 63, 34, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
button:disabled { opacity: .55; cursor: progress; }
.icon-button { width: 36px; min-height: 36px; padding: 0; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); font-size: 20px; line-height: 1; }
.icon-button:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ——— 指标 ——— */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.metric {
  display: grid; gap: 10px; align-content: start; justify-content: stretch; justify-items: start;
  padding: 16px 18px 18px; min-height: 0; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: 13px; font-weight: 520; box-shadow: var(--shadow-sm);
}
.metric:hover { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow); }
.metric .label { display: inline-flex; align-items: center; gap: 7px; }
.metric .label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--muted)); }
.metric strong { font-family: var(--serif); font-size: 34px; line-height: 1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.metric[data-filter=all] { --dot: var(--accent); }
.metric[data-filter=pool] { --dot: var(--warn); }
.metric[data-filter=first] { --dot: var(--info); }
.metric[data-filter=follow] { --dot: var(--ok); }
.metric[data-filter=closed] { --dot: var(--done); }

/* ——— 标签页 ——— */
.tabs {
  display: inline-flex; gap: 2px; padding: 4px; margin-bottom: 22px; max-width: 100%; overflow: auto;
  background: color-mix(in srgb, var(--line) 55%, transparent); border-radius: 12px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; box-shadow: none; background: transparent; color: var(--muted);
  border-radius: 9px; min-height: 34px; padding: 6px 16px; white-space: nowrap; font-weight: 560;
}
.tabs button:hover { background: transparent; color: var(--ink); }
.tabs button.selected { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ——— 区块 ——— */
.section, .actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section { margin-bottom: 14px; }
.section p { font-size: 14px; margin-top: 3px; }
.section > small { font-variant-numeric: tabular-nums; }
.actions { justify-content: flex-start; }
.list { display: grid; gap: 10px; }

/* ——— 询盘卡片 ——— */
.lead {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
  width: 100%; padding: 16px 18px; text-align: left; color: inherit; font-weight: 400;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.lead:hover { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow); }
.lead > div { min-width: 0; }
.lead-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 22px; }
.lead h3 { overflow-wrap: anywhere; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lead p {
  font-size: 14px; margin-top: 4px; color: var(--ink-2);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.55;
}
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.source { font-size: 11.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; letter-spacing: .02em; }

/* ——— 状态徽标 ——— */
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 4px 10px 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--b-soft, var(--accent-soft)); color: var(--b, var(--accent-ink));
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s-new { --b: var(--accent-ink); --b-soft: var(--accent-soft); }
.badge.s-info { --b: var(--info); --b-soft: var(--info-soft); }
.badge.s-ok { --b: var(--ok); --b-soft: var(--ok-soft); }
.badge.s-warn, .badge.warn { --b: var(--warn); --b-soft: var(--warn-soft); }
.badge.s-danger { --b: var(--danger); --b-soft: var(--danger-soft); }
.badge.s-done { --b: var(--done); --b-soft: var(--done-soft); }

/* ——— 倒计时 ——— */
.deadline {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px;
  margin-top: 12px; padding: 7px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); max-width: 100%;
}
.deadline strong { font-family: var(--sans); font-size: 15px; font-weight: 680; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.deadline .deadline-note { flex-basis: 100%; }
.deadline.soon { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.deadline.soon strong { color: var(--warn); }
.deadline.late { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.deadline.late strong { color: var(--danger); }
.deadline.full { display: flex; padding: 12px 14px; margin-top: 4px; }
.deadline.full strong { font-size: 22px; }

/* ——— 空状态 / 面板 ——— */
.panel, .notice, .empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.empty { padding: 44px 24px; text-align: center; border-style: dashed; box-shadow: none; background: transparent; }
.empty p::before { content: "◌"; display: block; font-size: 26px; color: var(--line-strong); margin-bottom: 6px; }
.panel { overflow: auto; }
.notice { padding: 16px 18px; }
.notice h3 { display: flex; align-items: center; gap: 8px; }
.notice p { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.notice .actions { margin-top: 10px; }
.notice.unread { border-left: 3px solid var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.hint { font-size: 13.5px; padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); }

/* ——— 表格 ——— */
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 14px; }
td, th { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td { font-variant-numeric: tabular-nums; color: var(--ink-2); }
td .person { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 560; }
td .person small { font-weight: 400; }
td button { min-height: 30px; padding: 3px 10px; font-size: 13px; }
td button.num { min-width: 36px; font-weight: 640; }
.meter { display: inline-flex; align-items: center; gap: 10px; }
.meter progress { appearance: none; -webkit-appearance: none; width: 64px; height: 6px; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.meter progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.meter progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

/* ——— 登录 ——— */
.login {
  max-width: 400px; margin: 8vh auto 0; padding: 36px 32px 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.login img { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 20px; }
.login h1 { font-size: 28px; }
.login p { margin: 8px 0 24px; font-size: 14.5px; }
.login button.primary { margin-top: 6px; min-height: 44px; }

/* ——— 表单 ——— */
form, .detail { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: var(--ink-2); font-weight: 560; font-size: 13.5px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 10px 12px; min-height: 42px; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input[type=file] { padding: 8px; font-size: 13.5px; background: var(--surface-2); border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 560; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 7px; padding: 5px 11px; margin-right: 10px; cursor: pointer; }
input[type=checkbox] { width: auto; min-height: auto; accent-color: var(--accent); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; line-height: 1.6; }
label.inline { display: flex; align-items: center; gap: 8px; }
.message { color: var(--danger); min-height: 1.2em; }
.message:empty { display: none; }
details { font-size: 13.5px; }
details summary { cursor: pointer; color: var(--accent-ink); font-weight: 560; width: fit-content; }
details p { margin-top: 8px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: 13px; }

/* ——— 对话框 ——— */
dialog {
  width: min(600px, calc(100% - 24px)); max-height: calc(100% - 32px);
  border: 1px solid var(--line); border-radius: 20px; padding: 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog[open] { animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: rgba(31, 30, 27, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } }
dialog .detail { padding: 22px 24px 26px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; position: sticky; top: -22px; margin: -22px -24px 0; padding: 20px 16px 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 1; }
.dialog-head h2 { font-size: 21px; padding-top: 4px; overflow-wrap: anywhere; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.contact { display: flex; gap: 8px; flex-wrap: wrap; }
.info-block { padding: 14px 16px; background: var(--surface-2); border-radius: 12px; color: var(--ink); font-size: 15px; line-height: 1.7; }
.proof { display: block; max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.copy { white-space: pre-wrap; overflow-wrap: anywhere; }
h3.sub { font-family: var(--serif); font-size: 16px; font-weight: 600; }

/* ——— 时间线 ——— */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 24px; font-size: 14px; color: var(--muted); }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:first-child::before { border-color: var(--accent); background: var(--accent); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline strong { color: var(--ink); font-weight: 620; }
.timeline .copy { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.timeline small { display: block; margin-top: 4px; }
.timeline img, .timeline details { margin-top: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ——— 提示 ——— */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 10;
  max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 520;
  box-shadow: var(--shadow-lg); animation: rise .2s ease-out;
}

/* ——— 日报 ——— */
.report-details-heading { margin-top: 36px; }
.report-entry h3 { overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.report-entry .section { margin-bottom: 0; }

/* ——— 手机 ——— */
@media (max-width: 640px) {
  .bar, main { padding-inline: 16px; }
  .bar { height: 56px; }
  .brand { font-size: 16px; }
  .brand img { width: 26px; height: 26px; }
  .account .who span:last-child { display: none; }
  .account button { padding: 6px 8px; }
  main { padding-top: 26px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .hero > .primary { width: 100%; min-height: 44px; }
  .hero p { font-size: 14px; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 24px; }
  .metric { padding: 13px 14px 14px; }
  .metric strong { font-size: 28px; }
  .tabs { display: flex; }
  .tabs button { flex: 1; padding-inline: 10px; }
  .lead { padding: 14px; gap: 12px; }
  .lead .avatar { width: 34px; height: 34px; font-size: 13px; }
  .deadline { width: 100%; }
  dialog { width: 100%; max-width: none; max-height: 92%; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; }
  dialog .detail { padding: 18px 18px 30px; }
  .dialog-head { top: -18px; margin: -18px -18px 0; padding: 16px 10px 12px 18px; }
  td, th { padding: 11px 12px; }
}
.detail:focus { outline: none; }

/* ===== v2：搜索、报表、人性化细节 ===== */
:root { --series-a: #c15f3c; --series-b: #3f7cb8; }
@media (prefers-color-scheme: dark) { :root { --series-a: #d4724a; --series-b: #4a8fd9; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
b { font-weight: 650; color: var(--ink); }
.hero p b { color: var(--accent-ink); }
.danger-text { color: var(--danger) !important; }
.zero { color: color-mix(in srgb, var(--muted) 55%, transparent); }

/* 工具栏 + 搜索 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-title { display: flex; align-items: baseline; gap: 10px; }
.search { position: relative; display: block; flex: 0 1 340px; font-weight: 400; }
.search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.search input { padding-left: 38px; padding-right: 38px; border-radius: 999px; background: var(--surface); min-height: 40px; font-size: 14.5px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 11px/1 ui-monospace, Menlo, monospace; color: var(--muted); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* 分组 */
.group { margin: 22px 0 10px; font-size: 12.5px; font-weight: 640; color: var(--muted); letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.group:first-child { margin-top: 0; }
.group.hot { color: var(--warn); }
.group.hot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.lead.is-late { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.fresh { font-size: 11.5px; font-weight: 640; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.deadline-label { font-weight: 560; }

/* 空状态 */
.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 24px; }
.empty h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.empty p { font-size: 14px; max-width: 360px; }
.empty p::before { content: none; }
.empty::before { content: ""; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 14px; background: var(--accent-soft); -webkit-mask: none; box-shadow: inset 0 0 0 10px var(--surface-2); }
.empty button { margin-top: 10px; }

/* 骨架屏 */
.skeleton { height: 92px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--line) 60%, var(--surface-2)) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border: 1px solid var(--line); }
.skeleton.tall { height: 280px; margin-top: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 分段控件 */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: color-mix(in srgb, var(--line) 55%, transparent); }
.segmented button { border: 0; box-shadow: none; background: transparent; color: var(--muted); min-height: 32px; padding: 5px 14px; border-radius: 8px; font-size: 13.5px; }
.segmented button:hover { background: transparent; color: var(--ink); }
.segmented button.selected { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented.small button { padding: 4px 12px; font-size: 13px; min-height: 30px; }
.inline-select select { min-height: 36px; font-size: 13.5px; padding-block: 6px; border-radius: 9px; }
.lead-in { font-size: 14px; margin-bottom: 14px; }

/* 表格补充 */
th.num-col, td.num-col { text-align: center; }
td.end { text-align: right; }
td .person > span:not(.avatar) { display: inline-flex; gap: 6px; align-items: baseline; }
td button.num.alert { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }
.report-entry .arrow { color: var(--muted); font-weight: 400; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.kpi { display: grid; gap: 8px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); font-size: 13px; color: var(--muted); }
.kpi.skeleton { height: 86px; }
.kpi strong { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi strong small { font-family: var(--sans); font-size: 13px; margin-left: 3px; font-weight: 500; }

/* 图表 */
.chart-panel { padding: 18px 18px 10px; overflow: visible; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span, .tip span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-a { background: var(--series-a); }
.sw-b { background: var(--series-b); }
.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar-a { fill: var(--series-a); }
.chart .bar-b { fill: var(--series-b); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .col.on .hit { fill: color-mix(in srgb, var(--line) 45%, transparent); }
.chart .col:not(.on) path { transition: opacity .15s; }
.chart-wrap:has(.col.on) .col:not(.on) path { opacity: .45; }
.tip { position: absolute; top: 0; transform: translate(-50%, -6px); display: grid; gap: 4px; padding: 9px 12px; min-width: 120px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 12.5px; color: var(--ink-2); pointer-events: none; z-index: 2; }
.tip b { font-size: 13px; }
.table-view { margin: 8px 0 4px; }
.table-view table { margin-top: 10px; font-size: 13px; }
.table-view td, .table-view th { padding: 8px 10px; }

/* 弹窗 v2 */
dialog.wide { width: min(680px, calc(100% - 24px)); }
dialog .detail > .skeleton, dialog .detail > .list .skeleton { height: 70px; }
.contact button { font-variant-numeric: tabular-nums; }
.copy-hint { font-size: 11.5px; color: var(--muted); margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.follow-box { display: grid; gap: 14px; padding: 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.follow-box textarea, .follow-box .drop { background: var(--surface); }
.hint.good { background: var(--ok-soft); color: var(--ok); }
.proof.small { max-height: 160px; }
.timeline li > div { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.timeline .t-time { margin: 0 0 0 auto; display: inline; }
.timeline li.t-timeout::before { border-color: var(--danger); }
.timeline li.t-incoming::before { border-color: var(--info); }
.timeline li.t-follow::before { border-color: var(--ok); }
.timeline li:first-child::before { background: currentColor; }
.timeline li.t-assign:first-child::before, .timeline li.t-view:first-child::before { color: var(--accent); border-color: var(--accent); }
.timeline li.t-follow:first-child::before { color: var(--ok); }
.timeline li.t-timeout:first-child::before { color: var(--danger); }
.timeline li.t-incoming:first-child::before { color: var(--info); }

/* 表单 v2 */
.field { display: grid; gap: 7px; }
.field-label { color: var(--ink-2); font-weight: 560; font-size: 13.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label { display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 560; color: var(--ink-2); transition: all .15s; }
.choice span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); transition: all .15s; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.choice input:checked + span::before { border: 4.5px solid var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; min-height: 84px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); cursor: pointer; font-weight: 400; color: var(--muted); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; }
.drop-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.drop-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-text { font-size: 13.5px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.drop-text b { color: var(--ink); }
.drop-text small { font-size: 12px; }
.drop-preview { margin-left: auto; width: 64px; height: 64px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); flex: none; }
.drop.has-file { border-style: solid; border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: var(--ok-soft); }
.drop.has-file .drop-icon svg { stroke: var(--ok); }
.ocr-note { font-size: 13px; color: var(--muted); margin-top: -6px; }
.ocr-note.busy { color: var(--accent-ink); }
.ocr-note.good { color: var(--ok); }
.ocr-note.bad { color: var(--danger); }
.password { position: relative; display: block; }
.password input { padding-right: 64px; }
.reveal { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); min-height: 30px; padding: 3px 10px; font-size: 12.5px; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.reveal:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.reveal:active { transform: translateY(-50%); }

/* 提示条 v2 */
#toast.error { background: var(--danger); color: #fff; }
.notice h3 { min-width: 0; }

@media (max-width: 640px) {
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { flex: 1 1 auto; }
  .search kbd { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi strong { font-size: 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .chart-panel { padding: 14px 10px 8px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  #report-controls { width: 100%; }
  #report-controls select { width: 100%; }
  .timeline .t-time { margin-left: 0; flex-basis: 100%; }
  .copy-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
[hidden] { display: none !important; }
.choice label { position: relative; }
dialog { overflow-x: hidden; }

/* ===== v3：客户身份 ===== */
.contact-line { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.title-sub { margin-left: 10px; font-family: var(--sans); font-size: 12px; font-weight: 560; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; vertical-align: 3px; }
.link-button { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: var(--accent-ink); font-size: 14px; font-weight: 560; margin-left: auto; }
.link-button:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.name-prompt { display: block; width: 100%; text-align: left; justify-content: flex-start; padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); color: var(--accent-ink); font-weight: 450; font-size: 13.5px; box-shadow: none; line-height: 1.5; }
.name-prompt b { color: var(--accent-ink); margin-right: 6px; }
.name-prompt:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 8%); border-color: var(--accent); }
.lead p.raw-note { color: var(--muted); font-style: italic; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.lead p.raw-note::before { content: "✎"; font-style: normal; color: var(--accent); }
.info-block.raw { font-size: 13px; color: var(--muted); max-height: 160px; overflow: auto; }
.sales-assessment{display:flex;gap:8px 14px;align-items:baseline;flex-wrap:wrap;margin:0 0 16px}.sales-assessment strong{font-size:23px;color:var(--accent,#804c24)}

/* ===== v4：60 天出单考核 ===== */
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.warn-text { color: var(--warn) !important; }
.count.warn { background: var(--warn); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--c-soft, var(--done-soft)); color: var(--c, var(--ink-2)); font-variant-numeric: tabular-nums; }
.chip.s-plain { --c: var(--ink-2); --c-soft: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.chip.s-warn { --c: var(--warn); --c-soft: var(--warn-soft); }
.chip.s-danger { --c: var(--danger); --c-soft: var(--danger-soft); }
.chip.s-ok { --c: var(--ok); --c-soft: var(--ok-soft); }
.last-note { margin-top: 8px !important; padding: 8px 12px; border-left: 2px solid var(--line-strong); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 13px !important; color: var(--ink-2) !important; -webkit-line-clamp: 2; }
.last-note span { font-size: 11.5px; font-weight: 640; color: var(--muted); margin-right: 8px; }

/* 员工考核横幅 */
.sales-assessment { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 22px; margin: -6px 0 22px; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.sales-assessment::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--ok)); }
.sales-assessment.s-warn { --c: var(--warn); }
.sales-assessment.s-danger { --c: var(--danger); background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.sales-assessment.s-plain { --c: var(--ok); }
.sales-assessment .eyebrow { margin-bottom: 4px; }
.sales-assessment strong { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--c, var(--ink)); line-height: 1.2; }
.sales-assessment.s-plain strong { color: var(--ink); }
.sales-assessment p { font-size: 13.5px; }
.assess-stat { display: grid; justify-items: center; padding-left: 22px; border-left: 1px solid var(--line); }
.assess-stat strong { font-size: 28px; color: var(--ink) !important; }
.assess-stat span { font-size: 12px; color: var(--muted); }

/* 详情里的考核进度 */
.assess { display: grid; gap: 8px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.assess-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.assess-top b { color: var(--ink); }
.assess-top strong { font-size: 16px; color: var(--c, var(--ink)); font-variant-numeric: tabular-nums; }
.assess.s-warn { --c: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 50%, var(--surface)); }
.assess.s-danger { --c: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); background: color-mix(in srgb, var(--danger-soft) 50%, var(--surface)); }
.assess progress { appearance: none; -webkit-appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; }
.assess progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.assess progress::-webkit-progress-value { background: var(--c, var(--ok)); border-radius: 3px; }
.assess progress::-moz-progress-bar { background: var(--c, var(--ok)); border-radius: 3px; }
.assess small { font-size: 12.5px; line-height: 1.55; }
.order-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--line)); }
.order-cta div { display: grid; gap: 2px; font-size: 13.5px; color: var(--ok); }
.order-cta b { color: var(--ink); font-size: 14.5px; }
.order-cta .primary { flex: none; }
tr.is-out td { color: var(--muted); }
tr.is-out .avatar { filter: grayscale(1); opacity: .6; }
.timeline li.t-won::before { border-color: var(--ok); }
.timeline li.t-won:first-child::before { color: var(--ok); }
.timeline li.t-reassign::before { border-color: var(--danger); }
@media (max-width: 640px) {
  .sales-assessment { grid-template-columns: 1fr auto; }
  .sales-assessment p { grid-column: 1 / -1; grid-row: 2; }
  .assess-stat { padding-left: 14px; }
  .order-cta { flex-direction: column; align-items: stretch; }
}
