/* ============================================================
   光遇控制台 · 手机浏览器版
   毛玻璃 · 白色为主 · 黑色按钮 · 圆润活泼
   手机优先（Mobile First），桌面自适应
   ============================================================ */

:root {
  /* ── 黑白灰 ── */
  --ink:      #141414;
  --ink-2:    #565656;
  --ink-3:    #919191;
  --ink-4:    #C4C4C4;
  --line:     rgba(0,0,0,.07);
  --line-2:   rgba(0,0,0,.12);

  /* ── 毛玻璃 ── */
  --glass:      rgba(255,255,255,.62);
  --glass-2:    rgba(255,255,255,.80);
  --glass-3:    rgba(255,255,255,.94);
  --glass-dark: rgba(20,20,20,.72);
  --blur:       blur(22px) saturate(180%);
  --blur-sm:    blur(14px) saturate(160%);

  /* ── 背景（有颜色的，不是纯白）── */
  --bg: linear-gradient(165deg, #FDFBFF 0%, #F4F1FA 32%, #EFF6FF 66%, #F7F3FF 100%);

  /* ── 圆润 ── */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-full: 999px;

  /* ── 阴影 ── */
  --sh-1: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.05);
  --sh-2: 0 2px 8px rgba(0,0,0,.06), 0 10px 28px rgba(0,0,0,.07);
  --sh-3: 0 10px 30px rgba(0,0,0,.10), 0 28px 64px rgba(0,0,0,.10);
  --sh-in: inset 0 1px 0 rgba(255,255,255,.9);

  /* ── 反馈 ── */
  --ok:     #12A150;
  --ok-bg:  rgba(18,161,80,.10);
  --warn:   #E06C00;
  --warn-bg:rgba(224,108,0,.10);
  --err:    #D92D20;
  --err-bg: rgba(217,45,32,.10);

  --ease: cubic-bezier(.34,1.42,.44,1);
  --ease-out: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
        "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: var(--ink); text-decoration: none; }

/* ── 毛玻璃通用 ─────────────────────────────────── */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: var(--sh-1), var(--sh-in);
}

/* ── 顶栏 ───────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 56px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: var(--glass-3);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 680; letter-spacing: -.02em; flex: 1 }
.topbar .icbtn {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: 18px;
  transition: background .16s var(--ease-out), transform .16s var(--ease);
}
.topbar .icbtn:active { transform: scale(.9); background: rgba(0,0,0,.06) }

/* ── 内容区 ─────────────────────────────────────── */
.page { padding: 14px 14px 100px; max-width: 560px; margin: 0 auto }
@media (min-width: 720px) { .page { max-width: 720px; padding: 20px 20px 100px } }

/* ── 卡片（毛玻璃）───────────────────────────────── */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1), var(--sh-in);
  padding: 18px;
}
.card + .card { margin-top: 12px }

.card.tap { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease-out) }
.card.tap:active { transform: scale(.978); box-shadow: var(--sh-2) }

