﻿:root {
  color-scheme: light;
  --ink: #1f2528;
  --muted: #667179;
  --line: #dce4e1;
  --panel: #ffffff;
  --wash: #f7f4ee;
  --sage: #6f8f72;
  --teal: #28666e;
  --rose: #b96f6a;
  --gold: #b68a3d;
  --shadow: 0 22px 60px rgba(35, 43, 40, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 244, 238, 0.84), rgba(247, 244, 238, 0.94)),
    url("https://images.unsplash.com/photo-1560066984-138dadb4c035?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
}

button, input, select, textarea { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button {
  min-height: 46px;
  border: 0;
  padding: 0 18px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:hover, .action-link:hover { filter: brightness(1.08); }

button:disabled { cursor: not-allowed; opacity: 0.5; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(220, 228, 225, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.nav-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 4px;
  background: #edf1ee;
}

.tab {
  min-height: 38px;
  padding: 0 18px;
  background: transparent;
  color: var(--muted);
}

.tab.active { background: white; color: var(--ink); box-shadow: 0 5px 18px rgba(31, 37, 40, 0.08); }

.quick-contact {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.quick-contact a, .action-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  background: white;
  font-weight: 800;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 40px;
}

.view { display: none; }
.view.active { display: block; }

.hero {
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 6vw, 64px);
  color: white;
  background:
    linear-gradient(180deg, rgba(31, 37, 40, 0.12), rgba(31, 37, 40, 0.82)),
    url("https://images.unsplash.com/photo-1522337360788-8b13dee7a37e?auto=format&fit=crop&w=1400&q=80") center/cover;
  box-shadow: var(--shadow);
}

.hero-copy { max-width: 760px; }

.eyebrow {
  margin: 0 0 10px;
  color: currentColor;
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 0.75;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 16px;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0;
}

.intro {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-stats strong { font-size: 1.55rem; }

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 22px;
  margin-top: 22px;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 228, 225, 0.88);
  box-shadow: var(--shadow);
}

.booking-form, .side-panel, .admin-lock, .panel.stack, #settingsForm, .admin-workspace > .panel {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 36px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head.compact { align-items: flex-start; }

.status-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #cadcc9;
  color: #49624b;
  background: #eef5ed;
  font-size: 0.88rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  padding: 13px 14px;
  outline: none;
  border-radius: 0;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(111, 143, 114, 0.16);
}

.grid.two, .admin-grid, .filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: #f5f1e9;
  border-left: 4px solid var(--gold);
}

.summary span, .muted { color: var(--muted); }
.summary span { font-weight: 800; }

.info-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.info-list div {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.info-list dt {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.info-list dd {
  margin: 6px 0 0;
  line-height: 1.55;
}

.contact-actions, .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-link.accent { background: var(--teal); color: white; border-color: var(--teal); }

.admin-lock {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: center;
}

.login-form { display: grid; gap: 14px; }

.admin-workspace { display: grid; gap: 22px; }

.admin-grid { align-items: start; }

.ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger { background: var(--rose); color: white; }

.filters { margin-top: 16px; }

.records-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.record, .manage-item, .empty {
  padding: 16px;
  border: 1px solid var(--line);
  background: white;
}

.record { display: grid; gap: 10px; }
.record h3 { margin: 0; font-size: 1.03rem; }
.record p { margin: 0; color: var(--muted); line-height: 1.55; }

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.record-actions button, .record-actions select {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.9rem;
}

.badge {
  width: fit-content;
  padding: 4px 8px;
  background: #edf1ee;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
}

.empty { grid-column: 1 / -1; color: var(--muted); border-style: dashed; }

.inline-form {
  display: grid;
  grid-template-columns: 1fr 92px 100px 76px;
  gap: 10px;
}

.inline-form.two-controls { grid-template-columns: 1fr 76px; }

.manage-list { display: grid; gap: 10px; }

.service-config {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: white;
}

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

.service-length-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #f7f4ee;
}

.service-length-card input { padding: 9px; }

.manage-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.manage-item strong { display: block; }
.manage-item span { color: var(--muted); font-size: 0.9rem; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  transform: translateY(20px);
  opacity: 0;
  padding: 13px 18px;
  background: var(--sage);
  color: white;
  font-weight: 900;
  transition: 180ms ease;
}

.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 920px) {
  .topbar { grid-template-columns: 1fr; justify-items: stretch; }
  .brand, .quick-contact { justify-content: center; }
  .booking-layout, .admin-lock, .admin-grid, .records-list { grid-template-columns: 1fr; }
  .hero { min-height: 54vh; }
}

@media (max-width: 560px) {
  .shell { width: 100%; padding-top: 0; }
  .topbar { position: static; padding: 12px; }
  .hero { box-shadow: none; }
  .booking-form, .side-panel, .admin-lock, .panel.stack, #settingsForm, .admin-workspace > .panel { padding: 20px 16px; }
  .grid.two, .filters, .inline-form, .service-length-grid { grid-template-columns: 1fr; }
  .section-head, .summary { align-items: flex-start; flex-direction: column; }
  .records-list { padding: 0; }
}
