
  * { box-sizing: border-box; }
  body { font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
         margin: 0; background: #0f1220; color: #e6e8f0; }
  .wrap { max-width: 760px; margin: 40px auto; padding: 0 16px; }
  /* 管理端 / 激活页：最外层容器铺满视口，不再 760px 居中 */
  .wrap.full { max-width: none; margin: 0; padding: 0; }
  h1 { font-size: 22px; margin: 0 0 4px; }
  .sub { color: #9aa0b5; font-size: 13px; margin-bottom: 20px; }
  /* 左侧可收缩侧边栏菜单（替代原顶部 tabs） */
  .layout { display: flex; gap: 16px; align-items: flex-start; max-width: 2200px; margin: 24px 16px; }
  .content { flex: 1; min-width: 0; }
  .sidebar { flex: 0 0 200px; width: 200px; background: #171b29; border-radius: 12px; padding: 10px; position: sticky; top: 16px; max-height: calc(100vh - 132px); overflow-y: auto; }
  /* 侧边栏内部滚动条（细、低调，避免抢视觉） */
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: #2a3047; border-radius: 3px; }
  .sidebar::-webkit-scrollbar-thumb:hover { background: #3a4258; }
  /* 全站滚动条：纵向适中、横向明显常驻（深色主题下高对比，缩窗时不隐蔽） */
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: #0c1020; border-radius: 6px; }
  *::-webkit-scrollbar-thumb { background: #39415e; border-radius: 6px; }
  *::-webkit-scrollbar-thumb:hover { background: #4a557a; }
  *::-webkit-scrollbar:horizontal { height: 12px; }
  *::-webkit-scrollbar-corner { background: transparent; }
  /* Firefox：给横向滚动容器着色（WebKit 走上面的 ::-webkit 规则） */
  div[style*="overflow-x:auto"], table { scrollbar-color: #39415e #0c1020; }
  .sidebar.collapsed { flex-basis: 46px; width: 46px; }
  .sidebar-toggle { text-align: center; cursor: pointer; color: #9aa0b5; font-size: 14px; padding: 6px 0 10px; user-select: none; }
  .sidebar-toggle:hover { color: #e6e8f0; }
  /* 「展开/收起功能菜单」文字只在窄屏显示（桌面端保留纯 ⏸ 图标，收起后成窄条） */
  .sidebar-toggle .sb-toggle-txt { display: none; }
  /* 左侧导航「大类 + 子页签」：58 个页签收进 12 个可折叠大类。
     默认只展开当前页签所在组（见 core.js navGroup*），避免侧栏又变回一长串平铺。 */
  .nav-group { margin-bottom: 6px; }
  .nav-group-head {
    display: flex; align-items: center; gap: 7px; padding: 9px 10px;
    border-radius: 8px; cursor: pointer; user-select: none;
    background: #202741; color: #cfd8f5; font-size: 13px; font-weight: 700;
    border: 1px solid #2b3558;
  }
  .nav-group-head:hover { background: #283255; color: #fff; }
  /* 当前页签所在的大类，即使收起也要能一眼看出「我在这儿」 */
  .nav-group.has-active > .nav-group-head { border-color: #5b7cff; color: #fff; }
  .ng-caret { display: inline-block; font-size: 11px; color: #8fb0ff; transition: transform .15s ease; }
  .nav-group.open > .nav-group-head .ng-caret { transform: rotate(90deg); }
  .ng-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ng-count {
    flex: none; min-width: 20px; text-align: center; padding: 1px 5px;
    border-radius: 10px; background: #2e3a63; color: #a9bcf5; font-size: 11px; font-weight: 600;
  }
  /* 子页签容器：收起不占位；展开时左侧一道细线表示层级 */
  .nav-group-items { display: none; margin: 4px 0 0 6px; padding-left: 8px; border-left: 2px solid #2b3558; }
  .nav-group-items.open { display: block; }
  .nav-group-items .nav-item { font-size: 13px; padding: 8px 10px; }
  .nav-item { padding: 10px 12px; border-radius: 8px; background: #1b2030; cursor: pointer; font-size: 14px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; position: relative; padding-right: 26px; }
  .nav-item:hover { background: #232a40; }
  .nav-item.active { background: #3b6fff; color: #fff; }
  /* 危险操作导航项（如「数据清理」）：红色醒目，提示不可逆 */
  .nav-item.danger-nav { background: #3a1722; color: #ff9bb0; }
  .nav-item.danger-nav:hover { background: #5a2233; }
  .nav-item.danger-nav.active { background: #b3304a; color: #fff; }
  /* 左侧导航「固定/置顶」：固定的页签排到最前（名单存后台 /myadmin/api/nav_pins，见 js/navpin.js） */
  .nav-pin {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font-size: 12px; line-height: 1; padding: 2px 3px; border-radius: 4px;
    opacity: .3; cursor: pointer; user-select: none;
  }
  .nav-pin:hover { opacity: .85; background: rgba(255,255,255,.12); }
  .nav-pin.on { opacity: 1; }
  .nav-item.pinned { background: #26315a; }
  .nav-item.pinned .nav-label { font-weight: 700; }
  /* 侧栏折叠成窄条时没有空间放图钉，直接隐藏 */
  .sidebar.collapsed .nav-pin { display: none; }
  .sidebar.collapsed .nav-item { padding-right: 0; }
  /* 角色受限导航项默认隐藏，仅管理员登录后由 JS 显式显示，
     避免网速慢、外部 JS 尚未加载时短暂暴露所有管理菜单 */
  .nav-item.admin-only { display: none; }
  .sidebar.collapsed .nav-item { text-align: center; padding: 10px 0; }
  .sidebar.collapsed .nav-label { display: none; }
  /* 折叠成窄条时整个大类一起隐藏。必须 !important：applyRole() 会给
     .nav-group.admin-only 写内联 display（管理员登录后会留下 display:''）。 */
  .sidebar.collapsed .nav-group { display: none !important; }
  /* 侧边栏「全局机器码搜索」：任意管理页签下回车即可查机器码详情。
     显隐由 core.js applyRole 按管理员角色控制（页面加载前靠内联 style 隐藏防闪现）；
     侧栏折叠成窄条时空间不足，整体隐藏。 */
  /* 配置搜索（侧边栏顶部）：搜功能/配置项 → 跳到对应面板并高亮 */
  .cfg-search { margin-bottom: 8px; }
  .cfg-search input {
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    border-radius: 8px; border: 1px solid #2a3047; background: #1b2030;
    color: #e6e8f0; font-size: 13px; outline: none;
  }
  .cfg-search input:focus { border-color: #3b6fff; }
  .cfg-search input::placeholder { color: #9aa0b5; }
  .sidebar.collapsed .cfg-search { display: none; }
  /* 收起态的搜索图标（点一下展开侧栏并聚焦搜索框） */
  .cfg-search-mini {
    display: none; text-align: center; cursor: pointer; font-size: 15px;
    padding: 6px 0 10px; user-select: none; color: #9aa0b5;
  }
  .cfg-search-mini:hover { color: #e6e8f0; }
  .sidebar.collapsed .cfg-search-mini { display: block; }
  /* 搜索态：隐藏导航项，只留结果列表（侧边栏 overflow-y:auto，不能用绝对定位下拉） */
  .sidebar.cfg-searching .nav-item,
  .sidebar.cfg-searching .nav-group,
  .sidebar.cfg-searching .mc-global-search { display: none; }
  .cfg-results { margin-top: 6px; }
  .cfg-res {
    padding: 7px 9px; border-radius: 7px; cursor: pointer;
    font-size: 13px; line-height: 1.5; color: #e6e8f0;
  }
  .cfg-res:hover { background: #1b2236; }
  .cfg-res .ck {
    display: inline-block; margin-right: 6px; padding: 1px 5px; border-radius: 5px;
    background: #232a3d; color: #8fb0ff; font-size: 11px; vertical-align: 1px;
  }
  .cfg-res .cp { display: block; margin-top: 1px; color: #6f7794; font-size: 11px; }
  .cfg-none { padding: 9px; color: #9aa0b5; font-size: 12px; line-height: 1.7; }
  /* 跳转命中的高亮 */
  @keyframes cfghit {
    0%, 55% { outline: 2px solid #3b6fff; outline-offset: 2px; background: rgba(59,111,255,.10); }
    100%    { outline: none; background: transparent; }
  }
  .cfg-hit { animation: cfghit 1.9s ease-out; }

  .mc-global-search { margin-bottom: 8px; }
  .mc-global-search input {
    width: 100%; box-sizing: border-box; padding: 8px 10px;
    border-radius: 8px; border: 1px solid #2a3047; background: #1b2030;
    color: #e6e8f0; font-size: 13px; outline: none;
  }
  .mc-global-search input:focus { border-color: #3b6fff; }
  .mc-global-search input::placeholder { color: #9aa0b5; }
  .sidebar.collapsed .mc-global-search { display: none; }
  /* 移动端：侧栏改为顶部横向滚动条 */
  @media (max-width: 720px) {
    .layout { flex-direction: column; }
    /* 导航改为可换行的两列网格，避免横向密集挤成一条 */
    .sidebar { position: static; flex-basis: auto; width: 100%; display: flex; flex-wrap: wrap; gap: 8px; overflow-x: visible; }
    .sidebar.collapsed { flex-basis: auto; width: 100%; }
    /* 窄屏：搜索框与结果列表各占整行（侧栏是横向换行布局） */
    .cfg-search { flex: 1 1 100%; }
    .cfg-results { flex: 1 1 100%; }
    .cfg-res { font-size: 13px; }
    /* 折叠开关：窄屏做成整行可点的条（⏸ + 文字），并常显；桌面端只显示 ⏸ */
    .sidebar-toggle {
      display: flex; align-items: center; gap: 8px; flex: 1 1 100%;
      text-align: left; padding: 11px 12px; background: #1b2030; border-radius: 8px;
      font-size: 14px; color: #cdd3e6;
    }
    .sidebar-toggle .sb-toggle-txt { display: inline; }
    /* 收起态：只留「展开功能菜单」条，隐藏 40+ 个菜单项与搜索框 ——
       否则每次进页面都要往下滑很久才能看到配置区。
       必须 !important：applyRole() 会给 .nav-item.admin-only 写内联 display:block。 */
    .sidebar.collapsed .nav-item,
    .sidebar.collapsed .nav-group,
    .sidebar.collapsed .mc-global-search { display: none !important; }
    /* 展开态：限高 + 内部滚动，避免把下方配置区顶出屏幕 */
    .sidebar:not(.collapsed) { max-height: 60vh; overflow-y: auto; }
    /* 窄屏：大类占整行，展开后的子页签仍保持原来的两列网格 */
    .nav-group { flex: 1 1 100%; margin-bottom: 0; }
    .nav-group-head { padding: 11px 12px; font-size: 14px; }
    .nav-group-items { margin: 6px 0 0 0; padding-left: 0; border-left: 0; }
    .nav-group-items.open { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    .nav-group-items .nav-item { flex: 1 1 calc(50% - 8px); text-align: center; margin-bottom: 0; }
    .nav-item { white-space: nowrap; margin-bottom: 0; flex: 1 1 calc(50% - 8px); text-align: center; }
    /* 搜索框在移动端占满一整行，排在菜单最前 */
    .mc-global-search { flex: 1 1 100%; margin-bottom: 0; }
  }
  .panel { display: none; background: #171b29; padding: 20px; border-radius: 12px; }
  .panel.active { display: block; }
  /* 新卡密生成界面：子 Tab（单类型切换） */
  .ctype-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
  .ctype-tab { padding: 8px 16px; border-radius: 8px; background: #1b2030; cursor: pointer; font-size: 14px; color: #b9bed0; user-select: none; }
  .ctype-tab:hover { background: #232a40; }
  .ctype-tab.active { background: #3b6fff; color: #fff; }
  .ctype-pane { margin-top: 14px; padding: 14px; border: 1px solid #2a3047; border-radius: 10px; background: #1a1f30; }
  .fields-box { display: flex; flex-wrap: wrap; gap: 8px 16px; max-height: 200px; overflow: auto; padding: 6px; border: 1px solid #2a3047; border-radius: 8px; background: #0f1322; }
  .fields-box label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: #e6e8f0; white-space: nowrap; }
  /* 单卡多权益组合面板：权益分块 / 头部勾选 / GPS 多选名单 */
  .perk-block { border: 1px solid #2a3047; border-radius: 10px; background: #171c2e; padding: 12px 14px; }
  /* 数量类权益容器（qty-col）：由竖列改横向流式 —— 开关+标题的矮扁卡自动换行，
     一眼扫过是横排的一组开关；align-items:flex-start 防止块被同行的高卡
     （GPS 名单等）拉伸成一大截空白竖条 */
  .qty-col { align-items: flex-start; }
  .qty-col .perk-block { flex: 1 1 230px; }
  .perk-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #e6e8f0; margin: 0; cursor: pointer; user-select: none; }
  /* ===== 兑换项编辑弹窗（#pf-form-mask）紧凑化 =====
     这个弹窗字段多、组合权益又分了好几块（基础 / GPS / 摄像头 / 麦克风 / 备份 …），
     沿用全局 label 上下 12px/6px 与 perk-block 12px 内边距后，行与行之间空得厉害。
     只在该弹窗内压紧一档，其它页面/弹窗不受影响。 */
  #pf-form-mask .modal label { margin: 6px 0 3px; }
  #pf-form-mask .perk-block { padding: 9px 10px; }
  /* perk-head 本身也是 <label>，特异性要压过上面的 label 规则 */
  #pf-form-mask .modal .perk-head { margin: 0 0 2px; font-size: 13px; }
  #pf-form-mask .hint { margin-top: 4px; line-height: 1.5; }
  #pf-form-mask input:not([type="checkbox"]):not([type="radio"]),
  #pf-form-mask select { padding: 7px 9px; }
  /* 行内样式压一层：权益块之间的 gap 12px、各 .row 的 margin-top:8px */
  #pf-form-mask #pf_feature_box > div[style*="display:flex"] { gap: 10px !important; }
  #pf-form-mask .row[style*="margin-top:8px"] { margin-top: 6px !important; }
  .perk-body { margin-top: 10px; }
  .perk-body .hint { margin-top: 6px; }
  .gps-multi { display: flex; flex-wrap: wrap; gap: 8px 14px; max-height: 176px; overflow: auto; padding: 8px; border: 1px solid #2a3047; border-radius: 8px; background: #0f1322; }
  .gps-multi label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: #e6e8f0; white-space: nowrap; }
  .gps-multi .gps-app-name { color: #8fb0ff; font-size: 11px; opacity: 0.85; }
  /* 字段卡：左侧分组列 + 编辑区 */
  /* 兑换目录每行的操作区（排序输入 + ↑ / ↓ / 编辑 / 删除）：作为一个整体并排，
     不再让 4 个按钮各自参与整行换行（窄屏会退化成「一行一个按钮」） */
  .pf-row-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .nc-groups-col { flex: 0 0 200px; display: flex; flex-direction: column; }
  .nc-groups-box { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow: auto; padding: 6px; border: 1px solid #2a3047; border-radius: 8px; background: #0f1322; }
  .nc-group-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 10px; border-radius: 7px; background: #1b2030; cursor: pointer; font-size: 13px; color: #cdd3e6; user-select: none; }
  .nc-group-item:hover { background: #232a40; }
  .nc-group-item.selected { background: #3b6fff; color: #fff; }
  .nc-group-n { font-size: 11px; opacity: 0.75; background: rgba(255,255,255,0.12); padding: 1px 6px; border-radius: 8px; }
  .nc-group-tag { font-size: 10px; color: #8fb0ff; }
  .nc-group-empty { font-size: 12px; color: #6b7390; padding: 8px 4px; }
  .nc-group-edit { margin-top: 8px; }
  .nc-group-edit input { margin-top: 0; }
  /* 自动赠送配置：字段卡分组+勾选选择器 */
  .ag-field-wrap { position: relative; }
  .ag-field-pop { position: absolute; z-index: 50; top: 100%; left: 0; margin-top: 4px; width: 320px;
    background: #1a1f30; border: 1px solid #3b6fff; border-radius: 10px; padding: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.45); }
  .ag-field-pop .row { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
  .ag-field-cbs { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 180px; overflow: auto;
    padding: 6px; border: 1px solid #2a3047; border-radius: 8px; background: #0f1322; margin: 6px 0; }
  .ag-field-cbs label { display: inline-flex; align-items: center; gap: 6px; margin: 0;
    font-size: 13px; color: #e6e8f0; white-space: nowrap; }
  .ag-vp-summary { font-size: 12px; color: #8fb0ff; margin-left: 6px; }
  label { display: block; font-size: 13px; color: #b9bed0; margin: 12px 0 6px; }
  input, textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #2a3047;
        background: #0f1322; color: #e6e8f0; font-size: 14px; }
  /* 单行输入框限宽：机器码 / 搜索 / 邮箱 / 包名等统一不超过 360px，避免过长占满整行。
     max-width 优先级高于 width:100%（含内联 style），故可收敛所有过宽的文本输入框。 */
  input[type="text"], input[type="password"], input[type="email"],
  input[type="search"], input[type="url"], input[type="number"], input:not([type]) {
    max-width: 360px;
  }
  /* 「记住口令」复选框行：上面 input{width:100%} 会把复选框也撑满整行、还被塞进 10px 内边距，
     这里把复选框收回成小方块，并压掉全局 label 的上下外边距 */
  .admin-remember {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 10px 0 2px; font-size: 13px; color: #b9bed0; cursor: pointer;
  }
  .admin-remember input[type="checkbox"]:not(.sw) {
    width: auto; max-width: none; margin: 0; padding: 0; accent-color: #3b6fff;
  }
  /* 复选框 / 单选框：上面 input{width:100%} 是给文本框用的，会把 checkbox 也撑满整行、
     把紧邻的文字挤到最右边 —— 「积分管理 → 支付方式（用户端入口开关）」在窄屏下就是
     一个大方框 + 复选框居中 + 文字贴右。这里统一收回自身尺寸并去掉内边距，
     在 flex 行里也不允许被拉伸（列表里想排多列时再单独覆盖）。 */
  /* **必须排除 .sw**：那是用 appearance:none + 固定 42×24 画出来的滑块开关，
     这条 width:auto 的特异性（type 属性选择器）比 `.sw` 的类选择器高，会把它的
     尺寸覆盖掉 → 开关塌成一个小块、18px 的白点看起来像个大圆压在旁边文字上
     （「当前包启用自动赠送」「开关类」配置项都中招）。 */
  input[type="checkbox"]:not(.sw), input[type="radio"]:not(.sw) {
    width: auto; max-width: none; padding: 0; margin: 0; flex: none;
    accent-color: #3b6fff;
  }
  /* 输入框清空按钮（clearable.js 注入）：右侧悬浮 ×，有内容时显示 */
  .clearable-wrap { position: relative; display: block; width: 100%; }
  /* 输入框 + 一键随机按钮并排 */
  .field-with-btn { display: flex; gap: 8px; align-items: center; }
  .field-with-btn > .clearable-wrap { flex: 1; width: auto; }
  .field-with-btn > button.mini { margin-top: 0; flex: 0 0 auto; padding: 0 14px; height: 38px; font-size: 13px; background: #2a3047; color: #cdd3e6; border-radius: 8px; border: 1px solid #3a4258; }
  .field-with-btn > button.mini:hover { background: #3b6fff; color: #fff; }
  /* 行内主操作按钮（如「查询机器码 / 查询明细」）：位于输入框右侧，保持主题蓝；
     不加此规则会被上面的 .field-with-btn > button.mini 底色覆盖成灰按钮 */
  .field-with-btn > button.mini.primary { background: #3b6fff; color: #fff; border-color: #3b6fff; }
  .field-with-btn > button.mini.primary:hover { background: #2f5be0; }
  /* 表单行内的紧凑按钮（如「账户调整」的赠送积分 / 执行全员赠送）：
     全局 button 带 margin-top:16px + padding:10px 20px，放在 align-items:center 的 .row 里
     会把整行高度顶高一大截，按钮本身也比输入框粗一圈。这里压成与输入框同高（38px）、
     margin-top 归零，只收窄按钮，不影响其它按钮。 */
  .btn-sm { margin-top: 0; padding: 0 14px; height: 38px; font-size: 13px; border-radius: 8px; }
  .clearable-wrap .input-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; border-radius: 50%; border: none; background: #2a3047; color: #9aa0b5;
    font-size: 12px; line-height: 1; cursor: pointer; display: none; align-items: center; justify-content: center;
    padding: 0; }
  .clearable-wrap .input-clear:hover { background: #3a4a7a; color: #fff; }
  /* 平铺筛选按钮组（替代下拉框）：状态筛选等场景，所有选项一眼可见、点一下即切换 */
  .seg-opts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  .seg-opt { margin-top: 0; padding: 5px 14px; height: 32px; font-size: 13px; border-radius: 8px;
             cursor: pointer; background: #232a3d; border: 1px solid #2f3752; color: #cfd4e6; }
  .seg-opt:hover { background: #2a3047; color: #fff; }
  .seg-opt.on { background: #3b6fff; border-color: #3b6fff; color: #fff; font-weight: 600; }
  /* 推送记录：窄屏卡片视图（小界面不挤表格） */
  .nu-card { background: #161a2c; border: 1px solid #2a3047; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
  .nu-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .nu-card-sel { font-size: 12px; color: #cfd4e6; }
  .nu-card-kind { font-size: 12px; color: #8fb0ff; }
  .nu-ok-true { color: #7ee2a8; font-size: 12px; }
  .nu-ok-false { color: #e2a0a0; font-size: 12px; }
  .nu-card-view { margin-left: auto; }
  .nu-card-row { display: flex; gap: 8px; padding: 4px 0; font-size: 13px; border-top: 1px dashed #232a3d; }
  .nu-card-k { flex: 0 0 84px; color: #9aa0b5; }
  .nu-card-v { flex: 1; min-width: 0; color: #e6e8f0; word-break: break-all; }
  /* 推送记录「查看详情」弹窗：字段名/值两栏，长文本可换行 */
  .nu-detail-row { display: flex; gap: 10px; padding: 7px 2px; border-top: 1px dashed #232a3d; font-size: 13px; }
  .nu-detail-row:first-child { border-top: none; }
  .nu-detail-k { flex: 0 0 96px; color: #9aa0b5; }
  .nu-detail-v { flex: 1; min-width: 0; color: #e6e8f0; white-space: pre-wrap; word-break: break-all; }
  .nu-detail-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
  textarea { resize: vertical; min-height: 70px; font-family: ui-monospace, monospace; }
  .row { display: flex; gap: 12px; }
  .row > div { flex: 1; }
  /* 「机器码管理」顶部筛选行：
     1) 按包名下拉限宽 —— 原生 select 的宽度取决于**最长选项**，包名一长就把整行撑满、
        把关键词输入框挤到几乎没有空间；
     2) 按钮文字禁止换行 —— 按钮列此前太窄，「查询 / 刷新」被折成竖排逐字显示，
        行高被撑到上百像素；同时压掉全局 button 的 margin-top，让按钮与输入框同一水平线。 */
  #mc_pkg { width: 200px; max-width: 220px; }
  /* 允许换行：按钮不再折字后最小宽度变大，窗口偏窄时整行换行而不是横向溢出 */
  #panel-machines .row { align-items: center; flex-wrap: wrap; row-gap: 8px; }
  #panel-machines .row > div > button { margin-top: 0; white-space: nowrap; }
  button { margin-top: 16px; padding: 10px 20px; border: none; border-radius: 8px;
        background: #3b6fff; color: #fff; font-size: 15px; cursor: pointer; }
  button.ghost { background: #2a3047; }
  /* 危险操作（清空 / 删除）按钮：红色醒目标识 */
  button.danger { background: #b3304a; color: #fff; }
  button.danger:hover { background: #d93a5c; }
  /* 面板内子标签页（积分管理等长页面的分节展示）：覆盖全局 button 的 margin-top/大内边距，
     做成页签样式；active 页签用主题色下划线 + 底色高亮，页签行底部有分隔线 */
  .pt-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 14px; border-bottom: 1px solid #2a3047; }
  .pt-tab { margin-top: 0; padding: 8px 16px; background: transparent; color: #9aa0b5; font-size: 14px;
        border-radius: 8px 8px 0 0; }
  .pt-tab:hover { background: #141a2c; color: #e6e9f5; }
  .pt-tab.active { background: #141a2c; color: #fff; box-shadow: inset 0 -2px 0 #3b6fff; }
  .pt-pane { display: none; padding-top: 14px; }
  .pt-pane.active { display: block; }
  /* 邮件记录：按状态筛选的平铺按钮（各状态带数量）。覆盖全局 button 的大内边距 /
     margin-top，做成一排紧凑胶囊；active 用主题色高亮，未选中保持中性底。 */
  .ml-status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
  .ml-status-bar .hint { margin-right: 2px; }
  button.ml-st { margin-top: 0; padding: 6px 12px; border-radius: 999px; font-size: 13px;
        background: #2a3047; color: #cfd4e6; border: 1px solid #2a3047; white-space: nowrap; }
  button.ml-st .n { color: #9aa0b5; font-weight: 600; margin-left: 2px; }
  /* 状态色圆点：与表格状态列的三色一致，平铺时不用读字也能分辨；「全部」用中性灰 */
  button.ml-st::before { content: ''; display: inline-block; width: 7px; height: 7px;
        border-radius: 50%; margin-right: 6px; background: #9aa0b5; }
  button.ml-st[data-mlst="queued"]::before { background: #e2c98a; }
  button.ml-st[data-mlst="sent"]::before { background: #7ee2a8; }
  button.ml-st[data-mlst="failed"]::before { background: #e2a0a0; }
  button.ml-st:hover { background: #3a4258; color: #fff; }
  button.ml-st.active { background: #3b6fff; border-color: #3b6fff; color: #fff; font-weight: 600; }
  button.ml-st.active .n { color: #fff; }
  /* 登录记录：按结果筛选的平铺按钮（与 .ml-st 同款式，只换前缀以免语义混淆） */
  .al-status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
  .al-status-bar .hint { margin-right: 2px; }
  button.al-st { margin-top: 0; padding: 6px 12px; border-radius: 999px; font-size: 13px;
        background: #2a3047; color: #cfd4e6; border: 1px solid #2a3047; white-space: nowrap; }
  button.al-st .n { color: #9aa0b5; font-weight: 600; margin-left: 2px; }
  /* 结果色圆点：与表格结果列一致（成功绿 / 失败红 / 全部中性灰） */
  button.al-st::before { content: ''; display: inline-block; width: 7px; height: 7px;
        border-radius: 50%; margin-right: 6px; background: #9aa0b5; }
  button.al-st[data-alst="success"]::before { background: #7ee2a8; }
  button.al-st[data-alst="fail"]::before { background: #e2a0a0; }
  button.al-st:hover { background: #3a4258; color: #fff; }
  button.al-st.active { background: #3b6fff; border-color: #3b6fff; color: #fff; font-weight: 600; }
  button.al-st.active .n { color: #fff; }
  /* 共享模板：全局/单app 范围快速筛选按钮（与 .ml-st 同款式，平铺非下拉） */
  .st-scope-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
  .st-scope-bar .hint { margin-right: 2px; }
  button.st-sc { margin-top: 0; padding: 6px 12px; border-radius: 999px; font-size: 13px;
        background: #2a3047; color: #cfd4e6; border: 1px solid #2a3047; white-space: nowrap; }
  button.st-sc:hover { background: #3a4258; color: #fff; }
  button.st-sc.active { background: #3b6fff; border-color: #3b6fff; color: #fff; font-weight: 600; }
  /* ===== 支付订单状态：用颜色区分，一眼看出要不要处理 =====
     0 待确认（橙，要盯）/ 1 已到账（绿，完成）/ 2 已驳回（红，作废）/
     3 已取消（灰，超 24 小时未确认被系统自动取消）/ timeout（橙，付款倒计时已归零需人工确认） */
  .pt-state { display: inline-block; padding: 1px 8px; border-radius: 10px;
              font-size: 12px; font-weight: 600; white-space: nowrap; }
  .pt-state[data-state="0"] { color: #ffb454; background: rgba(255, 180, 84, .14); }
  .pt-state[data-state="1"] { color: #3ddc84; background: rgba(61, 220, 132, .14); }
  .pt-state[data-state="2"] { color: #ff7a90; background: rgba(255, 122, 144, .14); }
  .pt-state[data-state="3"] { color: #9aa0b5; background: rgba(154, 160, 181, .14); }
  .pt-state[data-state="timeout"] { color: #ffb454; background: rgba(255, 180, 84, .14); }
  /* 白天主题：上面这些亮色在浅底上对比度不够，换成同色系的深色 */
  html[data-theme="light"] .pt-state[data-state="0"] { color: #8a5200; }
  html[data-theme="light"] .pt-state[data-state="1"] { color: #0b6b37; }
  html[data-theme="light"] .pt-state[data-state="2"] { color: #a3132f; }
  html[data-theme="light"] .pt-state[data-state="3"] { color: #4a5169; }
  html[data-theme="light"] .pt-state[data-state="timeout"] { color: #8a5200; }
  /* 表格行内操作按钮组（GPS 名单等）：横排、紧凑，避免被全局 button 的
     margin-top:16px / 大内边距撑高每一行，也避免窄列里按钮换行 */
  td.row-acts, .row-acts { white-space: nowrap; }
  .row-acts { display: flex; gap: 6px; align-items: center; }
  .row-acts button { margin-top: 0; padding: 4px 10px; font-size: 12px; border-radius: 6px; }
  .msg { margin-top: 14px; font-size: 13px; padding: 10px 12px; border-radius: 8px; }
  .msg.ok { background: #14331f; color: #7ee2a8; }
  .msg.err { background: #3a1722; color: #ff9bb0; }
  .result { margin-top: 14px; }
  .result code { display: block; word-break: break-all; background: #0f1322; padding: 12px;
        border-radius: 8px; border: 1px solid #2a3047; font-size: 13px; }
  a.dl { color: #7ee2a8; font-size: 13px; }
  .hint { font-size: 12px; color: #7a8099; margin-top: 4px; }
  .stats { display: flex; gap: 16px; margin-bottom: 12px; }
  .stat { background: #0f1322; border: 1px solid #2a3047; border-radius: 8px; padding: 10px 14px; }
  .stat .n { font-size: 20px; font-weight: 600; }
  .stat .l { font-size: 12px; color: #9aa0b5; }
  /* 机器码设备维度统计（按型号 / DRM / 序列号分组），点击计数筛选列表 */
  .mc-stats { display: flex; gap: 12px; flex-wrap: wrap; }
  .mc-stat-col { flex: 1 1 260px; min-width: 220px; background: #0f1322; border: 1px solid #2a3047;
        border-radius: 8px; padding: 8px 10px; }
  .mc-stat-title { font-size: 12px; color: #9aa0b5; margin-bottom: 6px; }
  .mc-stat-sum { color: #7fb0ff; font-weight: 600; }
  .mc-stat-body { max-height: 220px; overflow-y: auto; }
  .mc-stat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
        padding: 2px 0; border-bottom: 1px dashed #1c2338; }
  .mc-stat-val { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
        color: #c8cde0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table { width: 100%; border-collapse: collapse; font-size: 12px; }
  /* 窄屏（手机）下长中文串（地址/位置/备注/说明）默认**逐字换行**，
     一行一个字把行高撑得极高（共享基站列表的「位置」列最明显）。
     → 允许在任意位置断行，并允许单元格收缩到最小宽度。 */
  table td, table th { word-break: break-word; overflow-wrap: anywhere; }
  table td { min-width: 0; }
  /* 提示/说明类文字同理（长说明会把卡片撑得很高） */
  .hint, .hint * { overflow-wrap: anywhere; }
  th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #2a3047; vertical-align: top; }
  /* 窄窗横向滚动时首列（关键标识）固定可见，避免滚动后找不到对照、方便浏览 */
  table th:first-child, table td:first-child {
    position: sticky; left: 0; z-index: 2;
    background: #0f1322; border-right: 1px solid #2a3047;
  }
  table thead th:first-child { z-index: 3; }
  th { color: #9aa0b5; font-weight: 500; }
  /* 卡密「摘要」列：单行省略号，完整内容由 title 悬浮显示 */
  td.cell-summary { max-width: 280px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; color: #b9bed0; font-size: 12px; }
  /* 可点击排序的表头 */
  th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
  th.sortable:hover { color: #cfd4e6; background: #141a2c; }
  th.sortable.on { color: #7ee2a8; }
  th.sortable .sort-arrow { margin-left: 4px; font-size: 10px; opacity: .55; }
  th.sortable.on .sort-arrow { opacity: 1; }
  td code { word-break: break-all; font-size: 11px; }
  td button.mini { margin-top: 4px; padding: 2px 8px; font-size: 11px; background: #2a3047; border-radius: 6px; }
  td button.mini.ghost { background: #3a4258; }
  td button.mini:hover { background: #3b6fff; color: #fff; }
  td button.mini.danger { background: #b3304a; color: #fff; }
  td button.mini.danger:hover { background: #d93a5c; }
  /* 核销记录「操作」列：多个按钮强制横排。
     该表列数多，窄屏/内容撑宽其它列时操作列 td 会被压窄，inline 按钮逐个换行堆成一列，
     看起来就是"按钮纵向排列"（行越高越明显）。用 inline-flex + nowrap 锁死横向，
     并去掉 td button.mini 的 margin-top:4px（flex 行内会破坏对齐）。 */
  td.ops { white-space: nowrap; }
  td.ops .ops-row { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 4px; white-space: nowrap; }
  td.ops .ops-row button.mini { margin-top: 0; }
  /* 机器码列表行内按钮：btn-small 无全局样式会回退成全局大按钮（padding 10x20 / margin-top 16），
     这里缩小为行内小按钮并强制横排，避免换行占高 */
  #machines-wrap td button.btn-small { margin-top: 0; padding: 3px 8px; font-size: 11px; border-radius: 6px;
        background: #2a3047; color: #cdd3e6; vertical-align: middle; }
  #machines-wrap td button.btn-small:hover { background: #3b6fff; color: #fff; }
  /* 机器码单元格：代码 + 复制按钮同一行 */
  #machines-wrap .mc-code-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
  /* 统一机器码显示控件（core.js 的 mcLink）：等宽字体 + 单行省略号，完整值看悬停提示。
     inline-block 才能让 max-width / overflow / ellipsis 生效（行内元素上这些属性无效）。 */
  .mc-code { display: inline-block; vertical-align: middle; max-width: 190px; overflow: hidden;
      text-overflow: ellipsis; white-space: nowrap; font-family: monospace; font-size: 12px; }
  /* ===== 机器码权益弹窗 · 概览 =====
     原来是几个 .kv 块首尾相接（每行「键：<b>值</b><br>」、值全是加粗绿字），
     设备信息十几行 MD5 混进去就分不清层次。改为：顶部摘要胶囊 + 分区卡片，
     键左值右对齐，噪声大的区块（设备信息 / 各卡明细）折叠。 */
  .mc-ov-head { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
  .mc-ov-pill { font-size: 12px; line-height: 1.6; padding: 3px 10px; border-radius: 999px;
      border: 1px solid #2a3047; background: #141a2b; color: #cfd6e6;
      max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mc-ov-pill.on { border-color: #2e6f4e; background: #12231b; color: #7ee2a8; }
  .mc-ov-pill.off { border-color: #5a3b3b; background: #241a1a; color: #e2a0a0; }
  .mc-ov-sec { border: 1px solid #232a3d; border-radius: 10px; background: #0f1322;
      padding: 9px 12px; margin-bottom: 10px; }
  .mc-ov-sec__title { color: #9aa0b5; font-size: 12px; margin-bottom: 6px; }
  .mc-ov-details > summary { cursor: pointer; margin-bottom: 0; }
  .mc-ov-details[open] > summary { margin-bottom: 6px; }
  .mc-ov-row { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; font-size: 13px; }
  .mc-ov-row + .mc-ov-row { border-top: 1px dashed #1e2436; }
  .mc-ov-k { flex: 0 0 116px; color: #8b91a7; font-size: 12px; }
  .mc-ov-v { flex: 1; min-width: 0; color: #dfe6f3; word-break: break-all; }
  .mc-ov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .mc-ov-chip { font-size: 12px; padding: 4px 8px; border-radius: 8px;
      border: 1px solid #2a3047; background: #141a2b; color: #cfd6e6;
      max-width: 100%; word-break: break-all; }
  .mc-ov-chip b { color: #7ee2a8; margin-right: 4px; }
  /* 概览里长值（卡密 / 注册码）的复制小按钮：全局 button 是大按钮，这里压成行内小件 */
  .mc-ov-sec .mc-ov-copy { margin: 0; padding: 1px 7px; font-size: 11px; line-height: 1.5;
      border-radius: 6px; border: 1px solid #2a3047; background: #1b2337; color: #cfd6e6;
      cursor: pointer; vertical-align: middle; }
  .mc-ov-sec .mc-ov-copy:hover { background: #3b6fff; color: #fff; }
  /* 概览「基础授权明细（各卡）」：每张卡一张小卡片，头部是来源 + 到期，
     下面卡密 / 注册码（首尾几位 + 复制）与激活时间各占一行 */
  .mc-card-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
  .mc-card-item { border: 1px solid #232a3d; border-radius: 8px; background: #0b1020; padding: 8px 10px; }
  .mc-card-item__head { display: flex; justify-content: space-between; align-items: baseline;
      gap: 8px; margin-bottom: 2px; }
  .mc-card-item__tag { color: #7ee2a8; font-size: 12px; }
  .mc-card-item__exp { color: #cfd6e6; font-size: 12px; text-align: right; }
  .mc-card-item .mc-ov-row { padding: 2px 0; }
  .mc-card-item .mc-ov-row + .mc-ov-row { border-top: none; }
  .mc-card-item .mc-ov-k { flex: 0 0 52px; }
  /* 多值字段的数量提示（如「共 8 个」），排在小标签前面 */
  .mc-ov-count { color: #8b91a7; font-size: 12px; margin-right: 6px; }
  /* 操作列：按钮横排不换行 */
  #machines-wrap .mc-ops { display: inline-flex; flex-wrap: nowrap; gap: 4px; white-space: nowrap; }
  .empty { color: #7a8099; font-size: 13px; padding: 16px 0; }
  .hint { color: #9aa0b5; font-size: 12px; margin-top: 8px; }
  .meta { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
  .meta .chip { background: #0f1322; border: 1px solid #2a3047; border-radius: 8px; padding: 6px 12px; font-size: 13px; }
  .meta .chip b { color: #7ee2a8; }
  .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
  .admin-head { margin: 6px 0 4px; }
  .admin-head h2 { margin: 0 0 4px; font-size: 20px; color: #e8ebf7; }
  .admin-head .admin-sub { font-size: 13px; color: #8a90a6; }
  .admin-head .git-ver { font-size: 12px; font-weight: 400; color: #8a90a6;
    background: #0f1322; border: 1px solid #2a3047; border-radius: 999px; padding: 2px 10px; margin-left: 8px; }
  .brand img.logo { width: 40px; height: 40px; border-radius: 8px; background: #fff; padding: 2px; }
  /* 确认弹窗 */
  /* padding + overflow：弹窗高于视口时（如权益赠送选了全部字段）遮罩层自身可滚动兜底 */
  .modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; overflow: auto; }
  .modal-mask.show { display: flex; }
  /* max-height + overflow：弹窗本体限高并可滚动，避免内容过长时底部按钮被挤出屏幕外点不到 */
  .modal { width: 360px; max-width: 90vw; max-height: calc(100vh - 40px); overflow-y: auto; background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 22px; }
  .modal h3 { margin: 0 0 12px; font-size: 16px; }
  .modal .kv { font-size: 14px; line-height: 1.8; }
  .modal .kv b { color: #7ee2a8; }
  .modal .acts { display: flex; gap: 12px; justify-content: flex-end; margin-top: 18px; }
  .modal .acts button { margin-top: 0; }
  /* 权益赠送确认弹窗：字段全选时「包名/字段」是一长串逗号分隔值，会把弹窗撑到超出屏幕高度。
     让内容区独立滚动，标题与「取消 / 确认赠送」按钮固定在上下两端，任何屏高下都可点。 */
  /* 加宽：默认 360px 下长字段列表会折成极多行使弹窗更高，加宽可显著减少行数 */
  #gr_confirm_modal .modal { width: 520px; }
  #gr_confirm_body { max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }
  #gr_confirm_body::-webkit-scrollbar { width: 6px; }
  #gr_confirm_body::-webkit-scrollbar-thumb { background: #2a3047; border-radius: 3px; }
  /* 权益赠送：机器码后的备注回显 + 「按备注搜索」结果列表 */
  .gr-note { margin-left: 8px; font-size: 12px; color: #8a90a6; }
  .gr-mc-list { margin: 4px 0 8px; border: 1px solid #2a3047; border-radius: 8px;
    background: #12162a; max-height: 220px; overflow-y: auto; }
  .gr-mc-list:empty { display: none; }
  .gr-mc-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px;
    cursor: pointer; border-bottom: 1px solid #1d2338; }
  .gr-mc-item:last-child { border-bottom: none; }
  .gr-mc-item:hover { background: #1a1f30; }
  .gr-mc-code { font-family: monospace; font-size: 12px; color: #cfd6ff; word-break: break-all; }
  .gr-mc-note { margin-left: auto; text-align: right; font-size: 12px; color: #7ee2a8; }
  .gr-mc-empty { padding: 10px; font-size: 12px; color: #8a90a6; }
  /* 权益区可点击查看字段详情 */
  .rights-link { color: #6ea8ff; text-decoration: underline; cursor: pointer; }
  .rights-link:hover { color: #9cc2ff; }
  /* 白底弹窗（共享模板 / 素材详情）里的机器码控件：浅蓝在 #fff 上对比度不足，换深蓝 */
  .mc-code-light.rights-link { color: #1f6feb; }
  .mc-code-light.rights-link:hover { color: #0b4fbf; }
  /* 统一邮箱显示控件（core.js 的 mailLink）：链接样式，点击弹出「邮箱操作」弹窗。
     word-break 让长邮箱在窄列里换行而不是撑破表格；不可点时（使用者端/纯文本）
     用 .mail-link-plain 去掉下划线与手型，避免误导成可操作。 */
  .mail-link { color: #6ea8ff; text-decoration: underline; cursor: pointer; word-break: break-all; }
  /* 表格单元格里的邮箱：单行省略（title / 点击弹窗仍可看完整值并操作）。
     否则长邮箱按上面的 break-all 折成两三行，把整条记录撑得很高 —— 兑换记录最明显。 */
  td .mail-link {
    display: inline-block; max-width: 220px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;
  }
  /* 表格单元格里的长文本（邮箱 / 包名等）统一包一层 div 做单行省略。
     为什么不能只靠 td 自身：table-layout:auto 下 td 的 max-width 被忽略，
     列宽仍按内容撑开或折行，长邮箱会折成两三行把整行记录撑得很高
     （GPS卡 / 虚拟相机卡申请记录最明显）。悬停 title / 点击可看完整值。 */
  .cell-ellipsis {
    max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mail-link:hover { color: #9cc2ff; }
  .mail-link-plain { cursor: default; text-decoration: none; color: inherit; }
  .mail-link-plain:hover { color: inherit; }
  /* 邮箱按「过滤状态」着色（core.js 的 mailFilterStatus）：
     绿 = 正常发放免费赠送（不满足黑名单 / 满足白名单）；红 = 会被拦。
     用与站内状态色一致的绿/红，深浅底都够醒目。 */
  .mail-link.mail-ok { color: #5ad07a; }
  .mail-link.mail-ok:hover { color: #7ee2a8; }
  .mail-link.mail-hit { color: #e57373; }
  .mail-link.mail-hit:hover { color: #ff9b9b; }
  /* 邮箱操作弹窗：可从「机器码权益」弹窗（z-index 75）内的邮箱链接唤起，
     层级必须高于它，否则弹出来会被权益弹窗盖住、点不到按钮。 */
  #mail-actions-modal { z-index: 90; }
  #mail-actions-modal .modal { width: 460px; max-width: 92vw; }
  .field-row { padding: 3px 8px; border-bottom: 1px solid #232a40; display: flex; gap: 10px; align-items: baseline; }
  .field-idx { min-width: 26px; text-align: right; color: #6b7280; font-size: 12px; }
  .field-name { color: #e6e9f2; font-weight: 500; }
  .field-label { color: #8a93a8; margin-left: 8px; font-size: 12px; }
  /* 字段详情弹窗：置顶于确认/生成弹窗之上，可独立查看 */
  #fields-mask { z-index: 70; }
  /* 机器码权益弹窗：机器码控件各处可点（含「激活详情 / 每日明细」等弹窗内部），
     故置顶于所有弹窗之上，避免从弹窗里再打开时被下面的遮罩盖住 */
  #mc-rights-mask { z-index: 75; }
  #fields-mask .modal { width: 520px; max-width: 92vw; }
  .modal input[type=password] { background: #0f1322; color: #e6e9f5; border: 1px solid #2a3047;
    border-radius: 8px; padding: 8px 10px; font-size: 13px; }
  .errline { font-size: 12px; min-height: 16px; margin-top: 6px; }
  /* 分页条 */
  .pager { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center;
    margin-top: 12px; font-size: 13px; color: #9aa0b5; }
  .pager .pg-left { display: flex; gap: 6px; flex-wrap: wrap; }
  .pager .pbtn { background: #0f1322; color: #e6e9f5; border: 1px solid #2a3047; border-radius: 7px;
    padding: 5px 10px; cursor: pointer; font-size: 13px; }
  .pager .pbtn:hover:not(:disabled) { border-color: #3a4a72; background: #161b2c; }
  .pager .pbtn.cur { background: #2a3552; border-color: #4a6; color: #fff; }
  .pager .pbtn:disabled { opacity: .4; cursor: not-allowed; }
  .pager .pager-info { color: #9aa0b5; }
  .pager select { background: #0f1322; color: #e6e9f5; border: 1px solid #2a3047; border-radius: 7px;
    padding: 5px 8px; font-size: 13px; }
  /* 卡密库存工具栏 */
  .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; }
  .toolbar input, .toolbar select { background: #0f1322; color: #e6e9f5; border: 1px solid #2a3047;
    border-radius: 8px; padding: 6px 10px; font-size: 13px; }
  .toolbar input { flex: 1; min-width: 180px; }
  .toolbar button { margin-top: 0; padding: 6px 12px; font-size: 13px; background: #3b6fff; }
  .toolbar button.ghost { background: #2a3047; color: #cfd4e6; }
  .toolbar button:hover { background: #2f5be0; color: #fff; }
  .toolbar button.ghost:hover { background: #3a4258; color: #fff; }
  .toolbar button.danger { background: #b3304a; color: #fff; }
  .toolbar button.danger:hover { background: #d93a5c; }
  /* 卡密激活记录 / 卡密详情（功能配置）弹窗：全屏遮罩 + 水平垂直居中 */
  /* 注意：容器不能用通用 .modal 类（那是 360px 弹窗本体的样式），否则遮罩被压成 360px 宽、贴左不居中 */
  #card-record-modal, #card-detail-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60;
    display: flex; align-items: center; justify-content: center; }
  #card-record-modal .modal-box, #card-detail-modal .modal-box { width: 680px; max-width: 94vw; max-height: 86vh;
    overflow: auto; background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 18px 20px; }
  #card-record-modal .modal-head, #card-detail-modal .modal-head { display: flex; justify-content: space-between;
    align-items: center; font-size: 15px; font-weight: 600; }
  #card-record-modal table.kv, #card-detail-modal table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
  #card-record-modal table.kv td, #card-detail-modal table.kv td { padding: 7px 8px; border-bottom: 1px solid #2a3047; vertical-align: top; }
  #card-record-modal table.kv td:first-child, #card-detail-modal table.kv td:first-child { color: #9aa0b5; white-space: nowrap; width: 88px; }
  #card-record-modal table.kv .cr-val, #card-detail-modal table.kv .cr-val { display: flex; align-items: flex-start; gap: 10px; }
  #card-record-modal table.kv .cr-val code, #card-detail-modal table.kv .cr-val code { flex: 1; min-width: 0; }
  /* 固定高度滚动文本框（卡密/功能配置/机器码/注册码 统一风格） */
  #card-record-modal table.kv .cr-text, #card-detail-modal table.kv .cr-text { flex: 1; min-width: 0; height: 64px; resize: none;
    background: #0f1320; color: #cdd3e6; border: 1px solid #2a3047; border-radius: 6px;
    padding: 6px 8px; font-family: monospace; font-size: 11px; line-height: 1.5;
    word-break: break-all; white-space: pre-wrap; overflow: auto; }
  #card-record-modal table.kv .cr-val .mini, #card-detail-modal table.kv .cr-val .mini { flex: 0 0 auto; margin-top: 2px; }
  /* 推送记录「查看详情」弹窗：.modal-box 没有通用背景，必须像其它弹窗一样单独补不透明
     背景与边框，否则内容框透明、直接露出半透明遮罩，整块弹窗看起来是「半透明」的。 */
  #nu-detail-modal .modal-box { width: 760px; max-width: 94vw; max-height: 86vh; overflow: auto;
    background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 16px 20px 18px; }
  #nu-detail-modal .modal-head { display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; font-weight: 600; margin-bottom: 10px; }
  #nu-detail-modal .modal-head button { margin-top: 0; padding: 6px 14px; font-size: 13px; }
  /* 支付宝账单「积分订单详情」弹窗：.modal-box 没有通用背景（见上一条注释），
     不补 background 就会透出遮罩的 rgba(0,0,0,.55)，整块看起来是半透明的。 */
  #ab-order-modal .modal-box { width: 560px; max-width: 94vw; max-height: 86vh; overflow: auto;
    background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 18px 20px; }
  #ab-order-modal .modal-head { display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; font-weight: 600; margin-bottom: 6px; }
  #ab-order-modal .modal-head button { margin-top: 0; padding: 6px 14px; font-size: 13px; }
  /* 白天主题下弹窗底色要跟着换，否则深底上看不清字 */
  html[data-theme="light"] #ab-order-modal .modal-box { background: #fff; border-color: #e3e8f2; }
  /* 扫码更新 Cookie 弹窗：同 #ab-order-modal —— .modal-box 没有通用背景，
     不补就会透出遮罩的黑（看起来整块半透明），标题栏也要显式 flex 才不错位。 */
  #ab-qr-modal .modal-box { width: 420px; max-width: 94vw; max-height: 90vh; overflow: auto;
    background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 18px 20px; }
  #ab-qr-modal .modal-head { display: flex; justify-content: space-between; align-items: center;
    gap: 12px; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
  #ab-qr-modal .modal-head button { margin-top: 0; padding: 6px 14px; font-size: 13px; flex: 0 0 auto; }
  #ab-qr-modal .hint { line-height: 1.65; }
  html[data-theme="light"] #ab-qr-modal .modal-box { background: #fff; border-color: #e3e8f2; }
  /* GPS卡/虚拟相机卡 申请记录弹窗（从机器码列表点「查看记录」弹出）：
     与卡密记录弹窗同一套遮罩/弹窗结构，宽度放到 900px，机器码与 6 列明细不用横向滚动。 */
  #gpa-detail-modal .modal-box { width: 900px; max-width: 94vw; max-height: 86vh; overflow: auto;
    background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 0; }
  /* 标题栏 sticky：记录多时内部滚动，关闭按钮始终可见（padding 放 head/body 上，避免
     左右内边距露出滚上去的内容） */
  #gpa-detail-modal .modal-head { position: sticky; top: 0; z-index: 2;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; font-weight: 600; background: #171b29;
    padding: 16px 20px 10px; border-bottom: 1px solid #2a3047; }
  /* 头部「关闭」按钮：全局 button 的 margin-top:16px 会把弹窗标题行撑高 */
  #gpa-detail-modal .modal-head button { margin-top: 0; padding: 6px 14px; font-size: 13px; }
  #gpa-detail-modal #gpa-detail-sub, #gpa-detail-modal #gpa-detail-body { padding: 0 20px; }
  #gpa-detail-modal #gpa-detail-body { padding-bottom: 18px; }
  /* 包名管理 / 推荐码管理的「新增 / 编辑」弹窗：
     配置项多，弹窗内部滚动（.modal-box 自己滚），标题栏 sticky 固定在弹窗顶部，
     滚到中间「关闭」按钮也一直可见。
     注意 padding 放在 head / body 上而不是 .modal-box：否则 sticky 头部只覆盖内容区宽度，
     左右 20px 内边距里会露出滚上去的表单内容。 */
  #pkg-form-modal .modal-box, #ref-form-modal .modal-box { max-width: 96vw; max-height: 88vh;
    overflow: auto; background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 0; }
  #pkg-form-modal .modal-box { width: 980px; }
  #ref-form-modal .modal-box { width: 760px; }
  #pkg-form-modal, #ref-form-modal { z-index: 60; }
  #pkg-form-modal .modal-head, #ref-form-modal .modal-head {
    position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between;
    align-items: center; font-size: 15px; font-weight: 600;
    background: #171b29; padding: 16px 20px 10px; border-bottom: 1px solid #2a3047; }
  #pkg-form-modal .modal-head button, #ref-form-modal .modal-head button {
    margin-top: 0; padding: 6px 14px; font-size: 13px; }
  #pkg-form-body, #ref-form-body { padding: 12px 20px 18px; }
  /* 机器码权益详情弹窗：加宽 + tab（概览 / GPS申请记录 / 签到记录 / 积分记录 / 最近活动）。
     每个 tab 内容区自己滚动（max-height），标题栏 sticky 保证「关闭」始终可见。
     对齐方式改为顶部对齐：各 tab 内容高度不同，若沿用居中对齐，切换 tab 时弹窗会
     整体上下跳动；固定顶部后只有下边缘随内容伸缩，视觉位置稳定。 */
  #mc-rights-mask { align-items: flex-start; padding-top: 4vh; }
  #mc-rights-mask .modal-box { width: 920px; max-width: 96vw; max-height: 88vh; overflow: auto;
    background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 0; }
  #mc-rights-mask .modal-head { position: sticky; top: 0; z-index: 3; display: flex;
    justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600;
    background: #171b29; padding: 16px 20px 10px; border-bottom: 1px solid #2a3047; }
  #mc-rights-mask .modal-head button { margin-top: 0; padding: 6px 14px; font-size: 13px; }
  #mc-rights-mask #mc-rights-mc, #mc-rights-mask .mc-tabs, #mc-rights-mask .mc-pane,
  #mc-rights-mask .acts { margin-left: 20px; margin-right: 20px; }
  #mc-rights-mask #mc-rights-mc { font-family: monospace; font-size: 12px; color: #8b91a7;
    word-break: break-all; margin-top: 10px; margin-bottom: 6px; }
  #mc-rights-mask .mc-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px;
    border-bottom: 1px solid #2a3047; }
  #mc-rights-mask .mc-tab { margin-top: 0; padding: 7px 14px; background: transparent;
    color: #9aa0b5; font-size: 13px; border-radius: 8px 8px 0 0; }
  #mc-rights-mask .mc-tab:hover { background: #141a2c; color: #e6e9f5; }
  #mc-rights-mask .mc-tab.active { background: #141a2c; color: #fff; box-shadow: inset 0 -2px 0 #3b6fff; }
  #mc-rights-mask .mc-pane { display: none; padding: 10px 2px 6px; line-height: 1.9;
    max-height: 56vh; overflow: auto; }
  #mc-rights-mask .mc-pane.active { display: block; }
  /* 邮箱过滤面板：黑/白名单 tab（样式与 mc-tabs 一致，作用域限本面板） */
  /* 过滤模式单选：卡片式选项 —— 之前是裸 radio + 长文本挤在 block label 里，
     radio 与折行文字错位、观感差。改成与 perk-block 同风格的圆角卡片：
     radio 顶对齐首行、整卡可点、选中卡高亮描边；桌面并排两卡、窄屏自动各占一行 */
  .ebl-mode-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
  .ebl-mode-item { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 260px;
    margin: 0; padding: 10px 12px; border: 1px solid #2a3047; border-radius: 10px;
    background: #171c2e; cursor: pointer; font-size: 13px; color: #e6e8f0; line-height: 1.5; }
  .ebl-mode-item input[type="radio"] { flex: none; width: auto; margin: 2px 0 0; accent-color: #3b6fff; }
  .ebl-mode-item:has(input:checked) { border-color: #3b6fff; background: #141a2c; }
  .ebl-mode-item span b { color: #fff; }

  #panel-email_blacklist .ebl-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px;
    border-bottom: 1px solid #2a3047; }
  #panel-email_blacklist .ebl-tab { margin-top: 0; padding: 7px 14px; background: transparent;
    color: #9aa0b5; font-size: 13px; border: none; cursor: pointer;
    border-radius: 8px 8px 0 0; }
  #panel-email_blacklist .ebl-tab:hover { background: #141a2c; color: #e6e9f5; }
  #panel-email_blacklist .ebl-tab.active { background: #141a2c; color: #fff;
    box-shadow: inset 0 -2px 0 #3b6fff; }
  #panel-email_blacklist .ebl-pane { display: none; padding: 10px 2px 6px; }
  #panel-email_blacklist .ebl-pane.active { display: block; }
  #mc-rights-mask .acts { display: flex; justify-content: flex-end; align-items: center;
    gap: 12px; padding: 10px 0 16px; }
  #mc-rights-mask .acts button { margin-top: 0; }
  /* 表单在弹窗里铺满（面板里原本靠内容自适应，弹窗窄一点时三列会挤） */
  #pkg-form-modal .cfg-table { width: 100%; }
  /* ---- 首页美化（功能简介 / 截图轮播 / 注册入口 / 管理入口） ---- */
  .topbar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-height: 22px; }
  .quick-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
    font-size: 13px; color: #b9bed0; }
  .quick-links .ql-label { color: #8a90a6; }
  .quick-links .ql-link { color: #7aa2ff; text-decoration: none; padding: 3px 10px;
    border: 1px solid #2a3047; border-radius: 999px; background: #161b2e; transition: color .2s, border-color .2s;
    max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block;
    vertical-align: middle; }
  .quick-links .ql-link:hover { color: #a9c2ff; border-color: #3a4a7a; }
  .quick-links .ql-empty { color: #6b7494; font-style: italic; }
  .quick-links .ql-builtin { border-style: dashed; opacity: .92; }
  .quick-links .ql-builtin-admin { display: none; }  /* 默认隐藏，待 JS 按页面地址决定是否显示，避免慢网闪现 */
  .admin-entry { font-size: 11px; color: #3a4160; display: none;  /* 默认隐藏，避免慢网闪现 */
    text-decoration: none; opacity: .55; transition: opacity .2s, color .2s; user-select: none; }
  .admin-entry:hover { opacity: 1; color: #6b7494; }
  .hero { background: linear-gradient(135deg, #1a2a4f 0%, #2a1f4a 100%);
    border: 1px solid #2f3a5e; border-radius: 18px; padding: 38px 30px; margin: 18px 0 24px;
    text-align: center; box-shadow: 0 10px 40px rgba(10,16,36,.45); }
  .hero h2 { margin: 0 0 10px; font-size: 28px; letter-spacing: 1px;
    background: linear-gradient(90deg, #9fd0ff, #c9b6ff); -webkit-background-clip: text;
    background-clip: text; -webkit-text-fill-color: transparent; }
  .hero .tagline { color: #c2c8de; font-size: 15px; margin-bottom: 16px; }
  .hero .hero-desc { max-width: 560px; margin: 0 auto 20px; color: #aeb6d0; font-size: 14px;
    line-height: 1.9; }
  .hero .hero-link { display: inline-block; padding: 9px 20px; border-radius: 10px;
    border: 1px solid #3b6fff; color: #bcd3ff; font-size: 14px; font-weight: 600; text-decoration: none;
    transition: background .15s, color .15s; }
  .hero .hero-link:hover { background: #3b6fff; color: #fff; }
  .hero .hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
  .hero .hero-link#hero-download { border-color: #3aa86a; color: #a8e6c0; }
  .hero .hero-link#hero-download:hover { background: #3aa86a; color: #fff; }
  /* 界面一览：一图一文平铺容器 */
  .showcase { display: block; margin-top: 18px; }
  /* 激活页标题栏 */
  .act-head { margin: 6px 0 16px; }
  .act-head h2 { margin: 10px 0 6px; font-size: 22px; letter-spacing: .5px; }
  .act-head .act-sub { color: #9aa0b5; font-size: 13.5px; }
  .back-home { display: inline-block; font-size: 13px; color: #9aa0b5; text-decoration: none;
    padding: 5px 12px; border: 1px solid #2a3047; border-radius: 8px; background: #171b29; }
  .back-home:hover { color: #cdd2e6; border-color: #3b6fff; }
  .section-title { font-size: 17px; font-weight: 700; margin: 28px 0 14px; color: #dde2f4;
    display: flex; align-items: center; gap: 9px; }
  /* 并排时每个半区的小标题上边距收紧 */
  .showcase .section-title:first-child { margin-top: 0; }
  .section-title::before { content: ""; width: 4px; height: 17px; border-radius: 2px;
    background: linear-gradient(180deg, #4b8bff, #7a5bff); display: inline-block; }
  .intro { background: #171b29; border: 1px solid #2a3047; border-radius: 14px; padding: 20px 24px;
    font-size: 14px; line-height: 1.8; color: #c8cde0; box-shadow: 0 6px 22px rgba(10,16,36,.3); }
  .intro h3 { margin: 4px 0 10px; font-size: 18px; color: #e6e8f0; }
  .intro h4 { margin: 16px 0 6px; font-size: 15px; color: #d6daec; }
  .intro p { margin: 8px 0; }
  .intro ul { margin: 8px 0; padding-left: 20px; }
  .intro li { margin: 4px 0; }
  .intro blockquote { margin: 12px 0; padding: 10px 14px; border-left: 3px solid #3b6fff;
    background: #13182a; border-radius: 0 8px 8px 0; color: #9aa0b5; font-style: italic; }
  /* 权益清理界面：权益列表（与 myrights 使用者端风格统一） */
  .rights-list { margin: 8px 0 2px; padding-left: 0; list-style: none; }
  .rights-list li { font-size: 13px; color: #c7cde0; padding: 9px 11px; background: #141a2b;
    border: 1px solid #262e44; border-radius: 9px; margin-bottom: 7px; display: flex;
    align-items: center; gap: 10px; }
  .rights-list li .li-check { flex: 0 0 auto; }
  .rights-list li .li-body { flex: 1 1 auto; min-width: 0; }
  .rights-list li .li-title { font-weight: 600; color: #e6e8f0; }
  .rights-list li .li-detail { font-size: 12px; color: #9aa0b5; margin-top: 2px; word-break: break-all; }
  .rights-list li .li-exp { font-size: 12px; color: #8be0a8; flex: 0 0 auto; white-space: nowrap; }
  .rights-list li.disabled { opacity: .75; }
  .rights-list li.disabled .li-exp { color: #9aa0b5; }
  /* ---- 包名管理 / 卡密生成包选择 ---- */
  .pkg-info { background: #13182a; border: 1px solid #2a3047; border-radius: 8px;
    padding: 10px 12px; margin-bottom: 12px; font-size: 13px; line-height: 1.7; color: #c8cde0; }
  .pkg-info .k { color: #7e85a0; display: inline-block; width: 64px; }
  .pkg-info a { color: #6ea8ff; }
  .pkg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
  .pkg-pager { display: flex; align-items: center; margin: 6px 0 2px; }
  .pkg-pager .hint { color: #9aa0b5; font-size: 12px; }
  .sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
  .sys-card { background: #121626; border: 1px solid #2a3047; border-radius: 10px; padding: 12px 14px; }
  .sys-title { font-size: 13px; color: #9aa0b5; margin-bottom: 6px; }
  .sys-body { font-size: 14px; color: #e6e8f0; line-height: 1.7; }
  .sys-body b { color: #7aa2ff; }
  .sub-block { margin: 12px 0; padding: 12px 14px; background: #0f1322; border: 1px solid #232a40; border-radius: 10px; }
  .sub-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .sub-head span { font-size: 14px; color: #cdd2e6; font-weight: 600; }
  .pkg-item { background: #171b29; border: 1px solid #2a3047; border-radius: 8px;
    padding: 8px 10px; font-size: 13px; }
  .pkg-item .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .pkg-item .top > div:first-child { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
  .pkg-item .name { font-weight: 600; color: #e6e8f0; max-width: 160px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
  .pkg-item .note { color: #9aa0b5; font-size: 12px; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
  .pkg-item .meta { color: #8e94ab; font-size: 12px; margin-top: 4px; word-break: break-all; }
  .pkg-item .acts { display: flex; gap: 6px; }
  .pkg-item button { font-size: 12px; padding: 3px 10px; }
  .pkg-item .acts button:first-child, .pkg-item .acts button:nth-child(2) { padding: 3px 9px; font-weight: 700; }

  /* 环境变量配置面板 */
  .config-wrap { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
  .config-group { background: #0f1322; border: 1px solid #232a40; border-radius: 10px; padding: 12px 14px; }
  .config-group-title { font-size: 14px; color: #cdd2e6; font-weight: 600; margin-bottom: 8px;
    border-left: 3px solid #7aa2ff; padding-left: 8px; }
  .config-row { display: flex; gap: 14px; align-items: flex-start; padding: 8px 0;
    border-top: 1px dashed #232a40; }
  .config-row:first-of-type { border-top: none; }
  .config-label { flex: 0 0 200px; color: #e6e8f0; font-size: 13px; line-height: 1.5; }
  .config-key { display: inline-block; margin-top: 4px; font-size: 11px; color: #7aa2ff;
    background: #121626; border: 1px solid #2a3047; border-radius: 5px; padding: 1px 6px; }
  .config-field { flex: 1; min-width: 0; }
  .config-field input { width: 100%; max-width: 460px; box-sizing: border-box;
    background: #121626; border: 1px solid #2a3047; border-radius: 7px;
    padding: 7px 10px; color: #e6e8f0; font-size: 13px; font-family: inherit; }
  .config-field input:focus { outline: none; border-color: #7aa2ff; }
  .config-note { font-size: 12px; color: #9aa0b5; margin-top: 5px; line-height: 1.5; }
  .config-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
    color: #e6e8f0; cursor: pointer; }
  .config-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
  /* 开关样式：滑块与文字一体，点击文字即可切换 */
  .sw { -webkit-appearance: none; appearance: none; width: 42px; height: 24px; border-radius: 24px;
        background: #3a3f4b; position: relative; cursor: pointer; vertical-align: middle; margin: 0;
        flex: none; transition: background .2s; }
  .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
        border-radius: 50%; background: #e8ebf2; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
  .sw:checked { background: #7aa2ff; }
  .sw:checked::after { transform: translateX(18px); }
  .sw:disabled { opacity: .4; cursor: not-allowed; }
  .sw:focus-visible { outline: 2px solid #7aa2ff; outline-offset: 2px; }
  .sw-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
  .config-actions { display: flex; gap: 10px; margin-top: 14px; }
  .warn { font-size: 12px; color: #ffcf6e; background: #2a2410; border: 1px solid #5a4a18;
    border-radius: 8px; padding: 8px 12px; margin-top: 8px; }

  /* ===================== 移动端（手机）适配 ===================== */
  @media (max-width: 720px) {
    /* 内容内边距收紧，留出更多可视区域 */
    .layout { margin: 12px 10px; }
    .panel { padding: 14px; border-radius: 10px; }
    /* 双列 .row 在窄屏改为上下堆叠，避免挤压变形。
       align-items 必须 !important：不少 .row 带内联 align-items:center，
       竖向排布时会把标签/输入框/按钮全挤到中间，两侧留大片空白。
       gap 取 6px：归零会让堆叠的行（输入框 + 按钮）上下紧贴像一个控件，
       取太大（10px）又会和 label 的上下外边距叠加，每行之间空出一大截。 */
    .row { flex-direction: column; gap: 6px; align-items: flex-start !important; }
    /* 子 div 必须复位 flex-basis：桌面上写的是 flex:2 1 200px / flex:1 1 150px 这类
       「宽度」basis，改成纵向排布后 basis 变成**高度**，每个字段块被撑到 150~260px 高，
       视觉上就是「行与行之间相距极高」（兑换项编辑弹窗最明显）。 */
    .row > div { flex: 0 0 auto !important; width: 100%; }
    /* 窄屏竖向排布后给下拉框整行宽度（桌面端的固定窄宽只用于横向挤在一行时） */
    #mc_pkg { width: 100%; max-width: 100%; }
    /* 配置项：标签与输入框上下堆叠 */
    .config-row { flex-direction: column; gap: 6px; }
    .config-label { flex: none; width: auto; }
    .config-field input { max-width: 100%; }
    /* 字段卡分组列占满宽度 */
    .nc-groups-col { flex: none; width: 100%; }
    /* 自动赠送字段弹层在手机上左右贴边，避免超出视口 */
    .ag-field-pop { width: auto; left: 8px; right: 8px; }
    /* 表格横向滚动，避免长卡密/注册码把页面撑爆 */
    table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    /* 输入框/下拉字号提升到 16px，避免 iOS 聚焦时自动缩放 */
    input, textarea, select, .toolbar input, .toolbar select,
    .config-field input, .pager select, .pager .pbtn { font-size: 16px; }
    /* 窄屏下单行输入框放开 360px 上限，改由视口宽度约束（max-width:94vw），避免溢出 */
    input[type="text"], input[type="password"], input[type="email"],
    input[type="search"], input[type="url"], input[type="number"], input:not([type]) {
      max-width: 94vw;
    }
    /* 增大点按区域，方便手指操作；上边距从桌面端的 16px 收到 10px，
       避免每个独占一行的按钮把上下间距撑得过远（生成卡密等表单页最明显） */
    button { padding: 12px 18px; font-size: 16px; margin-top: 10px; }
    /* 标签上下外边距同步收紧（桌面 12px/6px 在堆叠布局里叠加起来行距过大） */
    .panel label { margin: 8px 0 4px; }
    .toolbar button { padding: 10px 14px; font-size: 15px; }
    td button.mini { padding: 5px 10px; font-size: 13px; }
    /* 工具栏输入框不强制最小宽度，避免溢出换行难看 */
    .toolbar input { min-width: 0; }
    /* 弹窗在手机上更贴边 */
    .modal { width: auto; max-width: 94vw; }
    #card-record-modal .modal-box, #card-detail-modal .modal-box { width: auto; }
    /* 首页 Hero 收紧留白 */
    .hero { padding: 26px 18px; margin: 12px 0 18px; }
    .hero h2 { font-size: 24px; }
    /* 移动端导航网格：加大点按区域，字号不缩太小 */
    .sidebar { padding: 8px; gap: 8px; }
    .nav-item { padding: 11px 10px; font-size: 14px; }

    /* ===== 窄屏「行内元素挤在一起 / 按钮文字被截断」统一加固 =====
       管理端大量行是内联 style="display:flex;gap:.." 写的（不走 .row），
       窄屏既不会堆叠也不会换行：input(width:100%) 会把同一行的按钮压到几像素宽，
       按钮文字被折成竖排、与输入框相互重叠。这里统一放开换行，
       并让按钮保持自身宽度、输入框可收缩。 */
    .panel [style*="display:flex"]:not([style*="flex-wrap"]),
    .panel [style*="display: flex"]:not([style*="flex-wrap"]),
    .modal [style*="display:flex"]:not([style*="flex-wrap"]),
    .modal [style*="display: flex"]:not([style*="flex-wrap"]),
    .modal-box [style*="display:flex"]:not([style*="flex-wrap"]),
    .modal-box [style*="display: flex"]:not([style*="flex-wrap"]) {
      flex-wrap: wrap;
    }
    /* 按钮：不折字、不被压缩到溢出；一行放不下就整体换行 */
    button, button.mini, .btn-sm, .toolbar button { white-space: nowrap; flex-shrink: 0; }
    /* 输入类控件允许收缩（默认 min-width:auto 会顶住不缩，把同行按钮挤出容器） */
    input, select, textarea { min-width: 0; }
    /* 内联 flex 行里的输入框/下拉：占剩余宽度并参与换行，按钮跟在后面。
       :not(.sw) 排除滑块开关 —— .sw 常作为 <label style="display:flex"> 的直接子元素
       （如制作卡密的「生成测试卡密 / 生成短卡密」），不改的话开关会被拉成整行蓝条 */
    .panel [style*="display:flex"] > input:not(.sw),
    .panel [style*="display:flex"] > select,
    .panel [style*="display: flex"] > input:not(.sw),
    .panel [style*="display: flex"] > select {
      flex: 1 1 140px; width: auto; max-width: 100%;
    }
    /* 按钮组 / 操作区 / 分页 / 工具栏：窄屏允许换行，不横向溢出 */
    .config-actions, .modal .acts, .row-acts, .pager, .pager .pg-left, .toolbar { flex-wrap: wrap; }
    /* 兑换目录的行本身就是横向换行排版（.row + 内联 flex-wrap），不能被上面的 .row
       堆叠规则改成竖排；操作区整组独占一行、内部横排，避免退化成「一行一个按钮」 */
    .row.pf-sort-row { flex-direction: row; align-items: center !important; }
    .pf-row-acts { width: 100%; justify-content: flex-end; }
    /* 通用豁免：带「内联 flex-wrap:wrap」的 .row 说明作者已声明横向换行排版
       （积分来源筛选按钮、卡密图片上传行、积分有效期行等），窄屏不强制竖排堆叠 ——
       让 wrap 自己按宽度从左到右铺开、放不下自动换行。否则会退化成一行一个按钮
       （来源筛选按钮每行一个又大又空就是这个问题）。
       pt-stats 统计卡例外：窄屏有意竖排（三小一大卡，见上方注释）。 */
    .row[style*="flex-wrap"]:not(.pt-stats) { flex-direction: row; align-items: center !important; }
    /* 积分-卡密库存筛选行：同理不能跟着 .row 竖排堆叠（状态下拉、查询按钮
       各占一行显得又大又空）。恢复横排 + 换行即可：搜索框内联 flex:2 1 200px
       （内联优先级高于类规则，无需也无法在这里覆盖），窄屏放不下时自动换行 ——
       搜索框独占一行并被 grow 拉满，状态下拉与查询按钮并排在下一行 */
    .row.pt-filter-row { flex-direction: row; flex-wrap: wrap; align-items: center !important; row-gap: 8px; }
    /* 数据表表头不折字（列宽按内容，宽表交给横向滚动），避免表头挤成竖排 */
    table th { white-space: nowrap; }
    /* 表格内边距收紧，手机上同样宽度多放一列内容 */
    th, td { padding: 7px 8px; }
    /* 窄屏取消「首列 sticky」：table 在上面的适配里改成了 display:block 的滚动容器，
       容器内 sticky 首列不随滚动区定位，会浮在其它列上方把内容盖住（看上去像单元格重叠） */
    table th:first-child, table td:first-child {
      position: static; border-right: none;
    }
    /* 长串（卡密 / 机器码 / 链接 / 邮箱）在窄屏内强制可断行，避免撑破容器 */
    .panel code, .panel .mono, .modal-box code { overflow-wrap: anywhere; }

    /* ===== 整页不再被宽内容撑开 =====
       手机上机器码列表的宽表格、内联 min-width:360px 的分栏、320px 的下拉框都会把文档
       撑得比视口宽，整页出现横向滚动；此时 fixed 弹窗相对视口出现，视觉上停在被滚走的
       左侧，必须横向滑回去才看得见（「点权益后弹窗要滑到左边」就是这个原因）。
       这里禁掉整页横向滚动，宽内容一律在各容器内滚动/收缩。 */
    html, body { max-width: 100%; overflow-x: hidden; }
    .layout, .content, .panel, .pt-pane { max-width: 100%; min-width: 0; }
    /* 内联 min-width（perk-block 360px / select 320px / input 280px 等）窄屏一律放开 */
    .panel [style*="min-width"] { min-width: 0 !important; max-width: 100%; }
    /* 权益块（GPS / 虚拟摄像头 / 虚拟麦克风等）内联 flex:1 且 min-width 被上面规则清零后，
       会在窄屏里被等分压成 ~110px 竖窄条（标题一字一行）。窄屏下每个块独占一行，
       块内内容横向正常排布；桌面端仍按 360px 起步自动换行，不受影响 */
    .panel .perk-block, .modal .perk-block { flex: 1 1 100% !important; }
    /* 数量类权益块内容少（开关+标题/输入），保持横向流式（一行 1-2 个矮扁卡），
       不参与上面「顶层权益块独占一行」的规则 —— 特异性更高，压过同权重的 100% 规则；
       basis 140px 保证 ~360px 视口也能两列并排（42px 开关 + 6 字标题刚好放下） */
    .panel .qty-col .perk-block, .modal .qty-col .perk-block { flex: 1 1 140px !important; }
    /* 弹窗内同样放开内联 min-width（组合权益的 perk-block 写了 360px，手机宽度不够会横向溢出） */
    .modal [style*="min-width"] { min-width: 0 !important; max-width: 100%; }
    /* 表格锁在容器宽度内滚动 */
    table { max-width: 100%; }
    /* 弹窗遮罩锁定视口宽度、内部滚动，弹窗居中显示 */
    .modal-mask { width: 100vw; max-width: 100vw; padding: 12px; }
    #mc-rights-mask .modal-box,
    #pkg-form-modal .modal-box, #ref-form-modal .modal-box,
    #card-record-modal .modal-box, #card-detail-modal .modal-box,
    #gpa-detail-modal .modal-box { width: 100%; max-width: 100%; }

    /* ===== 机器码列表：窄屏改成「一条设备一张卡片」=====
       11 列宽表在手机上横向滚动既宽又读不全；改为竖排，每行一个字段 + 左侧列名。
       列顺序须与 js/ui.js 的 _mcHead() 一致：
       # / 机器码 / 产品包名 / 备注 / 绑定邮箱 / 邮箱状态 / 积分 / App版本 /
       最近活动(北京) / 基础授权到期 / 操作 */
    #machines-wrap table,
    #machines-wrap thead,
    #machines-wrap tbody,
    #machines-wrap tr,
    #machines-wrap td { display: block; width: 100%; }
    #machines-wrap thead { display: none; }
    #machines-wrap tr {
      border: 1px solid #2a3047; border-radius: 10px; background: #0f1322;
      padding: 8px 10px; margin-bottom: 10px;
    }
    #machines-wrap td {
      border: none; padding: 3px 0; display: flex; gap: 8px; align-items: baseline;
      /* 桌上为了省列宽写在各列上的 max-width / overflow:hidden / nowrap / text-align:right
         在卡片里必须全部解除：每列已独占一行，空间足够显示完整内容；
         text-align 也要复位，否则「积分」这类右对齐列会把左侧列名（::before）也顶到右边 */
      white-space: normal !important;
      max-width: 100% !important;
      overflow: visible !important;
      text-overflow: clip !important;
      text-align: left !important;
    }
    /* 卡片内的长值（机器码 / 邮箱）放开 190px、220px 截断，按卡片宽度换行显示完整内容 */
    #machines-wrap td .mail-link,
    #machines-wrap .mc-code {
      max-width: 100%; white-space: normal; word-break: break-all;
      overflow: visible; text-overflow: clip;
    }
    #machines-wrap td::before {
      content: attr(data-label); flex: none; width: 84px; color: #8b91a7; font-size: 12px;
    }
    #machines-wrap td:nth-child(1)::before { content: "序"; }
    #machines-wrap td:nth-child(2)::before { content: "机器码"; }
    #machines-wrap td:nth-child(3)::before { content: "产品包名"; }
    #machines-wrap td:nth-child(4)::before { content: "备注"; }
    #machines-wrap td:nth-child(5)::before { content: "绑定邮箱"; }
    #machines-wrap td:nth-child(6)::before { content: "邮箱状态"; }
    #machines-wrap td:nth-child(7)::before { content: "积分"; }
    #machines-wrap td:nth-child(8)::before { content: "App版本"; }
    #machines-wrap td:nth-child(9)::before { content: "最近活动"; }
    #machines-wrap td:nth-child(10)::before { content: "授权到期"; }
    #machines-wrap td:nth-child(11)::before { content: "操作"; }
    /* 「按设备合并」视图的展开子行（colspan）：不挂列名，整块铺在卡片里 */
    #machines-wrap td[colspan]::before { content: none; }
    #machines-wrap td[colspan] { display: block; }

    /* ===== 自动赠送表格（#ag_table）=====
       行内有输入控件，走不了 .tbl-card 的通用卡片化（tablecard.js 只处理「行内无输入」的表格），
       窄屏下只剩 table{display:block} 这一条 → 列宽按内容乱分、三个时长框被挤成竖排。
       这里单独给它一份卡片布局：一行一个字段，时长三连框横排。 */
    #ag_table, #ag_table thead, #ag_table tbody, #ag_table tr, #ag_table td {
      display: block; width: 100%;
    }
    #ag_table { overflow: visible; }
    #ag_table thead { display: none; }
    #ag_table tr {
      border: 1px solid #2a3047; border-radius: 10px; background: #0f1322;
      padding: 8px 10px; margin-bottom: 10px;
    }
    #ag_table td {
      border: none; padding: 4px 0; display: flex; gap: 8px;
      align-items: center; text-align: left;
    }
    #ag_table td[data-label]:not([data-label=""])::before {
      content: attr(data-label); flex: 0 0 84px; color: #8b91a7; font-size: 12px;
    }
    /* 最后一列（删除按钮）不挂列名，单独一行靠右 */
    #ag_table td[data-label=""] { display: block; text-align: right; padding-top: 2px; }
    /* 时长三连框：横排 + 固定宽度，别被全局 input{width:100%} 撑成三行 */
    #ag_table .ag-time {
      display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
      flex: 1 1 auto; min-width: 0;
    }
    #ag_table .ag-time input { width: 64px; max-width: 64px; flex: 0 0 64px; }
    #ag_table select, #ag_table .ag_vp, #ag_table td > input {
      flex: 1 1 auto; min-width: 0; max-width: 100%;
    }
    /* 「选择字段 / 选择分组」这类包了一层的容器，也要占满列名右侧剩余宽度 */
    #ag_table td > div, #ag_table td > .ag-field-wrap {
      flex: 1 1 auto; min-width: 0;
    }

    /* ===== 通用卡片视图：其它列表（卡密 / 激活记录 / 兑换记录 / 签到 / 备份 …）=====
       由 js/tablecard.js 在窄屏给「有表头、列数 ≥ 4、行内无输入控件」的表格加 .tbl-card，
       并把 thead 的列名写进每个 td 的 data-label（这里用 attr() 取），列名自动跟随表头，
       不需要为每张表手写标签。宽屏时该类会被移除，恢复普通表格。 */
    .tbl-card, .cards-tbl,
    .tbl-card thead, .cards-tbl thead,
    .tbl-card tbody, .cards-tbl tbody,
    .tbl-card tr, .cards-tbl tr,
    .tbl-card td, .cards-tbl td { display: block; width: 100%; }
    .tbl-card thead, .cards-tbl thead { display: none; }
    /* 表头首列是「全选」勾选框的表格（共享广场 / 卡密库存…）：卡片模式下保留这一行，
       否则表头一藏，手机上就没法全选了。只显示第一个 th，其余列名由卡片内的
       data-label 提供。 */
    .tbl-card.has-check thead { display: block; }
    .tbl-card.has-check thead tr { display: flex; align-items: center; gap: 8px; padding: 0 2px 6px; }
    .tbl-card.has-check thead th { display: none; }
    .tbl-card.has-check thead th:first-child { display: inline-flex; align-items: center; gap: 6px; width: auto; }
    .tbl-card tr, .cards-tbl tr {
      border: 1px solid #2a3047; border-radius: 10px; background: #0f1322;
      padding: 8px 10px; margin-bottom: 10px;
    }
    .tbl-card td, .cards-tbl td {
      border: none; padding: 3px 0; display: flex; gap: 8px; align-items: baseline;
      /* 桌面端为省列宽写的内联 max-width / overflow:hidden / nowrap / text-align:right
         在卡片里一律解除：每列独占一行，空间足够显示完整内容 */
      white-space: normal !important;
      max-width: 100% !important;
      overflow: visible !important;
      text-overflow: clip !important;
      text-align: left !important;
    }
    .tbl-card td::before, .cards-tbl td::before {
      content: attr(data-label); flex: 0 0 92px; color: #8b91a7; font-size: 12px;
      overflow-wrap: anywhere;
    }
    /* 空列名 / 整行说明行（colspan）不显示列名，整块铺满卡片 */
    .tbl-card td[data-label=""]::before { content: none; }
    .tbl-card td.tbl-card-full { display: block; }
    /* 行内编辑的表（扫码支付渠道等，tbl-card-edit）：卡片里每列独占一行，
       输入框铺满「列名右侧」的剩余宽度，不再被桌面端的固定宽度挤成小框 */
    .tbl-card.tbl-card-edit td { align-items: center; }
    .tbl-card.tbl-card-edit td::before { flex: 0 0 84px; }
    .tbl-card.tbl-card-edit td input, .tbl-card.tbl-card-edit td select {
      flex: 1 1 auto; min-width: 0; width: auto !important; max-width: 100% !important;
    }
    /* 数字/金额类输入保持窄一点，避免在卡片里被拉成整行 */
    .tbl-card.tbl-card-edit td input[type="number"] { flex: 0 0 96px; }
    /* 卡片内的长值（邮箱 / 机器码 / 卡密）放开桌面端的省略，按卡片宽度换行显示完整内容 */
    .tbl-card td .mail-link, .cards-tbl td .mail-link,
    .tbl-card .mc-code, .cards-tbl .mc-code,
    .tbl-card td code, .cards-tbl td code {
      max-width: 100%; white-space: normal; word-break: break-all;
      overflow: visible; text-overflow: clip;
    }
    /* 卡密库存列表（js/cards.js 给表格加了 cards-tbl）：9 列顺序固定，列名直接写死，
       不依赖 tablecard.js 的 data-label 标注也能正确显示 */
    .cards-tbl td:nth-child(1)::before { content: "卡密"; }
    .cards-tbl td:nth-child(2)::before { content: "包名"; }
    .cards-tbl td:nth-child(3)::before { content: "金额"; }
    .cards-tbl td:nth-child(4)::before { content: "授权时长"; }
    .cards-tbl td:nth-child(5)::before { content: "摘要"; }
    .cards-tbl td:nth-child(6)::before { content: "功能配置"; }
    .cards-tbl td:nth-child(7)::before { content: "生成时间"; }
    .cards-tbl td:nth-child(8)::before { content: "状态"; }
    .cards-tbl td:nth-child(9)::before { content: "操作"; }
    /* 卡密单元格（码 + 复制按钮）在卡片里同一行居中，不要因为 baseline 对齐错位 */
    .cards-tbl td:first-child { align-items: center; }
  }
  @media (max-width: 480px) {
    .layout { margin: 10px 8px; }
    .panel { padding: 12px; }
    h1 { font-size: 19px; }
    .stats { gap: 10px; }
    .stat { padding: 8px 10px; flex: 1 1 42%; }
    .sub { font-size: 12px; }
    .hero .hero-desc { font-size: 13px; }
  }

  /* ===== 首页落地页增强（petpace 风格：光晕徽章 + 功能卡片网格 + CTA 横幅） ===== */
  /* Hero 顶部小徽章 */
  .hero-badge { display: inline-block; font-size: 12px; letter-spacing: .5px; color: #a9c2ff;
    background: rgba(59,111,255,.14); border: 1px solid rgba(59,111,255,.35);
    padding: 4px 13px; border-radius: 999px; margin-bottom: 16px; }
  /* Hero 柔和光晕背景（不遮挡内容） */
  .hero { position: relative; overflow: hidden; }
  .hero::before { content: ""; position: absolute; top: -45%; left: 50%; transform: translateX(-50%);
    width: 130%; height: 170%; pointer-events: none; z-index: 0;
    background:
      radial-gradient(closest-side, rgba(59,111,255,.20), transparent 70%),
      radial-gradient(closest-side, rgba(122,91,255,.16), transparent 70%);
    filter: blur(6px); }
  .hero > * { position: relative; z-index: 1; }
  .hero h2 { font-size: 32px; letter-spacing: 1.5px; }
  .hero .hero-actions { margin-top: 6px; }
  .hero-link { padding: 11px 24px; font-size: 15px; }

  /* 核心功能：卡片网格 */
  .feat { margin-top: 4px; }
  .feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
  .feat-card { background: linear-gradient(180deg, #171c2e, #141829);
    border: 1px solid #2a3047; border-radius: 14px; padding: 18px 18px 16px;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
  .feat-card:hover { transform: translateY(-3px); border-color: #3b6fff;
    box-shadow: 0 12px 30px rgba(10,16,36,.5); }
  .feat-ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center;
    justify-content: center; background: linear-gradient(135deg, #3b6fff, #7a5bff); color: #fff;
    margin-bottom: 13px; }
  .feat-ico svg { width: 23px; height: 23px; }
  .feat-title { font-size: 15.5px; font-weight: 700; color: #eef1fb; margin-bottom: 6px; }
  .feat-desc { font-size: 13px; line-height: 1.7; color: #aeb6d0; }

  /* 行动召唤横幅 */
  .cta-band { margin: 30px 0 8px; text-align: center; padding: 32px 24px;
    border-radius: 18px; background: linear-gradient(135deg, #1a2a4f, #2a1f4a);
    border: 1px solid #2f3a5e; box-shadow: 0 10px 40px rgba(10,16,36,.4); }
  .cta-title { font-size: 22px; font-weight: 700; color: #eef1fb; margin-bottom: 8px; }
  .cta-sub { font-size: 14px; color: #c2c8de; margin-bottom: 18px; }
  .cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
  .cta-btn { display: inline-block; padding: 11px 26px; border-radius: 11px; font-size: 15px;
    font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
  .cta-btn.primary { background: #3b6fff; color: #fff; border: 1px solid #3b6fff; }
  .cta-btn.primary:hover { background: #2f5be0; }
  .cta-btn.ghost { background: transparent; color: #bcd3ff; border: 1px solid #3b6fff; }
  .cta-btn.ghost:hover { background: #3b6fff; color: #fff; }

  /* 首页窄屏微调 */
  @media (max-width: 720px) {
    .hero h2 { font-size: 24px; }
    .feat-card { padding: 16px 16px 14px; }
    .cta-title { font-size: 19px; }
  }

  /* 信任能力条（避免易失真的用户量指标，突出产品能力） */
  .trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
    margin: 22px 0 4px; }
  .trust-item { text-align: center; padding: 16px 10px; border-radius: 12px;
    background: #141829; border: 1px solid #2a3047; }
  .trust-n { font-size: 19px; font-weight: 700;
    background: linear-gradient(90deg, #9fd0ff, #c9b6ff); -webkit-background-clip: text;
    background-clip: text; -webkit-text-fill-color: transparent; }
  .trust-l { font-size: 12.5px; color: #9aa0b5; margin-top: 4px; }
  /* 用户评价（社会证明） */
  .voices { margin-top: 4px; }
  .voice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
  .voice-card { background: linear-gradient(180deg, #171c2e, #141829); border: 1px solid #2a3047;
    border-radius: 14px; padding: 18px 18px 16px; }
  .voice-quote { font-size: 13.5px; line-height: 1.8; color: #d6daec; margin: 0 0 14px; }
  .voice-meta { display: flex; align-items: center; gap: 8px; }
  .voice-name { font-size: 13px; font-weight: 600; color: #eef1fb; }
  .voice-tag { font-size: 11px; color: #a9c2ff; background: rgba(59,111,255,.14);
    border: 1px solid rgba(59,111,255,.3); border-radius: 999px; padding: 1px 9px; }
  @media (max-width: 720px) {
    .trust-item { padding: 13px 8px; }
    .trust-n { font-size: 17px; }
  }

  /* 界面一览：petpace 风格「一图一文」平铺，图片圆角、文字与图分离 */
  .shots { display: flex; flex-direction: column; gap: 26px; margin-top: 4px; }
  .shot-row { display: flex; align-items: center; gap: 22px; }
  .shot-row.reverse { flex-direction: row-reverse; }
  .shot-media { flex: 1 1 0; min-width: 0; position: relative; }
  .shot-media img { width: 100%; height: auto; display: block; border-radius: 16px;
    border: 1px solid #2f3a5e; background: #0f1322; box-shadow: 0 10px 30px rgba(10,16,36,.4); }
  /* 条目多图：首图正常占位撑起高度，其余绝对定位叠加；仅靠透明度切换，版式与单图一致 */
  .shot-media img.shot-img { transition: opacity .6s ease; }
  .shot-media img.shot-img-abs { position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%; object-fit: cover; opacity: 0; }
  .shot-media img.shot-img:not(.active) { opacity: 0; }
  .shot-media img.shot-img.active { opacity: 1; z-index: 2; }
  /* 条目多图指示器：仅多图时由 JS 创建（单图不渲染），点击可手动切换查看第 N 张 */
  .shot-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 3;
    display: flex; justify-content: center; align-items: center; gap: 4px; }
  .shot-dot { width: 9px; height: 9px; padding: 0; box-sizing: content-box;
    border: 4px solid transparent; background-clip: padding-box; border-radius: 50%;
    background-color: rgba(255,255,255,.45); box-shadow: 0 1px 4px rgba(0,0,0,.45);
    cursor: pointer; transition: background-color .2s ease, transform .2s ease; }
  .shot-dot:hover { background-color: rgba(255,255,255,.8); }
  .shot-dot.active { background-color: #fff; transform: scale(1.3); }
  .shot-text { flex: 1 1 0; min-width: 0; }
  .shot-h { font-size: 17px; font-weight: 700; color: #eef1fb; margin-bottom: 10px;
    display: flex; align-items: center; gap: 9px; }
  .shot-h::before { content: ""; width: 4px; height: 17px; border-radius: 2px;
    background: linear-gradient(180deg, #4b8bff, #7a5bff); display: inline-block; }
  .shot-body2 { font-size: 13.5px; line-height: 1.8; color: #aeb6d0; }
  .shot-body2 p { margin: 0 0 8px; }
  .shot-body2 p:last-child { margin-bottom: 0; }
  .shot-body2 code { background: #13182a; border: 1px solid #2a3047; border-radius: 4px;
    padding: 1px 5px; font-size: 12.5px; color: #9fd0ff; }
  .shot-empty { color: #b9c0d8; font-size: 13px; line-height: 1.7; }
  /* 常见问题：点击问题标题展开描述与截图 */
  .faq { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
  .faq-item { background: rgba(255,255,255,.02); border: 1px solid #2a3047;
    border-radius: 12px; overflow: hidden; }
  .faq-q { display: flex; align-items: center; gap: 10px; padding: 13px 14px;
    cursor: pointer; font-size: 14.5px; color: #eef1fb; user-select: none; }
  .faq-q:hover { background: rgba(255,255,255,.04); }
  .faq-mark { flex: none; width: 20px; height: 20px; border-radius: 6px; font-size: 12px;
    font-weight: 700; display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(180deg, #4b8bff, #7a5bff); }
  .faq-title { flex: 1 1 auto; min-width: 0; }
  .faq-arrow { flex: none; color: #8b93ad; font-size: 12px; }
  .faq-a { padding: 0 14px 14px 44px; font-size: 13.5px; line-height: 1.8; color: #aeb6d0; }
  .faq-a p { margin: 0 0 8px; }
  .faq-a p:last-child { margin-bottom: 0; }
  .faq-img { max-width: 100%; height: auto; margin-top: 10px; border-radius: 10px;
    border: 1px solid #2f3a5e; background: #0f1322; }
  @media (max-width: 720px) {
    .faq-a { padding-left: 14px; }
  }
  @media (max-width: 720px) {
    .shot-row, .shot-row.reverse { flex-direction: column; gap: 12px; align-items: stretch; }
    .shot-media img { border-radius: 12px; }
  }

  /* 在线频道管理：带表头的紧凑表格（一行一条频道，压缩显示空间；网格视图已移除） */
  .stream-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .stream-table th {
    text-align: left; font-weight: 600; font-size: 12px; color: #9aa0b5;
    padding: 4px 6px; border-bottom: 1px solid #2a3047; white-space: nowrap;
  }
  .stream-table td { padding: 3px 6px; border-bottom: 1px solid #232a3f; vertical-align: middle; }
  .stream-table .st-idx { color: #9aa0b5; font-size: 12px; text-align: right; white-space: nowrap; }
  /* 表内控件全覆盖紧凑化：压掉全局 input 的 10px 大内边距与 button 的 16px 上边距 */
  .stream-table input, .stream-table select {
    width: 100%; max-width: 100%; margin-top: 0; padding: 4px 8px; font-size: 12.5px; border-radius: 6px;
  }
  .stream-table button { margin-top: 0; padding: 3px 9px; font-size: 12px; border-radius: 6px; white-space: nowrap; }
  .stream-table .st-off { opacity: .55; }

  /* 题库管理：列表模式紧凑表格（一行一题，行高压缩 + 输入框内边距压平） */
  .quiz-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .quiz-table th {
    text-align: left; font-weight: 600; font-size: 11.5px; color: #9aa0b5;
    padding: 3px 5px; border-bottom: 1px solid #2a3047; white-space: nowrap;
  }
  .quiz-table td { padding: 2px 5px; border-bottom: 1px solid #232a3f; vertical-align: middle; }
  .quiz-table input, .quiz-table textarea {
    width: 100%; box-sizing: border-box; margin: 0; padding: 3px 6px; font-size: 12px;
    line-height: 1.3; border-radius: 5px; min-height: 0;
  }
  .quiz-table textarea { resize: vertical; max-height: 66px; }
  .quiz-table input[type="checkbox"] { width: auto; padding: 0; }
  .quiz-table .qt-idx { color: #9aa0b5; font-size: 11px; text-align: right; white-space: nowrap; width: 38px; }
  .quiz-table .qt-act { white-space: nowrap; width: 1%; text-align: center; }
  .quiz-table .qt-en { text-align: center; width: 1%; }
  .quiz-table button { margin-top: 0; padding: 2px 8px; font-size: 11.5px; border-radius: 5px; }
  /* 用户补充题库：审核列表一条一行，信息密度优先 */
  .quiz-sub-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px;
    border-bottom: 1px dashed #232a3f; font-size: 12.5px; }
  .quiz-sub-row .qs-main { flex: 1; min-width: 0; }
  .quiz-sub-row .qs-meta { color: #7e86a0; font-size: 11.5px; }
  .quiz-sub-row .qs-body { color: #cdd3e6; word-break: break-all; line-height: 1.5; }
  .quiz-sub-row .qs-act { flex: 0 0 auto; display: flex; gap: 6px; }
  .quiz-sub-row .qs-act button { margin-top: 0; padding: 3px 10px; font-size: 12px; }

  /* 在线频道管理：分组排序面板（整组上移 / 下移 / 置顶 / 置底） */
  .stream-gorder {
    margin-top: 10px; padding: 10px 12px; border: 1px solid #2a3047; border-radius: 10px;
    background: #1a1f30;
  }
  /* 面板按电视栏 / 电台栏分两段，每段自己的顺序各行其是 */
  .stream-gorder-sec + .stream-gorder-sec { margin-top: 10px; }
  .stream-gorder-sec-head { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
  .stream-gorder-row {
    display: flex; align-items: center; gap: 8px; padding: 3px 0;
    border-top: 1px solid #232a3f;
  }
  .stream-gorder-row:first-of-type { border-top: 0; }
  .stream-gorder-idx { flex: 0 0 22px; color: #9aa0b5; font-size: 12px; text-align: right; }
  .stream-gorder-name { flex: 0 0 auto; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-weight: 600; }
  .stream-gorder-custom { opacity: .75; }
  .stream-gorder-off { opacity: .35; }

  /* ==========================================================================
     白天 / 黑夜皮肤
     --------------------------------------------------------------------------
     黑夜（默认）：沿用上面的深色配色，这里只补 color-scheme，让滚动条 / 输入框 /
       日期选择器等**原生控件**也跟着变深（否则浅色系统中会出现刺眼的白块）。
     白天：只覆盖「底色 / 文字 / 边框」三类。主色 #3b6fff 与语义色（成功绿 / 危险红）
       两套主题**共用** —— 改掉它们会让按钮与状态色失去辨识度。
     切换逻辑见 js/theme.js；首次取值在 page_head.html 的内联脚本里定妥（防首屏闪一下）。
     ========================================================================== */
  :root { color-scheme: dark; }
  html[data-theme="light"] { color-scheme: light; }

  /* —— 白天：容器底色 —— */
  html[data-theme="light"] body { background: #f2f4f9; color: #1c2233; }
  html[data-theme="light"] .sidebar,
  html[data-theme="light"] .panel,
  html[data-theme="light"] .modal,
  html[data-theme="light"] .pkg-item { background: #fff; border-color: #e3e8f2; }
  html[data-theme="light"] #card-record-modal .modal-box,
  html[data-theme="light"] #card-detail-modal .modal-box { background: #fff; border-color: #e3e8f2; }
  /* 推送记录详情弹窗（light 主题）：白底 + 深色文字，避免深色底上放浅色字看不清 */
  html[data-theme="light"] #nu-detail-modal .modal-box { background: #fff; border-color: #e3e8f2; }
  html[data-theme="light"] #nu-detail-modal .nu-detail-v { color: #1c2233; }
  html[data-theme="light"] #nu-detail-modal .nu-detail-k { color: #626a80; }
  /* 机器码权益详情弹窗（tab 版）：容器与标题栏跟主题走白底，否则深色底 + 亮色主题
     把内联浅灰字统一加深后，会出现"深底深字"看不清 */
  html[data-theme="light"] #mc-rights-mask .modal-box { background: #fff; border-color: #e3e8f2; }
  html[data-theme="light"] #mc-rights-mask .modal-head { background: #fff; border-bottom-color: #e3e8f2; color: #1c2233; }
  html[data-theme="light"] #mc-rights-mask #mc-rights-mc { color: #626a80; }
  html[data-theme="light"] #mc-rights-mask .mc-tabs { border-bottom-color: #e3e8f2; }
  html[data-theme="light"] #mc-rights-mask .mc-tab { color: #626a80; }
  html[data-theme="light"] #mc-rights-mask .mc-tab:hover { background: #eef1f7; color: #1c2233; }
  html[data-theme="light"] #mc-rights-mask .mc-tab.active { background: #eef3ff; color: #1c4fd8;
    box-shadow: inset 0 -2px 0 #3b6fff; }
  html[data-theme="light"] #mc-rights-mask .mc-pane { color: #1c2233; }
  html[data-theme="light"] #mc-rights-mask .mc-pane .empty { color: #5a6478; }
  /* 邮箱过滤面板的名单 tab（light 主题） */
  html[data-theme="light"] .ebl-mode-item { background: #f8f9fd; border-color: #e3e8f2; color: #1c2233; }
  html[data-theme="light"] .ebl-mode-item:has(input:checked) { border-color: #1c4fd8; background: #eef3ff; }
  html[data-theme="light"] .ebl-mode-item span b { color: #1c2233; }
  html[data-theme="light"] #panel-email_blacklist .ebl-tabs { border-bottom-color: #e3e8f2; }
  html[data-theme="light"] #panel-email_blacklist .ebl-tab { color: #626a80; }
  html[data-theme="light"] #panel-email_blacklist .ebl-tab:hover { background: #eef1f7; color: #1c2233; }
  html[data-theme="light"] #panel-email_blacklist .ebl-tab.active { background: #eef3ff; color: #1c4fd8;
    box-shadow: inset 0 -2px 0 #3b6fff; }
  /* 邮箱状态色（light 主题）：深色底挑的浅绿/浅红放到白底上对比度不足，换深色版 */
  html[data-theme="light"] .mail-link.mail-ok { color: #127a45; }
  html[data-theme="light"] .mail-link.mail-ok:hover { color: #0d5c33; }
  html[data-theme="light"] .mail-link.mail-hit { color: #c0392b; }
  html[data-theme="light"] .mail-link.mail-hit:hover { color: #a5281c; }
  html[data-theme="light"] .ctype-pane,
  html[data-theme="light"] .perk-block { background: #f8f9fd; border-color: #e3e8f2; }
  html[data-theme="light"] .fields-box,
  html[data-theme="light"] .gps-multi { background: #f8f9fd; border-color: #dfe4ef; }
  html[data-theme="light"] .stream-table th { color: #6b7385; border-bottom-color: #dfe4ef; }
  html[data-theme="light"] .stream-table td { border-bottom-color: #e6ebf5; }
  html[data-theme="light"] .stream-gorder { background: #f8f9fd; border-color: #dfe4ef; }
  html[data-theme="light"] .stream-gorder-row { border-top-color: #e6ebf5; }

  /* —— 白天：次要文字 / 提示 —— */
  html[data-theme="light"] .sub,
  html[data-theme="light"] .hint,
  html[data-theme="light"] .faq-a,
  html[data-theme="light"] th,
  html[data-theme="light"] .sidebar-toggle { color: #626a80; }

  /* —— 白天：侧栏导航 —— */
  html[data-theme="light"] .nav-item,
  html[data-theme="light"] .ctype-tab { background: #eef1f7; color: #2a3350; }
  html[data-theme="light"] .nav-item:hover,
  html[data-theme="light"] .ctype-tab:hover { background: #e2e7f3; }
  /* 选中态保持主色：让"当前在哪一页"一眼可见 */
  /* 白天：全局机器码搜索框（与侧栏导航同色系） */
  html[data-theme="light"] .mc-global-search input {
    background: #eef1f7; border-color: #dfe4ef; color: #2a3350;
  }
  html[data-theme="light"] .mc-global-search input:focus { border-color: #3b6fff; }
  html[data-theme="light"] .mc-global-search input::placeholder { color: #8a92a8; }
  html[data-theme="light"] .nav-item.active,
  html[data-theme="light"] .ctype-tab.active { background: #3b6fff; color: #fff; }
  html[data-theme="light"] .nav-item.danger-nav { background: #fdecef; color: #b3304a; }
  html[data-theme="light"] .nav-item.danger-nav:hover { background: #fadbe1; }
  html[data-theme="light"] .nav-item.danger-nav.active { background: #b3304a; color: #fff; }
  /* 白天：导航大类（比普通子页签更亮一档，体现层级） */
  html[data-theme="light"] .nav-group-head { background: #e8edfb; color: #33406b; border-color: #cbd6f2; }
  html[data-theme="light"] .nav-group-head:hover { background: #dce5fb; color: #1c2233; }
  html[data-theme="light"] .nav-group.has-active > .nav-group-head { border-color: #5b7cff; color: #1c2233; }
  html[data-theme="light"] .ng-caret { color: #4a68c9; }
  html[data-theme="light"] .ng-count { background: #d5e0fa; color: #4a5f9e; }
  html[data-theme="light"] .nav-group-items { border-left-color: #cbd6f2; }
  html[data-theme="light"] .sidebar::-webkit-scrollbar-thumb { background: #ccd3e3; }

  /* —— 白天：表单控件（含弹窗内的密码框）—— */
  html[data-theme="light"] input,
  html[data-theme="light"] select,
  html[data-theme="light"] textarea,
  html[data-theme="light"] .modal input[type=password] {
    background: #fff; color: #1c2233; border-color: #d4d9e6;
  }
  html[data-theme="light"] input::placeholder,
  html[data-theme="light"] textarea::placeholder { color: #9aa2b8; }
  /* 深色系统下 date/time 控件自带的白底会突兀，浅色主题正好一致，无需额外处理 */
  html[data-theme="light"] input::-webkit-calendar-picker-indicator { filter: none; }

  /* —— 白天：按钮（主色 / 危险色不变，只调中性按钮）—— */
  html[data-theme="light"] button.ghost { background: #e6eaf3; color: #2a3350; }
  html[data-theme="light"] button.ml-st { background: #e6eaf3; border-color: #d4d9e6; color: #2a3350; }
  html[data-theme="light"] button.ml-st:hover { background: #d8dfec; color: #1c2233; }
  html[data-theme="light"] button.ml-st.active { background: #3b6fff; border-color: #3b6fff; color: #fff; }
  html[data-theme="light"] button.al-st { background: #e6eaf3; border-color: #d4d9e6; color: #2a3350; }
  html[data-theme="light"] button.al-st:hover { background: #d8dfec; color: #1c2233; }
  html[data-theme="light"] button.al-st.active { background: #3b6fff; border-color: #3b6fff; color: #fff; }
  html[data-theme="light"] td button.mini { background: #e6eaf3; color: #2a3350; }
  html[data-theme="light"] td button.mini.ghost { background: #d8dfec; }

  /* —— 白天：表格 —— */
  html[data-theme="light"] th,
  html[data-theme="light"] td { border-bottom-color: #e3e8f2; }
  html[data-theme="light"] th.sortable:hover { background: #eef1f7; color: #2a3350; }
  html[data-theme="light"] .faq-img { background: #fff; border-color: #e3e8f2; }

  /* —— 主题切换按钮（右下角浮动；所有页面共用，故不写进 page_body）——
     z-index 40 低于弹窗遮罩（50/60）：打开弹窗时按钮被遮住，不会浮在弹窗之上。 */
  .sh-theme-btn {
    position: fixed; right: 16px; bottom: 16px; z-index: 40;
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    font-size: 13px; line-height: 1; margin: 0;
    border: 1px solid #2a3047; background: #1b2030; color: #e6e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
  }
  .sh-theme-btn:hover { background: #232a40; }
  .sh-theme-btn:active { transform: translateY(1px); }
  html[data-theme="light"] .sh-theme-btn {
    border-color: #d4d9e6; background: #fff; color: #2a3350;
    box-shadow: 0 2px 10px rgba(28,34,51,.14);
  }
  html[data-theme="light"] .sh-theme-btn:hover { background: #eef1f7; }
  /* 窄屏：按钮收成图标大小，避免挡住底部内容 */
  @media (max-width: 720px) {
    .sh-theme-btn { right: 10px; bottom: 10px; padding: 8px 10px; font-size: 12px; }
  }

  /* —— QQ 机器人群发工具（管理端）：浮动按钮紧贴主题按钮上方 + 弹窗 —— */
  .sh-qqbot-btn {
    position: fixed; right: 16px; bottom: 58px; z-index: 40;
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    font-size: 13px; line-height: 1; margin: 0;
    border: 1px solid #3b6fff; background: #24365c; color: #e6e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,.35);
  }
  .sh-qqbot-btn:hover { background: #2d4372; }
  html[data-theme="light"] .sh-qqbot-btn {
    border-color: #b9c9ee; background: #eaf0ff; color: #2a3350;
    box-shadow: 0 2px 10px rgba(28,34,51,.14);
  }
  html[data-theme="light"] .sh-qqbot-btn:hover { background: #dce6ff; }
  @media (max-width: 720px) {
    .sh-qqbot-btn { right: 10px; bottom: 50px; padding: 8px 10px; font-size: 12px; }
  }
  #panel-qqbot { z-index: 60; padding: 12px; }
  #panel-qqbot .modal-box {
    width: 100%; max-width: 100%; overflow: visible;
    background: #171b29; border: 1px solid #2a3047; border-radius: 12px; padding: 12px 16px;
    /* 面板铺满视口可用高度，内容区 flex 吃掉剩余空间，消除上下大片空白 */
    display: flex; flex-direction: column; min-height: calc(100vh - 170px);
  }
  #panel-qqbot .modal-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 15px; font-weight: 600; margin-bottom: 10px; flex: 0 0 auto;
  }
  #panel-qqbot .modal-head button { margin-top: 0; padding: 6px 14px; font-size: 13px; }
  #panel-qqbot .qqbot-groups {
    flex: 1; min-height: 180px; overflow: auto; margin-top: 6px;
    border: 1px solid #2a3047; border-radius: 6px; padding: 8px 10px;
  }
  #panel-qqbot textarea {
    width: 100%; box-sizing: border-box; margin-top: 6px;
    padding: 10px 12px; background: #0f1322; color: #cdd3e6;
    border: 1px solid #2a3047; border-radius: 6px; resize: vertical;
    font-family: ui-monospace, monospace; font-size: 13px;
  }
  #panel-qqbot .qqbot-group-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
  #panel-qqbot .qqbot-group { flex: 0 0 auto; min-width: 0; cursor: pointer; }
  #panel-qqbot .qqbot-remark { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12px; }
  #panel-qqbot .qqbot-group-row button.mini { flex: 0 0 auto; margin-top: 0; }
  #panel-qqbot .acts { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }
  html[data-theme="light"] #panel-qqbot .qqbot-remark { background: #f7f9fd; color: #2a3350; border-color: #d4d9e6; }
  /* 收到的消息列表 + 逐条被动回复 */
  #panel-qqbot .qqbot-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid #2a3047; }
  #panel-qqbot .qqbot-messages { flex: 1; min-height: 180px; overflow: auto; margin-top: 6px; }
  #panel-qqbot .qqbot-msg-row { padding: 8px 0; border-bottom: 1px solid #2a3047; }
  #panel-qqbot .qqbot-msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
  /* 消息发送者头像：未绑定用户也有；圆形裁切，加载失败由 onerror 隐藏 */
  #panel-qqbot .qqbot-msg-avatar {
    width: 20px; height: 20px; border-radius: 50%; object-fit: cover;
    border: 1px solid #4a5570; background: #2a3047; flex: 0 0 auto;
  }
  html[data-theme="light"] #panel-qqbot .qqbot-msg-avatar { border-color: #d4d9e6; background: #eef1f7; }
  #panel-qqbot .qqbot-msg-group { color: #7fa8ff; font-weight: 600; }
  #panel-qqbot .qqbot-msg-author { color: #cdd3e6; }
  /* 聊天记录里按 chat_id 标记的人员信息备注 */
  #panel-qqbot .tg-remark-wrap { white-space: nowrap; }
  #panel-qqbot .tg-remark-tag {
    color: #ffd479; background: rgba(255, 212, 121, .12);
    padding: 1px 5px; border-radius: 4px; margin-left: 6px;
  }
  #panel-qqbot .tg-chat-remark { flex: none; }
  #panel-qqbot .tg-from { color: #7fb0ff; }
  #panel-qqbot .tg-chat { color: #c8a0ff; }
  /* 原始推送 JSON 展开区：等宽、保留换行、限高可滚动 */
  #panel-qqbot .tg-raw-box {
    white-space: pre-wrap; word-break: break-all; font-family: monospace; font-size: 12px;
    background: #12172a; color: #b8c4de; padding: 8px 10px; border-radius: 5px;
    margin-top: 8px; max-height: 320px; overflow: auto;
  }
  #panel-qqbot .qqbot-msg-time { color: #8b93ab; margin-left: auto; }
  #panel-qqbot .qqbot-msg-content {
    margin-top: 4px; padding: 6px 8px; background: #0f1322; border-radius: 6px;
    font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
  }
  #panel-qqbot .qqbot-expired { color: #e6a23c; }
  #panel-qqbot .qqbot-replied { color: #5ad19a; margin-left: 8px; }
  #panel-qqbot .qqbot-reply-content {
    margin-top: 4px; padding: 6px 8px; border-left: 2px solid #5ad19a;
    background: #12201d; color: #a8d8c4; border-radius: 0 6px 6px 0;
    font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
  }
  html[data-theme="light"] #panel-qqbot .qqbot-replied { color: #16875c; }
  html[data-theme="light"] #panel-qqbot .qqbot-reply-content { background: #eef8f3; color: #176b4a; }
  html[data-theme="light"] #panel-qqbot .tg-remark-tag { color: #a06a00; background: #fff4d6; }
  html[data-theme="light"] #panel-qqbot .tg-from { color: #2456b8; }
  html[data-theme="light"] #panel-qqbot .tg-chat { color: #7a3fbf; }
  html[data-theme="light"] #panel-qqbot .tg-raw-box { background: #f2f4f8; color: #3b4256; }
  #panel-qqbot .qqbot-tabs {
    display: flex; gap: 4px; border-bottom: 1px solid #2a3047; margin-bottom: 8px;
    flex: 0 0 auto; flex-wrap: wrap;
  }
  #panel-qqbot .qqbot-tab {
    padding: 8px 18px; border: 0; border-radius: 6px 6px 0 0; cursor: pointer;
    background: transparent; color: #8b93ab; font-size: 13px;
  }
  #panel-qqbot .qqbot-tab:hover { color: #cdd3e6; }
  #panel-qqbot .qqbot-tab.active { background: #24365c; color: #fff; }
  #panel-qqbot .qqbot-tabpane { display: none; }
  /* 激活的页签用 flex 纵向铺满，内部列表 flex:1 吃掉剩余高度 */
  #panel-qqbot .qqbot-tabpane.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  #panel-qqbot .qqbot-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  #panel-qqbot .qqbot-msg-filter { display: flex; gap: 6px; margin: 8px 0; }
  #panel-qqbot .qqbot-msg-filter .mini.active { border-color: #3b6fff; color: #9db8ff; }
  /* Telegram 二级页签：配置 / 聊天记录 */
  #panel-qqbot .qqbot-tg-subtabs { display: flex; gap: 4px; border-bottom: 1px solid #2a3047; margin-bottom: 10px; }
  #panel-qqbot .qqbot-tg-subtabs .qqbot-tab { padding: 6px 14px; font-size: 12px; }
  #panel-qqbot .qqbot-tg-subpane { display: none; }
  #panel-qqbot .qqbot-tg-subpane.active { display: block; }
  #panel-qqbot [data-tgfilter].active { border-color: #3b6fff; color: #9db8ff; }
  html[data-theme="light"] #panel-qqbot .qqbot-tabs { border-color: #d4d9e6; }
  html[data-theme="light"] #panel-qqbot .qqbot-tab { color: #6b7386; }
  html[data-theme="light"] #panel-qqbot .qqbot-tab.active { background: #eaf0ff; color: #2a3350; }
  html[data-theme="light"] #panel-qqbot .qqbot-msg-filter .mini.active { color: #2a5fd0; }
  html[data-theme="light"] #panel-qqbot .qqbot-tg-subtabs { border-color: #d4d9e6; }
  html[data-theme="light"] #panel-qqbot [data-tgfilter].active { color: #2a5fd0; }
  /* 微信公众号二级页签：配置 / 菜单 / 文章生成 */
  #panel-qqbot .qqbot-wx-subtabs { display: flex; gap: 4px; border-bottom: 1px solid #2a3047; margin-bottom: 10px; }
  #panel-qqbot .wx-subtab { padding: 6px 14px; border: 0; border-radius: 6px 6px 0 0; cursor: pointer; background: transparent; color: #8b93ab; font-size: 12px; }
  #panel-qqbot .wx-subtab:hover { color: #cdd3e6; }
  #panel-qqbot .wx-subtab.active { background: #24365c; color: #fff; }
  #panel-qqbot .wx-subpane { display: none; }
  #panel-qqbot .wx-subpane.active { display: block; }
  html[data-theme="light"] #panel-qqbot .qqbot-wx-subtabs { border-color: #d4d9e6; }
  html[data-theme="light"] #panel-qqbot .wx-subtab { color: #6b7386; }
  html[data-theme="light"] #panel-qqbot .wx-subtab.active { background: #eaf0ff; color: #2a3350; }
  /* 文章生成：按日期的横向子tab */
  #panel-qqbot .wx-daily-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid #2a3047; }
  #panel-qqbot .wx-daily-tab {
    padding: 6px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0;
    cursor: pointer; background: transparent; color: #8b93ab; font-size: 12px;
  }
  #panel-qqbot .wx-daily-tab:hover { color: #cdd3e6; }
  #panel-qqbot .wx-daily-tab.active { background: #24365c; color: #fff; border-color: #2a3047; }
  #panel-qqbot .wx-daily-tab .wd { opacity: .75; font-size: 11px; }
  #panel-qqbot .wx-daily-tab .today { color: #409eff; font-size: 11px; font-weight: bold; }
  #panel-qqbot .wx-daily-tab.active .today { color: #8ab4ff; }
  #panel-qqbot .wx-daily-tab .edited { color: #67c23a; font-size: 11px; }
  html[data-theme="light"] #panel-qqbot .wx-daily-tabs { border-color: #d4d9e6; }
  html[data-theme="light"] #panel-qqbot .wx-daily-tab { color: #6b7386; }
  html[data-theme="light"] #panel-qqbot .wx-daily-tab.active { background: #eaf0ff; color: #2a3350; border-color: #d4d9e6; }
  #panel-qqbot .qqbot-reply-box { margin-top: 6px; }
  #panel-qqbot .qqbot-reply-text { width: 100%; box-sizing: border-box; margin-top: 4px; }
  #panel-qqbot .qqbot-reply-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
  html[data-theme="light"] #panel-qqbot .qqbot-section { border-color: #e3e8f2; }
  html[data-theme="light"] #panel-qqbot .qqbot-msg-row { border-color: #e3e8f2; }
  html[data-theme="light"] #panel-qqbot .qqbot-msg-content { background: #f7f9fd; color: #2a3350; }
  html[data-theme="light"] #panel-qqbot .qqbot-msg-author { color: #2a3350; }
  html[data-theme="light"] #panel-qqbot .qqbot-msg-time { color: #6b7386; }
  #panel-qqbot .qqbot-docs { flex: 1; min-height: 180px; overflow: auto; margin-top: 6px; }
  #panel-qqbot .qqbot-doc-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid #2a3047; font-size: 12px; }
  #panel-qqbot .qqbot-doc-row > span:first-child { flex: 1; min-width: 0; word-break: break-all; }
  #panel-qqbot .qqbot-doc-meta { color: #8b93ab; white-space: nowrap; }
  html[data-theme="light"] #panel-qqbot .qqbot-doc-row { border-color: #e3e8f2; }
  html[data-theme="light"] #panel-qqbot .qqbot-doc-meta { color: #6b7386; }
  #panel-qqbot .qqbot-kb-form { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
  #panel-qqbot .qqbot-kb-acts { display: flex; gap: 8px; }
  #panel-qqbot .qqbot-kb-row { padding: 7px 0; border-bottom: 1px solid #2a3047; font-size: 12px; }
  #panel-qqbot .qqbot-kb-row .mini { margin-right: 6px; }
  #panel-qqbot .qqbot-kb-q { color: #9db8ff; word-break: break-all; }
  #panel-qqbot .qqbot-kb-a { color: #8b93ab; word-break: break-all; margin: 3px 0 6px; }
  html[data-theme="light"] #panel-qqbot .qqbot-kb-row { border-color: #e3e8f2; }
  html[data-theme="light"] #panel-qqbot .qqbot-kb-a { color: #6b7386; }
  html[data-theme="light"] #panel-qqbot .modal-box { background: #fff; border-color: #e3e8f2; }
  html[data-theme="light"] #panel-qqbot .qqbot-groups { border-color: #d4d9e6; }
  html[data-theme="light"] #panel-qqbot textarea { background: #f7f9fd; color: #2a3350; border-color: #d4d9e6; }

  /* —— 白天兜底：JS / HTML 内联硬编码的深色背景与浅色文字 ——
     内联样式优先级高于类选择器，只有 !important 才盖得掉；这里按「色值出现在 style 属性里」
     匹配，把常见的大块深色底改成白底深字。语义徽章（绿/红/黄底且自身带浅色文字）不在此列，
     保留原样以免丢掉状态色。 */
  html[data-theme="light"] [style*="#0f1320"],
  html[data-theme="light"] [style*="#0f1322"],
  html[data-theme="light"] [style*="#0f1424"],
  html[data-theme="light"] [style*="#141a2b"],
  html[data-theme="light"] [style*="#1a1f30"],
  html[data-theme="light"] [style*="#1b1e2b"],
  html[data-theme="light"] [style*="#2a2f42"],
  html[data-theme="light"] [style*="#222941"],
  html[data-theme="light"] [style*="#222842"],
  html[data-theme="light"] [style*="#11152480"],
  html[data-theme="light"] [style*="#171c2e"],
  html[data-theme="light"] [style*="#12172a"],
  html[data-theme="light"] [style*="#1a2033"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: #e3e8f2 !important;
    color: #232838 !important;
  }
  /* 浅灰/浅蓝文字在亮色下看不见：统一加深。只改「自身没带 background」的元素，
     避免把深色徽章里的字也改成深色而看不见。 */
  html[data-theme="light"] [style*="color:#9aa0b5"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#9aa6c0"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#8b93ab"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#8b91a7"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#7e86a0"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#8a90a6"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#8b94ad"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#9aa4bf"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#c7cde0"]:not([style*="background"]),
  html[data-theme="light"] [style*="color:#cfe3ff"]:not([style*="background"]) {
    color: #5a6478 !important;
  }
  /* 机器码详情弹窗内的状态色（余额绿 / 今日已签 / IP 链接 / 负积分 / 机器码等宽字）
     都是按深色底挑的浅色值，直接放到白底上对比度不足，这里按语义换成深色版 */
  html[data-theme="light"] #mc-rights-mask [style*="color:#7ee787"],
  html[data-theme="light"] #mc-rights-mask [style*="color:#7ee2a8"],
  html[data-theme="light"] #mc-rights-mask [style*="color:#5ad07a"] { color: #127a45 !important; }
  html[data-theme="light"] #mc-rights-mask [style*="color:#7fb3ff"] { color: #2f6bdb !important; }
  html[data-theme="light"] #mc-rights-mask [style*="color:#ff9b9b"] { color: #c0392b !important; }
  html[data-theme="light"] #mc-rights-mask [style*="color:#cdd3e6"] { color: #3a4358 !important; }
  html[data-theme="light"] #mc-rights-mask code { color: #3a4358; }
  /* 白天：固定（收藏）的导航项高亮 */
  html[data-theme="light"] .nav-item.pinned { background: #dde6ff; }
  html[data-theme="light"] .nav-item.pinned.active { background: #3b6fff; color: #fff; }
  html[data-theme="light"] .nav-pin:hover { background: rgba(0,0,0,.08); }

  /* —— 白天：表格统一白底 ——
     table/th/td 本身没有背景规则，深色来自个别面板类或旧版内联样式；
     这里显式兜底，避免"白底页面里冒出一块黑表格"，偶数行加一层极浅灰便于阅读。 */
  html[data-theme="light"] table,
  html[data-theme="light"] thead,
  html[data-theme="light"] tbody,
  html[data-theme="light"] tr,
  html[data-theme="light"] th,
  html[data-theme="light"] td { background: #ffffff; }
  html[data-theme="light"] tbody tr:nth-child(even) { background: #f7f9fc; }
  /* 无数据行用 opacity 调灰（如"该区间内无活跃"），背景仍保持白 */
  html[data-theme="light"] tr[style*="opacity"] { background: #ffffff; }

  /* —— 白天：此前漏覆盖的深色容器 / 列表项 / 小按钮 —— */
  html[data-theme="light"] .stat { background: #f8f9fd; border-color: #e3e8f2; }
  html[data-theme="light"] .stat .l { color: #626a80; }
  html[data-theme="light"] .nc-groups-box { background: #f8f9fd; border-color: #dfe4ef; }
  html[data-theme="light"] .nc-group-item { background: #eef1f7; color: #2a3350; }
  html[data-theme="light"] .nc-group-item:hover { background: #e2e7f3; }
  html[data-theme="light"] .nc-group-item.selected { background: #3b6fff; color: #fff; }
  html[data-theme="light"] .nc-space-cross-block { background: #f8f9fd; border-color: #dfe4ef; }
  html[data-theme="light"] .field-with-btn > button.mini {
    background: #e6eaf3; color: #2a3350; border-color: #d4d9e6;
  }
  /* 白天主题下行内主操作按钮仍是主题蓝（否则会被上面那条刷成灰） */
  html[data-theme="light"] .field-with-btn > button.mini.primary {
    background: #3b6fff; color: #fff; border-color: #3b6fff;
  }
  html[data-theme="light"] .field-with-btn > button.mini.primary:hover { background: #2f5be0; }
  html[data-theme="light"] .clearable-wrap .input-clear { background: #e6eaf3; color: #5a6478; }
  html[data-theme="light"] .clearable-wrap .input-clear:hover { background: #3b6fff; color: #fff; }

  /* ===== 包名管理：配置项表格（项目 | 配置 | 说明） =====
     原先每个配置项都是「label 换行 + 输入框 + 若干行 hint」竖排堆叠，一屏看不完、
     视觉也散。改为三列表格：左列固定宽度放项目名，中列放控件，右列放说明，
     同一屏可扫完所有可配置项。注意首列必须自带背景 —— 全局 table th:first-child
     是 sticky 定位且底色为 #0f1322（见上），不覆盖会与面板底色不一致。 */
  .cfg-table { table-layout: fixed; margin-top: 4px; font-size: 13px; }
  .cfg-table col.cf-1 { width: 132px; }
  .cfg-table col.cf-2 { width: 320px; }
  .cfg-table col.cf-3 { width: auto; }
  .cfg-table th, .cfg-table td {
    vertical-align: middle; text-align: left; font-weight: 400;
    padding: 7px 10px; border-bottom: 1px solid #232a40;
  }
  /* 首列（项目名）：sticky + 与面板同底色，窄窗横向滚动时仍可见 */
  .cfg-table tr > th:first-child {
    color: #cdd3e6; font-weight: 600; line-height: 1.5; white-space: nowrap;
    background: #171b29; position: sticky; left: 0; z-index: 2;
    border-right: 1px solid #232a40;
  }
  /* 分组标题行（基础信息 / 试用与申请赠送 / …）：整行合并，浅底色 + 主题色文字 */
  .cfg-table tr.cfg-sec > th {
    background: #141a2c; color: #8fb0ff; font-size: 12.5px; font-weight: 700;
    letter-spacing: .3px; padding: 6px 10px; position: static;
    border-bottom: 1px solid #2a3047;
  }
  /* 说明列 */
  .cfg-table .cfg-tip { color: #8b93ad; font-size: 12px; line-height: 1.6; }
  /* 控件列：清掉全局 label 的上下外边距，输入框随列宽自适应 */
  .cfg-table td input { margin: 0; }
  .cfg-table td input[type="text"], .cfg-table td input:not([type]) { width: 100%; max-width: none; }
  .cfg-table td input.num { width: 96px; max-width: 120px; }
  .cfg-table td input.num-sm { width: 64px; max-width: 80px; }
  .cfg-table .cfg-dur { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #b9bed0; }
  .cfg-table .cfg-sep { margin: 0 2px 0 12px; color: #7a8099; font-size: 12px; }
  .cfg-table .cfg-cbs { display: flex; flex-wrap: wrap; gap: 6px 18px; }
  /* 包名管理「可用权益」：多选组上方的批量操作行（全选/反选 + 实时状态提示）。
     按钮沿用 td button.mini，但要清掉它的 margin-top，否则 flex 行里会偏下。 */
  .cfg-table .cfg-cbs-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
  .cfg-table .cfg-cbs-tools button.mini { margin-top: 0; }
  .cfg-table .cfg-cbs-hint { font-size: 11px; color: #8b93ad; }
  /* 表内开关项：文字与滑块一体，点文字也能切换（.chk 与全局 .chk 并存，这里只做表格内收敛） */
  .cfg-table .chk {
    display: inline-flex; align-items: center; gap: 6px; margin: 0;
    color: #e6e8f0; font-size: 13px; cursor: pointer;
  }
  .cfg-table .field-with-btn { margin: 0; }
  /* 窄屏：三列改单列堆叠（项目名 → 控件 → 说明），避免横向挤压 */
  @media (max-width: 720px) {
    .cfg-table, .cfg-table tbody, .cfg-table tr, .cfg-table th, .cfg-table td { display: block; width: auto; }
    .cfg-table colgroup { display: none; }
    .cfg-table tr { padding: 6px 0; border-bottom: 1px solid #232a40; }
    .cfg-table tr > th:first-child, .cfg-table th, .cfg-table td {
      border: none; padding: 2px 0; position: static; background: transparent;
    }
    .cfg-table .cfg-tip { margin-top: 4px; }
    .cfg-table td input[type="text"], .cfg-table td input:not([type]) { max-width: 94vw; }
  }
  /* 白天主题 */
  html[data-theme="light"] .cfg-table th,
  html[data-theme="light"] .cfg-table td { border-bottom-color: #eef1f7; }
  html[data-theme="light"] .cfg-table tr > th:first-child {
    background: #fff; color: #2a3350; border-right-color: #eef1f7;
  }
  html[data-theme="light"] .cfg-table tr.cfg-sec > th { background: #f2f4f9; color: #3b6fff; }
  html[data-theme="light"] .cfg-table .cfg-tip { color: #626a80; }
  html[data-theme="light"] .cfg-table .cfg-dur { color: #2a3350; }
  html[data-theme="light"] .cfg-table .cfg-sep { color: #8a92a8; }
  html[data-theme="light"] .cfg-table .cfg-cbs .chk { color: #1c2233; }
  html[data-theme="light"] .cfg-cbs-hint { color: #626a80; }
  html[data-theme="light"] .cfg-table tr { border-bottom-color: #eef1f7; }

  /* ===== 积分管理顶部统计卡 =====
     桌面沿用 HTML 内联 flex（三小一大一行）；窄屏 .row 会变成纵向堆叠，
     此时内联 flex 的 flex-basis（150px / 280px）会被当作"高度"，把卡片撑成
     150px 高的大空块（手机上非常占屏）。故窄屏改用网格：三小并排一行 +
     「卡密库存」独占整行（它的文案较长，需要整行宽度）。 */
  .pt-stat .hint { margin: 0; }
  .pt-stat-n { font-size: 22px; font-weight: 700; }
  .pt-stat-n.pt-stat-sm { font-size: 14px; font-weight: 600; margin-top: 6px; }
  @media (max-width: 720px) {
    /* stretch !important：压过上面「.row 堆叠时左对齐」的规则，保证同一行的卡片等高 */
    .row.pt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; align-items: stretch !important; }
    .row.pt-stats > .sys-card { padding: 10px 12px; }
    .row.pt-stats > .sys-card.pt-stat-wide { grid-column: 1 / -1; }
    .pt-stat-n { font-size: 18px; }
  }
  /* 白天主题 */
  html[data-theme="light"] .pt-stat-n { color: #1c2233; }
  /* 「记住口令」：白天主题下 #b9bed0 在浅底上对比度不够，换成深一点的灰 */
  html[data-theme="light"] .admin-remember { color: #4a5169; }

  /* ===== 试用测试：左操作 / 右日志 =====
     左栏填机器码、邮箱并按 ①②③④ 顺序点按钮，右栏固定展示请求日志并独立滚动。
     日志条数多、JSON 长时只占右栏，不会再把按钮和诊断表顶到屏幕外；
     窄屏沿用全局 .row 的纵向堆叠规则，日志落到操作区下方。 */
  .row.tsim-split { align-items: flex-start; }
  .row.tsim-split > .tsim-left { flex: 1 1 52%; min-width: 0; }
  .row.tsim-split > .tsim-right { flex: 1 1 48%; min-width: 0; position: sticky; top: 8px; }
  .tsim-log-head { display: flex; align-items: center; justify-content: space-between;
                   gap: 8px; font-size: 12px; color: #9aa0b5; }
  .tsim-log-head > span { font-weight: 600; }
  .tsim-log { max-height: 72vh; overflow-y: auto; padding-right: 2px; }
  .tsim-log:empty::before {
    content: '暂无日志：在左侧按顺序点 ① ② ③ ④，这里会实时打印每一步的请求与返回。';
    display: block; margin-top: 8px; font-size: 12px; color: inherit; opacity: .55;
  }
  @media (max-width: 720px) {
    .row.tsim-split > .tsim-right { position: static; }
    .tsim-log { max-height: 55vh; }
  }

  /* ===== 支付宝账单状态区：分「Cookie 保活 / 账单刷新」两组 =====
     原来是一整行用 · 拼十几个字段，窄屏要横向滚很久、重点也扫不出来。 */
  .ab-stat-group { margin-top: 8px; padding: 9px 11px; background: #121626;
                   border: 1px solid #232a40; border-radius: 8px; }
  .ab-stat-group + .ab-stat-group { margin-top: 8px; }
  .ab-stat-h { font-size: 12px; font-weight: 700; color: #cdd2e6; margin-bottom: 3px; }
  .ab-stat-l { font-size: 12px; color: #9aa0b5; line-height: 1.75; word-break: break-all; }
  .ab-stat-l .ab-ok { color: #7ee2a8; font-weight: 600; }
  .ab-stat-l .ab-err { color: #e2a0a0; }
  /* 白天主题：浅底上换深一档，保证对比度 */
  html[data-theme="light"] .ab-stat-group { background: #f6f8fc; border-color: #e3e8f2; }
  html[data-theme="light"] .ab-stat-h { color: #2a3047; }
  html[data-theme="light"] .ab-stat-l { color: #5a627a; }
  html[data-theme="light"] .ab-stat-l .ab-ok { color: #0b6b37; }
  html[data-theme="light"] .ab-stat-l .ab-err { color: #a3132f; }
  /* ===== AI 聊天配置页（管理端）：官方通道 / 提示词分组 / 跳过名单 ===== */
  .aic-prov, .aic-group {
    margin: 0 0 10px; padding: 10px 12px;
    background: #121626; border: 1px solid #232a40; border-radius: 8px;
  }
  .aic-prov .form-row, .aic-group .form-row { margin-bottom: 8px; }
  .aic-prov .form-row:last-child, .aic-group .form-row:last-child { margin-bottom: 0; }
  .aic-prov input[type="text"], .aic-prov input:not([type]),
  .aic-group input[type="text"], .aic-group input:not([type]) { min-width: 180px; }
  .aic-prompt-list { margin: 6px 0; }
  /* AI 通道「系统自动停用」角标：巡检连续失败达阈值后置灰显示，
     与管理员主动停用的复选框区分开（这个只读，恢复后自动消失） */
  .aic-p-health {
    display: inline-flex; align-items: center; white-space: nowrap;
    color: #ffb84d; font-size: 12px; font-weight: 600;
    background: rgba(255, 184, 77, .12); border: 1px solid rgba(255, 184, 77, .35);
    border-radius: 5px; padding: 2px 7px; cursor: help;
  }
  html[data-theme="light"] .aic-p-health { color: #a86a00; background: #fff4dc; border-color: #e8c378; }
  /* 排序手柄：只有按住它才能起拖（行内有输入框，从输入框拖会变成选文字） */
  .aic-drag { cursor: grab; user-select: none; color: #7c88a8; padding: 0 4px; font-size: 13px; line-height: 1; }
  .aic-drag:active { cursor: grabbing; }
  .aic-group.dragging, .aic-prompt-row.dragging { opacity: .55; outline: 1px dashed #6b7ba6; }
  /* ↑/↓ 小按钮：贴着「删除」放，别太宽 */
  .aic-prompt-row .aic-mv, .aic-group .aic-mv { padding: 2px 8px; min-width: 0; line-height: 1.2; }
  /* 「禁用」勾选：勾上后该行置灰 + 内容加删除线（保存后服务端不再下发这条） */
  /* 提示词开关列表：每条一行「开关 + 名称」，多了可以滚动 */
  .prompt-sw-box { display: flex; flex-direction: column; gap: 4px; max-height: 168px; overflow-y: auto;
    border: 1px solid #262e44; border-radius: 8px; padding: 6px 10px; }
  .prompt-sw { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #cfd6ea; cursor: pointer; }
  .prompt-sw input.sw { flex: 0 0 auto; }
  .prompt-sw span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .aic-dis { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: #9aa4bd; font-size: 12px; }
  .aic-prompt-row.dis { opacity: .55; }
  .aic-prompt-row.dis .aic-i-text { text-decoration: line-through; }
  .aic-prompt-row textarea { min-height: 46px; width: 100%; }
  /* 白天主题：浅底上换深一档，保证对比度 */
  html[data-theme="light"] .aic-prov, html[data-theme="light"] .aic-group {
    background: #f6f8fc; border-color: #e3e8f2;
  }

  /* ===== 宽屏下把通道 / 提示词改成紧凑的横向列表 =====
     | 背景 | 全局 `label{display:block}` + `input{max-width:360px}` 叠起来，
     | 每个字段都独占一行（label 一行、输入框一行），一条通道要占 5~6 行，
     | 20 条通道就得翻几十屏；而这一排字段其实只是"地址、模型、密钥"三样。
     |
     | 做法：宽屏时让 label 变成行内小标签、输入框自动分栏，行高大幅收紧。
     | 窄屏（<= 1100px）保持原来的纵向堆叠 —— 屏幕本身不够宽时强行分栏
     | 会把输入框压到几十像素，比现在更难用。 */
  @media (min-width: 1101px) {
    /* 每个 .form-row 变成一行多列的弹性布局，放不下自动换行 */
    .aic-prov .form-row, .aic-group .form-row {
      display: flex; flex-wrap: wrap; align-items: center;
      gap: 6px 10px; margin-bottom: 6px;
    }
    /* ★ label 收成行内小标签并去掉全局的上下外边距（否则每行还是被撑高） */
    .aic-prov .form-row > label,
    .aic-group .form-row > label,
    .aic-prompt-row > label {
      display: inline-flex; align-items: center; flex: 0 0 auto;
      margin: 0; white-space: nowrap; font-size: 12px; color: #9aa4bd;
    }
    /* 输入框：不再占满整行，按内容伸缩。flex:1 1 220px 让"地址"这类长字段
       吃掉剩余宽度、"模型"这类短字段保持紧凑 */
    .aic-prov .form-row > input,
    .aic-prov .form-row > select,
    .aic-group .form-row > input,
    .aic-prompt-row > input {
      flex: 1 1 200px; min-width: 140px; max-width: 420px;
      padding: 6px 9px; font-size: 13px;
    }
    /* 通道 ID 是只读的固定短串，没必要跟地址抢宽度 */
    .aic-prov .aic-p-id { flex: 0 1 150px; min-width: 110px; }
    /* 模型框 + datalist：datalist 不占位，但 input 要能撑开一点 */
    .aic-prov .aic-p-model { flex: 1 1 180px; }
    /* 按钮不参与拉伸，否则会和输入框一样宽，很难点 */
    .aic-prov .form-row > button,
    .aic-group .form-row > button,
    .aic-prompt-row > button { flex: 0 0 auto; padding: 5px 10px; font-size: 12px; }
    /* 能力勾选与「启用」：和输入框同一行，垂直居中 */
    .aic-prov .form-row > .chk,
    .aic-prov .form-row > .aic-dis {
      display: inline-flex; align-items: center; gap: 4px;
      margin: 0; flex: 0 0 auto; font-size: 12px; white-space: nowrap;
    }
    /* 覆盖全局 input{width:100%} 对复选框的影响（否则勾选框被撑成整行） */
    .aic-prov .chk input[type="checkbox"],
    .aic-prov .aic-dis input[type="checkbox"] {
      width: auto; max-width: none; margin: 0; padding: 0; flex: 0 0 auto;
    }

    /* ---- 提示词行：一行放「名称 + 正文 + 操作」，正文吃掉剩余宽度 ---- */
    .aic-prompt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
    /* 正文是最需要宽度的，给它更大的伸缩基准；min-width:0 才能正常收缩 */
    .aic-prompt-row > textarea {
      flex: 1 1 320px; min-width: 200px; width: auto;
      min-height: 34px; height: 34px; padding: 6px 9px; font-size: 13px;
      resize: vertical;
    }
    .aic-prompt-row > .aic-i-name { flex: 0 1 150px; min-width: 110px; }
    /* 测试结果区独占整行（flex-basis:100%），高度随内容走 */
    .aic-prompt-row > .aic-i-testout { flex: 0 0 100%; }

    /* 分组头：分组名 + 按钮排一行，组内提示词列表紧随其后 */
    .aic-group .aic-g-name { flex: 1 1 200px; max-width: 320px; }
    /* 通道块本身也做列向弹性容器：测试结果区在里面独占一整行，
       不会和 .form-row 挤在同一条线上 */
    .aic-prov { display: flex; flex-direction: column; }
    .aic-prov > .aic-p-testout { width: 100%; }

    /* 紧凑化后块间距也收一点：原来 10px 上下留白在列表里显得松散 */
    .aic-prov, .aic-group { margin-bottom: 8px; padding: 8px 10px; }
    .aic-prompt-list { margin: 4px 0 6px; }
  }

/* ===== 面板内的横向子 tab（如「AI 聊天」页签里的四块）=====
   管理端没有 .tabs/.tab 样式（那是 account.html 的），这里单独定义一组，
   保证子 tab 是**横向**排布（flex + 可换行），不再一个占一行。 */
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.subtabs .subtab {
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  background: #1b2030; border: 1px solid #262e44; color: #cfd6e6;
  user-select: none; white-space: nowrap; line-height: 1.4;
}
.subtabs .subtab:hover { background: #232a40; }
.subtabs .subtab.on { background: #3b6fff; color: #fff; border-color: #3b6fff; font-weight: 600; }
html[data-theme="light"] .subtabs .subtab { background: #f6f8fc; border-color: #e3e8f2; color: #333; }
html[data-theme="light"] .subtabs .subtab:hover { background: #eaf0fb; }
html[data-theme="light"] .subtabs .subtab.on { background: #3b6fff; color: #fff; border-color: #3b6fff; }

/* ===== 代理卡型：列表（宽屏表格 / 窄屏卡片）+ 编辑弹窗 =====
   列表默认是只读摘要表，点「编辑」才在弹窗里改。
   改造前每张卡内联一整块表单，一屏放不下两个卡型、改一个字段要滚很久。 */
/* 横向滚动容器：各列 nowrap 后有最小宽度，容器不够宽时**滚动**而不是裁切。
   min-width 取实测值：卡型 40 + 显示名 100 + 卡种 55 + 包名 139 + 时长 47
   + 单价 64 + 权益 147 + 操作 168 = 760px（实测 offsetWidth）。
   低于这个宽度时操作列的「删除」按钮会被裁到容器外，所以宁可横向滚动。 */
.ag-cards-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ag-cards { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 13px; }
.ag-cards thead th {
  text-align: left; font-weight: 600; color: var(--sub, #8b91a7);
  font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line4, #445);
  white-space: nowrap;
}
.ag-cards tbody td {
  padding: 7px 8px; border-bottom: 1px solid rgba(127,127,127,.16);
  vertical-align: middle;
}
.ag-cards tbody tr:hover { background: rgba(127,127,127,.06); }
/* 包名：整串不折行。全局有 `td code { word-break: break-all }`，会把
   com.superhide.gps 断成 com.superhide.g / ps 两行，扫读时很别扭。
   这里让它不折行，并由 table-layout 让该列按内容取宽（见下方列宽规则），
   而不是给它设 max-width —— 设了上限反而会逼出折行。 */
.ag-cards code {
  font-family: ui-monospace, monospace; font-size: 12px;
  color: var(--text2, #b9c0d4);
  word-break: normal; white-space: nowrap;
}
/* 列宽：只给窄列一个**上限**（max-width），不钉死固定宽度。
   之前用 table-layout:fixed + 固定 width，各列加总超过容器宽度时
   「操作」列被挤出可视区、删除按钮被裁掉。改为 auto 布局 + 上限，
   由浏览器分配剩余空间，长文本列（权益）自动吃掉多余宽度。 */
.ag-cards { table-layout: auto; }
.ag-cards th:nth-child(1) { width: 1%; white-space: nowrap; }   /* 卡型：按内容最窄 */
.ag-cards th:nth-child(3),
.ag-cards th:nth-child(5),
.ag-cards th:nth-child(6) { white-space: nowrap; }
.ag-cards td:nth-child(3), .ag-cards td:nth-child(5),
.ag-cards td:nth-child(6) { white-space: nowrap; }
/* 权益列允许换行但不要挤占操作列 */
.ag-cards td:nth-child(7) { min-width: 140px; }
/* 显示名：给一个下限，避免在中等宽度下被权益列挤成一列竖排文字 */
.ag-cards th:nth-child(2) { min-width: 96px; }
/* 操作列：整组按钮不可折行、不可压缩。宽度交给内容决定（两个按钮的实际
   宽度随字号/内边距变化，写死像素容易被裁 —— 之前写 128px 就把删除按钮
   裁掉了），只声明 nowrap 让浏览器把这一列撑到刚好放下。 */
.ag-cards th:nth-child(8), .ag-cards td:nth-child(8) {
  white-space: nowrap; width: 1%;
}
/* 首列不钉住：这个列表宽度可控，不需要横向滚动时固定列；
   而全局的 sticky 会给首列刷一层 #0f1322 深色底，与表格底色不一致。 */
.ag-cards th:first-child, .ag-cards td:first-child {
  position: static; background: none; border-right: none;
}
/* 操作列：两个按钮并排、靠右，不换行 */
.ag-cards-act { text-align: right; white-space: nowrap; }
.ag-cards-act .btn-small { margin-left: 6px; }

/* 弹窗外壳：复用 account.css 里 .pay-mask / .pay-modal 的观感，
   但那两个类只存在于用户端页面，管理端没有加载 account.css，所以这里补一份。 */
.pay-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: auto;
}
.pay-mask.hide { display: none; }
.pay-modal {
  background: var(--card, #131826); border: 1px solid var(--line2, #2a3047);
  border-radius: 12px; width: 100%; max-width: 360px;
  max-height: 92vh; overflow: auto; padding: 16px;
}

/* 窄屏：每条记录变一张卡片（thead 隐藏，列名靠 data-label 显示），
   与机器码列表的 .tbl-card 同一套交互习惯。
   阈值取 900px 而不是常见的 720px：这张表列较多、实测最小宽度 780px，
   容器窄于它时只能横向滚动 —— 而「编辑/删除」是主操作，让用户左右拖着找
   按钮很难受。800~900px 这个区间（平板竖屏、分屏窗口）直接切卡片更顺手。 */
@media (max-width: 900px) {
  .ag-cards-wrap { overflow-x: visible; }
  .ag-cards, .ag-cards thead, .ag-cards tbody, .ag-cards tr, .ag-cards td {
    display: block; width: 100%;
  }
  /* 卡片模式没有列的概念：撤销表格布局与最小宽度，否则卡片会被撑到 760px、
     手机上出现横向滚动。 */
  .ag-cards { table-layout: auto; min-width: 0; }
  .ag-cards thead { display: none; }
  .ag-cards tbody tr {
    border: 1px solid var(--line2, #2a3047); border-radius: 10px;
    background: rgba(127,127,127,.06); padding: 8px 10px; margin-bottom: 10px;
  }
  .ag-cards tbody td {
    display: flex; gap: 10px; align-items: center;
    border: none; padding: 3px 0; text-align: left;
  }
  /* 全局给 table 首列加了「横向滚动时固定可见」的深色底（page.css 的
     table td:first-child）。卡片模式下每行都成了独立小块、根本没有横向滚动，
     那层底色反而让「卡型 #1」单独顶着一条深色横条，看着像渲染错误。 */
  .ag-cards tbody td:first-child {
    position: static; background: none; border-right: none;
  }
  .ag-cards tbody td[data-label]:not([data-label=""])::before {
    content: attr(data-label); flex: 0 0 74px;
    color: var(--sub, #8b91a7); font-size: 12px;
  }
  /* 操作列：不挂列名，单独一行靠右。撤销桌面版的 width:1%（block 下它会把
     整行压成 1% 宽），并恢复内容宽度。 */
  .ag-cards tbody td[data-label=""] {
    display: block; text-align: right; padding-top: 6px;
    width: auto; max-width: none;
  }
  /* 弹窗在窄屏铺满，避免两侧留白过多挤扁表单 */
  .pay-modal { max-width: 100%; max-height: 94vh; padding: 12px; }
}
