:root {
  color-scheme: light;
  --primary: #176b61;
  --primary-hover: #12554d;
  --primary-soft: #e8f3f1;
  --surface: #ffffff;
  --background: #f4f5f6;
  --foreground: #202b2f;
  --muted: #5e6a70;
  --border: #d5dadd;
  --error: #b91c1c;
  --error-soft: #fef2f2;
  --focus: #176b61;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--foreground); font-size: 16px; line-height: 1.65; }
button, input, textarea, select { font: inherit; }
button, label, select { touch-action: manipulation; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-160%); background: #fff; color: var(--foreground); padding: 8px 12px; border-radius: 3px; }
.skip-link:focus { transform: none; }
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--border); }
.topbar__inner { width: min(100% - 32px, 960px); min-height: 58px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-weight: 700; letter-spacing: .04em; color: var(--primary); white-space: nowrap; }
.progress { width: min(260px, 48vw); font-size: 13px; color: var(--muted); text-align: right; }
.progress__track { height: 4px; margin-top: 6px; background: #dde3e4; overflow: hidden; }
.progress__track span { display: block; width: 0; height: 100%; background: var(--primary); transition: width .18s ease-out; }
.shell { width: min(100% - 32px, 960px); margin: 32px auto 72px; }
.survey-card, .status-card, .success-card, .admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
.status-card, .success-card { padding: 48px 24px; text-align: center; }
.survey-header { padding: clamp(28px, 4vw, 40px); border-bottom: 1px solid var(--border); }
.eyebrow { margin: 0 0 10px; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(25px, 3.2vw, 32px); line-height: 1.35; letter-spacing: 0; }
.survey-intro { max-width: 72ch; margin: 14px 0 0; color: var(--muted); }
.privacy-note { margin: 22px 0 0; padding: 12px 14px; border-left: 3px solid var(--primary); background: #f4f8f7; color: #3d5552; }
.survey-content { padding: clamp(24px, 4vw, 40px); }
.identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.field { min-width: 0; }
.field__label { display: block; margin-bottom: 8px; font-weight: 650; }
.required { color: var(--error); }
.text-input, .select-input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #aeb9bd; border-radius: 3px; background: #fff; color: var(--foreground); outline: none; transition: border-color .16s, box-shadow .16s; }
.text-input::placeholder, .choice__other::placeholder { color: #91999d; }
.text-input:focus, .select-input:focus { border-color: var(--focus); box-shadow: 0 0 0 2px rgba(23,107,97,.14); }
.textarea { resize: vertical; min-height: 100px; }
.question { min-width: 0; margin: 0; padding: 30px 0 34px; border: 0; }
.question legend { width: 100%; padding: 0; font-size: 17px; font-weight: 650; line-height: 1.6; }
.question__number { display: inline-flex; min-width: 34px; height: 26px; align-items: center; justify-content: center; margin-right: 10px; padding: 0 7px; border-radius: 3px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 700; vertical-align: 1px; }
.question__prompt { vertical-align: middle; }
.question__type { margin-left: 10px; color: #6b767b; font-size: 13px; font-weight: 400; white-space: nowrap; }
.question__help { margin: 12px 0 0 44px; color: var(--muted); font-size: 14px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 16px; }
.choice-grid--compact { margin-top: 0; }
.choice { position: relative; min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 3px; background: #fff; cursor: pointer; transition: border-color .16s, background .16s; }
.choice:hover { border-color: #91aaa6; background: #fbfdfd; }
.choice:has(input:checked) { border-color: var(--primary); background: #f4f9f8; }
.choice > input[type="radio"], .choice > input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.choice__control { flex: 0 0 20px; width: 20px; height: 20px; border: 2px solid #7a8c90; border-radius: 3px; background: #fff; }
.choice:has(input[type="radio"]) .choice__control { border-radius: 50%; }
.choice:has(input:checked) .choice__control { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 4px #fff; }
.choice:focus-within { outline: 2px solid rgba(23,107,97,.2); outline-offset: 2px; }
.choice__label { flex: 0 1 auto; min-width: 0; }
.choice--other { flex-wrap: nowrap; }
.choice__other { flex: 1 1 140px; min-width: 100px; height: 34px; margin-left: 2px; padding: 4px 6px; border: 0; border-bottom: 1px solid #7d898d; border-radius: 0; background: transparent; color: var(--foreground); outline: none; }
.choice__other:focus { border-bottom: 2px solid var(--primary); }
.question--error { margin: 22px -14px 0; padding: 28px 14px 34px; border: 1px solid #fecaca; border-radius: 3px; background: var(--error-soft); }
.field-error { margin: 8px 0 0; color: var(--error); font-size: 14px; font-weight: 600; }
.info-heading { margin: 38px 0 14px; font-size: 21px; line-height: 1.4; }
.info-text { margin: 10px 0; color: #315350; }
.table-scroll { margin: 20px 0 30px; overflow-x: auto; border: 1px solid var(--border); }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 14px; text-align: left; vertical-align: top; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: pre-line; }
th { background: #edf2f1; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { border-right: 0; }
.ranking { margin-top: 18px; }
.ranking__row { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid #e6efed; }
.ranking__unknown { margin-top: 14px; }
.survey-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 18px clamp(24px, 4vw, 40px); border-top: 1px solid var(--border); background: #fafbfb; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 22px; border: 1px solid transparent; border-radius: 3px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .16s, border-color .16s, box-shadow .16s; }
.button:focus-visible { outline: 3px solid rgba(8,145,178,.28); outline-offset: 2px; }
.button--primary { background: var(--primary); color: #fff; }
.button--primary:hover { background: var(--primary-hover); }
.button--secondary { border-color: var(--border); background: #fff; color: var(--foreground); }
.button:disabled { opacity: .52; cursor: wait; }
.submit-error { margin-bottom: 16px; padding: 14px 16px; border: 1px solid #fecaca; border-radius: 3px; background: var(--error-soft); color: var(--error); font-weight: 650; }
.success-mark { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; font-size: 34px; }
.success-card h1 { margin-bottom: 10px; }
.success-card p { color: var(--muted); }
.admin-shell { max-width: 1040px; }
.admin-header { margin-bottom: 28px; }
.admin-header p:last-child { color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.admin-card { padding: 28px; }
.admin-card h2 { margin: 0; font-size: 20px; }
.admin-count { margin: 22px 0 0; color: var(--primary); font-size: 38px; font-weight: 750; line-height: 1; }
.admin-meta { min-height: 26px; color: var(--muted); }

@media (max-width: 680px) {
  .shell { width: min(100% - 16px, 960px); margin-top: 14px; }
  .topbar__inner { width: calc(100% - 24px); min-height: 62px; }
  .identity-grid, .choice-grid, .admin-grid { grid-template-columns: 1fr; }
  .survey-card { border-radius: 3px; }
  .survey-header, .survey-content { padding-left: 18px; padding-right: 18px; }
  .choice { min-height: 50px; }
  .question__help { margin-left: 0; }
  .question__type { display: inline-block; margin-left: 6px; }
  .survey-actions { position: sticky; bottom: 0; z-index: 10; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); box-shadow: none; }
  .button { flex: 1; }
  .ranking__row { grid-template-columns: 1fr; gap: 8px; }
  .ranking__row .select-input { width: 100%; }
}

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