/* 金嘉创新港 · 招商模拟谈判训练系统 — 样式（浅色主题） */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-strong: #cfd8e3;
  --text: #1b2430;
  --text-2: #5a6675;
  --text-3: #8b96a5;
  --brand: #0b4f9e;
  --brand-soft: #e8f1fd;
  --brand-2: #1a73e8;
  --green: #1a7f4b;
  --green-soft: #e7f5ec;
  --amber: #a16207;
  --amber-soft: #fdf5e3;
  --red: #c0392b;
  --red-soft: #fdecea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.12);
  --nav-h: 60px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.35; font-weight: 650; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.boot { padding: 80px 20px; text-align: center; color: var(--text-2); }

/* ── 布局 ── */
.app-root { min-height: 100%; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex: 0 0 224px; background: #0f2744; color: #d7e3f4;
  padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.sidebar .brand { font-size: 15px; font-weight: 700; color: #fff; padding: 6px 10px 14px; line-height: 1.4; }
.sidebar .brand small { display: block; font-weight: 400; font-size: 12px; color: #8fabce; margin-top: 4px; }
.sidebar a.nav-item {
  display: block; padding: 9px 12px; border-radius: 8px; color: #c8d8ee; font-size: 14px;
}
.sidebar a.nav-item:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.sidebar a.nav-item.active { background: var(--brand-2); color: #fff; font-weight: 600; }
.sidebar .spacer { flex: 1; }
.sidebar .who { font-size: 12px; color: #8fabce; padding: 10px; border-top: 1px solid rgba(255,255,255,.1); }

.main { flex: 1; min-width: 0; padding: 22px 26px 90px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); font-size: 13px; }

/* 手机端底部导航 */
.bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h);
  background: var(--surface); border-top: 1px solid var(--border); z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-3); gap: 2px;
}
.bottom-nav a.active { color: var(--brand); font-weight: 600; }
.bottom-nav a span.ico { font-size: 18px; line-height: 1; }

/* ── 卡片 ── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.card.tight { padding: 12px 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--text-2); font-size: 13px; }
.tiny { color: var(--text-3); font-size: 12px; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 10px; }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 9px 15px; border-radius: 9px; font-size: 14px; font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #0a4488; }
.btn.danger { background: #fff; border-color: #e6b3ad; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ── 表单 ── */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 9px;
  font-size: 15px; font-family: inherit; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { resize: vertical; min-height: 76px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 16px; height: 16px; }

/* ── 徽章 / 标签 ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  white-space: nowrap;
}
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: #cfe1f8; }
.badge.green { background: var(--green-soft); color: var(--green); border-color: #bfe3cd; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: #f0dda6; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: #f2c3bd; }
.badge.grey { background: #f1f3f6; color: var(--text-2); }

/* ── 表格 ── */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { color: var(--text-2); font-weight: 600; font-size: 13px; background: var(--surface-2); }
table.data tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

/* ── 列表项 ── */
.list-item {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

/* ── 聊天 ── */
.chat-wrap { display: flex; flex-direction: column; height: 100vh; background: #eef1f5; }
.chat-head {
  flex: 0 0 auto; background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: calc(10px + env(safe-area-inset-top));
}
.chat-head .who { font-weight: 600; font-size: 15px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; }
.chat-inner { max-width: 760px; margin: 0 auto; }
.msg { display: flex; margin-bottom: 12px; }
.msg .bubble {
  max-width: 76%; padding: 9px 13px; border-radius: 12px; background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.06); white-space: pre-wrap; word-break: break-word; font-size: 15px;
}
.msg.customer .bubble { border-top-left-radius: 3px; }
.msg.learner { justify-content: flex-end; }
.msg.learner .bubble { background: #d3f0c4; border-top-right-radius: 3px; }
.msg.system { justify-content: center; }
.msg.system .bubble { background: #e2e6eb; color: var(--text-2); font-size: 12.5px; text-align: center; max-width: 90%; }
.chat-day { text-align: center; color: var(--text-3); font-size: 12px; margin: 12px 0; }
.typing { color: var(--text-2); font-size: 13px; padding: 2px 4px; }
.chat-foot {
  flex: 0 0 auto; background: var(--surface); border-top: 1px solid var(--border); padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.chat-input-row { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.chat-input-row textarea { min-height: 42px; max-height: 132px; resize: none; }
.timer { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); }
.timer.warn { color: var(--red); font-weight: 600; }

/* ── 报告 ── */
.report-hero { background: linear-gradient(135deg, #0f2744, #14457f); color: #fff; border: none; }
.report-hero h1 { color: #fff; }
.report-hero .muted, .report-hero .tiny { color: #b9cde6; }
.grade-pill { display: inline-flex; padding: 6px 14px; border-radius: 999px; font-weight: 650; font-size: 15px; background: rgba(255,255,255,.14); color: #fff; }
.dim-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.dim-row:last-child { border-bottom: none; }
.dim-bar { height: 7px; border-radius: 4px; background: #eaeef3; overflow: hidden; margin-top: 6px; }
.dim-bar > i { display: block; height: 100%; background: var(--brand-2); border-radius: 4px; }
.dim-bar.na > i { background: #c6ced8; }
.quote { background: var(--surface-2); border-left: 3px solid var(--brand-2); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: 14px; margin: 6px 0; }
.quote.customer { border-left-color: #b6c0cc; color: var(--text-2); }
.finding { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2); }
.finding.warn { border-color: #f0dda6; background: #fffdf6; }
.finding.risk { border-color: #f2c3bd; background: #fff8f7; }

/* ── 提示条 ── */
.notice { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; margin-bottom: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.notice.info { background: var(--brand-soft); border-color: #cfe1f8; color: #123f74; }
.notice.warn { background: var(--amber-soft); border-color: #f0dda6; color: #7a4c06; }
.notice.danger { background: var(--red-soft); border-color: #f2c3bd; color: #8f2b20; }
.notice.ok { background: var(--green-soft); border-color: #bfe3cd; color: #14603a; }

/* ── 空状态 ── */
.empty { text-align: center; padding: 34px 16px; color: var(--text-2); font-size: 14px; }

/* ── 模态 ── */
.modal-host { position: fixed; inset: 0; background: rgba(16,24,40,.45); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 18px; }
.modal-host[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: var(--radius); max-width: 520px; width: 100%;
  padding: 20px; box-shadow: var(--shadow-lg); max-height: 88vh; overflow: auto;
}
.modal h3 { margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Toast ── */
.toast-host { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1b2430; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow-lg); max-width: 90vw; }
.toast.ok { background: #14603a; }
.toast.err { background: #8f2b20; }

/* ── 登录页 ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, #0f2744, #1a4a86 60%, #2060a8); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 28px 26px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 19px; margin-bottom: 2px; }
.login-card .sub { color: var(--text-2); font-size: 13px; margin-bottom: 20px; }
.login-foot { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 16px; }

/* ── 统计块 ── */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat .n { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat .l { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* ── 标签页 ── */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button {
  border: none; background: transparent; padding: 9px 13px; font-size: 14px; font-family: inherit;
  color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ── 步骤条 ── */
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); }
.step .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex: 0 0 18px; }
.step.done { color: var(--text); }
.step.done .dot { background: var(--green); border-color: var(--green); }
.step.active .dot { border-color: var(--brand); border-right-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 响应式 ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 16px 14px 84px; }
  .bottom-nav { display: flex; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .grid.cols-3.keep, .grid.cols-4.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 901px) {
  .mobile-only { display: none !important; }
}
@media print {
  .sidebar, .bottom-nav, .btn, .no-print { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}
