/* ==========================================================================
   创世纪 · 科技感换肤层（方案 B）
   纯覆盖层：只在 index.html 里 style.css 之后加载，可单独摘除。
   设计语言：#05080E 底 / 冷蓝网格 / 青→紫渐变 #22D3EE→#7C6BFF / HUD 四角
   配套：index.html 只做了「容器与 class」的排版理顺，script.js 零改动。
   ========================================================================== */

/* ---------- 一、色板（覆盖旧变量） ---------- */
:root {
    --bg-primary: #05080E;
    --bg-sidebar: #080D16;
    --bg-card: rgba(110, 170, 255, 0.035);
    --bg-card-solid: #0C131F;
    --bg-secondary: #0C131F;   /* 原样式引用了但从未定义 → 补上 */
    --bg-hover: rgba(34, 211, 238, 0.06);

    --text-primary: #E9F2FF;
    --text-secondary: #93A7C4;
    --text-muted: #5B6C88;

    --accent: #22D3EE;
    --accent-light: #38BDF8;
    --accent-glow: rgba(34, 211, 238, 0.22);
    --accent2: #7C6BFF;
    --accent3: #38BDF8;

    --border-color: rgba(110, 170, 255, 0.10);
    --border-strong: rgba(110, 190, 255, 0.22);
    --border-light: rgba(110, 170, 255, 0.10);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 26px rgba(34, 211, 238, 0.22);

    --color-success: #34D399;
    --color-success-rgb: 52, 211, 153;
    --color-error: #FB7185;
    --color-error-rgb: 251, 113, 133;

    --grad: linear-gradient(135deg, #22D3EE 0%, #3B82F6 55%, #7C6BFF 100%);
    --gradient-primary: linear-gradient(135deg, #22D3EE 0%, #3B82F6 55%, #7C6BFF 100%);
    --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- 二、全局背景：冷蓝网格 + 双色径向光 ---------- */
body {
    background: #05080E;
}

body::before {
    background:
        radial-gradient(760px 360px at 20% -8%, rgba(34, 211, 238, 0.13), transparent 62%),
        radial-gradient(680px 340px at 92% 2%, rgba(124, 107, 255, 0.12), transparent 60%),
        radial-gradient(900px 600px at 60% 118%, rgba(56, 189, 248, 0.06), transparent 65%);
}

body::after {
    background-image:
        linear-gradient(rgba(110, 170, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 170, 255, 0.045) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 35%, transparent 78%);
    mask-image: radial-gradient(ellipse at 50% 40%, #000 35%, transparent 78%);
}

/* 滚动条统一
   ⚠️ 坑：Chrome 121+ 只要元素上写了 `scrollbar-width`（或 `scrollbar-color`），就会**整个忽略下面的
   `::-webkit-scrollbar` 自绘样式**，改用系统原生滚动条 —— 而主站没设 `color-scheme: dark`，
   于是那些容器会掉回系统浅色粗白条。所以凡是设了 `scrollbar-width: thin` 的地方，
   必须同时写 `scrollbar-color`（见下文 .polish-chat / .dropdown-menu / .preview-list）。 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(110, 170, 255, 0.16);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.45); background-clip: padding-box; }

/* ---------- 三、侧边栏（对标右侧结果区：网格底纹 + HUD 卡 + 图标磁贴） ---------- */
.sidebar {
    width: 272px;
    background: linear-gradient(180deg, #0A1018 0%, #080D16 55%, #060A11 100%);
    border-right: 1px solid var(--border-color);
    padding: 14px 12px 12px;
    gap: 12px;
}
/* 冷蓝网格底纹（与右侧预览区同源），左上打一盏冷光 */
.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(320px 150px at 8% -6%, rgba(34, 211, 238, 0.10), transparent 70%),
        linear-gradient(rgba(110, 170, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 170, 255, 0.05) 1px, transparent 1px);
    background-size: auto, 28px 28px, 28px 28px;
    -webkit-mask-image: radial-gradient(140% 62% at 12% 0%, #000 0%, transparent 74%);
    mask-image: radial-gradient(140% 62% at 12% 0%, #000 0%, transparent 74%);
    z-index: 0;
}
/* 右侧发光竖条 */
.sidebar::after {
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(34, 211, 238, 0.5) 20%,
        transparent 50%,
        rgba(124, 107, 255, 0.45) 78%,
        transparent 100%);
    opacity: 0.42;
}
.sidebar-top,
.sb-actions { position: relative; z-index: 1; }
.sidebar-top { gap: 12px; }

/* ── 品牌区 ── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 0;
}
.sidebar-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--grad);
    color: #04121A;
    font: 800 18px/1 var(--mono);
    /* ★ 必须 flex 居中：display 默认是 block，字会从左上角起排 —— 圆角处看着就像「创」跑出框外 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.42), inset 0 1px 10px rgba(255, 255, 255, 0.22);
    flex: 0 0 auto;
    position: relative;
}
.sidebar-brand-logo::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 15px;
    border: 1px solid rgba(34, 211, 238, 0.32);
    pointer-events: none;
}
.sidebar-brand-txt { min-width: 0; flex: 1; }
.sidebar-brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.15;
    background: linear-gradient(96deg, #EAF7FF 0%, #7FE3F5 52%, #A99CFF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #EAF7FF;
}
.sidebar-brand-sub {
    font: 500 8.5px/1.3 var(--mono);
    letter-spacing: 0.18em;
    color: var(--text-muted);
    margin-top: 5px;
}
.sidebar-ver {
    font: 600 9px/1 var(--mono);
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: rgba(110, 170, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 7px;
    flex: 0 0 auto;
}
/* 「释放你的创造力」→ 细标签（带一颗发光点） */
.sidebar-header { padding: 0; }
.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: none;
    color: var(--text-muted);
    margin: 11px 0 0;
}
.sidebar-header h2::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 9px var(--accent);
    flex: 0 0 auto;
}

/* ── 模型 + 余额：合成一张 HUD 卡（上=选择器，下=余额详情） ── */
.model-trigger {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.08), rgba(124, 107, 255, 0.05));
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: 13px 13px 0 0;
    padding: 11px 12px;
    position: relative;
    overflow: hidden;
}
.model-trigger::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--grad);
    opacity: 0.95;
}
.model-trigger::after {
    content: "";
    position: absolute;
    left: 0; right: 0; height: 60px; top: -60px;
    background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.10), transparent);
    animation: sb-scan 4.4s linear infinite;
    pointer-events: none;
}
@keyframes sb-scan { 0% { top: -60px; } 100% { top: 130%; } }
.model-trigger:hover {
    border-color: rgba(34, 211, 238, 0.5);
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.13), rgba(124, 107, 255, 0.08));
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.15);
}
.model-trigger-icon { border-radius: 10px; box-shadow: 0 0 16px rgba(34, 211, 238, 0.35); }
.model-trigger-text {
    font: 600 9px/1 var(--mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.model-trigger-name { font-weight: 700; color: var(--text-primary); }
.model-trigger-arrow { color: var(--text-muted); }

.sidebar-showcase { margin: 0; }
.sidebar-showcase .showcase-flat {
    background: linear-gradient(180deg, rgba(8, 13, 22, 0.95), rgba(6, 10, 17, 0.95));
    border: 1px solid var(--border-strong);
    border-top: 1px dashed rgba(110, 190, 255, 0.18);
    border-radius: 0 0 13px 13px;
    padding: 9px 12px;
    gap: 6px;
    position: relative;
}
.sidebar-showcase .showcase-flat-left { gap: 9px; }
.sidebar-showcase .showcase-icon-sm {
    width: 26px; height: 26px;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.28);
}
.sidebar-showcase .current-model-name { font-size: 12.5px; color: var(--text-secondary); }
.sidebar-showcase .showcase-flat-right { gap: 8px; }
.sidebar-showcase .showcase-quota-badge {
    background: rgba(34, 211, 238, 0.09);
    border: 1px solid rgba(34, 211, 238, 0.22);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 10.5px;
    border-radius: 999px;
    padding: 3px 9px;
    width: auto;
    max-width: none;
}
.sidebar-showcase .showcase-quota-badge .icon-svg { opacity: .8; }
.sidebar-showcase .showcase-quota-badge.warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: #FBBF24;
}
.sidebar-showcase .showcase-quota-badge.exhausted {
    background: rgba(251, 113, 133, 0.1);
    border-color: rgba(251, 113, 133, 0.32);
    color: var(--color-error);
}
.sidebar-showcase .showcase-quota-badge.unlimited {
    background: rgba(124, 107, 255, 0.14);
    border-color: rgba(124, 107, 255, 0.32);
    color: #B4A6FF;
}
.showcase-more-btn { color: var(--text-muted); border-radius: 7px; flex: 0 0 auto; }
.showcase-more-btn:hover { color: var(--accent); background: rgba(34, 211, 238, 0.1); }

