/**
 * =========================================================
 * Tutorial Studio
 * Dark Theme
 *
 * 文件：css/main/settings/dark_theme.css
 *
 * 只覆盖编辑器工作区、面板、菜单和弹窗。
 * 画布 iframe 中的作品保持原始设计，不参与反色。
 * =========================================================
 */

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #14161b;
    --panel: #1a1d23;
    --line: #2b303a;
    --text: #e4e7ee;
    --muted: #98a2b3;
    --primary: #8b96ff;
    --soft: #262c3d;
    --danger: #f2778a;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);

    --surface: #1a1d23;
    --surface-2: #20242c;
    --surface-3: #252a33;
    --text-soft: #c5ccd8;
    --faint: #778194;
    --border-soft: #2b303a;
    --accent-soft: #2a3048;

    background: var(--bg);
    color: var(--text);
}

html[data-theme="dark"] body {
    background-color: var(--bg);
    color: var(--text);
}

html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .center-column {
    background-color: var(--bg);
    color: var(--text);
}

html[data-theme="dark"] .icp-footer {
    background-color: #101216;
    color: #6f7989;
}

html[data-theme="dark"] .icp-link {
    color: #8d98aa;
}


/* =========================================================
   01. 顶部栏和菜单
========================================================= */

html[data-theme="dark"] .topbar {
    border-color: var(--line);
    background-color: #191c22;
}

html[data-theme="dark"] .brand {
    color: var(--text);
}

html[data-theme="dark"] .brand-sub {
    color: var(--muted);
}

html[data-theme="dark"] .menu-bar button {
    color: #c6cedb;
}

html[data-theme="dark"] .menu-bar button:hover,
html[data-theme="dark"] .menu-bar button:focus-visible,
html[data-theme="dark"] .menu-bar button.is-open {
    background-color: #262b35;
    color: #ffffff;
}

html[data-theme="dark"] .top-actions .btn.primary {
    border-color: #6d78f0;
    background-color: #5c68e8;
    color: #ffffff;
}

html[data-theme="dark"] .top-actions .btn:not(.primary),
html[data-theme="dark"] .account-login-btn,
html[data-theme="dark"] .topbar-toggle {
    border-color: var(--line);
    background-color: #232730;
    color: #d5dbe6;
}

html[data-theme="dark"] .menu-popover {
    border-color: #343a46;
    background-color: #1e222a;
    color: #e4e7ee;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .menu-popover button {
    color: #d7dde8;
}

html[data-theme="dark"] .menu-popover button:hover {
    background-color: #2a303b;
    color: #ffffff;
}

html[data-theme="dark"] .menu-popover .menu-item-shortcut {
    color: #7f8a9d;
}

html[data-theme="dark"] .menu-popover .menu-separator {
    background-color: #303641;
}

html[data-theme="dark"] .account-dropdown,
html[data-theme="dark"] .app-launcher-panel,
html[data-theme="dark"] .app-launcher-overlay {
    border-color: #343a46;
    background-color: #1d2128;
    color: var(--text);
}

html[data-theme="dark"] .account-dropdown-item:hover,
html[data-theme="dark"] .app-launcher-item:hover {
    background-color: #2a303b;
}


/* =========================================================
   02. 左侧栏
========================================================= */

html[data-theme="dark"] .sidebar {
    border-color: var(--line);
    background-color: #1a1d23;
}

html[data-theme="dark"] .sidebar-activity-bar {
    border-color: var(--line);
    background-color: #15181e;
}

html[data-theme="dark"] .sidebar-activity {
    color: #8a94a6;
}

html[data-theme="dark"] .sidebar-activity:hover {
    background-color: #242932;
    color: #dbe1ec;
}

html[data-theme="dark"] .sidebar-activity.active {
    background-color: #2a3040;
    color: #aeb8ff;
}

html[data-theme="dark"] .sidebar-panel-container,
html[data-theme="dark"] .sidebar-panel {
    border-color: var(--line);
    background-color: #1a1d23;
    color: var(--text);
}

