/* ============ TG Bot 管理平台 · 设计系统 "Nebula" ============ */
:root {
  --acc1: #6366f1;
  --acc2: #a855f7;
  --grad: linear-gradient(135deg, var(--acc1), var(--acc2));
  --bg: #05070d;
  --panel: rgba(255, 255, 255, .035);
  --panel2: rgba(255, 255, 255, .015);
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .045);
  --txt: #e6eaf2;
  --muted: #8b95a9;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #fb7185;
  --info: #38bdf8;
  --shadow: 0 12px 40px rgba(0, 0, 0, .4);
  --r: 16px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
body.merchant { --acc1: #06b6d4; --acc2: #3b82f6; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; }
body {
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background: var(--bg); color: var(--txt); font-size: 14px;
  min-height: 100vh; overflow-x: hidden;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 极光背景 ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 55vw; height: 55vw; border-radius: 50%;
  filter: blur(130px); opacity: .16; will-change: transform;
}
.aurora::before { background: var(--acc1); top: -18vw; left: -12vw; animation: drift1 26s ease-in-out infinite alternate; }
.aurora::after { background: var(--acc2); bottom: -22vw; right: -14vw; animation: drift2 32s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vw, -12vh) scale(1.1); } }
.grid-dots {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.008));
  border-right: 1px solid var(--line2); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; padding: 18px 12px; z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
.logo-ic {
  width: 38px; height: 38px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; font-size: 20px; color: #fff;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--acc1) 45%, transparent);
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-4px); } }
.logo-tx { font-size: 16px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(135deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-sub { font-size: 10px; color: var(--muted); letter-spacing: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-sec { font-size: 11px; color: var(--muted); padding: 14px 12px 6px; letter-spacing: 1px; }
.nav-item {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 12px; cursor: pointer; color: var(--muted);
  font-weight: 500; transition: all .22s ease; border: 1px solid transparent; user-select: none;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform .25s var(--spring); }
.nav-item:hover { color: var(--txt); background: rgba(255,255,255,.045); transform: translateX(3px); }
.nav-item:hover svg { transform: scale(1.12) rotate(-4deg); }
.nav-item.on {
  color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--acc1) 22%, transparent), color-mix(in srgb, var(--acc2) 14%, transparent));
  border-color: color-mix(in srgb, var(--acc1) 35%, transparent);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--acc1) 22%, transparent), inset 0 1px 0 rgba(255,255,255,.08);
}
.nav-item.on::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px;
  border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--acc1);
}
.side-foot { padding: 10px 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line2); }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

.main { flex: 1; min-width: 0; padding: 0 26px 40px; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px 12px; margin-bottom: 14px;
  background: linear-gradient(180deg, var(--bg) 65%, transparent);
}
.page-title { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.page-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 7px 13px 7px 8px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); cursor: default;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}

/* ---------- 视图切换动画 ---------- */
.view { animation: viewIn .4s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }

/* ---------- 卡片 ---------- */
.glass {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(22px); box-shadow: var(--shadow);
}
.card { padding: 20px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 16px; height: 16px; color: var(--acc1); }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  position: relative; overflow: hidden; padding: 20px; cursor: default;
  transition: transform .3s var(--spring), border-color .3s, box-shadow .3s;
}
.stat:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--sc, var(--acc1)) 45%, transparent);
  box-shadow: 0 16px 44px color-mix(in srgb, var(--sc, var(--acc1)) 18%, rgba(0,0,0,.4)); }
