/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1923;
  --bg-card: #1a2634;
  --bg-card-alt: #1e2f40;
  --primary: #4ecdc4;
  --primary-dim: #3aafa9;
  --accent: #ff6b6b;
  --accent-warm: #ffa34d;
  --text: #e8edf2;
  --text-dim: #8899aa;
  --text-dark: #4a5568;
  --border: #2d3f50;
  --safe: #2ecc71;
  --low: #3498db;
  --medium: #f39c12;
  --high: #e74c3c;
  --critical: #c0392b;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,.3);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #1a2634 0%, #0d3b2e 50%, #1a2634 100%);
  padding: 1.5rem 1.5rem 0.8rem;
  text-align: center;
}
.hero h1 { font-size: 1.8rem; letter-spacing: .05em; }
.hero .subtitle { color: var(--text-dim); margin: .3rem 0 0; font-size: 1rem; }

/* ===== Tab Nav Bar (Sticky) ===== */
.tab-nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 25, 35, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* ===== Tab Navigation ===== */
.tab-nav {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  padding: .5rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  transition: all .2s;
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.tab-btn.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  font-weight: 600;
}

/* ===== Layout & Sidebar ===== */
.layout-wrapper {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 1.5rem 0.5rem 2rem 1rem;
  border-right: 1px solid var(--border);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 0.5rem;
  margin-bottom: 0.8rem;
}

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin-bottom: 0.1rem; }

.sidebar-link {
  display: block;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s;
  line-height: 1.45;
  border-left: 2px solid transparent;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(78, 205, 196, 0.06);
}
.sidebar-link.active {
  color: var(--primary);
  background: rgba(78, 205, 196, 0.08);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* ===== Container & Cards ===== */
.container { flex: 1; min-width: 0; padding: 1.5rem 1.5rem 4rem; }

.tab-content { display: none; animation: fadeIn .3s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  scroll-margin-top: 70px;
}
.card h2 { color: var(--primary); margin-bottom: 1rem; font-size: 1.4rem; }
.card h3 { color: var(--primary-dim); margin: 1.5rem 0 .8rem; font-size: 1.15rem; }
.card h4 { color: var(--accent-warm); margin: 1.2rem 0 .5rem; font-size: 1rem; }
.card ul, .card ol { padding-left: 1.5rem; margin: .5rem 0; }
.card li { margin-bottom: .4rem; }
.card p { margin-bottom: .8rem; }
.card-desc { color: var(--text-dim); font-size: .92rem; }
.card.callout { border-left: 4px solid var(--primary); background: var(--bg-card-alt); }

/* ===== Feature Grid ===== */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin-top: 1rem; }
.feature-item {
  background: var(--bg-card-alt);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform .2s;
}
.feature-item:hover { transform: translateY(-3px); }
.feature-icon { font-size: 2rem; margin-bottom: .5rem; }
.feature-item h3 { font-size: 1rem; color: var(--primary); margin-bottom: .5rem; }
.feature-item p { font-size: .88rem; color: var(--text-dim); }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 2rem; margin-top: 1rem; }
.timeline::before {
  content: '';
  position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-dot {
  position: absolute; left: -2rem; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg);
}
.timeline-content h3 { font-size: 1rem; color: var(--text); margin-bottom: .3rem; }
.timeline-content p { color: var(--text-dim); font-size: .92rem; }

/* ===== Danger Levels ===== */
.danger-level {
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  overflow: hidden;
  border: 1px solid var(--border);
}
.danger-header {
  padding: .8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--bg-card-alt);
}
.danger-title { font-weight: 600; font-size: .95rem; }
.danger-body { padding: 1rem 1.2rem; }
.danger-explain { color: var(--text-dim); font-size: .9rem; margin-top: .5rem; }