/* ── 历史任务 ── */
.history-section { gap: 9px; margin-top: 3px; }
.history-header { padding: 0 2px; }
.history-header h3 {
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}
.history-header h3 .icon-svg { color: var(--accent); }
.history-clear { font-size: 10.5px; padding: 3px 7px; }
.history-clear:hover { background: rgba(251, 113, 133, 0.1); }
.history-list { gap: 6px; padding: 1px 3px 1px 0; }
.history-empty { color: var(--text-muted); font-size: 11.5px; }

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, rgba(110, 170, 255, 0.055), rgba(110, 170, 255, 0.022));
    border: 1px solid var(--border-color);
    border-radius: 11px;
    padding: 9px 9px 9px 13px;
    margin-bottom: 0;
    overflow: hidden;
    transition: border-color .16s, background .16s, box-shadow .16s, transform .16s;
}
.history-item::before {
    height: 100%;
    top: 0;
    transform: none;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--grad);
    opacity: 0.55;
}
.history-item:hover {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.09), rgba(110, 170, 255, 0.04));
    border-color: var(--border-strong);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.38);
    transform: translateX(1px);
}
.history-item:hover::before { opacity: 1; }
.history-item.active {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.14), rgba(124, 107, 255, 0.08));
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(34, 211, 238, 0.1);
}
.history-item.active::before { background: var(--accent); opacity: 1; }

/* 左侧类型图标磁贴（图 / 视频 / 反推 / 润色） */
.history-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(110, 170, 255, 0.09);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: background .16s, border-color .16s, color .16s;
}
.history-icon .icon-svg { width: 14px; height: 14px; }
.history-icon.hi-image   { color: #7FE3F5; background: rgba(34, 211, 238, 0.12);  border-color: rgba(34, 211, 238, 0.24); }
.history-icon.hi-video   { color: #B4A6FF; background: rgba(124, 107, 255, 0.14); border-color: rgba(124, 107, 255, 0.28); }
.history-icon.hi-reverse { color: #FBBF24; background: rgba(251, 191, 36, 0.11);  border-color: rgba(251, 191, 36, 0.26); }
.history-icon.hi-polish  { color: #7FE3F5; background: linear-gradient(150deg, rgba(34, 211, 238, 0.16), rgba(124, 107, 255, 0.14)); border-color: rgba(34, 211, 238, 0.28); }
.history-item:hover .history-icon { border-color: var(--border-strong); }

.history-item { padding: 6px 8px 6px 12px; gap: 9px; flex: 0 0 auto; }
.history-meta { gap: 2px; }
.history-delete { opacity: .5; }

/* ★ 侧栏里的「固定件」永不压缩：否则矮窗口下品牌/模型卡会被 flex 挤扁 */
.sidebar-header,
.model-trigger,
.sidebar-showcase,
.history-header { flex-shrink: 0; }
.history-meta { gap: 5px; }
.history-prompt { font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.history-info { gap: 0; font-size: 10px; }
/* 模型名降级为「安静的元信息」，不再抢镜 */
.history-model-tag {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.04em;
    opacity: 0.75;
}
.history-model-tag::after { content: "·"; margin: 0 6px; opacity: 0.55; }
.history-status-tag { border-radius: 7px; padding: 2px 7px; font-size: 9.5px; }
.history-time {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 9px;
    opacity: 0.55;
}
.history-delete { border-radius: 8px; }
.history-delete:hover { background: rgba(251, 113, 133, 0.12); }

/* ---------- 四、侧边栏底部动作区（图标磁贴 dock） ---------- */
.sb-actions {
    display: flex;
    flex-direction: column;
    gap: 11px;
    flex-shrink: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.sb-group { display: flex; flex-direction: column; gap: 5px; position: relative; }
.sb-glabel {
    font: 600 8.5px/1 var(--mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 3px 2px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.sb-glabel::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-color), transparent); }
.sb-pair { display: flex; gap: 5px; }
.sb-pair > * { flex: 1; }

/* 通用侧栏按钮重皮：左侧图标做成小磁贴 */
.sidebar-logout,
.sidebar-bind-email-btn,
.sidebar-admin-btn {
    display: flex;
    align-items: center;
    gap: 9px;
}
.sidebar-logout,
.sidebar-bind-email-btn {
    background: linear-gradient(180deg, rgba(110, 170, 255, 0.055), rgba(110, 170, 255, 0.025));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12.5px;
    padding: 8px 10px;
    letter-spacing: 0.01em;
    transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
}
.sidebar-logout:hover,
.sidebar-bind-email-btn:hover {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.11), rgba(34, 211, 238, 0.05));
    border-color: rgba(34, 211, 238, 0.4);
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32);
}
/* 图标磁贴 */
.sb-actions .icon-svg {
    width: 24px;
    height: 24px;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 7px;
    background: rgba(110, 170, 255, 0.07);
    color: currentColor;
    opacity: 0.9;
    flex: 0 0 auto;
    transition: background .16s;
}
.sidebar-logout:hover .icon-svg,
.sidebar-bind-email-btn:hover .icon-svg { background: rgba(34, 211, 238, 0.16); }
.sidebar-bind-email-btn { margin: 0; }

/* 主按钮：进入画布（渐变） */
#canvasEntryBtn {
    background: var(--grad);
    color: #04121A !important;
    border: none;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(34, 211, 238, 0.26);
}
#canvasEntryBtn:hover {
    background: var(--grad);
    color: #04121A;
    filter: brightness(1.08);
    box-shadow: 0 10px 28px rgba(34, 211, 238, 0.34);
}
#canvasEntryBtn .icon-svg { background: rgba(4, 18, 26, 0.16); color: #04121A; opacity: 1; }
/* 危险：退出登录 */
#logoutBtn:hover {
    background: linear-gradient(180deg, rgba(251, 113, 133, 0.12), rgba(251, 113, 133, 0.05));
    border-color: rgba(251, 113, 133, 0.42);
    color: var(--color-error);
}
#logoutBtn:hover .icon-svg { background: rgba(251, 113, 133, 0.16); }
/* 管理员 */
.sidebar-admin-btn {
    background: rgba(124, 107, 255, 0.12);
    border: 1px solid rgba(124, 107, 255, 0.4);
    color: #B4A6FF;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 10px;
}
.sidebar-admin-btn .icon-svg { background: rgba(124, 107, 255, 0.16); }
.sidebar-admin-btn:hover { background: rgba(124, 107, 255, 0.22); color: #fff; border-color: rgba(124, 107, 255, 0.6); }

.sidebar-user-info {
    color: var(--text-primary);
    background: linear-gradient(180deg, rgba(110, 170, 255, 0.055), rgba(110, 170, 255, 0.02));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 12.5px;
}
.sidebar-user-info .icon-svg { color: var(--accent); width: 15px; height: 15px; }
.sidebar-email { color: var(--text-muted); font-size: 10.5px; padding: 0 2px; }
.sidebar-tx-section {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.sidebar-tx-header { color: var(--text-muted); }
.sidebar-tx-item .tx-model { color: var(--text-secondary); }
.sidebar-tx-item .tx-time { color: var(--text-muted); }

/* 分组内按钮不再各自带 margin，间距交给 .sb-group 的 gap */
.sb-actions .sidebar-logout,
.sb-actions .sidebar-admin-btn,
.sb-actions .sidebar-bind-email-btn { margin: 0; }
/* ---------- 五、主内容区 ---------- */
.main-content { padding: 18px 22px 22px; }
.workspace { gap: 18px; }

/* ---------- 六、提示词卡（HUD） ---------- */
.input-container {
    background: linear-gradient(180deg, rgba(12, 19, 31, 0.92), rgba(8, 13, 22, 0.92));
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 18px 22px 20px;
}
.input-container:focus-within {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.09), 0 0 30px rgba(34, 211, 238, 0.10);
}
/* HUD 对角逐（左上 + 右下） */
.input-container::before,
.input-container::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(34, 211, 238, 0.6);
    pointer-events: none;
}
.input-container::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
.input-container::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }

