/* ==========================================================================
   QQBot 控制台 · 全新 UI
   设计系统：QQ 绿主色 + 柔光卡片 + 悬浮底部导航
   ========================================================================== */
:root {
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #07c160;
  --brand-strong: #06ad56;
  --brand-soft: #e6f9ef;
  --warn: #d97706;
  --warn-soft: #fdf3e3;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.04);
  --shadow: 0 6px 20px rgba(15,23,42,.07);
  --shadow-lg: 0 18px 44px rgba(15,23,42,.16);
}

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

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

body {
  background: linear-gradient(180deg, #f4f7fb 0%, #e9eef6 100%) fixed;
  color: var(--text);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 彻底去掉所有聚焦框和点击蓝色高亮 */
:focus, :focus-visible, :active { outline: none !important; box-shadow: none !important; }
* { -webkit-tap-highlight-color: transparent; }
a, button, input, select, textarea, label { -webkit-tap-highlight-color: transparent; }
a { text-decoration: none; color: var(--text); }
::selection { background: rgba(7,193,96,.22); }

/* 细滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #c3ccd8; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #a8b3c2; }
::-webkit-scrollbar-track { background: transparent; }

/* ── 顶栏（预留，部分部署环境使用）── */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  font-weight: 800; font-size: 15px; color: var(--text);
  letter-spacing: .5px; display: inline-flex; align-items: center; gap: 8px;
}
.brand::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4ade80, var(--brand) 60%, #059669);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav-item {
  display: inline-block; padding: 7px 14px;
  color: var(--muted); font-size: 13px; border-radius: 999px;
  transition: color .15s, background .15s;
}
.nav-item:hover { color: var(--text); background: var(--bg); }
.nav-item.active { color: var(--brand-strong); background: var(--brand-soft); font-weight: 600; }
.nav-item.nav-logout { color: var(--muted); margin-left: 8px; }
.nav-item.nav-logout:hover { color: var(--danger); background: var(--danger-soft); }

.wrap { max-width: 940px; margin: 0 auto; padding: 16px 14px 116px; }

