/* ============================================================
   实验室设备预约系统 · iOS Liquid Glass 设计系统
   材质：磨砂玻璃(backdrop-filter) + 高光边缘 + 弥散彩光环境
   动效：弹簧曲线 + 视觉连续性(过渡/滑入/按压回弹)
   ============================================================ */

:root {
  /* —— 材质 —— */
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .74);
  --glass-thin: rgba(255, 255, 255, .38);
  --glass-dark: rgba(28, 30, 38, .34);
  --glass-border: rgba(255, 255, 255, .70);
  --glass-inner: rgba(255, 255, 255, .85);
  --blur: 26px;
  --blur-sm: 16px;

  /* —— 色板（iOS 系统色） —— */
  --blue: #0a84ff;
  --blue-deep: #0060df;
  --indigo: #5e5ce6;
  --mint: #30d158;
  --green: #34c759;
  --orange: #ff9f0a;
  --red: #ff375f;
  --teal: #64d2ff;
  --purple: #bf5af2;
  --ink: #16212e;
  --ink-2: #4a5866;
  --ink-3: #8a97a5;
  --line: rgba(120, 140, 170, .18);

  /* —— 圆角 / 阴影 —— */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow-1: 0 10px 34px rgba(30, 50, 90, .13), 0 2px 8px rgba(30, 50, 90, .08);
  --shadow-2: 0 18px 60px rgba(30, 50, 90, .20), 0 4px 14px rgba(30, 50, 90, .10);
  --spec: inset 0 1px 0 var(--glass-inner), inset 0 0 0 1px rgba(255, 255, 255, .28);

  /* —— 动效 —— */
  --spring: cubic-bezier(.34, 1.46, .48, 1);
  --apple: cubic-bezier(.32, .72, 0, 1);
  --t-fast: .22s;
  --t-mid: .38s;
  --t-slow: .6s;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
  /* 静态环境背景：底色渐变 + 四点弥散色斑（原 .blob 动画的静态化）。
     全部画进 body 背景：零 DOM、零动画、零逐帧成本，滚动帧率最优。 */
  background:
    radial-gradient(46vw 46vw at 4vw 6vh, rgba(122,184,255,.42), rgba(122,184,255,0) 68%),
    radial-gradient(40vw 40vw at 96vw 18vh, rgba(183,157,255,.38), rgba(183,157,255,0) 68%),
    radial-gradient(42vw 42vw at 14vw 96vh, rgba(134,230,200,.34), rgba(134,230,200,0) 68%),
    radial-gradient(30vw 30vw at 88vw 88vh, rgba(255,199,224,.32), rgba(255,199,224,0) 68%),
    linear-gradient(180deg, #eaf2ff 0%, #f5f7fc 40%, #eef0fa 100%);
  background-attachment: fixed;
}

/* ================= 玻璃材质组件 =================
   性能策略：backdrop-filter 在无 GPU 加速的环境下是每帧全量重算，
   常驻元素（导航/卡片/列表）一律用高透明度平面玻璃 + 高光边缘；
   真模糊只保留在瞬时元素（模态抽屉/Toast/庆祝层），打开时才付成本。 */
.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .70));
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-1), var(--spec);
}
.glass-strong {
  background: linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .84));
}
.glass-thin {
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 4px 18px rgba(30, 50, 90, .07), var(--spec);
}

/* ================= 顶栏 ================= */
.navbar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(680px, calc(100% - 24px)); z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .78));
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--shadow-1), var(--spec);
  animation: navIn .55s var(--spring) both;
}
@keyframes navIn { from { opacity: 0; transform: translateX(-50%) translateY(-18px); } }
.nav-left, .nav-right { display: flex; align-items: center; gap: 8px; }
.nav-title { font-size: 17px; font-weight: 700; letter-spacing: .2px; padding: 0 4px; }
.nav-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; color: var(--ink);
  background: var(--glass-thin); box-shadow: var(--spec);
  transition: transform var(--t-fast) var(--spring), background var(--t-fast);
}
.nav-btn:active { transform: scale(.88); }
.nav-btn svg { width: 19px; height: 19px; }
.nav-chip {
  font-size: 11px; font-weight: 700; color: #fff; padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--indigo), var(--blue));
  box-shadow: 0 3px 10px rgba(94, 92, 230, .35);
}
.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  box-shadow: 0 3px 12px rgba(10, 132, 255, .4);
  transition: transform var(--t-fast) var(--spring);
}
.nav-avatar:active { transform: scale(.9); }