/* ── 按钮 ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px;
  border-radius: var(--r-md);
  font-size: 15px; font-weight: 620; letter-spacing: -.01em;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease-out),
              background .18s var(--ease-out), opacity .18s;
  white-space: nowrap;
}
.btn:active { transform: scale(.965) }

.btn-primary {
  background: var(--ink); color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.20), 0 6px 18px rgba(0,0,0,.16);
}
.btn-primary:active { box-shadow: 0 1px 2px rgba(0,0,0,.24), 0 3px 8px rgba(0,0,0,.16) }

.btn-ghost {
  background: var(--glass-2);
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: var(--sh-1), var(--sh-in);
}

.btn-tonal { background: rgba(20,20,20,.06); color: var(--ink) }
.btn-text  { background: none; color: var(--ink-2); box-shadow: none; font-weight: 560 }

.btn-block { width: 100% }
.btn:disabled { opacity: .42; pointer-events: none }

/* ── 输入框 ─────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px }
.field label { font-size: 13px; font-weight: 620; color: var(--ink-2); padding-left: 3px }
.input {
  height: 52px; padding: 0 16px; width: 100%;
  border-radius: var(--r-md);
  background: var(--glass-2);
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
  border: 1.5px solid rgba(0,0,0,.08);
  outline: none;
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s;
}
.input::placeholder { color: var(--ink-4) }
.input:focus {
  background: var(--glass-3);
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(20,20,20,.07);
}

/* ── 徽章 ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 25px; padding: 0 10px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 660; letter-spacing: .01em;
  background: rgba(0,0,0,.055); color: var(--ink-2);
}
.badge.ok   { background: var(--ok-bg);   color: var(--ok) }
.badge.warn { background: var(--warn-bg); color: var(--warn) }
.badge.err  { background: var(--err-bg);  color: var(--err) }
.badge.ink  { background: var(--ink); color: #fff }
.badge.glass{ background: var(--glass-2); -webkit-backdrop-filter: var(--blur-sm); backdrop-filter: var(--blur-sm); border: 1px solid rgba(255,255,255,.8) }

.dot { width: 6px; height: 6px; border-radius: 50%; flex: none }
.dot.ok { background: var(--ok) } .dot.warn { background: var(--warn) } .dot.off { background: var(--ink-4) }

/* ── 任务行 ─────────────────────────────────────── */
.task {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 15px;
  border-radius: var(--r-md);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
  border: 1.5px solid rgba(255,255,255,.7);
  box-shadow: var(--sh-1);
  cursor: pointer;
  transition: transform .18s var(--ease), border-color .18s var(--ease-out),
              background .18s var(--ease-out), box-shadow .18s;
}
.task:active { transform: scale(.982) }
.task.on {
  background: var(--glass-3);
  border-color: var(--ink);
  box-shadow: var(--sh-2);
}
.task.dis { opacity: .42; pointer-events: none }
.task .tk { font-size: 19px; width: 26px; text-align: center; flex: none }
.task .tx { flex: 1; min-width: 0 }
.task .tn { font-size: 14.5px; font-weight: 620 }
.task .td { font-size: 12px; color: var(--ink-3); margin-top: 2px }
.task .cx {
  width: 24px; height: 24px; flex: none; border-radius: 9px;
  border: 1.8px solid var(--ink-4);
  display: grid; place-items: center;
  color: #fff; font-size: 13px;
  transition: all .2s var(--ease);
}
.task.on .cx { background: var(--ink); border-color: var(--ink); transform: scale(1.06) }

/* ── 账号卡 ─────────────────────────────────────── */
.acc { display: flex; align-items: center; gap: 13px }
.acc .av {
  width: 46px; height: 46px; flex: none; border-radius: var(--r-md);
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* ── 进度条 ─────────────────────────────────────── */
.bar { height: 7px; border-radius: var(--r-full); background: rgba(0,0,0,.075); overflow: hidden }
.bar > i { display: block; height: 100%; border-radius: var(--r-full); background: var(--ink); transition: width .5s var(--ease-out) }
.bar.indet > i { width: 38% !important; animation: slide 1.3s var(--ease-out) infinite }
@keyframes slide { 0%{margin-left:-38%} 100%{margin-left:100%} }

/* ── 弹窗 ───────────────────────────────────────── */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .24s var(--ease-out);
}
.mask.on { opacity: 1; pointer-events: auto }
@media (min-width: 720px) { .mask { align-items: center } }

.sheet {
  width: 100%; max-width: 520px;
  max-height: 88vh; overflow: auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  background: var(--glass-3);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(255,255,255,.85);
  border-bottom: none;
  box-shadow: var(--sh-3);
  transform: translateY(24px);
  transition: transform .32s var(--ease);
}
.mask.on .sheet { transform: none }
@media (min-width: 720px) {
  .sheet { border-radius: var(--r-xl); border-bottom: 1px solid rgba(255,255,255,.85); padding: 26px 24px }
}
.sheet .grip { width: 38px; height: 4px; border-radius: 2px; background: var(--ink-4); margin: -6px auto 16px }

