:root {
    color-scheme: light;
    --ink: #172b36;
    --muted: #526773;
    --line: #cce0d1;
    --paper: #ffffff;
    --wash: #eef4ef;
    --navy: #123b4a;
    --teal: #599598;
    --teal-dark: #245d60;
    --mint: #cce0d1;
    --orange: #e89240;
    --danger: #a33632;
    font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    color: var(--ink);
    background: var(--wash);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: #075f70; text-underline-offset: 0.2em; }
a:hover { color: var(--teal-dark); }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { outline-offset: 3px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--teal-dark); }

.page-shell { --content-inset: clamp(20px, 5vw, 64px); width: min(100% - 48px, 1240px); margin: 28px auto 64px; }
.hero, .survey-section, .notice { background: var(--paper); border: 1px solid var(--line); }
.hero-content { padding: clamp(27px, 3.3vw, 44px) var(--content-inset) clamp(30px, 3.65vw, 48px); }
.hero-banner, .hero-banner-link { display: block; }
.hero-banner { width: 100%; height: auto; border-bottom: 4px solid var(--navy); }
.hero-banner-link:focus-visible { outline-offset: -4px; }
.eyebrow, .year-label { margin: 0; color: var(--muted); font-size: 0.92rem; letter-spacing: 0.02em; }
.eyebrow { display: inline-block; padding: .25rem clamp(.75rem, 2.4vw, 2rem); border-radius: 20px; background: var(--mint); color: var(--navy); font-weight: 600; }
.year-label { margin-top: 12px; color: var(--navy); font-weight: 700; }
h1 { margin: .9rem 0 1.65rem; color: var(--navy); font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(1.55rem, 3.55vw, 3.05rem); line-height: 1.24; letter-spacing: -0.02em; }
h1 span { display: block; margin-top: .35rem; font-family: "Segoe UI", "Noto Sans", sans-serif; font-size: clamp(.95rem, 2vw, 1.48rem); font-weight: 650; letter-spacing: 0; line-height: 1.4; }
.hero-result h1 { margin: 10px 0 16px; font-size: clamp(1.5rem, 3.2vw, 2.6rem); }
.hero-result h1 span { font-size: clamp(.95rem, 1.95vw, 1.25rem); }
.invitation { margin: 0; max-width: 760px; color: #344d59; font-size: 1.08rem; line-height: 1.8; }
.survey-status { display: grid; gap: .35rem; margin-top: clamp(20px, 3vw, 36px); }
.status-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem; margin: 0; color: var(--navy); }
.survey-period { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem; margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.survey-period-range {
    max-width: 100%;
    padding: .35rem .65rem;
    border-inline-start: 4px solid var(--teal);
    border-radius: 4px;
    color: var(--navy);
    background: var(--mint);
    font-size: clamp(.96rem, 1.5vw, 1.15rem);
    font-variant-numeric: tabular-nums;
}
.survey-period-range time { white-space: nowrap; }
.status-pill { padding: .25rem .65rem; border-radius: 5px; background: #e7f2e9; color: var(--teal-dark); font-weight: 700; }
.status-not_started, .status-closed, .status-not_configured { color: #744612; }
.local-note { margin: 18px 0 0; padding: 12px 14px; border-left: 3px solid #d59a36; background: #fff8e9; color: #674818; line-height: 1.6; }

.notice { margin: 22px 0; padding: 18px 22px; border-left: 5px solid var(--teal); line-height: 1.65; }
.notice strong, .notice span[lang="en"] { display: block; }
.notice span[lang="en"] { margin-top: 4px; color: var(--muted); }
.notice a { display: inline-block; margin-top: 10px; }
.notice-error { border-left-color: var(--danger); background: #fff9f8; }
.notice-success strong, .notice-duplicate strong { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.35; }
.hero :is(.notice-success, .notice-duplicate) { margin: 22px 0 0; }
.notice-success { border-left-color: #17558d; background: #f4f8fd; }
.notice-success strong { color: #17558d; }
.notice-duplicate { border-left-color: var(--danger); background: #fff5f4; }
.notice-duplicate strong { color: #a1201c; }
.notice ul { margin-bottom: 0; padding-left: 1.25rem; }

.section-nav { position: sticky; z-index: 4; top: 0; margin: 0; padding: .85rem var(--content-inset) 1rem; border-block: 5px solid var(--mint); background: var(--paper); }
.progress-label { margin: 0 0 .45rem; }
.progress-text, .progress-count { display: block; font-weight: 700; line-height: 1.25; }
.progress-text { color: var(--navy); font-size: .9rem; }
.progress-count { margin-top: .2rem; color: var(--teal-dark); font-size: clamp(1.35rem, 2.35vw, 1.85rem); font-variant-numeric: tabular-nums; }
.progress-track { position: relative; height: 10px; overflow: hidden; border-radius: 999px; background: var(--mint); }
.progress-fill { display: block; width: calc(100% / 6); height: 100%; border-radius: inherit; background: var(--teal); transition: width 180ms ease; }
.progress-nodes { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center; pointer-events: none; }
.progress-nodes span { width: 5px; height: 5px; justify-self: end; margin-right: 3px; border-radius: 50%; background: #fff; }
.survey-section { padding: clamp(26px, 4.8vw, 60px) var(--content-inset); margin-bottom: 20px; }
.survey-section[hidden], [hidden] { display: none !important; }
.section-heading { margin-bottom: clamp(22px, 3.5vw, 42px); }
.section-heading h2 { margin: 0; padding: .55rem clamp(.8rem, 1.7vw, 1.35rem); border: 1px solid var(--teal); color: var(--navy); font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(1.45rem, 3.25vw, 2.65rem); font-weight: 500; line-height: 1.3; }
.section-heading h2 span { display: block; margin-top: .25rem; font-family: "Segoe UI", "Noto Sans", sans-serif; font-size: .55em; line-height: 1.4; }
#respondent-heading span { display: inline; font: inherit; }
.section-guidance { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .35rem 1rem; margin-top: clamp(14px, 2.4vw, 27px); padding-bottom: .5rem; border-bottom: 2px solid var(--line); color: var(--muted); }
.section-guidance p { margin: 0; line-height: 1.6; }
.respondent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px clamp(24px, 5vw, 64px); }
.form-field { display: grid; grid-template-rows: 1fr auto auto; align-items: end; }
.form-field :is(input, select) { height: 50px; }
.form-field label, .question legend, .question-extra label { font-weight: 700; line-height: 1.5; }
.form-field input, .form-field select, .question textarea, .question-extra textarea { display: block; width: 100%; margin-top: 8px; padding: 11px 12px; border: 1px solid var(--teal); border-radius: 8px; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
textarea { resize: vertical; line-height: 1.55; }
.required-mark { margin-left: .2em; color: #a1201c; font-weight: 700; }
.field-error { min-height: 1.35em; margin: 5px 0 0; color: var(--danger); font-size: 0.84rem; }
.field-error:empty { display: none; }
.consent-box { margin-top: 12px; padding: 16px; border: 1px solid #c4d7d4; border-radius: 10px; background: #f4faf8; }
.consent-choice { align-items: flex-start !important; }
.consent-choice .choice-label { display: grid; gap: 7px; }
.lottery-card { margin-top: 20px; padding: 18px; border-radius: 10px; background: #f3f6f8; }
.lottery-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 1.04rem; }
.lottery-card p { margin: 0 0 10px; color: #3c515b; line-height: 1.7; }
.lottery-links { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }

.question-group { margin-bottom: 26px; }
.question-group h3 { display: flex; flex-wrap: wrap; gap: .25rem .65rem; align-items: baseline; margin: 0 0 18px; padding: 9px 12px; border-left: 4px solid var(--teal); background: #eaf3ec; color: var(--navy); font-size: 1.05rem; }
.question-group h3 span { color: var(--muted); font-size: .9rem; font-weight: 500; }
.question { margin: 0 0 18px; padding: 0 0 18px; border-bottom: 1px solid var(--line); scroll-margin-top: 132px; }
.question fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.question legend { float: left; width: 100%; padding: 0; color: var(--navy); font-size: 1.02rem; }
.question legend + * { clear: both; }
.question-choice-notice { margin: 0; color: var(--teal-dark); }
.question-choice-notice:not(:empty) { margin: 0 0 10px; }
.question-id { display: inline-flex; margin-right: 5px; color: var(--teal-dark); font-family: Consolas, monospace; font-size: 0.78rem; }
.question-en { margin: 7px 0 14px; color: var(--muted); line-height: 1.55; }
.hint { margin: 10px 0 14px; padding: 10px 12px; border-radius: 8px; background: #f3f7fa; color: #3d5561; line-height: 1.55; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choices-rating { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { display: flex; min-width: 0; align-items: flex-start; gap: 10px; padding: 9px 8px; background: #fff; cursor: pointer; }
.choice:hover { background: #f2f6f5; }
.choice input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal); }
.choice-label { display: grid; gap: 3px; line-height: 1.45; }
.choice-label span[lang="en"] { color: var(--muted); font-size: 0.88rem; }
.question-extra { margin-top: 14px; padding: 14px; border-left: 3px solid #d6a348; border-radius: 0 8px 8px 0; background: #fff9ee; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.button { min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 700; }
.button-primary { margin-left: auto; border-color: #9c4e10; color: #291607; background: var(--orange); }
.button-primary:hover:not(:disabled) { background: #f3a759; }
.button-secondary { color: var(--navy); border-color: #9cb3ba; background: #fff; }
.button:disabled { cursor: not-allowed; opacity: 0.55; }
.survey-start-actions { flex-wrap: wrap; align-items: center; }
.survey-start-status { margin: 0; color: var(--muted); line-height: 1.55; }
.survey-start-actions .button:disabled { border-color: #b6bfc4; color: #465760; background: #e7ebed; opacity: 1; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 16px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.site-footer p { margin: 0; }
.site-footer a { align-self: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 680px) {
    .page-shell { --content-inset: 18px; width: calc(100% - 20px); margin-top: 10px; }
    .respondent-grid, .choices, .choices-rating { grid-template-columns: 1fr; }
    .form-actions { position: sticky; bottom: 0; z-index: 3; padding: 10px 0; background: #fff; }
    .button { padding: 10px 13px; }
    .site-footer { display: block; }
    .site-footer a { display: inline-block; margin-top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