/* PROMPT 头 */
.prompt-hud-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.prompt-hud-tag {
    font: 700 10px/1 var(--mono);
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
}
.prompt-hud-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.prompt-hud-hint { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.upload-btn {
    background: rgba(34, 211, 238, 0.04);
    border: 1px dashed rgba(110, 190, 255, 0.3);
    border-radius: 10px;
    color: var(--text-secondary);
}
.upload-btn:hover {
    border-color: rgba(34, 211, 238, 0.6);
    color: var(--accent);
    background: rgba(34, 211, 238, 0.09);
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.18);
}
.upload-btn.has-files {
    border-color: rgba(34, 211, 238, 0.55);
    background: rgba(34, 211, 238, 0.10);
    color: var(--accent);
}

textarea#promptInput {
    min-height: 190px;
    font-size: 14.5px;
    line-height: 1.75;
}
textarea::placeholder { color: var(--text-muted); }

.send-btn {
    background: var(--grad);
    color: #04121A;
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.32);
}
.send-btn:hover { box-shadow: 0 10px 30px rgba(34, 211, 238, 0.46); }
.send-btn .icon-svg { color: #04121A; }

/* 工具条 */
.input-toolbar { border-top: 1px solid var(--border-color); }
.dropdown-btn {
    background: rgba(110, 170, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    color: var(--text-secondary);
}
.dropdown-btn:hover {
    background: rgba(34, 211, 238, 0.09);
    border-color: rgba(34, 211, 238, 0.4);
    color: var(--text-primary);
}
.dropdown-btn .icon-svg { color: var(--accent); }
.current-size-tag {
    color: var(--accent);
    background: rgba(34, 211, 238, 0.09);
    border: 1px solid rgba(34, 211, 238, 0.22);
    font-family: var(--mono);
    font-size: 11.5px;
}
.count-btn span:first-child { color: var(--accent); }

/* 下拉菜单 */
.dropdown-menu {
    background: #0C131F;
    border: 1px solid var(--border-strong);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
.dropdown-item { color: var(--text-secondary); }
.dropdown-item:hover { background: rgba(34, 211, 238, 0.09); color: var(--text-primary); }
.dropdown-item.active { background: rgba(34, 211, 238, 0.13); color: var(--accent); }
.dropdown-group-label { color: var(--text-muted); }
.dropdown-scene { color: var(--text-muted); }
.dropdown-item:hover .dropdown-scene,
.dropdown-item.active .dropdown-scene { color: var(--text-secondary); }

/* 上传提示 / 字数 */
.upload-hint { color: var(--text-muted); }
.warning-text { color: var(--color-error); }
.char-count { color: var(--text-muted); font-family: var(--mono); }
.cost-hint { color: var(--text-muted); }

/* ---------- 七、仪表盘：AI 提示词润色卡（原「创作灵感」位） ---------- */
.dashboard { grid-template-columns: 1fr; gap: 14px; }
.dash-card {
    background: linear-gradient(180deg, rgba(12, 19, 31, 0.9), rgba(8, 13, 22, 0.9));
    border: 1px solid var(--border-color);
    border-radius: 14px;
    position: relative;
}
.dash-card::before,
.dash-card::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1.5px solid rgba(34, 211, 238, 0.45);
    pointer-events: none;
}
.dash-card::before { top: 7px; left: 7px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.dash-card::after { bottom: 7px; right: 7px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.dash-card:hover {
    border-color: var(--border-strong);
    background: linear-gradient(180deg, rgba(14, 22, 36, 0.95), rgba(9, 15, 25, 0.95));
}
.dash-card-title { color: var(--text-primary); }
.dash-card-title .icon-svg { color: var(--accent); }
.dash-refresh-btn { color: var(--text-muted); }
.dash-refresh-btn:hover { color: var(--accent); background: rgba(34, 211, 238, 0.1); }

/* ── 卡头：图标 + 标题/副标题 + 价格 ── */
.polish-card { padding: 16px 18px 18px; }
.polish-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    position: relative;
}
.polish-ic {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, rgba(34, 211, 238, 0.2), rgba(124, 107, 255, 0.18));
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.22), inset 0 1px 8px rgba(255, 255, 255, 0.08);
}
.polish-ic .icon-svg { width: 20px; height: 20px; color: var(--accent); }
.polish-head-txt { min-width: 0; flex: 1; }
.polish-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.25;
    color: var(--text-primary);
}
.polish-sub {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-muted);
    margin-top: 3px;
}

/* 价格角标 */
.polish-price {
    font: 600 10.5px/1 var(--mono);
    letter-spacing: 0.05em;
    color: var(--accent);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 999px;
    padding: 4px 9px;
    white-space: nowrap;
    flex: 0 0 auto;
}

.polish-body { display: flex; flex-direction: column; gap: 11px; }

/* ★ 参考图：横向一行、放在卡片最上面（可多张，最多 3 张） */
.polish-refbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.polish-refadd {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 62px;
    padding: 0 15px;
    flex: 0 0 auto;
    border: 1px dashed rgba(110, 190, 255, 0.32);
    border-radius: 11px;
    background: rgba(34, 211, 238, 0.04);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .18s, background .18s, color .18s;
}
.polish-refadd .icon-svg { width: 17px; height: 17px; color: var(--accent); opacity: .9; }
.polish-refadd:hover {
    border-color: rgba(34, 211, 238, 0.6);
    background: rgba(34, 211, 238, 0.09);
    color: var(--accent);
}
.polish-reflist { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.polish-ref {
    position: relative;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.45);
    background: #000;
}
.polish-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polish-ref-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    background: rgba(0, 0, 0, 0.66);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    display: grid;
    place-items: center;
}
.polish-ref-del:hover { background: var(--color-error); }
.polish-refbar .polish-grab-btn { margin-left: auto; }

