:root {
  --bg: #f1f4fa;
  --surface: #fff;
  --ink: #17203a;
  --text: #36405a;
  --muted: #69748c;
  --faint: #97a1b5;
  --line: #e7ebf3;
  --edge: #d3d9e6;
  --brand: #3562ee;
  --brand-deep: #2449cf;
  --brand-soft: #eef3ff;
  --brand-edge: #cbd8ff;
  --ok: #17a870;
  --ok-soft: #e4f7ee;
  --warn: #a86200;
  --warn-soft: #fff5e0;
  --bad: #d9303c;
  --bad-ink: #bf2330;
  --bad-soft: #fff3f2;
  --radius: 12px;
  --pad: 32px;
  --indent: 44px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 16px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* The coloured top of the page; the sheet below overlaps its lower edge. */
.hero { position: relative; overflow: hidden; padding: 46px 24px 108px; color: #fff; text-align: center;
  background: radial-gradient(52% 110% at 8% -18%, rgb(255 255 255 / .26), transparent 62%),
    radial-gradient(46% 96% at 96% 0%, rgb(120 215 255 / .42), transparent 64%),
    linear-gradient(135deg, #2444d6 0%, #3769f1 54%, #4c97f8 100%); }
.hero::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: radial-gradient(rgb(255 255 255 / .2) 1px, transparent 1.6px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(#000, transparent 82%); mask-image: linear-gradient(#000, transparent 82%); }
.hero::after { content: ""; position: absolute; right: -70px; bottom: -150px; width: 300px; height: 300px; border: 42px solid rgb(255 255 255 / .08); border-radius: 50%; }
h1 { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; font-size: 27px; line-height: 1.35; font-weight: 700; letter-spacing: .06em; text-shadow: 0 2px 10px rgb(16 36 120 / .28); }

.sheet { position: relative; z-index: 1; max-width: 720px; margin: -64px auto 56px; padding-bottom: 32px; border-radius: 18px; background: var(--surface);
  box-shadow: 0 1px 2px rgb(18 32 77 / .05), 0 14px 36px -12px rgb(27 52 130 / .2); }
.sheet > section, .sheet > form { animation: rise .32s ease both; }

/* The ICP filing line under the sheet. */
.site-footer { margin-top: -24px; padding: 0 16px 24px; color: var(--faint); font-size: 12px; text-align: center; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.progress { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 14px; padding: 16px var(--pad) 14px; border-bottom: 1px solid var(--line); border-radius: 18px 18px 0 0;
  background: var(--surface); box-shadow: 0 8px 14px -14px rgb(27 52 130 / .4); }
.progress-track { flex: 1; height: 8px; border-radius: 99px; background: #e8ecf5; overflow: hidden; }
.progress-bar { width: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #56a5f9); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.progress-text { min-width: 5.8em; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.state { padding: 56px var(--pad) 28px; color: var(--muted); text-align: center; }
.state h2 { margin: 0 0 10px; color: var(--ink); font-size: 21px; line-height: 1.4; }
.state p { margin: 0 0 22px; }
.spinner { width: 34px; height: 34px; margin: 0 auto 16px; border: 3px solid #e3e9f6; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert-mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: var(--warn-soft); color: #d98a00; font-size: 32px; font-weight: 700; line-height: 64px; }

.mark { display: block; width: 84px; height: 84px; margin: 0 auto 20px; animation: pop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.mark-halo { fill: var(--ok-soft); }
.mark-disc { fill: var(--ok); }
.mark-tick { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: tick .4s .25s ease-out forwards; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes tick { to { stroke-dashoffset: 0; } }

.result { max-width: 480px; margin: 30px auto 0; padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fafbfe; }
.state .result p { margin: 0; color: var(--muted); font-size: 14px; }
.result strong { display: block; margin: 6px 0 4px; color: var(--brand-deep); font-size: 40px; font-weight: 700; line-height: 1.25; letter-spacing: .14em; text-indent: .14em; }
.state .result .result-names { color: var(--text); font-size: 15px; }
.state .result .result-text { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--edge); color: var(--text); font-size: 15px; line-height: 1.8; text-align: left; }
.state .result .result-note { margin-top: 12px; color: var(--faint); font-size: 12px; }

.video { max-width: 480px; margin: 30px auto 0; padding: 24px 22px 22px; border: 1px solid var(--brand-edge); border-radius: 16px; background: linear-gradient(#f5f8ff, #fff); }
.video.waiting { border-color: #f3dfb4; background: linear-gradient(#fffaf0, #fff); }
.state .video p { margin: 0 0 16px; color: var(--text); }
.video .button { min-width: 200px; }
.video .button.primary::before { content: ""; margin-right: 10px; border: solid transparent; border-width: 7px 0 7px 11px; border-left-color: #fff; }
.state .video .video-address { margin: 22px 0 0; padding-top: 16px; border-top: 1px dashed var(--edge); color: var(--muted); font-size: 13px; line-height: 1.7; text-align: left; }
.video-address span { display: block; margin-top: 8px; padding: 9px 12px; border-radius: 8px; background: #eff3fa; color: var(--ink); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; -webkit-user-select: all; user-select: all; }

.cover { padding: 30px var(--pad) 0; }
.intro, .lead { margin: 0 0 26px; padding: 16px 18px; border-radius: var(--radius); background: var(--brand-soft); color: #33405e; font-size: 15px; line-height: 1.8; }
.intro::before { content: "填写说明"; display: block; margin-bottom: 4px; color: var(--brand-deep); font-size: 13px; font-weight: 700; letter-spacing: .1em; }
.intro:empty, .lead:empty { display: none; }
.field { display: block; margin-bottom: 14px; }
.field-title { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 600; }
.required { margin-right: 4px; color: var(--bad); font-style: normal; }
.field input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--edge); border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder { color: var(--faint); }
.field input:hover { border-color: #b3bed6; }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(53 98 238 / .14); }
.hint { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.note { margin: 0 0 20px; padding: 11px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.note.saved { background: var(--ok-soft); color: #14774f; }
.error { margin: 0 var(--pad) 16px; padding: 11px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad-ink); font-size: 14px; text-align: left; }
.cover .error, .video .error { margin-right: 0; margin-left: 0; }

/* The rows of the second page: a title, a counter beside it, and the field below. */
.sheet:has(#view-enter:not([hidden])) { max-width: 440px; }
#rows .field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px; margin-bottom: 12px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfe; }
#rows .field-title { margin: 0; }
#rows .field input { grid-row: 2; grid-column: 1 / -1; height: 46px; font-size: 15px; }
#rows .hint { grid-row: 1; grid-column: 2; margin: 0; padding: 1px 11px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; font-weight: 600; }
#rows .hint:empty { display: none; }

.part-head { padding: 22px var(--pad) 20px; border-bottom: 1px solid var(--line); background: #f8faff; }
.part-head h2 { display: inline-block; margin: 0; padding: 3px 13px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-deep); font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.part-head p { margin: 12px 0 0; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.6; }

.item { padding: 20px var(--pad); scroll-margin-top: 76px; transition: background .2s; }
.item + .item { border-top: 1px solid var(--line); }
.item-title { position: relative; min-height: 28px; margin-bottom: 12px; padding-left: var(--indent); color: var(--ink); font-weight: 600; line-height: 28px; }
.number { position: absolute; top: 0; left: 0; min-width: 32px; height: 28px; padding: 0 6px; border-radius: 9px; background: #edf0f6; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; text-align: center; transition: background .2s, color .2s; }
.item:has(input:checked) .number { background: var(--brand); color: #fff; }
.blank { display: inline-block; width: 3em; margin: 0 4px; border-bottom: 1.5px solid var(--faint); vertical-align: baseline; }
.options { display: grid; gap: 10px; padding-left: var(--indent); }
.option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--edge); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s, transform .08s; }
.option:hover { border-color: #9cb3f6; background: #fafcff; }
.option:active { transform: scale(.985); }
.option.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--brand); }
.option input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; border: 2px solid #b9c3d6; border-radius: 50%; background: #fff; cursor: pointer; -webkit-appearance: none; appearance: none; transition: border-color .15s, border-width .15s; }
.option input:checked { border-color: var(--brand); border-width: 6px; }
.option input:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.item.pair { display: grid; grid-template-columns: var(--indent) 1fr; align-items: center; padding-top: 6px; padding-bottom: 6px; border-top: 0; }
.item.pair:first-child { padding-top: 20px; }
.item.pair .item-title { margin: 0; padding: 0; }
.item.pair .number { position: static; display: inline-block; }
.item.pair .options { grid-template-columns: 1fr 1fr; padding-left: 0; }
.item.missing { background: var(--bad-soft); box-shadow: inset 3px 0 0 var(--bad); }
.item.missing .number { background: #ffdcd9; color: var(--bad-ink); }
.item.missing .options::after { content: "请选择一项"; grid-column: 1 / -1; color: var(--bad-ink); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.actions { display: flex; justify-content: center; gap: 14px; padding: 28px var(--pad) 0; }
.cover .actions { padding: 8px 0 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-width: 136px; height: 48px; padding: 0 26px; border: 1px solid var(--edge); border-radius: var(--radius); background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s, box-shadow .15s, filter .15s, transform .08s; }
.button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.button.primary { border-color: transparent; background: linear-gradient(135deg, #2c52e4, #4284f7); color: #fff; box-shadow: 0 8px 18px -8px rgb(44 82 228 / .7); }
.button.primary:hover:not(:disabled) { border-color: transparent; color: #fff; filter: brightness(1.07); }
.button:disabled { opacity: .6; box-shadow: none; cursor: default; }
.cover .button:only-child { min-width: 240px; }
.page-note { margin: 16px 0 0; color: var(--faint); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  :root { --pad: 18px; --indent: 40px; }
  .hero { padding: 30px 18px 88px; }
  .hero::after { right: -110px; bottom: -190px; }
  h1 { font-size: 22px; letter-spacing: .04em; }
  .sheet { margin: -60px 12px 28px; padding-bottom: 24px; border-radius: 16px; }
  .site-footer { margin-top: -8px; }
  .progress { padding-top: 14px; padding-bottom: 12px; border-radius: 16px 16px 0 0; }
  .state { padding-top: 44px; }
  .cover { padding-top: 22px; }
  .options { padding-left: 0; }
  .button, .cover .button:only-child { min-width: 0; flex: 1; }
  .video { padding-right: 16px; padding-left: 16px; }
  .video .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mark-tick { stroke-dashoffset: 0; }
}
