/* 元气堂 · 通用样式（移动优先，适老化：大字号、大按钮） */
:root{
  --brand:#2f6b4f; --brand-d:#244f3b; --brand-l:#e8f2ec;
  --gold:#c8a45c; --gold-l:#faf4e6;
  --bg:#f5f3ee; --card:#ffffff; --line:#e8e4dc;
  --text:#2b2b2b; --muted:#8b8681; --muted-l:#b5b0a8;
  --ok:#3aa76d; --warn:#e08a00; --danger:#c0392b; --busy:#9aa0a6;
  --r:14px; --r-s:10px;
  --sh:0 2px 10px rgba(0,0,0,.06);
  --sh-l:0 8px 30px rgba(0,0,0,.12);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background:var(--bg); color:var(--text); font-size:16px; line-height:1.65;
  -webkit-font-smoothing:antialiased; padding-bottom:76px;
}
img{max-width:100%;display:block}
a{color:var(--brand);text-decoration:none}
h1,h2,h3,h4{margin:0 0 .5em;line-height:1.35}
h1{font-size:22px}h2{font-size:19px}h3{font-size:17px;margin-top:1.4em}
p{margin:.5em 0}
small{font-size:13px;color:var(--muted)}
.hide{display:none !important}

/* ---------- 顶栏 ---------- */
.topbar{
  position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:10px;
  padding:12px 16px;background:linear-gradient(135deg,var(--brand),var(--brand-d));
  color:#fff;box-shadow:0 2px 12px rgba(0,0,0,.15);
}
.topbar .brand{font-size:19px;font-weight:700;letter-spacing:1px}
.topbar .brand small{color:#cfe3d7;font-weight:400;margin-left:6px;font-size:12px}
.topbar .spacer{flex:1}
.topbar .tb-btn{
  background:rgba(255,255,255,.16);border:0;color:#fff;font-size:14px;
  padding:7px 12px;border-radius:20px;cursor:pointer;white-space:nowrap;
}
.topbar .tb-btn:active{background:rgba(255,255,255,.3)}

/* ---------- 布局 ---------- */
.wrap{max-width:640px;margin:0 auto;padding:14px}
.card{background:var(--card);border-radius:var(--r);padding:16px;box-shadow:var(--sh);margin-bottom:12px}
.card.tight{padding:12px}
.card-title{font-size:16px;font-weight:700;margin:0 0 10px;display:flex;align-items:center;gap:8px}
.card-title .dot{width:6px;height:16px;border-radius:3px;background:var(--brand)}
.row{display:flex;gap:10px;align-items:center}
.row.between{justify-content:space-between}
.row.wrap-r{flex-wrap:wrap}
.grow{flex:1}
.center{text-align:center}
.muted{color:var(--muted);font-size:14px}
.tiny{font-size:12px;color:var(--muted-l)}
.mt{margin-top:12px}.mb{margin-bottom:12px}

/* ---------- 按钮 ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:46px;padding:0 18px;border:0;border-radius:var(--r-s);
  font-size:16px;font-weight:600;cursor:pointer;font-family:inherit;
  background:var(--brand);color:#fff;transition:.15s;width:100%;
}
.btn:active{transform:scale(.985);opacity:.9}
.btn-lg{min-height:54px;font-size:18px;border-radius:12px}
.btn-gold{background:linear-gradient(135deg,#d4b16a,var(--gold));color:#4a3611}
.btn-ghost{background:#fff;color:var(--brand);border:1.5px solid var(--brand)}
.btn-line{background:#fff;color:var(--text);border:1.5px solid var(--line)}
.btn-sm{min-height:36px;font-size:14px;padding:0 12px;width:auto;border-radius:8px}
.btn-xs{min-height:30px;font-size:13px;padding:0 10px;width:auto;border-radius:8px}
.btn[disabled]{opacity:.45;pointer-events:none}
.btn-row{display:flex;gap:10px}
.btn-row .btn{flex:1}

/* ---------- 表单 ---------- */
label{display:block;font-size:14px;font-weight:600;margin:14px 0 6px}
input,select,textarea{
  width:100%;padding:12px 14px;border:1.5px solid var(--line);border-radius:var(--r-s);
  font-size:16px;font-family:inherit;color:var(--text);background:#fff;outline:none;
}
input:focus,select:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-l)}
textarea{min-height:76px;resize:vertical;line-height:1.6}

