:root {
  color-scheme: light;
  --paper: #f7f1e6;
  --surface: #fffdf7;
  --ink: #2c211a;
  --muted: #6b594b;
  --red: #8b3025;
  --dark: #431911;
  --line: #e5d6c2;
  --gold: #f5d592;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
a { color: var(--red); text-underline-offset: .22em; }
button, input, textarea { font: inherit; }
:focus-visible { outline: 3px solid #ad5c2d; outline-offset: 4px; }
.container { width: min(1152px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; inset: 10px auto auto 10px; z-index: 2; padding: 10px; background: white; transform: translateY(-150%); }
.skip:focus { transform: translateY(0); }
.site-header { background: var(--surface); border-top: 4px solid var(--red); }
.header-inner { min-height: 82px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; font-family: var(--serif); font-size: 19px; font-weight: 800; letter-spacing: .045em; }
.brand small { display: block; color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: .16em; }
.seal { color: var(--red); font-size: 13px; line-height: 1.12; letter-spacing: .02em; text-align: center; padding: 5px; border: 3px double var(--red); border-radius: 2px; }
nav { display: flex; gap: 6px; }
nav a { padding: 8px 16px; border-radius: 4px; text-decoration: none; color: var(--muted); font-weight: 700; white-space: nowrap; }
nav a:hover, nav a[aria-current] { background: #f3e7d9; color: var(--red); }
.hero {
  color: #fff9ec;
  background: linear-gradient(90deg, #301009 0%, #351208 25%, #4c190dd4 45%, #4d1d1150 75%, #2c100d38), url("temple.webp") center 47% / cover, var(--dark);
  border-bottom: 4px solid #bc8c44;
}
.hero-inner { min-height: 372px; display: flex; align-items: center; padding-block: 44px; }
.hero-copy { border-left: 1px solid #d4a457; padding-left: 29px; }
.year { color: var(--gold); font-size: 14px; font-weight: 700; letter-spacing: .24em; }
h1 { font: 800 clamp(2.55rem, 5.5vw, 4.5rem)/1.17 var(--serif); letter-spacing: .065em; margin: 13px 0 18px; }
.blessing { color: #fff0db; font-size: 16px; letter-spacing: .055em; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 304px; align-items: start; gap: 28px; padding-block: 40px 68px; }
.registration, .side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.registration { box-shadow: 0 10px 25px #482d1710; }
.form-header { padding: 24px 32px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.form-header h2 { font: 800 31px/1.3 var(--serif); letter-spacing: .08em; }
.form-header p, .muted { color: var(--muted); font-size: 14px; }
.required { color: var(--red); }
.form-section, .submit { border-top: 1px solid var(--line); padding: 25px 32px 29px; }
h3, .side-card h2 { font: 800 21px/1.4 var(--serif); letter-spacing: .06em; color: var(--red); }
h3 { margin-bottom: 15px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, legend { font-size: 15px; font-weight: 700; }
.field small, .lamp small { color: var(--muted); font-size: 13px; }
.field input:not([type="radio"]), textarea {
  min-height: 47px; width: 100%; padding: 9px 12px;
  border: 1px solid #cdbca9; border-radius: 5px; background: #fffefa; color: var(--ink);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #786c60; opacity: 1; font-size: 14px; }
.gender { margin: 0; border: 0; padding: 0; }
legend { margin-bottom: 5px; padding: 0; }
.radios { display: flex; gap: 8px; }
.radio { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 47px; padding: 5px 10px; background: #fffefa; border: 1px solid #cdbca9; border-radius: 5px; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--red); width: 18px; height: 18px; margin: 0; flex: none; }
.radio:has(:checked), .lamp:has(:checked) { border-color: #a34738; background: #f9eee5; }
.lamps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.lamp { min-width: 0; align-self: start; border: 1px solid #d9c9b5; border-radius: 5px; }
.lamp-choice, .lamp.sold { display: flex; align-items: center; gap: 10px; padding: 11px; min-height: 66px; }
.lamp-choice { cursor: pointer; }
.lamp-quantity:not([hidden]) { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin: 0 11px 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.lamp-quantity input { min-height: 42px; width: 6.5rem; padding: 5px 9px; border: 1px solid #cdbca9; border-radius: 5px; background: #fffefa; color: var(--ink); font-size: 16px; }
.person-header, .person-total, .people-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.person-header { margin-bottom: 15px; }
.person-header h3 { margin: 0; }
.person-total { margin-top: 12px; color: var(--dark); font-weight: 700; }
.person-total span:last-child, .total output { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.person-total span:first-child, .total span { flex: none; }
.people-actions { flex-wrap: wrap; justify-content: flex-start; padding: 0 clamp(16px, 3vw, 32px) 24px; }
.people-actions p:empty { display: none; }
[data-person] + [data-person] { border-top: 2px solid #b78a55; }
.lamp:hover { border-color: #a34738; }
.lamp strong, .lamp small { display: block; }
.price, .sold-label { margin-left: auto; text-align: right; color: var(--red); white-space: nowrap; font-weight: 750; font-size: 13px; }
.sold { background: #f3efe7; cursor: default; }
.sold:hover { border-color: #d9c9b5; }
.sold-label { color: var(--muted); }
.total { display: flex; justify-content: space-between; align-items: center; background: #f3e7d9; border-radius: 5px; padding: 9px 13px; gap: 10px; color: var(--dark); font-weight: 700; }
.total + .muted { margin: 4px 0 16px; }
.total output { color: var(--red); font-size: 21px; }
.bank { display: grid; gap: 2px; margin-bottom: 19px; padding: 13px 16px; background: #f6eddf; border-left: 3px solid #b17e3b; border-radius: 3px; }
.account { font-size: 22px; letter-spacing: .055em; font-weight: 700; }
.bank small { color: var(--muted); }
.payment-note { margin-top: 15px; }
.submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
.submit p { color: var(--muted); font-size: 13px; }
button { background: var(--red); color: white; border: 1px solid var(--red); border-radius: 5px; padding: 10px 17px; font-weight: 700; cursor: pointer; }
button:hover { background: var(--dark); }
button span { margin-left: 8px; }
.sidebar { display: grid; gap: 15px; }
.side-card { padding: 21px; }
.side-card h2 { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.side-card p { color: var(--muted); font-size: 14px; }
.steps { list-style: none; padding: 0; margin: 15px 0 12px; counter-reset: step; }
.steps li { display: flex; align-items: baseline; gap: 9px; margin-bottom: 11px; font-size: 14px; }
.steps li::before { counter-increment: step; content: counter(step); flex: 0 0 23px; border-radius: 50%; line-height: 23px; text-align: center; background: #f3e7d9; color: var(--red); font-weight: 700; }
.contact p { margin-top: 12px; }
.contact > a { display: block; width: fit-content; margin-top: 3px; }
.contact .line { margin-top: 12px; font-weight: 700; }
.fraud { color: var(--muted); font-size: 13px; padding-inline: 6px; }
.fraud summary { cursor: pointer; font-weight: 700; }
.fraud p { margin-top: 8px; }
footer { background: var(--dark); color: #fff3dc; border-top: 3px solid #b88a49; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 21px; }
footer a { color: #ffe2a7; }
footer small { display: block; color: #f3dcc3; margin-top: 4px; }
noscript { width: 100%; }
@media (max-width: 1030px) {
  .layout { grid-template-columns: minmax(0, 1fr) 245px; gap: 18px; }
  .form-section, .form-header, .submit { padding-inline: 22px; }
  .lamps { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .container { width: calc(100% - 32px); }
  .layout { grid-template-columns: minmax(0, 1fr); padding-block: 20px 40px; }
  .hero-inner { min-height: 270px; }
  .hero { background-position: center, 62% 48%; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lamps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 9px; padding-block: 11px; }
  nav { align-self: stretch; }
  nav a { flex: 1; text-align: center; padding: 6px 8px; }
  .hero { background-image: linear-gradient(90deg, #301009ed, #41180c9e 65%, #421b1150), url("temple.webp"); }
  .hero-copy { padding-left: 15px; }
  .form-section, .form-header, .submit { padding-inline: 16px; }
  .form-header h2 { font-size: 25px; }
  .fields, .lamps, .sidebar { grid-template-columns: 1fr; }
  .footer-inner { display: block; }
  .footer-inner p { margin-bottom: 8px; }
  .submit button { width: 100%; }
}

button:disabled { opacity: .65; cursor: wait; }
.submit .form-status:not(:empty) { flex-basis: 100%; padding: 10px 13px; border-radius: 5px; overflow-wrap: anywhere; }
.form-status.success { color: #284f36; background: #e9f2e8; }
.form-status.failure { color: #7a241d; background: #f6e7df; }
.admin { max-width: 900px; padding-block: 40px 64px; }
.admin h1 { font-size: clamp(1.55rem, 4vw, 2rem); margin: 0; }
.admin .records-status { margin-block: 12px; }
.admin button { margin-top: 15px; }
.admin-record { border-top: 1px solid var(--line); padding: 12px 2px; }
.admin-record summary, .admin-record h3 { overflow-wrap: anywhere; }
.admin-record summary { cursor: pointer; font-weight: 700; }
.admin-record dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; margin-bottom: 0; font-size: 14px; }
.admin-record dt { color: var(--muted); }
.admin-record dd { margin: 0; overflow-wrap: anywhere; }
.verification { flex-basis: 100%; min-width: 0; }
.verification:empty { display: none; }

.hero-action {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 7px 14px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: #301009bb;
  color: #fff3dc;
  font-weight: 700;
  text-decoration: none;
}
.hero-action:hover { background: var(--red); }
.form-intro { color: var(--muted); font-size: 14px; padding: 0 32px 17px; }
.birthday { margin: 0; min-width: 0; border: 0; padding: 0; }
.birthday-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); gap: 8px; }
.birthday-fields label, .birth-hour { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
.birthday-fields select { min-width: 0; min-height: 47px; padding: 8px; font: inherit; font-size: 16px; border: 1px solid #cdbca9; border-radius: 5px; background: #fffefa; color: var(--ink); }
.birthday-fields input[data-birth] { padding-inline: 8px; font-size: 16px; }
.field-hint { color: var(--muted); font-size: 13px; }
.receipt { width: 100%; border: 1px solid var(--line); background: #fcf7ed; padding: 14px; border-radius: 5px; }
.receipt h3 { margin: 0 0 5px; font-size: 17px; }
.receipt code { display: block; overflow-wrap: anywhere; font-size: 15px; }
.receipt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; margin-block: 10px; }
.receipt-actions a { font-size: 14px; font-weight: 700; }
.secondary-button { background: var(--surface); color: var(--red); padding: 5px 10px; font-size: 14px; }
.secondary-button:hover { background: #f3e7d9; }
.receipt .copy-status:not(:empty) { margin-top: 8px; }
.verification-status:not(:empty) { flex-basis: 100%; }
.submit .verification-status:empty { display: none; }
@media (max-width: 1030px) {
  .form-intro { padding-inline: 22px; }
}
@media (max-width: 540px) {
  .form-intro { padding-inline: 16px; }
  .birthday-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .birth-hour { grid-column: 1 / -1; }
  .receipt-actions button { width: auto; }
}