html[data-theme="dark"] .panel-head {
    border-color: var(--line);
    background-color: #1c2027;
    color: var(--text);
}

html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .panel-head-title,
html[data-theme="dark"] .panel-head h3 {
    color: var(--text);
}

html[data-theme="dark"] .panel-head-actions,
html[data-theme="dark"] .panel-icon-btn,
html[data-theme="dark"] .panel-head button {
    color: #9aa4b5;
}

html[data-theme="dark"] .panel-icon-btn:hover,
html[data-theme="dark"] .panel-head button:hover {
    background-color: #2a303b;
    color: #ffffff;
}

html[data-theme="dark"] .panel-icon-btn,
html[data-theme="dark"] .panel-head button {
    border-color: #343a46;
    background-color: #22262e;
}

html[data-theme="dark"] .sidebar-panel .panel-icon-btn,
html[data-theme="dark"] .sidebar-panel .panel-head-actions button {
    border-color: #343a46 !important;
    background-color: #22262e !important;
    color: #c6cedb !important;
}

html[data-theme="dark"] .sidebar-panel[data-panel="pages"] .page-item {
    border-color: #303641 !important;
}

html[data-theme="dark"] .sidebar-panel[data-panel="pages"] .page-item.active {
    border-color: #46518a !important;
}

html[data-theme="dark"] .sidebar-panel-body {
    background-color: #1a1d23;
    color: var(--text);
}

html[data-theme="dark"] .sidebar-search,
html[data-theme="dark"] #sidebarLayerSearch,
html[data-theme="dark"] .text-style-search,
html[data-theme="dark"] .text-style-search input,
html[data-theme="dark"] .input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    border-color: #353b47;
    background-color: #22262e;
    color: #e4e7ee;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #737e90;
}

html[data-theme="dark"] .sidebar-search:focus,
html[data-theme="dark"] .input:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
    border-color: #6f7df0;
    box-shadow:
        0 0 0 3px rgba(111, 125, 240, 0.14);
}

html[data-theme="dark"] .sidebar-category-list button,
html[data-theme="dark"] .template-category-list button,
html[data-theme="dark"] .text-style-category,
html[data-theme="dark"] .text-quick-tab {
    border-color: #343a46;
    background-color: #22262e;
    color: #aab4c4;
}

html[data-theme="dark"] .sidebar-category-list button:hover,
html[data-theme="dark"] .template-category-list button:hover,
html[data-theme="dark"] .text-style-category:hover,
html[data-theme="dark"] .text-quick-tab:hover {
    background-color: #2a303b;
    color: #eef1f6;
}

html[data-theme="dark"] .sidebar-category-list button.is-active,
html[data-theme="dark"] .template-category-list button.is-active,
html[data-theme="dark"] .text-style-category.is-active,
html[data-theme="dark"] .text-quick-tab.is-active {
    border-color: #4b5688;
    background-color: #2a3150;
    color: #c4cbff;
}

html[data-theme="dark"] .ts-template-card,
html[data-theme="dark"] .ts-template-card:hover,
html[data-theme="dark"] .text-style-card,
html[data-theme="dark"] .text-style-card:hover,
html[data-theme="dark"] .asset-card,
html[data-theme="dark"] .asset-item,
html[data-theme="dark"] .sidebar-card {
    border-color: #303641;
    background-color: #20242c;
    color: #dfe5ef;
}

html[data-theme="dark"] .ts-template-info,
html[data-theme="dark"] .ts-template-title,
html[data-theme="dark"] .text-style-card-name {
    color: #dfe5ef;
}

html[data-theme="dark"] .ts-template-meta,
html[data-theme="dark"] .ts-template-pages {
    color: #8b95a6;
}

html[data-theme="dark"] .ts-template-cover,
html[data-theme="dark"] .ts-template-placeholder {
    background-color: #171a20;
}