/* ── 悬浮底部导航 ── */
.bottom-nav {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 20px;
  display: flex; z-index: 30;
  box-shadow: 0 10px 30px rgba(15,23,42,.13), 0 2px 6px rgba(15,23,42,.06);
  padding-bottom: env(safe-area-inset-bottom);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 10px 2px 11px;
  font-size: 10px; color: var(--muted); border-radius: 14px;
  transition: color .15s, background .15s, transform .1s;
  line-height: 1.2;
}
.bn-item:active { transform: scale(.95); }
.bn-item svg { display: block; width: 20px; height: 20px; }
.bn-item.active { font-weight: 700; background: var(--brand-soft); color: #059669; }
.bn-item.active[data-page="dashboard"] { color: #059669; background: #e6f9ef; }
.bn-item.active[data-page="settings"] { color: #4f46e5; background: #eef0fd; }
.bn-item.active[data-page="groups"] { color: #d97706; background: #fdf3e3; }
.bn-item.active[data-page="members"] { color: #9333ea; background: #f3eafe; }
.bn-item.active[data-page="logs"] { color: #0d9488; background: #e6f6f4; }
.bn-logout { color: var(--muted); }
.bn-logout.active { color: var(--danger); background: var(--danger-soft); }
.bn-logout:active { color: var(--danger); }

/* ── 卡片 ── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .28s ease both;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap; padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .2px; }

/* 配置页每个分组卡片一个主题色：左侧竖条 + 标题色（背景保持白色） */
.card-cat-joinleave   { border-top: 3px solid #16a34a; }
.card-cat-joinleave .card-head h2   { color: #16a34a; }
.card-cat-cmd         { border-top: 3px solid #2563eb; }
.card-cat-cmd .card-head h2         { color: #2563eb; }
.card-cat-antispam    { border-top: 3px solid #d97706; }
.card-cat-antispam .card-head h2    { color: #d97706; }
.card-cat-ratelimit   { border-top: 3px solid #e11d48; }
.card-cat-ratelimit .card-head h2   { color: #e11d48; }
.card-cat-resource    { border-top: 3px solid #7c3aed; }
.card-cat-resource .card-head h2    { color: #7c3aed; }
.card-cat-restart     { border-top: 3px solid #ec4899; }
.card-cat-restart .card-head h2     { color: #ec4899; }
.card-head .btn { margin-left: auto; }
.inline-head { border-bottom: none; padding-bottom: 0; margin-bottom: 14px; }
h3.sub {
  font-size: 13px; margin: 18px 0 8px; padding-top: 14px;
  border-top: 1px dashed var(--line); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
h3.sub::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--brand); flex: none; }

/* ── 状态点 ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-on { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dot-mid { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot-off { background: #cbd5e1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.danger { color: var(--danger); }
.tag {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  background: var(--brand-soft); color: #059669; margin-right: 4px;
  font-weight: 600; display: inline-block;
}
/* 链接检测域名白名单标签 */
.la-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.la-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: #1e293b;
  background: #f1f5f9; border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px 5px 11px;
}
.la-del {
  border: none; background: transparent; color: #94a3b8; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; border-radius: 4px;
}
.la-del:hover { color: var(--danger); background: var(--danger-soft); }
.flash {
  background: #eef9f2; color: #15803d;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 12px;
  border: 1px solid #cfe9d9; display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.flash.danger { background: var(--danger-soft); color: var(--danger); border-color: #f3c9c9; }
.flash.danger::before { background: var(--danger); }

/* ── 统计格子 ── */
.grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.tile {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 12px; padding: 14px 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.tile:nth-child(1) { border-top: 3px solid #4f46e5; }
.tile:nth-child(2) { border-top: 3px solid #16a34a; }
.tile:nth-child(3) { border-top: 3px solid #d97706; }
.tile:nth-child(4) { border-top: 3px solid #0d9488; }
.tile-num { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.tile-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── 机器人卡片 ── */
.bot-card {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 14px; background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.bot-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.bot-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bot-head strong { font-size: 15px; }
.bot-name-link { cursor: pointer; text-decoration: none; border-bottom: 1px dashed #b6c2d2; }
.bot-name-link:hover { color: var(--brand-strong); border-bottom-color: var(--brand); }

.bot-body { display: flex; flex-direction: row; align-items: center; gap: 14px; margin: 6px 0 14px; }
.bot-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bot-line { font-size: 13px; line-height: 1.45; color: var(--text); display: flex; gap: 6px; }
.bot-line .muted { color: var(--muted); }
.bot-line strong { font-size: 14px; }
.status-tag {
  font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1.6; white-space: nowrap;
}
.status-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-tag.tag-on { background: var(--brand-soft); color: #059669; }
.status-tag.tag-on::before { animation: pulse 2s ease infinite; }
.status-tag.tag-off { background: #f1f5f9; color: #64748b; }
.status-tag.tag-mid { background: var(--warn-soft); color: #b45309; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5,150,105,.35); }
  50% { box-shadow: 0 0 0 4px rgba(5,150,105,0); }
}
.bot-avatar { flex: 0 0 auto; order: 2; width: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.bot-avatar img {
  width: 76px; height: 76px; border-radius: 20px;
  border: 2px solid #fff; box-shadow: var(--shadow);
  background: #f2f5f9; object-fit: cover;
}
.bot-avatar .avatar-empty { font-size: 10px; color: var(--muted); text-align: center; }

/* ── 按钮 ── */
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 12px;
  font-weight: 600; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; box-shadow: var(--shadow-sm);
}
.btn svg { flex: none; }
.btn:active { transform: scale(.97); }
.btn:hover { background: #f8fafc; }
.btn.primary {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-strong) 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px rgba(7,193,96,.32);
}
.btn.primary:hover { background: linear-gradient(180deg, #06b95a 0%, #059b4c 100%); }
.btn.warn { border-color: #f3d9ae; color: #b45309; background: #fef6ea; }
.btn.warn:hover { background: #fdf0d7; }
.btn.danger, .btn-danger { border-color: #f2c3c3; color: var(--danger); background: var(--danger-soft); }
.btn.danger:hover, .btn-danger:hover { background: #fbdcdc; }
.btn.small { padding: 4px 11px; font-size: 11px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.row-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* 机器人卡片操作按钮：四列圆角按钮（柔和底色 + 彩色文字） */
.bot-actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px;
}
.bot-actions .btn {
  width: 100%; justify-content: center; padding: 9px 0;
  border-radius: 10px; font-size: 12px; font-weight: 700; background: #fff;
  border: 1px solid transparent; box-shadow: none;
}
.bot-actions .btn:hover { transform: translateY(-1px); }
.bot-actions .btn:active { transform: scale(.96); }
.act-green  { background: #e6f9ef !important; color: #059669 !important; }
.act-green:hover  { background: #d2f3e2 !important; }
.act-red    { background: #fdecec !important; color: #dc2626 !important; }
.act-red:hover    { background: #fbd8d8 !important; }
.act-orange { background: #fdf3e3 !important; color: #d97706 !important; }
.act-orange:hover { background: #fbe9c8 !important; }
.act-blue   { background: #e8eefc !important; color: #2563eb !important; }
.act-blue:hover   { background: #d8e3fa !important; }
.act-indigo { background: #eef0fd !important; color: #4f46e5 !important; }
.act-indigo:hover { background: #e1e4fb !important; }
.act-purple { background: #f3eafe !important; color: #9333ea !important; }
.act-purple:hover { background: #e9d9fb !important; }
.act-cyan   { background: #e6f6f4 !important; color: #0d9488 !important; }
.act-cyan:hover   { background: #d4efec !important; }
.act-danger { background: #fdecec !important; color: #dc2626 !important; }
.act-danger:hover { background: #fbd8d8 !important; }
.batch-bar {
  padding: 10px 12px; background: #f8fafc; border-radius: 10px;
  margin-bottom: 14px; margin-top: 0; border: 1px dashed var(--line);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.save-fab {
  position: fixed; top: 14px; right: 14px; z-index: 30;
}
.save-fab .btn.primary {
  padding: 9px 20px; font-size: 13px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(7,193,96,.4);
}
/* ── 右上角下拉菜单（保存配置 / 查找卡片） ── */
.top-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15,23,42,.18); padding: 8px; min-width: 180px;
  z-index: 31; display: flex; flex-direction: column; gap: 6px;
  animation: fadeUp .18s ease both;
}
.tm-item {
  display: block; width: 100%; text-align: left; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
  color: #1a1b1c; cursor: pointer; font-family: inherit; background: #fff;
}
.tm-item:hover { background: #f1f5f9; }
.tm-item:active { background: #e2e8f0; }

/* ── chips 开关 ── */
.chips { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 5px 13px; font-size: 12px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.chip:hover { background: var(--bg); }
.chip.on {
  background: var(--brand-soft); border-color: #9fddb9; color: #059669; font-weight: 700;
  box-shadow: 0 0 0 3px rgba(7,193,96,.08);
}
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wrap-form { margin-top: 6px; }

/* ── 表单 ── */
.fields { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .fields { grid-template-columns: repeat(2, 1fr); } }
.field { display: flex; flex-direction: column; gap: 5px; }
/* .field 是纵向 flex，子项默认被横向拉伸成整行宽（按钮文字没到最右却占满），
   改为按钮宽度适配内容；显式 .btn.block（width:100%）仍保持全宽 */
.field .btn { align-self: flex-start; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.field code { font-size: 11px; color: var(--muted); font-weight: 400; font-family: ui-monospace, Menlo, Consolas, monospace; }
input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  border: 1px solid #d3dae5; border-radius: 10px; padding: 8px 12px;
  font-size: 13px; font-family: inherit; background: var(--card); color: var(--text); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(7,193,96,.14);
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; line-height: 1.55; resize: vertical; border-radius: 10px; }
input[type=number] { width: auto; }
.hint { font-size: 12px; color: var(--muted); margin: 2px 0 0; line-height: 1.6; }

/* switch 复选框样式 */
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500; font-size: 12px; }
.switch input { width: auto; accent-color: var(--brand); }

/* ── 日志 ── */
.log {
  border-radius: 12px;
  padding: 10px;
  max-height: 320px; overflow: auto;
  margin-top: 10px;
  background: #0f172a;
  border: 1px solid #1e293b;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.35);
}
.log.tall { max-height: 65vh; }
.log-block {
  background: #1b2536; border-radius: 8px;
  padding: 8px 11px; margin-bottom: 8px;
  font: 12px/1.65 ui-monospace, Menlo, Consolas, monospace;
  border-left: 2px solid #334155;
}
.log-block:last-child { margin-bottom: 0; }
.log-line { white-space: pre-wrap; word-break: break-all; }
.log .log-bot  { color: #7ab3e8; }
.log .log-user { color: #8ec98e; }
.log .log-sys  { color: #cbd5e1; }
.log .log-warn { color: #fde047; font-weight: 700; }
/* 日志页卡片头部操作区（下载 / 清空 / 自动刷新）靠右 */
.card-head .head-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head .head-actions .btn { margin-left: 0; }
/* 日志搜索框 */
.log-search { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.log-search input { flex: 1; min-width: 0; border-radius: 999px; padding-left: 16px; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 14px center no-repeat; padding-left: 38px; }
.log-search .hint { flex: none; white-space: nowrap; background: var(--brand-soft); color: #059669; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
/* 没有搜索内容时隐藏空计数条 */
.log-search .hint:empty { display: none; }
/* 搜索结果关键词高亮 */
.log .log-line mark { background: #f59e0b; color: #111827; padding: 0 3px; border-radius: 3px; font-weight: 700; }

/* ── 表格 ── */
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th {
  color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .4px; background: #f8fafc;
}
.table th:first-child { border-radius: 8px 0 0 8px; }
.table th:last-child { border-radius: 0 8px 8px 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table code { font-size: 11px; color: var(--muted); word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* 群头像方块 */
.gavatar {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .5px;
  box-shadow: var(--shadow-sm); border: 2px solid #fff;
}
.gavatar-img {
  position: absolute; right: 0; top: 0;
  width: 52px; height: 52px; border-radius: 14px; object-fit: cover;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
}

/* ── 登录 ── */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(150deg, #e8faf0 0%, #eef2fb 55%, #f3ecfa 100%);
  padding: 20px;
}
.login-card {
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 22px; padding: 34px 30px; width: 340px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .35s ease both;
}
.login-card h1 {
  font-size: 18px; letter-spacing: .3px;
  display: flex; align-items: center; gap: 10px;
}
.login-card h1::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4ade80, var(--brand) 60%, #059669);
  box-shadow: 0 0 0 6px var(--brand-soft); flex: none;
}
.login-card input[type=password] { padding: 11px 14px; border-radius: 12px; }

/* ── footer ── */
.foot { text-align: center; color: var(--muted); font-size: 11px; padding: 24px 16px; border-top: 1px solid var(--line); margin-top: 20px; }

/* ── toast（顶部提示条：成功绿 / 失败红，单行完整显示）── */
#toast {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%) translateY(-8px);
  background: var(--success); color: #fff; padding: 10px 20px; border-radius: 999px;
  border: 1px solid var(--success-soft);
  z-index: 9999; font-size: 13px; text-align: center;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
  box-shadow: 0 10px 30px rgba(15,23,42,.25);
  white-space: nowrap; width: max-content; max-width: calc(100vw - 32px);
  overflow: hidden; text-overflow: ellipsis;
}
#toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#toast.toast-err { background: var(--danger); border-color: #e3a7a7; }

/* ── 自定义确认弹窗 ── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
html.modal-open, body.modal-open { overflow: hidden; }
.modal-box {
  background: #fff; border-radius: 18px; padding: 22px; width: 320px;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: fadeUp .2s ease both;
  max-height: 86vh; overflow: auto;
}
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.modal-msg { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.6; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.modal-btns .btn { border-radius: 999px; padding: 8px 18px; }

/* ── 入场动画 ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

