/* ============================================================
   云宿 · 民宿多店管理系统 — 移动端设计系统
   三个角色端共用组件，通过 body.p-client / p-merchant / p-admin 区分主题色
   ============================================================ */

:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --line: #edf0f4;
  --tx: #1c2430;
  --tx2: #67707e;
  --tx3: #9aa3b2;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(23, 43, 77, .06);
  --shadow-lg: 0 10px 30px rgba(23, 43, 77, .12);
  --green: #10b981;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --gray: #94a3b8;
  --p: #0e9285;            /* 各端主题色，body class 覆盖 */
  --p2: #15b8a2;
  --pg: linear-gradient(135deg, var(--p), var(--p2));
  --safe-b: env(safe-area-inset-bottom, 0px);
}
body.p-client   { --p: #0e9285; --p2: #21bfa4; }
body.p-merchant { --p: #2e6cf6; --p2: #5f8dff; }
body.p-admin    { --p: #4f46e5; --p2: #7b6ff0; }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--tx);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--tx); }

.app-shell { max-width: 520px; margin: 0 auto; min-height: 100vh; position: relative; background: var(--bg); }
.page { padding: 12px 14px calc(78px + var(--safe-b)); }
.ic { flex: none; vertical-align: -0.18em; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: 56px 1fr 56px; align-items: center;
  height: 50px; padding: 0 8px;
}
.topbar-title { text-align: center; font-weight: 600; font-size: 16.5px; letter-spacing: .3px; }
.topbar-side { display: flex; align-items: center; gap: 4px; }
.topbar-r { justify-content: flex-end; }
.hbtn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--tx);
}
.hbtn:active { background: rgba(0, 0, 0, .05); }
.hbtn .dot {
  position: absolute; top: 3px; right: 1px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10px; font-style: normal;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}

/* 沉浸式顶栏（叠加在渐变 hero 上） */
.topbar-hero { background: transparent; border-bottom: 0; }
.topbar-hero .topbar-title, .topbar-hero .hbtn { color: #fff; }
.topbar-hero .hbtn:active { background: rgba(255, 255, 255, .15); }
.page.has-hero { padding-top: 0; margin-top: -50px; }

/* 门店切换条（商家端顶部） */
.store-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 0 4px;
}
.store-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 13px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow);
  font-weight: 600; font-size: 13.5px; color: var(--tx);
  max-width: 78%;
}
.store-chip .ic { color: var(--p); }
.store-chip .chev { color: var(--tx3); }
.store-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-msg {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; color: var(--tx2);
}
.store-msg .dot {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10px; font-style: normal;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}