/* 想法输入：高度由 JS 自动拉伸（同画布提示词框），不给手动拖拽手柄 */
.polish-idea {
    width: 100%;
    box-sizing: border-box;
    min-height: 56px;
    max-height: 260px;
    resize: none;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-color);
    border-radius: 11px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.6;
    padding: 10px 12px;
    font-family: inherit;
    transition: border-color .18s, box-shadow .18s;
}
.polish-idea::placeholder { color: var(--text-muted); }
.polish-idea:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

/* 运行按钮 + 提示 */
.polish-actions { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.polish-run-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: none; cursor: pointer;
    background: var(--grad);
    color: #04121A;
    font-size: 13px; font-weight: 700;
    padding: 9px 18px;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(34, 211, 238, 0.26);
    transition: filter .18s, box-shadow .18s, opacity .18s;
    white-space: nowrap;
    font-family: inherit;
}
.polish-run-btn:hover { filter: brightness(1.08); box-shadow: 0 10px 28px rgba(34, 211, 238, 0.4); }
.polish-run-btn:disabled { opacity: .6; cursor: not-allowed; filter: none; }
.polish-run-btn .icon-svg { color: #04121A; }

/* 「用已上传的图」次要按钮 */
.polish-grab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-strong);
    background: rgba(110, 170, 255, 0.055);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background .16s, border-color .16s, color .16s;
}
.polish-grab-btn .icon-svg { width: 15px; height: 15px; color: var(--accent); }
.polish-grab-btn:hover:not(:disabled) {
    background: rgba(34, 211, 238, 0.11);
    border-color: rgba(34, 211, 238, 0.42);
    color: var(--text-primary);
}
.polish-grab-btn:disabled { opacity: .42; cursor: not-allowed; }
.polish-grab-btn:disabled .icon-svg { opacity: .5; }

.polish-tip { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; margin: 0; }

/* 结果 */
.polish-result {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    padding: 10px 12px 12px;
}
.polish-result-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 9px;
}
.polish-result-tag {
    font: 700 10px/1 var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}
.polish-result-tools { display: flex; gap: 6px; }
.polish-mini-btn {
    border: 1px solid var(--border-color);
    background: rgba(110, 170, 255, 0.05);
    color: var(--text-secondary);
    font-size: 11.5px;
    padding: 4px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .16s;
    font-family: inherit;
}
.polish-mini-btn:hover { background: rgba(34, 211, 238, 0.1); border-color: rgba(34, 211, 238, 0.4); color: var(--text-primary); }
.polish-mini-btn.primary {
    background: var(--grad); color: #04121A; border: none; font-weight: 700;
    box-shadow: 0 6px 16px rgba(34, 211, 238, 0.22);
}
.polish-mini-btn.primary:hover { filter: brightness(1.08); }
.polish-result-text {
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}
/* 降级提示（参考图未识别） */
.polish-warn {
    font-size: 11.5px;
    line-height: 1.5;
    color: #FBBF24;
    background: rgba(251, 191, 36, 0.09);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 9px;
}

/* ---------- 八、右侧结果区 + 空态 ---------- */
.preview-panel {
    background: linear-gradient(180deg, rgba(12, 19, 31, 0.72), rgba(8, 13, 22, 0.72));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    gap: 12px;
}
.preview-panel::before {
    content: "结果预览 / OUTPUT";
    font: 600 9.5px/1 var(--mono);
    letter-spacing: 0.16em;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0 2px;
    flex: 0 0 auto;
}
.preview-placeholder {
    position: relative;
    overflow: hidden;
    background:
        repeating-linear-gradient(0deg, transparent 0 23px, rgba(110, 190, 255, 0.05) 23px 24px),
        repeating-linear-gradient(90deg, transparent 0 23px, rgba(110, 190, 255, 0.05) 23px 24px),
        rgba(4, 8, 14, 0.55);
    border: 1px dashed rgba(110, 190, 255, 0.22);
    border-radius: 14px;
}
.preview-placeholder::after {
    content: "";
    position: absolute;
    left: 0; right: 0; height: 90px; top: -90px;
    background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.12), transparent);
    animation: ph-scan 3.6s linear infinite;
    pointer-events: none;
}
@keyframes ph-scan { 0% { top: -90px; } 100% { top: 100%; } }

.placeholder-content { color: var(--text-muted); position: relative; z-index: 1; }
.placeholder-content .icon-svg { display: none; }
.ph-ring {
    width: 66px; height: 66px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.32);
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 30px rgba(34, 211, 238, 0.16), 0 0 24px rgba(34, 211, 238, 0.12);
}
.ph-core {
    width: 24px; height: 24px;
    border: 2px solid var(--accent);
    border-radius: 7px;
    display: block;
    opacity: 0.9;
}
.placeholder-content .ph-title { font-size: 13px; color: var(--text-secondary); margin: 0; }
.placeholder-content .ph-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; opacity: 1; }
.placeholder-content p { opacity: 1; }

/* 结果 / spinner */
.spinner { border-color: rgba(34, 211, 238, 0.2); }
.spinner::before { border-top-color: var(--accent); border-right-color: var(--accent2); }
.result-loading p { color: var(--text-secondary); }

