/* ==========================================================================
   爱命题 · Polish Layer  (loads AFTER design-system-refresh.css)
   --------------------------------------------------------------------------
   学术克制 v2 — 在已有"墨色/靛墨/赭石"系统上做最终精修：
     · 节奏：标题/正文/说明对比更稳，留白更均匀
     · 配色：补一层"米纸"暖度，hairline 半透明更柔
     · 按钮：默认 / hover / active / disabled / loading 五态完整
     · 表单：焦点环更克制，hover 反馈更明确
     · 动效：入场 stagger、状态切换 cubic-bezier 统一
     · 深色：完整一套 token，行为一致
     · 朱印 / 纸纹：极少量点缀（workspace header 章戳、卡片纸纹）
   --------------------------------------------------------------------------
   只覆盖样式，不改 id / class / JS 钩子。
   ========================================================================== */

/* ──────────────────────────────────────────────────────────────────
   01 · 全局 token 微调（保留旧变量名，只调色阶）
   ────────────────────────────────────────────────────────────────── */
:root {
    /* 暖一度的纸感画布 —— 比纯灰白多一点 ochre 温度，无明显黄 */
    --canvas:       #FAF8F4;
    --canvas-deep:  #F3F0EA;
    --surface:      #FFFFFF;
    --surface-soft: #FBF9F5;
    --surface-well: #F4F1EB;

    /* hairline 改为半透明墨色，跨深浅背景都更稳 */
    --hairline:        rgba(14, 17, 22, 0.08);
    --hairline-strong: rgba(14, 17, 22, 0.14);
    --hairline-warm:   rgba(122, 62, 30, 0.16);

    /* focus ring：靛墨 18% —— 已有同名 token，这里只增强一组深浅 */
    --focus-ring-strong: rgba(54, 73, 127, 0.32);
    --focus-ring-soft:   rgba(54, 73, 127, 0.12);

    /* 内容容器最大宽（让超宽屏不至于失控） */
    --content-max: 1320px;

    /* 单一标准缓动 */
    --ease-polish: cubic-bezier(0.22, 1, 0.36, 1);

    /* 朱印赭石点缀色（与现有 ochre-600 同色，便于阅读） */
    --seal: var(--ochre-600);
}

/* ──────────────────────────────────────────────────────────────────
   02 · 全局：body 背景 + 纸纹 + 选区 + 链接 + 滚动条
   ────────────────────────────────────────────────────────────────── */
body:not(.login-body) {
    background:
        radial-gradient(ellipse 1200px 600px at 12% -10%, rgba(54, 73, 127, 0.035), transparent 60%),
        radial-gradient(ellipse 900px 500px at 100% 110%, rgba(122, 62, 30, 0.030), transparent 65%),
        var(--canvas);
    background-attachment: fixed;
}

/* 极淡纸纹（barely 可见）—— 用 SVG noise mask，对核心阅读 0 干扰 */
body:not(.login-body)::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.05  0 0 0 0 0.05  0 0 0 0.018 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.app-shell { position: relative; z-index: 1; }

::selection {
    color: #FFFFFF;
    background: var(--ink-800);
}

/* 滚动条 · 克制墨色 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(14, 17, 22, 0.22) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(14, 17, 22, 0.18);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(14, 17, 22, 0.32); background-clip: padding-box; border: 2px solid transparent; }

/* ──────────────────────────────────────────────────────────────────
   03 · 侧边栏 · 更克制更精致
   ────────────────────────────────────────────────────────────────── */
.side-nav {
    width: 248px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 250, 245, 0.92)),
        var(--surface);
    border-right: 1px solid var(--hairline);
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
}
.app-shell { grid-template-columns: 248px minmax(0, 1fr); }

.brand-row {
    padding: 22px 22px 16px;
    gap: 12px;
    position: relative;
}
.brand-row::after {
    content: "";
    position: absolute;
    left: 22px; right: 22px; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hairline-strong) 18%, var(--hairline-strong) 82%, transparent);
}
.brand-mark {
    position: relative;
    width: 40px; height: 40px;
    font-size: 15px;
    border-radius: 10px;
    color: transparent;
    background:
        radial-gradient(120% 80% at 28% 18%, rgba(255, 232, 176, 0.22), transparent 60%),
        linear-gradient(145deg, #1B1A18 0%, #0E0D0B 55%, #06060A 100%) !important;
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 232, 176, 0.16),
        inset 0 0 0 1px rgba(212, 175, 55, 0.32),
        0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 22px -8px rgba(8, 6, 4, 0.5),
        0 0 18px -8px rgba(212, 175, 55, 0.35);
    isolation: isolate;
    overflow: hidden;
}
.brand-mark::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(60% 45% at 30% 0%, rgba(255, 240, 200, 0.18), transparent 65%);
    z-index: 1;
}
.brand-mark::after {
    content: "AI";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(155deg, #F8E7A8 0%, #E5C76B 38%, #C9A23F 62%, #8B6D2C 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
            color: transparent;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    font-weight: 900;
    letter-spacing: -0.04em;
    z-index: 2;
}
.brand-row strong { font-size: 15.5px; font-weight: 800; letter-spacing: 0; }
.brand-row span:last-child { letter-spacing: 0.22em; font-size: 9.5px; }

/* nav 项 · 更顺滑的 hover */
.workspace-tab {
    padding: 10px 14px 10px 16px;
    min-height: 40px;
    border-radius: 6px;
    transition:
        color 180ms var(--ease-polish),
        background 180ms var(--ease-polish);
}
.workspace-tab:hover { background: rgba(14, 17, 22, 0.04); }
.workspace-tab.is-active { background: rgba(14, 17, 22, 0.06); font-weight: 600; }
.workspace-tab.is-active::before {
    left: 4px;
    top: 9px; bottom: 9px;
    width: 2.5px;
    background: var(--seal);
    border-radius: 1px;
}

/* nav 分组 label */
.nav-main::before {
    content: "工作区";
    display: block;
    padding: 16px 10px 8px;
    color: var(--ink-400);
    font: 700 10px/1 var(--font-sans);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

/* teacher 卡 */
.teacher-card {
    padding: 11px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--hairline);
    transition: border-color 180ms var(--ease-polish), background 180ms var(--ease-polish);
}
.teacher-card:hover { background: #FFFFFF; border-color: var(--hairline-strong); }
.teacher-card > span, #teacherAvatar {
    width: 32px; height: 32px;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--indigo-600), var(--indigo-700));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    font-weight: 700;
}

