/* ==========================================================================
   云短信平台 · 公共样式（浅色调 / 响应式）
   ========================================================================== */

:root {
  --bg: #f6f8fb;
  --bg-soft: #eef2f8;
  --surface: #ffffff;
  --border: #e7ecf3;
  --border-strong: #d8e0ec;
  --text: #1a2233;
  --text-soft: #5a6a85;
  --text-muted: #8a97ad;
  --primary: #3b6ef6;
  --primary-dark: #2a56d4;
  --primary-soft: #eaf1ff;
  --success: #12a15a;
  --success-soft: #e6f7ef;
  --warning: #d98a12;
  --warning-soft: #fdf4e3;
  --danger: #e0483d;
  --danger-soft: #fdecea;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(30, 50, 90, 0.05);
  --shadow: 0 10px 30px rgba(30, 50, 90, 0.07);
  --shadow-lg: 0 20px 50px rgba(30, 50, 90, 0.1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }

.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.mono { font-family: var(--mono); font-size: 13px; }
.center { text-align: center; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 0 4px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.wrap { flex-wrap: wrap; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 12px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.nav-brand > span:last-child { white-space: nowrap; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b6ef6, #6f9bff); color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(59, 110, 246, 0.3);
}
.nav-links {
  display: flex; align-items: center; gap: 6px; margin-left: auto;
  min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--text-soft); font-weight: 500; padding: 8px 14px; border-radius: 9px;
  white-space: nowrap; flex-shrink: 0;
  transition: all .18s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--primary-soft); }

/* ---------------- 汉堡按钮 + 侧边抽屉（移动端导航） ---------------- */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 9px; border: none; cursor: pointer;
  background: none; border-radius: 11px; flex-shrink: 0; margin-left: 4px;
  transition: background .18s ease;
}
.nav-toggle:hover { background: var(--bg-soft); }
.nav-toggle span {
  display: block; height: 2px; width: 100%; border-radius: 2px;
  background: var(--text); transition: all .2s ease;
}
.drawer-mask {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 32, 56, 0.45); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .24s ease;
}
.drawer-mask.show { display: block; opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 201;
  width: 82%; max-width: 320px; height: 100%;
  background: var(--surface); box-shadow: -14px 0 40px rgba(20, 40, 80, 0.16);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 16px; border-bottom: 1px solid var(--border);
}
.drawer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--text); }
.drawer-brand .brand-logo { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.drawer-close {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: none; background: var(--bg-soft); color: var(--text-soft);
  border-radius: 10px; cursor: pointer; transition: all .18s ease;
}
.drawer-close:hover { background: var(--border); color: var(--text); }
.drawer-menu { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; }
.drawer-menu a {
  color: var(--text); font-size: 15.5px; font-weight: 500;
  padding: 15px 14px; border-radius: 12px; border-bottom: 1px solid var(--border);
  transition: all .16s ease;
}
.drawer-menu a:last-child { border-bottom: none; }
.drawer-menu a:hover, .drawer-menu a:active { background: var(--primary-soft); color: var(--primary); }
.drawer-foot {
  display: flex; gap: 12px; padding: 16px 18px calc(48px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.drawer-foot .btn { flex: 1; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: 11px; border: 1px solid transparent;
  font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: all .18s ease; white-space: nowrap; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(59, 110, 246, 0.28); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(59, 110, 246, 0.32); }
.btn-ghost { background: var(--surface); color: var(--text-soft); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #dde9ff; color: var(--primary-dark); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fbdcd8; color: var(--danger); }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
}
.card-hover { transition: all .22s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }

/* ---------------- 表单 ---------------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border-strong);
  border-radius: 11px; font-family: inherit; font-size: 14.5px; color: var(--text);
  background: #fbfcfe; transition: all .16s ease; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.12);
}
.field textarea { min-height: 110px; resize: vertical; font-size: 14px; }
.field small { color: var(--text-muted); font-size: 12.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.input-group { display: flex; gap: 10px; align-items: stretch; }
.input-group input { flex: 1; }
.captcha-box {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 0 14px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--primary-soft);
  color: var(--primary-dark); font-size: 15px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; user-select: none; transition: all .16s ease;
}
.captcha-box:hover { border-color: var(--primary); background: #dde9ff; }
.captcha-q {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 19px; font-weight: 700; letter-spacing: 4px; font-style: italic;
  background: linear-gradient(135deg, var(--primary) 0%, #7b5cff 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.captcha-refresh { opacity: .6; flex-shrink: 0; }
.captcha-box:hover .captcha-refresh { opacity: 1; }

/* ---------------- 提示 ---------------- */
.alert { padding: 13px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: #0d7a44; border-color: #c5ecd8; }
.alert-error { background: var(--danger-soft); color: #b83026; border-color: #f7cdc8; }
.alert-warn { background: var(--warning-soft); color: #a8690c; border-color: #f5e0b5; }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); border-color: #cfe0ff; }

/* ---------------- 徽章 ---------------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-soft { background: var(--bg-soft); color: var(--text-soft); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
table.data th, table.data td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { background: var(--bg-soft); font-weight: 600; color: var(--text-soft); font-size: 13px; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafcff; }
table.data td.wrap-cell { white-space: normal; word-break: break-word; max-width: 320px; vertical-align: top; }

/* 移动端表格卡片化（可选：.table-wrap.cards） */
@media (max-width: 820px) {
  .table-wrap.cards { border: none; border-radius: 0; overflow: visible; }
  .table-wrap.cards table.data { display: block; background: transparent; font-size: 14px; }
  .table-wrap.cards thead { display: none; }
  .table-wrap.cards tbody { display: block; }
  .table-wrap.cards tr {
    display: block; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 5px 0; margin-bottom: 12px;
  }
  .table-wrap.cards tr:last-child { margin-bottom: 0; }
  .table-wrap.cards td {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    width: auto; padding: 7px 14px; border-bottom: none;
    white-space: normal; word-break: break-word; text-align: right; line-height: 1.5;
  }
  .table-wrap.cards td::before {
    content: attr(data-label); flex: none; text-align: left;
    color: var(--text-muted); font-size: 13px; font-weight: 600;
  }
  .table-wrap.cards td.wrap-cell { max-width: none; }
}

/* ---------------- 认证页 ---------------- */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 12% 18%, #e5eeff 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, #e8f4ff 0%, transparent 42%),
    var(--bg);
}
.auth-wrap { width: 100%; max-width: 430px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 34px 30px; box-shadow: var(--shadow-lg);
}
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head .brand-logo { margin: 0 auto 14px; width: 48px; height: 48px; font-size: 15px; border-radius: 14px; }
.auth-head h1 { font-size: 21px; }
.auth-head p { color: var(--text-muted); font-size: 13.5px; margin-top: 5px; }
.auth-foot { text-align: center; font-size: 13px; margin-top: 20px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-soft); margin-top: 18px; }
.auth-switch a { font-weight: 600; }
.form-aux { display: flex; justify-content: flex-end; margin: -6px 0 14px; }
.form-aux a { font-size: 13.5px; color: var(--primary); font-weight: 500; }
.form-aux a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ---------------- 安装向导 ---------------- */
.steps-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.step-item { display: flex; justify-content: space-between; padding: 12px 16px; background: var(--bg-soft); border-radius: 11px; font-size: 14px; }
.section-mini { font-size: 14.5px; color: var(--text-soft); margin: 4px 0 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 10px 14px; border-radius: 10px; background: var(--bg-soft); }
.check-list li em { margin-left: auto; font-style: normal; font-weight: 600; font-size: 13px; }
.check-list li .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); flex: none; }
.check-list li.ok .dot { background: var(--success); }
.check-list li.ok em { color: var(--success); }
.check-list li.no .dot { background: var(--danger); }
.check-list li.no em { color: var(--danger); }

/* ==========================================================================
   用户控制台布局
   ========================================================================== */
.console { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .nav-brand { padding: 4px 8px 20px; }
.sidebar-menu { display: flex; flex-direction: column; gap: 3px; }
.sidebar-menu a {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: 11px;
  color: var(--text-soft); font-weight: 500; font-size: 14.5px; transition: all .16s ease;
}
.sidebar-menu a:hover { background: var(--bg-soft); color: var(--text); }
.sidebar-menu a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar-menu a .ico { width: 18px; text-align: center; font-size: 15px; }
.sidebar-divider { height: 1px; background: var(--border); margin: 12px 8px; }
.sidebar-menu .sub { font-size: 12px; color: var(--text-muted); padding: 8px 14px 4px; text-transform: uppercase; letter-spacing: .05em; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 17px; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-soft); }
.topbar .topbar-right { display: flex; align-items: center; gap: 18px; }
.balance-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; background: var(--bg-soft);
  border-radius: 999px; font-size: 13px; color: var(--text-soft);
}
.balance-pill .bp-num { font-weight: 700; color: var(--text); font-size: 14px; margin: 0 1px; }
.balance-pill .bp-unit { opacity: .6; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #e8ebf1; color: #9aa3b2;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.avatar-big { width: 44px; height: 44px; font-size: 15px; }
.avatar-wrap { position: relative; }
.avatar-trigger {
  display: flex; align-items: center; gap: 9px; border: none; background: none;
  padding: 5px 12px 5px 5px; border-radius: 999px; cursor: pointer;
  transition: background .15s; outline: none;
}
.avatar-trigger:hover { background: var(--bg-soft); }
.avatar-trigger .user-phone { font-size: 14px; color: var(--text); font-weight: 500; }
.avatar-trigger .caret { color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.avatar-wrap.open .avatar-trigger .caret { transform: rotate(180deg); }
.avatar-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 230px; background: #fff; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(30, 50, 90, .16); border: 1px solid var(--border);
  padding: 8px; z-index: 200;
}
.avatar-wrap.open .avatar-pop { display: block; animation: popIn .18s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.ap-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; }
.ap-name { font-weight: 600; color: var(--text); font-size: 15px; }
.ap-phone { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.ap-divider { height: 1px; background: var(--border); margin: 4px 4px 6px; }
.ap-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .14s;
}
.ap-link:hover { background: var(--bg-soft); }
.ap-link.ap-danger { color: var(--danger); }
.ap-link.ap-danger:hover { background: var(--danger-soft); }
.content { padding: 26px; flex: 1; }

/* 控制台移动端左侧抽屉 */
.topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar-left h2 { min-width: 0; }
.console-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 9px; border: none; cursor: pointer;
  background: none; border-radius: 11px; flex-shrink: 0; transition: background .18s ease;
}
.console-toggle:hover { background: var(--bg-soft); }
.console-toggle span { display: block; height: 2px; width: 100%; border-radius: 2px; background: var(--text); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.sidebar-close {
  display: none; place-items: center; width: 36px; height: 36px; flex: none;
  border: none; background: var(--bg-soft); color: var(--text-soft);
  border-radius: 10px; cursor: pointer; transition: all .18s ease;
}
.sidebar-close:hover { background: var(--border); color: var(--text); }
.console-mask {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 32, 56, 0.45); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .24s ease;
}
.console-mask.show { display: block; opacity: 1; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--text-muted); font-size: 14px; margin-top: 3px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0;
}
.stat-body { flex: 1; min-width: 0; }
.stat .label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.stat .value { font-size: 27px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; word-break: break-word; }
.stat .value small { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-left: 4px; }
.stat .icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--primary-soft); }