.stat::after {
  content: ""; position: absolute; top: -40%; right: -20%; width: 60%; height: 120%;
  background: radial-gradient(circle, color-mix(in srgb, var(--sc, var(--acc1)) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.stat-ic {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--sc, var(--acc1)), color-mix(in srgb, var(--sc, var(--acc1)) 55%, #fff 8%));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--sc, var(--acc1)) 40%, transparent);
  color: #fff;
}
.stat-ic svg { width: 22px; height: 22px; }
.stat-num { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.stat-lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 按钮（涟漪 + 流光 + 弹跳） ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; outline: none; cursor: pointer; border-radius: 12px; padding: 10px 18px;
  font-size: 13.5px; font-weight: 600; font-family: inherit; color: var(--txt);
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  transition: transform .16s var(--spring), box-shadow .3s ease, filter .2s ease, background .2s, border-color .2s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.1); }
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary {
  background: var(--grad); border: none; color: #fff;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--acc1) 38%, transparent);
}
.btn-primary:hover {
  background: var(--grad); filter: brightness(1.12);
  box-shadow: 0 8px 30px color-mix(in srgb, var(--acc2) 50%, transparent);
}
.btn-primary::before {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .55s ease;
}
.btn-primary:hover::before { left: 140%; }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #e11d48); border: none; color: #fff;
  box-shadow: 0 4px 18px rgba(244,63,94,.3); }
.btn-danger:hover { filter: brightness(1.12); box-shadow: 0 8px 28px rgba(244,63,94,.45); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.icon-btn {
  position: relative; overflow: hidden; width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); cursor: pointer; color: var(--muted);
  transition: all .2s var(--spring);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: #fff; transform: translateY(-2px) scale(1.06); background: rgba(255,255,255,.1); }
.icon-btn:active { transform: scale(.9); }

/* 涟漪 */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.5); transform: scale(0);
  animation: rip .6s ease-out forwards; mix-blend-mode: screen;
}
@keyframes rip { to { transform: scale(3.4); opacity: 0; } }