/* logout 按钮 */
.logout-btn {
    min-height: 36px;
    padding: 8px 12px;
    color: var(--ink-500);
    font-size: 12.5px;
    letter-spacing: 0.04em;
    border-radius: 6px;
}
.logout-btn:hover { color: var(--red-700); background: var(--red-50); }

/* ──────────────────────────────────────────────────────────────────
   04 · 主区 · 排版节奏
   ────────────────────────────────────────────────────────────────── */
.main-shell {
    /* 让超宽屏不要让标题被拉伸到难读 */
}
.workspace {
    padding: 40px 48px 56px;
    max-width: var(--content-max);
    margin: 0 auto;
}

/* 入场动画：错位且更柔 */
.workspace.is-active {
    animation: workspaceIn 480ms var(--ease-polish) both;
}
@keyframes workspaceIn {
    from { opacity: 0; transform: translateY(8px); filter: blur(0.5px); }
    to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.workspace.is-active > .workspace-header { animation: rowIn 520ms 40ms var(--ease-polish) both; }
.workspace.is-active > .stepper         { animation: rowIn 520ms 120ms var(--ease-polish) both; }
.workspace.is-active > .generator-stage,
.workspace.is-active > .single-question-layout,
.workspace.is-active > .open-discussion-layout,
.workspace.is-active > .diagnosis-tool-layout,
.workspace.is-active > .history-layout,
.workspace.is-active > .bank-layout,
.workspace.is-active > .panel,
.workspace.is-active > #agentConfigList   { animation: rowIn 520ms 180ms var(--ease-polish) both; }
@keyframes rowIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 工作区标题 · 加印章红角点缀 */
.workspace-header {
    align-items: flex-end;
    gap: 28px;
    margin: 0 0 32px;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--hairline-strong);
    position: relative;
}
.workspace-header::after {
    /* 极小朱印点 —— 仅作为系统标识 */
    content: "";
    position: absolute;
    left: 0; bottom: -1px;
    width: 28px; height: 2px;
    background: var(--seal);
    border-radius: 1px;
}

.workspace-header-main { gap: 10px; }
.eyebrow {
    color: var(--seal);
    font-weight: 800;
    letter-spacing: 0.28em;
    font-size: 10.5px;
    text-transform: uppercase;
}
.workspace-header-main h2 {
    font-size: 30px;
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -0.018em;
    color: var(--ink-900);
    max-width: 820px;
    text-wrap: balance;
}

/* meta-pill 更柔 */
.meta-pill {
    min-height: 26px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 180ms var(--ease-polish), border-color 180ms var(--ease-polish);
}
.meta-pill-soft { background: rgba(14, 17, 22, 0.04); border-color: var(--hairline); }

/* ──────────────────────────────────────────────────────────────────
   05 · Stepper · 更精致的步骤节奏
   ────────────────────────────────────────────────────────────────── */
.stepper {
    gap: 10px;
    margin-bottom: 28px;
}
.stepper-item {
    min-height: 76px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--hairline);
    background: rgba(255, 255, 255, 0.6);
    transition:
        color 220ms var(--ease-polish),
        background 220ms var(--ease-polish),
        border-color 220ms var(--ease-polish),
        transform 220ms var(--ease-polish);
}
.stepper-item:not(:disabled):not(.is-current):not(.is-done):hover {
    background: #FFFFFF;
    border-color: var(--hairline-strong);
    transform: translateY(-1px);
}
.stepper-index {
    width: 30px; height: 30px;
    border-radius: 6px;
    font-family: var(--font-serif);
    font-weight: 800;
    font-size: 15px;
    transition: transform 240ms var(--ease-polish);
}
.stepper-item.is-current .stepper-index { transform: scale(1.04); }

