:root {
  --bg: #f6f1ea;
  --card: #ffffff;
  --ink: #3a2e24;
  --ink-soft: #8a7a6a;
  --gold: #b8863f;
  --gold-deep: #9a6f30;
  --gold-light: #f0e4d3;
  --line: #e8ddcd;
  --green: #4a8b5f;
  --green-bg: #e9f3ec;
  --red: #c0564f;
  --red-bg: #f9eceb;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(58, 46, 36, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

.app { max-width: 640px; margin: 0 auto; padding: 0 0 40px; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 16px; font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--ink-soft); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); font-size: 18px; color: var(--ink-soft); cursor: pointer;
}

/* 产品线切换 */
.line-switch {
  display: flex; gap: 8px; padding: 8px 16px 12px;
}
.line-tab {
  flex: 1; padding: 10px 8px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-soft); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.line-tab.active {
  background: var(--gold); border-color: var(--gold); color: #fff;
  box-shadow: var(--shadow);
}

/* 视图 */
.view { padding: 0 16px; }
.hidden { display: none; }

/* 首页 hero */
.hero {
  background: linear-gradient(135deg, #3a2e24, #5c4632);
  color: #fff; border-radius: var(--radius); padding: 22px 20px;
  margin-bottom: 14px;
}
.hero-line { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.hero-goal { font-size: 13px; opacity: .85; margin-top: 6px; }

/* 进度卡 */
.progress-card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.progress-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
.progress-pct { color: var(--gold-deep); font-size: 18px; font-weight: 700; }
.progress-bar { height: 8px; background: var(--line); border-radius: 4px; margin: 10px 0 6px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); border-radius: 4px; width: 0; transition: width .3s; }
.progress-stat { font-size: 12px; color: var(--ink-soft); }

/* 模式入口 */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.mode-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 14px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s;
}
.mode-card:active { transform: scale(.97); }
.mode-icon { font-size: 28px; }
.mode-name { font-size: 16px; font-weight: 700; margin: 8px 0 4px; }
.mode-desc { font-size: 12px; color: var(--ink-soft); }

.tip { font-size: 12px; color: var(--ink-soft); text-align: center; padding: 4px 12px; }
.tip-inline { font-size: 12px; color: var(--gold-deep); background: var(--gold-light); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }

/* 返回栏 */
.back-bar { display: flex; align-items: center; gap: 8px; padding: 8px 0 12px; font-weight: 700; font-size: 16px; }
.back-btn {
  border: none; background: none; color: var(--gold-deep); font-size: 15px;
  cursor: pointer; font-weight: 600; padding: 4px 6px 4px 0;
}

