.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 16px calc(48px + env(safe-area-inset-bottom));
}

.card {
  background: var(--card);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
}

/* ---------- masthead ---------- */
.masthead {
  padding: 8px 4px 22px;
  border-bottom: 3px double var(--ink);
  margin-bottom: 22px;
}
.kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.masthead.open .status-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.masthead h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 6.4vw, 42px);
  line-height: 1.18;
  margin: 0;
  letter-spacing: 0.01em;
}
.lede {
  margin: 12px 0 0;
  color: var(--ink-soft);
  white-space: pre-line;
}

/* ---------- gate ---------- */
.gate {
  padding: 22px 20px 18px;
  margin-bottom: 22px;
  border: 1.5px solid var(--ink);
  position: relative;
}
.gate::before {
  content: "登记";
  position: absolute;
  top: -12px; right: 18px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 3px;
  transform: rotate(3deg);
}
.gate h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 4px; }
.gate-note { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.seg {
  display: inline-flex;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px;
  margin-bottom: 12px;
}
.seg-btn {
  border: 0; background: transparent; border-radius: 999px;
  padding: 5px 14px; font-size: 13px; font-weight: 600;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.seg-btn[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.gate-form { display: flex; gap: 8px; }
.gate-form .field { flex: 1; min-width: 0; }
.gate-error { min-height: 1.4em; margin: 8px 0 0; color: var(--danger); font-size: 13px; }

.whoami {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--ink-soft);
  margin: -8px 4px 16px;
}
.link-btn { border: 0; background: none; color: var(--accent-ink); text-decoration: underline; padding: 0; }

/* Questions stay readable but inert until the visitor registers. */
.locked .questions { opacity: 0.55; filter: saturate(0.6); pointer-events: none; user-select: none; }

/* ---------- questions ---------- */
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.question { padding: 20px 18px 16px; }
.q-head { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-bottom: 14px; }
.q-no {
  font-family: var(--font-num);
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
  font-weight: 700;
  min-width: 1.6em;
}
.q-title { font-family: var(--font-display); font-size: 19px; line-height: 1.4; margin: 0; }
.q-desc { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.q-desc:empty { display: none; }
.q-rule { margin: 6px 0 0; font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }

.options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opt {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1.5px solid var(--rule);
  background: var(--card);
  border-radius: var(--radius-s);
  padding: 11px 12px;
  overflow: hidden;
  transition: border-color var(--duration-fast), transform var(--duration-fast) var(--ease-out);
}
.opt:hover { border-color: var(--ink-soft); }
a.opt { text-decoration: none; color: inherit; }
.opt:active { transform: scale(0.99); }
.opt-bar {
  position: absolute; inset: 0 auto 0 0;
  width: 100%;
  background: var(--paper-deep);
  transform-origin: left center;
  transform: scaleX(var(--share, 0));
  transition: transform 600ms var(--ease-out);
  z-index: 0;
}
.opt > *:not(.opt-bar) { position: relative; z-index: 1; }
.opt-text { font-weight: 500; word-break: break-word; }
.opt-text .tag { margin-left: 6px; }
.opt-count { display: flex; align-items: center; gap: 8px; }
.opt-num { font-family: var(--font-num); font-size: 17px; font-weight: 700; min-width: 2ch; text-align: right; }
.plus {
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 1px 9px;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.opt.voted { border-color: var(--accent); }
.opt.voted .opt-bar { background: var(--accent-soft); }
.opt.voted .plus { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.voted .opt-num { color: var(--accent-ink); }
.opt.bump .opt-num { animation: bump 420ms var(--ease-out); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.opt.flash { animation: flash 1.2s var(--ease-out); }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px var(--accent-soft); } 100% { box-shadow: none; } }

/* ---------- add option ---------- */
.add-form { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.add-label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.add-row { display: flex; gap: 8px; }
.add-row .field { flex: 1; min-width: 0; }
.suggest { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.suggest li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 13px; background: var(--paper); border-radius: var(--radius-s); padding: 6px 10px;
}
.suggest .hint { color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.colophon {
  margin-top: 28px; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 0.06em;
}

@media (max-width: 420px) {
  .gate-form, .add-row { flex-direction: column; }
  .q-no { font-size: 24px; }
}