html[data-theme="dark"] .ts-template-skeleton-cover,
html[data-theme="dark"] .ts-template-skeleton-line,
html[data-theme="dark"] .text-style-skeleton {
    background-color: #2a303a;
}

html[data-theme="dark"] .ts-template-use,
html[data-theme="dark"] .sidebar-primary-btn {
    border-color: #5c68e8;
    background-color: #5c68e8;
    color: #ffffff;
}

html[data-theme="dark"] .sidebar-audio-item {
    border-color: #303641;
    background-color: #20242c;
}

html[data-theme="dark"] .sidebar-audio-item-head strong {
    color: #dfe5ef;
}

html[data-theme="dark"] .sidebar-audio-hint,
html[data-theme="dark"] .sidebar-audio-duration {
    color: #8b95a6;
}

html[data-theme="dark"] .sidebar-audio-trim label {
    color: #aab4c4;
}

html[data-theme="dark"] .sidebar-audio-section-title {
    color: #c6cedb;
}

html[data-theme="dark"] .sidebar-audio-trim-note {
    color: #8b95a6;
}

html[data-theme="dark"] .sidebar-audio-editor-btn {
    border-color: #343a46;
    background-color: #22262e;
    color: #c6cedb;
}

html[data-theme="dark"] .sidebar-audio-editor-btn:hover {
    border-color: #5c68e8;
    background-color: #2a3150;
    color: #c4cbff;
}

html[data-theme="dark"] .page-item {
    border-color: transparent;
    color: #d7dde8;
    background-color: #20242c !important;
}

html[data-theme="dark"] .page-item:hover {
    background-color: #262c35 !important;
}

html[data-theme="dark"] .page-item.active {
    border-color: #46518a !important;
    background-color: #2a3150 !important;
}

html[data-theme="dark"] .page-name {
    color: #ffffff !important;
}

html[data-theme="dark"] .page-item.active .page-name {
    color: #ffffff !important;
}

html[data-theme="dark"] .page-item-action {
    color: #9aa4b5;
}

html[data-theme="dark"] .page-item-action:hover {
    background-color: #343b47;
    color: #ffffff;
}

html[data-theme="dark"] .thumb {
    border-color: #343a46;
    background-color: #111419;
}

html[data-theme="dark"] .add-page {
    border-color: #343a46;
    background-color: #20242c;
    color: #aab4c4;
}

html[data-theme="dark"] .add-page:hover {
    border-color: #5c68e8;
    background-color: #262c3b;
    color: #c9d0ff;
}

html[data-theme="dark"] .sidebar-empty {
    color: #8e98a9;
}