/* ---------- 表单 ---------- */
.inp, select.inp {
  background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 11px;
  padding: 9.5px 13px; color: var(--txt); font-size: 13.5px; font-family: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s; min-width: 0;
}
.inp::placeholder { color: #5b6478; }
.inp:focus {
  border-color: var(--acc1); background: rgba(255,255,255,.07);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--acc1) 20%, transparent);
}
select.inp option { background: #10141f; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 11.5px; color: #5b6478; }

/* 模板多选 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; overflow: hidden; padding: 9px 14px; border-radius: 11px; cursor: pointer; user-select: none;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 500;
  transition: all .22s var(--spring); background: rgba(255,255,255,.03);
}
.chip:hover { transform: translateY(-2px); color: var(--txt); }
.chip.on {
  color: #fff; border-color: color-mix(in srgb, var(--acc1) 60%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--acc1) 30%, transparent), color-mix(in srgb, var(--acc2) 22%, transparent));
  box-shadow: 0 4px 16px color-mix(in srgb, var(--acc1) 25%, transparent);
}
.chip.on::after { content: "✓"; margin-left: 6px; font-weight: 800; }

/* ---------- 工具栏 / 查询区 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px; margin-bottom: 16px; }
.toolbar .inp { width: 150px; }
.toolbar .inp.date { width: 140px; }
.toolbar .grow { flex: 1; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; white-space: nowrap; }
.tbl thead th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .5px;
  padding: 13px 14px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.025); position: sticky; top: 0;
}
.tbl tbody td { padding: 12.5px 14px; border-bottom: 1px solid var(--line2); font-size: 13.2px; }
.tbl tbody tr { transition: background .18s; animation: rowIn .4s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--acc1) 6%, transparent); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .mono { font-family: Consolas, "JetBrains Mono", monospace; font-size: 12.5px; color: #a5b4fc; }
body.merchant .tbl .mono { color: #67e8f9; }
.tbl .muted { color: var(--muted); }
.tbl .actions { display: flex; gap: 7px; }

/* 状态徽章 */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: rgba(52,211,153,.12); color: var(--ok); }
.pill-ok .dot { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pill-off { background: rgba(148,163,184,.12); color: #94a3b8; }
.pill-err { background: rgba(251,113,133,.13); color: var(--err); }
.pill-warn { background: rgba(251,191,36,.13); color: var(--warn); }
.pill-info { background: rgba(56,189,248,.13); color: var(--info); }

/* 日志类型标签 */
.tag { padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; }
.tag-info { background: rgba(56,189,248,.12); color: var(--info); }
.tag-op { background: rgba(167,139,250,.14); color: #a78bfa; }
.tag-warn { background: rgba(251,191,36,.13); color: var(--warn); }
.tag-error { background: rgba(251,113,133,.14); color: var(--err); }
.tag-login { background: rgba(52,211,153,.12); color: var(--ok); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 14px 16px; flex-wrap: wrap; }
.pager .info { margin-right: auto; font-size: 12.5px; color: var(--muted); }
.page-btn {
  position: relative; overflow: hidden; min-width: 32px; height: 32px; padding: 0 9px; border-radius: 9px;
  display: inline-grid; place-items: center; cursor: pointer; font-size: 12.5px;
  background: rgba(255,255,255,.045); border: 1px solid var(--line); color: var(--muted);
  transition: all .18s var(--spring); user-select: none;
}
.page-btn:hover { color: #fff; transform: translateY(-2px); }
.page-btn.on { background: var(--grad); border: none; color: #fff; font-weight: 700;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--acc1) 35%, transparent); }
.page-btn.dis { opacity: .35; pointer-events: none; }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(3, 5, 12, .62); backdrop-filter: blur(7px); animation: fade .22s ease;
}
.overlay.closing { animation: fadeOut .18s ease forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.modal {
  width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; padding: 24px;
  animation: pop .4s var(--spring);
}
.overlay.closing .modal { animation: popOut .18s ease forwards; }
@keyframes pop { from { transform: scale(.88) translateY(18px); opacity: 0; } }
@keyframes popOut { to { transform: scale(.94) translateY(8px); opacity: 0; } }
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 9px; }
.modal-title svg { width: 18px; height: 18px; color: var(--acc1); }
.modal-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- Toast ---------- */
#toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  position: relative; overflow: hidden; min-width: 250px; max-width: 360px; padding: 13px 16px 15px;
  border-radius: 13px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(180deg, rgba(30,36,52,.92), rgba(22,27,40,.92));
  border: 1px solid var(--line); backdrop-filter: blur(18px); box-shadow: 0 14px 40px rgba(0,0,0,.5);
  animation: toastIn .38s var(--spring);
}
.toast.leaving { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { transform: translateX(110%) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(110%); opacity: 0; } }
.toast .t-ic { font-size: 16px; line-height: 1.2; }
.toast .t-bd b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.toast .t-bd span { color: var(--muted); font-size: 12.5px; }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2.5px; background: var(--grad); animation: barRun linear forwards; }
.toast.ok .bar { background: linear-gradient(90deg, #34d399, #10b981); }
.toast.err .bar { background: linear-gradient(90deg, #fb7185, #f43f5e); }
@keyframes barRun { from { width: 100%; } to { width: 0; } }

/* ---------- 下拉菜单 ---------- */
.menu {
  position: fixed; z-index: 150; min-width: 150px; padding: 6px;
  border-radius: 13px; background: linear-gradient(180deg, rgba(28,33,48,.97), rgba(20,24,36,.97));
  border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.55); backdrop-filter: blur(20px);
  animation: menuIn .2s var(--spring); transform-origin: top right;
}
@keyframes menuIn { from { transform: scale(.85); opacity: 0; } }
.menu-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 9px;
  cursor: pointer; font-size: 13px; color: var(--txt); transition: background .15s, transform .15s;
}
.menu-item svg { width: 14px; height: 14px; }
.menu-item:hover { background: rgba(255,255,255,.07); transform: translateX(2px); }
.menu-item.danger { color: var(--err); }
.menu-item.danger:hover { background: rgba(251,113,133,.1); }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 92vw); padding: 38px 34px; text-align: center; }
.login-logo {
  width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 20px; background: var(--grad);
  display: grid; place-items: center; font-size: 32px; color: #fff;
  box-shadow: 0 14px 40px color-mix(in srgb, var(--acc1) 45%, transparent);
  animation: float 5s ease-in-out infinite;
}
.login-title { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.login-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 26px; }
.login-card .inp { width: 100%; padding: 12px 15px; margin-bottom: 14px; font-size: 14px; }
.login-card .btn { width: 100%; padding: 12.5px; font-size: 14.5px; margin-top: 4px; }
.login-card.shake { animation: shake .45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

/* ---------- 空状态 / 骨架屏 ---------- */
.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty .e-ic { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.sk { border-radius: 9px; height: 15px; margin: 13px 14px;
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.1) 37%, rgba(255,255,255,.04) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- 仪表盘图表 ---------- */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-box { height: 300px; display: flex; flex-direction: column; }
.chart-box .chart { flex: 1; min-height: 0; width: 100%; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

/* 最近动态 */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item { display: flex; gap: 11px; padding: 9px 6px; border-radius: 10px; transition: background .15s; animation: rowIn .4s ease both; }
.feed-item:hover { background: rgba(255,255,255,.03); }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--acc1); box-shadow: 0 0 8px var(--acc1); }
.feed-bd { font-size: 12.8px; line-height: 1.5; }
.feed-bd .time { color: var(--muted); font-size: 11.5px; }

/* ---------- 商户端首页概览 ---------- */
.quota-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 8px; }
.quota-bar > div { height: 100%; border-radius: 99px; background: var(--grad); transition: width .8s var(--spring);
  box-shadow: 0 0 12px color-mix(in srgb, var(--acc1) 50%, transparent); }

/* 功能标签 */
.feat { display: inline-block; padding: 3px 9px; margin: 2px 3px 2px 0; border-radius: 7px; font-size: 11.5px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line2); color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .side { width: 66px; padding: 14px 8px; }
  .logo-tx, .logo-sub, .nav-item span, .nav-sec, .side-foot { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .main { padding: 0 14px 30px; }
  .toolbar .inp { width: 100%; }
}
.hide { display: none !important; }

/* ---------- 机器人配置后台（tab 弹窗） ---------- */
.cfg-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.cfg-tab {
  position: relative; padding: 10px 14px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s; display: flex; align-items: center; gap: 6px;
}
.cfg-tab:hover { color: var(--txt); }
.cfg-tab.on { color: #fff; border-bottom-color: var(--acc1); }
.cfg-tab .badge {
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--err); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.cfg-pane { display: none; animation: viewIn .3s ease both; }
.cfg-pane.on { display: block; }
.cfg-sec { font-size: 12.5px; font-weight: 700; color: var(--acc1); margin: 4px 0 10px; letter-spacing: .5px; }
body.merchant .cfg-sec { color: #38bdf8; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .cfg-grid { grid-template-columns: 1fr; } }
textarea.inp { font-family: inherit; line-height: 1.5; width: 100%; }

/* ---------- 模板详情 / BotFather 教程弹窗 ---------- */
.doc-intro {
  padding: 12px 14px; border-radius: 12px; font-size: 13.2px; line-height: 1.7; margin-bottom: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--acc1) 12%, transparent), color-mix(in srgb, var(--acc2) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--acc1) 25%, transparent);
}
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line2);
  animation: rowIn .4s ease both; transition: border-color .2s, transform .2s;
}
.doc-item:hover { border-color: color-mix(in srgb, var(--acc1) 35%, transparent); transform: translateX(3px); }
.doc-ic { font-size: 22px; line-height: 1.2; flex-shrink: 0; }
.doc-t { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.doc-d { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.doc-tip {
  margin-top: 14px; padding: 11px 13px; border-radius: 11px; font-size: 12.5px; line-height: 1.7; color: var(--muted);
  background: rgba(56,189,248,.07); border: 1px solid rgba(56,189,248,.2);
}
.doc-warn {
  margin-top: 14px; padding: 11px 13px; border-radius: 11px; font-size: 12.5px; line-height: 1.8;
  background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.25); color: #fcd34d;
}
.doc-steps { display: flex; flex-direction: column; gap: 12px; }
.doc-step {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.75;
  background: rgba(255,255,255,.03); border: 1px solid var(--line2); animation: rowIn .4s ease both;
}
.doc-step b { font-size: 13.5px; }
.doc-n {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 9px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-top: 2px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--acc1) 35%, transparent);
}
.doc-step code, .doc-warn code, .doc-tip code, .doc-cmd code {
  background: rgba(255,255,255,.08); padding: 1.5px 7px; border-radius: 6px;
  font-family: Consolas, "JetBrains Mono", monospace; font-size: 12.2px; color: #a5b4fc;
}
body.merchant .doc-step code { color: #67e8f9; }
.doc-cmds { display: flex; flex-direction: column; gap: 7px; }
.doc-cmd {
  display: flex; gap: 12px; align-items: baseline; padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line2); animation: rowIn .35s ease both;
  transition: border-color .2s;
}
.doc-cmd:hover { border-color: color-mix(in srgb, var(--acc1) 35%, transparent); }
.doc-cmd code { flex-shrink: 0; min-width: 130px; text-align: center; }
.doc-cmd span { font-size: 12.8px; color: var(--muted); line-height: 1.6; }
