/* ==========================================================================
   静庭 SeiTei · theme-dark.css
   深色主题层 —— 必须最后加载（theme-responsive.css 之后）。

   为什么需要「逐组件覆盖」：
   上层 theme-white.css / theme-qianfan.css / theme-qianfan-color.css 存在大量
   写死浅色 + !important 的规则（例如
     html, body, .app, .main, .view { background:#F5F6FA !important }
     .topbar { background:#fff !important } / .sidebar { background:#fff !important }
     .metric { background:#fff !important } / .card { background:var(--q-card) !important }
   ）只改变量不够，必须用「更高特异性 + !important」逐层夺回。

   本文件策略：
     1) 定义深色 token（--bg/--card/--line/--fg/--muted/--primary …）；
     2) 把旧主题的令牌（--w-* / --q-* / styles.css 的 --bg-* --ink-*）桥接到深色，
        让仍按变量取色的组件自动跟随；
     3) 对写死颜色的组件用 html[data-theme="dark"] 前缀 + !important 覆盖；
     4) 最后兜底 JS 模板里少数 inline 浅色。

   对比度（目标 ≥ 4.5:1）：
     --fg      #E6E8EE on --bg #14161B   ≈ 14.6:1
     --fg      #E6E8EE on --card #1B1E25 ≈ 13.0:1
     --muted   #9AA3B2 on --card         ≈  6.6:1
     --primary #4C8DFF on --card         ≈  5.2:1
     #9EC1FF on rgba(76,141,255,.16)/card≈  8.0:1
     #FFFFFF on --primary-strong #2F6FE4 ≈  4.7:1
   ========================================================================== */

/* ==========================================================================
 * 0. 令牌：深色基准 + 旧层令牌桥接
 * ========================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;

  /* ---- 本层 token ---- */
  --bg: #14161B;
  --bg-2: #191C22;
  --card: #1B1E25;
  --card-2: #20242C;
  --line: #2A2E38;
  --line-2: #363C48;
  --fg: #E6E8EE;
  --fg-2: #C3C9D4;
  --muted: #9AA3B2;
  --primary: #4C8DFF;
  --primary-strong: #2F6FE4;
  --primary-soft: rgba(76, 141, 255, .16);
  --primary-fg: #9EC1FF;
  --ok: #3DD68C;
  --warn: #FFB454;
  --danger: #FF7A7A;

  /* ---- styles.css 令牌 ---- */
  --bg-base: #14161B;
  --bg-raised: #1B1E25;
  --bg-raised-2: #1B1E25;
  --bg-sunken: #20242C;
  --ink-900: #E6E8EE;
  --ink-600: #C3C9D4;
  --ink-400: #9AA3B2;
  --line: #2A2E38;
  --line-ink: #3A4150;
  --soft: #20242C;
  --fog: #9AA3B2;
  --sumi: #4C8DFF;
  --sakura: #4C8DFF;
  --matcha: #3DD68C;
  --clay: #FFB454;
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .40);
  --sh-md: 0 2px 8px rgba(0, 0, 0, .45);
  --sh-lg: 0 8px 28px rgba(0, 0, 0, .55);

  /* ---- theme-white.css 令牌 ---- */
  --w-paper: #1B1E25;
  --w-ink: #E6E8EE;
  --w-g1: #C3C9D4;
  --w-g2: #9AA3B2;
  --w-line: #2A2E38;
  --w-soft: #20242C;
  --w-fill: #2F6FE4;
  --w-fill-2: #3D6FD0;
  --w-fill-3: #2C3A55;
  --w-on-fill: #FFFFFF;
  --w-hover: rgba(255, 255, 255, .07);
  --w-hatch: repeating-linear-gradient(45deg, rgba(255, 255, 255, .55) 0 1px, transparent 1px 5px);
  --w-solid-line: #3A4150;

  /* ---- theme-qianfan*.css 令牌 ---- */
  --q-bg: #14161B;
  --q-card: #1B1E25;
  --q-line: #2A2E38;
  --q-line-2: #363C48;
  --q-ink: #E6E8EE;
  --q-ink-2: #C3C9D4;
  --q-dim: #9AA3B2;
  --q-text: #E6E8EE;
  --q-text-2: #C3C9D4;
  --q-text-3: #9AA3B2;
  --q-border: #2A2E38;
  --q-border-2: #363C48;
  --q-primary: #4C8DFF;
  --q-primary-hover: #6BA1FF;
  --q-primary-light: rgba(76, 141, 255, .16);
  --q-violet: #8B8BFF;
  --q-violet-light: rgba(139, 139, 255, .16);
  --q-success: #3DD68C;
  --q-warning: #FFB454;
  --q-danger: #FF7A7A;

  /* ---- live-a11y.js 注入的对比度变量 ---- */
  --a11y-muted: #9AA3B2;
}

/* ==========================================================================
 * 1. 画布 / 壳层
 * ========================================================================== */
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .app,
html[data-theme="dark"] .main,
html[data-theme="dark"] .view {
  background: var(--bg) !important;
  color: var(--fg) !important;
}

html[data-theme="dark"] .sidebar {
  background: var(--card) !important;
  border-right: 1px solid var(--line) !important;
}

html[data-theme="dark"] .topbar {
  background: var(--card) !important;
  border-bottom: 1px solid var(--line) !important;
  color: var(--fg) !important;
}

html[data-theme="dark"] .page {
  color: var(--fg) !important;
}

/* 滚动条 */
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border: 2px solid transparent;
  background-clip: content-box;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .30);
  background-clip: content-box;
  border: 2px solid transparent;
}
html[data-theme="dark"] ::selection {
  background: rgba(76, 141, 255, .42) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] :focus-visible {
  outline-color: var(--primary) !important;
}

/* ==========================================================================
 * 2. 侧栏：品牌 / 导航 / 用户
 * ========================================================================== */