.stepper-item.is-current {
    background: linear-gradient(180deg, var(--ink-900), #000);
    border-color: #000;
    box-shadow: 0 8px 24px -10px rgba(14, 17, 22, 0.55);
}
.stepper-item.is-current::before {
    /* 顶部赭石朱印条 */
    height: 3px;
    background: var(--seal);
}
.stepper-item.is-current .stepper-status {
    background: var(--seal);
    border-color: var(--seal);
    color: #FFFFFF;
    letter-spacing: 0.18em;
}

.stepper-item.is-done {
    background: var(--indigo-50);
    border-color: rgba(54, 73, 127, 0.22);
}
.stepper-item.is-done .stepper-index {
    background: var(--indigo-600);
    border-color: var(--indigo-600);
    color: #FFFFFF;
    /* 已完成 -> 显示对勾 */
    font-size: 0;
    position: relative;
}
.stepper-item.is-done .stepper-index::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px; height: 7px;
    border-left: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    transform: translate(-50%, -60%) rotate(-45deg);
}

/* ──────────────────────────────────────────────────────────────────
   06 · Panel / card · 边线 + 顶端朱印挂条
   ────────────────────────────────────────────────────────────────── */
.panel,
.command-panel,
.flow-panel,
.preview-panel,
.history-papers,
.history-runs,
.history-detail,
.bank-list-panel,
.bank-editor-panel,
.providers-panel,
.active-combo-panel,
.diagnosis-control,
.diagnosis-output,
.single-question-control,
.single-question-output,
.open-discussion-control,
.open-discussion-output {
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface);
    box-shadow:
        0 1px 0 rgba(14, 17, 22, 0.02),
        0 1px 2px rgba(14, 17, 22, 0.03);
    transition: border-color 220ms var(--ease-polish), box-shadow 220ms var(--ease-polish);
}
.panel:hover { border-color: var(--hairline-strong); }

.panel-head { gap: 14px; }
.panel-head:not(.compact) {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--hairline);
}
.panel-head h2 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.008em;
    color: var(--ink-900);
}
.panel-head h3 { font-size: 16.5px; font-weight: 700; }
.panel-head .minor-text { color: var(--ink-500); font-size: 13.5px; line-height: 1.65; max-width: 64ch; }

/* compact 头部更紧凑 */
.panel-head.compact { padding-bottom: 0; border-bottom: 0; margin-bottom: 14px; }

/* ──────────────────────────────────────────────────────────────────
   07 · 表单系统 · 焦点更克制、hover 更明确
   ────────────────────────────────────────────────────────────────── */
.field { gap: 8px; }
.field > span,
.mini-field > span,
.field-label {
    color: var(--ink-700);
    font: 600 12px/1.4 var(--font-sans);
    letter-spacing: 0.06em;
    text-transform: none;
}

textarea, select, input[type="text"], input[type="search"],
input[type="number"], input[type="email"], input[type="password"],
input[type="url"], input[type="tel"], input:not([type]) {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--hairline-strong);
    border-radius: 6px;
    background: #FFFFFF;
    color: var(--ink-900);
    font: 500 14px/1.4 var(--font-sans);
    transition:
        border-color 160ms var(--ease-polish),
        box-shadow 160ms var(--ease-polish),
        background 160ms var(--ease-polish);
}
textarea {
    min-height: 88px;
    padding: 12px 14px;
    line-height: 1.6;
    resize: vertical;
}
select {
    padding-right: 36px;
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A525E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>")
        no-repeat right 12px center / 14px 14px,
        #FFFFFF;
    -webkit-appearance: none;
    appearance: none;
}
textarea::placeholder, input::placeholder {
    color: var(--ink-400);
    font-weight: 400;
}

.bank-search input {
    padding-left: 36px;
}

textarea:hover, select:hover, input:hover { border-color: var(--ink-400); }
textarea:focus, select:focus, input:focus {
    outline: none;
    border-color: var(--ink-800);
    box-shadow: 0 0 0 3px var(--focus-ring-soft);
    background: #FFFFFF;
}
textarea:disabled, select:disabled, input:disabled,
input[readonly], textarea[readonly] {
    color: var(--ink-500);
    background: var(--ink-50);
    border-color: var(--hairline);
    cursor: not-allowed;
}
input[readonly]:hover, textarea[readonly]:hover { border-color: var(--hairline); }

/* checkbox / radio · 重画一遍 */
input[type="checkbox"], input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px; height: 16px;
    min-height: 16px;
    padding: 0;
    border: 1.5px solid var(--ink-300);
    background: #FFFFFF;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 160ms var(--ease-polish), border-color 160ms var(--ease-polish);
}
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"] { border-radius: 999px; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--ink-700); }
input[type="checkbox"]:checked, input[type="radio"]:checked {
    background: var(--ink-900);
    border-color: var(--ink-900);
}
input[type="checkbox"]:checked::after {
    content: "";
    display: block;
    width: 8px; height: 4px;
    margin: 3px auto 0;
    border-left: 1.8px solid #FFFFFF;
    border-bottom: 1.8px solid #FFFFFF;
    transform: rotate(-45deg) translateY(-1px);
}
input[type="radio"]:checked::after {
    content: "";
    display: block;
    width: 6px; height: 6px;
    margin: 3px auto 0;
    border-radius: 999px;
    background: #FFFFFF;
}

/* ──────────────────────────────────────────────────────────────────
   08 · 按钮系统 · 五态完整 + loading
   ────────────────────────────────────────────────────────────────── */