/* ---------------- 渐变头图 ---------------- */
.hero { position: relative; color: #fff; border-radius: 0 0 24px 24px; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; background: var(--pg);
}
.hero-bg::before, .hero-bg::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12);
}
.hero-bg::before { width: 220px; height: 220px; right: -70px; top: -90px; }
.hero-bg::after { width: 130px; height: 130px; left: -40px; bottom: -60px; background: rgba(255, 255, 255, .08); }
.hero-in {
  position: relative; padding: 26px 18px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.hero-title { font-size: 21px; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.hero-sub { margin-top: 5px; font-size: 12.5px; opacity: .88; }
.page.has-hero main-pad {}

/* ---------------- 数据指标卡 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.stat-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
.stat-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 14px; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -22px; top: -22px; width: 74px; height: 74px;
  border-radius: 50%; opacity: .1;
}
.tone-blue::after { background: var(--blue); } .tone-blue .stat-top { color: var(--blue); }
.tone-green::after { background: var(--green); } .tone-green .stat-top { color: var(--green); }
.tone-orange::after { background: var(--orange); } .tone-orange .stat-top { color: var(--orange); }
.tone-purple::after { background: var(--purple); } .tone-purple .stat-top { color: var(--purple); }
.tone-cyan::after { background: var(--cyan); } .tone-cyan .stat-top { color: var(--cyan); }
.tone-red::after { background: var(--red); } .tone-red .stat-top { color: var(--red); }
.tone-gray::after { background: var(--gray); } .tone-gray .stat-top { color: var(--gray); }
.stat-top { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tx2); font-weight: 500; }
.stat-val { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.stat-val small { font-size: 12px; font-weight: 500; color: var(--tx3); margin-left: 2px; }
.stat-sub { font-size: 11.5px; color: var(--tx3); margin-top: 3px; }

/* 头图内白色指标 */
.hero .stat-grid { margin-top: 0; width: 100%; }
.hero .stat-card { background: rgba(255, 255, 255, .14); box-shadow: none; backdrop-filter: blur(6px); }
.hero .stat-card, .hero .stat-top, .hero .stat-sub { color: #fff; }
.hero .stat-top { color: rgba(255, 255, 255, .85); }
.hero .stat-card::after { display: none; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 15px; margin-top: 12px;
}
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-t { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.card-t .ic { color: var(--p); }
.card-more { font-size: 12.5px; color: var(--tx3); display: inline-flex; align-items: center; gap: 2px; }
.card-pad0 { padding: 0; overflow: hidden; }

.divider { height: 1px; background: var(--line); margin: 12px 0; }

/* ---------------- 列表行 ---------------- */
.cell { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.cell:last-child { border-bottom: 0; }
.cell-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--p) 10%, white); color: var(--p);
}
.cell-main { flex: 1; min-width: 0; }
.cell-t { font-weight: 560; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cell-d { font-size: 12.5px; color: var(--tx3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-r { text-align: right; font-size: 13px; color: var(--tx2); flex: none; }
.cell-arrow { color: var(--tx3); flex: none; }

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-flex; align-items: center; height: 21px; padding: 0 8px;
  border-radius: 7px; font-size: 11px; font-weight: 600; letter-spacing: .3px;
  background: #eef1f6; color: var(--tx2); white-space: nowrap;
}
.st-free      { background: #e7f8f0; color: #0b9e63; }
.st-booked    { background: #e8f1fe; color: #2563eb; }
.st-occupied  { background: #fef3e2; color: #d97706; }
.st-cleaning  { background: #e0f5fb; color: #0891b2; }
.st-repairing { background: #f1eafd; color: #7c3aed; }
.st-disabled  { background: #eef1f5; color: #8b95a5; }

.rdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.r-free { background: var(--green); } .r-booked { background: var(--blue); }
.r-occupied { background: var(--orange); } .r-cleaning { background: var(--cyan); }
.r-repairing { background: var(--purple); } .r-disabled { background: var(--gray); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 18px; border-radius: 21px;
  font-size: 15px; font-weight: 600; letter-spacing: .3px; white-space: nowrap;
  transition: transform .06s ease, opacity .15s;
}
.btn:active { transform: scale(.97); opacity: .9; }
.btn-pri { background: var(--pg); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--p) 35%, transparent); }
.btn-ghost { background: #fff; color: var(--p); border: 1.5px solid color-mix(in srgb, var(--p) 35%, white); }
.btn-plain { background: #f1f4f8; color: var(--tx2); }
.btn-danger { background: #feecec; color: var(--red); }
.btn-warn { background: #fef3e2; color: #d97706; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 0; }

/* ---------------- 表单 ---------------- */
.field { margin-top: 13px; }
.field:first-child { margin-top: 0; }
.field label { display: block; font-size: 13px; color: var(--tx2); margin-bottom: 6px; font-weight: 500; }
.field label .req { color: var(--red); margin-left: 2px; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 0 13px; background: #fafbfd; outline: none; transition: border .15s, background .15s;
  appearance: none; min-width: 0;   /* 允许 flex/grid 中收缩（日期输入等有最小固有宽度，防止挤爆整行） */
}
textarea.input { height: auto; min-height: 80px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--p); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--p) 12%, transparent); }
.field-tip { font-size: 11.5px; color: var(--tx3); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 15px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--tx3); border-bottom: 2px solid var(--tx3);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* 开关 */
.switch { position: relative; width: 46px; height: 27px; flex: none; }
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0; border-radius: 14px; background: #dfe4ec; transition: .2s;
}
.switch i::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.switch input:checked + i { background: var(--p); }
.switch input:checked + i::after { transform: translateX(19px); }

/* ---------------- 分段筛选 ---------------- */
.seg { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button {
  flex: none; height: 32px; padding: 0 14px; border-radius: 16px;
  background: #fff; color: var(--tx2); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; border: 1px solid var(--line);
}
.seg .on { background: var(--p); color: #fff; border-color: var(--p); box-shadow: 0 4px 10px color-mix(in srgb, var(--p) 30%, transparent); }
.seg.dark { background: rgba(255,255,255,.15); border-radius: 18px; padding: 3px; }
.seg.dark a, .seg.dark button { background: transparent; border: 0; color: rgba(255,255,255,.85); }
.seg.dark .on { background: #fff; color: var(--p); }

/* ---------------- 封面占位艺术 ---------------- */
.cov { position: relative; overflow: hidden; display: flex; align-items: flex-end; color: #fff; }
.cov-1 { background: linear-gradient(135deg, #34d0b6, #0e9285 60%, #08756b); }
.cov-2 { background: linear-gradient(135deg, #6fb1fc, #3b82f6 60%, #2b6ad4); }
.cov-3 { background: linear-gradient(135deg, #ffb56b, #f59e0b 60%, #d98407); }
.cov-4 { background: linear-gradient(135deg, #63c8f1, #0ea5e9 60%, #0284c7); }
.cov-5 { background: linear-gradient(135deg, #86efac, #34c07c 60%, #1f9d63); }
.cov-6 { background: linear-gradient(135deg, #a78bfa, #7c5cf0 60%, #5b3fd6); }
.cov::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.28) 0 46px, transparent 47px),
    radial-gradient(circle at 70% 40%, rgba(255,255,255,.14) 0 22px, transparent 23px),
    radial-gradient(circle at 95% 55%, rgba(255,255,255,.12) 0 30px, transparent 31px);
}
.cov .cov-deco { position: absolute; right: 10px; bottom: 8px; opacity: .35; }

/* ---------------- 民宿列表卡（客户端） ---------------- */
.hs-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-top: 13px; display: block; }
.hs-card .cov { height: 128px; }
.hs-body { padding: 12px 14px 13px; }
.hs-name { font-size: 16.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.hs-name .lv { font-size: 10px; color: #b8860b; background: #fdf3d8; border-radius: 5px; padding: 1px 5px; font-weight: 600; }
.hs-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12.5px; color: var(--tx3); }
.hs-tags { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.hs-tag { font-size: 11px; color: var(--tx2); background: #f2f5f9; border-radius: 6px; padding: 2.5px 7px; }
.hs-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.hs-price { color: #e2574c; font-weight: 700; font-size: 17px; }
.hs-price small { font-size: 11.5px; color: var(--tx3); font-weight: 400; }
.rate { color: #f59e0b; font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }

/* ---------------- 房间卡（商家端房态） ---------------- */
.room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.room-card {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 12px 13px; border-left: 4px solid var(--gray); position: relative;
}
.room-card.st-free { border-left-color: var(--green); }
.room-card.st-booked { border-left-color: var(--blue); }
.room-card.st-occupied { border-left-color: var(--orange); }
.room-card.st-cleaning { border-left-color: var(--cyan); }
.room-card.st-repairing { border-left-color: var(--purple); }
.room-card.st-disabled { border-left-color: var(--gray); opacity: .7; }
.room-no { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.room-type { font-size: 12px; color: var(--tx3); margin-top: 2px; }
.room-price { font-size: 14px; font-weight: 650; margin-top: 7px; color: #e2574c; }
.room-note { font-size: 11px; color: var(--tx3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-ops { display: flex; gap: 6px; margin-top: 9px; }
.chip-btn {
  flex: 1; height: 27px; border-radius: 8px; background: #f1f4f8; color: var(--tx2);
  font-size: 11.5px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
}
.chip-btn:active { background: #e6ebf2; }
.chip-btn.hl { background: color-mix(in srgb, var(--p) 12%, white); color: var(--p); }

/* 图例 */
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--tx2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------- 订单卡 ---------------- */
.order-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 12px; overflow: hidden; }
.order-top { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--tx3); }
.order-top .ono { font-weight: 600; color: var(--tx2); }
.order-main { display: flex; gap: 12px; padding: 13px 14px; }
.order-cov { width: 78px; height: 78px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.9); }
.order-info { flex: 1; min-width: 0; }
.order-t { font-weight: 640; font-size: 15.5px; }
.order-d { font-size: 12.5px; color: var(--tx2); margin-top: 4px; }
.order-d b { color: var(--tx); font-weight: 600; }
.order-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); }
.order-amt { font-size: 15px; font-weight: 700; color: #e2574c; }
.order-amt small { color: var(--tx3); font-weight: 400; font-size: 11.5px; }
.order-ops { display: flex; gap: 7px; }

/* ---------------- 快捷入口 ---------------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 2px; margin-top: 4px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 11px 2px; border-radius: 12px; font-size: 12px; color: var(--tx2); font-weight: 500;
}
.quick:active { background: #f2f5f9; }
.quick .qic {
  width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--p) 10%, white); color: var(--p);
}
.quick.alt1 .qic { background: #e7f8f0; color: #0b9e63; }
.quick.alt2 .qic { background: #e8f1fe; color: #2563eb; }
.quick.alt3 .qic { background: #fef3e2; color: #d97706; }
.quick.alt4 .qic { background: #f1eafd; color: #7c3aed; }
.quick.alt5 .qic { background: #e0f5fb; color: #0891b2; }

/* ---------------- 消息 / 公告 ---------------- */
.msg-item { display: flex; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.msg-item:last-child { border-bottom: 0; }
.msg-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: #eef4ff; color: #2563eb; }
.msg-ic.warn { background: #fef3e2; color: #d97706; }
.msg-ic.ok { background: #e7f8f0; color: #0b9e63; }
.msg-main { flex: 1; min-width: 0; }
.msg-t { font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.msg-t .dot { width: 7px; height: 7px; background: var(--red); border-radius: 50%; flex: none; }
.msg-c { font-size: 12.5px; color: var(--tx2); margin-top: 2px; }
.msg-time { font-size: 11px; color: var(--tx3); margin-top: 3px; }

/* ---------------- 日历 ---------------- */
.cal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px; margin-top: 12px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; font-weight: 650; font-size: 15px; margin-bottom: 9px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px 2px; text-align: center; }
.cal-w { font-size: 11px; color: var(--tx3); padding: 4px 0; }
.cal-d { position: relative; height: 40px; border-radius: 9px; font-size: 12.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--tx2); }
.cal-d .p { font-size: 9.5px; color: #e2574c; font-weight: 600; line-height: 1; margin-top: 1px; }
.cal-d.off { color: #cfd5de; pointer-events: none; }
.cal-d.sel { background: var(--p); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--p) 35%, transparent); }
.cal-d.sel .p { color: rgba(255,255,255,.9); }
.cal-d.mid { background: color-mix(in srgb, var(--p) 10%, white); color: var(--p); }
.cal-d.full::after { content: "满"; position: absolute; right: 3px; top: 2px; font-size: 8.5px; color: #c3c9d3; }

/* ---------------- 底部标签栏 ---------------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 60;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar-in { display: flex; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2.5px; padding: 7px 0 6px; color: var(--tx3); position: relative; }
.tab .tlabel { font-size: 10.5px; font-weight: 500; }
.tab.on { color: var(--p); }
.tab.on .tlabel { font-weight: 650; }
.tab:active { opacity: .8; }

/* ---------------- 底部弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
.sheet-mask[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 520px; background: #fff;
  border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + var(--safe-b));
  max-height: 78vh; overflow-y: auto; animation: up .22s cubic-bezier(.2,.8,.3,1);
}
.sheet-title { text-align: center; font-weight: 650; font-size: 15.5px; margin-bottom: 12px; }
.sheet-item {
  display: flex; align-items: center; gap: 10px; padding: 13px 6px;
  border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.sheet-item:last-of-type { border-bottom: 0; }
.sheet-item.on { color: var(--p); font-weight: 650; }
.sheet-code {
  font-size: 10.5px; background: #f1f4f8; color: var(--tx3); border-radius: 5px; padding: 2px 6px; font-weight: 600;
}
.sheet-item .ok { color: var(--p); }
.sheet-cancel {
  width: 100%; height: 44px; margin-top: 10px; border-radius: 22px;
  background: #f1f4f8; color: var(--tx2); font-size: 15px; font-weight: 550;
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40%); opacity: .4; } }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center; padding: 30px;
  animation: fade .18s ease;
}
.modal {
  width: 100%; max-width: 340px; background: #fff; border-radius: 18px;
  padding: 22px 20px 18px; text-align: center; animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
}
.modal-m { font-size: 15.5px; font-weight: 600; }
.modal-d { font-size: 13px; color: var(--tx2); margin-top: 7px; }
.modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.modal-btns .btn { flex: 1; height: 40px; }
@keyframes pop { from { transform: scale(.86); opacity: 0; } }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%);
  background: rgba(23, 32, 48, .88); color: #fff; font-size: 13.5px;
  padding: 11px 18px; border-radius: 12px; z-index: 200;
  display: flex; align-items: center; gap: 8px; max-width: 80vw;
  animation: pop .2s ease; pointer-events: none;
}
.toast.ok .ic { color: #34d399; } .toast.err .ic { color: #f87171; }
.fl-toast { display: none; }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 44px 0 38px; color: var(--tx3); }
.empty .ic { opacity: .4; }
.empty p { font-size: 13px; margin-top: 8px; }

/* ---------------- 登录页 ---------------- */
.login-hero { padding: 46px 0 26px; text-align: center; color: #fff; position: relative; }
.login-logo {
  width: 74px; height: 74px; margin: 0 auto; border-radius: 22px;
  background: rgba(255, 255, 255, .18); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35);
}
.login-title { font-size: 22px; font-weight: 700; margin-top: 14px; letter-spacing: 1px; }
.login-sub { font-size: 12.5px; opacity: .85; margin-top: 4px; }
.login-body { margin-top: -18px; padding: 0 22px 30px; position: relative; }
.demo-acc {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1.5px dashed color-mix(in srgb, var(--p) 30%, white); border-radius: 14px;
  margin-top: 12px; background: color-mix(in srgb, var(--p) 4%, white);
}
.demo-acc .da-ic { width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--p) 12%, white); color: var(--p); display: flex; align-items: center; justify-content: center; flex: none; }
.demo-acc b { font-size: 13.5px; }
.demo-acc span { display: block; font-size: 11.5px; color: var(--tx3); }
.demo-acc .btn { margin-left: auto; }

/* ---------------- 支付页 ---------------- */
.pay-amt { text-align: center; padding: 26px 0 8px; }
.pay-amt .n { font-size: 40px; font-weight: 750; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.pay-amt .l { color: var(--tx3); font-size: 13px; margin-top: 4px; }
.pay-ch { display: flex; align-items: center; gap: 12px; padding: 14px 4px; }
.pay-ch .wx-ic { width: 42px; height: 42px; border-radius: 12px; background: #e8f8ee; color: #07c160; display: flex; align-items: center; justify-content: center; flex: none; }
.pay-ok-ic { width: 74px; height: 74px; margin: 26px auto 0; border-radius: 50%; background: #e7f8f0; color: #0b9e63; display: flex; align-items: center; justify-content: center; animation: pop .3s cubic-bezier(.2,.9,.3,1.3); }

/* ---------------- NFC 扫描动画 ---------------- */
.scan-wrap { text-align: center; padding: 10px 0 4px; }
.scan-ring {
  width: 168px; height: 168px; margin: 0 auto; border-radius: 50%; position: relative;
  display: flex; align-items: center; justify-content: center; color: var(--p);
}
.scan-ring::before, .scan-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--p) 55%, white);
  animation: ripple 1.8s ease-out infinite;
}
.scan-ring::after { animation-delay: .9s; }
@keyframes ripple { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.scan-card {
  width: 112px; height: 74px; border-radius: 12px; background: var(--pg);
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--p) 40%, transparent);
  animation: cardfloat 2.2s ease-in-out infinite;
}
@keyframes cardfloat { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(6px); } }
.scan-tip { font-size: 14px; font-weight: 600; margin-top: 16px; }
.scan-sub { font-size: 12px; color: var(--tx3); margin-top: 4px; }

/* ---------------- 步骤条 / 时间线 ---------------- */
.steps { display: flex; align-items: center; margin: 4px 0 2px; }
.step { flex: 1; text-align: center; font-size: 11px; color: var(--tx3); position: relative; }
.step .s-dot {
  width: 22px; height: 22px; border-radius: 50%; background: #eef1f6; color: var(--tx3);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 5px; font-size: 11px; font-weight: 650;
}
.step.on { color: var(--p); font-weight: 600; }
.step.on .s-dot { background: var(--pg); color: #fff; }
.step::before, .step::after {
  content: ""; position: absolute; top: 11px; height: 2px; background: #eef1f6; width: calc(50% - 16px);
}
.step::before { left: 0; } .step::after { right: 0; }
.step:first-child::before, .step:first-child::after { display: none; }
.step.on::before, .step.on::after { background: color-mix(in srgb, var(--p) 40%, white); }

/* ---------------- 表格（报表） ---------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; color: var(--tx3); font-weight: 550; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; }
.tbl-scroll { overflow-x: auto; }

/* 条形图 */
.bars { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: 76px 1fr 64px; align-items: center; gap: 9px; font-size: 12.5px; }
.bar-track { height: 9px; border-radius: 5px; background: #eef1f6; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: var(--pg); }
.bar-val { text-align: right; color: var(--tx2); font-variant-numeric: tabular-nums; }

/* ---------------- 简报行 ---------------- */
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--tx2); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- 二维码 ---------------- */
.qr { display: inline-flex; padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.qr img, .qr canvas { width: var(--qrs, 180px); height: var(--qrs, 180px); image-rendering: pixelated; }

/* ---------------- 证件信息卡 ---------------- */
.idcard-show {
  border: 1.5px solid color-mix(in srgb, var(--p) 25%, white); background: color-mix(in srgb, var(--p) 5%, white);
  border-radius: 13px; padding: 11px 13px; margin-top: 9px;
}
.idcard-show .nm { font-weight: 650; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; }
.idcard-show .no { font-size: 12.5px; color: var(--tx2); margin-top: 2px; letter-spacing: .5px; }
.idcard-show .src { font-size: 10.5px; color: var(--p); background: color-mix(in srgb, var(--p) 12%, white); padding: 1.5px 6px; border-radius: 5px; font-weight: 600; }
.risk-tip { background: #feecec; color: #c0392b; border-radius: 12px; padding: 10px 13px; font-size: 12.5px; margin-top: 9px; display: flex; gap: 7px; align-items: flex-start; }

/* ---------------- 小票打印 ---------------- */
@media print {
  body * { visibility: hidden; }
  #receipt, #receipt * { visibility: visible; }
  #receipt { position: fixed; inset: 0; margin: 0; width: 100%; box-shadow: none; border-radius: 0; }
}
.receipt {
  background: #fff; border-radius: 12px; padding: 16px; font-size: 12px;
  border: 1px dashed #d7dce4; font-family: "Courier New", monospace; line-height: 1.7;
}
.receipt h4 { text-align: center; font-size: 15px; margin-bottom: 4px; }
.receipt .rc-line { border-top: 1px dashed #c9cfd9; margin: 7px 0; }

/* ---------------- 其他 ---------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 0 6px; font-size: 13px; color: var(--tx3); }
.pager a { color: var(--p); font-weight: 550; padding: 6px 10px; }
.pcur { font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: #f1f4f8; font-size: 12px; color: var(--tx2); font-weight: 500; }
.chip.hl { background: color-mix(in srgb, var(--p) 12%, white); color: var(--p); }

.banner {
  border-radius: 14px; padding: 12px 14px; font-size: 13px;
  background: linear-gradient(135deg, #fff7ea, #fdefd8); color: #a16207;
  display: flex; gap: 8px; align-items: flex-start; margin-top: 12px;
}
.banner.blue { background: linear-gradient(135deg, #eef5ff, #e3eeff); color: #1d4ed8; }

.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.row-flex { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.t-red { color: var(--red); } .t-green { color: #0b9e63; } .t-gray { color: var(--tx3); }
.t-bold { font-weight: 650; }
.fs12 { font-size: 12px; } .fs13 { font-size: 13px; }
.center { text-align: center; }

/* 头像 */
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: var(--pg); color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.avatar.lg { width: 62px; height: 62px; font-size: 24px; }

/* 会员卡 */
.member-card {
  border-radius: 16px; padding: 14px 16px; color: #fff;
  background: linear-gradient(120deg, #3f3a55, #2c2840 65%);
  display: flex; align-items: center; justify-content: space-between; position: relative; overflow: hidden;
}
.member-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.member-card .mc-lv { font-size: 17px; font-weight: 700; }
.member-card .mc-sub { font-size: 11.5px; opacity: .8; margin-top: 3px; }
.member-card .mc-ic { opacity: .9; }

/* 服务宫格（客户端服务页） */
.srv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 4px; }
.srv { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 11.5px; color: var(--tx2); }
.srv .qic { width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center; }

/* 入住凭证 */
.voucher {
  background: linear-gradient(135deg, #223047, #1a2536); color: #fff;
  border-radius: 18px; padding: 18px; position: relative; overflow: hidden;
}
.voucher::after {
  content: ""; position: absolute; right: -34px; bottom: -34px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(255, 255, 255, .06);
}
.voucher .v-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.voucher .v-row .k { opacity: .65; }
.voucher .v-code { font-size: 11px; opacity: .55; letter-spacing: 1px; }
.voucher .qr { margin: 14px auto 2px; display: flex; }
.v-perf { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); top: 58%; }
.v-perf.l { left: -8px; } .v-perf.r { right: -8px; }

/* 进度提示条 */
.steps-mini { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--tx3); }
.steps-mini i { width: 16px; height: 3px; border-radius: 2px; background: #e6eaf0; }
.steps-mini i.on { background: var(--p); }

/* ---------------- 布局加固（长文本 / 多按钮防溢出歪斜） ---------------- */
.kv { flex-wrap: wrap; row-gap: 2px; }
.kv .k { flex: 0 1 auto; min-width: 0; }
.kv .v { max-width: 66%; text-align: right; word-break: break-word; }
.order-top { flex-wrap: wrap; row-gap: 4px; }
.order-foot { flex-wrap: wrap; row-gap: 8px; }
.order-ops { flex-wrap: wrap; justify-content: flex-end; }
.order-ops > form { display: inline-flex; }
.cell-t { min-width: 0; }
.msg-t { flex-wrap: wrap; }
.topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-val { word-break: break-word; }
.bar-row { grid-template-columns: minmax(56px, 88px) 1fr minmax(56px, auto); }
.bar-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idcard-show .nm { flex-wrap: wrap; gap: 6px; }
.idcard-show .src { white-space: nowrap; }
.legend span { white-space: nowrap; }
.receipt { word-break: break-word; }
.voucher .v-row { gap: 10px; }
.voucher .v-row > span:last-child { text-align: right; word-break: break-word; }
.cal-d { overflow: hidden; }