/* ================================================================
   theme.css — 全站组件深色主题覆盖
   职责：主要组件在深色下的外观覆盖
   ================================================================ */

/* --- 基础覆盖 --- */
.theme-dark body {
  color: var(--text);
}

.theme-dark body:not(.admin-page):not(.agent-page) {
  background: var(--bg);
}

/* --- 顶栏 / 左侧栏 / 底部 dock ---
   注：admin 的 dock-nav-group / dock-module-group 在 PC 端嵌在 .site-dock 玻璃底内，
   必须保持透明以继承外层玻璃；移动端由 dock.css 媒体查询单独给予玻璃背景。 */
.theme-dark .nav,
.theme-dark .site-sidebar,
.theme-dark .site-dock {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.theme-dark .nav {
  border-bottom-color: var(--glass-border);
}

.theme-dark .site-sidebar {
  border-right-color: var(--glass-border);
}

.theme-dark .sb-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.theme-dark .sb-collapse {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
}

.theme-dark .site-dock-item {
  color: var(--muted);
}

.theme-dark .site-dock-item:active,
.theme-dark .site-dock-item:hover {
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand);
}

.theme-dark .sb-modules,
.theme-dark .sb-footer {
  border-top-color: var(--border);
}

/* --- 前台卡片 / 区块 --- */
.theme-dark .card,
.theme-dark .scene,
.theme-dark .footer {
  background: var(--surface);
  border-color: var(--border);
}

.theme-dark .card {
  box-shadow: var(--shadow-sm);
}

.theme-dark .section.soft {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
}

.theme-dark .section.soft::before {
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.25), transparent);
}

.theme-dark .section.soft::after {
  background: linear-gradient(180deg, transparent, var(--bg));
}

.theme-dark .closing-line {
  color: var(--text-2);
}

.theme-dark .eyebrow {
  background: var(--brand-soft);
  border-color: rgba(var(--brand-rgb), 0.2);
  color: var(--brand);
}

.theme-dark .card .ico {
  color: var(--brand);
}

.theme-dark .tag {
  color: var(--brand);
  border-color: rgba(var(--brand-rgb), 0.2);
}

.theme-dark .footer {
  border-top-color: var(--border);
}

.theme-dark .footer .links a:hover {
  color: var(--text);
}

/* --- 对话页玻璃组件 --- */
.theme-dark .top-bar,
.theme-dark .icon-btn,
.theme-dark .now-playing-bar,
.theme-dark .textbox,
.theme-dark .suggestion-chip,
.theme-dark .input-control-bar,
.theme-dark .float-btn,
.theme-dark .voice-dropdown {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.theme-dark .text-content {
  color: var(--text-2);
}

.theme-dark .modal-content,
.theme-dark .modal-body {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.theme-dark .icon-btn:hover,
.theme-dark .float-btn:hover {
  background: var(--surface-2);
}

.theme-dark .suggestion-chip {
  color: var(--text-2);
}

.theme-dark .suggestion-chip:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.theme-dark .voice-dropdown {
  box-shadow: var(--shadow-lg);
}

.theme-dark .voice-option {
  color: var(--text-2);
}

.theme-dark .voice-option:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

/* --- 后台组件 --- */
.theme-dark body.admin-page {
  background: var(--bg);
}

.theme-dark .admin-topbar {
  background: var(--glass-bg);
  border-bottom-color: var(--glass-border);
}

.theme-dark .admin-back,
.theme-dark .admin-close {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}

.theme-dark .admin-section,
.theme-dark .mn-listpanel,
.theme-dark .mn-editpanel,
.theme-dark .upload-card,
.theme-dark .qa-row,
.theme-dark .gateway-card,
.theme-dark .bind-row,
.theme-dark .menu-shared-toolbar,
.theme-dark .mi-preview,
.theme-dark .mi-rte-content,
.theme-dark .rte-toolbar,
.theme-dark .emoji-search input,
.theme-dark .mn-media-bar,
.theme-dark .mn-media-empty,
.theme-dark .mn-list-empty {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.theme-dark .admin-section--note {
  background: var(--brand-soft);
  border-color: rgba(var(--brand-rgb), 0.2);
}

.theme-dark .mn-item {
  background: var(--surface-2);
  border-color: var(--border);
}

.theme-dark .mn-item:hover {
  background: var(--surface);
}

.theme-dark .mn-addrow {
  background: var(--surface-2);
  border-color: var(--border);
}

.theme-dark .seg {
  background: var(--surface-2);
  border-color: var(--border);
}

.theme-dark .field input[type=text],
.theme-dark .field input:not([type]),
.theme-dark .field textarea,
.theme-dark .field select,
.theme-dark .form-group input,
.theme-dark .form-group textarea,
.theme-dark .form-group select,
.theme-dark .qa-row-fields input,
.theme-dark .mn-field input,
.theme-dark .mn-f-subtitle,
.theme-dark .mn-media-url,
.theme-dark .admin-lock-input,
.theme-dark .qa-paste-area,
.theme-dark .rte-source,
.theme-dark .mi-rte-content {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.theme-dark .btn-ghost {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-2);
}

.theme-dark .btn-ghost:hover {
  background: var(--surface);
  border-color: var(--brand);
  color: var(--brand);
}

.theme-dark .qa-paste-card,
.theme-dark .admin-lock-card,
.theme-dark .emoji-popover,
.theme-dark .coltype-popover {
  background: var(--surface);
  border-color: var(--border);
}

.theme-dark .gateway-card.add-card {
  background: var(--surface-2);
}

.theme-dark .admin-gateway {
  background: var(--bg);
}

/* --- 营地页 --- */
.theme-dark .camp-card {
  background: var(--surface);
  border-color: var(--border);
}

.theme-dark .camp-card.add-card {
  background: var(--surface-2);
  border-color: var(--border);
}

.theme-dark .camp-thumb {
  background-color: var(--surface-2);
}

.theme-dark .campsite-head .kicker {
  background: var(--brand-soft);
  border-color: rgba(var(--brand-rgb), 0.2);
  color: var(--brand);
}

/* --- 深色下的输入框焦点 --- */
.theme-dark .field input:focus,
.theme-dark .field textarea:focus,
.theme-dark .field select:focus,
.theme-dark .qa-row-fields input:focus,
.theme-dark .mn-field input:focus,
.theme-dark .mn-f-subtitle:focus,
.theme-dark .mn-media-url:focus,
.theme-dark .admin-lock-input:focus,
.theme-dark .qa-paste-area:focus,
.theme-dark .mi-rte-content:focus,
.theme-dark .compose-bar:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(var(--brand-rgb), 0.2);
}

/* --- 深色下的卡片悬停 --- */
.theme-dark .card:hover,
.theme-dark .scene:hover,
.theme-dark .camp-card:hover,
.theme-dark .gateway-card:hover,
.theme-dark .admin-section:hover {
  border-color: rgba(var(--brand-rgb), 0.3);
  box-shadow: var(--shadow-md);
}

/* --- 深色下的按钮 --- */
.theme-dark .btn-primary {
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.4);
}

.theme-dark .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(var(--brand-rgb), 0.5);
}

.theme-dark .mn-subtab.active,
.theme-dark .dock-modules .admin-nav-item.active,
.theme-dark .admin-dock .admin-nav-item.active,
.theme-dark .site-dock-item.active {
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.4);
}

/* --- 深色下的标签 --- */
.theme-dark .suggestion-chip {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}

.theme-dark .suggestion-chip:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* --- 深色下的分隔线 --- */
.theme-dark .dock-sep {
  background: var(--border);
}

.theme-dark .rte-btn.rte-sep {
  background: var(--border);
}