/* ================= 页面容器与过渡 ================= */
.app {
  width: min(680px, calc(100% - 24px));
  margin: 0 auto;
  padding: 86px 0 120px;
  min-height: 100vh;
}
.page { animation: pageIn .4s var(--apple) both; }
.page.leaving { animation: pageOut .18s var(--apple) both; }
.page-with-action { padding-bottom: 190px; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes pageOut { to { opacity: 0; transform: translateY(-8px) scale(.99); } }

.stagger > * { animation: itemIn .42s var(--spring) both; animation-delay: calc(var(--i, 0) * 26ms); }
@keyframes itemIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ================= 卡片 ================= */
.card {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  padding: 18px;
  /* 性能：内容卡片用"平面半透明玻璃"（无 backdrop-filter）——
     30+ 张卡片逐卡实时模糊会让背景动画期间整页重滤波掉帧；
     iOS 同策略：列表平面半透明，仅工具栏/弹窗保留真模糊（见 .navbar/.tabbar/.sheet） */
  background: linear-gradient(135deg, rgba(255,255,255,.80), rgba(255,255,255,.62));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-1), var(--spec);
  transition: transform var(--t-mid) var(--spring), box-shadow var(--t-mid);
}
.card.pressable { cursor: pointer; }
.card.pressable:hover { transform: translateY(-3px); box-shadow: var(--shadow-2), var(--spec); }
.card.pressable:active { transform: scale(.975); transition-duration: var(--t-fast); }
/* 液态高光：跟随鼠标的径向流光 */
.card.lux::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 20%),
              rgba(255, 255, 255, .55), transparent 65%);
  opacity: 0; transition: opacity .35s;
}
.card.lux:hover::before { opacity: 1; }