/* ── 提示条 ─────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 88px; z-index: 200;
  padding: 12px 20px;
  border-radius: var(--r-full);
  background: rgba(20,20,20,.90);
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
  color: #fff; font-size: 13.5px; font-weight: 560;
  box-shadow: var(--sh-3);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 14px);
  transition: all .28s var(--ease);
  white-space: nowrap; max-width: 88vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.on { opacity: 1; transform: translate(-50%, 0) }

/* ── 登录页 ─────────────────────────────────────── */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px 20px; position: relative; overflow: hidden;
}
.auth .orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .5; pointer-events: none }
.auth .o1 { width: 260px; height: 260px; background: #D6CCFF; top: -70px; left: -70px }
.auth .o2 { width: 300px; height: 300px; background: #BFE0FF; bottom: -100px; right: -90px }
.auth .o3 { width: 190px; height: 190px; background: #FFD9E6; top: 42%; right: -70px; opacity: .38 }
.auth .inner { position: relative; z-index: 1; width: 100%; max-width: 420px; margin: 0 auto }
.auth .mark {
  width: 66px; height: 66px; border-radius: 22px; margin: 0 auto 20px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-size: 29px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}
.auth h1 { font-size: 29px; font-weight: 730; letter-spacing: -.035em; text-align: center; margin-bottom: 5px }
.auth .lead { text-align: center; color: var(--ink-3); font-size: 14px; margin-bottom: 26px }
.auth .panel {
  padding: 24px 20px;
  border-radius: var(--r-xl);
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--sh-3), var(--sh-in);
}

/* ── 工具类 ─────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px }
.col { display: flex; flex-direction: column; gap: 10px }
.sp { flex: 1 }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.sec-title { font-size: 13px; font-weight: 660; color: var(--ink-2); padding: 4px 3px 9px; letter-spacing: .01em }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.5 }

/* ═══════════ 导航栏 V2 · 悬浮胶囊 ═══════════ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center;
  padding: 0 10px calc(8px + env(safe-area-inset-bottom));
  height: calc(66px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(26px) saturate(200%);
  backdrop-filter: blur(26px) saturate(200%);
  border-top: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 -1px 0 rgba(0,0,0,.04);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 0; border-radius: 14px;
  font-size: 10.5px; font-weight: 620; letter-spacing: .01em;
  color: var(--ink-4);
  transition: color .2s var(--ease-out), background .2s var(--ease-out), transform .18s var(--ease);
  position: relative;
}
.tabbar button .ti {
  font-size: 21px; line-height: 1;
  transition: transform .26s var(--ease);
}
.tabbar button.on { color: var(--ink) }
.tabbar button.on .ti { transform: scale(1.12) translateY(-1px) }
.tabbar button.on::after {
  content: ''; position: absolute; bottom: 2px;
  width: 18px; height: 3px; border-radius: 2px;
  background: var(--ink);
  animation: navdot .3s var(--ease);
}
@keyframes navdot { from { width: 0; opacity: 0 } to { width: 18px; opacity: 1 } }
.tabbar button:active { transform: scale(.9) }

/* 中间那个「添加账号」做成突起的黑色圆钮 */
.tabbar button:nth-child(2) { flex: none; width: 62px }
.tabbar button:nth-child(2) .ti {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-size: 24px; margin-top: -22px;
  box-shadow: 0 6px 18px rgba(0,0,0,.28), 0 0 0 5px rgba(255,255,255,.72);
  transition: transform .22s var(--ease), box-shadow .22s;
}
.tabbar button:nth-child(2):active .ti { transform: scale(.92) }
.tabbar button:nth-child(2).on .ti { transform: scale(1) }
.tabbar button:nth-child(2).on::after { display: none }
.tabbar button:nth-child(2) { color: var(--ink-3); font-size: 10px }

/* 桌面端：不悬浮，变顶部胶囊 */
@media (min-width: 720px) {
  .tabbar {
    position: sticky; top: 0; height: 62px;
    padding: 0 16px; max-width: 720px; margin: 0 auto;
    background: rgba(255,255,255,.80);
    border-top: none; border-bottom: 1px solid var(--line);
    border-radius: 0; box-shadow: none;
  }
  .tabbar button { flex-direction: row; gap: 8px; font-size: 14px; padding: 0 14px; border-radius: 12px }
  .tabbar button .ti { font-size: 18px }
  .tabbar button.on { background: rgba(0,0,0,.055) }
  .tabbar button.on::after { display: none }
  .tabbar button:nth-child(2) { flex: 1; width: auto }
  .tabbar button:nth-child(2) .ti {
    width: 30px; height: 30px; border-radius: 10px; font-size: 17px; margin: 0;
    box-shadow: none;
  }
  .tabbar button:nth-child(2).on .ti { transform: none }
}
/* ═══════════ 导航栏 V3 · SVG 图标 ═══════════ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center;
  padding: 0 8px calc(6px + env(safe-area-inset-bottom));
  height: calc(64px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  backdrop-filter: blur(28px) saturate(200%);
  border-top: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 -2px 20px rgba(0,0,0,.05);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px 0; border-radius: 16px;
  font-size: 10.5px; font-weight: 620; letter-spacing: .01em;
  color: var(--ink-4);
  transition: color .22s var(--ease-out), transform .18s var(--ease);
  position: relative;
}
.tabbar button svg {
  width: 23px; height: 23px; stroke-width: 1.9;
  stroke: currentColor; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .3s var(--ease);
}
.tabbar button.on { color: var(--ink) }
.tabbar button.on svg { transform: translateY(-1px) scale(1.08) }
.tabbar button.on::after {
  content: ''; position: absolute; bottom: 1px;
  width: 16px; height: 3px; border-radius: 2px; background: var(--ink);
  animation: navdot .32s var(--ease);
}
@keyframes navdot { from { width: 0; opacity: 0 } to { width: 16px; opacity: 1 } }
.tabbar button:active { transform: scale(.9) }

/* 中间的「添加账号」—— 突起黑圆钮 */
.tabbar button.mid { flex: none; width: 64px }
.tabbar button.mid svg {
  width: 46px; height: 46px; padding: 11px; border-radius: 50%;
  background: var(--ink); color: #fff; stroke: #fff; stroke-width: 2.2;
  margin-top: -20px;
  box-shadow: 0 6px 20px rgba(0,0,0,.30), 0 0 0 5px rgba(255,255,255,.78);
  box-sizing: border-box;
  transition: transform .24s var(--ease), box-shadow .24s;
}
.tabbar button.mid:active svg { transform: scale(.9) }
.tabbar button.mid.on::after { display: none }
.tabbar button.mid { font-size: 10px; color: var(--ink-3) }

@media (min-width: 720px) {
  .tabbar {
    position: sticky; top: 0; height: 60px; padding: 0 14px;
    max-width: 720px; margin: 0 auto; border-top: none;
    border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none;
  }
  .tabbar button { flex-direction: row; gap: 8px; font-size: 14px; padding: 0 14px; border-radius: 12px }
  .tabbar button svg { width: 19px; height: 19px }
  .tabbar button.on { background: rgba(0,0,0,.055) }
  .tabbar button.on::after { display: none }
  .tabbar button.mid { flex: 1; width: auto }
  .tabbar button.mid svg {
    width: 28px; height: 28px; padding: 6px; border-radius: 9px; margin: 0; box-shadow: none;
  }
  .tabbar button.mid.on svg { transform: none }
}

/* ═══════════ 货币图标（光遇官方）═══════════ */
.cur { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 15px; letter-spacing: -.01em }
.cur img { width: 20px; height: 20px; object-fit: contain; flex: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.12)) }
.cur-row { display: flex; gap: 0; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line) }
.cur-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px }
.cur-col .cur { font-size: 17px }
.cur-k { font-size: 11.5px; color: var(--ink-3); font-weight: 500 }

