:root {
  color-scheme: light;
  --paper: #f7f4ec;
  --ink: #25382f;
  --muted: #59675b;
  --teal: #265449;
  --gold: #d4b377;
  --stroke: #b2b5a4;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p, fieldset { margin: 0; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--teal); text-underline-offset: 4px; }
:focus-visible { outline: 3px solid #936018; outline-offset: 3px; }
::selection { color: #162e27; background: #ead5aa; }
.layout { display: grid; grid-template-columns: minmax(0, 1.07fr) minmax(430px, .93fr); min-height: 100svh; }
.world { position: relative; isolation: isolate; overflow: hidden; min-height: 660px; background: #16213e; }
.world picture, .world picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.world picture img { object-fit: cover; object-position: 50% 55%; }
.world::before { content: ''; position: absolute; z-index: 1; pointer-events: none; inset: 0; background: linear-gradient(180deg, #12192f66, transparent 42%); }
.world::after { content: ''; position: absolute; z-index: 2; pointer-events: none; inset: clamp(13px, 1.8vw, 30px); border: 1px solid #e6d5aa77; }
.wordmark { position: absolute; z-index: 2; top: 15%; left: 5%; right: 5%; text-align: center; color: #fff3d9; }
.wordmark h1 { font-size: clamp(64px, 7.4vw, 134px); font-weight: 650; line-height: 1.15; letter-spacing: .07em; text-shadow: 0 3px 14px #0d1439; }
.rule { display: block; position: relative; width: 132px; height: 1px; margin: 24px auto; background: var(--gold); }
.rule::after { content: ''; position: absolute; width: 7px; height: 7px; left: calc(50% - 4px); top: -3px; transform: rotate(45deg); background: var(--gold); outline: 4px solid #273356; }
.paper { display: grid; align-items: center; justify-items: center; padding: clamp(44px, 6vh, 80px) clamp(32px, 5vw, 95px); }
.content { width: 100%; max-width: 450px; }
h2 { font-size: clamp(33px, 3vw, 49px); font-weight: 650; line-height: 1.3; letter-spacing: .025em; }
.intro { color: var(--muted); margin-top: 10px; line-height: 1.65; font-size: 15px; }
.referral { font-size: 14px; color: #843821; background: #f3e6dc; border-left: 3px solid #a95c43; padding: 10px 14px; line-height: 1.55; margin-top: 22px; overflow-wrap: anywhere; }
#ref-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.inline { border: 0; padding: 0; background: transparent; color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }
#ref-actions > * { min-height: 44px; display: inline-flex; align-items: center; }
form { margin-top: 28px; }
fieldset { min-width: 0; padding: 0; border: none; display: grid; gap: 18px; }
label { display: block; font-size: 14px; font-weight: 400; line-height: 1.5; }
input { display: block; width: 100%; min-width: 0; margin-top: 6px; border: 1px solid var(--stroke); border-radius: 3px; color: var(--ink); background: #fffdf6; padding: 10px 12px; min-height: 45px; font-size: 15px; caret-color: var(--teal); font-weight: 400; }
input::placeholder { color: #647063; opacity: 1; }
input:focus { border-color: var(--teal); }
input:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
input:disabled { background: #ebe9df; }
small, .hint { display: block; font-size: 12px; font-weight: 400; line-height: 1.65; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.hint:empty { margin: 0; }
.captcha-row { margin-top: 6px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, 132px) auto; align-items: center; gap: 10px; }
.captcha-row input { margin: 0; }
.captcha-preview { width: 100%; height: 46px; background: #eeeee4; border: 1px solid var(--stroke); border-radius: 3px; overflow: hidden; }
.captcha-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.refresh { min-width: 44px; min-height: 46px; font-size: 14px; }
.backup { border: 1px solid #7b9281; color: var(--teal); background: transparent; border-radius: 3px; padding: 8px 16px; font-size: 14px; font-weight: 600; }
.primary, .backup { min-height: 47px; display: flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; }
.primary { width: 100%; color: #fffbed; background: var(--teal); border: 1px solid var(--teal); border-radius: 3px; padding: 10px 14px; font-size: 16px; font-weight: 650; }
.primary span, .backup span { font-size: 19px; font-weight: 400; }
.primary:hover { background: #163f34; }
.backup:hover { background: #e6ebdf; }
.refresh:hover { color: #143b32; }
button:disabled { cursor: default; opacity: .62; }
#complete .primary { margin-top: 26px; }
.notice { color: #813721; background: #f3e6dc; padding: 10px 12px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
dialog { width: min(410px, calc(100% - 32px)); max-height: calc(100svh - 32px); padding: 32px; border: 1px solid #aa9d80; border-radius: 4px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 20px 78px #12212566; }
dialog::backdrop { background: #101a2bba; }
dialog[open] { animation: reveal .22s ease-out both; }
.close { position: absolute; top: 9px; right: 9px; min-width: 42px; min-height: 42px; line-height: 1; border: 0; color: var(--muted); background: transparent; font-size: 28px; }
.companion { width: 78px; height: 78px; object-fit: contain; margin-bottom: 3px; }
dialog h2 { font-size: 34px; }
dialog .intro { margin: 8px 0 24px; }
.backup { margin-top: 10px; }
@keyframes reveal { from { transform: translateY(7px); opacity: .7; } }
@media (max-width: 1050px) and (min-width: 761px) { .paper { padding-inline: 36px; } }
@media (max-width: 760px) {
  .layout { display: block; }
  .world { min-height: 0; height: clamp(145px, 40vw, 220px); }
  .world picture img { object-position: 50% 43%; }
  .wordmark { top: 50%; left: 9%; right: auto; transform: translateY(-50%); }
  .wordmark h1 { font-size: clamp(44px, 8.6vw, 70px); }
  .world::after { inset: 9px; }
  .rule { width: 72px; margin: 11px auto 0; }
  .paper { padding: 24px max(20px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
  .content { max-width: 510px; }
  h2 { font-size: 31px; }
  .intro { margin-top: 5px; font-size: 14px; }
  form, .referral { margin-top: 18px; }
  fieldset { gap: 14px; }
  input { font-size: 16px; }
  .captcha-row { gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(96px, 32%) auto; }
}
@media (max-width: 350px) { .paper { padding-inline: 16px; } .captcha-row { gap: 6px; } .captcha-row input { padding-inline: 8px; } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }
