:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #1b2a3a;
  --ink-soft: #526377;
  --line: #dbe2ea;
  --brand: #1d4e79;
  --brand-deep: #163b5b;
  --brand-tint: #eaf1f8;
  --accent: #2f6f9e;
  --danger: #b3261e;
  --danger-tint: #fdeceb;
  --success: #1c6b48;
  --success-tint: #e9f5ee;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 42, 66, .05), 0 8px 24px rgba(18, 42, 66, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

.wrap { max-width: 820px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: var(--brand-deep);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  padding: 2px;
  flex: 0 0 auto;
}

.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
.brand-sub { font-size: 12px; color: #bcd3e6; line-height: 1.3; }

.admin-link {
  color: #cfe0ee;
  text-decoration: none;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  white-space: nowrap;
}
.admin-link:hover, .admin-link:focus-visible { color: #fff; background: rgba(255,255,255,.08); }

.main { padding-top: 32px; padding-bottom: 56px; }

.intro { margin-bottom: 24px; }

.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
  background: var(--brand-tint);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.intro h1 {
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  color: var(--brand-deep);
}

.notice {
  margin: 0;
  color: var(--ink-soft);
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.notice-alert {
  margin: 10px 0 0;
  color: #c0271b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.draft-banner {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid #e7c97a;
  background: #fff8e6;
  color: #6b4b00;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.draft-banner strong { white-space: nowrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
}

.card-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 20px; }
.card-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--brand-deep); }
.card-desc { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 7px;
  color: var(--ink);
}

.req { color: var(--danger); margin-left: 3px; font-weight: 700; }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c6d0dc;
  border-radius: 9px;
  padding: 10px 12px;
  min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}

.field textarea { resize: vertical; line-height: 1.6; }

.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: var(--danger); background: #fffafa; }

.field input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #f8fafc;
  border: 1px dashed #b9cbd9;
  border-radius: 9px;
  padding: 10px 12px;
  min-height: 46px;
}
.field input[type="file"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.file-name { font-size: 12px; color: var(--ink-soft); margin: 7px 0 0; word-break: break-all; }

.hint { font-size: 12px; color: var(--ink-soft); margin: 6px 0 0; }
.error-text { font-size: 12px; color: var(--danger); margin: 6px 0 0; font-weight: 600; }

.choice-group { display: flex; flex-wrap: wrap; gap: 10px; }

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c6d0dc;
  border-radius: 9px;
  padding: 9px 14px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  min-height: 44px;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(.98); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--brand-tint); font-weight: 600; }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice input { accent-color: var(--accent); margin: 0; width: 16px; height: 16px; }

.choice-group.invalid .choice { border-color: var(--danger); }

.consent-card { padding: 22px 24px; }
.consent-line { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.consent-line input { margin-top: 5px; width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.consent-line span { font-size: 14px; }

.form-error {
  background: var(--danger-tint);
  border: 1px solid #f0bdb9;
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}

.submit-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }

.btn-primary {
  appearance: none;
  border: 0;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 30px;
  min-height: 48px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(29, 78, 121, .2);
  transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-primary.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.submit-status { font-size: 13px; color: var(--ink-soft); }
.submit-status.is-error { color: var(--danger); font-weight: 600; }

.privacy-note { font-size: 12px; color: var(--ink-soft); margin: 14px 0 0; }

.success-card {
  background: var(--surface);
  border: 1px solid #bcdcc9;
  border-top: 4px solid var(--success);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  text-align: center;
}
.success-icon {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--success-tint); color: var(--success);
  display: grid; place-items: center; font-size: 28px; font-weight: 700;
  margin: 0 auto 16px;
}
.success-card h2 { margin: 0 0 10px; color: var(--brand-deep); font-size: 22px; }
.success-card p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }
.ref-box {
  display: inline-flex; align-items: center; gap: 12px;
  background: #f5f8fa; border: 1px dashed #b9cbd9;
  border-radius: 10px; padding: 12px 20px; margin-bottom: 12px;
}
.ref-label { font-size: 12px; color: var(--ink-soft); }
.ref-value { font-size: 18px; font-weight: 700; letter-spacing: .04em; color: var(--brand-deep); }
.success-time { font-size: 12px !important; margin-bottom: 22px !important; }

.btn-secondary {
  font: inherit; font-size: 14px; font-weight: 600;
  background: #fff; color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 9px; padding: 9px 20px; min-height: 42px; cursor: pointer;
}
.btn-secondary:hover { background: var(--brand-tint); }
.btn-secondary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.site-footer {
  border-top: 1px solid var(--line);
  color: #7b8b9c;
  font-size: 12px;
  padding: 20px 0 30px;
  text-align: center;
}

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .main { padding-top: 24px; }
  .card { padding: 18px 16px; border-radius: 12px; }
  .intro h1 { font-size: 24px; }
  .notice { padding: 12px 14px; font-size: 13px; }
  .btn-primary { width: 100%; justify-content: center; }
  .submit-bar { gap: 10px; }
  .submit-status { width: 100%; }
  .brand-name { font-size: 15px; }
  .admin-link { font-size: 12px; padding: 6px 9px; }
}

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