/* 国开刷题 v6 - Mobile App Style */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
:root {
  --blue: #4A6CF7; --blue-light: #EEF1FE; --green: #34C759; --green-light: #E8F8ED;
  --red: #FF3B30; --red-light: #FFECEB; --orange: #FF9500; --orange-light: #FFF3E6;
  --bg: #F2F3F7; --card: #FFFFFF; --text: #1D1D1F; --text2: #6E6E73; --text3: #AEAEB2;
  --border: #E5E5EA; --radius: 14px; --radius-sm: 10px; --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --nav-h: 48px; --tab-h: 56px; --status-h: env(safe-area-inset-top, 0px);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; user-select: none;
  -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; background: var(--bg); }

/* Status Bar */
.status-bar { height: var(--status-h); background: var(--blue); }

/* Nav Bar */
.nav-bar {
  height: var(--nav-h); background: var(--blue); color: #fff;
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  position: sticky; top: 0; z-index: 100; -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.nav-left { width: 40px; font-size: 13px; cursor: pointer; }
.nav-title { flex: 1; font-size: 17px; font-weight: 600; text-align: center; }
.nav-right { min-width: 52px; text-align: right; }
.nav-right span {
  background: rgba(255,255,255,0.2); padding: 3px 10px; border-radius: 12px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}

/* Main Content */
main { padding: 16px 16px calc(var(--tab-h) + 24px); min-height: calc(100vh - var(--nav-h) - var(--status-h)); }

/* Tab Bar */
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: var(--tab-h);
  background: rgba(255,255,255,0.92); -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px); border-top: 0.5px solid var(--border);
  display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; cursor: pointer; transition: all 0.2s;
  color: var(--text3); font-size: 10px; font-weight: 500;
}
.tab-item.active { color: var(--blue); }
.tab-item .tab-icon { width: 24px; height: 24px; }
.tab-item .tab-icon svg { width: 100%; height: 100%; fill: currentColor; }

/* Cards */
.card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}

