:root {
  --ink: #20342c;
  --muted: #66736d;
  --paper: #fffdf7;
  --canvas: #f3f1e7;
  --green: #176b55;
  --green-dark: #104e3e;
  --mint: #dcebe3;
  --coral: #d6674f;
  --line: #d7d9cf;
  --warning: #8a4d11;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.hero {
  color: #fff;
  background: linear-gradient(130deg, rgba(16,78,62,.96), rgba(23,107,85,.88)),
    radial-gradient(circle at 80% 20%, #caa764, transparent 40%);
  padding: 48px 0 42px;
  border-bottom: 6px solid #d4ae64;
}
.hero h1 { margin: 2px 0 4px; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: .08em; }
.hero p { margin: 0; max-width: 680px; }
.back-to-courses { display: inline-flex; margin-bottom: 16px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; color: #fff; font-weight: 800; text-decoration: none; }
.back-to-courses:hover { background: rgba(255,255,255,.14); }
.eyebrow { margin: 0; font-weight: 800; font-size: .82rem; letter-spacing: .13em; text-transform: uppercase; }
.layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .85fr); gap: 22px; padding-block: 24px 48px; align-items: start; }
.main-column { display: grid; gap: 22px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 28px); box-shadow: 0 12px 35px rgba(32,52,44,.07); }
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.section-heading > span { display: grid; place-items: center; min-width: 40px; height: 40px; border-radius: 12px; background: var(--green); color: #fff; font-weight: 900; }
h2, h3, p { margin-top: 0; }
.section-heading h2, .section-heading p { margin-bottom: 2px; }
.section-heading p, small, .selected-card span { color: var(--muted); }
.search-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.search-card { border: 1px solid var(--line); border-radius: 15px; padding: 18px; background: #fff; }
.search-card h3 { margin-bottom: 12px; font-size: 1rem; }
label, legend { font-weight: 700; }
input[type="search"], select { width: 100%; min-height: 46px; border: 1px solid #adb7b0; border-radius: 10px; padding: 9px 11px; color: var(--ink); background: #fff; }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(23,107,85,.22); outline-offset: 2px; border-color: var(--green); }
.inline { display: flex; gap: 8px; }
.inline input { min-width: 0; }
.select-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: 8px; margin-bottom: 10px; }
.button { min-height: 44px; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 800; }
.primary { background: var(--green); color: #fff; }
.primary:hover { background: var(--green-dark); }
.secondary { background: var(--mint); color: var(--green-dark); width: 100%; }
.ghost { border: 1px solid var(--line); background: #fff; color: var(--green-dark); min-height: 38px; padding: 6px 10px; }
.danger { color: #8d3022; background: #f9e7e3; min-height: 38px; }
.status { min-height: 1.6em; margin: 12px 0 0; color: var(--green); font-weight: 700; }
.status.error, .pending, .warning { color: #a04430; }
.empty { color: var(--muted); padding: 18px; border: 1px dashed #b9c0ba; border-radius: 12px; text-align: center; }
.selected-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.selected-card { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.selected-card strong, .selected-card span, .selected-card em { display: block; }
.selected-card em { font-size: .82rem; font-weight: 800; font-style: normal; }
.schedule-conflict { color: #b33a25; font-size: .84rem; font-style: normal; font-weight: 900; margin: 3px 0 5px; }
.child-field { font-size: .78rem; color: var(--muted); }
.child-field select { min-height: 38px; padding: 4px 8px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; }
.choice { display: block; padding: 5px 0; font-weight: 500; }
.child-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.child-status-grid label { font-size: .84rem; }
.child-status-grid select { margin-top: 4px; min-height: 40px; }
.wide-label { display: block; margin-top: 16px; }
.wide-label select { margin-top: 5px; }
.discount-options { margin-top: 16px; }
.field-help { margin: 0 0 10px; color: var(--muted); font-size: .88rem; }
#main-discounts { display: grid; gap: 8px; }
.discount-choice { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 11px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 500; }
.discount-choice span strong, .discount-choice span small { display: block; }
.family-note { padding: 14px; border: 1px solid #b8d7c7; border-radius: 12px; background: #eef7f2; color: var(--green-dark); font-size: .9rem; }
.special-options { display: grid; gap: 10px; margin-top: 14px; }
.option-card { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.option-card > small { grid-column: 1 / -1; }
.option-card span strong, .option-card span small { display: block; }
.nested { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; font-size: .88rem; }
.result-panel { position: sticky; top: 16px; }
.result-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.result-title h2 { margin-bottom: 0; }
.actions { display: flex; gap: 7px; }
.result-card { padding: 18px 0; border-bottom: 1px solid var(--line); }
.result-card h3 { font-size: 1rem; margin-bottom: 10px; }
dl { margin: 0; }
dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 3px 0; }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.discount { color: var(--coral); font-weight: 800; }
.subtotal { border-top: 1px dashed var(--line); margin-top: 7px; padding-top: 9px; font-weight: 900; }
.applied { margin: 10px 0 0; color: var(--green); font-size: .85rem; font-weight: 700; }
.warning { margin: 6px 0 0; font-size: .85rem; font-weight: 700; }
.promotion-summary { margin: 14px 0 0; padding: 11px 13px; border-radius: 10px; background: var(--mint); color: var(--green-dark); font-weight: 800; }
.warnings { background: #fff0d8; color: var(--warning); border-radius: 10px; padding: 12px 12px 12px 32px; font-size: .88rem; }
.grand-total { display: flex; align-items: baseline; justify-content: space-between; padding: 20px 0; }
.grand-total span { font-weight: 900; }
.grand-total strong { color: var(--green); font-size: 2rem; }
.notices { padding-top: 16px; border-top: 3px solid var(--mint); }
.notices h3 { font-size: 1rem; }
.notices ul { padding-left: 20px; margin-bottom: 0; color: var(--muted); font-size: .87rem; }
footer { padding: 20px; text-align: center; color: var(--muted); font-size: .82rem; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .result-panel { position: static; }
}
@media (max-width: 650px) {
  .shell { width: min(100% - 20px, 1180px); }
  .hero { padding: 34px 0 30px; }
  .panel { border-radius: 14px; padding: 16px; }
  .search-grid, .field-grid { grid-template-columns: 1fr; }
  .select-grid { grid-template-columns: 1fr; }
  .inline { flex-direction: column; }
  .selected-card { grid-template-columns: 1fr auto; }
  .selected-card > div { grid-column: 1 / -1; }
  .result-title { flex-direction: column; }
}
@media print {
  :root { background: #fff; }
  .hero, .main-column, footer, .actions { display: none !important; }
  .layout { display: block; padding: 0; }
  .shell { width: 100%; }
  .result-panel { position: static; box-shadow: none; border: 0; padding: 0; }
  .result-title { border-bottom: 2px solid #000; }
  .notices { page-break-inside: avoid; }
}