/* ---------- 徽标 ---------- */
.tag{display:inline-block;padding:3px 9px;border-radius:20px;font-size:12px;font-weight:600;line-height:1.5}
.tag-ok{background:#e6f6ec;color:#2b7a4b}
.tag-warn{background:#fdf3e0;color:#a86a00}
.tag-danger{background:#fdecea;color:#b03024}
.tag-muted{background:#f0efec;color:#7c7873}
.tag-gold{background:var(--gold-l);color:#8a6a20}
.tag-brand{background:var(--brand-l);color:var(--brand)}

/* ---------- 首页 hero ---------- */
.hero{
  background:linear-gradient(140deg,#38795a,#244f3b);color:#fff;
  border-radius:var(--r);padding:22px 18px;margin-bottom:12px;position:relative;overflow:hidden;
}
.hero::after{content:"";position:absolute;right:-40px;top:-40px;width:150px;height:150px;border-radius:50%;background:rgba(200,164,92,.22)}
.hero h1{font-size:23px;margin:0 0 6px;color:#fff}
.hero p{margin:0 0 16px;color:#cfe3d7;font-size:14px}
.hero .btn{position:relative;z-index:2}
.hero .price{font-size:13px;color:#e8d9b5;margin-top:10px}

/* ---------- 床位（值机式） ---------- */
.bed{
  background:#fff;border:1.5px solid var(--line);border-radius:var(--r);
  padding:12px 14px;margin-bottom:10px;box-shadow:var(--sh);
}
.bed.sel{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-l)}
.bed-head{display:flex;align-items:center;gap:10px;margin-bottom:9px}
.bed-no{font-size:17px;font-weight:800;color:var(--brand);min-width:52px}
.bed-state{flex:1;font-size:14px}
.bed-state b{font-size:15px}
.timeline{display:flex;gap:2px;height:22px;border-radius:6px;overflow:hidden;background:#f2f0ec}
.timeline .cell{flex:1;border-radius:2px;background:#e6e3dc;position:relative}
.timeline .cell.free{background:#cfe9da}
.timeline .cell.busy{background:#e58b8b}
.timeline .cell.past{background:#e6e3dc}
.timeline .cell.closed{background:#f0e2c0}
.timeline .cell.mine{background:var(--brand)}
.timeline .cell.sel{outline:2px solid var(--gold);outline-offset:-1px}
.axis{display:flex;justify-content:space-between;font-size:11px;color:var(--muted-l);margin-top:4px}
.legend{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin:8px 0 4px}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:4px;vertical-align:-1px}

/* ---------- 时段选择 ---------- */
.slots{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:10px}
.slot{
  border:1.5px solid var(--line);border-radius:9px;background:#fff;color:var(--text);
  padding:9px 0;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit;
}
.slot.busy{background:#f6efef;color:#c0b6b6;border-color:#efe6e6;text-decoration:line-through;pointer-events:none}
.slot.past{background:#f4f3f0;color:#c5c1ba;border-color:#eceae5;pointer-events:none}
.slot.closed{background:#fdf6e6;color:#c2a35e;border-color:#f2e6cc;pointer-events:none}
.slot.sel{background:var(--brand);color:#fff;border-color:var(--brand)}
.slot:active{transform:scale(.97)}

/* ---------- 列表 ---------- */
.list{list-style:none;margin:0;padding:0}
.list li{padding:12px 0;border-bottom:1px solid var(--line);display:flex;gap:12px;align-items:center}
.list li:last-child{border-bottom:0}
.list .li-main{flex:1;min-width:0}
.list .li-t{font-weight:600;font-size:15px}
.list .li-s{font-size:13px;color:var(--muted);margin-top:2px}

/* ---------- 券 ---------- */
.coupon{
  display:flex;border-radius:var(--r);overflow:hidden;background:#fff;
  box-shadow:var(--sh);margin-bottom:10px;border:1.5px dashed var(--gold);
}
.coupon .cp-l{background:linear-gradient(135deg,#d9bb7c,var(--gold));color:#4a3611;
  padding:14px;display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:96px}
.coupon .cp-l b{font-size:22px;line-height:1.1}
.coupon .cp-l span{font-size:11px}
.coupon .cp-r{flex:1;padding:12px 14px;min-width:0}
.coupon.used{filter:grayscale(.75);opacity:.72}
.coupon .code{font-family:ui-monospace,Consolas,monospace;font-size:13px;letter-spacing:.5px;color:var(--muted)}

/* ---------- 底部导航 ---------- */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:70;display:flex;
  background:rgba(255,255,255,.97);backdrop-filter:blur(10px);
  border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom);
}
.tabbar button{
  flex:1;border:0;background:none;padding:9px 0 8px;font-family:inherit;
  font-size:12px;color:var(--muted);cursor:pointer;display:flex;flex-direction:column;
  align-items:center;gap:2px;position:relative;
}
.tabbar button .ico{font-size:20px;line-height:1}
.tabbar button.on{color:var(--brand);font-weight:700}
.tabbar .badge{position:absolute;top:4px;right:50%;margin-right:-24px;background:var(--danger);
  color:#fff;font-size:10px;min-width:16px;height:16px;line-height:16px;border-radius:8px;padding:0 4px}

/* ---------- 弹层 ---------- */
.mask{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:100;display:flex;align-items:flex-end;justify-content:center}
.mask.center{align-items:center;padding:20px}
.sheet{background:#fff;width:100%;max-width:640px;border-radius:18px 18px 0 0;padding:18px;
  max-height:88vh;overflow:auto;animation:up .22s ease}
.mask.center .sheet{border-radius:16px;max-width:400px;animation:pop .2s ease}
@keyframes up{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
@keyframes pop{from{transform:scale(.94);opacity:.4}to{transform:none;opacity:1}}
.sheet h3{margin-top:0;display:flex;align-items:center;gap:8px}
.sheet .close{position:absolute;right:16px;top:14px;background:none;border:0;font-size:22px;color:var(--muted);cursor:pointer;line-height:1}

/* ---------- 提示条 ---------- */
.alert{border-radius:var(--r-s);padding:12px 14px;font-size:14px;margin-bottom:10px;display:flex;gap:9px;align-items:flex-start}
.alert-red{background:#fdecea;color:#9c2b1f;border:1px solid #f5c6c0}
.alert-orange{background:#fdf3e0;color:#8a5a00;border:1px solid #f3ddb4}
.alert-green{background:#eaf7ef;color:#226b42;border:1px solid #c6e6d3}
.alert .ai{font-size:18px;line-height:1.2}

/* ---------- toast ---------- */
#toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%);z-index:300;
  background:rgba(35,35,35,.94);color:#fff;padding:11px 20px;border-radius:22px;font-size:15px;
  max-width:86%;text-align:center;opacity:0;transition:.22s;pointer-events:none}
#toast.on{opacity:1;bottom:106px}

/* ---------- 体质测试 ---------- */
.q-item{background:#fff;border-radius:var(--r);padding:16px;margin-bottom:12px;box-shadow:var(--sh)}
.q-item .q-no{font-size:12px;color:var(--muted-l);font-weight:700}
.q-item .q-text{font-size:17px;font-weight:600;margin:4px 0 12px;line-height:1.5}
.q-opts{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.q-opt{border:1.5px solid var(--line);background:#fff;border-radius:10px;padding:10px 2px;
  font-size:13px;font-family:inherit;color:var(--text);cursor:pointer;line-height:1.3}
.q-opt small{display:block;font-size:10px;color:var(--muted-l)}
.q-opt.on{background:var(--brand);color:#fff;border-color:var(--brand)}
.q-opt.on small{color:#cfe3d7}
.progress{position:sticky;top:56px;z-index:50;background:var(--bg);padding:10px 0 8px;margin:-4px 0 10px}
.bar{height:8px;background:#e6e3dc;border-radius:5px;overflow:hidden}
.bar>i{display:block;height:100%;background:linear-gradient(90deg,var(--brand),#4f9a71);width:0;transition:.25s}
.bar-t{font-size:13px;color:var(--muted);margin-top:6px;display:flex;justify-content:space-between}

/* 体质结果条形 */
.score-row{display:flex;align-items:center;gap:10px;margin:9px 0;font-size:14px}
.score-row .nm{min-width:64px;font-weight:600}
.score-row .bw{flex:1;height:16px;background:#f0eeea;border-radius:8px;overflow:hidden}
.score-row .bw>i{display:block;height:100%;border-radius:8px;transition:width .6s}
.score-row .sc{min-width:38px;text-align:right;font-weight:700;font-variant-numeric:tabular-nums}

/* 选项胶囊 */
.chips{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.chip{border:1.5px solid var(--line);background:#fff;border-radius:20px;padding:8px 14px;
  font-size:14px;font-family:inherit;color:var(--text);cursor:pointer}
.chip.on{background:var(--brand-l);border-color:var(--brand);color:var(--brand-d);font-weight:600}

/* 日期条 */
.dates{display:flex;gap:8px;overflow-x:auto;padding:4px 0 8px;-webkit-overflow-scrolling:touch}
.date-btn{flex:0 0 auto;border:1.5px solid var(--line);background:#fff;border-radius:12px;
  padding:8px 13px;font-family:inherit;cursor:pointer;text-align:center;color:var(--text);min-width:62px}
.date-btn b{display:block;font-size:16px}
.date-btn small{font-size:11px;color:var(--muted)}
.date-btn.on{background:var(--brand);border-color:var(--brand);color:#fff}
.date-btn.on small{color:#cfe3d7}

/* 二维码 */
.qr-box{background:#fff;padding:14px;border-radius:12px;text-align:center;border:1px solid var(--line)}
.qr-box canvas{display:block;margin:0 auto;image-rendering:pixelated}

/* 打印 */
@media print{
  .tabbar,.topbar,.btn{display:none !important}
  body{background:#fff;padding:0}
}
@media(min-width:700px){
  .wrap{padding:20px}
}