/* ═══════════ 渠道选择 · 卡片网格（不再是枯胶囊）═══════════ */
.ch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px }
@media (min-width: 520px) { .ch-grid { grid-template-columns: repeat(4, 1fr) } }
.ch-card {
  position: relative; padding: 16px 12px 14px; border-radius: 18px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur-sm); backdrop-filter: var(--blur-sm);
  border: 1.5px solid rgba(255,255,255,.75);
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  cursor: pointer; overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s, background .2s;
}
.ch-card:active { transform: scale(.96) }
.ch-card.on {
  border-color: var(--ink); background: var(--glass-3);
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
.ch-card.on::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  border: 2px solid var(--ink); opacity: .9;
}
.ch-logo {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 720; color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
  transition: transform .26s var(--ease);
}
.ch-card.on .ch-logo { transform: scale(1.06) }
.ch-name { font-size: 13px; font-weight: 640; letter-spacing: -.01em }
.ch-tick {
  position: absolute; top: 8px; right: 8px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: none; place-items: center; font-size: 11px;
}
.ch-card.on .ch-tick { display: grid }

/* ═══════════ 登录方式 · 大卡片Segmented ═══════════ */
.lm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px }
.lm {
  padding: 14px 12px; border-radius: 16px; text-align: center;
  background: var(--glass-2); -webkit-backdrop-filter: var(--blur-sm); backdrop-filter: var(--blur-sm);
  border: 1.5px solid rgba(255,255,255,.75);
  cursor: pointer;
  transition: transform .18s var(--ease), background .2s, border-color .2s;
}
.lm:active { transform: scale(.97) }
.lm.on { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 4px 14px rgba(0,0,0,.16) }
.lm .li { font-size: 20px; margin-bottom: 5px }
.lm .lt { font-size: 13.5px; font-weight: 640 }
.lm .ld { font-size: 11px; opacity: .65; margin-top: 2px }

