:root {
  --cream: #F6F1E8;
  --beige: #EBE2D3;
  --line: #D8CCB9;
  --tan: #A58A6E;
  --coffee: #4A3527;
  --coffee-soft: #6F5A49;
  --white: #FFFCF7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--coffee); font-family: var(--font-body); font-size: 16px; line-height: 1.75; }
h1, h2, h3, .price, .brand { font-family: var(--font-heading); font-weight: 600; }
a { color: inherit; }
img { display: block; }
button, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--coffee); outline-offset: 2px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; background: var(--coffee); color: var(--cream); }
.topbar :focus-visible { outline-color: var(--cream); }
.brand { text-decoration: none; font-size: 20px; white-space: nowrap; }
.topbar nav { display: flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 500; }
.topbar nav a { padding: 6px 12px; border-radius: 2px; text-decoration: none; white-space: nowrap; color: var(--cream); }
.topbar nav a:hover { background: rgba(246, 241, 232, 0.16); }
.topbar nav a.nav-cta { background: var(--cream); color: var(--coffee); }
.topbar nav a.nav-cta:hover { background: var(--beige); }

.hero { text-align: center; padding: 40px 16px 44px; }
.hero-logo { width: 240px; height: auto; margin: 0 auto 28px; }
.hero h1 { margin: 0; font-size: clamp(34px, 7vw, 52px); line-height: 1.2; }
.hero-sub { margin: 12px 0 0; font-size: 18px; }
.hero-place { margin: 2px 0 28px; color: var(--coffee-soft); font-size: 15px; }

.btn { display: inline-block; padding: 12px 28px; background: var(--coffee); color: var(--cream); text-decoration: none; text-align: center; border: 1px solid var(--coffee); border-radius: 2px; cursor: pointer; }
.btn:hover { background: #38271C; }
.btn.ghost { background: transparent; color: var(--coffee); }
.btn.ghost:hover { background: var(--beige); }
.btn.wide { display: block; width: 100%; }
.btn[aria-disabled="true"] { background: var(--line); border-color: var(--line); color: var(--coffee-soft); cursor: not-allowed; pointer-events: none; }

.section { max-width: 1040px; margin: 0 auto; padding: 64px 24px; }
.band { max-width: none; background: var(--beige); padding-left: max(24px, calc((100% - 992px) / 2)); padding-right: max(24px, calc((100% - 992px) / 2)); }
h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.35; }
.lead { margin: 0 0 32px; color: var(--coffee-soft); max-width: 44em; }

.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.plan { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); padding: 24px; }
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.plan h3 { margin: 0; font-size: 20px; line-height: 1.4; }
.plan-tag { flex: none; font-size: 13px; color: var(--tan); }
.plan-fit { margin: 8px 0 16px; color: var(--coffee-soft); font-size: 15px; }
.price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.price { font-size: 26px; }
.original { color: var(--tan); text-decoration: line-through; font-size: 14px; }
.total-note { margin: 0; font-size: 14px; color: var(--coffee-soft); }
.pay { margin: 14px 0; padding: 12px 0; border-block: 1px solid var(--line); font-size: 14px; }
.pay div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }
.pay dt, .pay dd { margin: 0; }
.pay dt { color: var(--coffee-soft); }
.plan ul { margin: 0 0 20px; padding-left: 1.1em; font-size: 15px; flex: 1; }
.plan li { margin-bottom: 4px; }
.plan .btn { align-self: stretch; }

.teachers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.teacher { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; }
.avatar { width: 100%; min-width: 0; max-width: 100%; min-height: 0; overflow: hidden; aspect-ratio: 4 / 5; object-fit: cover; background: var(--cream); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--font-heading); font-size: 32px; margin-bottom: 10px; }
.teacher h3 { margin: 0; font-size: 20px; }
.season { font-size: 14px; color: var(--coffee-soft); }
.teacher p { margin: 6px 0 0; font-size: 15px; }
.teacher .todo { color: var(--tan); }

.banner { margin-bottom: 20px; padding: 10px 14px; background: var(--beige); border-left: 3px solid var(--tan); font-size: 14px; }
.month-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.month-tabs button { padding: 8px 20px; background: transparent; border: 1px solid var(--line); border-radius: 2px; cursor: pointer; }
.month-tabs button[aria-selected="true"] { background: var(--coffee); border-color: var(--coffee); color: var(--cream); }
.month-note { margin-bottom: 16px; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); font-size: 15px; }

