:root {
  --brand: #1f5eff;
  --brand-2: #00c2a8;
  --brand-soft: #eef3ff;
  --ink: #0f1729;
  --ink-2: #475069;
  --ink-3: #8a93a8;
  --line: #e6e9f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #12b76a;
  --warn: #f79009;
  --bad: #f04438;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(16, 24, 40, .05), 0 12px 32px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 40px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.6;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cdd3e0; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: #0d1424; color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 20px 20px 16px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: 0 0 34px; }
.brand-name { font-size: 15px; color: #fff; font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #64748b; margin-top: 2px; }
.nav-group { padding: 14px 12px 4px; }
.nav-title { font-size: 11px; color: #4c5a75; padding: 0 10px 8px; letter-spacing: .08em; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; cursor: pointer; transition: .15s; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(31,94,255,.9), rgba(31,94,255,.45)); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(31,94,255,.35); }
.nav-icon { width: 18px; text-align: center; opacity: .95; }
.nav-tag { margin-left: auto; font-size: 10px; background: rgba(255,255,255,.1); padding: 1px 6px; border-radius: 6px; }
.sidebar-foot { margin-top: auto; padding: 14px; font-size: 11px; color: #4c5a75; border-top: 1px solid rgba(255,255,255,.07); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 16px; margin: 0; font-weight: 700; }
.crumb { color: var(--ink-3); font-size: 12.5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pill { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #ffb020, #ff7a45); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.content { padding: 22px 24px 48px; flex: 1; }

/* ---------- 组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-hd { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-hd h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.card-hd .sub { font-size: 12px; color: var(--ink-3); }
.card-hd .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1180px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) { .g2,.g3,.g4,.g5 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; background: var(--brand); color: #fff; transition: .15s; box-shadow: 0 4px 12px rgba(31,94,255,.25); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: #c3cbdb; color: var(--ink); }
.btn.soft { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 12px 24px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; background: #f1f4f9; color: var(--ink-2); }
.chip.on { background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: #e7f8f0; color: #067647; }
.chip.warn { background: #fff5e6; color: #b54708; }
.chip.bad { background: #fee4e2; color: #b42318; }

.kpi { padding: 16px 18px; }
.kpi-label { font-size: 12.5px; color: var(--ink-3); }
.kpi-value { font-size: 27px; font-weight: 800; letter-spacing: -.5px; margin-top: 4px; }
.kpi-delta { font-size: 12px; margin-top: 4px; font-weight: 600; }
.up { color: var(--ok); } .down { color: var(--bad); }

.progress { height: 8px; background: #eef0f5; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .8s cubic-bezier(.2,.8,.2,1); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfd; position: sticky; top: 0; }
.table td { padding: 11px 12px; border-bottom: 1px solid #f1f3f7; }
.table tr:hover td { background: #fafbfd; }
.table-wrap { overflow: auto; max-height: 620px; }

input[type=text], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px;
  font-family: inherit; background: #fff; color: var(--ink); outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,94,255,.12); }
textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 9px 14px; font-size: 13.5px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tab.on { color: var(--brand); border-color: var(--brand); }

.empty { text-align: center; color: var(--ink-3); padding: 40px 20px; font-size: 13px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: "SF Mono", Consolas, monospace; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- 用户端（手机壳） ---------- */
.phone-wrap { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.phone {
  width: 390px; height: 760px; flex: 0 0 390px; background: #fff; border-radius: 36px;
  border: 10px solid #12182a; box-shadow: var(--shadow-lg); overflow: hidden; position: relative; display: flex; flex-direction: column;
}
.phone-status { height: 26px; flex: 0 0 26px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-size: 11px; color: var(--ink-2); font-weight: 600; }
.phone-bar { height: 44px; flex: 0 0 44px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 12px; gap: 8px; font-weight: 700; font-size: 14px; }
.phone-body { flex: 1; overflow-y: auto; background: #f7f8fc; }
.phone-foot { flex: 0 0 auto; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.phone-nav { display: flex; border-top: 1px solid var(--line); background: #fff; flex: 0 0 56px; }
.phone-nav div { flex: 1; display: grid; place-items: center; font-size: 10.5px; color: var(--ink-3); gap: 2px; cursor: pointer; }
.phone-nav div.on { color: var(--brand); font-weight: 700; }
.phone-nav i { font-style: normal; font-size: 17px; }

.aside-note { flex: 1; min-width: 300px; }
.note-list > div { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.note-list > div:last-child { border-bottom: none; }
.note-no { width: 20px; height: 20px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: 0 0 20px; margin-top: 2px; }

/* 对话 */
.chat { padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; max-width: 88%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .av { width: 28px; height: 28px; border-radius: 9px; flex: 0 0 28px; display: grid; place-items: center; font-size: 13px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.msg.me .av { background: #dfe4ee; color: var(--ink-2); }
.bubble { background: #fff; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.68; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.msg.me .bubble { background: var(--brand); color: #fff; }
.opts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.opt { padding: 7px 12px; border: 1px solid var(--brand); color: var(--brand); border-radius: 999px; font-size: 12.5px; background: #fff; font-weight: 600; }
.opt:hover { background: var(--brand-soft); }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #b6bfd0; margin-right: 3px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .25 } 30% { opacity: 1 } }

/* 报告页 */
.report { padding: 14px 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.score-ring { display: grid; place-items: center; position: relative; }
.ring-bg { fill: none; stroke: #eef0f5; stroke-width: 10; }
.ring-fg { fill: none; stroke: url(#g1); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.dir-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.dir-card.top { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,94,255,.08); }
.dir-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dir-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 7px; }
.bar-row .nm { width: 76px; color: var(--ink-2); flex: 0 0 76px; }
.bar-row .pg { flex: 1; }
.bar-row .vl { width: 34px; text-align: right; font-weight: 700; flex: 0 0 34px; }
.issue { border-left: 3px solid var(--warn); background: #fffdf7; padding: 10px 12px; border-radius: 0 10px 10px 0; margin-bottom: 10px; }
.issue.good { border-color: var(--ok); background: #f6fefa; }
.issue.quote { border-color: var(--brand); background: var(--brand-soft); }
.issue h5 { margin: 0 0 5px; font-size: 13px; }
.issue .q { font-weight: 600; color: var(--ink); background: #fff; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.cta-box { background: linear-gradient(135deg, #0d1b3e, #1f3f8f); color: #fff; border-radius: 14px; padding: 16px; }
.cta-box h4 { margin: 0 0 6px; font-size: 15px; }
.cta-box p { margin: 0 0 12px; font-size: 12.5px; opacity: .82; }

.job-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; margin-bottom: 10px; }
.job-hd { display: flex; gap: 8px; align-items: flex-start; }
.job-score { font-size: 19px; font-weight: 800; line-height: 1; }

/* 后台图表 */
.chart { width: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.funnel-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.funnel-row .nm { width: 130px; flex: 0 0 130px; font-size: 13px; }
.funnel-row .bar { flex: 1; height: 30px; background: #f4f6fa; border-radius: 8px; overflow: hidden; }
.funnel-row .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 8px; transition: width .9s ease; }
.funnel-row .vv { width: 96px; text-align: right; font-weight: 700; flex: 0 0 96px; font-size: 13px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 34px; background: #0d1424; color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow-lg); z-index: 999; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 10px) } }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px rgba(18,183,106,.18); }

.qa-item { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.qa-item:last-child { border: none; }
.opt-row { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; margin-top: 6px; cursor: pointer; font-size: 13px; }
.opt-row:hover { border-color: #c3cbdb; }
.opt-row.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt-row.right { border-color: var(--ok); background: #f2fbf6; }
.opt-row.wrong { border-color: var(--bad); background: #fef4f3; }
.k { font-weight: 700; flex: 0 0 16px; }

.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); margin-right: 5px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }