:root {
  --paper: #f3efe7;
  --paper-2: #ebe5d9;
  --card: #fbf9f4;
  --ink: #2b2722;
  --ink-2: #6d655b;
  --ink-3: #9a9187;
  --line: #ddd5c7;
  --accent: #9a5b43;      /* fired clay */
  --accent-soft: #ead8cc;
  --sage: #6f7d6a;
  --focus: #3c5a6e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, #efe3d6 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 30%, #e7ebe2 0%, transparent 55%),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* language display */
.zh, .en { display: block; }
.en { color: var(--ink-2); font-size: .92em; margin-top: .15em; }
body.lang-zh .en { display: none; }
body.lang-en .zh { display: none; }
body.lang-en .en { color: inherit; font-size: 1em; margin-top: 0; }

.progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: transparent; z-index: 20; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }

.langbar {
  position: fixed; top: 12px; right: 12px; z-index: 15;
  display: flex; gap: 2px; padding: 3px;
  background: rgba(251, 249, 244, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px;
}
.langbar button {
  border: 0; background: transparent; color: var(--ink-2); font: 500 12.5px/1 var(--sans);
  padding: 7px 10px; border-radius: 999px; cursor: pointer;
}
.langbar button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.page { max-width: 680px; margin: 0 auto; padding: 72px 20px 40px; }

.masthead { text-align: left; margin-bottom: 36px; }
.mark { width: 34px; height: 51px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; margin-bottom: 18px; }
.mark path { stroke: var(--accent); }
h1 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -.01em;
  font-size: clamp(42px, 11vw, 68px); line-height: 1; margin: 0 0 14px;
}
.sub { margin: 0; font-family: var(--serif); font-size: 19px; }
.sub .en { font-style: italic; }

.intro p { margin: 0 0 18px; }
.intro .en { margin-top: 6px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; margin: 18px 0; box-shadow: 0 1px 0 rgba(43, 39, 34, .03);
}

.consent { border-color: var(--accent-soft); }
.consent label.check { font-weight: 500; }
.consent .stop { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--ink-2); font-size: 15px; }
.consent .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.instructions { font-size: 15px; color: var(--ink-2); border-left: 2px solid var(--accent); padding: 2px 0 2px 14px; margin: 26px 0 8px; }
.instructions .en { color: var(--ink-3); }

.declined { text-align: center; padding: 36px 20px; }
.declined .zh { font-family: var(--serif); font-size: 22px; }

/* form */
form[aria-disabled="true"] { display: none; }

.section {
  margin: 56px 0 6px; padding-top: 22px; border-top: 1px solid var(--line);
  font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.3;
}
.section .en { font-family: var(--serif); font-style: italic; font-size: 17px; }

.scenario {
  margin: 34px 0 6px; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, #e9eee4, #efe7dc); border: 1px solid #d9dccf; font-size: 15.5px;
}
.scenario .tag { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sage); margin-bottom: 8px; }

fieldset.q { border: 0; padding: 0; margin: 0; min-width: 0; }
.q-card { scroll-margin-top: 70px; }
.q-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 4px; }
.q-num { font: 500 13px/1 var(--mono); color: var(--accent); min-width: 22px; padding-top: 4px; }
legend.q-title, .q-title { padding: 0; font-family: var(--serif); font-size: 19.5px; line-height: 1.45; font-weight: 500; }
.q-title .en { font-family: var(--sans); font-weight: 400; font-size: 15px; line-height: 1.5; margin-top: 4px; }
.q-type { font: 500 11.5px/1 var(--mono); letter-spacing: .04em; color: var(--ink-3); margin: 10px 0 14px 34px; }
.q-type span { display: inline; }
body.lang-zh .q-type .en, body.lang-en .q-type .zh { display: none; }
body.lang-both .q-type .en::before { content: " · "; }

.opts { display: grid; gap: 8px; margin-left: 34px; }
@media (max-width: 480px) { .opts, .q-type { margin-left: 0; } }

label.opt, label.check {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff;
  cursor: pointer; transition: border-color .15s, background .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
label.opt:hover { border-color: #c9bfae; }
label.opt:active { transform: scale(.995); }
label.opt .txt { flex: 1; line-height: 1.4; }
label.opt .txt .en { font-size: 13.5px; margin-top: 2px; }
label.opt.excl { background: transparent; border-style: dashed; }

input[type="radio"], input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; margin: 2px 0 0;
  width: 20px; height: 20px; border: 1.5px solid #b7ad9e; background: #fff; display: grid; place-content: center;
  transition: border-color .15s, background .15s;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"] { border-radius: 6px; }
input[type="radio"]::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); transform: scale(0); transition: transform .15s; }
input[type="checkbox"]::before { content: ""; width: 11px; height: 6px; border: solid var(--paper); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .15s; }
input:checked { background: var(--ink); border-color: var(--ink); }
input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:checked::before { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
label.opt:has(input:checked), label.check:has(input:checked) { border-color: var(--ink); background: #fffdf8; }
input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.other-wrap { margin: 2px 0 0 0; display: none; }
.other-wrap.show { display: block; }

input.text, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  transition: border-color .15s;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
input.text:focus, textarea:focus { outline: none; border-color: var(--ink); }
.text-wrap { margin-left: 34px; }
@media (max-width: 480px) { .text-wrap { margin-left: 0; } }
.counter { text-align: right; font: 12px/1 var(--mono); color: var(--ink-3); margin-top: 6px; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.submit-row { margin: 44px 0 10px; text-align: center; }
.btn {
  appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 500 16px/1.2 var(--sans); padding: 15px 28px; border-radius: 999px; cursor: pointer;
  min-width: 220px; transition: transform .08s, opacity .2s;
}
.btn .en { color: rgba(243, 239, 231, .72); font-size: 13px; margin-top: 3px; }
body.lang-en .btn .en { color: inherit; font-size: 16px; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost .en { color: var(--ink-2); }
.btn.small { min-width: 0; padding: 11px 18px; font-size: 14.5px; }
.btn.small .en { font-size: 12px; }
.meta-note { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 14px; }
.error { color: #9b2c2c; text-align: center; font-size: 14.5px; margin-top: 14px; min-height: 1em; }

.thanks { text-align: center; padding: 80px 10px 60px; animation: fade .6s ease; }
.thanks .mark { width: 46px; height: 69px; margin: 0 auto 26px; display: block; }
.thanks .zh { font-family: var(--serif); font-size: 34px; line-height: 1.2; }
.thanks .en { font-family: var(--serif); font-style: italic; font-size: 20px; margin-top: 10px; }
.thanks p.small { margin-top: 30px; }
.thanks p.small .zh, .thanks p.small .en { font-family: var(--sans); font-style: normal; font-size: 14px; color: var(--ink-3); margin-top: 2px; }

.foot { text-align: center; padding: 30px 20px 50px; font: 12px/1.4 var(--mono); color: var(--ink-3); letter-spacing: .03em; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
#instructions { scroll-margin-top: 72px; }