.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { text-align: center; font-size: 13px; color: var(--coffee-soft); padding: 4px 0; }
.day { min-height: 64px; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; background: transparent; border: 1px solid transparent; border-radius: 2px; font-size: 15px; font-variant-numeric: tabular-nums; }
.day small { font-size: 11px; line-height: 1.3; white-space: nowrap; }
.day.open { background: var(--white); border-color: var(--line); cursor: pointer; }
.day.open:hover { border-color: var(--coffee); }
.day.open small { color: var(--coffee); }
.day.full { background: var(--beige); cursor: pointer; color: var(--coffee-soft); }
.day.locked { background: transparent; border-color: var(--line); border-style: dashed; color: var(--coffee-soft); cursor: pointer; }
.day.closed, .day.past, .day.late { color: #B9AB98; cursor: default; }
.day.late small { white-space: pre-line; line-height: 1.25; text-align: center; }
.day.selected { background: var(--coffee); border-color: var(--coffee); color: var(--cream); }
.day.selected small { color: var(--cream); }
.day-empty { min-height: 64px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 16px 0 8px; padding: 0; font-size: 13px; color: var(--coffee-soft); }
.legend li { display: flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 2px; display: inline-block; }
.dot.open { background: var(--white); }
.dot.full { background: var(--beige); }
.dot.locked { border-style: dashed; border-color: var(--tan); }
.dot.closed { border-color: transparent; background: #DDD3C4; }
.fineprint { margin: 8px 0 0; font-size: 13px; color: var(--coffee-soft); }

.picker { margin-top: 24px; padding: 24px; background: var(--white); border: 1px solid var(--line); max-width: 480px; }
.picker h3 { margin: 0 0 12px; font-size: 20px; }
.slot-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.slot { padding: 10px 4px; background: transparent; border: 1px solid var(--line); border-radius: 2px; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot small { display: block; font-size: 12px; color: var(--coffee-soft); }
.slot[aria-pressed="true"] { background: var(--coffee); border-color: var(--coffee); color: var(--cream); }
.slot[aria-pressed="true"] small { color: var(--cream); }
.slot:disabled { cursor: not-allowed; color: #B9AB98; background: var(--cream); }
.slot:disabled small { color: #B9AB98; }
.field { display: block; margin: 0 0 6px; font-size: 14px; color: var(--coffee-soft); }
select { width: 100%; padding: 10px; margin-bottom: 16px; background: var(--white); border: 1px solid var(--line); border-radius: 2px; }
.pay-box { margin: 0 0 16px; padding: 14px 16px; background: var(--cream); border: 1px solid var(--line); font-size: 14px; }
.pay-box h4 { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.pay-step { display: grid; grid-template-columns: 22px 1fr; gap: 0 6px; margin-bottom: 10px; }
.pay-step i { font-style: normal; font-family: var(--font-heading); color: var(--coffee); }
.pay-step b { display: block; font-weight: 500; }
.pay-step span { display: block; color: var(--coffee-soft); }
.pay-step strong { font-weight: 600; color: var(--coffee); font-variant-numeric: tabular-nums; }
.pay-note { margin: 6px 0 0; font-size: 13px; color: var(--coffee-soft); }
.plan-hint { margin: -6px 0 14px; font-size: 14px; color: var(--coffee-soft); }

.steps { list-style: none; counter-reset: step; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; font-size: 14px; color: var(--coffee-soft); }
.steps li { counter-increment: step; border-top: 1px solid var(--coffee); padding-top: 10px; }
.steps li::before { content: counter(step); display: block; font-family: var(--font-heading); font-size: 18px; color: var(--coffee); }
.steps b { display: block; font-weight: 500; color: var(--coffee); margin-bottom: 2px; }

.bullets { margin: 16px 0 24px; padding-left: 1.1em; max-width: 46em; }
.bullets li { margin-bottom: 6px; }
details { border-top: 1px solid var(--line); max-width: 46em; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { padding: 12px 0; cursor: pointer; font-weight: 500; }
details ul { margin: 0 0 14px; padding-left: 1.1em; font-size: 15px; }
.pay-note { margin: 20px 0 0; max-width: 46em; }

#place { padding-top: 36px; padding-bottom: 36px; }
.address { margin: 12px 0 8px; }
.address-sub { margin: 0; color: var(--coffee-soft); font-size: 15px; }
.nowrap { white-space: nowrap; }
.links { display: flex; gap: 20px; margin-top: 16px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 12px; }
#booking, #contact { position: relative; }
#booking::before, #contact::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; border-top: 1px solid var(--line); }

.place-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; align-items: start; }
.photo-thumb { padding: 0; background: none; border: 0; cursor: zoom-in; text-align: left; font-size: 13px; color: var(--coffee-soft); }
.photo-thumb img { width: 100%; height: auto; margin-bottom: 6px; border: 1px solid var(--line); }
.photo-thumb:hover span { color: var(--coffee); text-decoration: underline; }
.taxi-note { margin: 20px 0 0; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); font-size: 15px; }
/* 照片點開：縮在視窗 80% 以內，不會變原檔大小 */
.photo-dialog { padding: 0; max-width: 80vw; max-height: 90vh; background: var(--white); border: 0; }
.photo-dialog::backdrop { background: rgba(38, 27, 19, 0.75); }
.photo-dialog img { display: block; width: auto; height: auto; max-width: 80vw; max-height: calc(80vh - 48px); }
.photo-dialog form { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 8px; background: var(--white); }
.photo-close { padding: 6px 16px; background: var(--coffee); color: var(--cream); border: 0; border-radius: 2px; cursor: pointer; }

.quiz { max-width: 560px; padding: 24px; background: var(--white); border: 1px solid var(--line); }
.quiz-step { margin: 0 0 4px; font-size: 13px; color: var(--coffee-soft); }
.quiz h3 { margin: 0 0 16px; font-size: 20px; line-height: 1.45; }
.quiz h3:focus { outline: none; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option { width: 100%; padding: 12px 14px; background: transparent; border: 1px solid var(--line); border-radius: 2px; text-align: left; cursor: pointer; }
.quiz-option:hover { border-color: var(--coffee); background: var(--cream); }
.quiz-desc { margin: 0 0 12px; }
.quiz-price { margin: 0 0 18px; font-family: var(--font-heading); font-size: 20px; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quiz-back { padding: 12px 8px; background: none; border: 0; text-decoration: underline; cursor: pointer; color: var(--coffee-soft); }

.footer { display: flex; align-items: center; gap: 16px; padding: 28px 24px; background: var(--coffee); color: var(--cream); font-size: 14px; }
.footer img { width: 56px; height: auto; }
.footer p { margin: 0; }

@media (max-width: 760px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 16px 10px; }
  .brand { font-size: 18px; }
  .topbar nav { justify-content: space-between; gap: 0; width: 100%; font-size: 15px; }
  .topbar nav a { padding: 5px 7px; }
  .topbar nav a:first-child { margin-left: -7px; }
  .topbar nav a:last-child { margin-right: -7px; }
  #booking::before, #contact::before { left: 16px; right: 16px; }
  .place-grid { grid-template-columns: minmax(0, 1fr) 104px; gap: 14px; }
  html { scroll-padding-top: 96px; }
  .hero { padding: 28px 16px 36px; }
  .hero-logo { width: 160px; }
  .section { padding: 48px 16px; }
  .band { padding-left: 16px; padding-right: 16px; }
  .plans, .teachers { grid-template-columns: 1fr; }
  .plan { padding: 20px; }
  .quiz { padding: 18px; }
  .quiz-actions .btn { width: 100%; }
  .teacher { grid-template-columns: 112px 1fr; column-gap: 16px; align-items: start; grid-template-rows: auto auto auto 1fr; }
  .avatar { grid-row: span 4; width: 112px; font-size: 26px; margin: 0; }
  .calendar { gap: 2px; }
  .day, .day-empty { min-height: 54px; padding: 5px 0; }
  .day small { font-size: 10px; }
  .picker { padding: 18px; max-width: none; }
  .steps { grid-template-columns: 1fr; gap: 14px; margin-top: 36px; }
}

@media (max-width: 374px) {
  .topbar nav { font-size: 13px; }
  .topbar nav a { padding: 5px 4px; }
  .topbar nav a:first-child { margin-left: -4px; }
  .topbar nav a:last-child { margin-right: -4px; }
}
