:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1b1c1f;
  --muted: #8a8f99;
  --line: #eceef1;
  --danger: #fa5151;
  --warn: #fa9d3b;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(17, 24, 39, 0.05);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: 16px; }
.year-tag {
  font-size: 12px;
  color: var(--green-dark);
  background: rgba(7, 193, 96, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
}

.view { flex: 1; padding: 16px 16px 32px; max-width: 640px; width: 100%; margin: 0 auto; }

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

.loading, .empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* 用户条 */
.userbar { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #07c160, #48d68a);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.userbar .name { font-weight: 600; }
.userbar .sub { font-size: 12px; color: var(--muted); }

/* 金额 */
.balance-card { text-align: center; padding: 22px 18px; }
.balance-card .label { color: var(--muted); font-size: 13px; }
.balance-amount { font-size: 40px; font-weight: 700; letter-spacing: -1px; margin: 4px 0 2px; }
.balance-amount small { font-size: 18px; font-weight: 500; margin-right: 2px; }
.balance-meta { display: flex; justify-content: center; gap: 26px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.balance-meta b { display: block; font-size: 15px; color: var(--text); font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border-radius: 10px; border: none;
  font-size: 15px; font-weight: 500; cursor: pointer; transition: opacity .15s;
  font-family: inherit;
}
.btn:active { opacity: .82; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-ghost { background: #f2f3f5; color: var(--text); }
.btn-outline { background: #fff; color: var(--green-dark); border: 1px solid var(--green); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #ffd6d6; }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* 规则说明 */
.rule-list { margin: 0; padding-left: 18px; color: #555a63; font-size: 13.5px; }
.rule-list li { margin-bottom: 4px; }

.section-title { font-size: 14px; font-weight: 600; margin: 20px 4px 10px; color: #33363b; }

/* 题目 */
.question { padding: 18px; }
.q-head { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.q-index {
  flex: none; width: 22px; height: 22px; border-radius: 6px; background: rgba(7,193,96,.1);
  color: var(--green-dark); font-size: 12px; display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.q-title { font-weight: 500; font-size: 15px; }
.q-type { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }
.q-required { color: var(--danger); margin-left: 2px; }

.option {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer; transition: .15s;
}
.option:last-child { margin-bottom: 0; }
.option.active { border-color: var(--green); background: rgba(7,193,96,.06); }
.option .mark {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid #c9ccd1; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent;
}
.option.multi .mark { border-radius: 5px; }
.option.active .mark { background: var(--green); border-color: var(--green); color: #fff; }

textarea.answer {
  width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-family: inherit; font-size: 14px; resize: vertical; background: #fafbfc;
}
textarea.answer:focus { outline: none; border-color: var(--green); background: #fff; }

/* 结果 */
.result-badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px;
  background: rgba(7,193,96,.1); color: var(--green-dark); margin-left: 8px;
}
.result-badge.bad { background: rgba(250,81,81,.1); color: var(--danger); }
.result-badge.mock { background: rgba(250,157,59,.12); color: #c77700; }

/* 记录 */
.record { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: none; }
.record .meta { font-size: 12px; color: var(--muted); }
.record .amt { font-weight: 600; }
.record .status { font-size: 12px; }
.status-success { color: var(--green-dark); }
.status-processing { color: var(--warn); }
.status-failed { color: var(--danger); }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.mask[hidden] { display: none; }
.sheet {
  background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 360px;
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.sheet h3 { margin: 0 0 8px; font-size: 17px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }

.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font-size: 15px; background: #fafbfc; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--green); background: #fff; }

.muted { color: var(--muted); font-size: 13px; }
.tip { color: var(--muted); font-size: 12px; margin-top: 10px; text-align: center; }
.link-muted { color: var(--muted); font-size: 12px; }
.footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px 22px; font-size: 12px; color: var(--muted); max-width: 640px; width: 100%; margin: 0 auto;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translate(-50%, 20px);
  background: rgba(27,28,31,.9); color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: 80%;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
