:root {
  --ink: #2b2320;
  --ink-2: #6b5d55;
  --line: #e7ded6;
  --bg: #f7f3ee;
  --card: #fffdfa;
  --accent: #8c4a2f;
  --accent-2: #c2703f;
  --green: #3f7a5c;
  --gold: #b08341;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(90, 62, 40, .08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; font-size: inherit; }
input, select, textarea {
  font-family: inherit; font-size: 15px; width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(140, 74, 47, .25); border-color: var(--accent); }

#app { max-width: 520px; margin: 0 auto; padding-bottom: 78px; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; padding: 14px 18px 12px;
  background: linear-gradient(180deg, #f7f3ee 70%, rgba(247,243,238,0));
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: .06em; }
.brand::before { content: ""; display: inline-block; width: 6px; height: 18px; background: var(--accent); border-radius: 3px; margin-right: 8px; vertical-align: -3px; }
.chip { font-size: 12px; padding: 5px 11px; border-radius: 999px; background: #ece2d8; color: var(--ink-2); }
.chip.on { background: #e4efe8; color: var(--green); }

main { padding: 4px 18px 20px; }
.hidden { display: none !important; }

/* 项目卡片 */
.proj {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 16px; border: 1px solid rgba(231,222,214,.7);
}
.proj img { width: 100%; height: 172px; object-fit: cover; display: block; background: #ded3c7; }
.proj .body { padding: 13px 15px 15px; }
.proj h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: .04em; }
.proj .sum { color: var(--ink-2); font-size: 13px; margin: 0 0 10px; }
.proj .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.tag { background: #f2ebe3; border-radius: 6px; padding: 2px 8px; }
.tag.seats { background: #e8f1ec; color: var(--green); }

/* 通用块 */
.panel { background: var(--card); border-radius: var(--radius); padding: 15px; margin-bottom: 14px; box-shadow: var(--shadow); }
.panel h4 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.panel h4 small { font-weight: 400; color: var(--ink-2); font-size: 12px; }
.muted { color: var(--ink-2); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > input, .row > select { flex: 1 1 auto; min-width: 0; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }

.btn { display: block; width: 100%; padding: 13px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #f2ebe3; color: var(--accent); }
.btn.line { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn.sm { padding: 9px 14px; width: auto; font-size: 13px; border-radius: 10px; white-space: nowrap; flex: 0 0 auto; }
.btn[disabled] { opacity: .45; }

.gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.gallery img { width: 76%; height: 168px; object-fit: cover; border-radius: 12px; flex: 0 0 auto; }

.hero { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.hero img { width: 100%; height: 200px; object-fit: cover; display: block; }
.hero .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 15px 13px; color: #fff; background: linear-gradient(transparent, rgba(20,14,10,.72)); }
.hero .cap h2 { margin: 0; font-size: 20px; }

.teacher { display: flex; gap: 12px; align-items: center; }
.teacher .ava { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #c2703f, #8c4a2f); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }

.slot { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; background: #fff; }
.slot.disabled { opacity: .5; }
.slot .t { font-weight: 600; }
.slot .s { font-size: 12px; color: var(--ink-2); }

.card-visual {
  border-radius: 16px; padding: 18px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #7c4128 0%, #a75c34 55%, #c98a4b 100%);
  box-shadow: 0 10px 28px rgba(124, 65, 40, .3);
}
.card-visual::after { content: "会员"; position: absolute; right: -6px; bottom: -18px; font-size: 68px; opacity: .14; font-weight: 700; letter-spacing: .1em; }
.card-visual .nm { font-size: 19px; font-weight: 700; letter-spacing: .05em; }
.card-visual .dt { font-size: 12px; opacity: .88; margin-top: 2px; }
.card-visual .days { font-size: 28px; font-weight: 700; margin-top: 10px; }
.card-visual .days span { font-size: 12px; font-weight: 400; opacity: .85; }

.qrbox { text-align: center; padding: 8px 0 4px; }
.qrbox .code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: .16em; font-weight: 700; color: var(--accent); word-break: break-all; }
.qrbox .cd { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.qrbox.dead .code { color: #b9aca2; text-decoration: line-through; }

.list-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.list-item:last-child { border-bottom: 0; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #f2ebe3; color: var(--ink-2); }
.badge.ok { background: #e4efe8; color: var(--green); }
.badge.warn { background: #fbeee0; color: var(--gold); }
.badge.off { background: #f0ecea; color: #9b8f88; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  max-width: 520px; margin: 0 auto; background: rgba(255,253,250,.96);
  border-top: 1px solid var(--line); backdrop-filter: blur(8px); padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; padding: 9px 0 10px; font-size: 11px; color: var(--ink-2); display: grid; gap: 2px; place-items: center; }
.tab span { font-size: 16px; line-height: 1; }
.tab.active { color: var(--accent); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(43,35,32,.94); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 14px; max-width: 84%; text-align: center; opacity: 0; pointer-events: none;
  transition: .22s; z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(150, 52, 40, .95); }

.sheet-mask { position: fixed; inset: 0; background: rgba(30,22,18,.44); z-index: 40; display: none; }
.sheet-mask.show { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 520px; margin: 0 auto;
  background: var(--card); border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: .26s cubic-bezier(.2,.8,.3,1); max-height: 86vh; overflow: auto;
}
.sheet.show { transform: translateY(0); }
.sheet h3 { margin: 0 0 12px; font-size: 17px; }

.empty { text-align: center; color: var(--ink-2); padding: 40px 0; font-size: 14px; }
.back { font-size: 13px; color: var(--ink-2); padding: 4px 0 10px; }
.field { margin-bottom: 11px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.check input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.price { font-weight: 700; color: var(--accent); }
.price small { font-weight: 400; font-size: 11px; color: var(--ink-2); }