.primary-btn, .ghost-btn, .regen-btn, .login-submit {
    position: relative;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 7px;
    font: 600 13.5px/1 var(--font-sans);
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition:
        background 160ms var(--ease-polish),
        border-color 160ms var(--ease-polish),
        color 160ms var(--ease-polish),
        box-shadow 200ms var(--ease-polish),
        transform 120ms var(--ease-polish);
}

/* primary · 墨黑实色 */
.primary-btn, .login-submit {
    background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
    color: #FFFFFF;
    border: 1px solid var(--ink-900);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 1px 2px rgba(14, 17, 22, 0.18),
        0 0 0 0 rgba(54, 73, 127, 0);
}
.primary-btn:hover:not(:disabled), .login-submit:hover:not(:disabled) {
    background: linear-gradient(180deg, #1f262f, var(--ink-800));
    border-color: #000;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.10) inset,
        0 4px 14px -4px rgba(14, 17, 22, 0.45);
    transform: translateY(-0.5px);
}
.primary-btn:active:not(:disabled), .login-submit:active:not(:disabled) {
    transform: translateY(0.5px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 1px 2px rgba(14, 17, 22, 0.25);
}
.primary-btn:focus-visible, .login-submit:focus-visible {
    outline: none;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 0 0 3px var(--focus-ring-strong);
}
.primary-btn:disabled, .login-submit:disabled {
    background: var(--ink-200);
    border-color: var(--ink-200);
    color: var(--ink-500);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* loading 状态：加 [data-loading] / [aria-busy] / .is-loading 都支持 */
.primary-btn.is-loading,
.primary-btn[aria-busy="true"],
.primary-btn[data-loading="true"],
.ghost-btn.is-loading,
.ghost-btn[aria-busy="true"],
.login-submit.is-loading,
.login-submit[aria-busy="true"] {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}
.primary-btn.is-loading::after,
.primary-btn[aria-busy="true"]::after,
.primary-btn[data-loading="true"]::after,
.ghost-btn.is-loading::after,
.ghost-btn[aria-busy="true"]::after,
.login-submit.is-loading::after,
.login-submit[aria-busy="true"]::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 16px; height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.32);
    border-top-color: #FFFFFF;
    animation: btnSpin 720ms linear infinite;
}
.ghost-btn.is-loading::after,
.ghost-btn[aria-busy="true"]::after {
    border-color: rgba(14, 17, 22, 0.18);
    border-top-color: var(--ink-800);
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ghost · 白底墨边 */
.ghost-btn, .regen-btn {
    background: #FFFFFF;
    color: var(--ink-800);
    border: 1px solid var(--hairline-strong);
    box-shadow: 0 1px 0 rgba(14, 17, 22, 0.02);
}
.ghost-btn:hover:not(:disabled), .regen-btn:hover:not(:disabled) {
    background: rgba(14, 17, 22, 0.03);
    border-color: var(--ink-400);
    color: var(--ink-900);
    transform: translateY(-0.5px);
}
.ghost-btn:active:not(:disabled), .regen-btn:active:not(:disabled) {
    transform: translateY(0.5px);
    background: rgba(14, 17, 22, 0.05);
}
.ghost-btn:focus-visible, .regen-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--focus-ring-soft);
    border-color: var(--ink-800);
}
.ghost-btn:disabled, .regen-btn:disabled {
    color: var(--ink-400);
    background: #FFFFFF;
    border-color: var(--hairline);
    cursor: not-allowed;
    opacity: 0.7;
}

/* danger button */
.danger-btn,
.ghost-btn.danger-btn,
.danger-zone .ghost-btn {
    color: var(--red-700);
    background: var(--red-50);
    border-color: rgba(169, 59, 54, 0.30);
}
.danger-btn:hover:not(:disabled),
.ghost-btn.danger-btn:hover:not(:disabled),
.danger-zone .ghost-btn:hover:not(:disabled) {
    background: rgba(169, 59, 54, 0.12);
    border-color: var(--red-600);
    color: var(--red-700);
    transform: translateY(-0.5px);
}

/* ──────────────────────────────────────────────────────────────────
   09 · chip / scope / 标签 / pill
   ────────────────────────────────────────────────────────────────── */
.chip, .bank-type-chip {
    min-height: 28px;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--hairline-strong);
    background: #FFFFFF;
    color: var(--ink-700);
    font: 500 12px/1.2 var(--font-sans);
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 160ms var(--ease-polish), border-color 160ms var(--ease-polish), color 160ms var(--ease-polish), transform 120ms var(--ease-polish);
}
.chip:hover, .bank-type-chip:hover { background: rgba(14, 17, 22, 0.04); border-color: var(--ink-400); transform: translateY(-0.5px); }