/* 套餐卡片 */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.plan {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; box-shadow: var(--shadow-sm); transition: all .22s ease; position: relative;
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary); }
.plan h3 { font-size: 17px; }
.plan .count { font-size: 32px; font-weight: 800; color: var(--primary); margin: 10px 0 2px; }
.plan .count span { font-size: 15px; color: var(--text-muted); font-weight: 600; }
.plan .price { font-size: 24px; font-weight: 800; margin: 14px 0; }
.plan .price small { font-size: 14px; color: var(--text-muted); }
.plan .desc { font-size: 13px; color: var(--text-muted); min-height: 38px; margin-bottom: 16px; }
.plan .ribbon { position: absolute; top: 14px; right: 14px; }

/* 空状态 */
.empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty .icon { font-size: 40px; margin-bottom: 12px; opacity: .6; }

/* 文档代码块 */
.code {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13px;
  line-height: 1.7; color: #24324a; white-space: pre;
}
.kv { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 140px; flex: none; color: var(--text-muted); }
.kv .v { flex: 1; word-break: break-all; font-family: var(--mono); font-size: 13.5px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  background: none; border: none; padding: 10px 16px; font-family: inherit; font-size: 14.5px;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* 支付二维码 */
.pay-box { text-align: center; padding: 10px; }
.pay-qr { width: 220px; height: 220px; margin: 0 auto 16px; border-radius: 14px; border: 1px solid var(--border); background: #fff; padding: 10px; }
.pay-qr img { width: 100%; height: 100%; object-fit: contain; }
.pay-amount { font-size: 34px; font-weight: 800; color: var(--primary); }

/* ==========================================================================
   后台管理
   ========================================================================== */
.admin-nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 60; }
.admin-nav .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.admin-tabs { display: flex; gap: 2px; overflow-x: auto; }
.admin-tabs a { padding: 9px 15px; border-radius: 9px; color: var(--text-soft); font-weight: 500; font-size: 14px; white-space: nowrap; }
.admin-tabs a:hover { background: var(--bg-soft); }
.admin-tabs a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 30, 55, .42); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 200; }
.modal-mask.show { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 18px; }

