/* =============================================================
   智链导航 · 后台样式
   ============================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --theme: #2563eb; --theme-dark: #1d4ed8;
  --bg: #f1f5f9; --card: #fff; --text: #1f2937; --muted: #6b7280; --border: #e5e7eb;
}
/* v1.9.2：emoji 兜底字体（必须用 unicode-range 限定，不能直接塞进 font-family 链）。
   后台菜单用了大量 emoji 图标（📊🌐🗂️🔗…），在没有 emoji 字体的精简版 Linux /
   老旧 Windows Server 上会被渲染成空心方块「□」，整条侧栏看起来像坏了。
   但**不能**把 "Noto Color Emoji" 直接写进字体链 —— 它内部含有 0-9 字形
   （emoji 数字键盘），一旦排在 sans-serif 前面，浏览器会拿它渲染普通数字，
   把「280」撑成 emoji 方块宽度（实测 47px → 105px），整个后台的数字全变形。
   正确做法：用 @font-face 声明一个只覆盖 emoji 码点的字体族。 */
@font-face {
  font-family: 'SLNEmoji';
  src: local('Apple Color Emoji'), local('Segoe UI Emoji'), local('Noto Color Emoji');
  unicode-range: U+1F000-1FAFF, U+2600-27BF, U+2190-21FF, U+2B00-2BFF, U+FE0F, U+200D, U+20E3;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", 'SLNEmoji', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: var(--theme); text-decoration: none; }
ul { list-style: none; }

.admin-body { display: flex; min-height: 100vh; }

/* =============================================================
   侧边栏宽度（v1.9）
   -------------------------------------------------------------
   历史：
     v1.8.1  260px → 216px（反馈「背景太宽」）
     v1.8.10 216px → 232px（字号放大后 216 装不下）
     v1.9    改为**真正的内容自适应**，并引入 --sb-w 变量统一收口

   为什么 v1.8.10 那次改了、用户却说「没生效」：
     那次只是把 216 换成 232 —— 依然是个写死的固定值。
     「黑底太宽」的本质是**侧栏宽度与菜单文字长度无关**，
     只要最长菜单项短于侧栏宽度，右侧就必然空出一条深色带。
     换个魔法数字治不了根。

   这一版的做法：
     1. 用 --sb-w 变量集中管理宽度，桌面默认 200px（比 232 收窄 32px，
        深色区更贴菜单），所有媒体查询也只改变量值，不再各处写死 px；
     2. 超宽屏（≥1600px）时用 :has() 探测「最长菜单项的实际文本宽度」，
        再按需把侧栏压到 176~200px —— 这需要浏览器支持 :has()，
        不支持时自动退回 200px 固定值（不会错版，只是不够极致）；
     3. 关键收益是**宽度可被一处覆盖**。以后站长若装了更长的菜单名，
        只改 --sb-w 一行即可，不用再翻媒体查询。

   注意：这里不再用 fit-content —— .admin-nav a 带 overflow:hidden +
   text-overflow:ellipsis，fit-content 只能量到压缩后的宽度，
   实测会顶到 min-width 下限，比固定值还窄（v1.8.10 的注释里记过这个坑）。
   ============================================================= */
.admin-sidebar {
  --sb-w: 200px;
  width: var(--sb-w); min-width: var(--sb-w); max-width: var(--sb-w);
  background: #0f172a; color: #cbd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overflow-x: hidden;
  transition: width .18s ease;
}
/* 超宽屏：内容驱动进一步收窄（:has() 不被支持时整条规则被忽略，无副作用） */
@media (min-width: 1600px) {
  .admin-sidebar:has(.admin-nav a) { --sb-w: 188px; }
}
.admin-logo {
  padding: 18px 16px; font-size: 17px; font-weight: 700; color: #fff;
  border-bottom: 1px solid #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-logo span { font-size: 12px; background: var(--theme); border-radius: 4px; padding: 2px 6px; margin-left: 6px; }
/* 侧栏收起（≤900px）时显示的短标题，默认隐藏 */
.admin-logo .logo-mini { display: none; }
.admin-nav { flex: 1; padding: 10px 0; }
/* v1.7.0 菜单分组标题（如「财务管理」）
   v1.7.9 调优：11px → 13px，颜色提亮，字距收紧。
   原先 11px + #64748b 在深色底上对比度过低，肉眼难以辨认。
   v1.8.10 调优（截图复核发现的层级颠倒）：
     菜单项字号提到 16px 后，分组标题若仍停在 12/13px 会「比子项还小」，
     视觉层级整个倒过来 —— 分组标题看着像脚注，子项反倒像标题。
     ------------------------------------------------------------------
   v2.0 修正（站长反馈「后台菜单字体太大、不协调」）：
     前几版把菜单项一路放大到 17px / font-weight:700，分组标题停在 13px/700。
     在只有 200px 宽的深色侧栏里，17px 的加粗中文又大又挤，跟后台正文
     （13~14px）完全脱节；而分组标题 13px 与菜单项 17px 只差 4px、两边又都
     加粗，视觉层次根本拉不开 —— 这就是「不协调」的来源。
     本次收敛为一套「小标签 + 正文」的协调比例：
       · 菜单项 14px / 500 —— 与后台正文同级，长看不累眼；
       · 分组标题 12px / 600 / 字距 0.7px —— 明确小于菜单项，靠暗色 + 字距
         定位成「小标签」，不再跟菜单项抢大小；
       · 行高 1.5、图标 16px，与 14px 文字等高对齐。
     注意：本选择器是两个类（.admin-nav .nav-group-title），优先级高于
     admin_header.php 里的单类 .nav-group-title。字号/颜色/字重一律以这里为准，
     不要在 layout 里再写一套 —— 上一版把 layout 里的字号改成 14px，
     却被这里的 13px 静默覆盖，等于白改。 */
.admin-nav .nav-group-title {
  padding: 15px 16px 6px; font-size: 12px; letter-spacing: 0.7px;
  color: #8b9bb4; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
/* 修复：菜单文字必须单行平排显示，禁止竖排折行 */
/* v1.7.9 调优：14px → 15px，行高与图标同步放大，长时间使用更护眼 */
/* v1.8.1 调优：
     1) 加粗字体（500）。反馈「菜单字体加粗」—— 原先普通字重 400，
        在 #0f172a 深色底上笔画偏细、发虚，远看不易辨认；
        提到 500 后文字更实、更清晰。
     2) 同步收窄左右内边距（22px → 18px）与图标间距，配合侧栏宽度调整。 */
/* v1.8.10 调优（反馈「字体大些看不清，加粗」）：
     1) 字号 15px → 16px，行高提到 1.45，中文在深底上更舒展；
     2) 字重 500 → 600（仅 active 保持 700，仍分得出主次）；
     3) 颜色 #d5dee9 → #e2e8f0，与深蓝底对比度从约 9:1 提到约 12:1；
     4) 行内 padding 由 11px 提到 12px，配合字号放大不显拥挤。
   v1.9 再调（用户二次反馈「字还是小」）：
     1) 字号 16px → 17px；
     2) 字重 600 → 700（全局加粗）。
     ------------------------------------------------------------------
   v2.0 修正（站长反馈「后台菜单字体太大、不协调」）：
     17px/700 是「一屏只看得见十来个字」的尺寸，在 200px 侧栏里又大又重，
     跟后台正文（13~14px）差了两档，正是「不协调」的来源。回调到正文同级：
       1) 字号 17px → 14px（标准后台侧栏字号，中文饱满不挤）；
       2) 字重 700 → 500（深色底上中等字重已足够清晰，700 太糊太重）；
       3) padding 12px → 10px、行高 1.45 → 1.5，条目更紧凑但不挤；
       4) 图标 19px → 16px，与 14px 文字等高对齐（emoji 过大同样撑行高）。
     说明：这是「回调到协调」，不是又改小 —— #e8eef6 on #0f172a 对比度约 12:1，
     14px/500 在深底上长期阅读同样清晰。 */
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: #e8eef6; font-size: 14px;
  font-weight: 500; line-height: 1.5;
  transition: .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.admin-nav a:hover { background: #1e293b; color: #fff; }
/* v1.9.2：active 不再改 font-weight。
   原先这里写的是 font-weight: 800（其余项 700），点击菜单跳转后「新项变粗、
   旧项回细」，中文在深色底上的视觉膨胀很明显，站长反馈为
   「点有的选项字一下变大，点有的又变小」。现在只靠背景色 + 白字区分当前页，
   字重保持 700 不变，切换页面时不再有跳动感。 */
.admin-nav a.active { background: var(--theme); color: #fff; }
/* v2.0：图标缩到 16px 与 14px 菜单项等高。原先 19px 的 emoji 会把行高顶起来，
   条目看着比实际更大，是「不协调」的另一个来源。 */
.nav-ic { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 10;
}
.admin-crumb { font-weight: 600; }
.admin-user { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.admin-user .logout { color: #dc2626; }
/* 使用帮助入口（顶栏右侧） */
.admin-user .help-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: 20px;
  background: #eff6ff; color: #2563eb;
  border: 1px solid #bfdbfe; font-weight: 500;
  transition: all .16s;
}
.admin-user .help-link:hover { background: #2563eb; color: #fff; border-color: #2563eb; }
/* v1.8.2 补全：改密入口与「使用帮助」保持同款胶囊样式，视觉成组 */
.admin-user .change-pwd {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: 20px;
  background: #f1f5f9; color: #475569;
  border: 1px solid #e2e8f0; font-weight: 500;
  transition: all .16s;
}
.admin-user .change-pwd:hover { background: #475569; color: #fff; border-color: #475569; }
.admin-content { padding: 20px; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h2 { font-size: 20px; }
.page-head-actions { display: flex; gap: 8px; align-items: center; }
.page-head-actions .btn { white-space: nowrap; }
.empty-tip { padding: 36px 16px; text-align: center; color: #6b7280; }
.empty-tip p:first-child { font-size: 16px; margin-bottom: 10px; }
.usage-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.usage-bar b { color: var(--theme); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #93c5fd; border-top-color: #2563eb; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h3 { font-size: 15px; }
.link { font-size: 13px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; }
.stat-card b { font-size: 28px; color: var(--theme); }
.stat-card.ok b { color: #16a34a; } .stat-card.warn b { color: #f59e0b; } .stat-card.bad b { color: #dc2626; }
.stat-card span { color: var(--muted); font-size: 13px; }
/* v1.8.10：统计卡改为可点击（<a class="stat-card stat-card-link">）。
   框架里 `a { color: var(--theme) }` 会把卡片文字染成蓝色，
   这里强制继承原色并去掉下划线，保证「能点但看不出是链接」——保持卡片观感不变。
   hover 只做轻微位移+阴影+边框高亮，提示可点，不做颜色突变以免误以为是按钮。 */
a.stat-card-link { color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.stat-card-link:hover {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15,23,42,0.10);
  border-color: var(--theme);
}
a.stat-card-link:focus-visible { outline: 2px solid var(--theme); outline-offset: 2px; }

.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } }

/* v2.0 仪表盘首屏：版本介绍 + 官方动态（对标 WordPress At a Glance / News） */
.welcome-row { margin-bottom: 18px; }
.edition-tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.edition-official { background: #eef2ff; color: #4338ca; }
.edition-generic  { background: #ecfeff; color: #0369a1; }
.ver-body { margin: 4px 0 12px; }
.ver-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.ver-key { color: var(--muted, #64748b); font-size: 13px; min-width: 72px; }
.ver-val { font-weight: 600; }
.ver-new { font-size: 12px; color: #dc2626; background: #fef2f2; padding: 1px 8px; border-radius: 999px; }
.ver-foot { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ver-ok { color: #16a34a; font-weight: 600; }
.ver-tip { font-size: 12px; color: var(--muted, #64748b); }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.news-list li:last-child { border-bottom: none; }
.news-title { font-weight: 600; color: var(--text, #1f2937); text-decoration: none; }
.news-title:hover { color: var(--theme, #2563eb); }
.news-date { font-size: 12px; color: var(--muted, #64748b); margin-left: 8px; }
.news-sum { font-size: 13px; color: var(--muted, #64748b); margin: 4px 0 0; line-height: 1.6; }
.rank-num { font-weight: 700; color: var(--theme); }

/* 表格 */
/* 修复：滚动容器原先只在 ≤768px 定义，导致 769~1024px 区间表格把页面撑出横向溢出 */
.table-wrap { width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
/* v1.8.4 修复（需求2）：补 white-space:nowrap。
   这是后台「类型/状态/备注被挤成竖排单字」的根因 ——
   原先只有 padding/border，长内容把每列压到最小宽度，
   浏览器只能在每个汉字之间换行，视觉上就是「一字一行」。
   与前台 user.css 的做法保持一致：默认不换行 + 滚动容器横向滑动，
   需要换行的列显式加 .cell-wrap 例外。 */
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: 13px; background: #f8fafc; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }
.cell-site b { display: block; }
.cell-site span { font-size: 12px; }
.cell-title { max-width: 320px; }
.ops { white-space: nowrap; }
.ops a { margin-right: 10px; font-size: 13px; }
.ops a.danger { color: #dc2626; }

/* ==========================================================================
   v1.8.4 新增（需求2）：后台宽表格「长内容收缩 + 点击弹详情」
   --------------------------------------------------------------------------
   与前台 user.css 同一套方案移植到后台：
     · .cell-wrap    —— 允许换行的列（备注/描述），带上限宽避免撑破表
     · .cell-truncate —— 单行省略号摘要
     · .cell-more    —— 「详情」小按钮，点击弹窗
     · tr.row-detail  —— 整行可点（由 table-detail.js 加 .row-clickable）
     · .cell-full    —— 承载完整文本（隐藏），供弹窗取用（避免 data-value 过长）
   ========================================================================== */
.table td.cell-wrap,
.table td[data-wrap="1"] {
  white-space: normal;
  min-width: 160px;
  max-width: 320px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
/* 纯数字 / 金额列右对齐更易读 */
.table td.cell-num,
.table th.cell-num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.cell-center,
.table th.cell-center { text-align: center; }

.cell-truncate {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 完整内容：默认收起，弹窗通过 textContent 读取。
   用 .sr-only 式裁剪而不是 display:none —— display:none 的元素
   textContent 依然可读，但部分旧内核（夸克）对 display:none 的
   querySelector 行为不一致，这里统一用视觉裁剪更稳。 */
.cell-full {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.cell-more {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--theme);
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  transition: background .15s ease, border-color .15s ease;
}
.cell-more:hover { background: rgba(37, 99, 235, .16); border-color: rgba(37, 99, 235, .35); }
.cell-more:active { transform: translateY(1px); }

.table tbody tr.row-clickable { cursor: pointer; }
.table tbody tr.row-clickable:hover { background: #f8fafc; }
.table tbody tr.row-clickable:hover .cell-more { background: rgba(37, 99, 235, .2); }

/* 后台侧栏是 fixed/sticky，弹窗 z-index 必须高于它（侧栏 z-index 约 100） */
.dlg-mask {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.dlg-mask.dlg-open { display: flex; }
.dlg-box {
  width: 100%;
  max-width: 520px;
  max-height: 84vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card, #fff);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  animation: dlg-in .18s ease-out;
}
@keyframes dlg-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dlg-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.dlg-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-close {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px;
  background: #f1f5f9; color: #475569;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.dlg-close:hover { background: #e2e8f0; color: #0f172a; }
.dlg-body {
  padding: 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13.5px; color: var(--text); line-height: 1.7;
}
.dlg-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: #fafbfc; flex-shrink: 0;
}
.dlg-list { margin: 0; }
.dlg-list dt { margin: 12px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.dlg-list dt:first-child { margin-top: 0; }
.dlg-list dd { margin: 0; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; word-break: break-word; }
.dlg-list dd.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 9px;
}
.dlg-hl { color: var(--theme); font-weight: 700; }
.dlg-in { color: #16a34a; font-weight: 700; }
.dlg-out { color: #dc2626; font-weight: 700; }

@media (max-width: 480px) {
  .dlg-mask { padding: 0; align-items: flex-end; }
  .dlg-box { max-width: 100%; max-height: 88vh; border-radius: 14px 14px 0 0; }
  .cell-truncate { max-width: 130px; }
}


/* 筛选 */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.chip.active { background: var(--theme); color: #fff; border-color: var(--theme); }
.inline-search { display: flex; gap: 6px; margin-left: auto; }
.inline-search input { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }
.form-row label em { color: #dc2626; font-style: normal; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--theme); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-col-2 { grid-column: span 2; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; }
.form-title { font-size: 15px; margin: 4px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; }
.editor { font-family: inherit; line-height: 1.7; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; font-size: 14px; transition: .15s;
}
.btn:hover { border-color: var(--theme); color: var(--theme); }
.btn-primary { background: var(--theme); border-color: var(--theme); color: #fff; }
.btn-primary:hover { background: var(--theme-dark); color: #fff; }
.btn-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
/* v1.8.2 补全：超小号按钮（表格行内操作，如「重置熔断」「立即试跑」） */
.btn-mini { padding: 2px 8px; font-size: 11.5px; line-height: 1.6; border-radius: 6px; }

details.pay-driver { background: #f9fafb; border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; margin: 14px 0 0; }
details.pay-driver > summary { cursor: pointer; font-size: 15px; padding: 6px 0; }
details.pay-driver[open] > summary { margin-bottom: 8px; }
details.pay-driver textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-family: ui-monospace, "Cascadia Code", "Menlo", monospace; font-size: 12px; }
details.pay-driver small { color: var(--muted); }
details.pay-driver small code { background: #1f2937; color: #e5e7eb; padding: 1px 6px; border-radius: 4px; font-size: 11px; }

/* 看板图表 */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.chart-panel { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-height: 200px; }
.chart-panel h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 700; }
.chart-panel svg { max-width: 100%; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0 4px 4px; font-size: 12px; color: #334155; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item i.lg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-item b { font-weight: 700; color: #0f172a; }
.type-bars { padding: 4px; }
.type-row { display: grid; grid-template-columns: 100px 1fr 50px; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.type-name { color: #475569; }
.type-bar-bg { background: #f1f5f9; border-radius: 4px; height: 18px; overflow: hidden; }
.type-bar-fill { height: 100%; transition: width 600ms ease; }
.type-num { text-align: right; color: #0f172a; font-weight: 700; }
.chart-updated { color: #94a3b8; font-size: 12px; margin-top: 8px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; background: #eef2ff; color: var(--theme); border-radius: 999px; font-size: 12px; }
.tag.ok { background: #ecfdf5; color: #047857; }
.tag.warn { background: #fffbeb; color: #b45309; }
.tag.ai { background: #fdf4ff; color: #a21caf; }
.tag.danger { background: #fef2f2; color: #b91c1c; }
.status-approved { background: #ecfdf5; color: #047857; }
.status-pending { background: #fffbeb; color: #b45309; }
.status-rejected { background: #fef2f2; color: #b91c1c; }
.status-manual { background: #eef2ff; color: #4f46e5; }
.score-num { font-weight: 700; color: var(--theme); }
.score-high { color: #16a34a; } .score-mid { color: #f59e0b; } .score-low { color: #dc2626; }

/* 提示框 */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
/* v1.8.2 补全：.alert-warning 此前被模板使用但未定义，警告框退化为无色块 */
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* 审核页 */
.audit-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .audit-cols { grid-template-columns: 1fr; } }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.info-table th { width: 90px; color: var(--muted); font-weight: 500; }
.step-item { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.step-head { display: flex; justify-content: space-between; align-items: center; }
.step-name { font-weight: 600; }
.step-score { color: var(--theme); font-weight: 700; }
.step-flag { font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.step-flag.ok { background: #ecfdf5; color: #047857; }
.step-flag.bad { background: #fef2f2; color: #b91c1c; }
.step-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.step-notes span { font-size: 12px; color: var(--muted); background: #f3f4f6; padding: 2px 8px; border-radius: 6px; }
.step-notes.danger span { background: #fef2f2; color: #b91c1c; }
.audit-form { display: flex; gap: 8px; margin-top: 16px; }
.audit-form input[type=text] { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; }

/* 分页 */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px 0; }
.pagination a, .pagination span { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 13px; }
.pagination a:hover { border-color: var(--theme); color: var(--theme); }
.pagination .cur { background: var(--theme); border-color: var(--theme); color: #fff; }

/* ============================================================
   登录页（v1.7.3 重做：加 Logo、按钮居中、卡片加大、页脚版本号）
   ============================================================ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 20px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  /* 柔光装饰：让背景不至于太空 */
  position: relative; overflow: hidden;
}
.login-body::before,
.login-body::after {
  content: ''; position: fixed; border-radius: 50%;
  background: rgba(255,255,255,.10); pointer-events: none;
}
.login-body::before { width: 420px; height: 420px; top: -150px; left: -130px; }
.login-body::after  { width: 340px; height: 340px; bottom: -130px; right: -100px; }

.login-shell {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  width: 100%;
}
.login-card {
  background: #fff; border-radius: 20px;
  padding: 44px 44px 40px; width: 420px; max-width: 100%;
  box-shadow: 0 24px 70px rgba(2, 20, 60, .32);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo-img {
  width: 72px; height: 72px; display: block; margin: 0 auto 14px;
  border-radius: 18px;
}
.login-logo { font-size: 27px; text-align: center; color: var(--theme); font-weight: 700; letter-spacing: .5px; }
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 0; font-size: 13.5px; }

.login-form .form-row { margin-bottom: 16px; }
.login-form .form-row input {
  width: 100%; padding: 14px 16px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #f9fafb; color: inherit; transition: border-color .16s, background .16s, box-shadow .16s;
}
.login-form .form-row input:focus {
  outline: none; background: #fff;
  border-color: var(--theme);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
/* 按钮居中并撑满表单宽度（原为 btn-block 靠左留白不齐） */
.login-actions { display: flex; justify-content: center; margin-top: 24px; }
.login-actions .btn {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 600;
  border-radius: 10px; letter-spacing: 2px;
  /* .btn 全局是 inline-flex，需显式居中，否则文字靠左 */
  justify-content: center; text-align: center;
}

/* 页脚：站名 + 版本号 */
.login-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  font-size: 12.5px; color: rgba(255,255,255,.86); text-align: center;
}
.login-foot-ver {
  padding: 2px 9px; border-radius: 999px; font-weight: 600;
  background: rgba(255,255,255,.20); border: 1px solid rgba(255,255,255,.28);
  color: #fff; letter-spacing: .3px;
}
.login-foot-copy { opacity: .78; }
/* v1.8.2 补全：登录页页脚的站名 */
.login-foot-name { font-weight: 600; color: #fff; }

@media (max-width: 480px) {
  .login-card { padding: 32px 24px 28px; border-radius: 16px; }
  .login-logo { font-size: 23px; }
  .login-logo-img { width: 62px; height: 62px; }
}

.btn-block { width: 100%; padding: 12px; font-size: 15px; }

.muted { color: var(--muted); }

/* Logo 上传 */
.logo-uploader { display: grid; grid-template-columns: 100px 1fr; gap: 12px; align-items: center; }
.logo-preview { width: 100px; height: 100px; border: 1px dashed var(--border); border-radius: 10px; background: #f9fafb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-controls { display: flex; flex-direction: column; gap: 6px; }
.logo-controls input[type="text"] { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.logo-file-row { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: #f9fafb; border: 1px dashed var(--border); border-radius: 6px; }
.logo-file-row input[type="file"] { font-size: 12px; }
.logo-action-row { display: flex; gap: 6px; }
.form-col-2 { grid-column: span 2; }

/* 缓存状态条（仪表盘 / 运维工具页共用） */
.cache-strip { display: flex; flex-wrap: wrap; gap: 18px; padding: 6px 0 14px; color: var(--muted); }
.cache-strip b { color: var(--text, #1f2937); font-weight: 700; margin-right: 3px; }
.cache-form-inline { margin-top: 8px; }
.cache-form-inline .btn { padding: 7px 18px; font-weight: 600; }
.btn-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fecaca; color: #7f1d1d; }
.details details summary { cursor: pointer; }

/* =============================================================
   响应式适配（修复Bug3：后台电脑/平板/手机适配）
   ============================================================= */

/* 移动端菜单按钮 */
.sidebar-toggle {
  display: none;
  background: none; border: none; font-size: 20px; cursor: pointer;
  padding: 6px 10px; color: var(--text); border-radius: 6px;
}
.sidebar-toggle:hover { background: #f1f5f9; }

/* 遮罩层 */
.sidebar-mask {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45); z-index: 90;
}

/* 平板 / 小笔记本（≤1024px）
   注意：这里**不再**把侧栏压成图标条。
   之前 1024px 就收起侧栏，导致 1024×768 / 1280 缩放的笔记本上
   Logo 被挤成一团「折叠」状、菜单文字也看不到，用户反馈就是这个问题。
   v1.8.1：现在 900–1024px 保留 216px 完整侧栏（只调整内容区栅格）。 */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr 1fr !important; }
}

/* 窄屏（≤900px）：侧栏才收成图标条，Logo 也要保持可读 */
@media (max-width: 900px) {
  /* v1.9：宽度统一走 --sb-w 变量。
     注意必须同时覆盖 min/max-width —— min-width 的计算优先级高于 width，
     只写 width:76px 会出现「说是 76px 实际 200px」的黑块（v1.8.10 踩过）。 */
  .admin-sidebar { --sb-w: 76px; overflow-y: auto; overflow-x: hidden; }
  /* Logo 只留品牌首字/图标，但给足高度与居中，不允许折行成一坨 */
  .admin-logo {
    padding: 18px 0; text-align: center; font-size: 16px; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: clip;
  }
  .admin-logo span { display: none; }
  /* 图标条模式下用「品牌首字」头衔替代长标题（由 JS/CSS 控制） */
  .admin-logo .logo-full { display: none; }
  .admin-logo .logo-mini { display: inline-block; }
  /* v1.8.10 关键修正（用户反馈「菜单项看不见，只剩一排分组标题」）：
     图标条模式下菜单项文字被 display:none，但分组标题（.nav-group-title）
     不是 <a>，不受该规则影响，于是侧栏里只剩「概览 / 站点运营 / 内容管理…」
     几行灰字，菜单项全空 —— 视觉上就是一大块「什么都没有的黑背景」。
     这里把分组标题一并隐藏，只留分组之间的一条细分隔线，
     让图标条模式真正变成干净的图标列表。 */
  .admin-nav .nav-group-title { display: none; }
  .nav-group { border-bottom: none; }
  /* 图标条模式下各分组之间用留白分隔，避免图标挤成一坨 */
  .nav-group + .nav-group { margin-top: 8px; padding-top: 8px; }
  /* v1.8.10：图标条模式下分组默认展开，否则 76px 里只剩几个分组分隔线，
     用户根本点不开子菜单（分组标题已隐藏，展开入口就没了）。 */
  .nav-group .nav-group-items { max-height: none !important; }
  /* v2.0：文字改用 .nav-txt 精确隐藏。
     旧规则 `.admin-nav a span:last-child{display:none}` 会把无徽标条目的
     图标（.nav-ic）当成「最后一个 span」一并藏掉，导致图标条模式下
     图标消失、只剩被 clip 成一条缝的文字。现在只藏 .nav-txt。 */
  .admin-nav a { padding: 12px 0; justify-content: center; gap: 0; font-size: 14px; }
  .admin-nav a .nav-txt { display: none; }
  .nav-ic { font-size: 20px; width: auto; }
}

/* 手机（≤768px）
   v1.8.1：抽屉宽度与「隐藏位移」同步改为 216px。
   注意 left 的负值必须 ≥ 侧栏宽度，否则收起时仍会露出边缘；
   原先 260/280 的组合在收窄侧栏后会导致抽屉收起不干净。
   v1.8.10：侧栏宽度改为自适应后，这里必须重新钉死抽屉宽度，
   否则按屏幕宽度膨胀，抽屉会盖满整屏。
   v1.9：同样收口到 --sb-w，并同步修正 left 负值。 */
@media (max-width: 768px) {
  .sidebar-toggle { display: inline-block; }
  .admin-sidebar {
    --sb-w: 240px;
    position: fixed; top: 0; left: -260px; bottom: 0; z-index: 100;
    transition: left .25s ease;
    height: 100vh; overflow-y: auto;
  }
  .admin-sidebar.open { left: 0; }
  .admin-logo { padding: 18px 16px; text-align: left; font-size: 17px; white-space: nowrap; }
  .admin-logo span { display: inline; }
  /* 手机端是 240px 抽屉，恢复完整品牌名 */
  .admin-logo .logo-full { display: inline; }
  .admin-logo .logo-mini { display: none; }
  /* v1.8.10：手机端恢复完整带文字的菜单，并把分组标题、分隔线一并还原 */
  .admin-nav .nav-group-title { display: flex; }
  .nav-group { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-group + .nav-group { margin-top: 0; padding-top: 0; }
  .admin-nav a { padding: 10px 16px; justify-content: flex-start; font-size: 15px; }
  .admin-nav a .nav-txt { display: inline; }
  .nav-ic { font-size: 17px; width: 20px; }
  /* v1.8.10：手机上所有分组默认展开。
     原先只有「当前所在分组」是 open，其余分组要点那行 12px 的灰色小标题才展开，
     用户反馈「菜单没有了」多半就是点不开/没意识到要点。
     手机屏幕小、滚动成本不高，直接全展开更符合直觉。 */
  .nav-group .nav-group-items { max-height: none !important; }
  .admin-main { width: 100%; }
  .admin-topbar { padding: 0 12px; gap: 8px; }
  .admin-crumb { font-size: 14px; }
  /* v1.7.9 调优：顶栏文字 12px → 13px，手机上更易辨认 */
  .admin-user { gap: 8px; font-size: 13px; }
  .admin-user a { font-size: 13px; }
  .admin-content { padding: 12px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head h2 { font-size: 17px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card b { font-size: 22px; }
  .panel { padding: 14px; border-radius: 10px; }
  /* 表格横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; font-size: 13px; }
  .table th, .table td { padding: 8px 10px; }
  .filter-bar { gap: 6px; }
  .chip { padding: 5px 10px; font-size: 12px; }
  .chart-grid { grid-template-columns: 1fr !important; }
  .form-row { grid-template-columns: 1fr !important; }
  .logo-uploader { grid-template-columns: 80px 1fr; }
  .usage-bar { gap: 8px; }
}

/* 小屏手机（≤480px） */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .admin-user span { display: none; }
  .admin-topbar .admin-crumb { font-size: 13px; }
  .btn { padding: 7px 12px; font-size: 12px; }
  .page-head-actions { flex-wrap: wrap; }
  .table { min-width: 520px; font-size: 12px; }
  .ops a { margin-right: 6px; font-size: 12px; }
}

/* 侧边栏打开时显示遮罩 */
body.sidebar-open .sidebar-mask { display: block; }

/* =============================================================
   v1.7.10 邮件配置：发送测试邮件
   ============================================================= */
.mail-test-box {
  margin-top: 6px; padding: 16px 18px;
  border: 1px dashed var(--border); border-radius: 10px;
  background: #f8fafc;
}
.mail-test-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mail-test-row input {
  flex: 1; min-width: 220px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: #fff; color: var(--text);
}
.mail-test-row input:focus { outline: none; border-color: var(--theme); }
.mail-test-result {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; line-height: 1.6; word-break: break-all;
}
.mail-test-result.ok  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.mail-test-result.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.mail-test-result.wait{ background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* v1.7.10 备份策略卡片 */
.policy-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; align-items: end; margin-top: 12px;
}
.policy-item { display: flex; flex-direction: column; gap: 6px; }
.policy-item .policy-label { font-size: 13px; font-weight: 600; color: var(--text); }
.policy-item select, .policy-item input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: #fff; color: var(--text);
}
.policy-item select:focus, .policy-item input:focus { outline: none; border-color: var(--theme); }
.policy-item small { font-size: 11px; line-height: 1.5; }
.policy-submit { justify-self: start; }
@media (max-width: 900px) { .policy-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .policy-grid { grid-template-columns: 1fr; } }

/* v1.7.10 广播邮件（分栏编辑 + 实时预览） */
.bc-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bc-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
.bc-edit { display: flex; flex-direction: column; gap: 14px; }
.bc-field { display: flex; flex-direction: column; gap: 6px; }
.bc-field label { font-size: 13px; font-weight: 600; color: var(--text); }
.bc-field input, .bc-field select, .bc-field textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: #fff; color: var(--text); font-family: inherit;
}
.bc-field textarea { resize: vertical; line-height: 1.7; }
.bc-field input:focus, .bc-field select:focus, .bc-field textarea:focus {
  outline: none; border-color: var(--theme); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.bc-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bc-tag {
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: #f8fafc; color: var(--text); font-size: 12px; cursor: pointer;
}
.bc-tag:hover { border-color: var(--theme); color: var(--theme); }
.bc-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.bc-preview { position: sticky; top: 12px; }
.bc-preview-head { font-size: 12px; color: #64748b; margin-bottom: 8px; font-weight: 600; }
.bc-preview-body {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #f1f5f9;
}
.bc-ph-head { padding: 16px 20px; background: linear-gradient(120deg,#1e40af 0%,#2563eb 55%,#7c3aed 100%); color: #fff; }
.bc-ph-title { font-size: 15px; font-weight: 700; }
.bc-ph-sub { margin-top: 4px; font-size: 12px; opacity: .9; word-break: break-all; }
.bc-ph-main { padding: 18px 20px; background: #fff; color: #0f172a; font-size: 13px; line-height: 1.8; min-height: 120px; word-break: break-word; }
.bc-ph-foot { padding: 12px 20px; border-top: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; font-size: 11px; }

@media (max-width: 1000px) {
  .bc-grid { grid-template-columns: 1fr; }
  .bc-preview { position: static; }
}

/* 友链代码（v1.7.11）：图文版 / 纯文字版 双 Tab + 复制 */
.embed-tabs { display: flex; gap: 8px; margin: 14px 0 10px; flex-wrap: wrap; }
.embed-tab {
  border: 1px solid #e6ebf2; background: #fff; color: #475569;
  padding: 7px 14px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all .15s;
}
.embed-tab:hover { border-color: #2563eb; color: #2563eb; }
.embed-tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.embed-pane { margin-bottom: 8px; }
.embed-preview {
  background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 12px;
  padding: 20px; text-align: center; margin-bottom: 10px;
}
.embed-copy { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.embed-copy .code-box { flex: 1; min-width: 260px; }
.embed-status { margin-top: 12px; color: #64748b; font-size: 13px; }
.embed-status b { color: #0f172a; }

/* ==================================================================
   v1.8.1 待办提醒卡片（迁移自 style.css 并重排）
   ------------------------------------------------------------------
   为什么要迁过来：这套 .todo-* 样式原先写在**前台** style.css 里，
   而后台布局 admin_header.php 只加载 css/admin.css，
   前台样式表是否被后台加载完全取决于页面偶然引入 —— 属于样式来源不明。
   现在统一下沉到后台样式表，后台页面的样式不再依赖前台文件。

   重排要点：由「图标 + 内容横向 flex」改为「上（图标+名称）/ 中（大数字）/
   下（说明）」的纵向结构，文字再长也不会把卡片撑变形。
   ================================================================== */
.todo-panel .panel-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.todo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 12px; font-weight: 700;
}
.todo-hint { font-size: 12px; }

/* 固定列宽区间：宽屏一行 5 列刚好排满，避免最后一张卡片孤行 */
.todo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.todo-card {
  display: flex; flex-direction: column;
  position: relative; min-width: 0;
  padding: 14px 16px 16px;
  border-radius: 12px; text-decoration: none;
  border: 1px solid #eef2f7; background: #fbfcfe;
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.todo-card:hover {
  box-shadow: 0 6px 20px rgba(15,23,42,.09);
  transform: translateY(-1px);
  border-color: #dbe3ef;
}
.todo-card.todo-zero { opacity: .55; }
.todo-card.todo-zero:hover { opacity: .85; }

/* 第一行：图标 + 名称，名称过长自动截断 */
.todo-card-top {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.todo-icon {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: #eef2ff;
}
.todo-name {
  font-size: 13px; font-weight: 600; color: #334155;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 第二行：大号数字，单独成行更醒目且不被文字挤压 */
.todo-num {
  font-size: 26px; font-weight: 700; line-height: 1.15;
  color: #0f172a; margin-top: 10px;
  font-variant-numeric: tabular-nums;   /* 数字等宽，多卡片对齐更整齐 */
}
/* 第三行：说明文案，允许折行，最长 2 行截断，保证卡片高度一致 */
.todo-desc {
  font-size: 12px; color: #94a3b8; line-height: 1.55; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}

.todo-go {
  position: absolute; right: 12px; bottom: 12px;
  font-size: 12px; font-weight: 600; color: #2563eb;
  opacity: 0; transition: opacity .16s ease;
}
.todo-card:hover .todo-go { opacity: 1; }

/* 分级配色：红色=需紧急处理，橙色=需关注，蓝色=提示性 */
.todo-bad  .todo-icon { background: #fee2e2; }
.todo-bad  .todo-num  { color: #dc2626; }
.todo-warn .todo-icon { background: #fef3c7; }
.todo-warn .todo-num  { color: #d97706; }
.todo-info .todo-icon { background: #dbeafe; }
.todo-info .todo-num  { color: #2563eb; }

/* 响应式降列：5 → 3 → 2 → 1 */
@media (max-width: 1200px) {
  .todo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .todo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .todo-grid { grid-template-columns: 1fr; }
  .todo-num { font-size: 22px; }
}

/* ==========================================================================
   v1.8.2 后台零星缺失类补全
   --------------------------------------------------------------------------
   这几处在模板中被使用，但 admin.css 从未定义，导致样式退化：
     .bc-panel      订阅者页外层卡片（原本只是普通 .panel，内边距不统一）
     .order-check   订单批量操作勾选框（尺寸偏小，移动端不好点）
     .preview-link  站点列表「预览」链接（与相邻操作按钮样式不齐）
     .stats-bar     死链/测速页顶部统计条（原本靠内联 style 撑）
   ========================================================================== */

/* ---- 订阅者页卡片 ---- */
.bc-panel { padding: 0; overflow: hidden; }
.bc-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.bc-panel-head h3 { margin: 0; font-size: 15px; }
.bc-panel-body { padding: 18px; }
@media (max-width: 640px) {
  .bc-panel-head { padding: 12px 14px; }
  .bc-panel-body { padding: 14px; }
}

/* ---- 订单批量勾选框 ---- */
.order-check {
  width: 16px; height: 16px;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
  accent-color: var(--theme);
}
@media (max-width: 640px) {
  /* 移动端放大点击热区，避免误触 */
  .order-check { width: 18px; height: 18px; }
}

/* ---- 站点列表「预览」链接 ---- */
.preview-link {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  font-size: 12px; font-weight: 500;
  color: var(--theme);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: all .16s;
}
.preview-link:hover { background: var(--theme); color: #fff; border-color: var(--theme); }

/* ---- 统计条（死链 / 测速页） ---- */
.stats-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.stats-bar > * { display: flex; align-items: baseline; gap: 6px; }
.stats-bar b { font-size: 19px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .stats-bar { gap: 10px 18px; padding: 12px 14px; }
  .stats-bar b { font-size: 17px; }
}

/* v2.0：后台表单补充说明类（此前缺失，导致提示文字与复选框无样式） */
.form-tip {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.6;
}
.form-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.form-check input[type="checkbox"] { width: 16px; height: 16px; }
.text-ok { color: #16a34a; }
.text-err { color: #dc2626; }
.text-muted { color: var(--muted, #64748b); }

/* =============================================================
   升级中心（v2.0）
   -------------------------------------------------------------
   背景：views/admin/upgrade.php 与 upgrade_manager.php 原先用的
   .um-* / .upgrade-* 类，在整个 admin.css 里一个字都没定义过 ——
   打开页面看到的是一堆没有样式的裸表单控件（站长反馈「重新设计一下」）。
   本次不再自造一套类名，直接复用后台既有设计系统
   （.page-head / .panel / .form-row / .form-grid / .form-actions /
     .form-tip / .form-check / .btn），只补升级页独有的三样：
     ① .upg-stats  版本数据块
     ② .upg-notice 提示条（占位更新源提醒 / 连通性结果）
     ③ .upg-log    升级日志终端
   ============================================================= */
.upg-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.upg-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; min-width: 0;
}
.upg-stat-k { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.upg-stat-v { font-size: 18px; font-weight: 700; line-height: 1.3; word-break: break-all; }
.upg-stat-v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 5px; }

/* 提示条：占位更新源 / 连通性测试结果 */
.upg-notice {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  font-size: 13px; line-height: 1.75; min-width: 0;
}
.upg-notice-ic { flex-shrink: 0; font-size: 15px; line-height: 1.5; }
.upg-notice-bd { min-width: 0; word-break: break-word; }
.upg-notice-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.upg-notice-ok   { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.upg-notice-err  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.upg-notice code { background: rgba(15,23,42,.07); border-radius: 4px; padding: 1px 5px; word-break: break-all; }
.upg-notice a { color: inherit; text-decoration: underline; }

/* 升级日志终端 */
.upg-log {
  margin-top: 12px; background: #0f172a; color: #cbd5e1;
  border-radius: 10px; padding: 12px 14px; max-height: 280px; overflow: auto;
  font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}
.upg-log:empty { display: none; }

/* admin-upgrade.js 输出成功/失败文案用的 .ok / .err */
.upgrade-wrap .ok  { color: #16a34a; font-weight: 600; }
.upgrade-wrap .err { color: #dc2626; font-weight: 600; }

/* =============================================================
   v2.1.3：升级进度条
   -------------------------------------------------------------
   结构（views/admin/upgrade.php #upgrade-progress 内）：
     .upg-bar-wrap  ── 轨道（含 .upg-bar 填充 + .upg-bar-text 百分比文字）
     .upg-stage     ── 阶段标签 + 状态文案
     .upg-detail    ── 当前正在写入的文件 / 下载速度
     .upg-stale     ── 「多久没进展」警告（warn 黄 / err 红）

   为什么百分比文字要盖在条子上而不是放右侧：
     条子本身很窄（手机端更窄），右侧放文字会把条子挤到 60px 以下，
     百分比反而看不清。压在条子上用白色文字 + 文字阴影，任何宽度都可读。
   ============================================================= */
.upg-progress { margin-top: 16px; }

.upg-bar-wrap {
  position: relative;
  height: 26px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.upg-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  /* 渐变让进度条有方向感，纯色块看起来像「一条静止的灰带」 */
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width .35s ease;   /* 与服务端 400ms 写盘节流匹配，动起来是连续的 */
}
/* 总大小未知时的「不确定态」：条纹流动，表示在跑但不知剩余量 */
.upg-bar-indeterminate {
  background: repeating-linear-gradient(
    45deg, #2563eb 0 12px, #3b82f6 12px 24px
  );
  animation: upg-stripes 1s linear infinite;
}
@keyframes upg-stripes {
  from { background-position: 0 0; }
  to   { background-position: 34px 0; }
}
.upg-bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, .45);
  pointer-events: none;
  letter-spacing: .3px;
}

.upg-stage {
  margin-top: 10px; font-size: 13.5px; line-height: 1.8; color: #334155;
  word-break: break-word;
}
.upg-stage-tag {
  display: inline-block;
  background: #eff6ff; color: #1d4ed8;
  border: 1px solid #bfdbfe; border-radius: 6px;
  padding: 1px 8px; margin-right: 6px;
  font-size: 12px; font-weight: 600;
}

.upg-detail {
  margin-top: 4px; font-size: 12.5px; color: var(--muted, #64748b);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  word-break: break-all;
}

.upg-stale {
  margin-top: 8px; font-size: 12.5px; line-height: 1.7;
  border-radius: 8px; padding: 8px 11px; border: 1px solid;
}
.upg-stale-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.upg-stale-err  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

@media (max-width: 560px) {
  .upg-bar-wrap { height: 22px; }
  .upg-bar-text { font-size: 11.5px; }
}

/* 「每 N 小时」这类行内数字输入：默认 .form-row input 是 width:100%，
   在行内布局里会把整行顶成两行，这里按需收窄。 */
.upg-num { width: 84px; max-width: 100%; }
.upg-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

@media (max-width: 1100px) {
  .upg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .upg-stats { grid-template-columns: 1fr; }
  .upg-stat-v { font-size: 16px; }
}

/* ============ v2.0.9：仪表盘窄提醒条 + 系统更新页 + 动态公告 ============ */
/* ① 仪表盘顶部窄提醒条 —— 单行，不抢首屏高度 */
.update-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 16px;
  background: linear-gradient(90deg, #eff6ff 0%, #f5f9ff 100%);
  border: 1px solid #bfdbfe; border-left: 3px solid var(--theme);
  border-radius: 8px;
}
.update-bar .ub-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
.update-bar .ub-text { font-size: 13.5px; color: var(--text); min-width: 0; }
.update-bar .ub-text b { color: var(--theme); }
.update-bar .ub-notes { color: var(--muted); }
.update-bar .ub-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
@media (max-width: 720px) {
  .update-bar { flex-wrap: wrap; }
  .update-bar .ub-actions { margin-left: 0; width: 100%; }
}

/* ② 系统更新页：版本状态网格（替代原来的纵向 ver-line，四列更省高度） */
.ver-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin: 4px 0 0;
}
@media (max-width: 900px) { .ver-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .ver-grid { grid-template-columns: 1fr; } }
.ver-cell {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 14px; background: #f8fafc; border-radius: 8px;
  border: 1px solid var(--border); min-width: 0;
}
.ver-cell .ver-key { font-size: 12.5px; }
.ver-cell .ver-val { font-size: 15px; font-weight: 600; }

/* ③ 站长动态：底部「共 N 条 / 查看更多」行 */
.notice-more {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ④ 公告编辑页：表单内联两列 */
.form-row-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .form-row-inline { grid-template-columns: 1fr; } }

/* ⑤ 公告预览区 */
.notice-preview { padding: 6px 2px 2px; }
.notice-preview h4 { margin: 0 0 10px; font-size: 16px; color: var(--text); }
.notice-preview-body { font-size: 14px; line-height: 1.85; color: var(--text); }
.notice-preview-body p { margin: 0 0 10px; }
.notice-preview-body ul, .notice-preview-body ol { margin: 0 0 10px; padding-left: 22px; }
.notice-preview-body li { margin: 3px 0; }

/* ⑥ 状态文字色（公告列表用） */
.text-ok    { color: #16a34a; font-weight: 600; }
.text-warn  { color: #d97706; font-weight: 600; }
.text-muted { color: var(--muted); }

/* 系统更新页：站长动态为空时的「随机网站 / 随机文章」动态展示兜底 */
.dyn-show { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dyn-col  { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 10px 12px; }
.dyn-h    { font-size: 12.5px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.dyn-list { list-style: none; margin: 0; padding: 0; }
.dyn-list li { padding: 4px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.dyn-list li:last-child { border-bottom: 0; }
.dyn-list a { color: #2563eb; text-decoration: none; }
.dyn-list a:hover { text-decoration: underline; }
@media (max-width: 640px) { .dyn-show { grid-template-columns: 1fr; } }

/* ============================================================================
   v2.1.4 授权体系（通用版）
   ----------------------------------------------------------------------------
   admin_header.php 从 v2.1 起就在渲染 .lic-banner，但 admin.css 里一直没有
   对应的样式定义 —— 那条横幅在真实环境里是**裸文字**，紧贴在页面顶部，
   没有底色、没有边距、和下面的内容糊在一起。
   这类「视图写了、样式没写」的问题在本地开发时最难发现：功能是对的、
   数据也是对的，只有打开真站点才看得出难看。
   ============================================================================ */

.lic-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin: 0 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 13.5px;
    line-height: 1.7;
}
.lic-banner-txt { flex: 1 1 auto; }
.lic-banner-btn {
    flex: 0 0 auto;
    padding: 5px 13px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(255, 255, 255, .75);
    border: 1px solid currentColor;
    color: inherit;
}
.lic-banner-btn:hover { background: #fff; }

/* 四档语义色。与 LicenseService::statusLevel() 的 ok/warn/danger/info 一一对应，
   改配色时只需对照那一处，不要凭感觉加第五种。 */
.lic-banner-warn   { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.lic-banner-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.lic-banner-info   { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.lic-banner-ok     { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

@media (max-width: 640px) {
    .lic-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
    .lic-banner-btn { align-self: stretch; text-align: center; }
}

/* 授权页：可复制的内容（授权码、接口地址）统一等宽 + 可选中，
   避免站长用鼠标拖选时把两侧中文一起拖走。 */
.lic-code {
    display: inline-block;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    letter-spacing: .4px;
    user-select: all;
    word-break: break-all;
}

/* =============================================================
   v2.7.0 后台 UI 美化增强（追加块）
   ------------------------------------------------------------------
   说明：本块统一追加在文件末尾，依赖「同优先级后写生效」自然覆盖，
   不改写上面任何历史规则，避免影响已稳定的页面。内容：
     1) 今日动态数据带（.today-strip）
     2) 表格：斑马纹 + 高亮 hover + 行内操作按钮统一
     3) 表单：输入框聚焦高亮 + 统一高度/圆角
     4) 统计卡：悬浮上浮
     5) 提示条：成功/错误色更醒目（左侧色条 + 加粗）
   ============================================================= */

/* ---------- 1) 今日动态数据带 ---------- */
.today-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.today-item {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.today-item::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--theme), #60a5fa);
}
.today-num { font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.today-label { font-size: 12.5px; color: var(--muted); }
a.today-item.today-link { color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.today-item.today-link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.08); border-color: var(--theme); }
@media (max-width: 900px) { .today-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .today-strip { grid-template-columns: 1fr 1fr; gap: 8px; } .today-item { padding: 10px 12px; } .today-num { font-size: 20px; } }

/* ---------- 2) 表格：斑马纹 + hover + 操作按钮统一 ---------- */
.table tbody tr:nth-child(even) { background: #fafbfc; }
.table tbody tr:hover { background: #eff6ff !important; }
.table thead th:first-child, .table tbody td:first-child { padding-left: 16px; }
.table thead th:last-child, .table tbody td:last-child  { padding-right: 16px; }
.table-wrap { border: 1px solid var(--border); border-radius: 10px; }
.table thead th { border-bottom: 1px solid var(--border); }

/* 行内操作链接统一为「小号描边按钮」，与 .btn-mini 视觉一致 */
.table td a:not(.btn):not(.tag):not(.cell-more) {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--theme);
  background: rgba(37,99,235,.07);
  border: 1px solid rgba(37,99,235,.22);
  border-radius: 7px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.table td a:not(.btn):not(.tag):not(.cell-more):hover {
  background: var(--theme);
  border-color: var(--theme);
  color: #fff;
}

/* ---------- 3) 表单：聚焦高亮 + 统一 ---------- */
.form-row input, .form-row select, .form-row textarea,
.inline-form input, .inline-form select {
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus,
.inline-form input:focus, .inline-form select:focus {
  border-color: var(--theme);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-row label { color: #374151; }
/* 水平表单变体：标签右对齐、与输入框同一行（需要时给 form-row 加 .form-horizontal） */
.form-row.form-horizontal {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  column-gap: 14px;
}
.form-row.form-horizontal > label { margin-bottom: 0; text-align: right; }
@media (max-width: 700px) {
  .form-row.form-horizontal { grid-template-columns: 1fr; }
  .form-row.form-horizontal > label { text-align: left; margin-bottom: 6px; }
}

/* ---------- 4) 统计卡悬浮（与 dashboard 内联色条互补） ---------- */
.stat-card { transition: transform .18s ease, box-shadow .18s ease; }
a.stat-card-link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.10); }

/* ---------- 5) 提示条更醒目 ---------- */
.alert {
  font-weight: 500;
  border-left-width: 4px;
  border-left-style: solid;
  padding: 12px 16px 12px 14px;
}
.alert-success { border-left-color: #059669; }
.alert-danger  { border-left-color: #dc2626; }
.alert-warning { border-left-color: #d97706; }
.alert-info    { border-left-color: #2563eb; }

/* =============================================================
   v3.0.0 新后台外壳：本地 SVG 图标 / 全局搜索 / 面包屑 / 收藏
   -------------------------------------------------------------
   仅新增样式，不改既有规则；历史页面在这套外壳下继续可用。 */
.nav-svg { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
/* 侧栏分组标题前的域图标 */
.nav-group-ic { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.nav-group-ic .nav-svg { opacity: .85; }
.nav-group-ic > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 图标条模式（≤900px）：分组标题本就隐藏，域图标随之隐藏 */

/* 顶栏：全局功能搜索框 */
.admin-topbar { gap: 10px; }
.admin-search { position: relative; flex: 0 1 320px; display: flex; align-items: center; gap: 6px;
  background: #f1f5f9; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; }
.admin-search-ic { color: var(--muted); display: inline-flex; }
.admin-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 13px; }
.admin-search-pop { position: absolute; top: calc(100% + 6px); left: 0; width: 320px; max-height: 360px; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(20,40,80,.14); z-index: 900; }
.asr { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 13px; color: var(--text); }
.asr:hover, .asr-on { background: #eef4ff; }
.asr-g { color: var(--muted); font-size: 11.5px; flex: none; }
.asr-empty { padding: 12px; color: var(--muted); font-size: 12.5px; }

/* 面包屑 */
.admin-crumb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.admin-crumb .crumb-domain { color: var(--muted); font-weight: 500; }
.admin-crumb .crumb-sep { color: #cbd5e1; }
.admin-crumb .crumb-page { font-weight: 600; color: var(--text); }

/* 收藏按钮 + 收藏弹层 */
.fav-btn { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 7px;
  padding: 4px 10px; font-size: 13px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.fav-btn.is-on { color: #f59e0b; border-color: #fcd34d; background: #fffbeb; }
.admin-user { position: relative; display: flex; align-items: center; gap: 12px; }
.fav-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(20,40,80,.14); z-index: 900; }
.fav-item { display: flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; }
.fav-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-del { border: 0; background: transparent; color: #cbd5e1; cursor: pointer; font-size: 16px; line-height: 1; }
.fav-del:hover { color: #dc2626; }

/* 页内子页 Tab（合并页归集用，见 _admin_subtabs.php） */
.admin-subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.admin-subtabs a { padding: 8px 14px; font-size: 13.5px; color: var(--muted); border: 1px solid transparent; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; }
.admin-subtabs a:hover { color: var(--text); background: #f8fafc; }
.admin-subtabs a.on { color: var(--theme); border-bottom-color: var(--theme); font-weight: 600; }

/* 窄屏：搜索框压缩、收藏文字隐藏 */
@media (max-width: 1100px) {
  .admin-search { flex: 0 0 180px; }
  .fav-txt { display: none; }
}
@media (max-width: 900px) {
  .admin-search { display: none; }
  .admin-crumb .crumb-domain { display: none; }
}

/* =============================================================
   v3.0.1 窄屏 / 手机浏览器走查兜底（纯样式，不改业务）
   -------------------------------------------------------------
   目标：在 375 / 390 / 768px 下保证
     document.documentElement.scrollWidth <= window.innerWidth
   （整页不出现横向滚动条），宽表格只在自身 .table-wrap 内横滚。
   思路：先治本（各视图把宽表格包进 .table-wrap），这里只做
   「最后一道防线」——任何漏网的长 URL / 宽 flex 子项都不得把
   整页撑宽。用 overflow-x:clip 而非 hidden：clip 不创建滚动容器，
   不会打断 .admin-topbar 的 position:sticky。 */
.admin-main { max-width: 100%; }
/* 内容区：横向溢出一律裁在内容区内部，不外溢到 body */
.admin-content { max-width: 100%; overflow-x: clip; overflow-wrap: break-word; }
/* 长 URL / 代码块 / 长链接允许断行，不撑破列宽 */
.admin-content code,
.admin-content pre {
  max-width: 100%; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.admin-content a { overflow-wrap: anywhere; }
.admin-content img { max-width: 100%; height: auto; }
/* 表单控件不超出容器（全局已 box-sizing:border-box，这里只限宽） */
.admin-content input,
.admin-content select,
.admin-content textarea { max-width: 100%; }
/* 数字/小输入保持原宽度，只是不许比父容器更宽 */
.admin-content input[type="number"],
.admin-content input[type="text"],
.admin-content input[type="password"],
.admin-content input[type="email"] { max-width: 100%; }

/* 宽表格统一横滚容器：确保即便个别视图漏写，表格也能在容器内滑，
   而不是把整页撑宽。table-wrap 已在上方定义 overflow-x:auto，
   这里补 min-width:0 让它在 flex/grid 子项里也能收缩。 */
.table-wrap { min-width: 0; max-width: 100%; -webkit-overflow-scrolling: touch; }
/* 表格自身不写死会撑爆视口的宽度；最小宽度仅用于「宽表格横滚」而非整页 */
.table { max-width: 100%; }

/* 极窄屏（≤480px）：统计卡 / 版本网格 / 表单栅格单列堆叠，gap 收紧 */
@media (max-width: 480px) {
  .admin-content { padding: 10px; }
  .stat-grid { gap: 8px; }
  .ver-grid { gap: 10px; }
  .page-head { margin-bottom: 12px; }
}