/* ================= 按钮 ================= */
.btn {
  position: relative; overflow: hidden; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 700 15px/1 inherit; color: #fff;
  padding: 13px 22px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  box-shadow: 0 8px 22px rgba(10, 132, 255, .38), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform var(--t-fast) var(--spring), box-shadow var(--t-fast), filter var(--t-fast);
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(10, 132, 255, .48); }
.btn:active { transform: scale(.95); }
.btn::after {   /* 液态流光扫过 */
  content: ''; position: absolute; top: 0; bottom: 0; width: 46%;
  left: -60%; transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transition: left .7s var(--apple);
}
.btn:hover::after { left: 130%; }
.btn.ghost {
  color: var(--ink); background: var(--glass-thin);
  border: 1px solid rgba(255,255,255,.6); box-shadow: var(--spec);
}
.btn.danger { background: linear-gradient(135deg, #ff5f7a, var(--red)); box-shadow: 0 8px 22px rgba(255, 55, 95, .35), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.mint { background: linear-gradient(135deg, #38d47f, var(--mint)); box-shadow: 0 8px 22px rgba(48, 209, 88, .35), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.sm { padding: 9px 16px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ================= 徽章 / 状态胶囊 ================= */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: var(--glass-thin); color: var(--ink-2);
  border: 1px solid rgba(255,255,255,.55); box-shadow: var(--spec);
}
.chip.blue { color: var(--blue-deep); background: rgba(10, 132, 255, .13); }
.chip.green { color: #1d9a4d; background: rgba(48, 209, 88, .15); }
.chip.orange { color: #c76a00; background: rgba(255, 159, 10, .16); }
.chip.red { color: #d81b4c; background: rgba(255, 55, 95, .13); }
.chip.purple { color: #8b3fd1; background: rgba(191, 90, 242, .14); }

/* ================= 底部标签栏 ================= */
.tabbar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 70; display: flex; align-items: center; gap: 2px;
  padding: 7px 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .84));
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--shadow-2), var(--spec);
  animation: navIn .55s var(--spring) both .1s;
}
/* 液态玻璃（真背景模糊）：唯一的常驻模糊元素。
   体量 ≈ 66px 高 × 栏宽，远小于此前被移除的 30+ 卡片；成本实测见提交说明。
   @supports 保护：不支持 backdrop-filter 的环境回退为上面的高不透明平面玻璃。 */
@supports ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .tabbar {
    background: linear-gradient(135deg, rgba(255, 255, 255, .46), rgba(255, 255, 255, .28));
    -webkit-backdrop-filter: blur(18px) saturate(1.85);
    backdrop-filter: blur(18px) saturate(1.85);
    border-color: rgba(255, 255, 255, .55);
    transition: background .22s var(--apple);
    box-shadow:
      0 14px 34px rgba(30, 50, 90, .24),
      0 4px 10px rgba(30, 50, 90, .10),
      inset 0 1px 0 rgba(255, 255, 255, .92),        /* 顶部镜面棱线 */
      inset 0 -1px 1px rgba(255, 255, 255, .35),     /* 底部反光 */
      inset 1px 0 0 rgba(255, 255, 255, .38),        /* 左右棱面 */
      inset -1px 0 0 rgba(255, 255, 255, .38),
      inset 0 0 22px rgba(10, 132, 255, .05);        /* 内部微弱冷色环境色 */
  }
  /* 滚动中（app.js 加 .tabbar-flat）：平面材质，撤掉每帧重算的背景模糊。
     亮度取玻璃态观感的等效值，避免两种材质切换时明暗跳变。 */
  .tabbar.tabbar-flat {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, .80), rgba(255, 255, 255, .68));
  }
  /* 玻璃内部液态光感：顶部聚光 + 斜向流光带（静态图层，无逐帧成本） */
  .tabbar::before {
    content: ''; position: absolute; inset: 0; z-index: 3;
    border-radius: inherit; pointer-events: none;
    background:
      radial-gradient(130% 90% at 50% -30%, rgba(255, 255, 255, .50), rgba(255, 255, 255, 0) 55%),
      linear-gradient(115deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .05) 24%,
                      rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, .05) 74%,
                      rgba(255, 255, 255, .22) 100%);
  }
}
.tab {
  position: relative; z-index: 2; text-decoration: none; color: var(--ink-3);
  width: 66px; height: 52px; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 700;
  transition: color var(--t-mid) var(--apple), transform var(--t-fast) var(--spring);
}
.tab svg { width: 21px; height: 21px; filter: drop-shadow(0 1px 1px rgba(255,255,255,.85)); }
.tab:active { transform: scale(.9); }
.tab.active { color: var(--blue-deep); }
.tab-indicator {
  position: absolute; z-index: 1; top: 7px; bottom: 7px;
  width: 66px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(10,132,255,.26), rgba(94,92,230,.22));
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92), inset 0 -2px 6px rgba(10,132,255,.10),
              0 4px 14px rgba(10,132,255,.24);
  transition: left var(--t-slow) var(--spring), width var(--t-slow) var(--spring);
}
.tab-fab {
  position: relative; z-index: 2; cursor: pointer; border: none;
  margin: 0 4px; width: 58px; height: 58px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: #fff; font-size: 10px; font-weight: 800;
  background: linear-gradient(135deg, var(--blue) 0%, var(--indigo) 100%);
  box-shadow: 0 10px 26px rgba(10, 132, 255, .5), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -6px 12px rgba(0,0,0,.12);
  transition: transform var(--t-mid) var(--spring);
}
.tab-fab svg { width: 22px; height: 22px; }
.tab-fab:active { transform: scale(.9) rotate(-4deg); }
.msg-dot {
  position: absolute; top: 8px; right: 16px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2.5px rgba(255,255,255,.9);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.5); opacity: .7; } }

/* ================= 通用布局 ================= */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.h1 { font-size: 24px; font-weight: 800; letter-spacing: .3px; }
.h2 { font-size: 17px; font-weight: 800; }
.sec-title { margin: 20px 4px 10px; font-size: 13px; font-weight: 800; color: var(--ink-3); letter-spacing: 1px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }

/* ================= 登录页 ================= */
.login-wrap { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.login-card { width: min(420px, 100%); padding: 34px 30px; }
.login-logo {
  width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 24px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--blue) 55%, var(--indigo));
  box-shadow: 0 14px 34px rgba(10, 132, 255, .4), inset 0 1px 0 rgba(255,255,255,.5);
  animation: logoFloat 4s ease-in-out infinite;
}
.login-logo svg { width: 40px; height: 40px; }
@keyframes logoFloat { 50% { transform: translateY(-7px) rotate(2deg); } }
.login-sub { text-align: center; color: var(--ink-3); font-size: 13px; margin-bottom: 22px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin: 0 0 6px 4px; }
.field input, .field select, .field textarea {
  width: 100%; font: 500 15px/1.4 inherit; color: var(--ink);
  padding: 13px 16px; border-radius: var(--r-md);
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--spec);
  outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(10,132,255,.6);
  box-shadow: 0 0 0 4px rgba(10,132,255,.14), var(--spec);
}
.demo-accounts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.demo-accounts .chip { cursor: pointer; transition: transform var(--t-fast) var(--spring); }
.demo-accounts .chip:hover { transform: translateY(-2px); }
.redirect-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-radius: var(--r-md); margin-bottom: 16px;
  background: rgba(255, 159, 10, .14); border: 1px solid rgba(255,159,10,.35);
  color: #9a5b00; font-size: 13px; font-weight: 600;
  animation: itemIn .4s var(--spring) both;
}