/* ---------- 九、模型选择弹窗 ---------- */
.model-select-panel {
    background: linear-gradient(180deg, #0A1018, #080D16);
    border: 1px solid var(--border-strong);
}
.model-select-header h2 { color: var(--text-primary); }
.model-select-group-title { color: var(--text-muted); }
.ms-card {
    background: rgba(110, 170, 255, 0.03);
    border: 1px solid var(--border-color);
}
.ms-card:hover { background: rgba(110, 170, 255, 0.07); border-color: var(--border-strong); }
.ms-card.active { background: rgba(34, 211, 238, 0.10); border-color: rgba(34, 211, 238, 0.42); }
.ms-check { color: var(--accent); }

/* ---------- 十、提示词反推区（对齐新主题） ---------- */
.reverse-upload-zone {
    background: rgba(34, 211, 238, 0.03);
    border: 1px dashed rgba(110, 190, 255, 0.28);
}
.reverse-upload-zone:hover { border-color: rgba(34, 211, 238, 0.6); background: rgba(34, 211, 238, 0.07); }
.reverse-send-btn { background: var(--grad); color: #04121A; }
.reverse-level-segmented { background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border-color); }
.level-tab.active { background: rgba(34, 211, 238, 0.14); color: var(--accent); border-color: rgba(34, 211, 238, 0.4); }

/* ---------- 十一、弹窗 / 通用 ---------- */
.confirm-dialog {
    background: linear-gradient(180deg, #0C131F, #080D16);
    border: 1px solid var(--border-strong);
}
.confirm-dialog h3 { color: var(--text-primary); }
.admin-panel, .reset-cred-dialog {
    background: linear-gradient(180deg, #0A1018, #080D16);
    border: 1px solid var(--border-strong);
}

/* ---------- 十二、移动端（侧栏是抽屉，别被上面的基础规则压掉内边距） ---------- */
@media (max-width: 768px) {
    .sidebar { width: 272px; padding: 16px 13px 12px; }
    .sidebar-top { gap: 13px; }
    .sidebar-header h2 { font-size: 11px; }
    .sb-actions { padding-top: 14px; }
    .sb-actions .sidebar-logout,
    .sb-actions .sidebar-admin-btn,
    .sb-actions .sidebar-bind-email-btn { margin: 0; padding: 10px; font-size: 13px; }
    /* 移动端润色卡纵向排布：参考图一行横向滚动，输入框占满宽 */
    .polish-card { padding: 14px 15px 16px; }
    .polish-head { flex-wrap: wrap; }
    .polish-sub { font-size: 11px; }
    .polish-refbar { gap: 8px; }
    .polish-refadd { height: 58px; padding: 0 12px; font-size: 12px; }
    .polish-ref { width: 58px; height: 58px; flex: 0 0 58px; }
    .polish-refbar .polish-grab-btn { margin-left: 0; width: 100%; justify-content: center; }
    .polish-idea { max-height: 200px; }
    .polish-actions { flex-direction: column; align-items: stretch; }
    .polish-run-btn { width: 100%; justify-content: center; }
    .polish-tip { text-align: center; }
}


/* ---------- 十三、全部历史：文本 / 视频卡片 + 详情弹窗 ---------- */

/* 文本记录缩略（AI 助手产出）——绝不参与图片加载 */
.hist-thumb-txt {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 14px;
    text-align: center;
    background:
        repeating-linear-gradient(0deg, transparent 0 21px, rgba(110, 190, 255, 0.05) 21px 22px),
        linear-gradient(180deg, rgba(12, 19, 31, 0.92), rgba(8, 13, 22, 0.92));
}
.hist-thumb-txt .icon-svg { width: 22px; height: 22px; color: var(--accent); opacity: .9; }
.hist-thumb-txt b {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hist-thumb-txt i {
    font: 600 9px/1 var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-style: normal;
}

/* 视频：角标 + 中央播放按钮 */
.hist-vid-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #B4A6FF;
    font: 700 10px/1.5 var(--mono);
    letter-spacing: 0.06em;
}
.hist-play-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .16s, transform .16s, opacity .16s;
}
.hist-play-btn svg { width: 20px; height: 20px; }
.hist-play-btn:hover { background: rgba(34, 211, 238, 0.58); transform: translate(-50%, -50%) scale(1.07); }
.hist-play-btn.is-playing { opacity: 0; }
.hist-thumb:hover .hist-play-btn.is-playing { opacity: .8; }
.hist-thumb-vid { cursor: pointer; }

/* meta 行的类型小标 */
.hist-typetag {
    display: inline-block;
    margin-right: 6px;
    padding: 0 5px;
    border-radius: 5px;
    font: 600 9.5px/1.6 var(--mono);
    letter-spacing: 0.04em;
}
.hist-typetag.is-img { color: #7FE3F5; background: rgba(34, 211, 238, 0.12); }
.hist-typetag.is-vid { color: #B4A6FF; background: rgba(124, 107, 255, 0.16); }
.hist-typetag.is-txt { color: #FBBF24; background: rgba(251, 191, 36, 0.13); }

/* ---- 详情弹窗 ---- */
.histd-box {
    background: linear-gradient(180deg, rgba(12, 19, 31, 0.985), rgba(8, 13, 22, 0.985));
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    max-width: 780px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 22px 24px 20px;
}
.histd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.histd-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text-primary); }
.histd-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 8px;
    transition: color .16s, background .16s;
}
.histd-close:hover { color: var(--text-primary); background: rgba(110, 170, 255, 0.1); }
.histd-media { margin-bottom: 14px; }
.histd-media .histd-img,
.histd-media .histd-video {
    width: 100%;
    max-height: 440px;
    border-radius: 12px;
    background: #000;
    display: block;
    object-fit: contain;
}
.histd-loading,
.histd-empty {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.2);
}
.histd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.histd-cell {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 0;
}
.histd-cell-full { grid-column: 1 / -1; }
.histd-label {
    font: 600 10px/1 var(--mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.histd-val { font-size: 13px; font-weight: 600; color: var(--text-primary); word-break: break-word; }
.histd-val.is-err { color: #FB7185; }
.histd-prompt {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
}
.histd-prompt-txt {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-height: 130px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.histd-actions { display: flex; gap: 10px; }
.histd-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    background: rgba(110, 170, 255, 0.055);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: background .16s, border-color .16s, color .16s;
}
.histd-btn:hover { background: rgba(34, 211, 238, 0.11); border-color: rgba(34, 211, 238, 0.4); color: var(--text-primary); }
.histd-btn.is-primary {
    background: var(--grad);
    color: #04121A;
    border: none;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(34, 211, 238, 0.24);
}
.histd-btn.is-primary:hover { filter: brightness(1.08); color: #04121A; }
.histd-asst { margin: 0; max-width: none; background: rgba(0, 0, 0, 0.28); border-color: var(--border-color); }

@media (max-width: 768px) {
    .histd-box { padding: 18px 16px 16px; }
    .histd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .histd-actions { flex-wrap: wrap; }
    .histd-media .histd-img,
    .histd-media .histd-video { max-height: 300px; }
}

/* ---------- 十四、矮窗口（用户浏览器可视高度只有 ~525px）----------
   原 bug：.sidebar 是 flex + overflow:hidden、.sidebar-top是 flex:1，
   高度不够时品牌/模型卡/历史条目会被 flex 一起压缩 —— 历史每条 33px 被压到 8~18px，文字互相重叠。
   规则：① 固定件 flex-shrink:0；② 历史条目 flex:0 0 auto；③ 矮窗口改成「侧栏自己滚」，绝不硬挤。 */
@media (max-height: 760px) {
    .sidebar { overflow-y: auto; overscroll-behavior: contain; gap: 10px; padding: 10px 10px 8px; }
    .sidebar-top { flex: 0 0 auto; overflow: visible; gap: 10px; }
    .sidebar-header h2 { display: none; }            /* 「释放你的创造力」 */
    .sb-glabel { display: none; }                    /* 导航 / 账户 / 系统 分节标签 */
    .sb-actions { gap: 6px; padding-top: 8px; flex-shrink: 0; }
    .sb-group { gap: 4px; }
    .sidebar-logout,
    .sidebar-bind-email-btn,
    .sidebar-admin-btn { padding: 7px 9px; font-size: 12px; }
    .sidebar-user-info { padding: 5px 9px; font-size: 12px; }
    .sb-actions .icon-svg { width: 22px; height: 22px; }
    .history-list { flex: 0 0 auto; max-height: 46vh; min-height: 96px; overflow-y: auto; }
}

/* ---------- 十五、AI 提示词润色：左右分栏（左输入 / 右 AI 对话预览） ---------- */
.polish-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 13px;
    align-items: stretch;
}
.polish-in,
.polish-out {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 11px 11px;
    background: rgba(0, 0, 0, 0.2);
}
.polish-out {
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(124, 107, 255, 0.09), transparent 60%),
        linear-gradient(180deg, rgba(34, 211, 238, 0.05), rgba(8, 13, 22, 0.28));
}
.polish-side-head { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.polish-side-tag {
    font: 700 9.5px/1 var(--mono);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.polish-side-tag.is-you { color: var(--text-secondary); background: rgba(110, 170, 255, 0.09); border: 1px solid var(--border-color); }
.polish-side-tag.is-ai { color: var(--accent); background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.28); }
.polish-out-hint { margin-left: auto; font-size: 10.5px; color: var(--text-muted); }
.polish-out-hint.is-busy { color: var(--accent); }

/* 左栏：加图磁贴收成方形，给它腾地方 */
.polish-split .polish-refadd {
    width: 62px;
    height: 62px;
    padding: 0;
    flex-direction: column;
    gap: 2px;
    font-size: 10.5px;
    letter-spacing: 0.02em;
}
.polish-split .polish-refadd .icon-svg { width: 18px; height: 18px; }
.polish-split .polish-idea { flex: 1 1 auto; min-height: 96px; }
.polish-in .polish-actions { gap: 8px; }
.polish-in .polish-actions .polish-run-btn { flex: 1 1 auto; padding: 9px 12px; }
.polish-in .polish-actions .polish-grab-btn { flex: 0 1 auto; padding: 9px 12px; }

/* 右栏：对话流 */
.polish-chat {
    flex: 1 1 auto;
    min-height: 172px;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: rgba(110, 170, 255, 0.22) transparent;   /* ★ 沉浸式：不写这句会掉回系统浅色粗条 */
}
.polish-chat-empty {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.6;
}
.polish-chat-empty .icon-svg { width: 22px; height: 22px; color: var(--accent); opacity: .55; margin-bottom: 7px; }
.polish-chat-empty p { margin: 0; }

.polish-bubble { display: flex; gap: 7px; max-width: 100%; cursor: pointer; }
.polish-bubble.is-user { align-self: flex-end; flex-direction: column; align-items: flex-end; max-width: 90%; cursor: pointer; }
.polish-bubble.is-ai { align-self: flex-start; align-items: flex-start; max-width: 100%; }
.polish-avatar {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, rgba(34, 211, 238, 0.22), rgba(124, 107, 255, 0.2));
    border: 1px solid rgba(34, 211, 238, 0.3);
}
.polish-avatar .icon-svg { width: 12px; height: 12px; color: var(--accent); }
.polish-bubble-txt {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 11px;
    padding: 8px 11px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.26);
}
.polish-bubble.is-user .polish-bubble-txt {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
}
.polish-bubble.is-ai .polish-bubble-txt { flex: 1 1 auto; min-width: 0; }
.polish-bubble.is-on .polish-bubble-txt {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.22);
}
.polish-bubble.is-err .polish-bubble-txt {
    color: #FDA4AF;
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.34);
}
.polish-bubble-imgs { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.polish-bubble-imgs img {
    width: 40px; height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(34, 211, 238, 0.4);
    display: block;
}
.polish-bubble-ph { color: var(--text-muted); font-style: normal; }

/* 打字动效 */
/* ★ AI 提示词润色的「实时思考块」（推理模型）：正文前展开滚动，正文到达后折叠 */
.polish-think { margin: 7px 0 0; max-width: 100%; }
.polish-think-h { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8b95a8; margin-bottom: 5px; }
.polish-think-dot { width: 5px; height: 5px; border-radius: 50%; background: #6aa2ff; flex: none;
  animation: polishThinkDot 1.1s ease-in-out infinite; }
@keyframes polishThinkDot { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
.polish-think-b { max-height: 180px; overflow-y: auto; font-size: 12px; line-height: 1.65; color: #8f9bb0;
  background: rgba(122, 148, 196, .08); border-left: 2px solid rgba(122, 148, 196, .3); border-radius: 6px;
  padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }
.polish-think.is-folded .polish-think-b { display: none; }
.polish-think.is-folded .polish-think-h { opacity: .85; }

.polish-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px;
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.26);
    border: 1px solid var(--border-color);
}
.polish-typing i {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    opacity: .3;
    animation: polishDot 1.1s infinite ease-in-out;
}
.polish-typing i:nth-child(2) { animation-delay: .18s; }
.polish-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes polishDot {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

/* 版本条：未润色 / 润色版 + 复制 / 重新润色 / 填入提示词 */
.polish-verbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px dashed var(--border-color);
    padding-top: 9px;
}
.polish-vers {
    display: inline-flex;
    padding: 2px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}
