:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --page: #f5f7fb;
  --primary: #1769e0;
  --primary-dark: #1554b8;
  --danger: #b42318;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-shell { width: min(980px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 72px; }
.page-header { margin: 24px 0; }
.compact-header { max-width: 720px; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(26px, 5vw, 38px); line-height: 1.25; letter-spacing: -.02em; }
h2 { line-height: 1.35; }
.page-header p, .muted { color: var(--muted); }
.back-link { display: inline-block; color: var(--muted); font-size: 14px; }
.questionnaire-grid { display: grid; gap: 16px; }
.questionnaire-card, .start-panel, .notice, .admin-panel, .success-panel, .question-card, .form-section { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(16, 24, 40, .04); }
.questionnaire-card { display: flex; gap: 20px; padding: 24px; align-items: flex-start; }
.card-mark, .section-number { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.card-mark { font-size: 26px; line-height: 1; }
.questionnaire-card h2 { margin: 0 0 8px; font-size: 21px; }
.questionnaire-card p { color: var(--muted); margin-bottom: 20px; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; min-height: 42px; padding: 0 17px; font: inherit; font-weight: 650; cursor: pointer; transition: background .15s, transform .15s; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { color: var(--ink); background: #eef2f6; }
.button.secondary:hover { background: #e1e7ef; }
.button.danger, .button.danger-quiet { color: #fff; background: var(--danger); }
.button.danger-quiet { background: transparent; color: var(--danger); }
.start-panel { max-width: 680px; padding: 28px; }
.start-form { display: grid; gap: 9px; max-width: 440px; }
label { font-weight: 600; }
input, textarea, select { width: 100%; border: 1px solid #d0d5dd; border-radius: 9px; color: var(--ink); background: #fff; font: inherit; font-size: 16px; outline: none; }
input, select { min-height: 44px; padding: 8px 12px; }
textarea { padding: 11px 12px; resize: vertical; min-height: 108px; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23, 105, 224, .13); }
.start-form small { color: var(--muted); margin-bottom: 8px; }
.notice { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px 18px; margin: 18px 0; }
.notice strong { margin-right: auto; }
.notice-info { border-color: #b2ddff; background: #eff8ff; }
.notice-warning { color: #9a3412; border-color: #fedf89; background: #fffaeb; }
.form-error, .field-error { color: var(--danger); font-size: 13px; }
.form-error { margin: 10px 0; }
.required-mark { color: #d92d20; margin-left: 3px; }
.form-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.save-state { color: var(--muted); font-size: 13px; }
.save-state.is-saving { color: var(--primary); }
.save-state.is-failed, .field-error { color: var(--danger); }
.form-header { margin-bottom: 28px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 8px; background: #e7edf5; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .25s ease; }
.form-section { padding: 22px 22px 4px; margin: 18px 0; }
.section-heading { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.section-number { font-size: 13px; }
.question-card { box-shadow: none; border-width: 0 0 1px; border-radius: 0; padding: 21px 0 20px; }
.question-card.has-error { border-bottom-color: #fda29b; }
.question-card:last-child { border-bottom: 0; }
.question-label { font-size: 16px; font-weight: 650; line-height: 1.5; }
.question-index { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.question-description { color: var(--muted); font-size: 13px; margin: 5px 0 10px; }
.answer-control { margin-top: 10px; }
.choice-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; margin-top: 12px; }
.choice { display: flex; gap: 9px; align-items: flex-start; border: 1px solid #dfe3e8; border-radius: 9px; padding: 10px 12px; color: var(--ink); font-weight: 400; cursor: pointer; }
.choice:has(input:checked) { border-color: #84adf4; background: #f2f7ff; }
.choice input { width: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--primary); }
.upload-zone { display: flex; align-items: center; gap: 12px; border: 1px dashed #b8c3d0; border-radius: 11px; padding: 14px; margin-top: 10px; background: #fafcff; }
.image-input { width: auto; min-height: auto; padding: 0; border: 0; font-size: 14px; }
.upload-copy { display: grid; color: var(--muted); font-size: 12px; }
.attachment-list, .admin-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 13px; }
.attachment { width: 142px; margin: 0; }
.attachment img, .admin-images img { display: block; width: 100%; height: 112px; object-fit: cover; border-radius: 8px; background: #eef2f6; }
.attachment figcaption { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; margin-top: 4px; }
.link-button { border: 0; padding: 0; color: var(--primary); background: none; font: inherit; cursor: pointer; }
.form-actions { position: sticky; bottom: 12px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 13px; margin-top: 20px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .94); box-shadow: 0 12px 32px rgba(16, 24, 40, .12); backdrop-filter: blur(8px); }
.form-actions .danger-quiet { margin-right: auto; }
dialog { border: 0; border-radius: 15px; padding: 25px; max-width: min(440px, calc(100% - 32px)); color: var(--ink); box-shadow: 0 20px 70px rgba(16, 24, 40, .25); }
dialog::backdrop { background: rgba(16, 24, 40, .45); }
.confirm-dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.success-panel { max-width: 620px; margin: 10vh auto 0; padding: 44px 28px; text-align: center; }
.success-icon { display: grid; width: 54px; height: 54px; place-items: center; margin: 0 auto 15px; border-radius: 50%; color: #fff; background: #12b76a; font-size: 30px; }
.submitted-number { display: grid; gap: 4px; margin: 24px auto; padding: 16px; border-radius: 11px; background: #f2f4f7; }
.submitted-number span { color: var(--muted); font-size: 13px; }
.submitted-number strong { font-size: 20px; letter-spacing: .05em; }
.admin-nav { display: flex; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.admin-nav a { font-weight: 650; }
.admin-panel { padding: 20px; margin: 18px 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 650; }
.status-muted { color: var(--muted); }
.empty-state { padding: 38px 12px; color: var(--muted); text-align: center; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.admin-section { padding: 20px 0; border-top: 1px solid var(--line); }
.admin-section h2 { margin-bottom: 14px; }
.admin-answer { padding: 12px 0; border-bottom: 1px solid #eef0f3; }
.admin-answer h3 { margin-bottom: 4px; font-size: 15px; }
.admin-answer p { white-space: pre-wrap; margin: 0; color: #344054; }
.admin-images img { width: 180px; height: 140px; object-fit: contain; border: 1px solid var(--line); }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-form label { min-width: 180px; flex: 1; }
.inline-form input, .inline-form select { display: block; margin-top: 4px; }

@media (max-width: 640px) {
  .site-shell { width: min(100% - 22px, 980px); padding-top: 20px; }
  .questionnaire-card, .start-panel, .form-section, .admin-panel { padding: 17px; }
  .questionnaire-card { gap: 12px; }
  .upload-zone { align-items: flex-start; flex-direction: column; }
  .image-input { width: 100%; }
  .form-actions { bottom: 6px; }
  .form-actions .danger-quiet { margin-right: 0; }
  .form-actions .button { flex: 1; min-width: 125px; }
  .choice-list { grid-template-columns: 1fr; }
}