html[data-theme="dark"] .brand {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .brand::before {
  background: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .brand-name {
  color: var(--fg) !important;
}
html[data-theme="dark"] .brand-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .enso-bg {
  opacity: .06;
}
html[data-theme="dark"] .enso-bg svg path {
  stroke: #FFFFFF !important;
}

html[data-theme="dark"] .nav-group-label,
html[data-theme="dark"] .nav-group-count {
  color: var(--muted) !important;
}
html[data-theme="dark"] .nav-item {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .nav-item .i {
  opacity: .8;
}
html[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, .07) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .nav-item.is-active,
html[data-theme="dark"] .sidebar .is-active,
html[data-theme="dark"] .sidebar a.is-active,
html[data-theme="dark"] .sidebar .nav-item.is-active > a {
  background: var(--primary-soft) !important;
  color: var(--primary-fg) !important;
  box-shadow: inset 2px 0 0 var(--primary) !important;
}
html[data-theme="dark"] .nav-item.is-active::before {
  background: var(--primary) !important;
  display: none;
}
html[data-theme="dark"] .sidebar a:hover {
  background: rgba(255, 255, 255, .07) !important;
}
html[data-theme="dark"] .sidebar .nav-label {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .nav-item.is-active .nav-label {
  color: var(--primary-fg) !important;
}
html[data-theme="dark"] .nav-badge {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .nav-item.is-active .nav-badge {
  background: transparent !important;
  border-color: rgba(158, 193, 255, .45) !important;
  color: var(--primary-fg) !important;
}
html[data-theme="dark"] .nav-badge--sakura {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--fg-2) !important;
}

html[data-theme="dark"] .sidebar-foot {
  border-top-color: var(--line) !important;
}
html[data-theme="dark"] .user-card:hover {
  background: rgba(255, 255, 255, .07) !important;
}
html[data-theme="dark"] .user-name {
  color: var(--fg) !important;
}
html[data-theme="dark"] .user-role {
  color: var(--muted) !important;
}
/* live-fixes.js 注入的退出登录按钮（写死 #fff / #4E5969） */
html[data-theme="dark"] #q-logout {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] #q-logout:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* ==========================================================================
 * 3. 顶栏：面包屑 / 图标按钮 / 搜索 / 快捷键
 * ========================================================================== */
html[data-theme="dark"] .crumb,
html[data-theme="dark"] .crumb a,
html[data-theme="dark"] .crumb-sep {
  color: var(--muted) !important;
}
html[data-theme="dark"] .crumb a:hover {
  color: var(--fg) !important;
}
html[data-theme="dark"] .crumb-now {
  color: var(--fg) !important;
}
html[data-theme="dark"] .icon-btn {
  color: var(--fg-2) !important;
  border-color: transparent !important;
  background: transparent !important;
}
html[data-theme="dark"] .icon-btn:hover {
  background: rgba(255, 255, 255, .08) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .icon-btn.is-active {
  background: rgba(255, 255, 255, .12) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .icon-btn__dot {
  background: var(--primary) !important;
  border-color: var(--card) !important;
}
html[data-theme="dark"] .search-trigger {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .search-trigger:hover {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .kbd {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .topbar-divider {
  background: var(--line) !important;
}
html[data-theme="dark"] .avatar-stack .av {
  border-color: var(--card) !important;
}
html[data-theme="dark"] #sz-live {
  color: var(--muted) !important;
  border-color: var(--line-2) !important;
  opacity: .85;
}

/* ==========================================================================
 * 4. 文字层级
 * ========================================================================== */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5 {
  color: var(--fg) !important;
}
html[data-theme="dark"] .page-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .page-title .page-title-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .page-desc {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .eyebrow {
  color: var(--muted) !important;
}
html[data-theme="dark"] .eyebrow .dot {
  background: var(--primary) !important;
}
html[data-theme="dark"] .sec-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .drawer-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .sec-sub,
html[data-theme="dark"] .card-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .dim,
html[data-theme="dark"] .t12.dim,
html[data-theme="dark"] .em-sub,
html[data-theme="dark"] .li-sub,
html[data-theme="dark"] .tbl-empty {
  color: var(--muted) !important;
}
html[data-theme="dark"] .muted {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .strong {
  color: var(--fg) !important;
}
html[data-theme="dark"] a,
html[data-theme="dark"] .link {
  color: var(--primary) !important;
}
html[data-theme="dark"] .link:hover {
  color: var(--primary-fg) !important;
  border-bottom-color: var(--primary-fg) !important;
}
html[data-theme="dark"] .page-head {
  border-bottom-color: var(--line-2) !important;
}
html[data-theme="dark"] .back-link {
  color: var(--muted) !important;
}
html[data-theme="dark"] .back-link:hover {
  color: var(--fg) !important;
}
html[data-theme="dark"] .divider,
html[data-theme="dark"] .vrule,
html[data-theme="dark"] .split-line::before,
html[data-theme="dark"] .split-line::after {
  background: var(--line) !important;
}
html[data-theme="dark"] .split-line,
html[data-theme="dark"] .foot,
html[data-theme="dark"] .ratio {
  color: var(--muted) !important;
}

/* ==========================================================================
 * 5. 卡片 / 统计 / 指标 / 面板
 * ========================================================================== */
html[data-theme="dark"] .card,
html[data-theme="dark"] .card--pad,
html[data-theme="dark"] .card--flat,
html[data-theme="dark"] .stat-band,
html[data-theme="dark"] .lib-card,
html[data-theme="dark"] .pcard,
html[data-theme="dark"] .akpi,
html[data-theme="dark"] .acard,
html[data-theme="dark"] .fcard,
html[data-theme="dark"] .tpl-card,
html[data-theme="dark"] .asset-hero,
html[data-theme="dark"] .article,
html[data-theme="dark"] .ed-frame,
html[data-theme="dark"] .pv-shell,
html[data-theme="dark"] .file-shell,
html[data-theme="dark"] .comments,
html[data-theme="dark"] .wizard-shell,
html[data-theme="dark"] .radio-card,
html[data-theme="dark"] .upload-drop,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .search-hero .big-input,
html[data-theme="dark"] .qr-box {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--fg) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .pcard:hover,
html[data-theme="dark"] .lib-card:hover,
html[data-theme="dark"] .acard:hover,
html[data-theme="dark"] .fcard:hover,
html[data-theme="dark"] .tpl-card:hover {
  border-color: var(--line-2) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .card-head {
  background: var(--card) !important;
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .card-foot,
html[data-theme="dark"] .tbl-foot {
  background: var(--card) !important;
  border-top-color: var(--line) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .card-body {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .panel {
  background: var(--card-2) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .metric .val {
  color: var(--fg) !important;
}
html[data-theme="dark"] .metric .lab,
html[data-theme="dark"] .metric .note {
  color: var(--muted) !important;
}
html[data-theme="dark"] .metrics {
  background: transparent !important;
  border: 0 !important;
}

html[data-theme="dark"] .stat {
  border-right-color: var(--line) !important;
}
html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .stat-meta,
html[data-theme="dark"] .stat-value small {
  color: var(--muted) !important;
}
html[data-theme="dark"] .stat-value {
  color: var(--fg) !important;
}

/* 进度条 / 环 / 热力 */
html[data-theme="dark"] .bar {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .bar-fill,
html[data-theme="dark"] .bar-fill--sakura,
html[data-theme="dark"] .bar-fill--matcha,
html[data-theme="dark"] .bar-fill--clay,
html[data-theme="dark"] .bar-fill--fog,
html[data-theme="dark"] .bar-fill--grad {
  background: var(--primary) !important;
}
html[data-theme="dark"] .ring circle:first-of-type {
  stroke: rgba(255, 255, 255, .12) !important;
}
html[data-theme="dark"] .ring circle:last-of-type {
  stroke: var(--primary) !important;
}
html[data-theme="dark"] .ring-label b,
html[data-theme="dark"] .ring-label span {
  color: var(--fg) !important;
}
html[data-theme="dark"] .ring-label em {
  color: var(--muted) !important;
}
html[data-theme="dark"] .h0 {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .h1 {
  background: #2C3442 !important;
}
html[data-theme="dark"] .h2 {
  background: #3C4A63 !important;
}
html[data-theme="dark"] .h3 {
  background: #5A739B !important;
}
html[data-theme="dark"] .h4 {
  background: var(--primary) !important;
}
html[data-theme="dark"] .health-dots i {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .health-dots i.on {
  background: var(--primary) !important;
}
html[data-theme="dark"] .health-dots i.warn {
  background: var(--warn) !important;
}

/* ==========================================================================
 * 6. Hero（千帆式浅蓝渐变 + 点阵，深色下改为深蓝渐变 + 低亮网点）
 * ========================================================================== */
html[data-theme="dark"] .q-hero {
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .07) 1px, transparent 0) 0 0 / 18px 18px,
    linear-gradient(180deg, #1C2129 0%, #171B22 100%) !important;
  border-color: var(--line) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .30) !important;
}
html[data-theme="dark"] .q-hero h2 {
  color: var(--fg) !important;
}
html[data-theme="dark"] .q-hero p {
  color: var(--muted) !important;
}
html[data-theme="dark"] .q-search {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .q-search:focus-within {
  border-color: var(--primary) !important;
}
html[data-theme="dark"] .q-search input {
  background: transparent !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .q-search input::placeholder {
  color: var(--muted) !important;
}
html[data-theme="dark"] .q-search .q-btn,
html[data-theme="dark"] .q-btn {
  background: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .q-search .q-btn:hover {
  background: #3C7EF0 !important;
}
html[data-theme="dark"] .q-chips button {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .q-chips button:hover {
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
  color: var(--primary-fg) !important;
}

/* ==========================================================================
 * 7. 表格 / 权限矩阵
 * ========================================================================== */
html[data-theme="dark"] table th,
html[data-theme="dark"] .tbl th,
html[data-theme="dark"] .matrix th,
html[data-theme="dark"] .art-table th {
  background: var(--card-2) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] table td,
html[data-theme="dark"] .tbl td,
html[data-theme="dark"] .matrix td,
html[data-theme="dark"] .art-table td {
  border-color: var(--line) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .tbl td:first-child,
html[data-theme="dark"] .matrix td:first-child {
  color: var(--fg) !important;
}
html[data-theme="dark"] .tbl th {
  border-bottom-color: var(--line-2) !important;
}
html[data-theme="dark"] .tbl .cell-title,
html[data-theme="dark"] .tbl td strong,
html[data-theme="dark"] .matrix td:first-child {
  color: var(--fg) !important;
}
html[data-theme="dark"] .tbl .cell-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .tbl tbody tr:hover,
html[data-theme="dark"] .tbl tbody tr:hover td,
html[data-theme="dark"] .matrix tbody tr:hover td,
html[data-theme="dark"] .article tr:hover td {
  background: rgba(255, 255, 255, .045) !important;
}
html[data-theme="dark"] .tbl tbody tr.is-selected,
html[data-theme="dark"] .tbl tbody tr.is-selected td {
  background: var(--primary-soft) !important;
}
html[data-theme="dark"] .matrix .mgroup td {
  background: var(--card-2) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .matrix .mcheck {
  background: var(--card) !important;
  border-color: var(--line-2) !important;
  color: transparent !important;
}
html[data-theme="dark"] .matrix .mcheck:hover {
  border-color: var(--primary) !important;
}
html[data-theme="dark"] .matrix .mcheck.is-on {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .matrix .mcheck.is-part {
  background: linear-gradient(135deg, var(--primary-fg) 0 50%, var(--card) 50% 100%) !important;
  border-color: var(--primary-fg) !important;
}
html[data-theme="dark"] .pager button {
  background: transparent !important;
  border-color: var(--line) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .pager button:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
html[data-theme="dark"] .pager button.is-active {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
  color: #FFFFFF !important;
}

/* ==========================================================================
 * 8. 表单控件（输入框必须可见，不能是纯黑块）
 * ========================================================================== */
html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] .textarea,
html[data-theme="dark"] .input--sm,
html[data-theme="dark"] .palette-input-row input,
html[data-theme="dark"] .search-hero .big-input input {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .input::placeholder,
html[data-theme="dark"] .textarea::placeholder,
html[data-theme="dark"] .input::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--muted) !important;
}
html[data-theme="dark"] .input:hover,
html[data-theme="dark"] .select:hover,
html[data-theme="dark"] .textarea:hover {
  border-color: #4A5464 !important;
}
html[data-theme="dark"] .input:focus,
html[data-theme="dark"] .select:focus,
html[data-theme="dark"] .textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(76, 141, 255, .22) !important;
  outline: none !important;
}
html[data-theme="dark"] select,
html[data-theme="dark"] option {
  background: var(--card-2) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .field > label,
html[data-theme="dark"] .field-label,
html[data-theme="dark"] .field-hint,
html[data-theme="dark"] .checkbox,
html[data-theme="dark"] .switch {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .checkbox .box {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
}
html[data-theme="dark"] .checkbox input:checked + .box {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .switch .track {
  background: var(--line-2) !important;
}
html[data-theme="dark"] .switch .track::after {
  background: var(--fg) !important;
  border-color: var(--line-2) !important;
}
html[data-theme="dark"] .switch input:checked + .track {
  background: var(--primary-strong) !important;
}
html[data-theme="dark"] .radio-card.is-on {
  border-color: var(--primary) !important;
  outline-color: var(--primary) !important;
}
html[data-theme="dark"] .radio-card .rc-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .radio-card .rc-desc {
  color: var(--muted) !important;
}
html[data-theme="dark"] .radio-card.is-on .rc-check {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .search-hero .big-input {
  border-color: var(--line-2) !important;
}

/* ==========================================================================
 * 9. 按钮 / 胶囊 / 分段 / 页签 / 徽标
 * ========================================================================== */
html[data-theme="dark"] .btn {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .btn:hover {
  background: #242A34 !important;
  border-color: #4A5464 !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .btn--primary {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .btn--primary:hover {
  background: #3C7EF0 !important;
  border-color: #3C7EF0 !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .btn--soft {
  background: rgba(255, 255, 255, .08) !important;
  border-color: transparent !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .btn--soft:hover {
  background: rgba(255, 255, 255, .12) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .btn--ghost {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .btn--ghost:hover {
  background: rgba(255, 255, 255, .08) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .btn--danger {
  background: transparent !important;
  border-color: rgba(255, 122, 122, .55) !important;
  color: var(--danger) !important;
}
html[data-theme="dark"] .btn--danger:hover {
  border-color: var(--danger) !important;
}

html[data-theme="dark"] .chip {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .chip:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
html[data-theme="dark"] .chip.is-active {
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
  color: var(--primary-fg) !important;
}
html[data-theme="dark"] .seg {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .seg-btn {
  background: transparent !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .seg-btn:hover {
  color: var(--fg) !important;
}
html[data-theme="dark"] .seg-btn.is-active {
  background: rgba(255, 255, 255, .12) !important;
  color: var(--fg) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .tabs {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .tab {
  color: var(--muted) !important;
}
html[data-theme="dark"] .tab:hover {
  color: var(--fg) !important;
}
html[data-theme="dark"] .tab.is-active {
  color: var(--fg) !important;
}
html[data-theme="dark"] .tab.is-active::after {
  background: var(--primary) !important;
}
html[data-theme="dark"] .tab .cnt {
  background: rgba(255, 255, 255, .08) !important;
  color: var(--fg-2) !important;
}

html[data-theme="dark"] .badge,
html[data-theme="dark"] .status-tag,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .pill {
  background: rgba(255, 255, 255, .08) !important;
  border-color: var(--line) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .tag--ink,
html[data-theme="dark"] .tag--matcha,
html[data-theme="dark"] .pill--matcha {
  background: rgba(76, 141, 255, .18) !important;
  border-color: rgba(76, 141, 255, .50) !important;
  color: var(--primary-fg) !important;
}
html[data-theme="dark"] .tag--sakura,
html[data-theme="dark"] .pill--sakura {
  background: rgba(76, 141, 255, .12) !important;
  border-color: rgba(76, 141, 255, .36) !important;
  color: var(--primary-fg) !important;
}
html[data-theme="dark"] .tag--clay,
html[data-theme="dark"] .pill--clay {
  background: rgba(255, 180, 84, .14) !important;
  border-color: rgba(255, 180, 84, .44) !important;
  color: #FFC98A !important;
}
html[data-theme="dark"] .tag--fog,
html[data-theme="dark"] .tag--line {
  background: transparent !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .dot--sakura,
html[data-theme="dark"] .dot--primary {
  background: var(--primary) !important;
}
html[data-theme="dark"] .dot--matcha,
html[data-theme="dark"] .dot--success {
  background: var(--ok) !important;
}
html[data-theme="dark"] .dot--clay,
html[data-theme="dark"] .dot--warning {
  background: var(--warn) !important;
}
html[data-theme="dark"] .dot--fog,
html[data-theme="dark"] .dot--ink {
  background: var(--muted) !important;
}
html[data-theme="dark"] .overdue,
html[data-theme="dark"] .text-danger {
  color: var(--danger) !important;
}
html[data-theme="dark"] .trend--up {
  color: var(--ok) !important;
}
html[data-theme="dark"] .trend--down {
  color: var(--fg-2) !important;
}

/* 头像：inline 用 rgba(10,10,10,.065) + #0A0A0A 字，深色下必须反色 */
html[data-theme="dark"] .av {
  background: var(--card-2) !important;
  color: var(--fg) !important;
  border-color: var(--line-2) !important;
}
html[data-theme="dark"] .avatar-stack .av {
  border-color: var(--card) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) !important;
}
html[data-theme="dark"] .li-check {
  background: transparent !important;
  border-color: var(--line-2) !important;
  color: transparent !important;
}
html[data-theme="dark"] .li-check:hover {
  border-color: var(--primary) !important;
}
html[data-theme="dark"] .li-check.is-done {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
  color: #FFFFFF !important;
}

/* ==========================================================================
 * 10. 列表 / 时间线 / 日历
 * ========================================================================== */
html[data-theme="dark"] .li {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .li-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .li-sub,
html[data-theme="dark"] .li-side .dim,
html[data-theme="dark"] .li.is-done .li-title {
  color: var(--muted) !important;
}
html[data-theme="dark"] .li--click:hover,
html[data-theme="dark"] .list--hover .li:hover {
  background: rgba(255, 255, 255, .05) !important;
}
html[data-theme="dark"] .timeline::before {
  background: var(--line) !important;
}
html[data-theme="dark"] .tl-dot {
  background: var(--card) !important;
  border-color: var(--line-2) !important;
}
html[data-theme="dark"] .tl-dot--sakura,
html[data-theme="dark"] .tl-dot--matcha,
html[data-theme="dark"] .tl-dot--clay {
  border-color: var(--primary) !important;
}
html[data-theme="dark"] .tl-body {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .tl-body b {
  color: var(--fg) !important;
}
html[data-theme="dark"] .tl-time {
  color: var(--muted) !important;
}
html[data-theme="dark"] .cycle-row {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .cycle-ini {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .cal {
  border-left-color: var(--line) !important;
  border-top-color: var(--line) !important;
}
html[data-theme="dark"] .cal-dow {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .cal-cell {
  background: var(--card) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .cal-cell:hover {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .cal-cell.is-mute {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .cal-cell.is-today {
  background: var(--card) !important;
  outline-color: var(--primary) !important;
}
html[data-theme="dark"] .cal-cell.is-today .cal-num {
  background: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .cal-num {
  color: var(--muted) !important;
}
html[data-theme="dark"] .cal-ev {
  background: var(--card-2) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .cal-ev::before,
html[data-theme="dark"] .cal-ev--sakura::before,
html[data-theme="dark"] .cal-ev--matcha::before,
html[data-theme="dark"] .cal-ev--clay::before {
  background: var(--primary) !important;
}
html[data-theme="dark"] .mm-dot {
  background: var(--muted) !important;
}
html[data-theme="dark"] .mm-dot--sakura,
html[data-theme="dark"] .mm-dot--matcha,
html[data-theme="dark"] .mm-dot--clay,
html[data-theme="dark"] .mm-dot--fog {
  background: var(--primary) !important;
}
html[data-theme="dark"] .ag-row {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .ag-date b {
  color: var(--fg) !important;
}
html[data-theme="dark"] .ag-date span,
html[data-theme="dark"] .ag-ev,
html[data-theme="dark"] .week-nav {
  color: var(--fg-2) !important;
}

/* ==========================================================================
 * 11. 看板
 * ========================================================================== */
html[data-theme="dark"] .kcol {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  border-top-color: var(--line-2) !important;
}
html[data-theme="dark"] .kcol.is-over {
  background: var(--primary-soft) !important;
  border-color: var(--primary) !important;
  border-top-color: var(--primary) !important;
}
html[data-theme="dark"] .kcol-head {
  background: transparent !important;
  border-bottom-color: var(--line) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .kcol-count {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .tcard {
  background: var(--card) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .tcard:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4) !important;
}
html[data-theme="dark"] .tcard-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .tcard-meta,
html[data-theme="dark"] .tcard-foot {
  color: var(--muted) !important;
}
html[data-theme="dark"] .tcard-foot {
  border-top-color: var(--line) !important;
}
html[data-theme="dark"] .kanban-empty {
  border-color: var(--line) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .kcol-ready {
  outline-color: var(--line) !important;
}

/* ==========================================================================
 * 12. 甘特
 * ========================================================================== */
html[data-theme="dark"] .gantt {
  border-top-color: var(--line) !important;
}
html[data-theme="dark"] .gantt-left {
  border-right-color: var(--line) !important;
}
html[data-theme="dark"] .gantt-head,
html[data-theme="dark"] .gantt-scale {
  background: var(--card) !important;
  border-bottom-color: var(--line-2) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .g-week,
html[data-theme="dark"] .g-day {
  color: var(--muted) !important;
  border-left-color: var(--line) !important;
}
html[data-theme="dark"] .g-week b {
  color: var(--fg) !important;
}
html[data-theme="dark"] .g-row,
html[data-theme="dark"] .g-track,
html[data-theme="dark"] .g-task {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .g-task:hover {
  background: rgba(255, 255, 255, .04) !important;
}
html[data-theme="dark"] .g-task-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .g-task-code,
html[data-theme="dark"] .g-task .dim {
  color: var(--muted) !important;
}
html[data-theme="dark"] .g-weekend-bg {
  background: rgba(255, 255, 255, .035) !important;
}
html[data-theme="dark"] .g-bg {
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px) !important;
}
html[data-theme="dark"] .g-today {
  background: var(--primary) !important;
  background-image: linear-gradient(to bottom, var(--primary) 50%, transparent 50%) !important;
}
html[data-theme="dark"] .gbar {
  background: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .gbar--doing {
  background: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .gbar--done {
  background: #3A4250 !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .gbar--review {
  background: #4A5A78 !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .gbar--todo {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .gbar--overdue {
  background: var(--card-2) !important;
  border-color: var(--warn) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .gbar--overdue::before {
  border-right-color: var(--warn) !important;
}
html[data-theme="dark"] .g-progress {
  background: rgba(255, 255, 255, .28) !important;
}
html[data-theme="dark"] .gmile {
  background: var(--card) !important;
  border-color: var(--primary) !important;
}
html[data-theme="dark"] .gmile.is-done {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
}
html[data-theme="dark"] .g-tip {
  background: #2B3140 !important;
  color: var(--fg) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5) !important;
}
html[data-theme="dark"] .cap-cell {
  background: var(--card-2) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .cap-cell.l1 {
  background: #2C3442 !important;
}
html[data-theme="dark"] .cap-cell.l2 {
  background: #3C4A63 !important;
}
html[data-theme="dark"] .cap-cell.l3 {
  background: #5A739B !important;
  color: #F0F4FA !important;
}
html[data-theme="dark"] .cap-cell.l4 {
  background: var(--primary) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .cap-grid {
  color: var(--muted) !important;
}

/* ==========================================================================
 * 13. 文件 / 预览 / 知识 / 编辑器
 * ========================================================================== */
html[data-theme="dark"] .tree {
  background: var(--card-2) !important;
  border-right-color: var(--line) !important;
}
html[data-theme="dark"] .tree-label {
  color: var(--muted) !important;
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .tree-node {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .tree-node:hover {
  background: rgba(255, 255, 255, .07) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .tree-node.is-active {
  background: var(--card) !important;
  color: var(--fg) !important;
  box-shadow: inset 2px 0 0 var(--primary) !important;
}
html[data-theme="dark"] .tree-node .tree-count {
  color: var(--muted) !important;
}
html[data-theme="dark"] .file-bar {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .file-crumb {
  color: var(--muted) !important;
}
html[data-theme="dark"] .file-crumb b {
  color: var(--fg) !important;
}
html[data-theme="dark"] .fcard.is-selected {
  border-color: var(--primary) !important;
  outline-color: var(--primary) !important;
}
html[data-theme="dark"] .fthumb,
html[data-theme="dark"] .asset-hero-art,
html[data-theme="dark"] .acover,
html[data-theme="dark"] .tpl-preview,
html[data-theme="dark"] .pv-stage--light {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .ftype {
  background: var(--card-2) !important;
  color: var(--fg-2) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .fstar {
  background: var(--card-2) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .fstar.is-on {
  color: var(--primary) !important;
}
html[data-theme="dark"] .fmeta {
  border-top-color: var(--line) !important;
}
html[data-theme="dark"] .fname {
  color: var(--fg) !important;
}
html[data-theme="dark"] .fsub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .upload-drop:hover {
  border-color: var(--primary) !important;
  background: var(--card-2) !important;
}
html[data-theme="dark"] .upload-drop .ud-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .upload-drop .ud-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .up-item {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .up-bar {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .up-bar i {
  background: var(--primary) !important;
}
html[data-theme="dark"] .pv-info,
html[data-theme="dark"] .pv-info-head {
  border-color: var(--line) !important;
}
html[data-theme="dark"] .meta-row dt {
  color: var(--muted) !important;
}
html[data-theme="dark"] .meta-row dd {
  color: var(--fg) !important;
}
html[data-theme="dark"] .pv-doc {
  background: var(--card) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .lib-card .lib-ico {
  background: var(--card-2) !important;
  color: var(--fg) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .lib-card.is-active {
  border-color: var(--primary) !important;
  outline-color: var(--primary) !important;
}
html[data-theme="dark"] .lib-card .lib-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .asset-hero-desc {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .atitle {
  color: var(--fg) !important;
}
html[data-theme="dark"] .asum,
html[data-theme="dark"] .afoot,
html[data-theme="dark"] .rank-no {
  color: var(--muted) !important;
}
html[data-theme="dark"] .afoot {
  border-top-color: var(--line) !important;
}
html[data-theme="dark"] .article h1,
html[data-theme="dark"] .article h2,
html[data-theme="dark"] .article h3,
html[data-theme="dark"] .ed-paper h1,
html[data-theme="dark"] .ed-paper h2 {
  color: var(--fg) !important;
}
html[data-theme="dark"] .article h2,
html[data-theme="dark"] .ed-paper h2 {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .article p,
html[data-theme="dark"] .article li,
html[data-theme="dark"] .ed-paper p,
html[data-theme="dark"] .article .art-lead {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .article li::before {
  background: var(--primary) !important;
}
html[data-theme="dark"] .article blockquote,
html[data-theme="dark"] .ed-paper blockquote {
  background: var(--card-2) !important;
  border-left-color: var(--primary) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .article code {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .article .art-meta {
  border-bottom-color: var(--line) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .toc a {
  color: var(--muted) !important;
  border-left-color: var(--line) !important;
}
html[data-theme="dark"] .toc a:hover,
html[data-theme="dark"] .toc a.is-on {
  color: var(--fg) !important;
  border-left-color: var(--primary) !important;
}
html[data-theme="dark"] mark,
html[data-theme="dark"] .res-title mark,
html[data-theme="dark"] .article mark {
  background: rgba(76, 141, 255, .26) !important;
  color: var(--fg) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .ed-toolbar {
  background: var(--card) !important;
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .ed-tool {
  color: var(--muted) !important;
}
html[data-theme="dark"] .ed-tool:hover {
  background: var(--card-2) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .ed-tool.is-on {
  background: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .ed-tool-sep {
  background: var(--line) !important;
}
html[data-theme="dark"] .ed-paper {
  background: var(--card) !important;
}
html[data-theme="dark"] .ed-presence,
html[data-theme="dark"] .comment-head {
  color: var(--muted) !important;
}
html[data-theme="dark"] .comment-head b {
  color: var(--fg) !important;
}
html[data-theme="dark"] .comment {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .comment-body {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .comment-input {
  background: var(--card) !important;
  border-top-color: var(--line) !important;
}
html[data-theme="dark"] .ed-cursor {
  background: var(--primary) !important;
  color: var(--primary) !important;
}
html[data-theme="dark"] .presence-dot {
  background: var(--primary) !important;
}

/* ==========================================================================
 * 14. 搜索 / 通知
 * ========================================================================== */
html[data-theme="dark"] .search-hero {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .res-item {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .res-item:hover {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .res-ico {
  background: var(--card-2) !important;
  color: var(--fg-2) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .res-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .res-sub,
html[data-theme="dark"] .res-side,
html[data-theme="dark"] .kbd-row {
  color: var(--muted) !important;
}
html[data-theme="dark"] .notif {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .notif.is-unread {
  background: rgba(76, 141, 255, .08) !important;
}
html[data-theme="dark"] .notif-ico {
  background: var(--card-2) !important;
  color: var(--fg) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .notif-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .notif-sub,
html[data-theme="dark"] .notif-time {
  color: var(--muted) !important;
}

/* ==========================================================================
 * 15. 设置 / 登录 / 管理端
 * ========================================================================== */
html[data-theme="dark"] .settings-nav .sn-item {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .settings-nav .sn-item:hover {
  background: rgba(255, 255, 255, .07) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .settings-nav .sn-item.is-active {
  background: var(--primary-soft) !important;
  color: var(--primary-fg) !important;
}
html[data-theme="dark"] .set-row {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .set-row-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .set-row-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .login-wrap,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .login-art {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .login-panel {
  border-left-color: var(--line) !important;
}
html[data-theme="dark"] .login-panel h2,
html[data-theme="dark"] .login-art .la-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .login-panel .lp-sub,
html[data-theme="dark"] .login-art .la-poem,
html[data-theme="dark"] .login-note,
html[data-theme="dark"] .login-art .la-foot,
html[data-theme="dark"] .login-art .la-en {
  color: var(--muted) !important;
}
html[data-theme="dark"] .login-tabs {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .login-tabs button {
  color: var(--muted) !important;
}
html[data-theme="dark"] .login-tabs button.is-active {
  color: var(--fg) !important;
}
html[data-theme="dark"] .login-tabs button.is-active::after {
  background: var(--primary) !important;
}
html[data-theme="dark"] .login-divider {
  color: var(--muted) !important;
}
html[data-theme="dark"] .login-divider::before,
html[data-theme="dark"] .login-divider::after {
  background: var(--line) !important;
}
html[data-theme="dark"] .login-art .la-seal {
  background: var(--card) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .qr-box {
  border-color: var(--line-2) !important;
}
html[data-theme="dark"] .login-note a {
  color: var(--primary) !important;
  border-bottom-color: var(--line-2) !important;
}

html[data-theme="dark"] .akpi-label,
html[data-theme="dark"] .akpi-sub,
html[data-theme="dark"] .akpi-value small {
  color: var(--muted) !important;
}
html[data-theme="dark"] .akpi-value {
  color: var(--fg) !important;
}
html[data-theme="dark"] .gt-dept {
  color: var(--fg) !important;
}
html[data-theme="dark"] .gt-dept:hover,
html[data-theme="dark"] .gt-group:hover {
  background: rgba(255, 255, 255, .07) !important;
}
html[data-theme="dark"] .gt-group {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .gt-group.is-active {
  background: var(--primary-soft) !important;
  color: var(--primary-fg) !important;
}
html[data-theme="dark"] .gt-group.is-active::before {
  background: var(--primary) !important;
}
html[data-theme="dark"] .gt-count {
  color: var(--muted) !important;
}
html[data-theme="dark"] .audit-filters {
  background: var(--card) !important;
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .quota-bar,
html[data-theme="dark"] .sb-track,
html[data-theme="dark"] .meter-track,
html[data-theme="dark"] .up-bar,
html[data-theme="dark"] .wp-track {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .quota-bar i,
html[data-theme="dark"] .sb-track i,
html[data-theme="dark"] .meter-track i,
html[data-theme="dark"] .wp-track i {
  background: var(--primary) !important;
}
html[data-theme="dark"] .sb-label,
html[data-theme="dark"] .sb-val,
html[data-theme="dark"] .meter-label {
  color: var(--muted) !important;
}
html[data-theme="dark"] .tpl-col {
  background: var(--card-2) !important;
}
html[data-theme="dark"] .tpl-line {
  background: var(--line) !important;
}
html[data-theme="dark"] .tpl-line:nth-child(1) {
  background: var(--line-2) !important;
}
html[data-theme="dark"] .rule-row,
html[data-theme="dark"] .setting-section {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .channel {
  border-color: var(--line) !important;
  background: var(--card) !important;
}
html[data-theme="dark"] .channel.is-on {
  border-color: var(--primary) !important;
  outline-color: var(--primary) !important;
}
html[data-theme="dark"] .step::before {
  background: var(--line) !important;
}
html[data-theme="dark"] .step-no {
  background: var(--card) !important;
  border-color: var(--line-2) !important;
  color: var(--muted) !important;
}
html[data-theme="dark"] .step.is-on .step-no {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .step.is-done .step-no {
  background: var(--card) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
html[data-theme="dark"] .step-title,
html[data-theme="dark"] .step-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .step.is-on .step-title,
html[data-theme="dark"] .step.is-done .step-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .wizard-rail {
  background: var(--card-2) !important;
  border-right-color: var(--line) !important;
}
html[data-theme="dark"] .wizard-body {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .wizard-foot {
  border-top-color: var(--line) !important;
}
html[data-theme="dark"] .wizard-progress {
  color: var(--muted) !important;
}
html[data-theme="dark"] .tip {
  background: var(--card-2) !important;
  border-left-color: var(--primary) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .tip--sakura,
html[data-theme="dark"] .tip--clay {
  border-left-color: var(--primary) !important;
}
html[data-theme="dark"] .split-line {
  color: var(--muted) !important;
}

/* ==========================================================================
 * 16. 覆盖层：遮罩 / 弹窗 / 抽屉 / 命令面板 / 灯箱 / Toast
 * ========================================================================== */
html[data-theme="dark"] .overlay--dim,
html[data-theme="dark"] .drawer-wrap,
html[data-theme="dark"] .palette-wrap {
  background: rgba(3, 5, 9, .64) !important;
}
html[data-theme="dark"] .overlay--dark {
  background: rgba(3, 5, 9, .95) !important;
}
html[data-theme="dark"] .modal,
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .palette {
  background: var(--card) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .60) !important;
}
html[data-theme="dark"] .modal-head,
html[data-theme="dark"] .modal-foot,
html[data-theme="dark"] .drawer-head,
html[data-theme="dark"] .drawer-foot,
html[data-theme="dark"] .palette-input-row,
html[data-theme="dark"] .palette-foot {
  background: var(--card) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .modal-sub,
html[data-theme="dark"] .drawer-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .modal-close {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .p-item {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .p-item:hover,
html[data-theme="dark"] .p-item.is-on {
  background: rgba(255, 255, 255, .08) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .p-group {
  color: var(--muted) !important;
}
html[data-theme="dark"] .p-item .pi-key,
html[data-theme="dark"] .palette-foot {
  color: var(--muted) !important;
}
html[data-theme="dark"] .lightbox {
  background: rgba(3, 5, 9, .95) !important;
}
html[data-theme="dark"] .toast {
  background: #2B3140 !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .50) !important;
}
html[data-theme="dark"] .toast .toast-ico {
  color: var(--ok) !important;
}
html[data-theme="dark"] .empty .em-ico {
  background: var(--card-2) !important;
  border-color: var(--line) !important;
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .empty .em-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .empty .em-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .hero-wash::after {
  display: none !important;
}

/* ==========================================================================
 * 17. live.js 登录浮层（.sz-*）与 live-more / live-pro 弹层（.szm / .qpm）
 * ========================================================================== */
html[data-theme="dark"] .sz-mask {
  background: var(--bg) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .sz-card {
  background: var(--card) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .sz-brand,
html[data-theme="dark"] .sz-card h1 {
  color: var(--fg) !important;
}
html[data-theme="dark"] .sz-brand span,
html[data-theme="dark"] .sz-sub,
html[data-theme="dark"] .sz-label,
html[data-theme="dark"] .sz-hint,
html[data-theme="dark"] .sz-msg {
  color: var(--muted) !important;
}
html[data-theme="dark"] .sz-input {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .sz-input:focus {
  border-color: var(--primary) !important;
}
html[data-theme="dark"] .sz-btn {
  background: var(--primary-strong) !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .szm,
html[data-theme="dark"] .qpm {
  color: var(--fg) !important;
  background: rgba(3, 5, 9, .62) !important;
}
html[data-theme="dark"] .szm-card,
html[data-theme="dark"] .qpm-card {
  background: var(--card) !important;
  color: var(--fg) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .60) !important;
}
html[data-theme="dark"] .szm-card h3,
html[data-theme="dark"] .qpm-card h3 {
  color: var(--fg) !important;
}
html[data-theme="dark"] .szm-card .szm-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .szm label,
html[data-theme="dark"] .qpm label {
  color: var(--fg-2) !important;
}
html[data-theme="dark"] .szm input,
html[data-theme="dark"] .szm select,
html[data-theme="dark"] .szm textarea,
html[data-theme="dark"] .qpm input,
html[data-theme="dark"] .qpm select,
html[data-theme="dark"] .qpm textarea {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .szm input:focus,
html[data-theme="dark"] .szm select:focus,
html[data-theme="dark"] .qpm input:focus,
html[data-theme="dark"] .qpm select:focus,
html[data-theme="dark"] .qpm textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(76, 141, 255, .22) !important;
}
html[data-theme="dark"] .szm-btn,
html[data-theme="dark"] .qpm-btn {
  background: var(--card-2) !important;
  border-color: var(--line-2) !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .szm-btn--p,
html[data-theme="dark"] .qpm-btn--p {
  background: var(--primary-strong) !important;
  border-color: var(--primary-strong) !important;
  color: #FFFFFF !important;
}
html[data-theme="dark"] .szm-tone button {
  border-color: var(--line-2);
}
html[data-theme="dark"] .szm-tone button.on {
  border-color: #FFFFFF;
}
/* 资产库卡片（live-pro.js 注入） */
html[data-theme="dark"] .q-pro-lib {
  background: var(--card) !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] .q-pro-lib:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4) !important;
}
html[data-theme="dark"] .q-pro-lib.on {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
}
html[data-theme="dark"] .q-pro-lib .k {
  color: var(--muted) !important;
}
html[data-theme="dark"] .q-res-item {
  border-bottom-color: var(--line) !important;
}
html[data-theme="dark"] .q-res-item:hover {
  background: rgba(255, 255, 255, .05) !important;
}
html[data-theme="dark"] .q-res-title {
  color: var(--fg) !important;
}
html[data-theme="dark"] .q-res-sub {
  color: var(--muted) !important;
}
html[data-theme="dark"] .q-res-type {
  background: var(--primary-soft) !important;
  border-color: rgba(76, 141, 255, .50) !important;
  color: var(--primary-fg) !important;
}

/* ==========================================================================
 * 18. 兜底：JS 模板里的 inline 浅色（inline 无 !important，可被本层覆盖）
 * ========================================================================== */
html[data-theme="dark"] [style*="color:#1D2129"],
html[data-theme="dark"] [style*="color: #1D2129"],
html[data-theme="dark"] [style*="color:#0A0A0A"],
html[data-theme="dark"] [style*="color: #0A0A0A"] {
  color: var(--fg) !important;
}
html[data-theme="dark"] [style*="color:#4E5969"],
html[data-theme="dark"] [style*="color: #4E5969"],
html[data-theme="dark"] [style*="color:#6B6B6B"],
html[data-theme="dark"] [style*="color: #6B6B6B"],
html[data-theme="dark"] [style*="color:#9B9B9B"],
html[data-theme="dark"] [style*="color: #9B9B9B"],
html[data-theme="dark"] [style*="color:#86909C"],
html[data-theme="dark"] [style*="color: #86909C"],
html[data-theme="dark"] [style*="color:#5B6472"],
html[data-theme="dark"] [style*="color: #5B6472"],
html[data-theme="dark"] [style*="color:#C9CDD4"] {
  color: var(--muted) !important;
}
html[data-theme="dark"] [style*="color:#1746B0"] {
  color: var(--primary-fg) !important;
}
html[data-theme="dark"] [style*="color:#2468F2"] {
  color: var(--primary) !important;
}
html[data-theme="dark"] [style*="background:#F2F3F5"],
html[data-theme="dark"] [style*="background: #F2F3F5"],
html[data-theme="dark"] [style*="background:#F7F8FA"],
html[data-theme="dark"] [style*="background:#F7F9FF"],
html[data-theme="dark"] [style*="background:#F2F7FF"],
html[data-theme="dark"] [style*="background:#E8F0FF"],
html[data-theme="dark"] [style*="background: #E8F0FF"],
html[data-theme="dark"] [style*="background:#FFFFFF"],
html[data-theme="dark"] [style*="background:#FFF"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"] {
  background: var(--card-2) !important;
}
html[data-theme="dark"] [style*="background:rgba(10,10,10,.065)"],
html[data-theme="dark"] [style*="background:rgba(10,10,10,.06)"],
html[data-theme="dark"] [style*="background:rgba(10,10,10,.07)"],
html[data-theme="dark"] [style*="background:rgba(10,10,10,.08)"],
html[data-theme="dark"] [style*="background:rgba(10,10,10,.09)"] {
  background: rgba(255, 255, 255, .08) !important;
}
html[data-theme="dark"] [style*="border-bottom:1px solid #F2F3F5"],
html[data-theme="dark"] [style*="border-bottom:1px solid #E8E8E8"],
html[data-theme="dark"] [style*="border:1px solid #E5E6EB"],
html[data-theme="dark"] [style*="border:1px solid #E8E8E8"],
html[data-theme="dark"] [style*="border:1px solid #C9CDD4"] {
  border-color: var(--line) !important;
}
html[data-theme="dark"] [style*="border-top:1px solid #F2F3F5"] {
  border-top-color: var(--line) !important;
}

/* 设置页的「浅色/深色」主题预览卡：预览框本身保持浅色，不要被深色层吃掉 */
html[data-theme="dark"] .radio-card[data-theme="light"],
html[data-theme="dark"] .radio-card[data-theme="dark"] {
  background: #FFFFFF !important;
}
html[data-theme="dark"] .radio-card[data-theme="light"] .t12,
html[data-theme="dark"] .radio-card[data-theme="dark"] .t12 {
  color: #0A0A0A !important;
}
html[data-theme="dark"] .radio-card[data-theme] .tag {
  background: #FFFFFF !important;
  border-color: #E8E8E8 !important;
  color: #6B6B6B !important;
}