.bank-type-chip.is-active,
.chip.is-selected,
.selected-scopes .scope-chip {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: #FFFFFF;
    font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────────
   10 · status / info box · 更柔的层级
   ────────────────────────────────────────────────────────────────── */
.status-box, .info-box {
    padding: 11px 14px 11px 36px;
    border-radius: 7px;
    font: 500 13px/1.55 var(--font-sans);
    position: relative;
    border: 1px solid;
}
.status-box::before, .info-box::before {
    content: "";
    position: absolute;
    left: 14px; top: 13px;
    width: 14px; height: 14px;
    border-radius: 999px;
    flex-shrink: 0;
}

.status-box, .info-box {
    color: var(--indigo-700);
    background: var(--indigo-50);
    border-color: rgba(54, 73, 127, 0.22);
}
.status-box::before, .info-box::before {
    background:
        radial-gradient(circle, #FFFFFF 35%, transparent 36%),
        var(--indigo-600);
}

.generator-status.status-box {
    gap: 8px;
    padding: 11px 14px;
}

.generator-status.status-box::before {
    position: static;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    transform: none;
}

.info-box.info-box-soft {
    background: rgba(14, 17, 22, 0.03);
    border-color: var(--hairline);
    color: var(--ink-700);
}
.info-box.info-box-soft::before { background: var(--ink-400); }

.info-box.info-box-ok,
.generator-status.is-success {
    background: var(--green-50);
    border-color: rgba(61, 115, 80, 0.28);
    color: var(--green-700);
}
.info-box.info-box-ok::before,
.generator-status.is-success::before { background: var(--green-600); }

.info-box.info-box-warn,
.generator-status.is-warning {
    background: var(--amber-50);
    border-color: rgba(158, 106, 27, 0.30);
    color: var(--amber-700);
}
.info-box.info-box-warn::before,
.generator-status.is-warning::before { background: var(--amber-600); }

.info-box.info-box-error,
.generator-status.is-error,
.status-box.status-box-error {
    background: var(--red-50);
    border-color: rgba(169, 59, 54, 0.28);
    color: var(--red-700);
}
.info-box.info-box-error::before,
.generator-status.is-error::before,
.status-box.status-box-error::before { background: var(--red-600); }

/* ──────────────────────────────────────────────────────────────────
   11 · empty state
   ────────────────────────────────────────────────────────────────── */
.empty-state {
    padding: 36px 24px;
    border-radius: 8px;
    background: var(--surface-soft);
    border: 1px dashed var(--hairline-strong);
    color: var(--ink-500);
    font-size: 13.5px;
    line-height: 1.7;
    text-align: center;
}
.empty-state.planning-summary { background: var(--surface-soft); border-style: dashed; }

/* ──────────────────────────────────────────────────────────────────
   12 · scope / form-card / fieldset
   ────────────────────────────────────────────────────────────────── */
.form-card, .scope-box, .bank-fieldset {
    padding: 18px 18px 20px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: #FFFFFF;
}
.form-card-legend, .bank-fieldset > legend, .scope-list-label {
    padding: 0 8px 0 0;
    color: var(--seal);
    font: 800 10.5px/1 var(--font-sans);
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.scope-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin: 12px 0 6px;
}
.scope-actions input { flex: 1; }

.scope-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--hairline);
}

/* sticky panel footer 更克制的视觉 */
.panel-footer.sticky-actions {
    margin-top: 18px;
    padding: 16px 0 0;
    border-top: 1px solid var(--hairline);
    background: transparent;
    gap: 14px;
}

/* ──────────────────────────────────────────────────────────────────
   13 · 历史 / 题库列表行
   ────────────────────────────────────────────────────────────────── */
.history-list, .bank-list {
    padding: 4px;
    border-radius: 8px;
    background: var(--surface-soft);
}

/* ──────────────────────────────────────────────────────────────────
   14 · 试卷预览 · 纸感更稳
   ────────────────────────────────────────────────────────────────── */
.paper-preview {
    background:
        repeating-linear-gradient(0deg, rgba(122, 62, 30, 0.0) 0, rgba(122, 62, 30, 0.0) 35px, rgba(122, 62, 30, 0.05) 35px, rgba(122, 62, 30, 0.05) 36px),
        var(--paper-bg);
}

/* ──────────────────────────────────────────────────────────────────
   15 · 跳转链接（skip link）
   ────────────────────────────────────────────────────────────────── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 8px 14px;
    background: var(--ink-900);
    color: #FFFFFF;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; outline: 3px solid var(--focus-ring-strong); }

/* ──────────────────────────────────────────────────────────────────
   16 · 主题切换按钮
   ────────────────────────────────────────────────────────────────── */
.nav-actions-row {
    position: relative;
    display: grid;
    align-items: center;
    justify-items: center;
    justify-self: stretch;
    width: 100%;
    min-height: 44px;
}
.nav-actions-row .logout-btn {
    justify-self: center;
    margin-top: 0;
}
.theme-toggle {
    display: grid;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-700);
    cursor: pointer;
    transition:
        color 180ms var(--ease-polish),
        transform 180ms var(--ease-polish);
}
.theme-toggle:hover {
    background: transparent;
    color: var(--ink-900);
    transform: translateY(-50%) translateY(-1px);
}
.theme-toggle .theme-toggle-icon {
    grid-area: 1 / 1;
    width: 17px; height: 17px;
    color: var(--seal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        opacity 180ms var(--ease-polish),
        transform 180ms var(--ease-polish),
        color 180ms var(--ease-polish);
}
.theme-toggle-icon svg {
    width: 100%;
    height: 100%;
}
.theme-toggle-icon-sun {
    opacity: 0;
    transform: scale(0.72) rotate(-35deg);
}
.theme-toggle-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}
:root[data-theme="dark"] .theme-toggle-icon-moon {
    opacity: 0;
    transform: scale(0.72) rotate(35deg);
}
:root[data-theme="dark"] .theme-toggle-icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    color: var(--ochre-600);
}

