/* ============================================================
   AiVoice 后台暗黑模式 (html.theme-dark)
   由 dark.js 在 <html> 上切换 class, localStorage 记忆
   ============================================================ */
html.theme-dark {
    color-scheme: dark;
}
html.theme-dark body {
    background: #111318 !important;
    color: #d7d7d7;
}
html.theme-dark a:not(.layui-btn) { color: #6ea8dc; }
html.theme-dark a:hover:not(.layui-btn) { color: #8fc1ef; }
/* 按钮内文字恢复按钮自配色(不被全局链接色染) */
html.theme-dark .layui-btn { color: #ffffff; }
html.theme-dark .layui-btn-primary { color: #d7d7d7 !important; }
html.theme-dark a.layui-btn-primary:hover { color: #4fae65 !important; }

/* ---------- LayuiMini 框架区域 ---------- */
html.theme-dark .layuimini-content-tab { background-color: #111318 !important; }
html.theme-dark .layuimini-main { background-color: #111318 !important; }
html.theme-dark .layuimini-tab-action,
html.theme-dark .layuimini-tab .layui-tab-title { background-color: #1c1e22 !important; }
html.theme-dark .layuimini-tab .layui-tab-title .layui-tab-bar,
html.theme-dark .layuimini-tab .layui-tab-title li {
    background-color: #1c1e22 !important;
    color: #b8b8b8 !important;
}
html.theme-dark .layuimini-tab .layui-tab-title .layui-this {
    color: #4fae65 !important;
    background-color: #111318 !important;
}
html.theme-dark .layuimini-tab .layui-tab-title .layui-this:after {
    background-color: #111318 !important;
    border-bottom: 2px solid #4fae65 !important;
}
html.theme-dark .layuimini-search input { background-color: #1d2026 !important; color: #d7d7d7 !important; }
html.theme-dark .layuimini-search .layui-input:focus { border-color: #4fae65 !important; }

/* ---------- 卡片 / 快捷入口 ---------- */
html.theme-dark .layui-card {
    background-color: #1d2026 !important;
    border-color: #2c2f36 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.4) !important;
}
html.theme-dark .layui-card-header {
    color: #e7e7e7 !important;
    border-bottom-color: #2c2f36 !important;
}
html.theme-dark .layui-card-body { color: #d7d7d7 !important; }

/* ---------- 表格 ---------- */
html.theme-dark .layui-table {
    background-color: #1d2026 !important;
    color: #d7d7d7 !important;
}
html.theme-dark .layui-table thead tr,
html.theme-dark .layui-table th {
    background-color: #23262d !important;
    color: #e7e7e7 !important;
}
html.theme-dark .layui-table tbody tr:hover,
html.theme-dark .layui-table-hover {
    background-color: #23262d !important;
}
html.theme-dark .layui-table td, html.theme-dark .layui-table th {
    border-color: #2c2f36 !important;
}
html.theme-dark .layui-table-page { background-color: #1d2026 !important; }
html.theme-dark .layui-table-grid-down { border-color: #2c2f36 !important; }

/* ---------- 表单 ---------- */
html.theme-dark .layui-form-label { color: #b8b8b8 !important; }
html.theme-dark .layui-input,
html.theme-dark .layui-select,
html.theme-dark .layui-textarea {
    background-color: #1d2026 !important;
    border-color: #3a3d45 !important;
    color: #d7d7d7 !important;
}
html.theme-dark .layui-input::placeholder,
html.theme-dark .layui-textarea::placeholder { color: #6b6e75 !important; }
html.theme-dark .layui-form-select dl {
    background-color: #1d2026 !important;
    border-color: #3a3d45 !important;
}
html.theme-dark .layui-form-select dl dd,
html.theme-dark .layui-form-select dl dt { color: #d7d7d7 !important; background-color: transparent !important; }
html.theme-dark .layui-form-select dl dd:hover { background-color: #23262d !important; }
html.theme-dark .layui-form-select dl dd.layui-this { background-color: #2c2f36 !important; color: #4fae65 !important; }
/* 复选框: 未选中=深底空框; 选中=绿底白勾(保留layui原生对勾形态) */
html.theme-dark .layui-form-checkbox[lay-skin="primary"] i {
    background-color: #23262d !important;
    border-color: #3a3d45 !important;
    color: transparent !important;
}
html.theme-dark .layui-form-checkbox[lay-skin="primary"]:hover i {
    border-color: #4fae65 !important;
    color: transparent !important;
}
html.theme-dark .layui-form-checked[lay-skin="primary"] i,
html.theme-dark .layui-form-checked[lay-skin="primary"]:hover i {
    background-color: #4fae65 !important;
    border-color: #4fae65 !important;
    color: #ffffff !important;
}
html.theme-dark .layui-form-radio > i { color: #b8b8b8 !important; }
html.theme-dark .layui-form-radioed > i { color: #4fae65 !important; }
html.theme-dark .layui-form-switch { background-color: #3a3d45 !important; border-color: #3a3d45 !important; }
html.theme-dark .layui-form-onswitch { background-color: #4fae65 !important; border-color: #4fae65 !important; }
html.theme-dark .layui-form-pane .layui-form-label {
    background-color: #23262d !important;
    border-color: #3a3d45 !important;
    color: #b8b8b8 !important;
}

/* ---------- 按钮 ---------- */
html.theme-dark .layui-btn-primary {
    background-color: #1d2026 !important;
    border-color: #3a3d45 !important;
    color: #d7d7d7 !important;
}
html.theme-dark .layui-btn-primary:hover { border-color: #4fae65 !important; }
html.theme-dark .layui-btn-default {
    background-color: #1d2026 !important;
    color: #d7d7d7 !important;
}

/* ---------- 弹层 layer / laydate / 分页 / 树 ---------- */
html.theme-dark .layui-layer {
    background-color: #1d2026 !important;
    color: #d7d7d7 !important;
}
html.theme-dark .layui-layer-title {
    background-color: #23262d !important;
    color: #e7e7e7 !important;
    border-bottom-color: #2c2f36 !important;
}
html.theme-dark .layui-layer-btn a {
    background-color: #2c2f36 !important;
    color: #d7d7d7 !important;
    border-color: #3a3d45 !important;
}
html.theme-dark .layui-layer-btn .layui-layer-btn0 {
    background-color: #4fae65 !important;
    border-color: #4fae65 !important;
    color: #fff !important;
}
html.theme-dark .layui-laydate,
html.theme-dark .layui-laydate-content { background-color: #1d2026 !important; color: #d7d7d7 !important; }
html.theme-dark .layui-laydate-content th,
html.theme-dark .layui-laydate-content td { color: #d7d7d7 !important; }
html.theme-dark .laydate-day-mark { color: #8d8d8d !important; }
html.theme-dark .layui-laypage a, html.theme-dark .layui-laypage span {
    background-color: #1d2026 !important;
    color: #d7d7d7 !important;
    border-color: #3a3d45 !important;
}
html.theme-dark .layui-laypage .layui-laypage-curr .layui-laypage-em {
    background-color: #4fae65 !important;
}
html.theme-dark .layui-laypage input { background-color: #1d2026 !important; color: #d7d7d7 !important; }
html.theme-dark .layui-tree-entry:hover { background-color: #23262d !important; }
html.theme-dark .layui-drop-down,
html.theme-dark .dropdown-menu { background-color: #1d2026 !important; color: #d7d7d7 !important; }
html.theme-dark .layui-badge-rim { border-color: #3a3d45 !important; }

/* ---------- 其他文字 ---------- */
html.theme-dark .layui-form-mid, html.theme-dark .layui-word-aux { color: #8d8d8d !important; }
html.theme-dark .text-muted { color: #8d8d8d !important; }
html.theme-dark h1, html.theme-dark h2, html.theme-dark h3, html.theme-dark h4 {
    color: #e7e7e7 !important;
}
html.theme-dark .table-label, html.theme-dark .layui-table-view {
    border-color: #2c2f36 !important;
    background-color: #1d2026 !important;
}

/* ---------- 后台首页快捷入口 / 引用条 / 禁用按钮 ---------- */
html.theme-dark .layuimini-qiuck-module a {
    background-color: transparent !important;
}
html.theme-dark .layuimini-qiuck-module a i {
    background-color: #23262d !important;
    color: #4fae65 !important;
    border: 1px solid #2c2f36;
}
html.theme-dark .layuimini-qiuck-module a:hover i {
    background-color: #2c2f36 !important;
    color: #e7e7e7 !important;
}
html.theme-dark .layuimini-qiuck-module a cite,
html.theme-dark .welcome-module cite { color: #d7d7d7 !important; }
html.theme-dark .welcome-module { color: #d7d7d7 !important; }
html.theme-dark .layui-elem-quote {
    background-color: #1d2026 !important;
    border-left: 5px solid #4fae65 !important;
    color: #d7d7d7 !important;
}
html.theme-dark .layui-btn-disabled,
html.theme-dark .layui-btn-disabled:hover,
html.theme-dark .layui-btn.btn-size[disabled] {
    background-color: #23262d !important;
    border-color: #3a3d45 !important;
    color: #6b6e75 !important;
}
html.theme-dark .layui-bg-gray { background-color: #23262d !important; color: #d7d7d7 !important; }
html.theme-dark .background, html.theme-dark .progressBar {
    background-color: #1d2026 !important;
    color: #d7d7d7 !important;
}

/* ---------- 表格工具条/表头 ---------- */
html.theme-dark .layui-table-tool {
    background-color: #1d2026 !important;
    color: #d7d7d7 !important;
}
html.theme-dark .layui-table-tool-temp { color: #d7d7d7 !important; }
html.theme-dark .layui-table-tool .layui-inline { color: #d7d7d7 !important; }
html.theme-dark .layui-table-header {
    background-color: #23262d !important;
    color: #e7e7e7 !important;
}

/* ---------- CKEditor4 富文本 ---------- */
html.theme-dark .cke_chrome { border-color: #3a3d45 !important; }
html.theme-dark .cke_inner { background: #1d2026 !important; }
html.theme-dark .cke_top {
    background: #23262d !important;
    border-bottom-color: #3a3d45 !important;
}
html.theme-dark .cke_bottom {
    background: #23262d !important;
    border-top-color: #3a3d45 !important;
}
html.theme-dark .cke_toolgroup,
html.theme-dark .cke_combo_button {
    background: #2c2f36 !important;
    border-color: #3a3d45 !important;
}
html.theme-dark .cke_button a:hover,
html.theme-dark .cke_button a:focus,
html.theme-dark .cke_button_on {
    background: #3a3d45 !important;
    border-color: #4fae65 !important;
}
html.theme-dark .cke_button_icon { filter: invert(0.85) hue-rotate(180deg); }
html.theme-dark .cke_combo_text { color: #d7d7d7 !important; }
html.theme-dark .cke_panel { background: #1d2026 !important; border-color: #3a3d45 !important; }
html.theme-dark .cke_panel_frame { background: #1d2026 !important; }
html.theme-dark .cke_panel_listItem a { color: #d7d7d7 !important; }
html.theme-dark .cke_panel_listItem a:hover { background: #2c2f36 !important; }
html.theme-dark .cke_voice_label { color: #d7d7d7 !important; }

/* ---------- tab栏左右滚动钮/下拉钮 ---------- */
html.theme-dark .layuimini-tab .layui-tab-control .layui-tab-tool,
html.theme-dark .layuimini-tab .layui-tab-control .layuimini-tab-roll-left,
html.theme-dark .layuimini-tab .layui-tab-control .layuimini-tab-roll-right {
    background-color: #1c1e22 !important;
    color: #8d8d8d !important;
    border-color: #2c2f36 !important;
}
html.theme-dark .layuimini-tab .layui-tab-control .layui-tab-tool:hover,
html.theme-dark .layuimini-tab .layui-tab-control .layuimini-tab-roll-left:hover,
html.theme-dark .layuimini-tab .layui-tab-control .layuimini-tab-roll-right:hover {
    background-color: #23262d !important;
    color: #4fae65 !important;
}

/* ---------- 主框架加载层 ---------- */
html.theme-dark .layuimini-loader {
    background-color: #111318 !important;
}
html.theme-dark .layuimini-loader .layuimini-loader-inner {
    border-top-color: #4fae65 !important;
    border-right-color: #23262d !important;
    border-bottom-color: #4fae65 !important;
}
html.theme-dark .layuimini-loader .layuimini-loader-inner:before {
    border-top-color: #2c2f36 !important;
    border-right-color: #4fae65 !important;
    border-bottom-color: #2c2f36 !important;
}

/* ---------- 框架边框/滚动条/侧栏残留 ---------- */
html.theme-dark .layuimini-tab .layui-tab-title {
    background-color: #1c1e22 !important;
    border: 1px solid #2c2f36 !important;
    border-bottom-color: #2c2f36 !important;
}
html.theme-dark .layuimini-tab .layui-tab-title li {
    background-color: transparent !important;
    border-right-color: #2c2f36 !important;
    color: #b8b8b8 !important;
}
html.theme-dark .layuimini-tab .layui-tab-title li.layui-this { color: #4fae65 !important; }
html.theme-dark .layuimini-tab .close-box,
html.theme-dark .layuimini-tab .layui-tab-title span { background-color: #1c1e22 !important; }
html.theme-dark .layuimini-tab .layui-tab-title { border-bottom-color: #2c2f36 !important; }
html.theme-dark .layuimini-tab .layui-tab-title li:after { border-bottom-color: transparent !important; }
html.theme-dark .layui-layout-admin { background-color: #111318 !important; }
html.theme-dark .layui-layout-admin .layui-side { background-color: #1c1e22 !important; }
html.theme-dark .layui-layout-admin .layui-body { background-color: #111318 !important; }
html.theme-dark .layui-side-scroll { background-color: #1c1e22 !important; }
html.theme-dark .layuimini-site-mobile { background-color: #1c1e22 !important; }
/* 滚动条深色化(主框架+iframe内容页共用本文件) */
html.theme-dark ::-webkit-scrollbar { width: 8px; height: 8px; background: #1c1e22; }
html.theme-dark ::-webkit-scrollbar-thumb { background: #3a3d45; border-radius: 4px; }
html.theme-dark ::-webkit-scrollbar-thumb:hover { background: #4a4d55; }
html.theme-dark ::-webkit-scrollbar-track { background: transparent; }
html.theme-dark iframe::-webkit-scrollbar { width: 8px; height: 8px; }
html.theme-dark hr { border-top: 1px solid #2c2f36 !important; }

/* ---------- 登录页 ---------- */
html.theme-dark body {
    background: #111318 !important;
    background-image: none !important;
}
html.theme-dark body:after { background-color: #111318; }
html.theme-dark .login-form {
    background-color: #1d2026 !important;
    border-color: #2c2f36 !important;
    box-shadow: 0 0 24px rgba(0,0,0,.55) !important;
}
html.theme-dark .logo-title h1 { color: #4fae65 !important; }
html.theme-dark .login-form .layui-form-item input {
    background-color: #23262d !important;
    color: #d7d7d7 !important;
    border: 1px solid #3a3d45 !important;
}
html.theme-dark .login-form .layui-form-item input::placeholder { color: #6b6e75 !important; }
html.theme-dark .login-form .layui-form-item label { color: #6b6e75 !important; }
html.theme-dark .login-form .layui-form-item input { padding-left: 36px; }
html.theme-dark .captcha-img img { border-color: #3a3d45 !important; }
html.theme-dark .login-btn, html.theme-dark button.login-btn {
    background-color: #4fae65 !important;
    color: #fff !important;
}

/* ---------- 主题切换按钮 ---------- */
#adminThemeToggle {
    position: fixed;
    right: 18px;
    bottom: 68px;
    z-index: 99999999;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background-color: #1d2026;
    color: #f5d76e;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.45);
    border: 1px solid #3a3d45;
    user-select: none;
    transition: transform .15s ease;
}
#adminThemeToggle:hover { transform: scale(1.12); }
html:not(.theme-dark) #adminThemeToggle {
    background-color: #ffffff;
    color: #5b5e66;
    border: 1px solid #e2e2e2;
}

/* == 配音员等表单弹窗: 单选/容器白底适配(20261018) == */
html.theme-dark .layuimini-form .layui-form-item,
html.theme-dark .layuimini-form .layui-input-block,
html.theme-dark .layuimini-form .layui-form-radio,
html.theme-dark .layuimini-form .layui-form-radio > i { background-color: transparent !important; }
html.theme-dark .layuimini-form .layui-form-radio { color: #c9c9c9 !important; }
html.theme-dark .layuimini-form .layui-form-radio > i { color: #5cc07d !important; font-size: 22px; }
html.theme-dark .layuimini-form .layui-form-mid.layui-word-aux { color: #6b6e75 !important; }


/* == 根元素浅色底残留修复: 暗黑下html根背景必须是深色(否则弹窗iframe内容不足/滚动到底时露出#f2f2f2白板) == */
html.theme-dark { background-color: #111318 !important; }
html.theme-dark body { min-height: 100vh; }