/* 响应式 */
@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .console { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 201;
    width: 82%; max-width: 280px; height: 100%;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--border); border-bottom: none;
    overflow-y: auto; transform: translateX(-105%);
    transition: transform .26s cubic-bezier(.22,.61,.36,1); will-change: transform;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .nav-brand { padding: 4px 8px 20px; }
  .sidebar-menu { flex-direction: column; gap: 3px; }
  .sidebar-menu .sub, .sidebar-divider { display: block; }
  .sidebar-menu a { white-space: normal; padding: 11px 14px; }
  .sidebar-head { display: flex; }
  .sidebar-close { display: grid; }
  .console-toggle { display: flex; }
  .content { padding: 18px; }
  .topbar { padding: 0 16px; }
  .stat-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  /* 凭证行：标签独占一行，值 + 按钮换行排列，避免重叠 */
  .kv { flex-wrap: wrap; row-gap: 6px; }
  .kv .k { width: 100%; }
  .kv .v { flex: 1 1 auto; min-width: 0; }
  .kv .btn { flex: 0 0 auto; }
  /* 首页顶栏：隐藏横向导航与登录按钮，改为汉堡 + 抽屉 */
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}
@media (max-width: 560px) {
  .nav-inner { height: 62px; }
  .nav-brand { font-size: 16px; }
  .nav-brand .brand-logo { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar h2 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .topbar-right { gap: 8px; }
  .balance-pill { padding: 5px 10px; font-size: 12px; }
  .balance-pill .bp-num { font-size: 13px; }
  .avatar-trigger { gap: 6px; padding: 4px; }
  .avatar-trigger .user-phone { display: none; }
  .topbar .user-chip span:not(.avatar) { display: none; }
  .stat .value { font-size: 23px; }
  .page-head h1 { font-size: 19px; }
  .auth-card { padding: 26px 20px; }
  .btn-lg { padding: 13px 22px; }
  body { font-size: 14.5px; }
}
