:root {
  --bg: #f5f6f8;
  --bg2: #ffffff;
  --ink: #16202e;
  --muted: #6b7a90;
  --rule: #e3e7ed;
  --accent: #1f5fd6;
  --accent2: #e8842c;
  --ok: #1f9d6b;
  --warn: #d9822b;
  /* 中性色别名（沿用现有色值） */
  --ink-2: #33445c;
  --line: #e3e7ed;
  --line-soft: #f0f3f8;
  --bg-2: #ffffff;
  /* 圆角刻度（收敛为 3 档） */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  /* 间距刻度（8px 基准） */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  /* 阴影 */
  --shadow-1: 0 2px 10px rgba(20,40,80,.05);
  --shadow-2: 0 8px 24px rgba(20,40,80,.07);
  /* 内容宽度 */
  --content: 1080px;
  --content-wide: 1200px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }

/* ---------------- 应用外壳 ---------------- */
.appbar {
  display: flex; align-items: center; gap: 1.2rem;
  background: var(--bg-2); border-bottom: 1px solid var(--rule);
  padding: .7rem 1.4rem; position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: .5rem; }
.brand .mark { font-size: 1.2rem; font-weight: 800; }
.brand .mark span { color: var(--accent); }
.brand .sub { font-size: .82rem; color: var(--muted); }
.nav { display: flex; gap: .3rem; margin-left: auto; }
.nav button {
  border: none; background: transparent; color: var(--muted);
  padding: .45rem .9rem; border-radius: var(--r-sm); cursor: pointer; font-size: .92rem; font-weight: 600;
}
.nav button:hover { background: #eef1f5; color: var(--ink); }
.nav button.active { background: #eaf1fd; color: var(--accent); }
/* 锁定态导航入口（如 C1 账号看到的「实时助手」）：灰显 + C2 角标，点进去只有一句开通提示 */
.nav button.locked { color: #a9b3c1; }
.nav button.locked::after {
  content: "C2"; margin-left: .32rem; font-size: .68rem; font-weight: 800;
  color: #98a3b2; background: #f0f3f7; border-radius: 3px; padding: 0 .24rem;
}
.nav button.locked:hover { background: #f5f7fa; color: #a9b3c1; }
.nav button.locked.active { background: #f0f3f7; color: #a9b3c1; }
.mode-chip {
  font-size: .76rem; font-weight: 700; color: #a5741a;
  background: #fdf3e2; border-radius: 999px; padding: .2rem .7rem;
}
.mode-chip.real { color: #1f7a52; background: #e8f6ef; }

main { max-width: var(--content); margin: 0 auto; padding: 1.8rem 1.2rem 4rem; }
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1 { font-size: 1.45rem; font-weight: 800; margin: 0 0 .4rem; }
.lead { color: var(--muted); font-size: .92rem; margin: 0 0 1.4rem; }
code { background: #eef1f5; padding: .1rem .35rem; border-radius: var(--r-sm); font-family: var(--mono); font-size: .85em; }

/* ---------------- 按钮 ---------------- */
.btn {
  border: 1px solid var(--rule); background: var(--bg-2); color: var(--ink);
  padding: .6rem 1.1rem; border-radius: var(--r-sm); cursor: pointer; font-size: .92rem; font-weight: 600;
  transition: .15s;
}
.btn:hover { border-color: #cbd3de; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg-2); }
.btn.primary:hover { background: #1a53bd; }
.btn.primary:disabled { background: #b9c6dc; border-color: #b9c6dc; cursor: not-allowed; }
.btn.ghost { background: var(--bg-2); }
.btn.small { padding: .4rem .8rem; font-size: .85rem; }
/* 危险操作修饰类：沿用文件已有红色系危险色 #b23b2e（红色文字 + 红色边框），悬停加深 */
.btn.danger { color: #b23b2e; border-color: #b23b2e; }
.btn.danger:hover { color: var(--bg-2); background: #b23b2e; border-color: #b23b2e; }

/* ---------------- 工作台 ---------------- */
.dropzone {
  border: 2px dashed #c7d0dd; background: var(--bg-2); border-radius: var(--r-md);
  padding: 2.6rem 1.5rem; text-align: center; cursor: pointer; transition: .18s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: #f7faff; }
.dz-icon { font-size: 1.8rem; color: var(--accent); font-weight: 300; }
.dz-title { font-size: 1rem; margin-top: .5rem; }
.dz-title .link { color: var(--accent); font-weight: 600; }
.dz-hint { font-size: .82rem; color: var(--muted); margin-top: .4rem; }
.work-actions { display: flex; gap: .8rem; margin-top: 1.2rem; flex-wrap: wrap; }
.selected-file {
  margin-top: 1rem; background: #eef3fd; border: 1px solid #d7e3fb; border-radius: var(--r-sm);
  padding: .6rem .9rem; font-size: .88rem; color: #21395f;
}
.progress { display: flex; align-items: center; gap: .7rem; margin-top: 1.2rem; color: var(--muted); font-size: .9rem; }
/* 关键：作者样式 display:flex 会覆盖浏览器对 [hidden] 的默认 display:none，
   导致「正在处理…」常驻。这里显式让 [hidden] 生效。 */
.progress[hidden] { display: none; }
.spinner {
  width: 20px; height: 20px; border: 2.5px solid #d7dde6; border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* 上传进度条（方案A）：与转圈同排；分析/其他场景隐藏 */
.p-bar { flex: 1 1 8rem; height: 8px; min-width: 6rem; background: #e3e8ef; border-radius: 999px; overflow: hidden; }
.p-bar[hidden] { display: none; }
.p-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .15s ease; }
.tipbox {
  margin-top: 1.6rem; background: #fff7ec; border: 1px solid #f3d9b5; border-left: 4px solid var(--accent2);
  border-radius: var(--r-sm); padding: .8rem 1rem; font-size: .86rem; color: #7a4a12;
}
/* 「客户档案」页提示条：加粗 + 字号略大（.86rem → 1rem） */
.tipbox-strong { font-weight: 700; font-size: 1rem; line-height: 1.7; }

/* ---------------- 报告 ---------------- */
.toolbar { display: flex; align-items: center; margin-bottom: 1rem; }
.toolbar .grow { flex: 1; }
#reportRoot { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 1.6rem 1.8rem; }

.rpt-lead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: .9rem; flex-wrap: wrap; }
.rpt-lead .num { font-family: var(--mono); font-size: .72rem; color: var(--muted); text-align: right; line-height: 1.5; }
.rpt-title { font-size: 1.5rem; font-weight: 800; margin: 1.2rem 0 .3rem; }
.rpt-sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.3rem; }

.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; margin-bottom: 1.4rem; }
.meta-grid .cell { background: var(--bg-2); padding: .7rem .9rem; }
.meta-grid .k { font-size: .72rem; color: var(--muted); }
.meta-grid .v { font-size: .92rem; font-weight: 600; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin-bottom: 1.6rem; }
.metric { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 1rem 1.1rem; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.metric.green::after { background: var(--ok); }
.metric.amber::after { background: var(--accent2); }
.metric .label { font-size: .76rem; color: var(--muted); }
.metric .value { font-size: 1.45rem; font-weight: 800; margin-top: .2rem; }
.metric .hint { font-size: .76rem; color: var(--muted); margin-top: .15rem; }

.rpt section { margin-top: 1.9rem; }
.rpt h2 { font-size: 1.12rem; font-weight: 800; padding-left: .6rem; border-left: 4px solid var(--accent); margin: 0 0 .9rem; }
.rpt h2 .idx { font-family: var(--mono); color: var(--muted); font-size: .85rem; margin-right: .45rem; }
.rpt .card { border: 1px solid var(--rule); border-radius: var(--r-md); padding: 1rem 1.1rem; }
.rpt p { font-size: .93rem; margin: 0; }
.rpt mark.key { background: none; color: var(--accent); font-weight: 700; }

dl.profile { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; }
dl.profile dt { color: var(--muted); font-size: .86rem; white-space: nowrap; }
dl.profile dd { margin: 0; font-size: .9rem; font-weight: 500; }

.signals { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.signals .col { border-radius: var(--r-md); padding: .9rem 1rem; border: 1px solid var(--rule); }
.signals .col.pos { background: #f2faf6; border-color: #cfeadd; }
.signals .col.neg { background: #fdf6ee; border-color: #f0ddc6; }
.signals h3 { font-size: .9rem; margin: 0 0 .4rem; }
.signals .pos h3 { color: var(--ok); }
.signals .neg h3 { color: var(--warn); }
ul.ticks { list-style: none; margin: 0; padding: 0; }
ul.ticks li { font-size: .88rem; padding-left: 1rem; position: relative; margin-bottom: .35rem; }
ul.ticks li::before { content: "•"; position: absolute; left: .2rem; color: var(--muted); }
blockquote { border-left: 3px solid var(--rule); padding-left: .7rem; color: var(--muted); font-size: .84rem; margin: .4rem 0 0; }
blockquote::before { content: "原话："; color: var(--accent); font-weight: 700; font-size: .78rem; }

.pain, .needs { list-style: none; margin: 0; padding: 0; }
.pain > li, .needs > li { padding: .85rem 0; border-bottom: 1px dashed var(--rule); }
.pain > li:last-child, .needs > li:last-child { border-bottom: none; padding-bottom: .1rem; }
.pain-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pain .tag { font-size: .72rem; font-weight: 700; color: var(--accent); background: #eaf1fd; border-radius: 999px; padding: .1rem .55rem; }
.pain .p-title { font-weight: 700; font-size: .93rem; }
.pain .level { font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .1rem .55rem; margin-left: auto; white-space: nowrap; }
.pain .level.high { color: #b23b2e; background: #fdecea; }
.pain .level.mid { color: #a5741a; background: #fdf3e2; }
.pain .level.low { color: #40618a; background: #eaf1f7; }
.pain .p-desc { font-size: .9rem; margin-top: .35rem; }
.pain .p-tip { margin-top: .5rem; font-size: .85rem; color: #21395f; background: #f0f5ff; border: 1px solid #d7e3fb; border-radius: var(--r-sm); padding: .5rem .7rem; }
.pain .p-tip .lbl { color: var(--accent); font-weight: 700; }

.needs .n-title { font-weight: 700; font-size: .93rem; display: flex; align-items: center; gap: .45rem; }
.needs .n-title .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent2); flex: none; }
.needs .n-meta { font-size: .88rem; margin-top: .35rem; display: flex; gap: .5rem; }
.needs .n-meta .lbl { flex: none; font-size: .7rem; font-weight: 700; color: var(--muted); background: #eef1f5; border-radius: var(--r-sm); padding: .05rem .4rem; margin-top: .15rem; }
.needs .n-meta.move .lbl { color: var(--accent); background: #eaf1fd; }
.needs .n-meta.basis { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; background: var(--bg-2); font-size: .88rem; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--rule); }
th { background: var(--line-soft); font-weight: 700; font-size: .8rem; color: var(--ink-2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num { font-family: var(--mono); }

ol.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
ol.steps > li { counter-increment: step; position: relative; padding: .8rem 0 .8rem 2.4rem; border-bottom: 1px dashed var(--rule); }
ol.steps > li:last-child { border-bottom: none; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: .75rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--bg-2);
  font-weight: 700; font-size: .82rem; display: flex; align-items: center; justify-content: center; font-family: var(--mono);
}
ol.steps .st-title { font-weight: 700; font-size: .93rem; }
ol.steps .script { margin-top: .45rem; background: #f0f5ff; border: 1px solid #d7e3fb; border-radius: var(--r-sm); padding: .55rem .75rem; font-size: .87rem; color: #21395f; }
ol.steps .script .lbl { color: var(--accent); font-weight: 700; font-size: .76rem; display: block; }

.score-row { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.score-ring {
  width: 104px; height: 104px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--rule) 0);
  display: grid; place-items: center;
}
.score-ring span { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; font-family: var(--mono); }
.dims { flex: 1; min-width: 260px; }
.dim { display: flex; align-items: center; gap: .6rem; margin: .4rem 0; }
.dim .name { width: 5.2rem; flex: none; font-size: .85rem; color: var(--muted); }
.dim .bar { flex: 1; height: 10px; background: var(--rule); border-radius: 999px; overflow: hidden; }
.dim .bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.dim .val { width: 2.2rem; text-align: right; font-family: var(--mono); font-size: .8rem; color: var(--muted); }

.rpt footer { margin-top: 2rem; padding-top: 1rem; border-top: 2px solid var(--ink); font-size: .76rem; color: var(--muted); }
.rpt footer b { color: var(--ink); }

/* ---------------- 报告库 ---------------- */
.report-list { display: grid; gap: .8rem; }
.report-item {
  display: flex; align-items: center; gap: 1rem; background: var(--bg-2); border: 1px solid var(--rule);
  border-radius: var(--r-md); padding: .9rem 1.1rem; cursor: pointer; transition: .15s;
}
.report-item:hover { border-color: #c7d0dd; box-shadow: var(--shadow-1); }
.report-item .ri-main { flex: 1; }
.report-item .ri-title { font-weight: 700; font-size: .95rem; }
.report-item .ri-meta { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.badge { font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .12rem .6rem; }
.badge.high { color: #b23b2e; background: #fdecea; }
.badge.mid { color: #a5741a; background: #fdf3e2; }
.badge.low { color: #40618a; background: #eaf1f7; }
.badge.none { color: var(--muted); background: #eef1f5; }
/* 「待分析」徽标：用琥珀色强调，提示用户还需点「分析」才出报告（方案A） */
.badge.pend { color: #a5741a; background: #fdf3e2; }
.icon-btn { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: .85rem; padding: .3rem .5rem; border-radius: var(--r-sm); }
.icon-btn:hover { background: #f2f4f7; color: #b23b2e; }
.empty { color: var(--muted); text-align: center; padding: 3rem 0; font-size: .92rem; }

/* ---------------- 设置 ---------------- */
.card { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card h2 { font-size: 1rem; margin: 0 0 .9rem; padding-left: .55rem; border-left: 4px solid var(--accent); }
.field { display: grid; grid-template-columns: 6rem 1fr; gap: .8rem; align-items: center; margin-bottom: .7rem; }
.field label { font-size: .88rem; color: var(--muted); }
.field input, .field select { width: 100%; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: var(--r-sm); font-size: .9rem; font-family: inherit; background: var(--bg-2); }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.row-note { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.row-note.link-blue { color: var(--accent); }
.test-row { display: flex; align-items: center; gap: .8rem; margin-top: .6rem; }
.test-result { font-size: .86rem; }

/* ---------------- 反馈 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%) translateY(1rem);
  background: var(--ink); color: var(--bg-2); padding: .65rem 1.1rem; border-radius: var(--r-md); font-size: .88rem;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b23b2e; }

/* ---------------- 平板（721–1024px）：多列栅格降为 2 列，避免挤压 ---------------- */
@media (min-width: 721px) and (max-width: 1024px) {
  .meta-grid, .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  main { padding: 1.2rem .8rem 3rem; }
  .appbar { padding: .6rem .8rem; gap: .6rem; }
  .brand .sub { display: none; }
  .metrics, .signals, .meta-grid { grid-template-columns: 1fr; }
  #reportRoot { padding: 1.1rem 1rem; }
  .field { grid-template-columns: 1fr; gap: .25rem; }
}

/* ---------------- 打印（导出 PDF） ---------------- */
@media print {
  .appbar, .toolbar, .toast { display: none !important; }
  body { background: var(--bg-2); }
  main { max-width: none; padding: 0; }
  .view { display: none !important; }
  #view-report { display: block !important; }
  #reportRoot { border: none; border-radius: 0; padding: 0; }
  .rpt section { break-inside: avoid; }
  #view-report { break-inside: auto; }
}

/* ---------------- 登录 ---------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 1rem; }
.login-card { background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 2rem 1.8rem; width: 100%; max-width: 360px; box-shadow: var(--shadow-2); }
.login-brand { font-size: 1.25rem; font-weight: 800; text-align: center; }
.login-brand span { color: var(--accent); }
.login-sub { text-align: center; color: var(--muted); font-size: .88rem; margin: .35rem 0 1.3rem; }
.login-btn { width: 100%; margin-top: .5rem; }
.login-err { color: #b23b2e; font-size: .85rem; margin-top: .7rem; min-height: 1.1rem; text-align: center; }

.userbox { display: flex; align-items: center; gap: .6rem; }
.userbox #whoami { font-size: .84rem; color: var(--muted); }
.hide { display: none !important; }

/* ---------------- 客户档案 / 上传队列 / 时间线 / 角色（批次2 新增） ---------------- */
.cust-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cust-bar .k { font-size: .86rem; color: var(--muted); }
.cust-bar select {
  flex: 1 1 16rem; min-width: 0; padding: .55rem .7rem;
  border: 1px solid var(--rule); border-radius: var(--r-sm); font-size: .92rem; font-family: inherit; background: var(--bg-2);
}
.cust-bar select:focus { outline: none; border-color: var(--accent); }
.cust-bar .cust-search {
  flex: 1 1 12rem; min-width: 0; padding: .55rem .7rem;
  border: 1px solid var(--rule); border-radius: var(--r-sm); font-size: .92rem; font-family: inherit; background: var(--bg-2);
}
.cust-bar .cust-search:focus { outline: none; border-color: var(--accent); }
.sec-h2 { font-size: 1.05rem; font-weight: 800; margin: 1.8rem 0 .7rem; padding-left: .55rem; border-left: 4px solid var(--accent); }
/* 待分析提示条（方案A）：提醒用户「上传≠完成」，需再点分析 */
.pending-hint {
  margin: 0 0 .8rem; background: #fff7ec; border: 1px solid #f3d9b5; border-left: 4px solid var(--accent2);
  border-radius: var(--r-sm); padding: .55rem .9rem; font-size: .85rem; color: #7a4a12; line-height: 1.6;
}
.pending-hint[hidden] { display: none; }
.pending-hint b { color: #b55a10; }

.queue { margin-top: 1rem; border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); }
.q-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; border-bottom: 1px solid var(--rule); font-size: .88rem; }
.q-item:last-child { border-bottom: none; }
.q-item.bad { background: #fdf6f5; }
.q-item .q-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-item .q-size { color: var(--muted); font-family: var(--mono); font-size: .78rem; white-space: nowrap; }
.q-item .q-err { color: #b23b2e; font-size: .8rem; white-space: nowrap; }
.q-item .q-tag { font-size: .72rem; color: #1f9d6b; background: #e8f7f0; border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; }

.timeline { display: grid; gap: .5rem; }
.tl-item { display: flex; align-items: center; gap: .8rem; background: var(--bg-2); border: 1px solid var(--rule); border-radius: var(--r-md); padding: .6rem .9rem; }
.tl-time { font-family: var(--mono); font-size: .74rem; color: var(--muted); white-space: nowrap; }
.tl-main { flex: 1; min-width: 0; }
.tl-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-meta { font-size: .76rem; color: var(--muted); margin-top: .1rem; }

.report-item .ri-title .ver { font-family: var(--mono); font-size: .72rem; color: var(--accent); background: #eaf1fd; border-radius: var(--r-sm); padding: .05rem .35rem; }

.roles { display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.role-item { display: flex; align-items: center; gap: .45rem; }
.role-chip { font-size: .82rem; font-weight: 700; color: var(--accent); background: #eaf1fd; border-radius: 999px; padding: .12rem .6rem; white-space: nowrap; }
.role-src { font-size: .82rem; color: var(--muted); }
.role-note { font-size: .8rem; color: var(--muted); margin: .7rem 0 0; }

/* ---------------- 移动端（覆盖在后面，优先级更高） ---------------- */
@media (max-width: 720px) {
  /* 顶栏换行 + 导航横向滚动，避免挤爆 */
  .appbar { flex-wrap: wrap; gap: .5rem; padding: .6rem .8rem; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand .mark { font-size: 1.05rem; }
  .brand .sub { display: none; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: .2rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav button { white-space: nowrap; }
  .mode-chip { font-size: .7rem; padding: .15rem .5rem; }
  .userbox { margin-left: auto; }
  .userbox #whoami { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* 触屏：输入框 16px 防 iOS 自动放大；按钮足够大 */
  .field input, .field select, .cust-bar select, .cust-bar .cust-search { font-size: 16px; }
  .btn { min-height: 40px; }
  .nav button, .icon-btn { min-height: 40px; }
  .dropzone { padding: 1.6rem 1rem; }

  /* 列表卡片化（不再靠横向滚动） */
  .report-item { flex-wrap: wrap; gap: .45rem; }
  .report-item .ri-main { flex: 1 1 100%; }
  .tl-item { flex-wrap: wrap; gap: .45rem; }
  .tl-main { flex: 1 1 100%; }
  .cust-bar select { flex: 1 1 100%; }
  .cust-bar .cust-search { flex: 1 1 100%; }
  .cust-bar .k { flex: 1 1 100%; }

  /* 报告：字号与留白收紧 */
  #reportRoot { padding: 1rem .9rem; }
  .rpt-title { font-size: 1.25rem; }
  .metric .value { font-size: 1.25rem; }
  .rpt-lead { gap: .4rem; }
  .rpt-lead .num { text-align: left; }
  .score-ring { width: 84px; height: 84px; }
  .score-ring span { width: 64px; height: 64px; font-size: 1.2rem; }
  .toolbar .btn { flex: none; }
}

/* ---------------- 转写文本 / 人工纠错（批次3 新增） ---------------- */
.tr-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .7rem; }
.tr-head .tr-meta { flex: 1; font-size: .82rem; color: var(--muted); }
.tr-badge { font-size: .72rem; font-weight: 700; color: #1f7a52; background: #e8f6ef; border-radius: 999px; padding: .1rem .5rem; }
.tr-view { max-height: 26rem; overflow: auto; border: 1px solid var(--rule); border-radius: var(--r-md); padding: .6rem .7rem; background: #fbfcfe; }
.tr-line { display: flex; gap: .5rem; padding: .18rem 0; font-size: .86rem; }
.tr-who { flex: none; width: 4.6rem; color: var(--accent); font-size: .76rem; font-weight: 700; text-align: right; padding-top: .12rem; }
.tr-text { flex: 1; min-width: 0; }
.tr-edit textarea {
  width: 100%; min-height: 16rem; padding: .7rem .8rem; border: 1px solid var(--rule);
  border-radius: var(--r-md); font-family: inherit; font-size: .88rem; line-height: 1.7; resize: vertical;
}
.tr-edit textarea:focus { outline: none; border-color: var(--accent); }
.tr-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.tr-actions input { flex: 1 1 12rem; min-width: 0; padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: var(--r-sm); font-family: inherit; font-size: .86rem; }
.tr-tip { font-size: .78rem; color: var(--muted); margin: .6rem 0 0; }
.tr-impact { margin-top: .8rem; font-size: .86rem; background: #f2faf6; border: 1px solid #cfeadd; border-radius: var(--r-md); padding: .7rem .85rem; color: #1c5a42; }
.tr-impact.warn { background: #fff7ec; border-color: #f3d9b5; color: #7a4a12; }

@media (max-width: 720px) {
  .tr-who { width: 3.6rem; font-size: .72rem; }
  .tr-view { max-height: 20rem; }
  .tr-edit textarea { min-height: 12rem; }
}

/* ---------------- 客户画像（批次4 新增） ---------------- */
.prof-card { margin-bottom: 1rem; }
.prof-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.prof-title { font-size: 1.05rem; font-weight: 800; margin: 0; }
.prof-sub { flex: 1; font-size: .8rem; color: var(--muted); }
.prof-body .empty { color: var(--muted); font-size: .88rem; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .7rem; }
.p-card { border: 1px solid var(--rule); border-radius: var(--r-md); padding: .6rem .8rem; background: #fbfcfe; }
.p-h { font-size: .78rem; color: var(--muted); font-weight: 600; }
.p-big { font-size: 1.2rem; font-weight: 800; color: var(--accent); }
.p-big .p-trend { font-size: .76rem; font-weight: 700; color: var(--ok); }
.p-strong { font-size: .92rem; font-weight: 600; margin-top: .2rem; }
.p-hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.p-sec { margin-top: .9rem; }
.p-row { display: flex; gap: .6rem; padding: .3rem 0; border-bottom: 1px dashed var(--rule); font-size: .88rem; }
.p-row:last-child { border-bottom: none; }
.p-k { flex: 0 0 88px; color: var(--muted); }
.p-v { flex: 1; min-width: 0; }
.p-next { margin-top: .9rem; padding: .6rem .85rem; background: #eef3fd; border: 1px solid #d7e3fb; border-radius: var(--r-sm); font-size: .9rem; color: #21395f; }
.h-row { display: flex; gap: .5rem; align-items: baseline; padding: .32rem 0; font-size: .85rem; border-bottom: 1px dashed var(--rule); }
.h-row:last-child { border-bottom: none; }
.h-at { flex: 0 0 105px; color: var(--muted); font-variant-numeric: tabular-nums; }
.h-car { flex: 0 1 auto; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-sum { flex: 1; min-width: 0; color: #44505f; }
.lv { display: inline-block; font-size: .72rem; font-weight: 700; padding: .05rem .4rem; border-radius: var(--r-sm); background: #eef1f5; color: var(--muted); vertical-align: middle; }
.lv.high { background: #fdecec; color: #b23b2e; }
.lv.mid { background: #fdf3e2; color: #a5741a; }
.lv.low { background: #eaf1fd; color: #1f5fd6; }
.lv.none { background: #eef1f5; color: var(--muted); }

@media (max-width: 720px) {
  .p-grid { grid-template-columns: 1fr 1fr; }
  .p-k { flex-basis: 74px; }
  .h-at { flex-basis: 88px; font-size: .78rem; }
  .h-car { max-width: 34%; }
  .prof-sub { flex: 1 1 100%; }
}

/* ---------------- 版本与额度 / 额度提示条（批次5 / 5-3） ---------------- */
.quota-note { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .45rem; font-size: .82rem; color: var(--muted); }
.quota-note .qbar { flex: 0 0 92px; height: 6px; border-radius: 999px; background: #e6ebf2; overflow: hidden; }
.quota-note .qbar i { display: block; height: 100%; background: var(--accent); }
.quota-note .qtxt b { color: var(--ink); }
.quota-note.q-warn { color: #a5741a; }
.quota-note.q-warn .qbar i { background: var(--warn); }
.quota-note.q-bad { color: #b23b2e; }
.quota-note.q-bad .qbar i { background: #b23b2e; }
.quota-note.q-bad .qtxt b, .quota-note.q-warn .qtxt b { color: inherit; }

@media (max-width: 720px) {
  .quota-note .qbar { flex-basis: 68px; }
}

/* ---------------- 报告反馈（批次5-4 阶段1） ---------------- */
.fb-card { margin-top: 1.2rem; }
.fb-card h2 { font-size: 1.02rem; }
.fb-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fb-hint { font-size: .78rem; color: var(--muted); }
.fb-reasons { margin-top: .8rem; border-top: 1px dashed var(--rule); padding-top: .7rem; }
.fb-reasons .fb-h { font-size: .84rem; color: var(--muted); margin-bottom: .4rem; }
.fb-opt { display: inline-flex; align-items: center; gap: .3rem; margin: 0 .9rem .4rem 0; font-size: .88rem; }
.fb-reasons textarea {
  width: 100%; min-height: 4.5rem; margin-top: .4rem; padding: .55rem .7rem;
  border: 1px solid var(--rule); border-radius: var(--r-sm); font-family: inherit; font-size: .88rem; resize: vertical;
}
.fb-reasons textarea:focus { outline: none; border-color: var(--accent); }
.fb-actions { display: flex; gap: .6rem; margin-top: .6rem; }
.fb-done { margin-top: .7rem; font-size: .85rem; color: #1c5a42; background: #f2faf6; border: 1px solid #cfeadd; border-radius: var(--r-sm); padding: .55rem .8rem; }

/* ---------------- 门店知识库（批次5-4 阶段2） ---------------- */
.field textarea {
  width: 100%; min-height: 6.5rem; padding: .6rem .8rem; border: 1px solid var(--rule);
  border-radius: var(--r-sm); font-family: inherit; font-size: .9rem; line-height: 1.7; resize: vertical;
}
.field textarea:focus { outline: none; border-color: var(--accent); }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.kb-list { margin-top: .8rem; }
.kb-item { display: flex; align-items: flex-start; gap: .5rem; padding: .6rem 0; border-top: 1px dashed var(--rule); }
.kb-main { flex: 1; min-width: 0; }
.kb-title { font-weight: 600; font-size: .92rem; }
.kb-meta { font-size: .76rem; color: var(--muted); margin-top: .1rem; }
.kb-text { font-size: .82rem; color: #55606f; margin-top: .25rem; word-break: break-all; }
.kb-used { margin: 0; padding-left: 1.1rem; font-size: .88rem; }
.kb-import { margin-top: .7rem; padding: .7rem .85rem; border: 1px solid var(--rule); border-radius: var(--r-sm); background: #fafbfc; }
.kb-import .kb-list { margin-top: .4rem; max-height: 22rem; overflow-y: auto; }
.kb-import .kb-item { gap: .45rem; }
.kb-import .kb-item:first-child { border-top: none; }
.kb-import input[type="checkbox"] { flex: none; margin: .4rem 0 0; }
.kb-imptitle { width: 100%; padding: .3rem .5rem; border: 1px solid var(--rule); border-radius: var(--r-sm); font: inherit; font-size: .88rem; }
.kb-imptitle:focus { outline: none; border-color: var(--accent); }
.kb-warn { color: #b5473a; }

@media (max-width: 720px) {
  .kb-item { flex-wrap: wrap; }
  .kb-main { flex: 1 1 100%; }
}

/* ---------------- 评分维度（评分卡，批次5-4 阶段3） ---------------- */
.rubric-list { margin-top: .7rem; }
.rubric-row { display: flex; align-items: center; gap: .45rem; padding: .35rem 0; border-top: 1px dashed var(--rule); }
.rubric-row:first-child { border-top: none; }
.rubric-row .rb-name { flex: 0 0 9rem; padding: .4rem .55rem; border: 1px solid var(--rule); border-radius: var(--r-sm); font-family: inherit; font-size: .88rem; }
.rubric-row .rb-weight { flex: 0 0 5.4rem; padding: .4rem .4rem; border: 1px solid var(--rule); border-radius: var(--r-sm); font-family: inherit; font-size: .86rem; background: var(--bg-2); }
.rubric-row .rb-desc { flex: 1; min-width: 0; padding: .4rem .55rem; border: 1px solid var(--rule); border-radius: var(--r-sm); font-family: inherit; font-size: .86rem; }
.rubric-row input:focus, .rubric-row select:focus { outline: none; border-color: var(--accent); }

@media (max-width: 720px) {
  .rubric-row { flex-wrap: wrap; }
  .rubric-row .rb-name { flex: 1 1 60%; }
  .rubric-row .rb-weight { flex: 0 0 6rem; }
  .rubric-row .rb-desc { flex: 1 1 100%; }
}

/* ---------------- 话术库（批次5-4 阶段4） ---------------- */
.sc-block { margin-top: 1.1rem; }
.sc-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sc-head b { font-size: .95rem; }
.sc-ver { font-size: .76rem; color: var(--muted); }
.sc-list { margin-top: .6rem; }
.sc-sub { font-size: .82rem; color: var(--muted); margin: .2rem 0 .3rem; }
.sc-item { display: flex; align-items: flex-start; gap: .5rem; padding: .55rem 0; border-top: 1px dashed var(--rule); }
.sc-item:first-child { border-top: none; }
.sc-main { flex: 1; min-width: 0; }
.sc-meta { font-size: .74rem; color: var(--muted); }
.sc-trig { font-size: .82rem; color: #a5741a; margin-top: .15rem; }
.sc-script { font-size: .88rem; color: #21395f; background: #f0f5ff; border: 1px solid #d7e3fb; border-radius: var(--r-sm); padding: .42rem .6rem; margin-top: .3rem; line-height: 1.7; }
.sc-pending .sc-script { background: #fff8ec; border-color: #f5e3c2; }
.sc-playbook { margin-top: .7rem; border: 1px solid var(--rule); border-radius: var(--r-md); padding: .5rem .8rem; background: #fafbfd; max-height: 22rem; overflow: auto; }
.sc-cat { margin-top: .6rem; }
.sc-cat:first-child { margin-top: .2rem; }
.sc-cat-h { font-weight: 700; font-size: .9rem; color: var(--ink); }
.sc-reco { list-style: none; padding: 0; margin: 0; }
.sc-reco > li { padding: .6rem 0; border-top: 1px dashed var(--rule); }
.sc-reco > li:first-child { border-top: none; }
.sc-reco-head { display: flex; align-items: center; gap: .5rem; }
.sc-src { font-size: .72rem; color: var(--muted); }

/* ---------------- 公开落地页（产品入口，批次6） ---------------- */
.landing-body { min-height: 100vh; background: var(--bg); }
.landing-top { display: flex; align-items: baseline; gap: .5rem; max-width: 880px; margin: 0 auto; padding: 1.5rem 1.4rem 0; }
.landing-brand { font-size: 1.25rem; font-weight: 800; color: var(--accent); }
.landing-sep { font-size: 1.25rem; color: var(--muted); }
.landing-brand-sub { font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.landing { max-width: 880px; margin: 0 auto; padding: 2.6rem 1.4rem 4rem; }

.landing-hero { margin-bottom: 2.2rem; }
.landing-hero h1 { font-size: 1.85rem; line-height: 1.45; font-weight: 800; margin: 0 0 .7rem; }
.landing-hero p { color: var(--muted); font-size: .98rem; margin: 0; }

.landing-entries { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.entry-card {
  display: flex; flex-direction: column; background: var(--bg-2);
  border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.5rem 1.5rem 1.4rem;
  transition: .18s;
}
.entry-card:hover { border-color: #c7d0dd; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.entry-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .95rem; }
.entry-tag { font-size: .74rem; font-weight: 800; color: var(--accent); background: #eaf1fd; border-radius: 999px; padding: .12rem .6rem; }
.entry-name { font-size: 1.25rem; font-weight: 800; margin: 0; }
.entry-feats { list-style: none; margin: 0 0 1.25rem; padding: 0; color: #44505f; font-size: .9rem; }
.entry-feats li { position: relative; padding: .26rem 0 .26rem 1.1rem; }
.entry-feats li::before { content: ""; position: absolute; left: .15rem; top: .78rem; width: .38rem; height: .38rem; border-radius: 50%; background: var(--accent); opacity: .55; }
.entry-btn { margin-top: auto; display: block; text-align: center; text-decoration: none; }

.c3-note { margin-top: 1.4rem; background: var(--bg-2); border: 1px solid var(--rule); border-left: 4px solid #c7d0dd; border-radius: var(--r-md); padding: 1.05rem 1.2rem; }
.c3-title { font-weight: 800; margin-bottom: .35rem; }
.c3-text { margin: 0; font-size: .88rem; color: #55606f; line-height: 1.85; }
.landing-foot { margin-top: 1.5rem; text-align: center; color: var(--muted); font-size: .82rem; }

@media (max-width: 720px) {
  .landing-top { padding: 1.1rem 1rem 0; }
  .landing { padding: 1.8rem 1rem 3rem; }
  .landing-hero h1 { font-size: 1.42rem; }
  .landing-entries { grid-template-columns: 1fr; }
}

/* 登录页：入口标识 + 销售场景 + 返回首页 */
.login-entry { text-align: center; color: var(--accent); font-size: .86rem; font-weight: 700; margin: -.8rem 0 1rem; }
.login-scene-hint { font-size: .8rem; color: var(--muted); margin: -.35rem 0 .7rem; }
.login-home { display: block; text-align: center; margin-top: 1rem; color: var(--muted); font-size: .84rem; text-decoration: none; }
.login-home:hover { color: var(--accent); }

/* ---------------- 实时助手 ---------------- */
.live-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.live-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #cbd3de; display: inline-block; }
.live-dot.on { background: #e0453a; animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .28; } }
.live-status { font-size: .9rem; font-weight: 700; }
.live-status.err { color: #b23b2e; font-weight: 600; }
.live-metrics { margin-left: auto; font-size: .82rem; color: var(--muted); }
.live-consent { display: block; margin-top: .8rem; }

.live-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 1rem; align-items: start; }
.live-partial { min-height: 1.5rem; color: var(--muted); font-size: .92rem; margin-bottom: .5rem; }
.live-finals { max-height: 46vh; overflow-y: auto; }
.live-line { padding: .3rem 0; border-bottom: 1px dashed var(--line-soft); font-size: .92rem; }
.live-t { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; margin-right: .45rem; }
.live-cards { max-height: 62vh; overflow-y: auto; }
.live-card { border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: var(--r-sm); margin-bottom: .7rem; background: #fbfcfe; }
.live-card.amb { border-left-color: var(--warn); }         /* 歧义反问：要销售先确认再答 */
/* 实时助手 · 麦克风音量条（说话时该跟着跳；不跳就是没采到声音，比"没出字"更早暴露问题） */
.live-level { display: inline-flex; align-items: center; width: 72px; height: 8px; flex: none;
  background: #e9edf4; border-radius: 4px; overflow: hidden; }
.live-level > i { display: block; height: 100%; width: 0; background: var(--accent); }
.live-level.silent > i { background: #b9c3d3; }
.live-level.off { visibility: hidden; }
/* 实时助手 · 归属客户一行（选了才把通话转写存进客户档案） */
.live-cust { align-items: center; gap: .5rem; flex-wrap: wrap; }
.live-cust select { min-width: 12rem; }
.live-card-head { display: flex; align-items: center; gap: .5rem; padding: .42rem .7rem; background: #f2f5fb; border-bottom: 1px solid var(--rule); font-size: .84rem; font-weight: 700; }
.live-card-ms { margin-left: auto; color: var(--muted); font-weight: 400; font-size: .78rem; }
/* 卡片是多行字符画，必须 monospace + 保留空白，否则框线全乱 */
.live-card-pre { margin: 0; padding: .7rem .8rem; font-family: var(--mono); font-size: .78rem; line-height: 1.55; white-space: pre; overflow-x: auto; color: var(--ink-2); }
/* 三键标注：有用 / 没用 / 认错车 —— 点一下把这张卡连同上下文回传平台 */
.live-card-foot { display: flex; gap: var(--sp-2); padding: .5rem .7rem; border-top: 1px solid var(--rule); }
.live-fb { border: 1px solid var(--rule); background: var(--bg-2); color: var(--ink-2); border-radius: var(--r-sm); padding: .28rem .7rem; font-size: .8rem; cursor: pointer; }
.live-fb:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.live-fb.on { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.live-card-foot.done .live-fb:disabled { opacity: .5; cursor: default; }
.live-card-foot.done .live-fb.on { opacity: 1; }

/* 管理端「实时助手反馈 · 待办队列」：三组任务清单 */
.lf-group { margin-top: var(--sp-3); }
.lf-group-head { font-weight: 700; font-size: .9rem; padding-bottom: var(--sp-1); border-bottom: 1px solid var(--rule); margin-bottom: var(--sp-1); }

@media (max-width: 900px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-metrics { margin-left: 0; }
}
