/* ============================================================
   共享设计体系 theme.css
   - CSS token（品牌色 / 语义色 / 圆角 / 阴影 / 过渡）
   - 亮色细节优化（悬停、过渡、焦点、卡片）
   - 深色模式：Element Plus --el-* 变量覆盖 + 逐页面自定义面覆盖
   - 主题切换按钮（FAB）
   仅通过 <body class="theme-admin|theme-user|theme-login|theme-agent"> 作用域，
   避免 admin/web 两控制台共享类名（.sidebar/.panel/.topbar/.welcome-card…）互相污染。
   ============================================================ */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #e8f0fe;
    --ok: #34a853;
    --warn: #f9ab00;
    --danger: #f56c6c;
    --info: #909399;

    /* 圆角梯度（yc6 风偏大）：卡片/面板 --r-lg，输入/子项 --r-md，标签用 999px */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;

    /* 两档柔和投影（低对比、大扩散），避免堆叠 */
    --shadow-sm: 0 6px 20px rgba(31, 51, 79, .06);
    --shadow-md: 0 8px 28px rgba(31, 51, 79, .07);
    --shadow-lg: 0 20px 55px rgba(31, 51, 79, .12);

    --ease: cubic-bezier(.4, 0, .2, 1);
    --dur: .2s;

    /* 亮面色（供各页面统一引用，深色在 html.dark 重定义） */
    --canvas: #f5f7fb;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, .9);
    --surface-2: #f0f4f8;
    --surface-3: #e8eef4;
    --line: rgba(20, 39, 66, .11);
    --line-soft: rgba(20, 39, 66, .07);
    --text-1: #172033;
    --text-2: #697487;
    --text-3: #8a94a6;
    /* 代码块（pre / 行内 code）底色与文字色：页面上大量内联 style 引用这两个变量，
       这样深色模式不再需要在每个 pre 上写 !important */
    --code-bg: #f2f4f8;
    --code-fg: #303133;

    /* Element Plus 主色统一为科技蓝 */
    --el-color-primary: #2563eb;
    --el-color-primary-light-3: #6ba3f5;
    --el-color-primary-light-5: #9dc0f8;
    --el-color-primary-light-7: #c2d8fb;
    --el-color-primary-light-8: #d4e3fc;
    --el-color-primary-light-9: #eaf2ff;
    --el-color-primary-dark-2: #1d4ed8;

    /* 统一“成功/正向”绿（2026-11-22）：控制台原本 EP 默认黄绿 #67c23a 与内联 bootstrap 绿 #198754 混用，
       与 promo 已标准的 #16a34a 不一致。这里把 EP success 语义色整体锁定为 #16a34a 及其梯度。 */
    --el-color-success: #16a34a;
    --el-color-success-light-3: #5cbf80;
    --el-color-success-light-5: #8ad1a4;
    --el-color-success-light-7: #b9e3c9;
    --el-color-success-light-8: #d0eddb;
    --el-color-success-light-9: #e8f6ed;
    --el-color-success-dark-2: #12823b;
}