/* ================= 设备列表 ================= */
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.dev-icon {
  width: 46px; height: 46px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, rgba(100,210,255,.35), rgba(10,132,255,.18));
  border: 1px solid rgba(255,255,255,.6); box-shadow: var(--spec);
}
.dev-no { font-size: 11px; font-weight: 800; color: var(--blue-deep); letter-spacing: .5px; }
.dev-name { font-size: 14.5px; font-weight: 800; line-height: 1.3; margin: 3px 0; }
.free-n { font-size: 11.5px; font-weight: 700; color: #1d9a4d; }

/* 搜索与筛选 */
.searchbar {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 16px; border-radius: 999px; margin-bottom: 14px;
}
.searchbar input {
  flex: 1; border: none; outline: none; background: transparent;
  font: 500 14.5px/1 inherit; color: var(--ink);
}
.filter-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 10px; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; cursor: pointer; font-size: 12.5px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; color: var(--ink-2);
  background: var(--glass-thin); border: 1px solid rgba(255,255,255,.5); box-shadow: var(--spec);
  transition: all var(--t-fast) var(--spring);
}
.fchip.active { color: #fff; background: linear-gradient(135deg, var(--blue), var(--indigo)); box-shadow: 0 5px 14px rgba(10,132,255,.35); }

/* ================= 扫码 FAB 弹出按钮 ================= */
.scan-sheet-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }

