:root {
  --brand: #0046d1;
  --brand-dark: #0034a0;
  --ink: #1b2430;
  --muted: #4d5a6a;
  --line: #dbe5f2;
  --ice: #f3f8ff;
  --ice-line: #cfe2fb;
  --bg: #fff;
  --danger: #9b1c1c;
  --danger-bg: #fde8e8;
  --ok: #0f7b4b;
  --warn: #7c2d12;
  --warn-bg: #fff7ed;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0, 42, 128, 0.06);
  font-family: "PingFang HK", "PingFang TC", "Noto Sans TC", "Heiti TC", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 132px; }
.btn, .field input, .field textarea, .choice { scroll-margin-top: 148px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--ice);
  line-height: 1.55;
}
a { color: var(--brand); }
img { max-width: 100%; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--brand);
  color: #fff;
  padding: 8px 12px;
  z-index: 30;
}
.skip:focus { top: 8px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
}
.demo-banner {
  background: var(--warn);
  color: #fff;
  text-align: center;
  padding: 10px 16px;
  font-weight: 700;
}

.site-header, .site-footer {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-footer { border-bottom: 0; border-top: 1px solid var(--line); margin-top: 32px; }
.bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.brand { font-weight: 800; color: #002a80; text-decoration: none; font-size: 1.15rem; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.nav { display: flex; gap: 14px; align-items: center; }
.nav a { text-decoration: none; font-weight: 650; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 8px; color: #002a80; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 16px; }

.stepper {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  flex-wrap: wrap;
}
.stepper li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}
.stepper li[aria-current="step"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}
.stepper li.is-done { border-color: var(--ok); color: var(--ok); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.card, .summary, .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 18px; }
.summary { padding: 16px; position: sticky; top: 124px; }
.summary h2 { font-size: 1rem; }
.summary dl { margin: 0; }
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ice-line);
}
.summary dt, .money dt { margin: 0; color: var(--muted); flex: 0 0 auto; }
.summary dd, .money dd { margin: 0; text-align: right; white-space: nowrap; }
.summary .total, .money .total { font-weight: 800; font-size: 1.15rem; color: #002a80; border-bottom: 0; }
.money { margin: 12px 0; }
.money div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ice-line);
}
.tagline { color: var(--brand); font-weight: 700; margin: 8px 0 0; }

.grid { display: grid; gap: 12px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.choice {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}
.choice.is-selected { border-color: var(--brand); background: var(--ice); }
.choice h3 { margin: 0; font-size: 1.05rem; }
.price { font-size: 1.35rem; font-weight: 800; color: #002a80; margin: 0; }
.price small { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); }
.list { margin: 0; padding-left: 1.1rem; }
.list li { margin: 3px 0; }

.btn, button, .btn-link {
  font: inherit;
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 0;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.secondary:hover { background: var(--ice); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.notice {
  background: var(--warn-bg);
  border: 2px solid var(--warn);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.notice strong { color: var(--warn); }
.callout {
  background: var(--ice);
  border: 1px solid var(--ice-line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}
.error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
}
.error:empty { display: none; }
.ok-text { color: var(--ok); font-weight: 700; }

label { font-weight: 700; display: block; margin-bottom: 4px; }
.field { margin: 0 0 12px; }
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 88px; resize: vertical; }
.hint { font-weight: 500; color: var(--muted); font-size: 0.88rem; }
.req { color: var(--danger); font-weight: 700; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; margin: 8px 0; }
.check input { margin-top: 4px; }
.legal {
  background: #fafafa;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}
.legal p { margin: 0 0 8px; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--ice);
  color: var(--brand);
}
.badge.warn { background: var(--danger-bg); color: var(--danger); }
.badge.ok { background: #e7f6ee; color: var(--ok); }
.file-meta { min-height: 1.2em; font-size: 0.92rem; }
.hidden { display: none !important; }

.progress { display: flex; gap: 8px; list-style: none; padding: 0; margin: 12px 0; flex-wrap: wrap; }
.progress li {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.progress li.is-now { border-color: var(--brand); background: var(--ice); font-weight: 800; }

.table-wrap { overflow-x: auto; margin-top: 12px; background: #fff; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); }
tr.overdue { background: var(--danger-bg); }
.detail {
  margin-top: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.detail textarea,
.detail input[type="text"] { margin: 8px 0; }
.detail .btn { margin: 8px 8px 8px 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pay-methods { display: grid; gap: 10px; }
.pay-method {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.pay-method.is-selected { border-color: var(--brand); background: var(--ice); }

@media (max-width: 860px) {
  .layout, .grid-3, .grid-2, .split { grid-template-columns: 1fr; }
  .summary { position: static; }
  h1 { font-size: 1.4rem; }
}
