:root {
  --bg: #0b1a16;
  --card: #16302a;
  --line: #2a4d43;
  --ink: #eaf4ee;
  --dim: #9fb8ae;
  --gold: #ffd34d;
  --red: #e2483c;
  --green: #4ec98a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(120% 60% at 50% 0%, #1c3a31 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.glow {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1px 1px at 40% 7%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 88% 34%, rgba(255,255,255,.25), transparent 60%);
}

.app {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 18px calc(28px + env(safe-area-inset-bottom));
  min-height: 100vh;   /* 老浏览器兜底 */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, #1b3a31, var(--card));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 20px 40px -30px #000;
}

.kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .18em; color: var(--gold); }

h1 { margin: 0 0 10px; font-size: 26px; line-height: 1.3; }

.sub { margin: 0 0 18px; color: var(--dim); font-size: 14px; line-height: 1.7; }

button { font: inherit; cursor: pointer; border: 0; border-radius: 14px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .12s, opacity .12s, background .12s; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }

.btn-primary {
  display: block; width: 100%; margin-top: 16px; padding: 15px;
  background: linear-gradient(180deg, #ffe27a, var(--gold));
  color: #3a2a00; font-weight: 800; font-size: 17px;
}

.btn-ghost {
  display: block; width: 100%; margin-top: 10px; padding: 12px;
  background: transparent; color: var(--dim); border: 1px solid var(--line); font-size: 14px;
}

.bar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--dim); }
.bar .track { flex: 1; height: 5px; border-radius: 999px; background: #0d231d; overflow: hidden; }
.bar .fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width .3s; }
.bar .clock { font-variant-numeric: tabular-nums; color: var(--gold); min-width: 44px; text-align: right; }

.field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 6px;
  font-size: 15px;
  color: var(--dim);
}

.field-label { flex: 0 0 auto; }

.namefield {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1.5px dashed #3d6b5c;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  padding: 3px 2px 7px;
  outline: none;
}
.namefield::placeholder { color: #5f7a70; }
.namefield:focus { border-bottom-color: var(--gold); }

.qtext { margin: 6px 0 18px; font-size: 20px; line-height: 1.5; font-weight: 700; }.opts { display: grid; gap: 9px; }

.opt {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; text-align: left; font-size: 16px;
  color: var(--ink); background: #0f2620; border: 1px solid var(--line);
  -webkit-tap-highlight-color: transparent;   /* 手机上别闪一下 */
  touch-action: manipulation;                 /* 去掉 300ms 点击延迟 */
}

/* 只在真正有指针悬停能力的设备上才有效果。
   手机上 :hover 会"粘住"上一次点击的坐标，换题后同一个位置仍然发亮，
   看起来像是系统提示了某个选项 —— 必须关掉。 */
@media (hover: hover) and (pointer: fine) {
  .opt:hover:not(:disabled) { border-color: #3d6b5c; background: #133029; }
}

/* 键盘 Tab 过来时给个可见的焦点圈，但手机上点击不留痕 */
.opt:focus { outline: none; }
.opt:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.opt .k {
  flex: 0 0 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: #0b1a16; color: var(--dim); font-size: 12px; font-weight: 700;
}

.score { font-size: 54px; font-weight: 800; line-height: 1; margin: 4px 0 10px; }
.score small { font-size: 18px; color: var(--dim); font-weight: 600; }

.msg { font-size: 16px; line-height: 1.6; margin: 0 0 14px; }

.marks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.mk {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-size: 13px;
  border: 1px solid var(--line); color: var(--dim);
}
.mk.ok { border-color: var(--green); color: var(--green); background: #123326; }
.mk.no { border-color: var(--red); color: var(--red); background: #331815; }

.meta { font-size: 12.5px; color: var(--dim); line-height: 1.7; }