/* ================= 设备详情 ================= */
.hero-card { padding: 22px; }
.hero-emoji {
  width: 62px; height: 62px; border-radius: 20px; font-size: 30px;
  display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  box-shadow: 0 10px 24px rgba(10,132,255,.35), inset 0 1px 0 rgba(255,255,255,.5);
}
.meta-line { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-pill {
  flex: none; cursor: pointer; text-align: center; min-width: 62px;
  padding: 9px 10px; border-radius: 18px; border: 1px solid rgba(255,255,255,.55);
  background: var(--glass-thin); box-shadow: var(--spec);
  transition: all var(--t-fast) var(--spring); color: var(--ink-2);
}
.date-pill .dow { font-size: 11px; font-weight: 800; opacity: .8; }
.date-pill .dom { font-size: 16px; font-weight: 900; }
.date-pill.active { color: #fff; background: linear-gradient(135deg, var(--blue), var(--indigo)); border-color: transparent; box-shadow: 0 6px 16px rgba(10,132,255,.4); }
.date-pill.banned { opacity: .5; }

/* 时段网格 */
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot {
  position: relative; cursor: pointer; text-align: center;
  padding: 10px 4px 8px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.6);
  background: rgba(255,255,255,.5); box-shadow: var(--spec);
  transition: all var(--t-fast) var(--spring);
}
.slot .t { font-size: 12.5px; font-weight: 800; }
.slot .s { font-size: 9.5px; font-weight: 700; margin-top: 2px; color: var(--ink-3); }
.slot:hover { transform: translateY(-2px); }
.slot:active { transform: scale(.92); }
.slot.ok { color: var(--ink); }
.slot.ok .s { color: #1d9a4d; }
.slot.full { opacity: .45; cursor: not-allowed; }
.slot.full .s { color: var(--red); }
.slot.banned { opacity: .4; cursor: not-allowed; background: repeating-linear-gradient(45deg, rgba(255,120,120,.12) 0 6px, rgba(255,255,255,.4) 6px 12px); }
.slot.banned .s { color: #c76a00; }
.slot.mine { background: linear-gradient(135deg, rgba(10,132,255,.16), rgba(94,92,230,.14)); border-color: rgba(10,132,255,.5); }
.slot.mine .s { color: var(--blue-deep); }
.slot.selected { background: linear-gradient(135deg, var(--blue), var(--indigo)); color: #fff; border-color: transparent; transform: scale(1.05); box-shadow: 0 8px 20px rgba(10,132,255,.4); }
.slot.selected .s { color: rgba(255,255,255,.85); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 4px; vertical-align: -1px; }

/* 详情底部操作条 */
.action-bar {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  width: min(648px, calc(100% - 24px)); z-index: 55;
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px;
  animation: slideUp .45s var(--spring) both;
}
@keyframes slideUp { from { opacity: 0; transform: translateX(-50%) translateY(26px); } }

/* ================= 预约卡 ================= */
.bk-card { display: flex; gap: 13px; align-items: center; }
.bk-time {
  flex: none; text-align: center; min-width: 74px; padding: 8px 6px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(10,132,255,.14), rgba(94,92,230,.12));
  border: 1px solid rgba(10,132,255,.28);
}
.bk-time .d { font-size: 11px; font-weight: 800; color: var(--blue-deep); }
.bk-time .t { font-size: 15px; font-weight: 900; }
.bk-actions { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }

/* 分段控制器 */
.seg { position: relative; display: flex; padding: 5px; border-radius: 999px; margin-bottom: 14px; }
.seg-thumb {
  position: absolute; top: 5px; bottom: 5px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  box-shadow: 0 5px 14px rgba(10,132,255,.35), inset 0 1px 0 rgba(255,255,255,.4);
  transition: left var(--t-slow) var(--spring), width var(--t-slow) var(--spring);
}
.seg button {
  position: relative; z-index: 2; flex: 1; border: none; background: none; cursor: pointer;
  font: 700 13.5px/1 inherit; color: var(--ink-3); padding: 11px 0; border-radius: 999px;
  transition: color var(--t-mid);
}
.seg button.active { color: #fff; }

/* ================= 消息 ================= */
.msg-icon {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 19px;
  background: var(--glass-thin); border: 1px solid rgba(255,255,255,.6); box-shadow: var(--spec);
}
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); flex: none; box-shadow: 0 0 0 3px rgba(255,55,95,.15); }

/* ================= 我的 / 信用 ================= */
.me-hero { padding: 24px; text-align: center; }
.avatar-xl {
  width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-size: 32px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  box-shadow: 0 14px 34px rgba(10,132,255,.4), inset 0 1px 0 rgba(255,255,255,.5);
}
.ring-wrap { position: relative; width: 132px; margin: 6px auto 2px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-val { position: absolute; inset: 0; display: grid; place-items: center; }
.ring-val b { font-size: 30px; font-weight: 900; }
.ring-val span { font-size: 10.5px; color: var(--ink-3); }
.tl { position: relative; margin-left: 8px; padding-left: 18px; }
.tl::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(var(--blue), transparent); opacity: .35; }
.tl-item { position: relative; padding: 7px 0; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 14px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,132,255,.18);
}
.tl-item.minus::before { background: var(--orange); box-shadow: 0 0 0 3px rgba(255,159,10,.18); }

/* ================= 管理端 ================= */
.admin-wrap { width: min(1080px, calc(100% - 24px)); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.kpi { padding: 18px; text-align: left; }
.kpi .v { font-size: 27px; font-weight: 900; letter-spacing: -.5px; }
.kpi .l { font-size: 12px; color: var(--ink-3); font-weight: 700; margin-top: 2px; }
.kpi .v em { font-style: normal; font-size: 13px; color: var(--ink-3); font-weight: 700; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.htable { width: 100%; border-collapse: collapse; font-size: 13px; }
.htable th { text-align: left; font-size: 11.5px; letter-spacing: .5px; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.htable td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.htable tr:last-child td { border-bottom: none; }
.htable tr { transition: background var(--t-fast); }
.htable tbody tr:hover { background: rgba(255,255,255,.5); }

/* 热力图 */
.heat { display: grid; grid-template-columns: 34px repeat(14, 1fr); gap: 3px; font-size: 10px; color: var(--ink-3); }
.heat .cell { height: 21px; border-radius: 5px; background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); transition: transform var(--t-fast) var(--spring); cursor: default; }
.heat .cell:hover { transform: scale(1.18); }
.heat .lab { display: grid; place-items: center; font-weight: 800; }

/* 条形图（纯 CSS 动画） */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 62px; gap: 10px; align-items: center; font-size: 12px; }
.bar-track { height: 15px; border-radius: 999px; background: rgba(255,255,255,.5); box-shadow: inset 0 0 0 1px rgba(255,255,255,.6); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--blue) 60%, var(--indigo));
  box-shadow: 0 2px 8px rgba(10,132,255,.35);
  transition: width 1.1s var(--apple);
}
.bar-val { font-weight: 800; text-align: right; }