/* ---------- 亮色细节优化（全局，轻量） ---------- */
.theme-admin, .theme-user, .theme-login, .login-root, .theme-agent {
    color-scheme: light;
}
/* App 级文字观感：抗锯齿、数字等宽（统计数据不抽颤）、页内锚点平滑滚动 */
body[class*="theme-"] {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
body[class*="theme-"] .stat-info h3, body[class*="theme-"] .stat .v,
body[class*="theme-"] .stat-info, body[class*="theme-"] .balance-display strong {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}
@media (prefers-reduced-motion: no-preference) {
    body[class*="theme-"] { scroll-behavior: smooth; }
}
* { scrollbar-gutter: stable; }
a { transition: color var(--dur) var(--ease); }
/* App 化触摸手感（全局，桌面无害）：去点击高亮、禁长按弹出系统菜单、禁 UI 面被选中 */
html { -webkit-tap-highlight-color: transparent; }
body[class*="theme-"] { -webkit-touch-callout: default; }
body[class*="theme-"] .topbar, body[class*="theme-"] .sidebar,
body[class*="theme-"] .nav-item, body[class*="theme-"] .device-tab,
body[class*="theme-"] .topbar-tab, body[class*="theme-"] .stat-card {
    -webkit-user-select: none; user-select: none;
}
.panel, .stat-card, .card, .login-card, .rent-card {
    transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav-item, .device-tab, .topbar-tab, .row-check, .quick button, button {
    transition: all var(--dur) var(--ease);
}
button:not(:disabled):active, .nav-item:active, .quick button:active { transform: translateY(1px); }
.el-button { transition: all var(--dur) var(--ease); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 亮色细节升级（2026-11 高级感打磨，全局三端 + 登录页受益）：
   1) 亮色滚动条此前未样式化，露出系统默认粗灰条，与深色精致条割裂 → 统一为纤细、随主题色的滚动条（深色由后文 html.dark 更特异度接管）；
   2) 文本选区跟随品牌蓝，替换浏览器默认刺眼蓝，亮暗两模式均用蓝底白字保证可读。 */
* { scrollbar-width: thin; scrollbar-color: #c7d0dd transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7d0dd; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b6c4e4; background-clip: padding-box; }
::selection { background: var(--brand); color: #fff; }

/* ---------- 主题切换按钮（FAB，由 theme.js 注入） ---------- */
.theme-toggle {
    position: fixed; right: 18px; bottom: 18px; z-index: 9000;
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
    box-shadow: var(--shadow-md); cursor: pointer; font-size: 18px; line-height: 1;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.theme-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--brand); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle .tt-ico { width: 20px; height: 20px; }
html.dark .theme-toggle { background: #2a2c34; color: #ffd66b; border-color: #3a3d46; }
html.dark .theme-toggle:hover { color: #ffe9a8; }

/* ============================================================
   深色模式：全局 + Element Plus 变量覆盖
   ============================================================ */
html.dark { color-scheme: dark; }
html.dark body { background: #0f1115; color: #d6dbe4; }
html.dark {
    /* 画布色：admin/web 两个控制台的 body 都是 background:var(--canvas)，
       深色下漏了它 → 页面底色永远是浅灰，卡片变深后反而“上白下黑”割裂 */
    --canvas: #0f1115;
    --surface: #1a1d23;
    --surface-2: #20242c;
    --surface-3: #262b34;
    --surface-glass: rgba(22, 26, 33, .9);
    --line: #2c313a;
    --line-soft: #262b33;
    --text-1: #e5eaf3;
    --text-2: #b6bdca;
    --text-3: #7e879a;
    --code-bg: #14171d;
    --code-fg: #c3c9d4;
    --brand-soft: #123a6e;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 14px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);

    /* Element Plus 深色变量（组件随之自动变暗） */
    --el-color-primary: #4d8dff;
    --el-color-primary-light-3: #3b76d6;
    --el-color-primary-light-5: #2f5fb0;
    --el-color-primary-light-7: #264a8c;
    --el-color-primary-light-8: #203e75;
    --el-color-primary-light-9: #1a3360;
    --el-color-primary-dark-2: #78abff;
    /* 深色下语义色浅底（EP 默认未覆盖，避免 is-plain 按钮亮片） */
    --el-color-danger-light-9: #3a1a1a;
    --el-color-warning-light-9: #33290f;
    --el-color-success: #34c471;
    --el-color-success-dark-2: #27a85c;
    --el-color-success-light-9: #12301f;
    --el-color-info-light-9: #262b34;
    --el-bg-color: #1a1d23;
    --el-bg-color-page: #0f1115;
    --el-bg-color-overlay: #20242c;
    --el-text-color-primary: #e5eaf3;
    --el-text-color-regular: #c3c9d4;
    --el-text-color-secondary: #9aa3b2;
    --el-text-color-placeholder: #6b7280;
    --el-text-color-disabled: #565c66;
    --el-border-color: #363b45;
    --el-border-color-light: #30343d;
    --el-border-color-lighter: #2a2e37;
    --el-border-color-extra-light: #242830;
    --el-border-color-dark: #42474f;
    --el-border-color-darker: #4c525c;
    --el-fill-color-blank: #1a1d23;
    --el-fill-color-light: #22262e;
    --el-fill-color-lighter: #1e222a;
    --el-fill-color: #262b34;
    --el-fill-color-dark: #2c313a;
    --el-fill-color-darker: #333944;
    --el-mask-color: rgba(0, 0, 0, .7);
    /* 表格 */
    --el-table-bg-color: #1a1d23;
    --el-table-tr-bg-color: #1a1d23;
    --el-table-header-bg-color: #20242c;
    --el-table-row-hover-bg-color: #232832;
    --el-table-border-color: #2c313a;
    --el-table-text-color: #c3c9d4;
    --el-table-header-text-color: #9aa3b2;
    --el-table-current-row-bg-color: #24304a;
}

/* 深色滚动条：与亮色共用同一套“内嵌圆角胶囊”语言（同 10px 宽 / r8 / 2px 透明边内嵌 / 透明轨道），仅换深色取值，深浅两态风格统一；hover 微染品牌蓝呼应主色 */
html.dark ::-webkit-scrollbar { width: 10px; height: 10px; }
html.dark ::-webkit-scrollbar-track { background: transparent; }
html.dark ::-webkit-scrollbar-thumb { background: #3a4150; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #4a5a82; background-clip: padding-box; }
html.dark { scrollbar-color: #3a4150 transparent; }

/* 深色下常见内联灰/蓝文字兜底提亮（内联 style 优先级高，用属性选择器 + !important） */
html.dark [style*="color:#666"], html.dark [style*="color: #666"],
html.dark [style*="color:#888"], html.dark [style*="color: #888"],
html.dark [style*="color:#999"], html.dark [style*="color: #999"],
html.dark [style*="color:#6b7686"], html.dark [style*="color: #6b7686"],
html.dark [style*="color:#5b6472"], html.dark [style*="color: #5b6472"] { color: #a7afbe !important; }
html.dark [style*="color:#333"], html.dark [style*="color: #333"] { color: #d0d5dd !important; }

/* Element Plus 少量硬编码面在深色的补强 */
html.dark .el-message-box, html.dark .el-dialog, html.dark .el-drawer,
html.dark .el-popover, html.dark .el-popper, html.dark .el-select-dropdown,
html.dark .el-picker-panel, html.dark .el-dropdown-menu {
    --el-bg-color-overlay: #20242c;
    background-color: #20242c !important;
    border-color: #2c313a !important;
    color: #d6dbe4;
}
html.dark .el-message-box__title, html.dark .el-dialog__title { color: #e5eaf3; }
html.dark .el-overlay { background-color: rgba(0, 0, 0, .6); }
html.dark .el-card { background-color: #1a1d23; border-color: #2c313a; color: #d6dbe4; }
html.dark .el-tag { border-color: #363b45; }
html.dark .el-divider__text { background-color: #1a1d23; color: #9aa3b2; }
html.dark .el-empty__description p { color: #7e879a; }

/* ============================================================
   后台管理控制台 theme-admin
   ============================================================ */
html.dark body.theme-admin { background: #0f1115; }
html.dark body.theme-admin .sidebar {
    background: #161a21; color: var(--text-1); border-right-color: #23272f;
    box-shadow: 2px 0 16px rgba(0, 0, 0, .5);
}
html.dark body.theme-admin .sidebar-logo { border-bottom-color: #23272f; }
html.dark body.theme-admin .sidebar-logo .logo-text { color: #e5eaf3; }
html.dark body.theme-admin .nav-group-title { color: #6b7280; }
html.dark body.theme-admin .nav-item { color: #aeb6c4; }
html.dark body.theme-admin .nav-item:hover { background: #1f2735; color: #78abff; }
html.dark body.theme-admin .nav-item.active { background: #123a6e; color: #78abff; }
html.dark body.theme-admin .nav-item.group-active { color: #e5eaf3; }
html.dark body.theme-admin .sidebar-footer { border-top-color: #23272f; color: #7e879a; }

html.dark body.theme-admin .topbar {
    background: #161a21; border-bottom-color: #23272f; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
html.dark body.theme-admin .topbar-left { color: #e5eaf3; }
html.dark body.theme-admin .topbar-tabs { background: #20242c; }
html.dark body.theme-admin .topbar-tab { color: #9aa3b2; }
html.dark body.theme-admin .topbar-tab.active { background: #2a3346; color: #78abff; box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
html.dark body.theme-admin .hamburger-btn span { background: #c3c9d4; }
html.dark body.theme-admin .topbar-user { color: #b6bdca; }

html.dark body.theme-admin .welcome-card {
    background: #1a1f28; border-color: #262b34; color: #e5eaf3; box-shadow: var(--shadow-md);
}
html.dark body.theme-admin .welcome-card h2 { color: #eef1f6; }
html.dark body.theme-admin .welcome-card p { color: #9aa3b2; }

html.dark body.theme-admin .stat-card {
    background: #1a1d23; border-color: #262b34; box-shadow: var(--shadow-sm);
}
html.dark body.theme-admin .stat-info h3 { color: #e5eaf3; }
html.dark body.theme-admin .stat-info span { color: #7e879a; }
html.dark body.theme-admin .stat-icon.blue { background: #16386b; color: #78abff; }
html.dark body.theme-admin .stat-icon.green { background: #12301f; color: #5ec97f; }
html.dark body.theme-admin .stat-icon.orange { background: #33290f; color: #f0c04a; }
html.dark body.theme-admin .stat-icon.purple { background: #2b1740; color: #c58af0; }
html.dark body.theme-admin .stat-icon.cyan { background: #0d2c30; color: #4dd0e1; }
html.dark body.theme-admin .stat-icon.gray { background: #262b33; color: #a0aec0; }

html.dark body.theme-admin .panel {
    background: #1a1d23; border-color: #262b34; box-shadow: var(--shadow-md);
}
html.dark body.theme-admin .panel h3, html.dark body.theme-admin .panel-head h3 { color: #e5eaf3; border-bottom-color: #262b34; }
html.dark body.theme-admin .panel-head { border-bottom-color: #262b34; }
html.dark body.theme-admin .field label { color: #9aa3b2; }
html.dark body.theme-admin .hint { color: #7e879a; }
html.dark body.theme-admin .row-check { background: #20242c; border-color: #3a4150; }
html.dark body.theme-admin .row-check.checked { background: #4d8dff; border-color: #4d8dff; color: #fff; }
html.dark body.theme-admin .edit-tabs .el-tabs__nav-wrap { background: #20242c; }
html.dark body.theme-admin .edit-tabs .el-tabs__item { color: #9aa3b2; }
html.dark body.theme-admin .edit-tabs .el-tabs__item.is-active { background: #2a3346; color: #e5eaf3; }
html.dark body.theme-admin .sms-detail-content { background: #20242c; color: #c3c9d4; }
html.dark body.theme-admin .rent-sms-expand { background: #1e222a; }
html.dark body.theme-admin .rent-sms-item { border-bottom-color: #2a2e37; }
html.dark body.theme-admin .rent-sms-line { color: #c3c9d4; }
html.dark body.theme-admin .device-tab { color: #9aa3b2; }
html.dark body.theme-admin .device-tab.active { color: #78abff; }
html.dark body.theme-admin .device-tab.channel-tab, html.dark body.theme-admin .device-tab.group-tab { color: #7e879a; }
html.dark body.theme-admin .group-nav-count { background: #262b34; color: #9aa3b2; }
html.dark body.theme-admin .project-rules-box { background: #20242c; border-color: #2c313a; }
html.dark body.theme-admin .group-edit-input { background: #16191f; color: #e5eaf3; }
html.dark body.theme-admin .group-context-menu { background: #20242c; border-color: #2c313a; box-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
html.dark body.theme-admin .group-context-item { color: #c3c9d4; }
html.dark body.theme-admin .group-context-item:hover { background: #262b34; color: #78abff; }
html.dark body.theme-admin .group-context-title { color: #6b7280; border-bottom-color: #2a2e37; }
html.dark body.theme-admin .h5-preview-url { background: #20242c; color: #9aa3b2; }
html.dark body.theme-admin .h5-preview-iframe { background: #fff; border-color: #2c313a; }
html.dark body.theme-admin .sidebar-overlay { background: rgba(0, 0, 0, .6); }
/* API/深色代码块本就深色，保持 */
html.dark body.theme-admin .api-example { background: #14171d; color: #d6deeb; }

/* ============================================================
   用户前台控制台 theme-user
   ============================================================ */
html.dark body.theme-user { background: #0f1115; }
/* web sidebar 浅色已是深色渐变，深色下微调更深 */
html.dark body.theme-user .sidebar {
    background: linear-gradient(180deg, #0a0e16 0%, #0d1622 50%, #0f1a2b 100%);
    box-shadow: 2px 0 20px rgba(0, 0, 0, .6);
}
html.dark body.theme-user .topbar {
    background: #161a21; border-bottom-color: #23272f; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
html.dark body.theme-user .topbar-left { color: #e5eaf3; }
html.dark body.theme-user .balance-display { color: #9aa3b2; }
html.dark body.theme-user .balance-display strong { color: #78abff; }
html.dark body.theme-user .topbar-user { color: #b6bdca; }
html.dark body.theme-user .menu-toggle { background: #20242c; color: #c3c9d4; }

html.dark body.theme-user .welcome-card {
    background: linear-gradient(135deg, #1e3a6b 0%, #14264a 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
html.dark body.theme-user .panel {
    background: #1a1d23; border-color: #262b34; box-shadow: var(--shadow-md);
}
html.dark body.theme-user .panel h3 { color: #e5eaf3; }
html.dark body.theme-user .qrcode-box img, html.dark body.theme-user .qrcode-box canvas { border-color: #2c313a; }
html.dark body.theme-user .addr-box { background: #20242c; color: #9aa3b2; }
html.dark body.theme-user .card-balance { color: #9aa3b2; }
html.dark body.theme-user .rent-card { border-color: #2c313a; background: #1e222a; }
html.dark body.theme-user .rent-phone { color: #78abff; }
html.dark body.theme-user .rent-phone:hover { color: #9cc2ff; }
html.dark body.theme-user .rent-meta { color: #7e879a; }
html.dark body.theme-user .sms-list { border-top-color: #2a2e37; }
html.dark body.theme-user .sms-item { border-bottom-color: #23272f; }
html.dark body.theme-user .sms-content { color: #b6bdca; }
html.dark body.theme-user .code-hl { background: #3a3010; color: #f0c04a; }
html.dark body.theme-user .code-hl:hover { background: #4a3d14; }
html.dark body.theme-user .sms-time { color: #6b7280; }
html.dark body.theme-user .info-item label { color: #7e879a; }
html.dark body.theme-user .info-item .val { color: #e5eaf3; }
html.dark body.theme-user .api-key-mono { color: #d6dbe4; }
html.dark body.theme-user .api-doc-row { border-bottom-color: #262b34; }
html.dark body.theme-user .api-doc-row label { color: #7e879a; }
html.dark body.theme-user .api-doc-row .val { color: #e5eaf3; }
html.dark body.theme-user .api-doc-row code { background: #20242c; color: #78abff; }
html.dark body.theme-user .api-example { background: #14171d; color: #d6deeb; }
html.dark body.theme-user .sidebar-mask.open { background: rgba(0, 0, 0, .6); }

/* ============================================================
   登录页 theme-login（admin/index.html + web/index.html）
   ============================================================ */
html.dark body.theme-login {
    background: radial-gradient(1200px 600px at 50% -10%, #123a6e 0%, #0f1115 60%);
    color: #e5eaf3;
}
html.dark body.theme-login .login-card {
    background: #1a1d23; border-color: #262b34; box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
html.dark body.theme-login .login-title h1 { color: #eef1f6; }
html.dark body.theme-login .login-title p { color: #7e879a; }
html.dark body.theme-login .tab-switch { background: #20242c; }
html.dark body.theme-login .tab-switch .tab { color: #9aa3b2; }
html.dark body.theme-login .tab-switch .tab.active { background: #2a3346; color: #78abff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
html.dark body.theme-login .tip { color: #6b7280; }
/* 登录页新手引导块（web/index.html、admin/index.html 共用类名，靠 body 作用域区分页面） */
html.dark body.theme-login .login-help { border-top-color: #23272f; }
html.dark body.theme-login .login-help-hd { color: #c3c9d4; }
html.dark body.theme-login .login-help-hd .el-icon { color: #78abff; }
html.dark body.theme-login .login-help-row { color: #9aa3b2; }
html.dark body.theme-login .login-help-row b { background: #123a6e; color: #78abff; }
html.dark body.theme-login .login-help-row i { color: #7e879a; }
html.dark body.theme-login .login-help-note { background: #16191f; color: #7e879a; }
html.dark body.theme-login .login-help-note.warn { background: #33290f; color: #f0c04a; }

/* ============================================================
   代理 API 测试台 theme-agent
   ============================================================ */
html.dark body.theme-agent { background: #0f1115; color: #d6dbe4; }
html.dark body.theme-agent .card {
    background: #1a1d23; border-color: #262b34; box-shadow: var(--shadow-sm);
}
html.dark body.theme-agent .sub { color: #7e879a; }
html.dark body.theme-agent .card h2 { color: #e5eaf3; }
html.dark body.theme-agent .card h2 .n { background: #4d8dff; color: #0f1115; }
html.dark body.theme-agent label { color: #9aa3b2; }
html.dark body.theme-agent input, html.dark body.theme-agent select, html.dark body.theme-agent textarea {
    background: #16191f; border-color: #2c313a; color: #d6dbe4;
}
html.dark body.theme-agent input:focus, html.dark body.theme-agent select:focus, html.dark body.theme-agent textarea:focus {
    border-color: #4d8dff; background: #1a1e25;
}
html.dark body.theme-agent button { background: #262b34; color: #c3c9d4; }
html.dark body.theme-agent button.primary { background: #4d8dff; color: #0f1115; }
html.dark body.theme-agent button.ghost { background: #16191f; border-color: #2c313a; }
html.dark body.theme-agent pre { background: #14171d; color: #c3c9d4; border-color: #262b34; }
html.dark body.theme-agent .tag { background: #262b34; color: #9aa3b2; }
html.dark body.theme-agent .tag.get { background: #12301f; color: #5ec97f; }
html.dark body.theme-agent .tag.post, html.dark body.theme-agent .tag.put { background: #33290f; color: #f0c04a; }
html.dark body.theme-agent .tag.del { background: #3a1a1a; color: #f58c8c; }
html.dark body.theme-agent .hint { color: #7e879a; }
html.dark body.theme-agent .tokbox { background: #16191f; border-color: #2c313a; }
html.dark body.theme-agent .guide { background: #161a21; border-color: #262b34; border-left-color: #4d8dff; color: #9aa3b2; }
html.dark body.theme-agent .guide b { color: #e5eaf3; }
html.dark body.theme-agent .guide .tip { color: #7e879a; }
html.dark body.theme-agent .status.ok { color: #5ec97f; }
html.dark body.theme-agent .status.err { color: #f58c8c; }

/* ============================================================
   响应式微调（移动端把 FAB 贴边、但不缩到 44px 以下：实测 38px 点按容易漏）
   ============================================================ */
@media (max-width: 640px) {
    .theme-toggle { right: 12px; bottom: 12px; width: 44px; height: 44px; font-size: 18px; }
}

/* 尊重系统减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
   Element Plus 组件精修层（2026-11 UI 升级）
   - 把 EP 默认组件（4px 小圆角 / 32px 高 / 无焦点光圈）统一到本设计语言：
     大圆角、品牌蓝焦点光圈、柔和层次、一致间距。一处生效，三端 + 登录页全受益。
   - 作用域 body[class*="theme-"]，特异度高于 EP 默认与多数页面内联同名规则；
     深色背景仍由前文 html.dark 的 !important 接管，本层只补圆角/间距/光圈等。
   - 移动端紧凑内距交给 responsive.css：凡涉及 padding/height 的精修都 guard 在
     min-width 媒体查询里，避免覆盖窄屏基线。
   ============================================================ */
body[class*="theme-"] {
    --el-border-radius-base: 10px;
    --el-border-radius-small: 6px;
    /* 统一控件尺寸（2026-11-22 修正）：此前 small/default/large 三档并存(28/36/42)，
       按钮又用另一套 --el-button-size(24/32/40)，导致同页按钮/输入/开关高低不齐。
       把三档收敛为同一基准，使 EP 无论 size 属性都渲染同高，一次性抹平差异。 */
    --el-component-size: 34px;
    --el-component-size-large: 34px;
    --el-component-size-small: 34px;
    --el-button-size: 34px;
}

/* ---------- 输入框 / 文本域 / 选择器：统一圆角 + 品牌蓝焦点光圈 ---------- */
body[class*="theme-"] .el-input__wrapper {
    border-radius: 10px;
    background-color: var(--el-fill-color-blank);
    box-shadow: 0 0 0 1px var(--el-border-color) inset;
    transition: box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
body[class*="theme-"] .el-input__wrapper:hover { box-shadow: 0 0 0 1px var(--el-border-color-hover, #c0c4cc) inset; }
body[class*="theme-"] .el-input__wrapper.is-focus {
    box-shadow: 0 0 0 1px var(--el-color-primary) inset, 0 0 0 3px var(--el-color-primary-light-9) !important;
}
body[class*="theme-"] .el-input__wrapper.is-disabled {
    background-color: var(--el-fill-color-light);
    box-shadow: 0 0 0 1px var(--el-border-color-lighter) inset;
}
body[class*="theme-"] .el-input__inner { color: var(--el-text-color-regular); }
body[class*="theme-"] .el-input__inner::placeholder { color: var(--el-text-color-placeholder); }
body[class*="theme-"] .el-input__prefix, body[class*="theme-"] .el-input__suffix { color: var(--el-text-color-placeholder); }
body[class*="theme-"] .el-input-group__prepend, body[class*="theme-"] .el-input-group__append { border-radius: 10px; }
body[class*="theme-"] .el-textarea__inner {
    border-radius: 10px;
    padding: 8px 12px;
    line-height: 1.6;
    box-shadow: 0 0 0 1px var(--el-border-color) inset;
    transition: box-shadow var(--dur) var(--ease);
}
body[class*="theme-"] .el-textarea__inner:hover { box-shadow: 0 0 0 1px var(--el-border-color-hover, #c0c4cc) inset; }
body[class*="theme-"] .el-textarea__inner:focus {
    box-shadow: 0 0 0 1px var(--el-color-primary) inset, 0 0 0 3px var(--el-color-primary-light-9) !important;
}
/* 下拉面板：选项圆角 + 选中浅蓝底 */
body[class*="theme-"] .el-select-dropdown__list { padding: 4px; }
body[class*="theme-"] .el-select-dropdown__item { border-radius: 7px; margin: 1px 4px; }
body[class*="theme-"] .el-select-dropdown__item.is-hovering { background: var(--el-fill-color-light); }
body[class*="theme-"] .el-select-dropdown__item.is-selected { color: var(--el-color-primary); font-weight: 600; background: var(--el-color-primary-light-9); }
body[class*="theme-"] .el-select-dropdown__empty { color: var(--text-3); }

/* ---------- 按钮：圆角分级 + 主按钮柔和投影 ---------- */
body[class*="theme-"] .el-button { border-radius: 9px; font-weight: 500; }
/* 统一按钮尺寸/圆角/字号：抹平 size=small/default/large 造成的 24/32/40 高度混排与圆角不一 */
body[class*="theme-"] .el-button,
body[class*="theme-"] .el-button--small,
body[class*="theme-"] .el-button--large { --el-button-size: 34px; height: 34px; border-radius: 9px; font-size: 14px; padding-top: 0; padding-bottom: 0; }
body[class*="theme-"] .el-button--large { font-weight: 600; }
body[class*="theme-"] .el-button.is-circle { width: 34px; padding-left: 0; padding-right: 0; }
body[class*="theme-"] .el-button--primary:not(.is-disabled):not(.is-link) { box-shadow: 0 2px 8px rgba(37, 99, 235, .22); }
body[class*="theme-"] .el-button--primary:not(.is-disabled):not(.is-link):hover { box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
body[class*="theme-"] .el-button.is-link, body[class*="theme-"] .el-button.is-text { box-shadow: none !important; }

/* ---------- 标签 / 分页 / 消息浮层 ---------- */
body[class*="theme-"] .el-tag { border-radius: 7px; font-weight: 500; }
body[class*="theme-"] .el-pager li { border-radius: 8px; }
body[class*="theme-"] .el-pager li.is-active { background: var(--el-color-primary); color: #fff; }
body[class*="theme-"] .el-message-box { border-radius: 14px; }
body[class*="theme-"] .el-message { border-radius: 10px; box-shadow: var(--shadow-md); }
body[class*="theme-"] .el-notification { border-radius: 12px; box-shadow: var(--shadow-md); }
body[class*="theme-"] .el-tabs__active-bar { background-color: var(--el-color-primary); }
body[class*="theme-"] .el-tabs__item.is-active, body[class*="theme-"] .el-tabs__item:hover { color: var(--el-color-primary); }
body[class*="theme-"] .el-empty__description p { color: var(--text-3); }
body[class*="theme-"] .el-form-item__label { color: var(--text-2); font-weight: 500; }

/* ---------- 表格：柔和表头 + 品牌蓝悬停 + 圆角 ---------- */
body[class*="theme-"] .el-table {
    --el-table-border-color: var(--line-soft);
    --el-table-header-bg-color: var(--surface-2);
    --el-table-header-text-color: var(--text-2);
    --el-table-row-hover-bg-color: var(--brand-soft);
}
body[class*="theme-"] .el-table th.el-table__cell { font-weight: 600; }
body[class*="theme-"] .el-table__inner-wrapper { border-radius: 12px; }
/* 全局 *{scrollbar-gutter:stable} 会让表体预留滚动条槽而表头未同步，
   导致固定列（右固定操作列）表头/表体错位出现纵缝；EP 表格真正的滚动容器是
   .el-scrollbar__wrap，把槽位交还 EP 自身补偿才能对齐。
   注意 .el-scrollbar 本身（overflow:hidden 的外层）也会吃到全局 stable 预留 15px，
   使 wrap 比 header-wrapper 窄一截、横向滚到右端时表头/表体错缝，必须一并还原 */
body[class*="theme-"] .el-table .el-scrollbar,
body[class*="theme-"] .el-table .el-scrollbar__wrap,
body[class*="theme-"] .el-table__header-wrapper,
body[class*="theme-"] .el-table__body-wrapper,
body[class*="theme-"] .el-table__footer-wrapper { scrollbar-gutter: auto; }
@media (min-width: 993px) {
    body[class*="theme-"] .el-table .el-table__cell { padding: 13px 0; }
}

/* ---------- 弹窗：大圆角 + 头尾分隔线 + 标题加重（窄屏内距交给 responsive.css） ---------- */
body[class*="theme-"] .el-dialog { border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
body[class*="theme-"] .el-dialog__title { font-size: 16px; font-weight: 600; color: var(--text-1); }
body[class*="theme-"] .el-dialog__headerbtn { top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; transition: background var(--dur) var(--ease); }
body[class*="theme-"] .el-dialog__headerbtn:hover { background: var(--surface-2); }
body[class*="theme-"] .el-dialog__headerbtn:hover .el-dialog__close { color: var(--brand); }
@media (min-width: 769px) {
    body[class*="theme-"] .el-dialog__header { padding: 18px 48px 14px 22px; margin-right: 0; border-bottom: 1px solid var(--line-soft); }
    body[class*="theme-"] .el-dialog__body { padding: 20px 22px; }
    body[class*="theme-"] .el-dialog__footer { padding: 14px 22px 18px; border-top: 1px solid var(--line-soft); }
    body[class*="theme-"] .el-drawer__header { padding: 18px 22px 14px; margin-bottom: 0; border-bottom: 1px solid var(--line-soft); }
}
/* 预览类弹窗保持紧凑上内距（页面内联意图，不被全局 body padding 推高） */
body[class*="theme-"] .guide-preview-dialog .el-dialog__body,
body[class*="theme-"] .tpl-prev-dialog .el-dialog__body { padding-top: 8px; }
body[class*="theme-"] .el-drawer__title { font-size: 16px; font-weight: 600; color: var(--text-1); }

/* ---------- 管理后台侧栏/顶栏细节（token 化，深色由前文接管） ---------- */
body.theme-admin .nav-item { border-radius: 10px; }
body.theme-admin .nav-item.active { background: var(--brand-soft); color: var(--brand); }
body.theme-admin .topbar-tabs { border-radius: 9px; }
body.theme-admin .topbar-tab { border-radius: 6px; }

/* ============================================================
   登录页精修（admin/index.html + web/index.html 共用 theme-login）
   ============================================================ */
body.theme-login {
    background: radial-gradient(1000px 520px at 50% -8%, var(--brand-soft) 0%, var(--canvas) 58%);
}
body.theme-login .login-card {
    position: relative;
    border-radius: 18px; border: 1px solid var(--line-soft); box-shadow: var(--shadow-lg);
}
body.theme-login .login-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}
body.theme-login .login-title h1 { color: var(--text-1); }
body.theme-login .login-title .logo-badge { box-shadow: 0 8px 20px rgba(37, 99, 235, .32); }
body.theme-login .el-input--large .el-input__wrapper { border-radius: 11px; }
body.theme-login .submit-btn {
    height: 44px; border-radius: 11px; font-size: 15px; font-weight: 600; border: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 6px 18px rgba(37, 99, 235, .3);
}
body.theme-login .submit-btn:hover, body.theme-login .submit-btn:focus {
    background: linear-gradient(135deg, #3b76f0, #1d4ed8);
    box-shadow: 0 8px 22px rgba(37, 99, 235, .38);
}
body.theme-login .login-help-row b { background: var(--brand-soft); color: var(--brand); }
/* 登录页前缀/引导图标首帧 paint 不失效（无头截图与个别浏览器首屏不绘制，重排后才画出）：
   提升为独立合成层强制光栅化 */
body.theme-login .el-input__prefix .el-icon,
body.theme-login .login-help-hd .el-icon,
body.theme-agent .el-input__prefix .el-icon { transform: translateZ(0); }
body.theme-login .tab-switch { border-radius: 11px; }
body.theme-login .tab-switch .tab { border-radius: 8px; }
body.theme-login .tab-switch .tab.active { color: var(--brand); }

/* 登录页品牌徽标：admin 此前缺 .logo-badge 盒样式（只有 web 内联有），提到 theme.css 统一成
   与侧栏品牌砖同款三段渐变+高光，两页徒标从此一模一样 */
body[class*="theme-"] .login-title .logo-badge {
    width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px;
    background: linear-gradient(135deg, #3b76e8 0%, #2563eb 45%, #1d4ed8 100%);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .30), inset 0 1px 0 rgba(255, 255, 255, .25);
}
/* 副标题/说明游离灰 #9ca3af → 统一走 --text-3（深色由既有 html.dark 规则接管） */
body.theme-login .login-title p { color: var(--text-3); }

/* ---------- 代理台：登录卡顶部品牌条 + api-test 原生输入框精修 ---------- */
body.theme-agent .login-card { position: relative; box-shadow: var(--shadow-lg); }
body.theme-agent .login-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}
body.theme-agent input:not([type=checkbox]):not([type=radio]):not([type=range]),
body.theme-agent select, body.theme-agent textarea {
    border-radius: 10px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
body.theme-agent input:not([type=checkbox]):not([type=radio]):not([type=range]):focus,
body.theme-agent select:focus, body.theme-agent textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ===== 数字步进器精修（20261120b）=====
   右置小箭头（controls-position=right）在高分屏/缩放下仅 ~10px 且被 scale(.8)，观感近似空白方块；
   全站改用 EP 默认两侧 −/+ 大按钮后，这里保证图标足够大、足够深、hover 有品牌反馈，深色模式自动适配。 */
body[class*="theme-"] .el-input-number__increase,
body[class*="theme-"] .el-input-number__decrease {
    color: var(--el-text-color-regular, #606266);
    transition: color .15s, background-color .15s;
}
body[class*="theme-"] .el-input-number__increase:hover,
body[class*="theme-"] .el-input-number__decrease:hover {
    color: var(--el-color-primary, #2563eb);
    background: var(--el-fill-color-light, #f5f7fa);
}
body[class*="theme-"] .el-input-number__increase:active,
body[class*="theme-"] .el-input-number__decrease:active {
    color: var(--el-color-primary, #2563eb);
    background: var(--el-fill-color, #f0f2f5);
}
body[class*="theme-"] .el-input-number__increase .el-icon,
body[class*="theme-"] .el-input-number__decrease .el-icon {
    font-size: 15px;
    font-weight: 700;
    transform: none;
}
body[class*="theme-"] .el-input-number__increase .el-icon svg,
body[class*="theme-"] .el-input-number__decrease .el-icon svg {
    width: 1em;
    height: 1em;
}
body[class*="theme-"] .el-input-number.is-disabled .el-input-number__increase,
body[class*="theme-"] .el-input-number.is-disabled .el-input-number__decrease {
    color: var(--el-disabled-text-color, #c0c4cc);
}

/* ===== 说明/引导默认收起（20261121a）=====
   登录帮助折叠（.login-help.is-open 才展开正文）+ 页内提示折叠条 .page-hint-bar
   + 帮助按钮一次性红点 .tb-help-dot。默认收起、点击展开，状态由各页 localStorage 记忆。 */
.login-help-hd { cursor: pointer; user-select: none; }
.login-help-hd .lh-caret { display: inline-block; transition: transform .18s var(--ease, ease); color: var(--brand, #2563eb); font-size: 12px; }
.login-help.is-open .login-help-hd .lh-caret { transform: rotate(90deg); }
.login-help .login-help-body { display: none; }
.login-help.is-open .login-help-body { display: block; }
.page-hint-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 9px 14px; border: 1px solid var(--line, #e8ecf1); border-left: 3px solid var(--brand, #2563eb); border-radius: 10px; background: var(--surface-2, #f7f8fa); font-size: 13px; color: var(--text-2, #5b6472); cursor: pointer; user-select: none; transition: color .15s; }
.page-hint-bar:hover, .page-hint-bar:focus-visible { color: var(--brand, #2563eb); outline: none; }
.page-hint-bar .phb-ic { display: flex; color: var(--brand, #2563eb); font-size: 15px; }
.page-hint-bar .phb-caret { margin-left: auto; color: var(--brand, #2563eb); font-size: 12px; white-space: nowrap; }
.tb-help, .topbar-help { position: relative; }
.tb-help-dot { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--surface, #fff); pointer-events: none; }

/* ===== 首屏加载指示 boot-splash（20261121b）=====
   三控制台用 v-cloak 把整个应用藏到 Vue 运行时编译完巨型内联模板才显示，
   期间纯白屏、无任何反馈，用户误以为「卡死」。这里在 #app 之外放一个纯 CSS
   加载屏（不依赖 Vue/JS），首次绘制即出现，盖住编译空窗；mount 后由页内脚本
   加 .bs-hide 淡出并移除。z-index 高于一切（含 EP 弹窗/底部栏）。 */
.boot-splash { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--surface, #fff); transition: opacity .3s ease; }
html.dark .boot-splash { background: #161a21; }
.boot-splash .bs-ring { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--brand-soft, #e8f0fe); border-top-color: var(--brand, #2563eb); animation: bs-spin .8s linear infinite; }
html.dark .boot-splash .bs-ring { border-color: #123a6e; border-top-color: #78abff; }
.boot-splash .bs-tx { font-size: 13px; color: var(--text-3, #8a94a6); letter-spacing: .5px; }
.boot-splash .bs-error { max-width: 320px; padding: 0 24px; color: var(--text-1, #1f2430); font-size: 15px; font-weight: 600; text-align: center; line-height: 1.7; }
.boot-splash .bs-error-tip { max-width: 340px; padding: 0 24px; color: var(--text-3, #8a94a6); font-size: 12.5px; text-align: center; line-height: 1.7; }
.boot-splash .bs-retry { margin-top: 2px; }
.boot-splash.bs-hide { opacity: 0; pointer-events: none; }
.boot-splash.bs-failed .bs-ring { animation: none; border-color: var(--el-color-danger-light-7, #fbc4c4); border-top-color: var(--el-color-danger, #f56c6c); }
@keyframes bs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot-splash .bs-ring { animation-duration: 1.6s; } }

/* ============================================================
   控制台高级感打磨（2026-11-22）：顶栏品牌化 / 基准字号 / 卡片留白
   - 均用 body[class*="theme-"] 作用域（特异度 0,2,1）覆盖各页内联同名规则，无需 !important；
   - 深色顶栏/卡片由前文 html.dark body.theme-* （0,3,1）更高特异度接管，本层只影响亮色；
   - 卡片内距/间距只在桌面 min-width 下加宽，窄屏紧凑基线交给 responsive.css。
   ============================================================ */

/* 顶栏：纯白平面 → 半透明白竖向微渐变 + 更柔的浮起投影，并在底沿加一条极淡品牌细线，
   让它从“无身份的白色横条”升级为有识别度的 app bar（.topbar 为 sticky 定位元素，::after 绝对定位安全、不占布局） */
body[class*="theme-"] .topbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .82) 100%);
    box-shadow: 0 1px 0 rgba(20, 39, 66, .04), 0 6px 18px rgba(31, 51, 79, .06);
}
body[class*="theme-"] .topbar::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: linear-gradient(90deg, var(--brand), rgba(37, 99, 235, .25) 38%, rgba(37, 99, 235, 0) 72%);
    opacity: .5; pointer-events: none;
}

/* 字号：整体偏小 → 抬升 Element Plus 基准字号，表格 / 按钮 / 输入 / 表单标签 / 标签页一处受益 */
body[class*="theme-"] { --el-font-size-base: 15px; }
body[class*="theme-"] .topbar-tab { font-size: 13.5px; }

/* 卡片留白：桌面加大面板 / 统计卡之间距，并把代理台偏紧的卡片内距对齐后台的宽松节奏 */
@media (min-width: 993px) {
    body[class*="theme-"] .panel,
    body[class*="theme-"] .ag-card { margin-bottom: 20px; }
    body.theme-agent .ag-card { padding: 20px 22px; }
    body.theme-agent .stat { padding: 18px; }
}

/* ============================================================
   控制台高级感打磨二期（2026-11-22b）：侧栏行高/选中竖条 · 统计卡层次 · 斑马纹淡化
   ============================================================ */

/* 侧边栏：导航项行高更松（11→13px 竖向内距），点按目标更大、列表不再局促 */
body[class*="theme-"] .nav-item { padding-top: 13px; padding-bottom: 13px; }

/* 选中项品牌竖条：把 admin/web 原有的整高 border-left 升级为居中短竖条 pill（更精致），
   并给此前没有竖条的 agent 补上。做法：保留透明 border 占位（文字不错位）+ ::before 画短条。
   .nav-item / .ag-item 设为定位上下文。 */
body[class*="theme-"] .nav-item,
body.theme-agent .ag-item { position: relative; }
body[class*="theme-"] .nav-item.active {
    border-left-color: transparent;   /* 原 3px 实边→透明，仍占 3px，文字位置不变 */
}
body[class*="theme-"] .nav-item.active::before,
body.theme-agent .ag-item.on::before {
    content: ''; position: absolute; left: -3px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 2px; background: var(--brand); pointer-events: none;
}
/* agent 卡片无 border 占位，竖条贴着圆角内缘更协调 */
body.theme-agent .ag-item.on::before { left: 0; border-radius: 3px; }

/* 统计卡：数字更大更重、标签更细更淡，拉开主/次层次（桌面加宽，窄屏维持页内 20px 基线） */
@media (min-width: 993px) {
    body[class*="theme-"] .stat-info h3 { font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
    body[class*="theme-"] .stat-info span { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: .3px; margin-top: 3px; }
    body.theme-agent .stat .v { font-size: 28px; letter-spacing: -.3px; }
    body.theme-agent .stat .k { letter-spacing: .3px; margin-bottom: 8px; }
}

/* 斑马纹淡化：亮色下把 EP 隔行底色压到近白、带一丝冷调，弱于 hover，避免与内容抢视线 */
html:not(.dark) body[class*="theme-"] .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
    background: #fbfcfe;
}

/* ============================================================
   控制台选择/开关控件精修（2026-11-22c）
   开关 / 勾选框 / 单选 / 单选按钮组：统一品牌蓝、柔和投影、焦点光圈、更舒展的成组间距。
   尺寸/位移沿用 EP 原生以保证不错位，仅做配色·圆角·阴影·间距·过渡精修；深色补 off 轨道/滑块阴影。
   ============================================================ */
body[class*="theme-"] {
    --el-switch-off-color: #d7dce4;
    --el-switch-on-color: var(--el-color-primary);
    --el-checkbox-input-border-color-hover: var(--el-color-primary);
    --el-radio-input-border-color-hover: var(--el-color-primary);
}
html.dark body[class*="theme-"] { --el-switch-off-color: #3a4150; }

/* 开关：未选轨道柔化、滑块加轻投影更立体、文案随状态变蓝、焦点品牌光圈 */
body[class*="theme-"] .el-switch__core { transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
body[class*="theme-"] .el-switch__action { box-shadow: 0 1px 3px rgba(17, 24, 39, .25); }
html.dark body[class*="theme-"] .el-switch__action { box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
body[class*="theme-"] .el-switch__label { color: var(--text-2); font-weight: 500; transition: color var(--dur) var(--ease); }
body[class*="theme-"] .el-switch.is-checked .el-switch__label { color: var(--el-color-primary); }
body[class*="theme-"] .el-switch:not(.is-disabled):hover .el-switch__core { filter: brightness(.98); }
body[class*="theme-"] .el-switch:focus-visible .el-switch__core { outline: 2px solid var(--el-color-primary); outline-offset: 2px; }

/* 勾选框：更圆角、悬停品牌描边、选中柔光、焦点光圈 */
body[class*="theme-"] .el-checkbox__inner { border-radius: 5px; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
body[class*="theme-"] .el-checkbox__input.is-checked .el-checkbox__inner { box-shadow: 0 2px 6px rgba(37, 99, 235, .28); }
body[class*="theme-"] .el-checkbox__label { color: var(--text-2); font-weight: 500; }
body[class*="theme-"] .el-checkbox:focus-visible .el-checkbox__inner { outline: 2px solid var(--el-color-primary); outline-offset: 2px; }

/* 单选：平滑 + 选中柔光 + 文案层次 + 焦点光圈 */
body[class*="theme-"] .el-radio__inner { transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
body[class*="theme-"] .el-radio__input.is-checked .el-radio__inner { box-shadow: 0 2px 6px rgba(37, 99, 235, .28); }
body[class*="theme-"] .el-radio__label { color: var(--text-2); font-weight: 500; }
body[class*="theme-"] .el-radio__input.is-checked + .el-radio__label { color: var(--el-color-primary); }
body[class*="theme-"] .el-radio:focus-visible .el-radio__inner { outline: 2px solid var(--el-color-primary); outline-offset: 2px; }

/* 成组的单选/勾选项：改用 flex + gap 均匀排布，比 EP 固定 30px 左边距更舒展、可自动换行 */
body[class*="theme-"] .el-radio-group,
body[class*="theme-"] .el-checkbox-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
body[class*="theme-"] .el-radio-group .el-radio + .el-radio,
body[class*="theme-"] .el-checkbox-group .el-checkbox + .el-checkbox { margin-left: 0; }
body[class*="theme-"] .el-radio, body[class*="theme-"] .el-checkbox { margin-right: 0; }

/* 单选按钮组（分段切换）：悬停品牌反馈、选中加柔和品牌投影与加粗，圆角沿用全局 token */
body[class*="theme-"] .el-radio-button__inner { transition: all var(--dur) var(--ease); font-weight: 500; }
body[class*="theme-"] .el-radio-button:not(.is-active) .el-radio-button__inner:hover { color: var(--el-color-primary); }
body[class*="theme-"] .el-radio-button.is-active .el-radio-button__inner { font-weight: 600; box-shadow: 0 2px 8px rgba(37, 99, 235, .30) !important; }

/* ============================================================
   控制台高级感打磨三期（2026-11-22d）：面板标题品牌引导条 · 后台欢迎卡层次 · 浮层菜单统一
   均用高特异度作用域；标题用 ::before 内联小竖条（不强改 display，避免子元素重排）。
   ============================================================ */

/* 面板/分区标题：去掉 admin 原有朴素整宽灰线，改为标题前一条品牌引导短竖条 + 加重字重，层级更现代 */
body[class*="theme-"] .panel h3 { border-bottom: none; padding-bottom: 0; margin-bottom: 14px; font-weight: 700; letter-spacing: .2px; color: var(--text-1); }
body[class*="theme-"] .panel-head h3 { font-weight: 700; letter-spacing: .2px; }
body[class*="theme-"] .panel h3::before,
body[class*="theme-"] .panel-head h3::before {
    content: ''; display: inline-block; width: 4px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 9px;
    background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

/* 后台欢迎卡（仅亮色）：平板白 → 右上角极淡品牌光晕 + 微渐变，仪表页顶部不再是无身份白块 */
html:not(.dark) body.theme-admin .welcome-card {
    background:
        radial-gradient(520px 200px at 100% 0%, rgba(37, 99, 235, .08), transparent 70%),
        linear-gradient(135deg, #f6f9ff 0%, #ffffff 55%);
    border-color: var(--line-soft);
}

/* 浮层菜单（下拉 / 选择器 / 气泡 / 右键）：统一大圆角 + 柔和投影 + 内嵌式条目与品牌悬停态 */
body[class*="theme-"] .el-dropdown__popper,
body[class*="theme-"] .el-select__popper,
body[class*="theme-"] .el-popover { border-radius: 12px; box-shadow: var(--shadow-lg); }
body[class*="theme-"] .el-dropdown-menu { padding: 5px; border-radius: 12px; }
html:not(.dark) body[class*="theme-"] .el-dropdown-menu,
html:not(.dark) body[class*="theme-"] .el-popover { border-color: var(--line-soft); }
body[class*="theme-"] .el-dropdown-menu__item {
    border-radius: 8px; margin: 1px 0; padding: 0 12px; min-height: 34px;
    display: flex; align-items: center; gap: 9px; color: var(--text-2);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
body[class*="theme-"] .el-dropdown-menu__item:not(.is-disabled):hover {
    background: var(--el-color-primary-light-9); color: var(--el-color-primary);
}
body[class*="theme-"] .el-dropdown-menu__item.is-active { color: var(--el-color-primary); font-weight: 600; }

/* ============================================================
   控制台高级感打磨四期（2026-11-22e）：次要按钮品牌化 · 空状态 · 卡片微浮起 · 描述表 · 进度条
   ============================================================ */

/* 默认/次要按钮（排除 primary/success/warning/danger/info 及 text/link 变体）：悬停品牌化，与主按钮成体系 */
body[class*="theme-"] .el-button:not(.el-button--primary):not(.el-button--success):not(.el-button--warning):not(.el-button--danger):not(.el-button--info):not(.is-text):not(.is-link) { color: var(--text-2); }
body[class*="theme-"] .el-button:not(.el-button--primary):not(.el-button--success):not(.el-button--warning):not(.el-button--danger):not(.el-button--info):not(.is-text):not(.is-link):not(.is-disabled):hover {
    border-color: var(--el-color-primary); color: var(--el-color-primary); background: var(--el-color-primary-light-9);
}

/* 空状态：间距更舒展、文案转灰（三端共 38 处，观感提升面广） */
body[class*="theme-"] .el-empty { padding: 30px 0; }
body[class*="theme-"] .el-empty__image { width: 92px; opacity: .85; }
body[class*="theme-"] .el-empty__description { margin-top: 12px; }
body[class*="theme-"] .el-empty__description p { color: var(--text-3); font-size: 13.5px; }

/* 卡片微浮起：仅真实悬停的桌面生效，避免触屏“粘住”；面板只描边提亮、不位移（体量大） */
@media (hover: hover) and (pointer: fine) and (min-width: 993px) {
    body[class*="theme-"] .stat-card,
    body[class*="theme-"] .ag-card, body[class*="theme-"] .rent-card { transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
    body[class*="theme-"] .stat-card:hover,
    body[class*="theme-"] .ag-card:hover,
    body[class*="theme-"] .rent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--el-color-primary-light-8); }
    body[class*="theme-"] .panel:hover { border-color: var(--el-color-primary-light-8); box-shadow: var(--shadow-md); }
}

/* 信息描述表：圆角 + 标签加重转深 + 行分隔柔化 */
body[class*="theme-"] .el-descriptions__body { border-radius: 12px; overflow: hidden; }
body[class*="theme-"] .el-descriptions__label { color: var(--text-2); font-weight: 600; }
body[class*="theme-"] .el-descriptions__content { color: var(--text-1); }
body[class*="theme-"] .el-descriptions .el-descriptions__cell { border-color: var(--line-soft); }

/* 进度条：轨道/进度都圆角化，未成部分用柔和底 */
body[class*="theme-"] .el-progress-bar__outer { border-radius: 999px; background: var(--surface-3); }
body[class*="theme-"] .el-progress-bar__inner { border-radius: 999px; }

/* ============================================================
   控制台高级感打磨六期（2026-11-22f）：信息提示条 el-alert · 分页悬停态
   ============================================================ */

/* 信息提示条（三端共 14 处，此前未精修）：大圆角 + 舒展内距 + 标题加重、正文行高与颜色分层（几何/排版不涉语义配色，亮暗两模式通用） */
body[class*="theme-"] .el-alert { border-radius: 12px; padding: 12px 15px; align-items: flex-start; }
body[class*="theme-"] .el-alert .el-alert__title { font-weight: 600; font-size: 14px; line-height: 1.5; }
body[class*="theme-"] .el-alert .el-alert__description { font-size: 13px; line-height: 1.65; margin-top: 4px; color: var(--text-2); }
body[class*="theme-"] .el-alert .el-alert__icon { font-size: 18px; }
body[class*="theme-"] .el-alert .el-alert__closebtn { font-size: 15px; }

/* 分页：页码/箭头圆角与悬停品牌反馈，与其余控件一致 */
body[class*="theme-"] .el-pagination { font-weight: 500; color: var(--text-2); }
body[class*="theme-"] .el-pagination button { border-radius: 8px; }
body[class*="theme-"] .el-pager li:not(.is-active):hover { color: var(--el-color-primary); }
body[class*="theme-"] .el-pagination.is-background .el-pager li:not(.is-active):hover { color: var(--el-color-primary); background: var(--el-color-primary-light-9); }

/* ============================================================
   侧栏品牌区统一 & 精致化（2026-11-22i）
   三端 logo 砖此前各写各的（admin/web 砖 38·r10·中性标题，agent 砖 26·r8·品牌蓝粗标题），
   现统一图标砖为 38×38 / r11 / 三段品牌渐变 + 柔和高光投影（浅侧栏与 web 深 navy 侧栏都好看）；
   标题字重统一 700；agent 蓝字标题回归中性强调色（var(--text-1)，深色模式自适应）。
   刻意不改 padding/gap：避免 theme.css 高特异度反杀 agent 移动端媒体查询。
   ============================================================ */
body[class*="theme-"] .sidebar-logo .logo-icon,
body[class*="theme-"] .ag-logo .dot {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, #3b76e8 0%, #2563eb 45%, #1d4ed8 100%);
    box-shadow: 0 5px 14px rgba(37, 99, 235, .30), inset 0 1px 0 rgba(255, 255, 255, .22);
    color: #fff;
}
body[class*="theme-"] .ag-logo .dot { font-size: 16px; }
body[class*="theme-"] .logo-text,
body[class*="theme-"] .ag-logo { font-weight: 700; }
body.theme-agent .ag-logo { color: var(--text-1); }

/* ============================================================
   移动端触控优化：窄屏 + 粗指针（真正的手机/平板才命中，桌面窄窗不受影响）。
   1) 触控目标放大：桌面基准 34px 控件在手指下偏小，窄屏统一提到 40px
      （EP 两套尺寸 token 同步抬，否则按钮和输入框会一高一矮）；
   2) 防 iOS 聚焦缩放：字号 <16px 的输入框被聚焦时 Safari 会自动放大整页
      （解除 user-scalable 锁定后这个行为会暴露出来），窄屏把输入字号提到 16px 阈值；
   3) 补 safe-area 欠账：viewport 早就写了 viewport-fit=cover，但刘海与底部手势条的
      避让一直没做：顶栏加高避开刘海，底部内容/FAB 垫高避开手势条，
      侧栏抽屉底缘不被手势条压住退出按钮（PWA standalone 全屏时尤其明显）。
   ============================================================ */
@media (max-width: 768px) and (pointer: coarse) {
    body[class*="theme-"] {
        --el-component-size: 40px;
        --el-component-size-large: 44px;
        --el-component-size-small: 36px;
        --el-button-size: 40px;
    }
    body[class*="theme-"] .el-button,
    body[class*="theme-"] .el-button--small,
    body[class*="theme-"] .el-button--large {
        --el-button-size: 40px;
        height: 40px;
        font-size: 15px;
        padding-top: 0;
        padding-bottom: 0;
    }
    body[class*="theme-"] .el-button.is-circle { width: 40px; padding-left: 0; padding-right: 0; }
    body[class*="theme-"] .el-input__inner,
    body[class*="theme-"] .el-textarea__inner,
    body[class*="theme-"] .el-select .el-input__inner { font-size: 16px; }
    /* 三控制台顶栏基础高度都是 56px（admin/web .topbar，agent .ag-top），这里直接按 56 加高；
       环境值为 0 的机型（非刘海/桌面窄窗）自动退回原高度，不会多出空白 */
    body[class*="theme-"] .topbar,
    body[class*="theme-"] .ag-top {
        height: calc(56px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
    }
    body[class*="theme-"] .content-area { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
    body[class*="theme-"] .sidebar { padding-bottom: env(safe-area-inset-bottom); }
    body[class*="theme-"] .theme-toggle { bottom: calc(18px + env(safe-area-inset-bottom)); }
}
