/* ============ 销冠之路 Demo ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #2f6fed;
  --green: #22a06b;
  --grad: linear-gradient(135deg, #2f6fed 0%, #22a06b 100%);
  --bg: #f4f7fa;
  --card: #ffffff;
  --text: #1f2d3d;
  --muted: #8492a6;
  --line: #e4eaf2;
  --danger: #e5484d;
  --warn: #e8930c;
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #e9eef5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 480px; min-height: 100vh; margin: 0 auto;
  background: var(--bg);
  display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(31,45,61,.12);
  position: relative;
}

/* ---- header ---- */
.app-header {
  background: var(--grad);
  color: #fff; padding: 18px 20px 16px;
  border-radius: 0 0 20px 20px;
}
.logo { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.sub { font-size: 12px; opacity: .85; margin-top: 4px; }

/* ---- pages ---- */
#pages { flex: 1; padding: 16px 14px 24px; overflow-y: auto; }
.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- tabbar ---- */
.tabbar {
  display: flex; background: #fff;
  border-top: 1px solid var(--line);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  position: sticky; bottom: 0;
}
.tab {
  flex: 1; border: none; background: none; cursor: pointer;
  font-size: 12px; color: var(--muted); padding: 6px 0;
}
.tab .ico { display: block; font-size: 20px; margin-bottom: 2px; }
.tab.active { color: var(--blue); font-weight: 700; }

/* ---- generic ---- */
.card {
  background: var(--card); border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(31,45,61,.06);
}
.card h3 { font-size: 15px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 12px; }
.btn {
  display: block; width: 100%; border: none; cursor: pointer;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 700;
  padding: 12px; border-radius: 12px; margin-top: 12px;
}
.btn:active { opacity: .85; }
.btn.ghost { background: #eef2f8; color: var(--blue); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.tag {
  display: inline-block; font-size: 11px; color: var(--blue);
  background: #eaf1ff; border-radius: 20px; padding: 3px 10px; margin: 0 6px 6px 0;
}
.banner {
  border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
  color: #fff; font-weight: 800; font-size: 16px;
}
.banner small { display: block; font-weight: 400; font-size: 12px; opacity: .9; margin-top: 4px; }
.banner.win { background: linear-gradient(135deg, #22a06b, #2ecc8f); }
.banner.lose { background: linear-gradient(135deg, #e5484d, #f0714f); }

/* ---- quote ---- */
.quote-date { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.quote-text {
  font-size: 18px; line-height: 1.7; font-weight: 700;
  background: linear-gradient(135deg, #2f6fed, #22a06b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 6px 0 14px;
}
.quote-scene {
  background: #f2f7f4; border-left: 3px solid var(--green);
  border-radius: 0 10px 10px 0; padding: 10px 12px;
  font-size: 13px; line-height: 1.7; color: #3d5a50;
}
.quote-actions { display: flex; gap: 10px; margin-top: 12px; }
.quote-actions .btn { margin-top: 0; flex: 1; font-size: 13px; padding: 10px; }
.btn.faved { background: #fff2d9; color: #c07f00; }

/* ---- quiz ---- */
.quiz-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.quiz-progress .bar { flex: 1; height: 6px; background: #e4eaf2; border-radius: 3px; overflow: hidden; }
.quiz-progress .bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; }
.quiz-meta { font-size: 12px; color: var(--muted); }
.scenario {
  background: #f4f6fb; border-radius: 10px; padding: 12px;
  font-size: 13px; line-height: 1.8; margin-bottom: 12px; color: #3a4a63;
}
.q-text { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.opt {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: #f8fafc; border: 2px solid var(--line); border-radius: 12px;
  padding: 12px; font-size: 13.5px; line-height: 1.6; margin-bottom: 10px;
  color: var(--text); font-family: inherit;
}
.opt .key { font-weight: 800; margin-right: 8px; color: var(--blue); }
.opt:hover { border-color: #bcd2f7; }
.opt.sel { border-color: var(--blue); background: #eef4ff; }
.opt.right { border-color: var(--green); background: #eafaf2; }
.opt.wrong { border-color: var(--danger); background: #fdeeee; }
.analysis { font-size: 13px; line-height: 1.8; }
.analysis .ok { color: var(--green); font-weight: 700; }
.analysis .no { color: var(--danger); font-weight: 700; }
.deep {
  margin-top: 12px; background: #f3f0fa; border-left: 3px solid #8256d0;
  border-radius: 0 10px 10px 0; padding: 12px; font-size: 13px; line-height: 1.8; color: #4a3d63;
}
.deep b { color: #6b4fc0; }
.quiz-nav { display: flex; gap: 10px; }
.quiz-nav .btn { margin-top: 0; flex: 1; font-size: 14px; }
.score-big { font-size: 40px; font-weight: 800; text-align: center;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- battle: briefing ---- */
.brief-row { display: flex; margin-bottom: 10px; font-size: 13px; line-height: 1.7; }
.brief-row .k { flex: 0 0 74px; color: var(--muted); }
.brief-row .v { flex: 1; }
.state-pills { display: flex; gap: 8px; margin-top: 10px; }
.pill { flex: 1; text-align: center; background: #f4f6fb; border-radius: 10px; padding: 8px 4px; font-size: 12px; }
.pill b { display: block; font-size: 16px; margin-top: 2px; }

/* ---- battle: cards ---- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gcard {
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  padding: 10px 8px; text-align: center; cursor: pointer; user-select: none;
}
.gcard .nm { font-weight: 800; font-size: 13.5px; }
.gcard .tp { font-size: 11px; margin: 4px 0; }
.gcard .ds { font-size: 10.5px; color: var(--muted); line-height: 1.5; height: 63px; overflow: hidden; }
.gcard.sel { border-width: 2px; }
.gcard.sel .nm::after { content: " ✓"; }
.pick-count { text-align: center; font-size: 13px; color: var(--muted); margin: 10px 0 2px; }

/* ---- battle: chat ---- */
.state-bars { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 2px 10px rgba(31,45,61,.06); }
.sb-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.sb-row:last-child { margin-bottom: 0; }
.sb-row .lbl { flex: 0 0 66px; }
.sb-row .track { flex: 1; height: 8px; background: #edf1f7; border-radius: 4px; overflow: hidden; }
.sb-row .fill { height: 100%; border-radius: 4px; transition: width .4s ease, background .4s ease; }
.sb-row .num { flex: 0 0 30px; text-align: right; font-weight: 700; }
.round-ind { text-align: center; font-size: 11px; color: var(--muted); margin-bottom: 8px; }

.chat-box {
  background: var(--card); border-radius: 14px; box-shadow: 0 2px 10px rgba(31,45,61,.06);
  display: flex; flex-direction: column; height: 46vh; min-height: 300px; margin-bottom: 12px;
}
.chat-log { flex: 1; overflow-y: auto; padding: 14px; }
.msg { display: flex; margin-bottom: 12px; }
.msg .ava {
  flex: 0 0 34px; height: 34px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
}
.msg.npc .ava { background: var(--grad); }
.msg.me { flex-direction: row-reverse; }
.msg.me .ava { background: #5a6b85; margin-left: 8px; }
.msg.npc .ava { margin-right: 8px; }
.bubble {
  max-width: 76%; border-radius: 12px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.7; white-space: pre-wrap;
}
.msg.npc .bubble { background: #f1f4f9; border-top-left-radius: 4px; }
.msg.me .bubble { background: var(--grad); color: #fff; border-top-right-radius: 4px; }
.sys { text-align: center; font-size: 11.5px; color: var(--muted); margin: 8px 0; }
.sys .inner {
  display: inline-block; background: #eef2f8; border-radius: 20px; padding: 4px 14px;
}
.sys .inner.good { background: #e6f7ef; color: #1a7a4e; }
.sys .inner.bad { background: #fdeeee; color: #c53030; }

.card-bar { display: flex; gap: 8px; padding: 0 2px; margin-bottom: 10px; }
.mini-card {
  flex: 1; border: none; border-radius: 10px; color: #fff; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700; padding: 9px 4px;
  box-shadow: 0 2px 6px rgba(31,45,61,.15);
}
.mini-card .fx { display: block; font-size: 10px; font-weight: 400; opacity: .9; margin-top: 2px; }
.mini-card:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

.chat-input { display: flex; gap: 8px; }
.chat-input input {
  flex: 1; border: 2px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
.chat-input input:focus { border-color: var(--blue); }
.chat-input button {
  flex: 0 0 64px; border: none; border-radius: 12px; background: var(--grad);
  color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}

/* ---- result ---- */
.radar-wrap { text-align: center; padding: 6px 0; }
.dim-list { margin-top: 8px; }
.dim-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.dim-row .nm { flex: 0 0 56px; }
.dim-row .track { flex: 1; height: 8px; background: #edf1f7; border-radius: 4px; overflow: hidden; }
.dim-row .fill { height: 100%; background: var(--grad); border-radius: 4px; }
.dim-row .num { flex: 0 0 30px; text-align: right; font-weight: 700; }
.rating { text-align: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.rating b { font-size: 26px; margin: 0 4px; }
.coach { background: #f4f8ff; border-radius: 10px; padding: 12px; font-size: 13px; line-height: 1.8; color: #33517e; }
.coach b { color: var(--blue); }

/* ---- stats ---- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-cell { background: var(--card); border-radius: 14px; padding: 14px 6px; text-align: center; box-shadow: 0 2px 10px rgba(31,45,61,.06); }
.stat-cell b { display: block; font-size: 24px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-cell span { font-size: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; }

/* ---- 行业线 / 关卡切换 ---- */
.level-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.level-switch .lvl {
  flex: 1 1 auto; border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 12px; padding: 7px 10px; border-radius: 20px; cursor: pointer; white-space: nowrap;
}
.level-switch .lvl.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }

/* 关卡分组切换（按行业分行） */
.level-groups { margin-bottom: 14px; }
.level-switch { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 7px; }
.lvl-tag { flex: none; font-size: 11px; color: var(--muted); font-weight: 700; margin-right: 2px;
  min-width: 52px; }

/* ---- 目标横幅（对话页常驻） ---- */
.goal-bar { background: #fff8ec; border: 1px solid #ffe3b3; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 12px; }
.goal-bar .g-title { font-size: 11px; color: #d99a06; font-weight: 700; margin-bottom: 3px; }
.goal-bar .g-text { font-size: 13px; color: #5b4a1f; line-height: 1.6; }

/* ---- 引导提示（连续未命中时的系统提示） ---- */
.sys .inner.warn { background: #fff6e5; color: #a06a00; }

/* ---- 难度阶梯 ---- */
.diff-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin: 10px 0 4px; }
.diff-btn { text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text); }
.diff-btn .dn { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.diff-btn .dd { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.diff-btn.on { border-color: var(--blue); background: #eef3ff; }
.diff-btn.on .dn { color: var(--blue); }

/* ---- 情境选择 ---- */
.sit-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.sit-chip { font-size: 12px; padding: 5px 12px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--muted); }
.sit-chip.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }

@media (max-width:560px){ .diff-grid { grid-template-columns: 1fr; } }

/* ---- 每日挑战 ---- */
.daily-card { border: 1px solid #ffd591; background: #fffbf3; }
.daily-card h3 { color: #d99a06; }

/* ---- 成长中心 ---- */
.tier-row { display: flex; align-items: center; gap: 14px; margin: 10px 0 12px; }
.tier-badge { width: 52px; height: 52px; flex: none; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff;
  background: #2f6fed; }
.tier-info .tn { font-size: 16px; font-weight: 700; }
.tier-info .td { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tier-bar { height: 8px; border-radius: 6px; background: #eef1f5; overflow: hidden; margin-bottom: 14px; }
.tier-fill { height: 100%; background: #22a06b; border-radius: 6px; }
.medal-wall { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.medal { text-align: center; padding: 10px 4px; border-radius: 10px; background: #f5f6f8;
  border: 1px solid var(--line); filter: grayscale(1); opacity: .5; }
.medal.got { filter: none; opacity: 1; background: #fff8ec; border-color: #ffd591; }
.medal .mi { display: block; font-size: 20px; }
.medal .mn { display: block; font-size: 11px; margin-top: 3px; }
