/* ========== 共用 ========== */
:root {
  --brand: #8a5a6b;
  --brand-d: #6e4454;
  --brand-l: #f5ecef;
  --ink: #2b2326;
  --muted: #8a7f83;
  --line: #e8e0e3;
  --bg: #faf7f8;
  --card: #fff;
  --ok: #2f8a5b;
  --warn: #b7791f;
  --danger: #c0392b;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 15px; }
a { color: var(--brand); }
img { max-width: 100%; height: auto; }
h1 { font-size: 1.6rem; margin: .4em 0 .6em; line-height: 1.3; }
h2 { font-size: 1.2rem; margin: 1em 0 .6em; }
h3 { font-size: 1.02rem; margin: 1em 0 .4em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.danger { color: var(--danger); }
.hp { position: absolute; left: -9999px; }

.btn { display: inline-block; background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 8px; padding: .55em 1.1em; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--brand-d); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { padding: .8em 1.6em; font-size: 1.05rem; }
.btn-sm { padding: .35em .8em; font-size: .88rem; }
.btn-ghost { background: #fff; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-l); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-dark { background: #3a3034; border-color: #3a3034; }
.x { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 0 .3em; }
.x:hover { color: var(--danger); }

.flash { padding: .75em 1em; border-radius: 8px; margin: .8em 0; }
.flash-ok { background: #e8f5ee; color: #1e6142; }
.flash-err { background: #fcebea; color: #8e2a20; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1em 1.3em; margin: 0 0 1.1em; }
.card > h2:first-child { margin-top: 0; }

.form label { display: block; margin: 0 0 .85em; font-size: .92rem; color: #554a4e; }
.form label.check, label.check { display: flex; gap: .5em; align-items: center; color: var(--ink); margin: .3em 0; }
input, select, textarea { font: inherit; border: 1px solid #d8cdd1; border-radius: 7px; padding: .5em .6em; background: #fff; color: var(--ink); max-width: 100%; }
.form input:not([type=checkbox]):not([type=radio]):not([type=color]), .form select, .form textarea { display: block; width: 100%; margin-top: .25em; }
input[type=checkbox] { width: 1.1em; height: 1.1em; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-l); border-color: var(--brand); }
.row { display: flex; gap: .8em; flex-wrap: wrap; }
.row > label { flex: 1 1 160px; }
.w4 { width: 4.5em !important; } .w6 { width: 6.5em !important; } .w10 { width: 10em !important; }
.inline { display: inline; }
.inline-form { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; margin-bottom: 1em; }
.inline-form label { display: flex; gap: .4em; align-items: center; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55em .5em; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: #5b4f53; font-size: .9rem; }
.table.compact th, .table.compact td { padding: .38em .4em; font-size: .92rem; }
.table tr.muted td { color: var(--muted); }
.table tr.changed td { background: #fff8ec; }
.table-scroll { overflow-x: auto; }

.badge { display: inline-block; padding: .1em .55em; border-radius: 99px; font-size: .78rem; background: #eee; color: #555; white-space: nowrap; }
.st-booked { background: #e8eefc; color: #2c4fa3; }
.st-checked_in { background: #fff3dc; color: #8a5a00; }
.st-completed { background: #e3f4ea; color: #1e6142; }
.st-cancelled { background: #f6e3e1; color: #8e2a20; }
.st-no_show { background: #ececec; color: #666; }
.tag { display: inline-block; font-size: .75rem; padding: 0 .45em; border-radius: 4px; background: var(--brand-l); color: var(--brand-d); margin-right: .25em; }
.tag.in { background: #e3f4ea; color: #1e6142; } .tag.out { background: #ececec; color: #444; }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; vertical-align: middle; }

details > summary { cursor: pointer; color: var(--brand); margin: .3em 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45em 1.2em; margin: 0 0 1em; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.price { font-weight: 700; color: var(--brand-d); }

/* ========== 後台 ========== */
.topbar { background: #3a3034; color: #fff; display: flex; align-items: center; gap: 1em; padding: 0 1em; position: sticky; top: 0; z-index: 20; min-height: 52px; flex-wrap: wrap; }
.topbar a { color: #f1e7ea; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.mainnav { display: flex; flex-wrap: wrap; gap: .1em; flex: 1; }
.mainnav a { padding: .9em .7em; font-size: .93rem; border-bottom: 3px solid transparent; }
.mainnav a.on, .mainnav a:hover { border-bottom-color: #e7b6c4; color: #fff; }
.who { font-size: .85rem; color: #cbbfc3; display: flex; gap: .8em; white-space: nowrap; }
.navtoggle { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; margin-left: auto; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 1em 1.2em 3em; }
.wrap.narrow { max-width: 480px; }
.login-page .wrap, .punch .wrap { padding-top: 2em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 1.1em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8em; margin-bottom: 1.1em; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9em 1em; }
.stat .n { font-size: 1.45rem; font-weight: 700; color: var(--brand-d); }
.board-top { display: flex; align-items: center; justify-content: space-between; gap: 1em; flex-wrap: wrap; }
.tabs { display: flex; gap: .3em; flex-wrap: wrap; margin-bottom: 1em; }
.tabs a { padding: .4em .9em; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .92rem; }
.tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.actions { display: flex; gap: .5em; flex-wrap: wrap; }
.checks li.ok::marker { content: "✓  "; color: var(--ok); }
.checks li.bad { color: var(--danger); } .checks li.bad::marker { content: "✗  "; }
.approval { background: #fff8ec; border: 1px dashed var(--warn); padding: .6em; border-radius: 8px; }
.quote td:last-child, .quote th:last-child { text-align: right; }
.lockcode { font-size: 1.4rem; letter-spacing: .15em; font-family: ui-monospace, Menlo, monospace; }

/* 排程板 */
.board { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(150px, 1fr)); overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.board-times { position: relative; margin-top: 38px; border-right: 1px solid var(--line); }
.board-times .tick { position: absolute; right: 6px; font-size: .72rem; color: var(--muted); transform: translateY(-50%); }
.board-times .tick:not(.hour) { opacity: .55; }
.board-col { border-right: 1px solid var(--line); min-width: 150px; }
.board-head { height: 38px; display: flex; align-items: center; justify-content: center; font-weight: 600; border-bottom: 3px solid; position: sticky; top: 0; background: #fff; }
.board-body { position: relative; cursor: copy; }
.board-body .off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg, #f4f1f2, #f4f1f2 6px, #ece7e9 6px, #ece7e9 12px); }
.board-body .on { position: absolute; left: 0; right: 0; background: #fff; }
.board-body .gl { position: absolute; left: 0; right: 0; border-top: 1px dotted #eee; }
.board-body .gl.hour { border-top: 1px solid #e6e0e2; }
.board-body .buffer { position: absolute; left: 4px; right: 4px; background: #f1ecee; border-radius: 0 0 6px 6px; }
.appt { position: absolute; left: 4px; right: 4px; background: color-mix(in srgb, var(--c) 18%, #fff); border-left: 4px solid var(--c); border-radius: 6px; padding: 3px 6px; font-size: .78rem; line-height: 1.35; overflow: hidden; color: var(--ink); text-decoration: none; cursor: pointer; z-index: 2; }
.appt:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 3; }
.appt b, .appt span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .meta { color: var(--muted); font-size: .72rem; }
.appt.st-completed { opacity: .65; }
.appt.st-no_show { opacity: .5; text-decoration: line-through; }
.appt.st-checked_in { box-shadow: inset 0 0 0 2px #e0a940; }

/* 時段選擇 */
.slots { display: flex; flex-wrap: wrap; gap: .45em; }
.slot { border: 1px solid #d8cdd1; background: #fff; border-radius: 8px; padding: .5em .8em; font: inherit; cursor: pointer; min-width: 4.6em; }
.slot:hover { border-color: var(--brand); }
.slot.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.slot-group { margin-bottom: .8em; }
.slot-label { font-size: .85rem; color: var(--muted); margin-bottom: .3em; }
.slot-date { font-weight: 600; margin-bottom: .6em; }
.sp-slots { margin: .3em 0 .8em; }
.sp-addons { margin-bottom: 1em; }

/* 結帳 */
.pos-add { display: flex; gap: .5em; flex-wrap: wrap; margin-bottom: .8em; }
.pos-lines input[type=number] { width: 7em; }
.pos-lines select { max-width: 15em; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }
.pay-grid label { font-size: .9rem; }
.pay-grid input { width: 100%; display: block; margin-top: .2em; font-size: 1.05rem; }
.pay-quick { margin: .6em 0; display: flex; gap: .4em; flex-wrap: wrap; }
.pay-state { font-weight: 600; }
.pay-state.ok { color: var(--ok); } .pay-state.bad { color: var(--danger); }
.pos-sum input { width: 8em; }
.sig { width: 100%; height: 220px; border: 1px dashed #c9b8be; border-radius: 8px; background: #fff; display: block; }
.sig-img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6em; margin-bottom: .8em; }
.photo-item { border: 1px solid var(--line); border-radius: 8px; padding: .4em; }
.photo-item img { aspect-ratio: 4/3; object-fit: cover; width: 100%; border-radius: 6px; }
.photo-item input { width: 100%; margin-top: .3em; font-size: .85rem; }
.faq-edit { border-bottom: 1px solid var(--line); padding: .6em 0; }
.faq-edit input:not([type=checkbox]), .faq-edit textarea { width: 100%; display: block; margin-bottom: .3em; }
.avatar-lg { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; display: block; margin-bottom: .5em; }

.bars .bar-row { display: grid; grid-template-columns: 3.5em 1fr 5.5em; align-items: center; gap: .5em; font-size: .85rem; margin: 2px 0; }
.bars .bar { height: 14px; background: var(--brand); border-radius: 3px; min-width: 2px; }
.bars .bar-val { text-align: right; color: var(--muted); }

/* 打卡 */
.punch-card { text-align: center; }
.punch-who { font-size: 1.1rem; }
.punch-clock { font-size: 3.4rem; font-weight: 700; letter-spacing: .05em; color: var(--brand-d); line-height: 1.1; margin: .2em 0; }
.punch-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .7em; margin: 1.2em 0 .8em; }
.punch-btns .btn { padding: 1.1em 0; font-size: 1.15rem; }
.mini-appt { border-left: 4px solid var(--brand); padding: .5em .8em; margin-bottom: .6em; background: #fcfafb; border-radius: 6px; }

/* ========== 前台 ========== */
.site-inner { max-width: 1080px; margin: 0 auto; padding: 0 1.2em; }
.site-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-head .site-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 1em; }
.site-logo { display: flex; align-items: center; gap: .5em; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; gap: 1.1em; align-items: center; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-size: .95rem; }
.hero { background: linear-gradient(rgba(43,35,38,.45), rgba(43,35,38,.45)), var(--cover, linear-gradient(135deg, #b98a99, #8a5a6b)); background-size: cover; background-position: center; color: #fff; padding: 5.5em 0 4.5em; text-align: center; }
.hero h1 { font-size: 2.2rem; margin: 0 0 .3em; }
.hero .lead { font-size: 1.15rem; opacity: .95; }
.section { padding: 2.4em 1.2em; }
.section h2 { font-size: 1.45rem; text-align: center; margin: 0 0 1em; }
.prose p { max-width: 46em; margin: 0 auto 1em; }
.adv-list, .notice-list { max-width: 46em; margin: 0 auto; padding-left: 1.3em; }
.adv-list li, .notice-list li { margin: .45em 0; }
.cat-title { margin-top: 1.6em; border-left: 4px solid var(--brand); padding-left: .6em; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1em; }
.svc-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: box-shadow .15s; }
.svc-card:hover { box-shadow: 0 6px 20px rgba(138,90,107,.15); }
.svc-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.svc-body { padding: .9em 1em 1em; flex: 1; display: flex; flex-direction: column; }
.svc-body h4 { margin: 0 0 .3em; font-size: 1.05rem; }
.svc-body p { margin: 0 0 .6em; color: var(--muted); font-size: .9rem; flex: 1; }
.svc-meta { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.2em; }
.team-card { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2em; }
.team-card img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; }
.team-card h4 { margin: .5em 0 .1em; }
.team-card p { font-size: .9rem; color: #5b4f53; text-align: left; }
.faq { max-width: 46em; margin: 0 auto; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .2em 1em; margin-bottom: .6em; }
.faq summary { font-weight: 600; color: var(--ink); padding: .6em 0; }
.cta { text-align: center; }
.crumb { font-size: .85rem; color: var(--muted); padding-top: 1em; }
.crumb a { color: var(--muted); }
.svc-detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2em; padding-top: 1em; padding-bottom: 1em; }
.svc-gallery .main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
.thumbs { display: flex; gap: .4em; margin-top: .4em; overflow-x: auto; }
.thumbs img { width: 76px; height: 58px; object-fit: cover; border-radius: 6px; cursor: pointer; }
.svc-info h1 { margin-top: .1em; }
.svc-info .lead { color: #5b4f53; }
.svc-sections section { margin: 1.5em 0 2em; }
.site-foot { background: #3a3034; color: #e2d6da; padding: 2em 0 1.5em; margin-top: 2em; font-size: .92rem; }
.site-foot .site-inner { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; }
.site-foot a { color: #f4c9d6; }
.site-foot .muted { color: #b9a9ae; }
.foot-links { display: flex; gap: 1em; flex-wrap: wrap; }

/* 預約流程 */
.book { max-width: 820px; padding-top: 1em; padding-bottom: 2em; }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 1.2em; gap: .3em; counter-reset: s; }
.steps li { flex: 1; text-align: center; font-size: .82rem; color: var(--muted); border-bottom: 3px solid var(--line); padding: .3em 0; }
.steps li.on { color: var(--brand-d); border-color: var(--brand); font-weight: 600; }
.steps li.done { color: var(--ink); border-color: #d6b6c1; }
.choice-list { display: grid; gap: .6em; }
.choice { display: flex; align-items: center; gap: .9em; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9em 1em; font: inherit; color: var(--ink); cursor: pointer; width: 100%; }
.choice:hover, .choice:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.choice > div:first-of-type { flex: 1; }
.choice-meta { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.choice img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.check-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-l); }
.step-actions { display: flex; justify-content: space-between; margin-top: 1.2em; gap: .6em; }
.cal-wrap { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 1.4em; align-items: start; }
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8em; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5em; }
.cal-nav { background: none; border: 1px solid var(--line); border-radius: 6px; width: 2.2em; height: 2.2em; font-size: 1.1rem; cursor: pointer; color: var(--brand); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: .78rem; color: var(--muted); padding: .2em 0; }
.cal-day { aspect-ratio: 1; border: none; border-radius: 8px; font: inherit; cursor: pointer; background: transparent; }
.cal-day.ok { background: var(--brand-l); color: var(--brand-d); font-weight: 600; }
.cal-day.ok:hover { background: #ead6dd; }
.cal-day.no { color: #c9bfc3; cursor: default; }
.cal-day.sel { background: var(--brand); color: #fff; }
.cal-day.loading { background: #f6f3f4; color: #ddd; }
.cal-legend { font-size: .78rem; color: var(--muted); margin-top: .5em; display: flex; gap: .4em; align-items: center; }
.cal-legend .dot.ok { background: var(--brand-l); border: 1px solid #d6b6c1; }
.cal-legend .dot.no { background: #eee; }
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1em 1.2em; margin-bottom: 1em; }
.notice-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .8em 1em; font-size: .9rem; margin-bottom: .8em; }
.notice-box ul { margin: .3em 0 0; padding-left: 1.2em; }

/* ========== 手機 ========== */
@media (max-width: 860px) {
  .navtoggle { display: block; }
  .mainnav, .who { display: none; width: 100%; }
  .nav-open .mainnav { display: flex; flex-direction: column; }
  .nav-open .who { display: flex; padding: .6em 0 .9em; }
  .mainnav a { padding: .6em .2em; border-bottom: 1px solid #4c4044; }
  .grid2 { grid-template-columns: 1fr; }
  .svc-detail { grid-template-columns: 1fr; }
  .cal-wrap { grid-template-columns: 1fr; }
  .site-nav a:not(.btn) { display: none; }
  .hero { padding: 3.5em 0 3em; }
  .hero h1 { font-size: 1.7rem; }
  .pos-lines thead { display: none; }
  .pos-lines tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); padding: .4em 0; }
  .pos-lines td { border: none; padding: .2em .3em; }
  .pos-lines td:first-child { grid-column: 1 / -1; }
  .wrap { padding: .8em .8em 3em; }
  .steps li { font-size: .72rem; }
}
@media print {
  .topbar, .actions, form, .btn { display: none !important; }
  body { background: #fff; }
  .card { border: none; }
}
