* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", Helvetica, sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 28rpx; /* 在浏览器中实际按 px 生效，这里仅作保留 */
}

#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
}

.topbar {
  height: 88px;
  background: #c0392b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 20;
}

#main { flex: 1; padding: 24px; padding-bottom: 120px; }
.view.hidden, .overlay.hidden, .hidden { display: none !important; }

/* 首页 */
.header { margin: 8px 4px 24px; }
.title { font-size: 40px; font-weight: 700; color: #c0392b; }
.subtitle { margin-top: 6px; font-size: 24px; color: #888; }

.card {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 16px; padding: 28px 24px; margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.card-main { flex: 1; }
.card-name { font-size: 30px; font-weight: 600; color: #222; }
.card-desc { margin-top: 6px; font-size: 22px; color: #999; }
.card-right { display: flex; align-items: center; }
.card-count { font-size: 22px; color: #c0392b; margin-right: 10px; }
.card-arrow { font-size: 38px; color: #ccc; }
.tip { margin-top: 12px; font-size: 20px; color: #aaa; line-height: 1.6; }

/* 答题覆盖层 */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: #f5f5f5; overflow-y: auto;
}
.exam { padding: 24px; padding-bottom: 140px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.progress { font-size: 24px; color: #666; }
.tag { font-size: 20px; color: #fff; background: #c0392b; border-radius: 8px; padding: 4px 14px; }

.qbox { background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.qno { display: inline-block; font-size: 20px; color: #c0392b; border: 1px solid #c0392b; border-radius: 8px; padding: 2px 12px; margin-bottom: 14px; }
.qtext { font-size: 30px; line-height: 1.6; color: #222; }

.options { margin-top: 22px; }
.option { display: flex; align-items: center; background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 24px 22px; margin-bottom: 18px; }
.option.on { border-color: #c0392b; background: #fdeceb; }
.option-mark { width: 46px; height: 46px; border-radius: 50%; border: 1px solid #ccc; text-align: center; line-height: 46px; font-size: 24px; color: #888; margin-right: 18px; flex-shrink: 0; }
.option.on .option-mark { background: #c0392b; color: #fff; border-color: #c0392b; }
.option-text { font-size: 28px; line-height: 1.5; color: #333; }

.footer { position: fixed; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; display: flex; gap: 18px; padding: 18px 24px; background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,0.05); }
.fbtn { flex: 1; margin: 0; font-size: 28px; padding: 18px 0; border: none; border-radius: 12px; }
.btn-primary { background: #c0392b; color: #fff; }
.btn-ghost { background: #fff; color: #c0392b; border: 1px solid #c0392b; }
.fbtn[disabled] { opacity: 0.5; }

/* 成绩 */
.result { padding: 24px; }
.score-card { background: #fff; border-radius: 16px; padding: 44px 24px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.score-num { font-size: 92px; font-weight: 800; line-height: 1; }
.score-num.pass { color: #27ae60; }
.score-num.fail { color: #c0392b; }
.score-label { margin-top: 10px; font-size: 28px; color: #555; }
.score-meta { margin-top: 14px; font-size: 22px; color: #999; }
.actions { margin-top: 26px; }
.act { display: block; width: 100%; margin-bottom: 18px; font-size: 28px; padding: 18px 0; border: none; border-radius: 12px; }
.act[disabled] { opacity: 0.6; }

.review { margin-top: 10px; }
.rv-item { background: #fff; border-radius: 12px; padding: 22px; margin-bottom: 18px; }
.rv-head { font-size: 24px; margin-bottom: 10px; }
.rv-head.ok { color: #27ae60; }
.rv-head.no { color: #c0392b; }
.rv-q { font-size: 28px; line-height: 1.5; color: #222; margin-bottom: 14px; }
.rv-opt { font-size: 26px; padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; background: #f7f7f7; color: #555; }
.rv-opt.sel { background: #fdeceb; color: #c0392b; }
.rv-opt.ans { background: #e9f7ef; color: #1e8449; }
.rv-exp { margin-top: 10px; font-size: 22px; color: #888; line-height: 1.6; }
.bottom { margin-top: 22px; }

/* 我的 */
.user-card { display: flex; align-items: center; background: #fff; border-radius: 16px; padding: 28px 24px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.avatar { width: 88px; height: 88px; border-radius: 50%; margin-right: 22px; background: #c0392b; color: #fff; text-align: center; line-height: 88px; font-size: 38px; }
.user-info { flex: 1; }
.nick { font-size: 30px; font-weight: 600; color: #222; }
.uid { margin-top: 6px; font-size: 20px; color: #999; }

.cell { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 12px; padding: 24px; margin-top: 20px; gap: 14px; }
.cell-name { font-size: 28px; color: #333; }
.cell-arrow { font-size: 38px; color: #ccc; }
.nick-input { flex: 1; border: 1px solid #eee; border-radius: 10px; padding: 14px; font-size: 26px; outline: none; }
.btn-primary.small { padding: 14px 22px; font-size: 24px; border: none; border-radius: 10px; white-space: nowrap; }
.note { margin-top: 28px; font-size: 20px; color: #aaa; line-height: 1.7; }

/* 历史 */
.empty { text-align: center; color: #aaa; font-size: 26px; margin-top: 120px; }
.rec { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 12px; padding: 26px 24px; margin-bottom: 18px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.rec-cert { font-size: 28px; font-weight: 600; color: #222; }
.rec-date { margin-top: 6px; font-size: 20px; color: #999; }
.rec-score { font-size: 42px; font-weight: 800; text-align: right; }
.rec-score.pass { color: #27ae60; }
.rec-score.fail { color: #c0392b; }
.rec-sub { font-size: 20px; color: #999; text-align: right; margin-top: 4px; }

/* 底部 tab */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; display: flex; background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,0.06); z-index: 30; }
.tab { flex: 1; border: none; background: #fff; padding: 18px 0; font-size: 26px; color: #999; }
.tab.active { color: #c0392b; font-weight: 600; }
