/* 相亲销售助手：电脑端为主的内部后台 */
:root {
  --bg: #f6f5f3; --panel: #ffffff; --line: #e7e3de; --line-strong: #d6d0c8;
  --fg: #1f1d1a; --muted: #6b665f; --faint: #9a948b;
  --accent: #b23a48; --accent-soft: #f8e8ea; --accent-ink: #8e2a37;
  --ok: #2f7d4f; --ok-soft: #e6f2ea; --warn: #9a5b06; --warn-soft: #fbf0dc;
  --bad: #b42318; --bad-soft: #fdeceb; --info: #2b5c9e; --info-soft: #e8eef8;
  --say: #f3efe9; --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.6; color: var(--fg); background: var(--bg); }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* 整体布局 */
.layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px; gap: 18px; }
.brand { padding: 0 8px; }
.brand b { display: block; font-size: 16px; color: var(--accent-ink); }
.brand span { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 6px;
  color: var(--fg); }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav .badge { font-size: 12px; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; }
.nav-title { font-size: 12px; color: var(--faint); padding: 10px 10px 4px; }
.side-foot { margin-top: auto; padding: 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.main { padding: 24px 32px 48px; max-width: 1320px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* 卡片、提示、空状态 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.flash { padding: 10px 14px; border-radius: var(--radius); border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: #c6e2cf; color: #1f5a37; }
.flash.err { background: var(--bad-soft); border-color: #f3c6c2; color: #8c1d13; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); }
.focus { background: var(--accent-soft); border: 1px solid #efd0d4; border-radius: var(--radius); padding: 12px 16px;
  display: flex; gap: 10px; align-items: baseline; }
.focus b { color: var(--accent-ink); white-space: nowrap; }

/* 数字块 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.tile .value small { font-size: 13px; font-weight: 400; color: var(--muted); }
.tile .note { font-size: 12px; color: var(--faint); }
.tile.alert .value { color: var(--bad); }

/* 标签 */
.pill { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--muted); background: var(--panel); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 按钮和表单 */
.btn { font: inherit; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--fg); white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--info); padding: 0; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--info); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 6px 10px; min-width: 0; }
textarea { width: 100%; min-height: 72px; resize: vertical; }
label { color: var(--muted); font-size: 13px; }
.inline { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.filters .field { display: flex; flex-direction: column; gap: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; align-items: end; }
.form-grid .field { display: flex; flex-direction: column; gap: 2px; }

/* 表格 */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; white-space: nowrap; background: #fbfaf8; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; }
td .strong-bad { color: var(--bad); font-weight: 600; }

/* 话术 */
.say { background: var(--say); border-radius: 4px; padding: 1px 3px; }
.say-box { background: var(--say); border-radius: var(--radius); padding: 10px 12px; line-height: 1.7; }

/* 今天要跟进：左列表右详情 */
.split { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.todo-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.todo-list .head { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.todo { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--fg); }
.todo:last-child { border-bottom: 0; }
.todo:hover { background: var(--bg); text-decoration: none; }
.todo.on { background: var(--accent-soft); }
.todo .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.todo .who { font-weight: 600; }
.todo .what { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail { position: sticky; top: 16px; }
.kv { display: flex; flex-direction: column; gap: 4px; }
.kv > .k { font-size: 12px; color: var(--faint); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 复盘卡片 */
.review-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.col h3 { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.col h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.col.good h3::before { background: var(--ok); } .col.bad h3::before { background: var(--bad); }
.col.fix h3::before { background: var(--accent); }
.col ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.7; }
.call-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; color: var(--fg); }
.call-card:hover { border-color: var(--line-strong); text-decoration: none; }
.call-card .top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.call-card .result { font-weight: 600; font-size: 15px; }
.call-card .problem { color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.next-box { background: #fbfaf8; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.alert-box { background: var(--warn-soft); border-radius: var(--radius); padding: 10px 12px; color: #6b3f04; }

/* 共性问题 */
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: i; }
.issues li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 10px; counter-increment: i; }
.issues li::before { content: counter(i); grid-row: span 3; font-size: 18px; font-weight: 600; color: var(--accent); }
.issues .eg { color: var(--muted); }

/* 文字稿 */
.transcript { display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; padding-right: 6px; }
.line { display: grid; grid-template-columns: 44px 40px minmax(0, 1fr); gap: 8px; font-size: 13px; line-height: 1.7; }
.line .t { color: var(--faint); font-variant-numeric: tabular-nums; }
.line .r { font-weight: 600; color: var(--muted); }
.line.sales .r { color: var(--accent-ink); }
audio { width: 100%; max-width: 560px; }

/* 分页 */
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; }
.login .card { gap: 14px; padding: 28px; }
.login .field { display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .split { grid-template-columns: 1fr; }
  .detail { position: static; }
  .main { padding: 16px; }
}
@media print { .side, .filters, .actions, form { display: none !important; } .layout { display: block; } }
.nowrap th, .nowrap td { white-space: nowrap; }