/* Subject Switcher */
.subj-switch {
  display: flex; background: #E8ECF4; border-radius: 10px; padding: 3px; margin-bottom: 16px;
}
.subj-btn {
  flex: 1; padding: 10px 8px; border-radius: 8px; border: none; outline: none;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
  background: transparent; color: var(--text2);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.subj-btn.on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* Hero Card */
.hero-card { background: linear-gradient(135deg, var(--blue) 0%, #6B8AFF 100%); color: #fff; text-align: center; }
.hero-icon { font-size: 44px; margin-bottom: 6px; }
.hero-name { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.hero-sub { font-size: 13px; opacity: 0.85; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-cell {
  background: var(--card); border-radius: var(--radius-sm); padding: 14px 6px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-num { font-size: 24px; font-weight: 800; color: var(--blue); }
.stat-label { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* Buttons */
.btn {
  display: block; width: 100%; padding: 14px; border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s;
  text-align: center; color: #fff; background: var(--blue);
}
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn-lg { padding: 16px; font-size: 17px; border-radius: var(--radius); }
.btn-outline { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; display: inline-block; border-radius: 8px; }

/* Exam Progress */
.exam-header { margin-bottom: 16px; }
.exam-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.exam-type-badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
}
.badge-single { background: var(--blue-light); color: var(--blue); }
.badge-multi { background: var(--red-light); color: var(--red); }
.badge-judge { background: var(--green-light); color: var(--green); }
.exam-count { font-size: 13px; color: var(--text2); }
.progress-bar {
  height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--blue); border-radius: 2px; transition: width 0.3s; }

/* Question */
.q-text { font-size: 16px; font-weight: 600; line-height: 1.6; margin-bottom: 14px; color: var(--text); }

/* Options */
.opt-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.opt-item {
  padding: 14px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--card); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 12px; font-size: 15px;
}
.opt-item:active { transform: scale(0.98); }
.opt-letter {
  width: 30px; height: 30px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 700;
  font-size: 13px; background: #F0F2F5; color: var(--text2); flex-shrink: 0;
}
.opt-item.selected { border-color: var(--blue); background: var(--blue-light); }
.opt-item.selected .opt-letter { background: var(--blue); color: #fff; }
.opt-item.correct { border-color: var(--green); background: var(--green-light); }
.opt-item.correct .opt-letter { background: var(--green); color: #fff; }
.opt-item.wrong { border-color: var(--red); background: var(--red-light); }
.opt-item.wrong .opt-letter { background: var(--red); color: #fff; }

/* Explanation */
.exp-box {
  border-radius: var(--radius-sm); padding: 14px; margin-top: 12px;
  font-size: 14px; line-height: 1.5;
}
.exp-box.ok { background: var(--green-light); border: 1px solid #B8E6C8; }
.exp-box.no { background: var(--red-light); border: 1px solid #FFCCCC; }
.exp-title { font-weight: 700; margin-bottom: 6px; }
.exp-body { color: #555; }
.exp-key { font-size: 12px; color: #999; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,0.06); }

/* Nav buttons */
.exam-nav { display: flex; gap: 10px; margin-top: 16px; }
.exam-nav .btn { flex: 1; }

/* Dot indicators */
.dots { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; padding: 12px 0; }
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: #D1D1D6;
  cursor: pointer; transition: all 0.2s;
}
.dot.current { background: var(--blue); width: 22px; border-radius: 4px; }
.dot.done { background: var(--green); }
.dot.wrong-dot { background: var(--red); }

/* Result Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 24px 20px 40px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.result-score {
  width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 800; color: #fff;
}
.score-pass { background: linear-gradient(135deg, #34C759, #30D158); }
.score-fail { background: linear-gradient(135deg, #FF3B30, #FF6B58); }
.score-sub { font-size: 12px; font-weight: 500; opacity: 0.9; }
.result-summary { display: flex; gap: 10px; margin-bottom: 16px; }
.result-cell {
  flex: 1; text-align: center; padding: 12px; border-radius: var(--radius-sm);
  background: #F8F8FA;
}
.result-cell .num { font-size: 22px; font-weight: 700; }
.result-cell .lbl { font-size: 11px; color: var(--text2); }
.result-cell.c-green .num { color: var(--green); }
.result-cell.c-red .num { color: var(--red); }
.result-cell.c-blue .num { color: var(--blue); }

/* Review list */
.review-item {
  background: #F8F8FA; border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 8px; font-size: 14px;
}
.review-q { font-weight: 600; margin-bottom: 6px; }
.review-status { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.review-status.ok { background: var(--green-light); color: var(--green); }
.review-status.no { background: var(--red-light); color: var(--red); }
.review-detail { font-size: 12px; color: var(--text2); margin-top: 4px; }
.review-exp { font-size: 12px; color: #555; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }

/* Wrong List */
.wrong-item {
  background: var(--card); border-radius: var(--radius-sm); padding: 16px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.wrong-q { font-weight: 600; margin-bottom: 8px; }
.wrong-ans { font-size: 13px; color: var(--green); margin-bottom: 4px; }
.wrong-yours { font-size: 13px; color: var(--red); margin-bottom: 6px; }
.wrong-exp { font-size: 12px; color: #555; padding-top: 6px; border-top: 1px solid var(--border); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text3); }
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-text { font-size: 15px; }

/* Section title */
.section-title { font-size: 14px; font-weight: 600; color: var(--text2); margin: 20px 0 10px; padding-left: 2px; }

/* Chapter filter */
.chapter-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chapter-tag {
  padding: 5px 12px; border-radius: 14px; font-size: 12px; font-weight: 500;
  background: #F0F2F5; color: var(--text2); cursor: pointer; transition: all 0.15s;
  border: none; outline: none;
}
.chapter-tag.on { background: var(--blue); color: #fff; }

/* Misc */
.mb8 { margin-bottom: 8px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.text-center { text-align: center; }
