/* ============================================================
   判断何楚天是否为小南梁 · 智慧验证系统
   样式表 style.css —— 蓝色主色调 / 圆角矩形控件
   ============================================================ */

:root {
  --blue: #1868b7;
  --blue-dark: #12579b;
  --blue-light: #e8f1fa;
  --blue-border: #b6cde4;
  --bg: #f2f5f8;
  --surface: #ffffff;
  --border: #d5dde5;
  --text: #222222;
  --muted: #6b7580;
  --faint: #98a2ad;
  --green: #2f9e44;
  --green-dark: #24772f;
  --green-bg: #eef8f0;
  --green-border: #b7e0c0;
  --red: #d33b3b;
  --red-dark: #b32d2d;
  --red-bg: #fdeeee;
  --red-border: #f0c2c2;
  --gold: #e8a021;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB",
    "Heiti SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部标题栏 ---------- */
.site-header {
  background: var(--blue);
  color: #ffffff;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-text p {
  font-size: 12px;
  color: #cfe2f5;
}

/* ---------- 页面容器 ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.05);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
}

.card-desc {
  color: var(--muted);
  margin-bottom: 16px;
}

/* ---------- 信息列表 ---------- */
.meta-list {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 18px;
}

.meta-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.meta-item:last-child {
  border-bottom: none;
}

.meta-item:nth-child(even) {
  background: #fafbfc;
}

.meta-key {
  color: var(--muted);
  flex: 0 0 auto;
}

.meta-val {
  text-align: right;
  word-break: break-word;
}

.meta-val b {
  color: var(--blue);
  font-weight: 700;
}

/* ---------- 按钮（圆角矩形） ---------- */
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.actions-row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 11px 18px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--blue-border);
  color: var(--blue);
}

.btn-outline:hover {
  background: var(--blue-light);
}

.btn-plain {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
}

.btn-plain:hover {
  background: #f4f6f8;
}

.btn-danger {
  background: var(--surface);
  border-color: var(--red-border);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red-bg);
}

/* ---------- 答题页 ---------- */
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.q-count {
  color: var(--blue);
  font-weight: 700;
}

.q-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.q-timer img {
  width: 15px;
  height: 15px;
}

.progress {
  height: 8px;
  background: #e6ebf0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width 0.3s ease;
}

.question {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.7;
  margin: 16px 0;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.option:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f7fbff;
}

.option .letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: #eef3f8;
  color: #4a5b6b;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}

/* 正确答案按钮变绿 */
.option.correct {
  border-color: var(--green);
  background: var(--green-bg);
}

.option.correct .letter {
  background: var(--green);
  color: #ffffff;
}

.option.correct .opt-text {
  color: var(--green-dark);
  font-weight: 700;
}

/* 自己的错误答案标红 */
.option.wrong {
  border-color: var(--red);
  background: var(--red-bg);
}

.option.wrong .letter {
  background: var(--red);
  color: #ffffff;
}

.option.wrong .opt-text {
  color: var(--red-dark);
  font-weight: 700;
}

.option:disabled {
  cursor: default;
}

/* ---------- 反馈 + 解析 ---------- */
.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.feedback > img {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 3px;
}

.fb-body {
  flex: 1;
  min-width: 0;
}

.fb-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.fb-text {
  font-size: 14px;
}

.fb-hint {
  margin-top: 4px;
  font-size: 13px;
}

.fb-explain {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(0, 0, 0, 0.14);
  font-size: 13px;
  line-height: 1.75;
  color: #46535f;
}

.feedback.ok {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green-dark);
}

.feedback.bad {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red-dark);
}

.quiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.score-now {
  color: var(--muted);
  font-size: 13px;
}

.hint-bar {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}

/* ---------- 结果页 ---------- */
.result-card {
  text-align: center;
}

.result-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
}

.result-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.result-score {
  color: var(--muted);
}

.result-score b {
  color: var(--blue);
  font-size: 18px;
}

.result-eval {
  color: var(--muted);
  margin-bottom: 6px;
}

.result-best {
  color: var(--faint);
  font-size: 13px;
  margin-bottom: 16px;
}

.rating {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-bottom: 18px;
}

.rating-label {
  font-weight: 600;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 6px;
}

.stars img {
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.rating-text {
  color: var(--blue-dark);
  font-size: 13px;
  min-height: 1.4em;
}

/* ---------- 历史成绩 ---------- */
.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fafbfc;
}

.hi-score {
  color: var(--blue);
  font-weight: 700;
}

.hi-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.empty-tip {
  text-align: center;
  color: var(--faint);
  padding: 22px 0;
  margin-bottom: 14px;
}

/* ---------- 返回按钮 ---------- */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  flex: 0 0 auto;
}

.back-btn:hover {
  background: #f4f6f8;
}

.back-btn img {
  width: 16px;
  height: 16px;
}

/* ---------- 说明块 ---------- */
.note {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f7f9fb;
  border-left: 3px solid var(--blue);
  border-radius: 0 4px 4px 0;
  color: #46535f;
  font-size: 13px;
  line-height: 1.75;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: #22303c;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 13px;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center;
  color: var(--faint);
  font-size: 12px;
  padding: 20px 16px 28px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 520px) {
  .header-inner {
    padding: 12px 14px;
  }

  .brand-text h1 {
    font-size: 16px;
  }

  .page {
    padding: 14px 12px 8px;
  }

  .card {
    padding: 16px;
  }

  .question {
    font-size: 16px;
  }

  .actions-row {
    flex-direction: column;
  }

  .actions-row .btn {
    width: 100%;
  }

  .quiz-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-foot .btn {
    width: 100%;
  }
}