html[data-theme="dark"] .page-context-menu,
html[data-theme="dark"] .layers-context-menu,
html[data-theme="dark"] .context-menu {
    border-color: #3a414d;
    background-color: #1f232b;
    color: #e4e7ee;
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .page-context-item,
html[data-theme="dark"] .layers-context-item,
html[data-theme="dark"] .context-menu-item {
    color: #d7dde8;
}

html[data-theme="dark"] .page-context-item:hover:not(:disabled),
html[data-theme="dark"] .layers-context-item:hover:not(:disabled),
html[data-theme="dark"] .context-menu-item:hover:not(:disabled) {
    background-color: #2a303b;
}

html[data-theme="dark"] .layers-row:hover {
    background-color: #242932;
}

html[data-theme="dark"] .layers-row.is-selected {
    background:
        linear-gradient(90deg, #2a3150, #303359);
    box-shadow:
        inset 2px 0 0 #8b96ff;
}

html[data-theme="dark"] .layers-item-label {
    color: #dbe1ec;
}

html[data-theme="dark"] .layers-row.is-selected .layers-item-label {
    color: #eef0ff;
}

html[data-theme="dark"] .layers-item-icon {
    color: #8e98a9;
}

html[data-theme="dark"] .layers-row-action {
    color: #8e98a9;
}

html[data-theme="dark"] .layers-row-action:hover:not(:disabled) {
    background-color: #343b47;
    color: #ffffff;
}

html[data-theme="dark"] .layers-toggle {
    color: #7f8a9d;
}

html[data-theme="dark"] .layers-toggle:hover:not(:disabled) {
    background-color: #2d333e;
    color: #dbe1ec;
}

html[data-theme="dark"] .layers-count {
    background-color: #2a3150;
    color: #c4cbff;
}


/* =========================================================
   03. 中央舞台
========================================================= */

html[data-theme="dark"] .stage-panel {
    border-color: var(--line);
    background-color: #14161b;
}

html[data-theme="dark"] .stage-toolbar,
html[data-theme="dark"] .viewport-toolbar,
html[data-theme="dark"] .stage-actions,
html[data-theme="dark"] .workspace-toolbar {
    border-color: var(--line);
    background-color: #1a1d23;
    color: #aeb7c6;
}

html[data-theme="dark"] .stage-toolbar button,
html[data-theme="dark"] .stage-toolbar .toolbar-btn,
html[data-theme="dark"] .stage-toolbar .icon-btn,
html[data-theme="dark"] .stage-toolbar .subtle-btn {
    border-color: #343a46 !important;
    background-color: #22262e !important;
    color: #cfd6e2 !important;
}

html[data-theme="dark"] .stage-toolbar button:hover,
html[data-theme="dark"] .stage-toolbar .toolbar-btn:hover,
html[data-theme="dark"] .stage-toolbar .icon-btn:hover {
    background-color: #2d333e !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .viewport-action-btn,
html[data-theme="dark"] .stage-actions button,
html[data-theme="dark"] .workspace-toolbar button {
    border-color: #343a46;
    background-color: #22262e;
    color: #aeb7c6;
}

html[data-theme="dark"] .viewport-action-btn:hover,
html[data-theme="dark"] .stage-actions button:hover,
html[data-theme="dark"] .workspace-toolbar button:hover {
    background-color: #2d333e;
    color: #ffffff;
}

html[data-theme="dark"] .viewport-zoom-value,
html[data-theme="dark"] .page-indicator,
html[data-theme="dark"] #pageIndicator {
    color: #cfd6e2;
}

html[data-theme="dark"] .stage-wrap,
html[data-theme="dark"] .stage-frame {
    background-color: #101217;
}

html[data-theme="dark"] .workspace-popover {
    border-color: #343a46;
    background-color: #1e222a;
    color: #dfe5ef;
}

html[data-theme="dark"] .ruler {
    border-color: var(--line);
    background-color: #181b21;
    color: #7e8899;
}

html[data-theme="dark"] .ruler-tick::after {
    border-color: #545d6b
}

html[data-theme="dark"] .timeline-panel {
    border-color: var(--line);
    background-color: #191c22;
    color: #cfd6e2;
}

html[data-theme="dark"] .timeline-head,
html[data-theme="dark"] .timeline-body {
    border-color: var(--line);
    background-color: #191c22;
}

html[data-theme="dark"] .timeline-head strong,
html[data-theme="dark"] .timeline-duration,
html[data-theme="dark"] #timelineDuration {
    color: #dfe5ef;
}

html[data-theme="dark"] .timeline-current-time {
    color: #dfe5ef !important;
}

html[data-theme="dark"] .audio-source-clip {
    border-color: #424a57;
    background-color: #343a44;
}

html[data-theme="dark"] .audio-clip-used {
    border-color: #727de5;
    background-color: #343d74;
    color: #e0e4ff;
}

html[data-theme="dark"] .audio-clip-used::before,
html[data-theme="dark"] .audio-clip-used::after {
    background-color: #aab1ff;
}

html[data-theme="dark"] .mini-action,
html[data-theme="dark"] .timeline-actions button {
    border-color: #343a46;
    background-color: #22262e;
    color: #aeb7c6;
}

html[data-theme="dark"] .mini-action:hover,
html[data-theme="dark"] .timeline-actions button:hover {
    background-color: #2d333e;
    color: #ffffff;
}

html[data-theme="dark"] .audio-track,
html[data-theme="dark"] .track-row {
    border-color: #303641;
    background-color: #20242c;
}

html[data-theme="dark"] .timeline-empty {
    color: #7f8a9d;
}

html[data-theme="dark"] .audio-empty {
    border-color: #2f3541 !important;
    background-color: #1a1d23 !important;
    color: #8e98a9 !important;
}

html[data-theme="dark"] .audio-empty div {
    color: #8e98a9 !important;
}

html[data-theme="dark"] .audio-tracks,
html[data-theme="dark"] #audioTracks {
    background-color: #191c22 !important;
}