/* 液态玻璃开关 */
.switch { position: relative; width: 51px; height: 31px; border-radius: 999px; cursor: pointer; background: rgba(120,140,170,.25); border: 1px solid rgba(255,255,255,.5); transition: background var(--t-mid) var(--apple); flex: none; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 25px; height: 25px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(30,50,90,.25), inset 0 1px 0 rgba(255,255,255,.9);
  transition: left var(--t-mid) var(--spring);
}
.switch.on { background: linear-gradient(135deg, var(--mint), var(--green)); }
.switch.on::after { left: 22px; }

/* ================= 模态 / 底部抽屉 ================= */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(24, 34, 50, .35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .28s var(--apple) both;
}
.overlay.closing { animation: fadeOut .22s var(--apple) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  width: min(460px, 100%); max-height: 86vh; overflow: auto;
  border-radius: var(--r-xl); padding: 24px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(calc(var(--blur) + 10px)) saturate(1.9);
  backdrop-filter: blur(calc(var(--blur) + 10px)) saturate(1.9);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-2), var(--spec);
  animation: sheetIn .5s var(--spring) both;
}
.overlay.closing .sheet { animation: sheetOut .22s var(--apple) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(46px) scale(.94); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(30px) scale(.96); } }
.sheet h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }

/* ================= Toast ================= */
#toast-root { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(calc(var(--blur) + 8px)) saturate(2);
  backdrop-filter: blur(calc(var(--blur) + 8px)) saturate(2);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-2), var(--spec);
  animation: toastIn .5s var(--spring) both;
}
.toast.out { animation: toastOut .3s var(--apple) both; }
.toast.ok::before, .toast.err::before, .toast.info::before { content: ''; width: 9px; height: 9px; border-radius: 50%; }
.toast.ok::before { background: var(--mint); box-shadow: 0 0 8px rgba(48,209,88,.8); }
.toast.err::before { background: var(--red); box-shadow: 0 0 8px rgba(255,55,95,.8); }
.toast.info::before { background: var(--blue); box-shadow: 0 0 8px rgba(10,132,255,.8); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.94); } }

/* ================= 预约成功覆盖层（液态礼花） ================= */
.success-overlay {
  position: fixed; inset: 0; z-index: 130; display: grid; place-items: center;
  background: rgba(240, 248, 255, .55);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  animation: fadeIn .3s both;
}
.success-blob {
  width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mint), var(--teal) 60%, var(--blue));
  box-shadow: 0 24px 70px rgba(48, 209, 88, .45), inset 0 2px 0 rgba(255,255,255,.6);
  animation: blobPop .8s var(--spring) both;
  position: relative;
}
.success-blob::before, .success-blob::after {
  content: ''; position: absolute; inset: -14px; border-radius: 50%;
  border: 2px solid rgba(48, 209, 88, .4);
  animation: ripple 1.6s ease-out infinite;
}
.success-blob::after { animation-delay: .5s; }
@keyframes blobPop { from { transform: scale(.2) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.12) rotate(4deg); } }
@keyframes ripple { from { transform: scale(1); opacity: .8; } to { transform: scale(1.55); opacity: 0; } }
.success-blob svg { width: 64px; height: 64px; }
.success-blob path {
  stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw .5s .25s var(--apple) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ================= 二维码 ================= */
.qr-box { display: grid; place-items: center; padding: 14px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-1); }
.qr-box canvas, .qr-box svg { image-rendering: pixelated; }

/* ================= 骨架屏 ================= */
.skel { border-radius: var(--r-md); background: linear-gradient(100deg, rgba(255,255,255,.4) 40%, rgba(255,255,255,.85) 50%, rgba(255,255,255,.4) 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }

/* ================= 打印页（A4 标签） ================= */
.print-only { display: none; }
@media print {
  .mesh-bg, .navbar, .tabbar, .action-bar, #modal-root, #toast-root, .no-print { display: none !important; }
  body { background: #fff; }
  .app { padding: 0; width: 100%; }
  .print-area { display: block !important; }
  .label-card { break-inside: avoid; }
}
.print-area { display: none; }
.label-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; width: 190mm; margin: 0 auto; }
.label-card { border: 1px dashed #bbb; border-radius: 6mm; padding: 5mm; text-align: center; }

/* ================= 响应式 ================= */
@media (max-width: 640px) {
  .device-grid, .grid2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .slot-grid { grid-template-columns: repeat(3, 1fr); }
  .tab { width: 56px; }
  .bar-row { grid-template-columns: 96px 1fr 56px; }
  .heat { grid-template-columns: 26px repeat(14, 1fr); }
}
@media (min-width: 900px) {
  .app { padding-top: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