/* 章节列表 */
.chapter-list { display: flex; flex-direction: column; gap: 10px; }
.chapter-item {
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); cursor: pointer; display: flex; align-items: center; gap: 12px;
}
.chapter-badge {
  width: 34px; height: 34px; border-radius: 50%; background: var(--gold-light); color: var(--gold-deep);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.chapter-badge.done { background: var(--green); color: #fff; }
.chapter-title { flex: 1; font-size: 14px; font-weight: 600; }
.chapter-count { font-size: 12px; color: var(--ink-soft); }

/* 章节详情 */
.chapter-detail { display: flex; flex-direction: column; gap: 12px; }
.block {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.block-title { font-size: 13px; font-weight: 700; color: var(--gold-deep); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.when-tag { font-size: 12px; color: var(--ink-soft); background: #f4efe7; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.why { font-size: 13px; color: var(--ink); background: #faf6ef; border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 8px; }
.num-chip { display: inline-block; background: var(--gold-light); color: var(--gold-deep); font-size: 12px; padding: 4px 10px; border-radius: 14px; margin: 3px 4px 3px 0; font-weight: 600; }
.script-line { font-size: 13px; margin-bottom: 6px; padding-left: 2px; }
.script-diff { font-size: 12px; color: var(--ink-soft); background: #f7f3ec; border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.script-diff b { color: var(--gold-deep); }

/* 自测题 */
.quiz-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.quiz-q { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.quiz-a { font-size: 13px; background: var(--green-bg); color: var(--green); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; display: none; }
.quiz-a.show { display: block; }
.quiz-actions { display: flex; gap: 8px; }
.quiz-btn { flex: 1; padding: 8px; border-radius: 10px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.quiz-btn.show { background: var(--gold-light); color: var(--gold-deep); }
.quiz-btn.ok { background: var(--green); color: #fff; }
.quiz-btn.retry { background: var(--red-bg); color: var(--red); }
.quiz-done { font-size: 12px; font-weight: 600; margin-top: 6px; }
.quiz-done.pass { color: var(--green); }
.quiz-done.fail { color: var(--red); }

/* 抗拒对练 */
.objection-list { display: flex; flex-direction: column; gap: 14px; }
.objection-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.objection-customer { font-size: 16px; font-weight: 700; padding: 14px; background: #faf6ef; border-radius: 12px; position: relative; }
.objection-customer::before { content: "顾客"; font-size: 11px; color: var(--red); font-weight: 700; display: block; margin-bottom: 4px; }
.mind-tag { display: inline-block; font-size: 11px; background: var(--red-bg); color: var(--red); padding: 2px 10px; border-radius: 12px; margin-top: 8px; font-weight: 600; }
.objection-answer { display: none; margin-top: 12px; }
.objection-answer.show { display: block; }
.objection-answer-text { font-size: 13px; background: var(--green-bg); color: #2e5d40; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.key-tag { display: inline-block; font-size: 11px; background: var(--gold-light); color: var(--gold-deep); padding: 3px 9px; border-radius: 12px; margin: 2px 3px 2px 0; font-weight: 600; }
.objection-actions { display: flex; gap: 8px; margin-top: 10px; }
.objection-btn { flex: 1; padding: 9px; border-radius: 10px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.objection-btn.show { background: var(--gold-light); color: var(--gold-deep); }
.objection-btn.ok { background: var(--green); color: #fff; }
.objection-btn.retry { background: var(--red-bg); color: var(--red); }

/* 数字快问 */
.num-controls { display: flex; gap: 8px; margin-bottom: 10px; }
.primary-btn { flex: 1; padding: 11px; border-radius: 12px; border: none; background: var(--gold); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.ghost-btn { padding: 11px 18px; border-radius: 12px; border: 1px solid var(--gold); background: var(--card); color: var(--gold-deep); font-size: 14px; font-weight: 600; cursor: pointer; }
.num-counter { text-align: center; font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; }
.flip-wrap { perspective: 1000px; min-height: 200px; }
.flip-card { position: relative; width: 100%; min-height: 200px; transform-style: preserve-3d; transition: transform .5s; cursor: pointer; }
.flip-card.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; width: 100%; min-height: 200px; backface-visibility: hidden;
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.flip-front { background: var(--card); }
.flip-back { background: var(--gold); color: #fff; transform: rotateY(180deg); }
.flip-q { font-size: 18px; font-weight: 700; line-height: 1.5; }
.flip-hint { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }
.flip-a { font-size: 20px; font-weight: 700; line-height: 1.5; }
.flip-actions { display: flex; gap: 8px; margin-top: 12px; }
.flip-actions .quiz-btn { padding: 8px 14px; }

/* 看板 */
.board { display: flex; flex-direction: column; gap: 14px; }
.board-section { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.board-section h3 { font-size: 15px; margin-bottom: 10px; color: var(--gold-deep); }
.board-row { font-size: 13px; padding: 8px 0; border-bottom: 1px solid #f3ede3; }
.board-row:last-child { border-bottom: none; }
.board-row .b-label { font-weight: 600; display: block; }
.board-row .b-val { color: var(--ink-soft); }
.price-item { font-size: 14px; font-weight: 600; padding: 10px 12px; background: #faf6ef; border-radius: 10px; margin-bottom: 8px; border-left: 3px solid var(--gold); }
.banned-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3ede3; font-size: 13px; }
.banned-row:last-child { border-bottom: none; }
.banned-from { color: var(--red); font-weight: 600; background: var(--red-bg); padding: 2px 10px; border-radius: 10px; }
.banned-arrow { color: var(--ink-soft); }
.banned-to { color: var(--green); font-weight: 600; }
.pass-rule { font-size: 13px; background: var(--gold-light); color: var(--gold-deep); border-radius: 10px; padding: 12px; font-weight: 600; line-height: 1.7; }
