:root {
  color-scheme: light;
  --bg: #f6f2eb;
  --ink: #1f1a16;
  --muted: #7d746b;
  --line: #eadfd3;
  --gold: #a97945;
  --gold-soft: #f4e7d4;
  --red: #9c3b32;
  --green: #246246;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #e6ddd0;
}
button, input, select, textarea { font: inherit; color: inherit; font-size: 16px; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.phone { width: min(430px, 100%); margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
.boot, .login { min-height: 100vh; }
.boot { display: grid; place-items: center; color: var(--muted); letter-spacing: .14em; }
.login { padding: 48px 22px 32px; }
.login h1 { font-family: Palatino, "Palatino Linotype", "Songti SC", serif; font-size: 46px; font-weight: 500; letter-spacing: .08em; }
.eyebrow { letter-spacing: .22em; color: var(--gold); font-size: 12px; }
.sub, .hint, .back-link, .muted { color: var(--muted); }
.sub { margin: 6px 0 28px; }
label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  width: 100%; margin-top: 6px; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; padding: 12px; outline: none;
}
textarea { min-height: 72px; resize: vertical; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; }
.pw-row button, .btn, .btn-primary, .btn-ghost, .btn-danger {
  border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 10px 12px;
}
.btn-primary { background: #1f1a16; color: #f8f1e7; border-color: #1f1a16; }
.btn-danger { background: #f8ecea; color: var(--red); border-color: transparent; }
.btn-block { width: 100%; margin-top: 8px; }
.hint { line-height: 1.6; margin: 4px 0 8px; }
.back-link { display: inline-block; margin-top: 18px; }
.m-top {
  position: sticky; top: 0; z-index: 5; background: rgba(246,242,235,.94);
  backdrop-filter: blur(8px); padding: 14px 16px 8px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 8px;
}
.m-top h1 { font-size: 24px; }
.m-top button, .text-btn { background: transparent; border: 0; color: var(--gold); padding: 6px 0; }
.m-view { padding: 8px 14px 108px; }
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(430px, 100%); display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fffdfb; border-top: 1px solid var(--line); padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 6;
}
.tabbar button { border: 0; background: transparent; color: var(--muted); padding: 8px 0; font-size: 13px; }
.tabbar button.active { color: var(--ink); font-weight: 650; }
.tab-main { font-weight: 650; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card, .stat {
  background: #fffdfb; border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.stat span, .stat em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.stat b { display: block; margin: 6px 0 2px; font-size: 22px; font-variant-numeric: tabular-nums; }
.section-title { margin: 16px 2px 8px; font-size: 15px; }
.row {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #f3ebe3;
}
.row button { background: transparent; border: 0; text-align: left; padding: 0; }
.tag { display: inline-flex; border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #eeeae4; white-space: nowrap; }
.lv-silver { background: #e7eef6; color: #2f5274; }
.lv-gold { background: var(--gold-soft); color: #7a5730; }
.lv-black { background: #1f1a16; color: #e6d3b0; }
.st-booked { background: #f4e7d4; color: #7a5730; }
.st-arrived { background: #e5eef6; color: #2f5274; }
.st-doing { background: #e5f2ea; color: var(--green); }
.st-done { background: #eeeae4; color: #6e675f; }
.st-cancelled { background: #f8ecea; color: var(--red); }
.low { color: var(--red); font-weight: 650; }
.chips { display: flex; gap: 8px; overflow: auto; padding-bottom: 4px; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 13px; }
.chip.on { background: #1f1a16; color: #f8f1e7; border-color: #1f1a16; }
.appt { margin-bottom: 10px; }
.appt-top, .actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.actions { margin-top: 10px; }
.actions .btn { flex: 1; font-size: 14px; }
.date-nav { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.date-nav input { margin: 0; flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 28px 0; }
.item { width: 100%; text-align: left; margin-bottom: 8px; }
.item b, .item em { display: block; }
.item em { font-style: normal; color: var(--muted); font-size: 12px; margin-top: 4px; }
.banner { background: var(--gold-soft); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f3ebe3; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.pay-grid button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 0; }
.pay-grid button.on { background: #1f1a16; color: #f8f1e7; }
.sum { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); }
.sum.total { color: var(--ink); font-size: 18px; font-weight: 700; }
.menu-btn { width: 100%; text-align: left; margin-bottom: 8px; display: flex; justify-content: space-between; }
.hero { display: flex; gap: 10px; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #1f1a16; color: #f4e7d4; font-family: Palatino, "Songti SC", serif; }
.mask { position: fixed; inset: 0; background: rgba(36,28,22,.4); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal { width: min(430px, 100%); max-height: 88vh; overflow: auto; background: #fffdfb; border-radius: 18px 18px 0 0; }
.modal header, .modal footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 14px 16px; }
.modal-body { padding: 0 16px 16px; }
.icon-x { border: 0; background: transparent; font-size: 24px; }
.fields { display: grid; gap: 8px; }
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: #1f1a16; color: #f8f1e7; padding: 10px 14px; border-radius: 999px;
  z-index: 30; opacity: 0; pointer-events: none; max-width: 90%;
}
.toast.show { opacity: 1; }
.bar { height: 8px; background: #f3ebe3; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: #1f1a16; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.week i { font-style: normal; text-align: center; background: #f6f1ea; border-radius: 8px; padding: 6px 0; font-size: 11px; }
.week i.today { outline: 1px solid #c4a574; }