.polish-ver-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 7px;
    transition: background .16s, color .16s;
}
.polish-ver-btn:hover { color: var(--text-secondary); }
.polish-ver-btn.is-on { background: rgba(34, 211, 238, 0.16); color: var(--accent); }
.polish-ver-tools { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }

/* 降级提示移到分栏下方 */
.polish-body > .polish-warn { margin-bottom: 0; }

@media (max-width: 900px) {
    .polish-split { grid-template-columns: minmax(0, 1fr); }
    .polish-chat { max-height: 260px; min-height: 140px; }
    .polish-ver-tools { margin-left: 0; width: 100%; }
    .polish-ver-tools .polish-mini-btn { flex: 1 1 auto; }
}

/* 卡片自身宽度不够（用户窗口窄 / 三栏挤压）→ 自动改为上下堆叠。
   用容器查询而不是媒体查询：真正的约束是「卡片有多宽」，不是「屏幕有多宽」。 */
.polish-card { container-type: inline-size; }
@container (max-width: 640px) {
    .polish-split { grid-template-columns: minmax(0, 1fr); gap: 11px; }
    .polish-chat { max-height: 260px; min-height: 150px; }
    .polish-in .polish-actions .polish-run-btn { flex: 1 1 auto; }
    .polish-in .polish-actions .polish-grab-btn { flex: 1 1 auto; }
    .polish-ver-tools { margin-left: 0; width: 100%; }
    .polish-ver-tools .polish-mini-btn { flex: 1 1 auto; }
}

/* ---------- 十六、主站下拉：沉浸式（玻璃面板 + 冷光） ---------- */
.dropdown-btn {
    background: linear-gradient(180deg, rgba(20, 30, 48, 0.9), rgba(12, 19, 31, 0.92));
    border: 1px solid rgba(110, 170, 255, 0.16);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 2px 8px rgba(0, 0, 0, 0.26);
    transition: border-color .18s, box-shadow .18s, color .18s, background .18s;
}
.dropdown-btn:hover {
    background: linear-gradient(180deg, rgba(26, 38, 58, 0.94), rgba(15, 23, 37, 0.94));
    border-color: rgba(34, 211, 238, 0.42);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.dropdown-btn .icon-svg { color: var(--accent); opacity: .92; }
.dropdown-btn .icon-chevron { opacity: .65; transition: transform .25s ease, opacity .18s; }
/* 展开态：用 :has() 判断，无需改 JS；老浏览器不支持时只是少一层高亮 */
.dropdown:has(.dropdown-menu.show) .dropdown-btn,
.dropdown.open .dropdown-btn {
    border-color: rgba(34, 211, 238, 0.55);
    color: var(--accent);
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.13), rgba(124, 107, 255, 0.09));
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.dropdown:has(.dropdown-menu.show) .dropdown-btn .icon-chevron,
.dropdown.open .dropdown-btn .icon-chevron { transform: rotate(180deg); opacity: 1; }

.dropdown-menu {
    background: linear-gradient(180deg, rgba(14, 22, 36, 0.975), rgba(9, 15, 25, 0.985));
    border: 1px solid rgba(110, 170, 255, 0.2);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(34, 211, 238, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    max-width: min(340px, calc(100vw - 36px));
    scrollbar-width: thin;
    scrollbar-color: rgba(110, 170, 255, 0.22) transparent;
}
.dropdown-menu.show { animation: dropdownIn .18s cubic-bezier(.2, .9, .3, 1); }
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-7px) scale(.985); }
    to { opacity: 1; transform: none; }
}
.dropdown-item {
    border-radius: 9px;
    padding: 9px 12px;
    margin: 1px 0;
    color: var(--text-secondary);
    transition: background .15s, color .15s, box-shadow .15s;
}
.dropdown-item:hover {
    background: rgba(34, 211, 238, 0.1);
    color: var(--text-primary);
}
.dropdown-item.active {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.17), rgba(124, 107, 255, 0.12));
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.26);
}
.dropdown-item.active .dropdown-scene { color: rgba(34, 211, 238, 0.72); }
.dropdown-scene { color: var(--text-muted); font-size: 11px; }
.dropdown-item:hover .dropdown-scene { color: var(--text-secondary); }
.dropdown-group-label {
    padding: 10px 12px 5px;
    font: 700 9.5px/1 var(--mono);
    letter-spacing: 0.16em;
    color: var(--text-muted);
    opacity: .85;
}
.dropdown-group-label:first-child { padding-top: 8px; }