/* ═══════════ 桌面端布局：左侧栏 + 内容区 ═══════════ */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  display: flex;               /* 由末尾媒体查询控制显示/隐藏 */
  width: 248px; flex: none;
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--line);
  flex-direction: column;
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh;
}
#sideNav { display: flex; flex-direction: column; flex: 1; }

.sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 24px; }
.sb-logo {
  width: 38px; height: 38px; border-radius: 13px; flex: none;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700;
  box-shadow: 0 3px 12px rgba(0,0,0,.18);
}
.sb-name { font-weight: 680; font-size: 15px; letter-spacing: -.015em; }
.sb-sub  { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

.sb-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sb-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: 13px;
  color: var(--ink-2); font-size: 14px; font-weight: 540;
  cursor: pointer; text-decoration: none;
  transition: background .18s var(--ease-out), color .18s, transform .16s var(--ease);
}
.sb-nav a svg {
  width: 20px; height: 20px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.sb-nav a:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.sb-nav a:active { transform: scale(.98); }
.sb-nav a.on { background: var(--ink); color: #fff; font-weight: 620; box-shadow: 0 2px 10px rgba(0,0,0,.16); }

.sb-foot { padding-top: 14px; border-top: 1px solid var(--line); margin-top: 14px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; }
.sb-av {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg,#2b2b2b,#4a4a4a); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.sb-un { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ud { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.sb-out {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border-radius: 13px;
  color: var(--ink-2); font-size: 13.5px; cursor: pointer;
  transition: background .18s, color .18s;
}
.sb-out svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sb-out:hover { background: rgba(220,38,38,.08); color: var(--err); }

/* 桌面顶栏 */
@media (min-width: 900px) {
  .sidebar { display: flex; }
  .tabbar, .tabbar2, #tabbar, #tabbar2 { display: none !important; }
  .topbar {
    position: sticky; top: 0;
    background: rgba(250,250,250,.80);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--line);
    height: 62px;
  }
  .page { max-width: 860px; padding: 26px 30px 60px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .ch-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 平板：只留底部导航 */
@media (min-width: 720px) and (max-width: 899px) {
  .sidebar { display: none; }
}

/* ═══════════ 布局互斥（最终覆盖 · 必须放最后）═══════════ */

/* 手机 / 平板：隐藏侧边栏，显示底部导航 */
@media (max-width: 899px) {
  .sidebar { display: none !important; }
  #tabbar, #tabbar2 { display: flex !important; }
  .main { width: 100%; }
}

/* 电脑：显示侧边栏，隐藏底部导航 */
@media (min-width: 900px) {
  .sidebar { display: flex !important; }
  #tabbar, #tabbar2 { display: none !important; }
  .app { display: flex; }
  .main { flex: 1; min-width: 0; }
}



/* ═══ 布局（真·最终版）═══ */

.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.main {
  flex: 1 1 0%; min-width: 0;
  display: flex; flex-direction: column;
}

.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center;
  height: 64px; padding: 0 30px;
}

/* 内容区：让父级 flex 居中，元素自己不带 margin auto */
.page {
  flex: 0 1 auto;
  width: 100%;                 /* ★ 关键 */
  max-width: 880px;            /* 上限 */
  box-sizing: border-box;
  padding: 24px 30px 72px;
  /* 水平居中：父级 column + align-items */
}

.main { align-items: center; }   /* ★ 让 .page 居中 */
.topbar { width: 100%; }          /* 顶栏撑满，不跟着居中 */

@media (max-width: 899px) {
  .page { max-width: none; padding: 14px 14px 88px; }
  .topbar { padding: 0 14px; }
}

@media (min-width: 900px) {
  #sidebar { display: flex !important; }
  #tabbar, #tabbar2 { display: none !important; }
}
@media (max-width: 899px) {
  #sidebar { display: none !important; }
  #tabbar, #tabbar2 { display: flex !important; }
}

.card, .task, .acc { width: 100%; box-sizing: border-box; }
div::-webkit-scrollbar { display: none; }
div { scrollbar-width: none; }


/* fix: hidden */
[hidden] { display: none !important; }