/* ──────────────────────────────────────────────────────────────────
   17 · loading skeleton（如果文本未替换）
   ────────────────────────────────────────────────────────────────── */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* ──────────────────────────────────────────────────────────────────
   18 · 减少动画偏好
   ────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ──────────────────────────────────────────────────────────────────
   19 · 响应式（≤1180 / ≤900）
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .workspace { padding: 32px 28px 48px; }
    .stepper { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .workspace-header-main h2 { font-size: 26px; }
}
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .side-nav {
        position: static;
        z-index: auto;
        width: 100%;
        max-width: none;
        height: auto;
        transform: none;
        transition: none;
        border-right: 0;
        border-bottom: 1px solid var(--hairline);
    }
    .workspace { padding: 24px 18px 40px; }
    .workspace-header { flex-direction: column; align-items: flex-start; gap: 14px; }
    .workspace-header-main h2 { font-size: 22px; }
    .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .single-question-layout,
    .open-discussion-layout,
    .diagnosis-tool-layout,
    .history-layout,
    .bank-layout {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================================
   D A R K   M O D E
   ----------------------------------------------------------------------------
   学术克制 · 深色：墨蓝近黑 + 暖纸感反相
   ============================================================================ */
:root[data-theme="dark"] {
    /* 反相后的 ink scale —— 0 是底色，9 是高光（不是纯白，带 6% 暖度） */
    --ink-25:  #14171C;   /* page bg */
    --ink-50:  #1A1E25;   /* well */
    --ink-100: #20252E;
    --ink-150: #2A303A;   /* hairline weak */
    --ink-200: #353C48;   /* hairline default */
    --ink-300: #485160;
    --ink-400: #6F7886;
    --ink-500: #97A0AE;   /* muted */
    --ink-600: #B6BEC9;
    --ink-700: #CFD5DD;
    --ink-800: #E3E7EC;
    --ink-900: #F2F4F7;   /* primary text */

    /* indigo / ochre / 语义色 · 提亮饱和度更柔 */
    --indigo-50:  rgba(116, 137, 196, 0.10);
    --indigo-100: rgba(116, 137, 196, 0.18);
    --indigo-300: rgba(159, 178, 224, 0.45);
    --indigo-500: #8FA4D8;
    --indigo-600: #A6B8DF;
    --indigo-700: #C3D0E8;
    --indigo-800: #E0E7F2;
    --indigo-900: #F2F5FA;

    --ochre-50:  rgba(214, 145, 96, 0.10);
    --ochre-100: rgba(214, 145, 96, 0.20);
    --ochre-300: rgba(214, 145, 96, 0.55);
    --ochre-400: #DCA683;
    --ochre-500: #E6B79C;
    --ochre-600: #E6B79C;
    --ochre-700: #F0CFB9;

    --green-50:  rgba(110, 175, 132, 0.10);
    --green-100: rgba(110, 175, 132, 0.20);
    --green-600: #8BC79E;
    --green-700: #ACDABA;

    --amber-50:  rgba(220, 169, 87, 0.10);
    --amber-100: rgba(220, 169, 87, 0.20);
    --amber-600: #E5C281;
    --amber-700: #F2D8A1;

    --red-50:   rgba(220, 122, 117, 0.10);
    --red-100:  rgba(220, 122, 117, 0.22);
    --red-600:  #E59A95;
    --red-700:  #EFB7B3;

    /* 表面 + 边线 */
    --canvas:           #0E1116;
    --canvas-deep:      #0A0D12;
    --surface:          #161B22;
    --surface-soft:     #131820;
    --surface-well:     #1A2029;
    --paper-bg:         #1C1A14;
    --paper-line:       rgba(230, 183, 156, 0.18);

    --hairline:         rgba(255, 255, 255, 0.06);
    --hairline-strong:  rgba(255, 255, 255, 0.12);
    --hairline-warm:    rgba(230, 183, 156, 0.20);

    --focus-ring:        rgba(166, 184, 223, 0.30);
    --focus-ring-strong: rgba(166, 184, 223, 0.45);
    --focus-ring-soft:   rgba(166, 184, 223, 0.18);

    --seal:             #E0A87C;

    color-scheme: dark;
}

:root[data-theme="dark"] body:not(.login-body) {
    background:
        radial-gradient(ellipse 1200px 600px at 12% -10%, rgba(116, 137, 196, 0.07), transparent 60%),
        radial-gradient(ellipse 900px 500px at 100% 110%, rgba(214, 145, 96, 0.05), transparent 65%),
        var(--canvas);
    color: var(--ink-800);
}
:root[data-theme="dark"] body:not(.login-body)::before {
    /* 暗色下纸纹略加 */
    opacity: 0.6;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.014 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    mix-blend-mode: screen;
}

/* 侧边栏 */
:root[data-theme="dark"] .side-nav {
    background:
        linear-gradient(180deg, rgba(22, 27, 34, 0.96), rgba(15, 19, 25, 0.96)),
        var(--surface);
    border-right: 1px solid var(--hairline);
}
:root[data-theme="dark"] .brand-mark {
    background:
        radial-gradient(120% 80% at 28% 18%, rgba(255, 232, 176, 0.28), transparent 60%),
        linear-gradient(145deg, #211F1B 0%, #131210 55%, #0A0908 100%) !important;
    color: transparent;
    box-shadow:
        inset 0 1px 0 rgba(255, 232, 176, 0.22),
        inset 0 0 0 1px rgba(212, 175, 55, 0.42),
        0 10px 22px -8px rgba(0, 0, 0, 0.6),
        0 0 22px -6px rgba(212, 175, 55, 0.5);
}
:root[data-theme="dark"] .workspace-tab:hover { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .workspace-tab.is-active { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .teacher-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--hairline);
}
:root[data-theme="dark"] .teacher-card:hover { background: rgba(255, 255, 255, 0.05); }

/* panels */
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .command-panel,
:root[data-theme="dark"] .flow-panel,
:root[data-theme="dark"] .preview-panel,
:root[data-theme="dark"] .history-papers,
:root[data-theme="dark"] .history-runs,
:root[data-theme="dark"] .history-detail,
:root[data-theme="dark"] .bank-list-panel,
:root[data-theme="dark"] .bank-editor-panel,
:root[data-theme="dark"] .providers-panel,
:root[data-theme="dark"] .active-combo-panel,
:root[data-theme="dark"] .diagnosis-control,
:root[data-theme="dark"] .diagnosis-output,
:root[data-theme="dark"] .single-question-control,
:root[data-theme="dark"] .single-question-output,
:root[data-theme="dark"] .open-discussion-control,
:root[data-theme="dark"] .open-discussion-output {
    background: var(--surface);
    border-color: var(--hairline);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}
:root[data-theme="dark"] .panel:hover { border-color: var(--hairline-strong); }

/* form */
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="search"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] input[type="email"],
:root[data-theme="dark"] input:not([type]) {
    background: var(--surface-well);
    border-color: var(--hairline-strong);
    color: var(--ink-900);
}
:root[data-theme="dark"] textarea::placeholder,
:root[data-theme="dark"] input::placeholder { color: var(--ink-400); }
:root[data-theme="dark"] textarea:hover,
:root[data-theme="dark"] select:hover,
:root[data-theme="dark"] input:hover { border-color: var(--ink-400); }
:root[data-theme="dark"] textarea:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] input:focus {
    border-color: var(--ink-700);
    background: var(--surface-well);
    box-shadow: 0 0 0 3px var(--focus-ring-soft);
}
:root[data-theme="dark"] select {
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B6BEC9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>")
        no-repeat right 12px center / 14px 14px,
        var(--surface-well);
}
:root[data-theme="dark"] input[readonly],
:root[data-theme="dark"] textarea[readonly],
:root[data-theme="dark"] input:disabled,
:root[data-theme="dark"] textarea:disabled,
:root[data-theme="dark"] select:disabled {
    background: rgba(255, 255, 255, 0.03);
    color: var(--ink-500);
    border-color: var(--hairline);
}