/* ---------- 十七、参考图预览：紧凑横向条（不再撑坏下方布局） ---------- */
/* 原来 106px 大方块 + 自动换行：传 2 张就占 136px，传 6 张直接吃掉半屏，把下面的润色卡挤下去。
   现在固定一行、小图、超出横向滚动 —— 高度恒定，布局永远不动。 */
.image-preview-area { padding: 10px 12px; border-radius: 14px; }
.preview-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 9px;
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(110, 170, 255, 0.22) transparent;
    overscroll-behavior-x: contain;
}
.preview-item {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    border-width: 1px;
    border-radius: 12px;
}
.preview-item:hover { box-shadow: 0 0 16px rgba(34, 211, 238, 0.3); transform: translateY(-2px); }
.preview-item .preview-remove { width: 19px; height: 19px; top: 3px; right: 3px; }
.preview-item .preview-remove .icon-svg { width: 9px; height: 9px; }
.preview-item .preview-label { font-size: 9px; padding: 2px 0; }
.preview-item.preview-audio .audio-icon .icon-svg,
.preview-item.preview-audio svg { width: 20px; height: 20px; }

/* ---------- 十八、锁住高度：滚动只发生在面板内部，卡片不再越拉越长 ---------- */
.control-panel { overscroll-behavior: contain; }
.input-wrapper .upload-btn { justify-content: center; }
/* 左栏输入框不再被右栏「拉高」—— 高度只跟自己的内容走（自动拉伸，上限 200） */
.polish-split .polish-idea { flex: 0 1 auto; min-height: 84px; max-height: 200px; }
.polish-chat { min-height: 132px; max-height: 236px; }
.polish-split .polish-refadd { justify-content: center; }

/* ---------- 十九、提示词反推区（重建：HUD 卡片 + 冷光） ---------- */
.reverse-prompt-area { display: block; }
.rev-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 16px 17px 18px;
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(34, 211, 238, 0.07), transparent 58%),
        linear-gradient(180deg, rgba(12, 19, 31, 0.74), rgba(8, 13, 22, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
}
.rev-card::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.55), transparent);
}
.rev-head { display: flex; align-items: center; gap: 11px; }
.rev-ic {
    flex: 0 0 38px;
    width: 38px; height: 38px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(124, 107, 255, 0.2));
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
}
.rev-ic .icon-svg { width: 19px; height: 19px; color: var(--accent); }
.rev-head-txt { flex: 1 1 auto; min-width: 0; }
.rev-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.rev-sub { margin-top: 2px; font-size: 11px; line-height: 1.45; color: var(--text-muted); }
.rev-price {
    flex: 0 0 auto;
    font: 600 10.5px/1 var(--mono);
    letter-spacing: 0.05em;
    color: var(--accent);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 999px;
    padding: 5px 10px;
    white-space: nowrap;
}

.rev-body { display: flex; flex-direction: column; gap: 11px; }
.rev-stage { position: relative; }