.danger-badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.danger-badge.critical { background: var(--critical); color: #fff; }
.danger-badge.high { background: var(--high); color: #fff; }
.danger-badge.medium { background: var(--medium); color: #fff; }
.danger-badge.low { background: var(--low); color: #fff; }
.danger-badge.safe { background: var(--safe); color: #fff; }

.danger-critical { border-color: var(--critical); }
.danger-high { border-color: var(--high); }
.danger-medium { border-color: var(--medium); }
.danger-low { border-color: var(--low); }
.danger-safe { border-color: var(--safe); }

/* ===== Tile Examples ===== */
.tile {
  display: inline-block;
  background: #f0e6d2;
  color: #333;
  padding: .1rem .45rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: .85rem;
  margin: 0 .15rem;
  border-bottom: 2px solid #c4b89a;
}
.tile.wan { color: #c0392b; }
.tile.tiao { color: #27ae60; }
.tile.tong { color: #2980b9; }

/* ===== Danger Chart ===== */
.tile-danger-chart { margin-top: 1rem; }
.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1.5fr;
  gap: .5rem;
  padding: .7rem .8rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: .9rem;
}
.chart-row.header { font-weight: 700; color: var(--primary); background: var(--bg-card-alt); border-radius: 8px 8px 0 0; }
.tile-label { font-weight: 600; }
.bar {
  display: block;
  height: 10px;
  border-radius: 5px;
}
.bar-5 { width: 100%; background: var(--critical); }
.bar-4 { width: 80%; background: var(--high); }
.bar-3 { width: 60%; background: var(--medium); }
.bar-2 { width: 35%; background: var(--low); }
.bar-1 { width: 20%; background: var(--safe); }

/* ===== Phase Cards ===== */
.phase-container { display: flex; flex-direction: column; gap: 1.5rem; }
.phase-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.phase-header {
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.phase-number {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800;
  flex-shrink: 0;
}
.phase-header h3 { font-size: 1.15rem; margin: 0; }
.phase-tag {
  margin-left: auto;
  font-size: .78rem;
  padding: .2rem .8rem;
  border-radius: 999px;
  font-weight: 600;
}
.phase-body { padding: 0 1.5rem 1.5rem; }
.phase-body ul { padding-left: 1.3rem; }
.phase-body li { margin-bottom: .4rem; font-size: .93rem; }

.phase-early .phase-header { background: linear-gradient(90deg, rgba(46,204,113,.15), transparent); }
.phase-early .phase-number { background: var(--safe); color: #fff; }
.phase-early .phase-tag { background: rgba(46,204,113,.15); color: var(--safe); }

.phase-mid .phase-header { background: linear-gradient(90deg, rgba(243,156,18,.15), transparent); }
.phase-mid .phase-number { background: var(--medium); color: #fff; }
.phase-mid .phase-tag { background: rgba(243,156,18,.15); color: var(--medium); }

.phase-late .phase-header { background: linear-gradient(90deg, rgba(231,76,60,.15), transparent); }
.phase-late .phase-number { background: var(--high); color: #fff; }
.phase-late .phase-tag { background: rgba(231,76,60,.15); color: var(--high); }

.tip-box {
  background: rgba(78,205,196,.08);
  border-left: 3px solid var(--primary);
  padding: .8rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: .9rem;
  color: var(--text-dim);
  margin: .5rem 0;
}
.tip-box.danger {
  background: rgba(231,76,60,.08);
  border-color: var(--high);
}

.mnemonic {
  background: var(--bg-card-alt);
  padding: .8rem 1.2rem;
  border-radius: 8px;
  font-size: 1.05rem;
  color: var(--accent-warm);
  text-align: center;
  font-weight: 600;
  margin-top: .8rem;
  letter-spacing: .05em;
}

/* ===== Key Insight Box ===== */
.key-insight {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(255,163,77,.08);
  border: 1.5px solid var(--accent-warm);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1rem 0 1.5rem;
}
.key-insight-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.key-insight-text { font-size: .93rem; line-height: 1.7; }
.key-insight-text strong { color: var(--accent-warm); }

/* ===== Signal Grid ===== */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.signal-item {
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
}
.signal-item ul { padding-left: 1.2rem; margin-top: .5rem; }
.signal-item li { font-size: .88rem; margin-bottom: .3rem; color: var(--text-dim); }
.signal-label {
  font-weight: 700;
  font-size: .9rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}
.signal-strong { background: rgba(231,76,60,.06); }
.signal-strong .signal-label { color: var(--high); }
.signal-moderate { background: rgba(243,156,18,.06); }
.signal-moderate .signal-label { color: var(--medium); }
.signal-weak { background: rgba(46,204,113,.06); }
.signal-weak .signal-label { color: var(--safe); }

/* ===== Strategy Matrix ===== */
.strategy-matrix td, .strategy-matrix th { text-align: center; vertical-align: middle; }
.strategy-matrix td:first-child { text-align: left; }
.strategy-matrix th:first-child { text-align: left; }
.strategy-matrix td small { display: block; color: var(--text-dim); font-size: .78rem; margin-top: .3rem; }

.strat-tag {
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.strat-attack { background: rgba(46,204,113,.2); color: var(--safe); }
.strat-balance { background: rgba(243,156,18,.2); color: var(--medium); }
.strat-defend { background: rgba(231,76,60,.15); color: var(--high); }
.strat-full-defend { background: rgba(192,57,43,.25); color: var(--critical); }

/* ===== Flowchart ===== */
.flowchart { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.5rem 0; }
.flow-node {
  padding: .8rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  max-width: 500px;
  width: 100%;
  font-size: .92rem;
}
.flow-node.start { background: var(--primary); color: var(--bg); font-weight: 700; }
.flow-node.decision { background: var(--bg-card-alt); border: 1.5px solid var(--primary-dim); }
.flow-node.action { font-weight: 600; }
.flow-node.action.safe { background: rgba(46,204,113,.15); border: 1.5px solid var(--safe); }
.flow-node.action.medium { background: rgba(243,156,18,.1); border: 1.5px solid var(--medium); }
.flow-node.action.danger { background: rgba(231,76,60,.1); border: 1.5px solid var(--high); }
.flow-arrow { font-size: 1.2rem; color: var(--text-dim); }
.flow-branch {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 600px;
}
.flow-path { display: flex; flex-direction: column; align-items: center; gap: .3rem; flex: 1; min-width: 200px; }
.flow-label { font-size: .85rem; color: var(--text-dim); font-weight: 600; }

/* ===== Probability Tables ===== */
.prob-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: .88rem;
}
.prob-table th, .prob-table td {
  padding: .6rem .8rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.prob-table th { color: var(--primary); background: var(--bg-card-alt); font-weight: 700; white-space: nowrap; }
.prob-table tbody tr:hover { background: rgba(78,205,196,.04); }

.prob-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: .82rem;
  white-space: nowrap;
}
.prob-bar::before {
  content: '';
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--primary);
  width: var(--w, 0%);
  min-width: 3px;
}
.prob-bar.danger::before { background: var(--critical); }
.prob-bar.high::before { background: var(--high); }
.prob-bar.medium::before { background: var(--medium); }
.prob-bar.low::before { background: var(--low); }
.prob-bar.safe::before { background: var(--safe); }

.score-5 { color: var(--critical); }
.score-4 { color: var(--high); }
.score-3 { color: var(--medium); }
.score-2 { color: var(--low); }
.score-1 { color: var(--safe); }

.cell-prob {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: .82rem;
  white-space: nowrap;
}
.cell-prob.p-safe { background: rgba(46,204,113,.15); color: var(--safe); }
.cell-prob.p-low { background: rgba(52,152,219,.15); color: var(--low); }
.cell-prob.p-medium { background: rgba(243,156,18,.15); color: var(--medium); }
.cell-prob.p-high { background: rgba(231,76,60,.15); color: var(--high); }
.cell-prob.p-critical { background: rgba(192,57,43,.2); color: var(--critical); }

.card-hint { color: var(--text-dim); font-size: .85rem; margin-top: .5rem; }

/* Column highlight on hover */
.prob-table.has-hover col.col-highlight { background: rgba(78,205,196,.06); }
.prob-table.has-hover tbody tr:hover { background: rgba(78,205,196,.1); }
.prob-table.has-hover tbody tr:hover td { color: #fff; }
.prob-table.has-hover th.col-highlight { color: #fff; }

/* ===== Priority List ===== */
.priority-list { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.priority-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  transition: transform .15s;
}
.priority-item:hover { transform: translateX(4px); }
.priority-item.priority-danger {
  border-color: var(--critical);
  background: rgba(192,57,43,.08);
}

.priority-rank {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}
.rank-1 { background: var(--safe); }
.rank-2 { background: #27ae60; }
.rank-3 { background: var(--low); }
.rank-4 { background: var(--medium); }
.rank-5 { background: var(--accent-warm); }
.rank-6 { background: var(--text-dim); }

.rank-def-1 { background: var(--safe); }
.rank-def-2 { background: #27ae60; }
.rank-def-3 { background: var(--low); }
.rank-def-4 { background: #5dade2; }
.rank-def-5 { background: var(--medium); }
.rank-def-6 { background: var(--accent-warm); }
.rank-def-x { background: var(--critical); font-size: .9rem; }

.priority-body { flex: 1; min-width: 0; }
.priority-title { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: .3rem; }
.priority-desc { font-size: .9rem; color: var(--text-dim); }
.priority-desc p { margin-bottom: .4rem; }
.priority-example {
  background: rgba(78,205,196,.06);
  padding: .5rem .8rem;
  border-radius: 6px;
  margin-top: .4rem;
  font-size: .85rem;
  border-left: 2px solid var(--primary-dim);
}
.priority-tag { margin-top: .4rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .82rem; }

@media (max-width: 700px) {
  .priority-item { padding: .8rem; gap: .7rem; }
  .priority-rank { width: 30px; height: 30px; font-size: .85rem; }
}

/* ===== Practice / Quiz ===== */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.quiz-card h3 { color: var(--primary); margin-bottom: .8rem; }
.quiz-scenario {
  background: var(--bg-card-alt);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  border-left: 3px solid var(--primary);
  font-size: .93rem;
  line-height: 1.8;
}
.quiz-options { display: flex; flex-direction: column; gap: .6rem; }
.quiz-option {
  background: var(--bg-card-alt);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .8rem 1.2rem;
  cursor: pointer;
  transition: all .2s;
  font-size: .92rem;
}
.quiz-option:hover { border-color: var(--primary); background: rgba(78,205,196,.05); }
.quiz-option.selected { border-color: var(--primary); background: rgba(78,205,196,.1); }
.quiz-option.correct { border-color: var(--safe); background: rgba(46,204,113,.1); }
.quiz-option.wrong { border-color: var(--high); background: rgba(231,76,60,.08); opacity: .7; }
.quiz-option.correct::after { content: ' ✓'; color: var(--safe); font-weight: 700; }
.quiz-option.wrong.selected::after { content: ' ✗'; color: var(--high); font-weight: 700; }

.quiz-explanation {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(78,205,196,.06);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
  font-size: .9rem;
  display: none;
}
.quiz-explanation.show { display: block; animation: fadeIn .3s ease; }
.quiz-explanation strong { color: var(--primary); }

.btn-primary {
  background: var(--primary);
  color: var(--bg);
  border: none;
  padding: .7rem 2rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.btn-primary:hover { background: var(--primary-dim); transform: scale(1.03); }

.score-box {
  margin-top: 1rem;
  color: var(--text-dim);
  font-size: .95rem;
}
.score-box span { color: var(--primary); font-weight: 700; }

/* ===== Hand Display (Tile Visualization) ===== */
.hand-display {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 1rem;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  margin: 1rem 0;
  align-items: flex-end;
}
.hand-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #faf3e3 0%, #e8dcc8 100%);
  color: #333;
  padding: 0.45rem 0.3rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.85rem;
  border: 1px solid #c4b89a;
  border-bottom: 3px solid #b0a080;
  min-width: 30px;
  text-align: center;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
  line-height: 1.2;
}
.hand-tile.wan { color: #c0392b; }
.hand-tile.tiao { color: #27ae60; }
.hand-tile.tong { color: #2980b9; }
.hand-tile.zi { color: #555; }
.hand-spacer { width: 10px; }
.hand-label { width: 100%; font-size: 0.8rem; color: var(--text-dim); margin-top: 0.5rem; }

/* ===== Difficulty Tags ===== */
.difficulty-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.difficulty-tag.d-easy { background: rgba(46,204,113,0.15); color: var(--safe); }
.difficulty-tag.d-medium { background: rgba(243,156,18,0.15); color: var(--medium); }
.difficulty-tag.d-hard { background: rgba(231,76,60,0.15); color: var(--high); }

/* ===== Reading Steps ===== */
.reading-step {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(45,63,80,0.5);
}
.reading-step:last-child { border-bottom: none; }
.reading-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.reading-step-content { flex: 1; min-width: 0; font-size: 0.9rem; }
.reading-step-content strong { color: var(--primary); }

/* ===== River Display (Tile River) ===== */
.river-display {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0.6rem 0.8rem;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  margin: 0.5rem 0;
}
.river-label { font-size: 0.78rem; color: var(--text-dim); margin-right: 0.5rem; align-self: center; }

/* ===== Mistake Cards ===== */
.mistake-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-card-alt);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  transition: transform 0.15s;
}
.mistake-card:hover { transform: translateX(4px); }
.mistake-number {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--high);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; flex-shrink: 0;
}
.mistake-body { flex: 1; min-width: 0; }
.mistake-title { font-weight: 700; color: var(--text); margin-bottom: 0.4rem; font-size: 1rem; }
.mistake-wrong {
  background: rgba(231,76,60,0.08);
  border-left: 3px solid var(--high);
  padding: 0.5rem 0.8rem;
  border-radius: 0 6px 6px 0;
  margin: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.mistake-right {
  background: rgba(46,204,113,0.08);
  border-left: 3px solid var(--safe);
  padding: 0.5rem 0.8rem;
  border-radius: 0 6px 6px 0;
  margin: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* ===== Review Checklist ===== */
.review-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--bg-card-alt);
  border-radius: var(--radius);
  margin-bottom: 0.8rem;
  border: 1px solid var(--border);
}
.review-step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; flex-shrink: 0;
}
.review-step-body { flex: 1; min-width: 0; }
.review-step-body h4 { color: var(--primary); margin: 0 0 0.3rem; font-size: 1rem; }

.checklist { list-style: none; padding: 0; margin: 0.5rem 0; }
.checklist li {
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.3rem;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-dim);
  background: rgba(78,205,196,0.04);
  border-left: 2px solid var(--border);
}
.checklist li::before { content: '□ '; color: var(--primary); font-weight: 700; }

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: .85rem;
  border-top: 1px solid var(--border);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .layout-wrapper { display: block; }
  .container { max-width: 960px; margin: 0 auto; }
}

@media (max-width: 700px) {
  .hero h1 { font-size: 1.4rem; }
  .hero .subtitle { font-size: .85rem; }
  .tab-nav-bar { padding: 0.5rem 0.8rem; }
  .tab-btn { padding: .4rem .8rem; font-size: .8rem; }
  .container { padding: 1rem; }
  .hand-display { padding: 0.6rem; gap: 2px; }
  .hand-tile { font-size: 0.75rem; padding: 0.35rem 0.2rem; min-width: 26px; }
  .hand-spacer { width: 6px; }
  .mistake-card { flex-direction: column; gap: 0.6rem; }
  .review-step { flex-direction: column; gap: 0.6rem; }
  .reading-step { flex-direction: column; gap: 0.4rem; }
  .card { padding: 1.2rem; }
  .chart-row { grid-template-columns: 1fr 1fr; gap: .3rem; font-size: .82rem; }
  .prob-table { font-size: .78rem; }
  .prob-table th, .prob-table td { padding: .4rem .5rem; }
  .flow-branch { flex-direction: column; align-items: center; }
  .phase-header { flex-direction: column; text-align: center; }
  .phase-tag { margin-left: 0; }
}