/* checkbox / radio */
:root[data-theme="dark"] input[type="checkbox"],
:root[data-theme="dark"] input[type="radio"] {
    background: var(--surface-well);
    border-color: var(--ink-300);
}
:root[data-theme="dark"] input[type="checkbox"]:checked,
:root[data-theme="dark"] input[type="radio"]:checked {
    background: #FFFFFF;
    border-color: #FFFFFF;
}
:root[data-theme="dark"] input[type="checkbox"]:checked::after {
    border-left-color: var(--ink-25);
    border-bottom-color: var(--ink-25);
}
:root[data-theme="dark"] input[type="radio"]:checked::after { background: var(--ink-25); }

/* primary 按钮：暗色下反相为白底黑字 */
:root[data-theme="dark"] .primary-btn,
:root[data-theme="dark"] .login-submit {
    background: linear-gradient(180deg, #FFFFFF, #E3E7EC);
    color: var(--ink-25);
    border-color: #FFFFFF;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.20) inset,
        0 1px 2px rgba(0, 0, 0, 0.25);
}
:root[data-theme="dark"] .primary-btn:hover:not(:disabled),
:root[data-theme="dark"] .login-submit:hover:not(:disabled) {
    background: linear-gradient(180deg, #F7F9FB, #D6DCE3);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.30) inset,
        0 6px 16px -6px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .primary-btn:disabled,
:root[data-theme="dark"] .login-submit:disabled {
    background: var(--ink-150);
    color: var(--ink-400);
    border-color: var(--ink-200);
}
:root[data-theme="dark"] .primary-btn.is-loading::after,
:root[data-theme="dark"] .primary-btn[aria-busy="true"]::after,
:root[data-theme="dark"] .login-submit.is-loading::after {
    border-color: rgba(0,0,0,0.18);
    border-top-color: var(--ink-25);
}

/* ghost 按钮 · 暗色 */
:root[data-theme="dark"] .ghost-btn,
:root[data-theme="dark"] .regen-btn {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink-800);
    border-color: var(--hairline-strong);
    box-shadow: none;
}
:root[data-theme="dark"] .ghost-btn:hover:not(:disabled),
:root[data-theme="dark"] .regen-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--ink-400);
    color: var(--ink-900);
}
:root[data-theme="dark"] .ghost-btn:disabled,
:root[data-theme="dark"] .regen-btn:disabled {
    background: transparent;
    border-color: var(--hairline);
    color: var(--ink-400);
}
:root[data-theme="dark"] .ghost-btn.is-loading::after,
:root[data-theme="dark"] .ghost-btn[aria-busy="true"]::after {
    border-color: rgba(255,255,255,0.18);
    border-top-color: var(--ink-800);
}

