/* 百炼业务辅助平台 · 界面（手机优先，一套代码两套排版）
   模式由 <html data-mode="mobile|desktop"> 决定，JS 在 <head> 里同步设置，避免闪版。 */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --brand: #2f6bd8;
  --brand-dark: #2456b4;
  --brand-ink: #ffffff;
  --line: #e6e8ee;
  --ok: #1f9d55;
  --warn: #c47f00;
  --bad: #cf3b3b;
  --warn-bg: #fdf3e2;
  --soft: #f2f6fd;
  --soft-line: #dbe6f8;
  --r-card: 14px;
  --r-ctl: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 16px; line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
.hidden { display: none !important; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30; min-height: 52px;
}
.topbar .brand { font-weight: 800; font-size: 15px; letter-spacing: .3px; white-space: nowrap; }
.topbar .who { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: #3b4250; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar .nav { display: none; gap: 8px; align-items: center; }
.drawer-mask { position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 40; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 76%; max-width: 300px;
  background: #fff; z-index: 41; box-shadow: -8px 0 24px rgba(16,24,40,.16);
  display: flex; flex-direction: column; padding: 14px; overflow-y: auto;
}
.drawer h4 { margin: 4px 0 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.drawer button, .drawer a {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 13px 10px; border-radius: 10px; font-size: 15px; color: var(--ink);
  text-decoration: none;
}
.drawer button:hover { background: var(--soft); }
.drawer .sep { height: 1px; background: var(--line); margin: 8px 0; }
.drawer .close { margin-top: auto; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- 容器 / 卡片 ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 14px 12px 24px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px; margin-bottom: 12px;
}
.card h2 { margin: 0 0 10px; font-size: 17px; }
.card h3 { margin: 14px 0 8px; font-size: 15px; }

/* ---------- 表单控件 ---------- */
.field, .lbl { display: block; margin: 12px 0 5px; font-size: 12.5px; color: var(--muted); }
.lbl .opt { color: #a8aeba; }
input[type=text], input[type=password], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: var(--r-ctl); background: #fff; outline: none;
  font-size: 16px; color: var(--ink); min-height: 44px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,107,216,.12); }
input::placeholder, textarea::placeholder { color: #9aa1ae; }
:focus-visible { outline: 2px solid #9db9ee; outline-offset: 1px; }
textarea { min-height: 64px; resize: vertical; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: var(--r-ctl); border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 15px;
  min-height: 44px;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); font-weight: 600; }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.danger { background: #fff; color: #c0392b; border-color: #efc3bc; font-weight: 600; }
.btn.danger:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn.small { padding: 7px 12px; font-size: 13px; font-weight: 600; min-height: 36px; border-radius: 9px; }
.btn.big { width: 100%; padding: 15px; font-size: 16.5px; border-radius: 11px; }
.btn.soft { background: var(--soft); color: #2b4a7d; border-color: var(--soft-line); font-weight: 600; }

/* ---------- chip / badge ---------- */
.chip { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef2fb; color: var(--brand); font-size: 12px; }
.chip.gray { background: #eef0f4; color: #556; }
.badge { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.badge.ok { background: #e6f6ec; color: var(--ok); }
.badge.half { background: var(--warn-bg); color: var(--warn); }
.badge.no { background: #fdecec; color: var(--bad); }
.badge.gray { background: #eef0f4; color: #666; }

/* ---------- 登录 ---------- */
.auth { max-width: 460px; margin: 0 auto; }
.auth-hero {
  text-align: center; padding: 10px 8px 6px;
  background: radial-gradient(120% 90% at 50% 0%, #e7effc 0%, rgba(245,246,248,0) 68%);
}
.auth-hero .mark {
  width: 50px; height: 50px; border-radius: 15px; margin: 0 auto 10px;
  background: linear-gradient(160deg, #3f7ae6, #2456b4); color: #fff;
  font-size: 19px; letter-spacing: .5px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(47,107,216,.32);
}
.auth-hero .brand-name { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.auth-hero .slogan { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 2px 12px rgba(24,32,50,.05); }
.auth-card .cta { width: 100%; background: var(--brand); color: #fff; border: 0; border-radius: 11px; padding: 14px; font-size: 16px; font-weight: 700; box-shadow: 0 4px 12px rgba(47,107,216,.22); }
.auth-card .cta.ghost { background: #fff; color: var(--brand); border: 1px solid #c5d5f2; box-shadow: none; }
.auth-or { display: flex; align-items: center; gap: 9px; margin: 14px 0 10px; color: #aab1bd; font-size: 11.5px; }
.auth-or:before, .auth-or:after { content: ""; flex: 1; height: 1px; background: #eceff4; }
.auth-note { background: var(--soft); border: 1px solid var(--soft-line); border-radius: 10px; padding: 9px 10px; margin-top: 12px; font-size: 12px; color: #3d4a63; }
.auth-note b { color: #1f3f77; }
.login-err { color: var(--bad); font-size: 12.5px; margin-top: 8px; min-height: 16px; }
.app-foot { text-align: center; font-size: 12px; color: #9aa1ae; padding: 14px 6px 4px; line-height: 1.9; }
.app-foot .lk { color: #6b7280; text-decoration: none; }
.app-foot .sw { color: var(--brand); font-weight: 600; background: none; border: 0; font-size: 12px; padding: 0 4px; }
.app-foot .icp-line { margin-top: -2px; }
.app-foot .icp { color: #6b7280; text-decoration: none; border-bottom: 1px dotted #c9cfda; }
.app-foot .icp:hover { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- 首页参数 ---------- */
.home-lead { display: flex; gap: 8px; background: var(--soft); border: 1px solid var(--soft-line); border-radius: 11px; padding: 10px 11px; margin-bottom: 10px; }
.home-lead .tx { flex: 1; font-size: 12.5px; color: #3d4a63; }
.home-lead .tx b { color: #1f3f77; }
.param { margin-bottom: 11px; }
.param .lbl { margin: 0 0 5px; display: flex; align-items: center; gap: 6px; }
.param .lbl .tag { margin-left: auto; font-size: 11px; color: #9aa1ae; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; background: #fff; }
.seg button, .seg div {
  flex: 1; text-align: center; padding: 10px 2px; font-size: 13.5px; color: #4b5563;
  background: #fff; border: 0; border-right: 1px solid var(--line); white-space: nowrap;
}
.seg button:last-child, .seg div:last-child { border-right: 0; }
.seg button.on, .seg div.on { background: var(--brand); color: #fff; font-weight: 700; }
.seg.tight button { font-size: 12.5px; padding: 9px 1px; }
.cta-sticky {
  position: sticky; bottom: 0; padding: 10px 0 12px; margin-top: 4px;
  background: linear-gradient(to top, var(--bg) 62%, rgba(245,246,248,0));
}
.cta-sticky .btn { width: 100%; padding: 15px; font-size: 16.5px; border-radius: 12px; box-shadow: 0 6px 16px rgba(47,107,216,.24); }

/* ---------- 对练 ---------- */
.chat-shell {
  display: flex; flex-direction: column;
  height: 100dvh; max-height: 100dvh;
  background: var(--bg);
}
.chat-status {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: #eef2fb; border-bottom: 1px solid var(--line); font-size: 12px; color: #3f4d68;
  flex: 0 0 auto;
}
.chat-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.chat-scene {
  padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--muted); line-height: 1.5; flex: 0 0 auto;
}
.chat-scene b { color: #3d4a63; }
.chat-body {
  flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.chat-foot { flex: 0 0 auto; background: #fff; border-top: 1px solid var(--line); padding: 8px 10px 10px; }

.msg { display: flex; flex-direction: column; gap: 2px; max-width: 88%; }
.msg .who { font-size: 10.5px; color: #9aa1ae; padding: 0 4px; }
.msg .bubble { padding: 9px 12px; border-radius: 14px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg.customer { align-self: flex-start; }
.msg.customer .bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.consultant { align-self: flex-end; align-items: flex-end; }
.msg.consultant .bubble { background: var(--brand); color: #fff; border-top-right-radius: 4px; }
.msg.system { align-self: stretch; max-width: 100%; }
.msg.system .bubble { background: #fffaf0; border: 1px dashed #e0c98a; color: #5f5433; border-radius: 12px; font-size: 13px; }
.msg.system .who { color: #a98a3a; font-weight: 700; }
.typing { color: var(--muted); font-size: 12.5px; padding: 2px 4px; }
.chat-foot .send-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-foot textarea { min-height: 46px; max-height: 120px; }
.chat-foot .send { flex: 0 0 auto; min-width: 76px; }
.chat-foot .end { flex: 0 0 auto; }

/* ---------- 复盘 ---------- */
.rep-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rep-head h2 { margin: 0; font-size: 17px; }
.verdict { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.vbadge { font-size: 12.5px; font-weight: 800; padding: 5px 11px; border-radius: 999px; }
.vbadge.ok { background: #e6f6ec; color: var(--ok); }
.vbadge.half { background: var(--warn-bg); color: var(--warn); }
.vbadge.no { background: #fdecec; color: var(--bad); }
.vbadge.gray { background: #eef0f4; color: #666; }
.vscore { font-size: 12.5px; color: var(--muted); }
.vscore b { font-size: 17px; color: var(--ink); }
.vsum { font-size: 13.5px; color: #3d4a63; line-height: 1.6; margin: 0 0 4px; }

.dims { display: flex; flex-direction: column; gap: 9px; }
.dim { border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; background: #fff; }
.dim-top { display: flex; align-items: baseline; gap: 8px; }
.dim-name { font-weight: 700; font-size: 14px; }
.dim-score { margin-left: auto; font-size: 15px; font-weight: 800; color: var(--brand); }
.dim-score small { font-size: 11px; color: var(--muted); font-weight: 400; }
.dim-ticks { display: flex; gap: 4px; margin: 6px 0 5px; }
.dim-ticks i { flex: 1; height: 5px; border-radius: 3px; background: #edf0f5; }
.dim-ticks i.on { background: var(--brand); }
.dim-note { margin: 0; font-size: 12.5px; color: #4b5563; line-height: 1.55; }
.dims-total { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }

.fold { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-top: 12px; overflow: hidden; }
.fold > summary { list-style: none; cursor: pointer; padding: 13px 14px; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .arw { margin-left: auto; color: #9aa1ae; font-size: 12px; transition: transform .15s; }
.fold[open] > summary .arw { transform: rotate(180deg); }
.fold .fold-body { padding: 0 14px 14px; }
.rep-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rep-actions .btn { width: 100%; }

/* 报告正文（保留原 markdown 渲染类） */
.report { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.75; }
.report h1, .report h2, .report h3 { font-size: 15px; margin: 14px 0 6px; }
.demo-body { margin-top: 6px; font-size: 14px; line-height: 1.7; }
.demo-body .kbt { font-weight: 700; margin: 10px 0 4px; }
.kbp { margin: 2px 0; }
.kbl { position: relative; padding-left: 16px; margin: 3px 0; }
.kbl:before { content: '•'; position: absolute; left: 4px; color: var(--brand); }
.kbn { padding-left: 4px; }
.kbn:before { content: none; }
.kbgap { height: 6px; }
.kba { color: #64748b; font-size: 13px; line-height: 1.6; margin: 2px 0 8px 14px; border-left: 2px solid #dbe7ff; padding-left: 9px; }
.rtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 12px; overflow-x: auto; }
.rtab { border: 0; background: none; padding: 10px 6px; margin-right: 14px; font-size: 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.rtab.on { color: var(--brand); border-bottom-color: var(--brand); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 26px rgba(16,24,40,.16); min-width: 200px; z-index: 60; padding: 6px; text-align: left; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: #243b53; }
.menu button:hover { background: #eef4ff; color: #1e3a8a; }

/* ---------- 看板 ---------- */
.kb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kb-num { background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kb-num .v { font-size: 22px; font-weight: 700; color: var(--brand); line-height: 1.2; }
.kb-num .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kb-sec { margin-top: 16px; }
.kb-sec > h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.kb-chart { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; overflow: auto; }
.kb-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.kb-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.kb-card .kbt { font-weight: 700; margin-bottom: 6px; color: var(--ink); }

/* ---------- 记录 / 管理 ---------- */
.list-item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.list-item.click { cursor: pointer; border-radius: 8px; }
.list-item.click:hover { background: #f5f8fd; }
.group-head { font-weight: 700; color: var(--muted); margin: 16px 0 6px; font-size: 13.5px; border-left: 3px solid var(--brand); padding-left: 8px; }
.group-head:first-child { margin-top: 4px; }
.mini { border: none; background: transparent; cursor: pointer; font-size: 13px; padding: 0 4px; color: var(--brand); }

/* ---------- 对话框 / 提示 ---------- */
.dialog-mask { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: #fff; border-radius: 16px; padding: 16px; width: 100%; max-width: 400px; }
.dialog h3 { margin: 0 0 8px; font-size: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #222; color: #fff; padding: 10px 16px; border-radius: 10px;
  opacity: .95; z-index: 99; max-width: 90%; font-size: 14px;
}

/* ---------- 试用弹窗 ---------- */
.trial-box { text-align: center; }
.trial-box .qr {
  width: 150px; height: 150px; margin: 10px auto; border: 1px dashed var(--line);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: #9aa1ae; font-size: 12px; background: #fafbfd; overflow: hidden;
}
.trial-box .qr img { width: 100%; height: 100%; object-fit: contain; }
.trial-box .phone { font-size: 17px; font-weight: 800; color: var(--brand); letter-spacing: .5px; margin: 6px 0; }
.trial-box .lead { font-size: 13px; color: #3d4a63; line-height: 1.6; margin: 4px 0 2px; }
.watermark { position: relative; }
.watermark:after {
  content: "试 用"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 64px; font-weight: 900; color: rgba(47,107,216,.10); transform: rotate(-22deg);
  pointer-events: none; letter-spacing: 8px;
}

/* ================= 电脑版排版 ================= */
html[data-mode="desktop"] .topbar { min-height: 58px; padding: 10px 22px; }
html[data-mode="desktop"] .topbar .nav { display: flex; }
html[data-mode="desktop"] .topbar .brand { font-size: 16px; }
html[data-mode="desktop"] #btn-menu { display: none; }
html[data-mode="desktop"] .drawer, html[data-mode="desktop"] .drawer-mask { display: none !important; }
html[data-mode="desktop"] .wrap { max-width: 1180px; padding: 20px 24px 40px; }
html[data-mode="desktop"] .card { padding: 20px; border-radius: 16px; margin-bottom: 16px; }
html[data-mode="desktop"] .auth { max-width: 460px; }
html[data-mode="desktop"] .auth-hero { padding: 40px 8px 16px; }
html[data-mode="desktop"] .auth-hero .brand-name { font-size: 22px; }
html[data-mode="desktop"] .home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
html[data-mode="desktop"] .home-grid .full { grid-column: 1 / -1; }
html[data-mode="desktop"] .cta-sticky { position: static; background: none; padding-top: 10px; }
html[data-mode="desktop"] .cta-sticky .btn { width: auto; min-width: 260px; }
html[data-mode="desktop"] .seg button:hover { background: #eef4ff; color: var(--brand); }
html[data-mode="desktop"] .seg button.on:hover { background: var(--brand); color: #fff; }
html[data-mode="desktop"] .btn:hover { background: var(--brand-dark); }
html[data-mode="desktop"] .btn.ghost:hover { background: #fff; color: var(--brand); }

/* 电脑版对练：聊天区限宽居中 */
html[data-mode="desktop"] .chat-shell { height: calc(100dvh - 58px); }
html[data-mode="desktop"] .chat-status,
html[data-mode="desktop"] .chat-scene { padding-left: max(24px, calc(50% - 380px)); padding-right: max(24px, calc(50% - 380px)); }
html[data-mode="desktop"] .chat-body { padding: 18px max(24px, calc(50% - 380px)); }
html[data-mode="desktop"] .chat-foot { padding: 12px max(24px, calc(50% - 380px)) 16px; }
html[data-mode="desktop"] .chat-foot .send-row { max-width: 760px; margin: 0 auto; }
html[data-mode="desktop"] .chat-foot textarea { min-height: 56px; }
html[data-mode="desktop"] .msg { max-width: 76%; }

/* 电脑版复盘：左右对照 */
html[data-mode="desktop"] .report-2col { display: grid; grid-template-columns: 1fr 430px; gap: 18px; align-items: start; }
html[data-mode="desktop"] .report-2col .col-left { min-width: 0; }
html[data-mode="desktop"] .report-2col .col-right { position: sticky; top: 74px; }
html[data-mode="desktop"] .dims { gap: 10px; }
html[data-mode="desktop"] .dim-note { font-size: 13px; }
html[data-mode="desktop"] .rep-actions { flex-direction: row; flex-wrap: wrap; }
html[data-mode="desktop"] .rep-actions .btn { width: auto; flex: 1; min-width: 180px; }
html[data-mode="desktop"] .kb-cards { grid-template-columns: 1fr 1fr; }
html[data-mode="desktop"] .kb-grid { grid-template-columns: repeat(4, 1fr); }

/* 电脑版记录表格 */
html[data-mode="desktop"] .rec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
html[data-mode="desktop"] .rec-table th { text-align: left; padding: 10px; background: #f7f9fd; color: #44506a; font-size: 12.5px; font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
html[data-mode="desktop"] .rec-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
html[data-mode="desktop"] .rec-table tr:hover td { background: #f8fafe; }

@media (max-width: 380px) {
  .wrap { padding: 12px 10px 20px; }
  .seg button { font-size: 12.5px; padding: 9px 1px; }
  .topbar .brand { font-size: 14px; }
}

/* ---------- 模块大厅（登录后第一屏） ---------- */
.portal { max-width: 520px; margin: 0 auto; padding-top: 6px; }
.portal-head { padding: 8px 4px 14px; }
.portal-head .ph-t { font-size: 20px; font-weight: 800; letter-spacing: .3px; }
.portal-head .ph-s { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.pcard {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 18px; margin-bottom: 12px; min-height: 104px;
  box-shadow: 0 2px 12px rgba(24,32,50,.05); color: var(--ink);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.pcard:not(.soon):hover { border-color: #c5d5f2; box-shadow: 0 8px 22px rgba(47,107,216,.14); transform: translateY(-1px); }
.pcard:not(.soon):active { transform: translateY(0); }
.pcard .pc-ico {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: linear-gradient(160deg, #eaf1fd, #dbe7fb);
}
.pcard .pc-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pcard .pc-tx b { font-size: 17.5px; font-weight: 800; letter-spacing: .3px; }
.pcard .pc-tx small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pcard .pc-arw { margin-left: auto; color: #9aa1ae; font-size: 22px; line-height: 1; flex: 0 0 auto; }
.pcard .pc-tag {
  margin-left: auto; flex: 0 0 auto; font-size: 11.5px; font-weight: 600;
  color: #8a92a2; background: #f1f3f7; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.pcard.soon { background: #fbfcfe; box-shadow: none; }
.pcard.soon .pc-ico { background: #f1f3f7; opacity: .8; }
.pcard.soon .pc-tx b { color: #6b7280; font-size: 16.5px; }
.pcard[disabled] { cursor: default; }
.portal-foot { text-align: center; font-size: 12px; color: #9aa1ae; padding: 10px 4px 2px; }
html[data-mode="desktop"] .portal { max-width: 560px; }
html[data-mode="desktop"] .pcard { padding: 22px 20px; min-height: 112px; }

/* 电脑版：大厅内容垂直居中，别显得空旷 */
html[data-mode="desktop"] #view-portal { min-height: calc(100dvh - 168px); display: flex; align-items: center; justify-content: center; }
html[data-mode="desktop"] .portal { width: 100%; max-width: 520px; padding-top: 0; }
html[data-mode="desktop"] .pcard { min-height: 132px; padding: 24px 22px; margin-bottom: 16px; }
html[data-mode="desktop"] .pcard .pc-ico { width: 58px; height: 58px; font-size: 27px; }
html[data-mode="desktop"] .pcard .pc-tx b { font-size: 18.5px; }
html[data-mode="desktop"] .pcard .pc-tx small { font-size: 13px; }
html[data-mode="desktop"] .portal-head .ph-t { font-size: 22px; }
html[data-mode="desktop"] .portal-foot { color: #8b93a2; }

/* ---------- 改进点汇总（卡片，替代四列表格） ---------- */
.imps { display: grid; grid-template-columns: 1fr; gap: 10px; }
.imp { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 11px; box-shadow: 0 2px 8px rgba(24,32,50,.04); }
.imp .top { display: flex; gap: 9px; align-items: flex-start; }
.imp .no { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; background: #eef2fb; color: var(--brand); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.imp .said { font-size: 15px; font-weight: 700; line-height: 1.5; letter-spacing: .2px; }
.imp .said span { color: var(--muted); font-weight: 400; font-size: 12px; display: block; margin-bottom: 1px; }
.imp .rows { margin-top: 11px; border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 9px; }
.imp .row { display: flex; gap: 8px; align-items: flex-start; }
.imp .row .k { flex: 0 0 58px; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 0; text-align: center; }
.imp .row .k.mine { background: #eef2fb; color: #2b4a7d; }
.imp .row .k.why { background: #fdecec; color: var(--bad); }
.imp .row .k.fix { background: #e6f6ec; color: var(--ok); }
.imp .row .v { flex: 1; font-size: 13.5px; line-height: 1.62; color: #334155; }
.imp .row .v.q { color: #475569; }
.imp .fixline { background: #f4fbf6; border: 1px solid #d9f0e1; border-left: 3px solid #7fc59b; border-radius: 9px; padding: 9px 11px; margin-top: 2px; }
.imp-group { margin-bottom: 16px; }
.imp-gh { font-size: 13px; font-weight: 700; color: #44506a; border-left: 3px solid var(--brand); padding-left: 8px; margin: 6px 0 10px; }
html[data-mode="desktop"] .imps { grid-template-columns: 1fr 1fr; gap: 14px; }
html[data-mode="desktop"] .imp { padding: 16px 16px 14px; }
html[data-mode="desktop"] .imp .said { font-size: 15.5px; }
html[data-mode="desktop"] .imp .row .v { font-size: 14px; }

/* ---------- 完整复盘：章节卡片 ---------- */
.secs { display: flex; flex-direction: column; gap: 10px; }
.sec { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 13px 12px; box-shadow: 0 2px 8px rgba(24,32,50,.04); }
.sec-head { display: flex; gap: 9px; align-items: center; margin-bottom: 9px; }
.sec-head .no { width: 24px; height: 24px; border-radius: 8px; background: #eef2fb; color: var(--brand); font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sec-head .t { font-size: 15px; font-weight: 800; letter-spacing: .2px; }
.sec-body { font-size: 13.8px; line-height: 1.72; color: #334155; }
.sec-body .kbp { margin: 3px 0; }
.sec-body .kbt { font-weight: 700; margin: 10px 0 4px; color: #1f2430; font-size: 13.8px; }
.sec-body .kbl { margin: 4px 0; }
.sec-body .kba { font-size: 13px; }
.mini-dims { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.mini-dim { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: #fbfcfe; }
.mini-dim .md-name { font-weight: 700; font-size: 13.5px; }
.mini-dim .md-star { color: #c47f00; font-size: 13px; letter-spacing: 1px; margin: 1px 0 2px; }
.mini-dim .md-note { font-size: 13px; color: #475569; line-height: 1.6; }
.tbl-wrap { overflow-x: auto; margin: 8px 0; }
.tbl { border-collapse: collapse; width: 100%; font-size: 12.8px; }
.tbl th { background: #f7f9fd; text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; color: #44506a; }
.tbl td { padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.6; }
html[data-mode="desktop"] .sec-body { font-size: 14px; }
html[data-mode="desktop"] .secs { gap: 12px; }

/* ---------- 试用：介绍弹窗 / 复盘页进度条 ---------- */
.tround { display: flex; gap: 11px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 9px; background: #fbfcfe; }
.tr-no { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; background: #eef2fb; color: var(--brand); font-size: 12.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tr-tx b { display: block; font-size: 14px; line-height: 1.5; }
.tr-tx small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.tnotice { font-size: 11.5px; color: #8a92a2; background: #f5f7fb; border-radius: 8px; padding: 7px 9px; margin-top: 4px; }
.trial-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--soft); border: 1px solid var(--soft-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.trial-bar .tb-tx { flex: 1; min-width: 200px; font-size: 12.5px; color: #2b4a7d; line-height: 1.5; }
.trial-bar .tb-tx b { color: #1f3f77; }
html[data-mode="desktop"] .trial-bar .tb-tx { font-size: 13px; }

/* ---------- 对练：电脑版整块做成居中卡片（不再是一条窄缝＋两侧大片空白） ---------- */
html[data-mode="desktop"] #view-chat { margin: 0; }
html[data-mode="desktop"] .chat-shell {
  height: calc(100dvh - 116px);
  max-width: 1040px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 24px rgba(24,32,50,.06);
}
html[data-mode="desktop"] .chat-status {
  padding: 10px 20px;
  background: #f4f7fd;
  border-bottom: 1px solid var(--line);
}
html[data-mode="desktop"] .chat-scene { padding: 11px 20px; font-size: 12.5px; }
html[data-mode="desktop"] .chat-body { padding: 20px 24px; background: #fff; gap: 12px; }
html[data-mode="desktop"] .chat-foot { padding: 12px 20px 16px; background: #fbfcfe; border-top: 1px solid var(--line); }
html[data-mode="desktop"] .chat-foot .send-row { max-width: none; }
html[data-mode="desktop"] .chat-body .msg { max-width: 72%; }
html[data-mode="desktop"] .chat-body .msg.system { max-width: 100%; }
html[data-mode="desktop"] .msg .bubble { font-size: 15px; }
html[data-mode="desktop"] .msg.system .bubble { padding: 14px 16px; line-height: 1.75; }

/* 开场提示：再松一点 */
html[data-mode="desktop"] .msg.system .bubble { padding: 16px 18px; border-radius: 14px; font-size: 13.5px; }
/* 电脑版对练：卡片内的滚动条更细 */
html[data-mode="desktop"] .chat-body::-webkit-scrollbar { width: 10px; }
html[data-mode="desktop"] .chat-body::-webkit-scrollbar-thumb { background: #dfe4ee; border-radius: 6px; border: 3px solid #fff; }

/* 电脑版：开始对练按钮居中 */
html[data-mode="desktop"] .cta-sticky { display: flex; justify-content: center; padding-top: 16px; }
html[data-mode="desktop"] .cta-sticky .btn { min-width: 340px; padding: 16px 28px; }
html[data-mode="desktop"] .cta-hint { text-align: center; }

/* 通用确认对话框 */
.ask-body { font-size: 13.5px; line-height: 1.7; color: #3d4a63; white-space: pre-wrap; margin: 2px 0 4px; }
.ask-actions { justify-content: flex-end; margin-top: 14px; gap: 8px; }

/* 电脑版：各页面主操作按钮统一居中 */
html[data-mode="desktop"] .rep-actions { justify-content: center; }
html[data-mode="desktop"] .rep-actions .btn { flex: 0 0 auto; min-width: 240px; }
html[data-mode="desktop"] .auth-card .row { justify-content: center; }
html[data-mode="desktop"] .ask-actions { justify-content: center; }
html[data-mode="desktop"] .dialog .row { justify-content: center; }

/* 账号剩余天数（只在最后 5 天出现） */
.chip.warn { background: #fdf3e2; color: #c47f00; font-weight: 700; }
.chip.warn.hot { background: #fdecec; color: #cf3b3b; }

/* 管理页标签 */
.adm-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-tabs .atab { flex: 1; min-width: 68px; height: 34px; border-radius: 9px; border: 1px solid #e6e8ee;
  background: #fff; color: #4b5563; font-size: 13px; font-weight: 600; cursor: pointer; }
.adm-tabs .atab.on { background: #2f6bd8; border-color: #2f6bd8; color: #fff; }

/* 到期提醒条（只在最后 5 天出现） */
.expire-banner { position: sticky; top: 0; z-index: 40; display: flex; align-items: flex-start; gap: 8px;
  background: #fdf3e2; border-bottom: 1px solid #f0dcb8; color: #7a5200; padding: 9px 12px; font-size: 12.5px; line-height: 1.6; }
.expire-banner .eb-tx { flex: 1; }
.expire-banner .eb-close { border: 0; background: transparent; color: #a98545; font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; }
.expire-banner.hot { background: #fdecec; border-bottom-color: #f3c9c9; color: #9b2c2c; }
.expire-banner.hot .eb-close { color: #c07a7a; }
