:root {
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: #18362d;
  background: #f5f7f2;
  font-synthesis: none;
  --ink: #18362d;
  --muted: #71857b;
  --green-950: #123c31;
  --green-800: #1d5b47;
  --green-700: #267357;
  --green-500: #54a978;
  --green-100: #dff0e3;
  --green-50: #eef7ef;
  --cream: #fbfaf5;
  --line: #e1e9e1;
  --coral: #ee816c;
  --gold: #e8b44d;
  --shadow: 0 18px 50px rgba(28, 65, 49, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 7% 2%, rgba(214, 237, 216, .75), transparent 28rem),
    radial-gradient(circle at 96% 25%, rgba(250, 222, 169, .26), transparent 27rem),
    #f6f8f4;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px max(4vw, 24px);
  border-bottom: 1px solid rgba(213, 225, 215, .86);
  background: rgba(255, 255, 252, .88);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--green-700), var(--green-950));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(25, 87, 64, .24);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .04em; }
.brand small { margin-top: 2px; color: #7d9287; font-size: 10px; letter-spacing: .09em; }
.header-account { display: flex; align-items: center; gap: 10px; }
.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--green-100);
  color: var(--green-800);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.account-name { display: block; font-size: 12px; font-weight: 800; }
.account-email { display: block; margin-top: 2px; color: #8a9b92; font-size: 10px; }
.link-button { border: 0; background: transparent; color: var(--green-700); font-size: 11px; font-weight: 800; }

main { min-height: calc(100vh - 138px); }
.loading-panel { min-height: 62vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.spinner { width: 21px; height: 21px; border: 3px solid #d7e5da; border-top-color: var(--green-700); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero {
  max-width: 1260px;
  min-height: 680px;
  margin: auto;
  padding: 64px 34px 88px;
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  align-items: center;
  gap: clamp(34px, 5vw, 76px);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #66be80; box-shadow: 0 0 0 5px rgba(102, 190, 128, .12); }
.hero h1 {
  max-width: 600px;
  margin: 22px 0 18px;
  color: var(--ink);
  font-size: clamp(39px, 5vw, 66px);
  line-height: 1.16;
  letter-spacing: -.065em;
}
.hero h1 em { color: #48a271; font-style: normal; }
.hero-copy > p:not(.hint, .alert) { max-width: 510px; margin: 0 0 31px; color: #637b70; font-size: 15px; line-height: 1.9; }
.button {
  min-height: 43px;
  padding: 11px 17px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--green-700), #174f3d); box-shadow: 0 10px 24px rgba(28, 102, 74, .23); }
.button.primary:hover { box-shadow: 0 13px 28px rgba(28, 102, 74, .3); }
.button.secondary { color: #3f6252; background: #edf2ec; }
.button.large { min-height: 54px; padding: 13px 22px; border-radius: 14px; font-size: 13px; }
.google-g { padding: 1px 5px; border-radius: 5px; background: #fff; color: #4285f4; font: 700 18px/22px Arial, sans-serif; }
.hint { margin-top: 16px; color: #8a9e93; font-size: 11px; }
.alert { max-width: 490px; padding: 11px 14px; border: 1px solid #f3cfc5; border-radius: 10px; background: #fff1ed; color: #a5442d; font-size: 12px; }

.hero-visual { position: relative; min-height: 500px; display: grid; place-items: center; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 3% 5% 0;
  border-radius: 48% 52% 45% 55% / 52% 42% 58% 48%;
  background: linear-gradient(145deg, #e3f0df, #f3edcf);
  transform: rotate(-3deg);
}
.hero-image-card {
  position: relative;
  width: min(690px, 100%);
  overflow: hidden;
  border: 9px solid rgba(255, 255, 255, .85);
  border-radius: 34px;
  background: #143c31;
  box-shadow: 0 34px 80px rgba(25, 59, 44, .2);
  transform: rotate(1.4deg);
}
.hero-image-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.floating-note {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 17px;
  border: 1px solid rgba(217, 229, 216, .9);
  border-radius: 15px;
  background: rgba(255, 255, 252, .94);
  box-shadow: 0 16px 36px rgba(28, 64, 48, .16);
  color: #71877b;
  font-size: 10px;
  line-height: 1.55;
}
.floating-note strong { color: #285a44; font-size: 12px; }
.note-check { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; background: #dcf0df; color: #2d935d; font-size: 19px; }

.app-shell { max-width: 1400px; margin: auto; padding: 30px 26px 76px; }
.app-intro {
  min-height: 150px;
  padding: 30px 38px;
  border: 1px solid rgba(193, 220, 199, .85);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  background: linear-gradient(115deg, #e4f1e2, #f6f2dc);
  box-shadow: 0 14px 40px rgba(35, 78, 57, .06);
}
.app-intro h1 { margin: 8px 0 5px; color: #173f31; font-size: 30px; letter-spacing: -.04em; }
.app-intro p { margin: 0; color: #688173; font-size: 12px; }
.intro-art { width: 250px; height: 132px; margin: -25px 8px -25px 20px; overflow: hidden; border-radius: 60px 20px 60px 20px; box-shadow: 0 15px 34px rgba(24, 63, 47, .15); transform: rotate(-2deg); }
.intro-art img { width: 100%; height: 100%; object-fit: cover; }

.main-tabs {
  position: sticky;
  top: 76px;
  z-index: 20;
  width: max-content;
  max-width: 100%;
  margin: 22px 0 0;
  padding: 5px;
  border: 1px solid #dde7df;
  border-radius: 14px;
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 252, .9);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(28, 61, 47, .07);
}
.tab { padding: 10px 16px; border: 0; border-radius: 10px; background: transparent; color: #74897d; font-size: 12px; font-weight: 900; }
.tab:hover { color: var(--green-700); background: #f0f6f0; }
.tab.active { color: #fff; background: var(--green-800); box-shadow: 0 5px 14px rgba(29, 91, 71, .22); }
.view { padding-top: 22px; }

.booking-grid { display: grid; grid-template-columns: 315px minmax(0, 1fr); gap: 18px; align-items: start; }
.panel {
  padding: 22px;
  border: 1px solid rgba(220, 230, 221, .96);
  border-radius: 18px;
  background: rgba(255, 255, 253, .94);
  box-shadow: 0 10px 34px rgba(25, 59, 45, .055);
}
.panel-heading, .section-title { padding-bottom: 17px; border-bottom: 1px solid #edf1ec; }
.panel-heading { display: flex; align-items: flex-start; gap: 12px; }
.step { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--green-100); color: var(--green-700); font-size: 12px; font-weight: 900; }
.panel h2, .panel h3 { margin: 0; color: #25483a; }
.panel h2 { font-size: 16px; }
.panel h3 { font-size: 15px; }
.panel p, .section-title p { margin: 5px 0 0; color: #899b92; font-size: 11px; }

.staff-panel { position: sticky; top: 146px; }
.staff-list { padding-top: 10px; }
.staff-option {
  width: 100%;
  margin: 4px 0;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: transparent;
  transition: background .16s, border .16s, transform .16s;
}
.staff-option:hover { background: #f3f8f2; transform: translateX(2px); }
.staff-option.active { border-color: #b8dbc1; background: linear-gradient(135deg, #e6f3e7, #f0f7e9); }
.staff-avatar { flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: #edf3eb; color: #47715c; font-weight: 900; }
.staff-option.active .staff-avatar { background: #c7e5cf; color: #1d6d49; }
.staff-meta { flex: 1; min-width: 0; }
.staff-meta strong { display: block; color: #2f5042; font-size: 12px; }
.staff-meta small { display: block; margin-top: 3px; color: #93a399; font-size: 10px; }
.staff-arrow { color: #9caf9f; font-size: 19px; }

.date-toolbar { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; }
.calendar-date-toolbar { justify-content: space-between; flex-wrap: wrap; }
.calendar-date-toolbar > div:first-child { display: grid; gap: 3px; }
.calendar-date-toolbar > div:first-child strong { color: #254b3b; font-size: 13px; }
.field-label { color: #72877b; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.day-kind { padding: 5px 9px; border-radius: 20px; background: #fff0d9; color: #9a6633; font-size: 10px; font-weight: 800; }
.calendar-toolbar { display: flex; align-items: center; gap: 7px; }
.calendar-toolbar strong { min-width: 102px; text-align: center; color: #315947; font-size: 12px; }
.mini-button { padding: 7px 9px; border: 1px solid #d7e5d9; border-radius: 8px; background: #fff; color: #4f8062; font-size: 10px; font-weight: 900; }
.mini-button:hover { background: #edf6ee; }
.mini-button:disabled { opacity: .36; cursor: not-allowed; }
.booking-calendar { margin-bottom: 20px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.calendar-weekdays { margin: 8px 0 7px; color: #819389; text-align: center; font-size: 10px; font-weight: 900; }
.calendar-day {
  min-height: 68px;
  padding: 8px;
  border: 1px solid #e4ece5;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  background: #fff;
  color: #315646;
  transition: border .15s, background .15s, transform .15s;
}
.calendar-day:hover { border-color: #78b68d; background: #f5faf5; transform: translateY(-1px); }
.calendar-day.selected { border-color: #2f815c; background: #dff0e3; box-shadow: inset 0 0 0 1px #2f815c; }
.calendar-day.outside { opacity: .42; }
.calendar-day:disabled { cursor: not-allowed; background: #f6f7f5; color: #bdc7c0; }
.calendar-day:disabled:hover { border-color: #e4ece5; background: #f6f7f5; transform: none; }
.calendar-day strong { font-size: 12px; }
.calendar-day small { color: #2c8659; font-size: 9px; font-weight: 900; }

.slot-content { min-height: 220px; }
.slot-group { margin: 18px 0 22px; }
.slot-group h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 9px; color: #688075; font-size: 11px; }
.slot-group h3::after { content: ""; height: 1px; flex: 1; background: #e9eee8; }
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 9px; }
.slot-button { padding: 12px 13px; border: 1px solid #bddbc3; border-radius: 11px; text-align: left; background: linear-gradient(145deg, #fff, #f4faf4); color: #27704a; }
.slot-button:hover { border-color: #5eaa78; background: #e9f6eb; transform: translateY(-1px); }
.slot-button strong { display: block; font-size: 13px; }
.slot-button small { display: block; margin-top: 4px; color: #82998a; font-size: 9px; }
.slot-button.booked { cursor: not-allowed; border-color: #e2e7e1; background: #f5f6f4; color: #a2afa5; transform: none; }

.empty-state { padding: 38px 18px; text-align: center; color: #91a399; }
.empty-icon { display: block; margin-bottom: 8px; color: #b4d2bd; font-size: 31px; }
.empty-state strong { display: block; color: #627a6c; font-size: 12px; }
.empty-state p { margin: 7px 0 0; line-height: 1.6; }
.wide-panel { min-height: 300px; margin-bottom: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title input { padding: 8px 10px; border: 1px solid #dce7dc; border-radius: 9px; background: #fff; color: #365a45; font-size: 11px; }
.booking-row { padding: 14px 1px; border-bottom: 1px solid #eef2ed; display: grid; grid-template-columns: minmax(145px, 1.1fr) minmax(175px, 1.5fr) auto; gap: 12px; align-items: center; font-size: 11px; }
.booking-row strong { color: #315344; }
.booking-row small { display: block; margin-top: 3px; color: #8ca095; }
.status-pill { display: inline-block; padding: 5px 9px; border-radius: 20px; background: #e4f3e5; color: #318057; font-size: 9px; font-weight: 900; }
.status-pill.cancelled { background: #eff1ee; color: #94a197; }

.admin-lead { margin-bottom: 17px; display: flex; align-items: center; justify-content: space-between; }
.admin-lead h2 { margin: 0; color: #244438; font-size: 21px; }
.admin-lead p { margin: 5px 0 0; color: #84998d; font-size: 11px; }
.admin-badge { padding: 6px 10px; border-radius: 20px; background: #dff0e1; color: #257849; font-size: 10px; font-weight: 900; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-bookings, .admin-calendar-panel { grid-column: 1 / -1; }
.admin-calendar-controls { display: flex; align-items: end; gap: 16px; }
.admin-calendar-controls label { display: grid; gap: 5px; color: #667e6d; font-size: 10px; font-weight: 900; }
.admin-calendar-controls select { padding: 8px 10px; border: 1px solid #dae6db; border-radius: 9px; background: #fff; color: #305541; }
#calendar-day-bookings, #admin-calendar-day-bookings { margin-top: 20px; }
#calendar-day-bookings h3, #admin-calendar-day-bookings h3 { margin: 0 0 10px; color: #315646; font-size: 14px; }
.admin-form { padding-top: 15px; display: grid; gap: 10px; }
.admin-form label, .booking-dialog label { display: grid; gap: 5px; color: #667e6d; font-size: 10px; font-weight: 900; }
.admin-form input, .admin-form select, .booking-dialog textarea { width: 100%; padding: 9px 10px; border: 1px solid #dae6db; border-radius: 9px; outline: 0; background: #fff; color: #305541; }
.admin-form input:focus, .admin-form select:focus, .booking-dialog textarea:focus { border-color: #51a974; box-shadow: 0 0 0 3px #d9f1df; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.admin-form .button { justify-self: start; }
.checkbox-row { display: flex !important; align-items: center; gap: 8px !important; }
.checkbox-row input { width: auto; }
.compact-list { max-height: 300px; margin-top: 16px; overflow: auto; border-top: 1px solid #edf1ec; }
.compact-item { padding: 10px 0; border-bottom: 1px solid #eef2ed; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; }
.compact-item strong { color: #426550; }
.compact-item small { color: #96a79c; }
.compact-item button { border: 0; background: transparent; color: #2d7854; font-size: 10px; font-weight: 900; }

.booking-dialog { width: min(440px, calc(100vw - 28px)); padding: 27px; border: 1px solid #e5ece4; border-radius: 20px; box-shadow: 0 28px 90px rgba(18, 52, 39, .35); }
.booking-dialog::backdrop { background: rgba(16, 44, 34, .66); backdrop-filter: blur(4px); }
.booking-dialog form { position: relative; }
.booking-dialog h2 { margin: 9px 0 16px; color: #244638; font-size: 21px; }
.dialog-close { position: absolute; top: -8px; right: -6px; width: 29px; height: 29px; border: 0; border-radius: 50%; background: #edf3ed; color: #71887a; font-size: 18px; }
.confirm-details { margin-bottom: 16px; padding: 14px; border-radius: 12px; background: #f1f7f1; color: #436854; font-size: 12px; line-height: 1.85; }
.confirm-details strong { color: #245540; }
.dialog-hint { margin-top: 9px; color: #92a497; font-size: 10px; }
.dialog-actions { margin-top: 21px; display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; padding: 12px 16px; border-radius: 11px; background: #214e3c; color: #fff; box-shadow: 0 12px 28px rgba(16, 51, 37, .3); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; font-size: 11px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a94d39; }
footer { padding: 19px max(4vw, 24px); border-top: 1px solid #e2e9e1; display: flex; justify-content: space-between; color: #93a49a; font-size: 10px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; max-width: 760px; padding-top: 56px; }
  .hero-copy { text-align: center; }
  .hero h1, .hero-copy > p:not(.hint, .alert), .alert { margin-left: auto; margin-right: auto; }
  .hero-visual { min-height: 430px; }
  .booking-grid { grid-template-columns: 1fr; }
  .staff-panel { position: static; }
  .staff-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-bookings, .admin-calendar-panel { grid-column: auto; }
}

@media (max-width: 650px) {
  .site-header { min-height: 68px; padding: 10px 15px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: 13px; }
  .brand small, .account-email { display: none; }
  .account-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
  .hero { min-height: auto; padding: 44px 19px 55px; }
  .hero h1 { font-size: 38px; }
  .hero-copy > p:not(.hint, .alert) { font-size: 13px; }
  .hero-visual { min-height: 315px; }
  .hero-image-card { border-width: 5px; border-radius: 23px; }
  .floating-note { right: 2px; bottom: 2px; }
  .app-shell { padding: 17px 12px 48px; }
  .app-intro { min-height: 124px; padding: 22px; }
  .app-intro h1 { font-size: 24px; }
  .intro-art { width: 120px; height: 100px; margin-right: -46px; opacity: .7; }
  .main-tabs { top: 68px; width: 100%; overflow-x: auto; }
  .tab { flex: 1; white-space: nowrap; padding: 9px 11px; }
  .panel { padding: 16px; border-radius: 15px; }
  .staff-list { grid-template-columns: 1fr; }
  .calendar-date-toolbar { align-items: flex-start; }
  .calendar-date-toolbar > div:first-child { width: 100%; }
  .calendar-grid, .calendar-weekdays { gap: 3px; }
  .calendar-day { min-height: 49px; padding: 5px; border-radius: 8px; }
  .calendar-day small { font-size: 7px; }
  .slot-list { grid-template-columns: 1fr 1fr; }
  .section-title { align-items: flex-start; flex-direction: column; }
  .admin-calendar-controls { width: 100%; align-items: flex-start; flex-direction: column; }
  .admin-calendar-controls label, .admin-calendar-controls select { width: 100%; }
  .booking-row { grid-template-columns: 1fr auto; }
  .booking-row > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .form-row { grid-template-columns: 1fr; }
  footer { display: block; padding: 16px; }
  footer span { display: block; margin: 3px 0; }
}