/* danger */
:root[data-theme="dark"] .danger-btn,
:root[data-theme="dark"] .ghost-btn.danger-btn {
    background: rgba(220, 122, 117, 0.12);
    color: var(--red-700);
    border-color: rgba(220, 122, 117, 0.30);
}

/* chip */
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .bank-type-chip {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink-700);
    border-color: var(--hairline-strong);
}
:root[data-theme="dark"] .chip:hover,
:root[data-theme="dark"] .bank-type-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink-900);
}
:root[data-theme="dark"] .bank-type-chip.is-active,
:root[data-theme="dark"] .chip.is-selected,
:root[data-theme="dark"] .selected-scopes .scope-chip {
    background: #FFFFFF;
    color: var(--ink-25);
    border-color: #FFFFFF;
}

/* status / info box */
:root[data-theme="dark"] .status-box,
:root[data-theme="dark"] .info-box {
    background: rgba(116, 137, 196, 0.10);
    border-color: rgba(116, 137, 196, 0.30);
    color: var(--indigo-800);
}
:root[data-theme="dark"] .info-box.info-box-soft {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--hairline);
    color: var(--ink-600);
}
:root[data-theme="dark"] .info-box.info-box-ok,
:root[data-theme="dark"] .generator-status.is-success {
    background: rgba(110, 175, 132, 0.10);
    border-color: rgba(110, 175, 132, 0.32);
    color: var(--green-700);
}
:root[data-theme="dark"] .info-box.info-box-warn,
:root[data-theme="dark"] .generator-status.is-warning {
    background: rgba(220, 169, 87, 0.10);
    border-color: rgba(220, 169, 87, 0.30);
    color: var(--amber-700);
}
:root[data-theme="dark"] .info-box.info-box-error,
:root[data-theme="dark"] .generator-status.is-error,
:root[data-theme="dark"] .status-box.status-box-error {
    background: rgba(220, 122, 117, 0.10);
    border-color: rgba(220, 122, 117, 0.32);
    color: var(--red-700);
}

/* stepper */
:root[data-theme="dark"] .stepper-item {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--hairline);
}
:root[data-theme="dark"] .stepper-item:not(:disabled):not(.is-current):not(.is-done):hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--hairline-strong);
}
:root[data-theme="dark"] .stepper-index {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--hairline-strong);
    color: var(--ink-700);
}
:root[data-theme="dark"] .stepper-item.is-current {
    background: linear-gradient(180deg, #FFFFFF, #E3E7EC);
    color: var(--ink-25);
    border-color: #FFFFFF;
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .stepper-item.is-current .stepper-text small { color: rgba(14, 17, 22, 0.72); }
:root[data-theme="dark"] .stepper-item.is-current .stepper-index { background: var(--ink-25); border-color: var(--ink-25); color: #FFFFFF; }
:root[data-theme="dark"] .stepper-item.is-current::before { background: var(--seal); }
:root[data-theme="dark"] .stepper-item.is-current .stepper-status {
    background: var(--seal);
    border-color: var(--seal);
    color: var(--ink-25);
}
:root[data-theme="dark"] .stepper-item.is-done {
    background: rgba(116, 137, 196, 0.10);
    border-color: rgba(116, 137, 196, 0.30);
    color: var(--indigo-700);
}
:root[data-theme="dark"] .stepper-item.is-done .stepper-index {
    background: var(--indigo-600);
    border-color: var(--indigo-600);
    color: var(--ink-25);
}

/* meta-pill / fieldsets */
:root[data-theme="dark"] .meta-pill {
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink-700);
    border-color: var(--hairline-strong);
}
:root[data-theme="dark"] .meta-pill-soft {
    background: rgba(255, 255, 255, 0.03);
}
:root[data-theme="dark"] .form-card,
:root[data-theme="dark"] .scope-box,
:root[data-theme="dark"] .bank-fieldset {
    background: var(--surface-well);
    border-color: var(--hairline);
}

/* empty state */
:root[data-theme="dark"] .empty-state {
    background: var(--surface-well);
    border-color: var(--hairline-strong);
    color: var(--ink-500);
}

/* history / bank lists */
:root[data-theme="dark"] .history-list,
:root[data-theme="dark"] .bank-list {
    background: var(--surface-well);
}

/* paper preview */
:root[data-theme="dark"] .paper-preview {
    background:
        repeating-linear-gradient(0deg, transparent 0, transparent 35px, var(--paper-line) 35px, var(--paper-line) 36px),
        var(--paper-bg);
    color: var(--ink-800);
}

/* theme-toggle dark */
:root[data-theme="dark"] .theme-toggle {
    background: transparent;
    color: var(--ink-700);
}
:root[data-theme="dark"] .theme-toggle:hover {
    background: transparent;
    color: var(--ink-900);
}

/* logout */
:root[data-theme="dark"] .logout-btn:hover { background: rgba(220, 122, 117, 0.12); color: var(--red-700); }