/* =========================================================
   04. 右侧面板
========================================================= */

html[data-theme="dark"] .right-dock,
html[data-theme="dark"] .right-dock-panel,
html[data-theme="dark"] .right-view,
html[data-theme="dark"] .inspector,
html[data-theme="dark"] .ai-panel {
    border-color: var(--line);
    background-color: #1a1d23;
    color: var(--text);
}

html[data-theme="dark"] .right-activity-bar {
    border-color: var(--line);
    background-color: #15181e;
}

html[data-theme="dark"] .right-activity-btn {
    color: #8e98a9;
}

html[data-theme="dark"] .right-activity-btn:hover {
    background-color: #242932;
    color: #dfe5ef;
}

html[data-theme="dark"] .right-activity-btn.active {
    background-color: #2a3040;
    color: #aeb8ff;
}

html[data-theme="dark"] .inspector-head,
html[data-theme="dark"] .right-view .eyebrow {
    color: #8e98a9;
}

html[data-theme="dark"] .inspector-title,
html[data-theme="dark"] .right-view h3,
html[data-theme="dark"] .right-view h4 {
    color: #dfe5ef;
}

html[data-theme="dark"] .ai-messages,
html[data-theme="dark"] .ai-panel-body {
    background-color: #1a1d23;
}

html[data-theme="dark"] .ai-message,
html[data-theme="dark"] .ai-message.assistant {
    border-color: #343a46;
    background-color: #22262e;
    color: #dfe5ef;
}

html[data-theme="dark"] .ai-quick-actions button {
    border-color: #343a46;
    background-color: #22262e;
    color: #aeb7c6;
}

html[data-theme="dark"] .ai-input,
html[data-theme="dark"] #aiInput {
    border-color: #343a46;
    background-color: #20242c;
    color: #e4e7ee;
}

html[data-theme="dark"] .code-tabs {
    border-color: var(--line);
    background-color: #171a20;
}

html[data-theme="dark"] .code-tab {
    color: #8e98a9;
}

html[data-theme="dark"] .code-tab.active {
    background-color: #242932;
    color: #dfe5ef;
}

html[data-theme="dark"] .code-editor-wrap,
html[data-theme="dark"] .code-editor-head {
    border-color: #2b303a;
    background-color: #101827;
}

html[data-theme="dark"] .code-editor {
    color: #e5edf9;
    background-color: #101827;
}

html[data-theme="dark"] .right-view .input,
html[data-theme="dark"] .right-view select,
html[data-theme="dark"] .right-view textarea {
    border-color: #343a46;
    background-color: #20242c;
    color: #e4e7ee;
}

html[data-theme="dark"] .subtle-btn,
html[data-theme="dark"] .small-square {
    border-color: #343a46;
    background-color: #22262e;
    color: #aeb7c6;
}

html[data-theme="dark"] .subtle-btn:hover,
html[data-theme="dark"] .small-square:hover {
    background-color: #2d333e;
    color: #ffffff;
}


/* =========================================================
   05. 弹窗与浮层
========================================================= */

html[data-theme="dark"] .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.58);
}

html[data-theme="dark"] .settings-modal,
html[data-theme="dark"] .export-modal,
html[data-theme="dark"] .video-modal,
html[data-theme="dark"] .png-modal,
html[data-theme="dark"] .pptx-modal,
html[data-theme="dark"] .project-dialog,
html[data-theme="dark"] .account-modal,
html[data-theme="dark"] .modal-content {
    border-color: #343a46;
    background-color: #1d2128;
    color: var(--text);
}