/* 上传区 */
.rev-drop {
    min-height: 148px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    cursor: pointer;
    border: 1px dashed rgba(110, 190, 255, 0.3);
    border-radius: 14px;
    background: rgba(34, 211, 238, 0.035);
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.rev-drop:hover {
    border-color: rgba(34, 211, 238, 0.6);
    background: rgba(34, 211, 238, 0.075);
    box-shadow: inset 0 0 42px rgba(34, 211, 238, 0.07);
}
.rev-drop-ring {
    width: 48px; height: 48px;
    margin-bottom: 5px;
    border-radius: 50%;
    display: grid; place-items: center;
    border: 1px solid rgba(34, 211, 238, 0.32);
    box-shadow: inset 0 0 22px rgba(34, 211, 238, 0.14), 0 0 18px rgba(34, 211, 238, 0.1);
    transition: transform .22s;
}
.rev-drop:hover .rev-drop-ring { transform: translateY(-2px) scale(1.05); }
.rev-drop-ring .icon-svg { width: 21px; height: 21px; color: var(--accent); }
.rev-drop-title { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.rev-drop-hint { margin: 0; font-size: 11px; color: var(--text-muted); }

/* 预览 */
.rev-preview {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    background: #000;
    animation: fadeInUp .3s ease-out;
}
.rev-preview img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.rev-remove {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px;
    border: none; border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff; font-size: 17px; line-height: 1;
    display: grid; place-items: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .16s, transform .16s;
}
.rev-remove:hover { background: #e11d48; transform: scale(1.08); }
.rev-preview-bar {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 6px 12px;
    font: 600 10.5px/1 var(--mono);
    letter-spacing: 0.1em;
    color: var(--accent);
    background: linear-gradient(180deg, transparent, rgba(4, 8, 14, 0.88));
}

/* 等级分段 */
.rev-levels {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-color);
}
.rev-levels input[type="radio"] { display: none; }
.rev-levels .level-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px 4px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background .18s, color .18s, box-shadow .18s;
}
.rev-levels .level-tab svg { width: 14px; height: 14px; opacity: .6; transition: opacity .18s; }
.rev-levels .level-tab:hover:not(.active) { color: var(--text-secondary); background: rgba(110, 170, 255, 0.07); }
.rev-levels .level-tab:hover:not(.active) svg { opacity: .9; }
.rev-levels .level-tab.active { transform: none; box-shadow: none; }
.rev-levels .level-tab.active svg { opacity: 1; }
.rev-levels .level-tab[data-level="normal"].active { background: linear-gradient(135deg, #22D3EE, #5AC8FA); color: #04121A; }
.rev-levels .level-tab[data-level="expert"].active { background: linear-gradient(135deg, #7C6BFF, #A78BFA); color: #fff; }
.rev-levels .level-tab[data-level="master"].active { background: linear-gradient(135deg, #F59E0B, #FBBF24); color: #1a1a1a; }
.rev-levels .level-tab[data-level="super"].active { background: linear-gradient(135deg, #F43F5E, #F97316); color: #fff; }

.rev-hint {
    margin: 0;
    padding: 8px 11px;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-muted);
    background: rgba(34, 211, 238, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 9px;
}

/* 主按钮 */
.rev-run {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border: none;
    border-radius: 12px;
    background: var(--grad);
    color: #04121A;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(34, 211, 238, 0.25);
    transition: filter .18s, box-shadow .18s;
}
.rev-run:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 12px 32px rgba(34, 211, 238, 0.35); }
.rev-run:disabled { opacity: .5; cursor: not-allowed; filter: none; box-shadow: none; }
.rev-run .icon-svg { width: 19px; height: 19px; }

/* 结果 */
.rev-result {
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 12px;
    overflow: hidden;
    animation: fadeInUp .3s ease-out;
}
.rev-result-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent);
}
.rev-result-head .icon-svg { width: 15px; height: 15px; }
.rev-result-text {
    padding: 12px 14px;
    max-height: 240px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}
.rev-use {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: calc(100% - 28px);
    margin: 0 14px 14px;
    padding: 10px;
    border: 1px solid rgba(34, 211, 238, 0.32);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(124, 107, 255, 0.14));
    color: var(--accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
}
.rev-use:hover { background: linear-gradient(135deg, rgba(34, 211, 238, 0.26), rgba(124, 107, 255, 0.2)); }
.rev-use .icon-svg { width: 15px; height: 15px; }

/* 错误 */
.rev-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
    border-radius: 12px;
    background: rgba(244, 63, 94, 0.09);
    border: 1px solid rgba(244, 63, 94, 0.32);
}
.rev-error .icon-svg { width: 22px; height: 22px; color: #FB7185; }
.rev-error p { margin: 0; font-size: 12.5px; color: #FDA4AF; }
.rev-retry {
    padding: 7px 16px;
    border: 1px solid rgba(244, 63, 94, 0.4);
    border-radius: 9px;
    background: transparent;
    color: #FDA4AF;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background .16s;
}
.rev-retry:hover { background: rgba(244, 63, 94, 0.14); }

/* 价格表节点保持隐藏（已并入顶部卡片/面板） */
.reverse-right { display: none; }

/* 右侧预览区的「等待反推」占位 */
.reverse-preview-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
    min-height: 240px;
    text-align: center;
    color: var(--text-muted);
}
.reverse-preview-waiting .icon-svg { width: 30px; height: 30px; color: var(--accent); opacity: .55; }
.reverse-preview-waiting p { margin: 0; font-size: 12.5px; line-height: 1.7; }
.reverse-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    height: 100%;
    min-height: 240px;
    color: var(--text-secondary);
}
.reverse-preview-loading p { margin: 0; font-size: 13px; }

@media (max-width: 768px) {
    .rev-card { padding: 13px 13px 15px; }
    .rev-head { flex-wrap: wrap; }
    .rev-drop { min-height: 128px; }
    .rev-levels .level-tab { padding: 8px 2px; font-size: 11.5px; }
}

/* 反推等待/加载占位铺满右侧预览面板并垂直居中 */
.preview-panel .result-area { flex: 1 1 auto; display: flex; flex-direction: column; }
.preview-panel .result-images { flex: 1 1 auto; display: flex; flex-direction: column; }
.reverse-preview-waiting,
.reverse-preview-loading { height: auto; flex: 1 1 auto; }

/* ==========================================================================
   全站公告弹窗（登录后弹出；点「已阅读」该账号永久不再弹）
   与后台 admin.html 的公告共用后端接口 /api/announcement/*
   ========================================================================== */
.ann-mask {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(3, 6, 12, 0.66);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ann-card {
    width: min(520px, 92vw); max-height: 80vh;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, #0C131F, #080D16);
    border: 1px solid var(--border-strong, rgba(110,190,255,.22));
    border-radius: var(--radius-lg, 20px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(34, 211, 238, 0.08);
    overflow: hidden;
    animation: annPop .25s ease-out;
}
@keyframes annPop { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.ann-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 0; }
.ann-tag {
    font-size: 11px; font-weight: 600; letter-spacing: .5px;
    color: #05121A; background: var(--grad, linear-gradient(135deg,#22D3EE,#7C6BFF));
    padding: 3px 11px; border-radius: 99px;
}
.ann-date { margin-left: auto; font-size: 11px; color: var(--text-muted, #5B6C88); font-family: var(--mono, monospace); }
.ann-title { padding: 13px 22px 0; font-size: 16.5px; font-weight: 600; color: var(--text-primary, #E9F2FF); line-height: 1.45; }
.ann-body {
    padding: 10px 22px 6px; overflow-y: auto;
    font-size: 13.5px; line-height: 1.8; color: var(--text-secondary, #93A7C4);
}
.ann-body p { margin: 0 0 10px; }
.ann-body p:last-child { margin-bottom: 0; }
.ann-body b, .ann-body strong { color: var(--text-primary, #E9F2FF); }
.ann-body i, .ann-body em { color: var(--text-primary, #E9F2FF); }
.ann-body a { color: var(--accent, #22D3EE); text-decoration: none; border-bottom: 1px solid rgba(34, 211, 238, 0.35); }
.ann-body a:hover { border-bottom-color: var(--accent, #22D3EE); }
.ann-body ul, .ann-body ol { padding-left: 22px; margin: 0 0 10px; }
.ann-body code { font-family: var(--mono, monospace); font-size: 12.5px; color: var(--accent3, #38BDF8); }
.ann-foot { display: flex; justify-content: flex-end; padding: 16px 22px 20px; }
.ann-btn {
    font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
    padding: 10px 26px; border: 0; border-radius: 99px;
    background: var(--grad, linear-gradient(135deg,#22D3EE,#7C6BFF)); color: #05121A;
    transition: filter .18s, transform .18s;
}
.ann-btn:hover { filter: brightness(1.08); }
.ann-btn:active { transform: scale(0.98); }

/* ═══════════ PROMPT 卡片 · 合规提示（2026-10-14）═══════════
   位置：PROMPT 卡片最顶部、**那条渐变横线之上**（用户明确要求"放横线上面，不是下面"）。
   形态：与右上角「描述越详细，出图越接近」**同一色号**（`var(--text-muted)`）、同字号（11px）、
   无底色、无图标 —— 一行安静的说明文字；关键词只加粗、不提亮。
   （先做过通栏版：红带横跨整屏、观感太抢、还像"盖住"侧栏和右栏 → 已废弃。） */
.legal-note {
    margin: 0 0 4px;
    font-size: 11px; line-height: 1.4;
    color: var(--text-muted);
    text-align: center;
    user-select: none;
}
.legal-note b { color: inherit; font-weight: 600; }

/* 手机上更收敛些，正常折行 */
@media (max-width: 768px) {
    .legal-note { font-size: 10.5px; line-height: 1.5; margin-bottom: 3px; }
}

/* ═══ 手机端合规提示字号回调（2026-10-14 二次调整）═══
   上面那条把它压到了 10.5px —— 但这是一段 60+ 字、需要用户认真看的封号/取证警示，
   手机上读着费劲。统一回到 11px（与桌面一致）、行高 1.5。 */
@media (max-width: 768px) {
    .legal-note { font-size: 11px; line-height: 1.5; }
}

/* ═══ 修正：「润色对话区」的窄屏高度调整此前是死规则（2026-10-14）═══
   本文件后段有一条**同权重、无媒体查询**的 `.polish-chat{min-height:132px;max-height:236px}`，
   源序在后 → 把 ≤900px 与容器 ≤640px 的调优整个盖掉了（调了没反应）。
   这里在文件末尾重叙一遍，保证「越窄越矮」真正生效。 */
@media (max-width: 900px) {
    .polish-chat { min-height: 140px; max-height: 260px; }
}
@container (max-width: 640px) {
    .polish-chat { min-height: 150px; max-height: 260px; }
}

/* ═══════════ 主站 · 透明底开关（2026-10-14）═══════════
   位置：PROMPT 卡片工具栏「比例 · 分辨率 · 尺寸 · 张数」之后。
   显示规则：只有 models.json 标了 transparent 的模型（GPT-image-2.5 Plus / Pro 4K）才显示；
            **默认关闭** —— 用户选了 Plus 但只想出普通图时完全不受影响。
   样式与旁边的 .dropdown-btn 对齐（同 padding / 圆角 / 字号），不突兀。 */
.trans-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 12px; font-family: inherit; line-height: 1;
    cursor: pointer; white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
/* ★ 必须写：上面的 display:inline-flex 优先级高于 UA 的 [hidden]{display:none} */
.trans-toggle[hidden] { display: none; }
.trans-toggle .trans-dot {
    width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: rgba(255, 255, 255, 0.22);
    transition: background .18s ease, box-shadow .18s ease;
}
.trans-toggle:hover { background: rgba(255, 255, 255, .07); color: var(--text-primary); }
.trans-toggle.on {
    color: #7FE3C8; border-color: rgba(0, 184, 148, .6); background: rgba(0, 184, 148, .13);
}
.trans-toggle.on .trans-dot { background: #00D6A3; box-shadow: 0 0 6px rgba(0, 214, 163, .8); }
@media (max-width: 768px) {
    .trans-toggle { padding: 6px 10px; font-size: 11.5px; }
}