html[data-theme="dark"] .modal-close {
    color: #98a2b3;
}

html[data-theme="dark"] .modal-close:hover {
    background-color: #2a303b;
    color: #ffffff;
}

html[data-theme="dark"] .eyebrow {
    color: #8e98a9;
}

html[data-theme="dark"] .settings-modal h2,
html[data-theme="dark"] .export-modal h2,
html[data-theme="dark"] .video-modal h2 {
    color: #f0f3f9;
}

html[data-theme="dark"] [data-version-notice] {
    border-color: #3a414d !important;
    background-color: #1f232b !important;
    color: #e4e7ee !important;
    box-shadow:
        0 18px 46px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] [data-version-notice] div {
    color: #dfe5ef !important;
}

html[data-theme="dark"] [data-version-notice] button {
    border-color: #3a414d !important;
    background-color: #2a303b !important;
    color: #dfe5ef !important;
}

html[data-theme="dark"] #toast {
    border-color: #3a414d !important;
    background-color: #1f232b !important;
    color: #e4e7ee !important;
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.42) !important;
}

html[data-theme="dark"] .png-result-modal {
    background-color: #1f232b;
    color: #e4e7ee;
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .png-result-head h2 {
    color: #f0f3f9;
}

html[data-theme="dark"] .png-result-meta,
html[data-theme="dark"] .png-result-hint,
html[data-theme="dark"] .png-result-note {
    color: #98a2b3;
}

html[data-theme="dark"] .png-result-zip {
    border-color: #343a46;
    background:
        linear-gradient(135deg, #232a3a, #252a3d);
}

html[data-theme="dark"] .png-result-zip-copy b {
    color: #e4e7ee;
}

html[data-theme="dark"] .png-result-zip-copy span {
    color: #98a2b3;
}

html[data-theme="dark"] .png-result-action.is-secondary {
    border-color: #343a46;
    background-color: #22262e;
    color: #dfe5ef;
}

html[data-theme="dark"] .png-result-card {
    border-color: #343a46;
    background-color: #22262e;
    color: #c5ccd8;
}


/* =========================================================
   06. 文本样式库 / 素材面板细节
========================================================= */

html[data-theme="dark"] .text-style-library,
html[data-theme="dark"] .text-panel-body,
html[data-theme="dark"] .asset-center-body,
html[data-theme="dark"] .template-panel-body {
    background-color: #1a1d23;
}

html[data-theme="dark"] .text-style-tile,
html[data-theme="dark"] .text-style-card {
    border-color: #303641;
    background-color: #20242c;
}

html[data-theme="dark"] .text-style-card-name,
html[data-theme="dark"] .text-style-results-copy h3 {
    color: #dfe5ef;
}

html[data-theme="dark"] .text-style-results-copy p,
html[data-theme="dark"] .text-style-count,
html[data-theme="dark"] .text-style-results-head {
    color: #8e98a9;
}

html[data-theme="dark"] .text-style-card-insert {
    border-color: #5c68e8;
    background-color: #5c68e8;
    color: #ffffff;
}

html[data-theme="dark"] .text-style-load-more {
    border-color: #343a46;
    background-color: #22262e;
    color: #aeb7c6;
}

html[data-theme="dark"] .text-style-load-more:hover {
    background-color: #2d333e;
    color: #ffffff;
}

html[data-theme="dark"] .asset-section-head,
html[data-theme="dark"] .asset-group-title {
    color: #8e98a9;
}


/* =========================================================
   07. 滚动条
========================================================= */

html[data-theme="dark"] * {
    scrollbar-color: #3a414d #1a1d23;
}

html[data-theme="dark"] ::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1d23;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    border: 2px solid #1a1d23;
    border-radius: 6px;
    background: #3a414d;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4b5362;
}
