/* Hallmark · pre-emit critique: P4 H4 E4 S5 R5 V4 */
/* Hallmark · genre: atmospheric · macrostructure: Workbench · theme: Day Foundry · enrichment: none · nav: N9 · footer: none · contrast: pass (40–41) · slop: pass (42–49) · mobile: pass (34, 49–57) */
@import url("../../tokens.css");

/**
 * @file style.css
 * @description Clip Maker Frontend v2.0.0 侧边栏工作台与 Hallmark Anti-AI-slop 美学样式系统
 * @rule 全量 CSS 规范带有详细中文注释，默认采用 Light 白天皮肤，高高度适配草图布局与发光线 Logo
 */

/* ==========================================
 * 1. OKLCH 色彩 Token 与双皮肤变量定义 (默认 Light 白天皮肤)
 * ========================================== */
/* 品牌标题专用字体，仅用于聊天页主标语，避免影响正文可读性。 */
@font-face {
    font-family: 'JinNianYeYaoJiaYouYa';
    src: url('../assets/JinNianYeYaoJiaYouYa-2.ttf') format('truetype');
    font-display: swap;
}

:root, html.light {
    --color-bg: oklch(98% 0.008 250);
    --color-bg-subtle: oklch(95% 0.012 250);
    --color-panel: rgba(255, 255, 255, 0.88);
    --color-panel-border: rgba(0, 0, 0, 0.08);
    --color-card: rgba(255, 255, 255, 0.75);
    --color-card-hover: rgba(255, 255, 255, 0.98);
    --color-card-border: rgba(0, 0, 0, 0.06);

    /* ☀️ 白天皮肤下大标题与文本一律采用高清晰深炭黑色，彻底消除看不清问题 */
    --color-text-primary: oklch(18% 0.03 260);
    --color-text-secondary: oklch(42% 0.03 260);
    --color-text-muted: oklch(62% 0.02 260);

    --color-accent: oklch(55% 0.22 250);
    --color-accent-hover: oklch(48% 0.24 250);
    --color-accent-light: oklch(55% 0.22 250 / 12%);
    --color-accent-border: oklch(55% 0.22 250 / 30%);

    --color-success: oklch(62% 0.20 150);
    --color-warning: oklch(75% 0.19 75);
    --color-danger: oklch(58% 0.22 25);

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.09);
    --shadow-glow: 0 0 20px oklch(55% 0.22 250 / 25%);
}

/* 🌙 暗夜皮肤模式 (Dark Theme) */
html.dark {
    --color-bg: oklch(13% 0.02 260);
    --color-bg-subtle: oklch(16% 0.025 260);
    --color-panel: rgba(22, 26, 38, 0.75);
    --color-panel-border: rgba(255, 255, 255, 0.12);
    --color-card: rgba(255, 255, 255, 0.05);
    --color-card-hover: rgba(255, 255, 255, 0.09);
    --color-card-border: rgba(255, 255, 255, 0.1);

    --color-text-primary: oklch(98% 0 0);
    --color-text-secondary: oklch(72% 0.02 260);
    --color-text-muted: oklch(52% 0.02 260);

    --color-accent: oklch(62% 0.24 265);
    --color-accent-hover: oklch(68% 0.22 265);
    --color-accent-light: oklch(62% 0.24 265 / 15%);
    --color-accent-border: oklch(62% 0.24 265 / 35%);

    --color-success: oklch(72% 0.19 150);
    --color-warning: oklch(78% 0.18 70);
    --color-danger: oklch(65% 0.22 25);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px oklch(62% 0.24 265 / 30%);
}

/* 全局皮肤平滑过渡 */
body, header, aside, main, div, input, textarea, button, section, h1, h2, h3, p, span {
    transition: background-color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    overflow: hidden;
    font-family: var(--font-body);
}

/* ==========================================
 * 2. 侧边栏 (Sidebar) 展开/折叠与居中 Logo 布局
 * ========================================== */
.sidebar-wrapper {
    width: 300px;
    height: 100vh;
    background-color: var(--color-bg-subtle);
    border-right: 1px solid var(--color-panel-border);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    z-index: 30;
    flex-shrink: 0;
}

.sidebar-wrapper.collapsed {
    width: 72px;
    padding: 12px;
}

.sidebar-wrapper.collapsed .hide-on-collapse {
    display: none !important;
}

/* 折叠时完全收起任务区和底部工具区，仅保留品牌 Logo 与展开入口。 */
.sidebar-wrapper.collapsed .sidebar-collapse-content {
    display: none !important;
}

/* 折叠态 Logo 水平居中，展开按钮悬浮在侧边栏外缘且不占用内容宽度。 */
.sidebar-wrapper.collapsed .sidebar-header {
    justify-content: center;
    border-bottom-color: transparent;
    padding-bottom: 0;
    position: relative;
}

.sidebar-wrapper.collapsed .sidebar-toggle-button {
    position: absolute;
    top: 8px;
    right: -25px;
    width: 26px;
    height: 26px;
    padding: 0;
    z-index: 35;
}

/* 侧边栏放映机仅保留机身渐变和虚线投射光，不使用环绕光或旋转边框。 */
.sidebar-projector-logo {
    width: 44px;
    height: 44px;
    overflow: visible;
    background: linear-gradient(135deg, #3975ee 0%, #2abce8 48%, #7667f2 74%, #31d2d0 100%);
    background-size: 220% 220%;
    box-shadow: 0 6px 16px rgba(38, 116, 229, 0.28);
    border-radius: 12px;
    color: #ffffff;
    animation: projectorColorFlow 5s ease-in-out infinite;
}

.sidebar-projector-icon {
    width: 34px;
    height: 34px;
    transform: translateX(1px);
}

/* 三束投射光以短虚线持续向外移动，表现“- - - -”的放映方向。 */
.sidebar-projector-icon path:nth-of-type(n + 2) {
    stroke-dasharray: 3 5;
    animation: projectorDashedLight 1.15s linear infinite;
}

/* 侧边栏作品列表容器：最多展示八个作品项，更多内容在局部区域内滚动。 */
.sidebar-work-list {
    max-height: min(calc(100vh - 230px), calc((64px * 8) + (10px * 7)));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-bottom: 2px;
}

/* 侧边栏作品列表滚动条：保持轻量，避免抢走作品卡片视觉焦点。 */
.sidebar-work-list::-webkit-scrollbar {
    width: 6px;
}

/* 侧边栏作品列表滚动轨道：透明轨道适配白天与黑夜皮肤。 */
.sidebar-work-list::-webkit-scrollbar-track {
    background: transparent;
}

/* 侧边栏作品列表滚动滑块：使用主题边框色确保双皮肤都可见。 */
.sidebar-work-list::-webkit-scrollbar-thumb {
    background: var(--color-panel-border);
    border-radius: 999px;
}

/* 侧边栏任务卡片列表 */
.sidebar-task-item {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-task-item:hover {
    background: var(--color-card-hover);
    border-color: var(--color-accent-border);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

/* 任务卡片右侧的删除入口：默认保持克制，悬停后提示风险操作。 */
.sidebar-task-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    padding: 0;
    color: var(--color-text-primary);
    background: transparent;
    border: 0;
    cursor: pointer;
    opacity: 0.68;
    transition: transform 160ms ease, color 160ms ease, opacity 160ms ease;
}

.sidebar-task-rename {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    color: var(--color-text-muted);
    background: transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: transform 160ms ease, color 160ms ease, opacity 160ms ease;
}

.sidebar-task-rename svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-task-rename:hover {
    color: var(--color-accent);
    opacity: 1;
    transform: scale(1.08);
}

.sidebar-task-rename:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.sidebar-task-delete svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.sidebar-task-delete:hover {
    color: #dc2626;
    opacity: 1;
    transform: scale(1.08);
}

.sidebar-task-delete:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.sidebar-task-time {
    color: var(--color-text-muted);
    font-weight: 500;
}

/* 任务计数左侧的新建按钮保持紧凑圆形，悬停时使用主题强调色。 */
.sidebar-new-task-button {
    width: 19px;
    height: 19px;
    padding: 0;
    border: 1px solid var(--color-accent-border);
    border-radius: 50%;
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-new-task-button:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

/* 侧边栏底部 3 个圆形控制按钮 */
.sidebar-action-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--color-card);
    border: 1px solid var(--color-panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.sidebar-action-circle:hover {
    background: var(--color-accent);
    color: #ffffff;
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* 皮肤工具按钮参考圆形工具栏样式：柔和底色、细描边、简洁图标，不使用 Emoji。 */
.theme-toggle-circle {
    background: var(--color-card);
    border-color: var(--color-panel-border);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-sm);
}

.theme-toggle-circle:hover {
    background: var(--color-accent-light);
    border-color: var(--color-accent-border);
    color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.theme-toggle-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-icon svg {
    width: 100%;
    height: 100%;
}

/* ==========================================
 * 3. 模态框 (Modal) 与遮罩锁定机制
 * ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content-box {
    background: var(--color-panel);
    border: 1px solid var(--color-panel-border);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 账号登录窗口仅包含一个操作按钮，使用更紧凑的宽高比例。 */
.account-modal-content {
    max-width: 448px;
}

/* ==========================================
 * 3.1 全局通知与确认反馈组件
 * ========================================== */
.feedback-toast-region {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 220;
    width: min(360px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.feedback-toast {
    background: var(--color-panel);
    border: 1px solid var(--color-panel-border);
    border-left: 4px solid var(--color-accent);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 11px 12px;
    color: var(--color-text-primary);
    pointer-events: auto;
    animation: feedbackToastIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.feedback-toast.is-leaving {
    animation: feedbackToastOut 0.22s ease-in both;
}

.feedback-toast-success { border-left-color: var(--color-success); }
.feedback-toast-warning { border-left-color: var(--color-warning); }
.feedback-toast-error { border-left-color: var(--color-danger); }

.feedback-toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-accent-light);
    color: var(--color-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.feedback-toast-success .feedback-toast-icon { color: var(--color-success); }
.feedback-toast-warning .feedback-toast-icon { color: var(--color-warning); }
.feedback-toast-error .feedback-toast-icon { color: var(--color-danger); }

.feedback-toast-message {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-primary);
}

.feedback-toast-close {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.feedback-toast-close:hover {
    background: var(--color-card-hover);
    color: var(--color-text-primary);
}

.feedback-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 210;
    background: rgba(8, 12, 22, 0.38);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.feedback-confirm-card {
    width: min(420px, 100%);
    padding: 24px;
    border-radius: 22px;
    background: var(--color-panel);
    border: 1px solid var(--color-panel-border);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    animation: modalPopIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.feedback-confirm-symbol {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 19px;
}

.feedback-confirm-card p {
    margin: 0;
    color: var(--color-text-secondary);
}

.feedback-confirm-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

.feedback-confirm-button {
    padding: 7px 16px;
    border: 1px solid var(--color-accent-border);
    background: var(--color-accent);
    color: #ffffff;
}

.feedback-confirm-button:hover { background: var(--color-accent-hover); }

.feedback-confirm-button.is-danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
}

@keyframes feedbackToastIn {
    from { opacity: 0; transform: translateX(18px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes feedbackToastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(16px) scale(0.98); }
}

@keyframes modalPopIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==========================================
 * 4. 通用按钮与控件
 * ========================================== */
.btn-apple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: 9999px;
    transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    user-select: none;
}

.btn-apple-secondary {
    background-color: var(--color-card);
    border: 1px solid var(--color-card-border);
    color: var(--color-text-primary);
    padding: 6px 14px;
}

.btn-apple-secondary:hover {
    background-color: var(--color-card-hover);
    border-color: var(--color-panel-border);
    transform: translateY(-1px);
}

/* 任务创建聊天框使用主题令牌，避免白天模式仍残留深色 Tailwind 固定颜色。 */
.theme-prompt-box {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
}

.theme-prompt-box:hover,
.theme-prompt-box:focus-within {
    background: var(--color-card-hover);
    border-color: var(--color-accent-border);
    box-shadow: var(--shadow-sm);
}

/* 聊天创建页以品牌图标和主张引导用户，再放置居中的放大输入区。 */
.task-create-shell {
    width: min(100%, 960px);
    margin: clamp(58px, 10vh, 136px) auto 0;
}

.task-create-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(34px, 5vh, 62px);
}

/* 聊天页取消 Logo，仅让本地品牌字体承担欢迎语视觉焦点。 */
.task-create-slogan {
    margin: 0;
    font-family: 'JinNianYeYaoJiaYouYa', 'Outfit', 'Inter', sans-serif;
    font-size: clamp(2rem, 3.45vw, 3.2rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.22;
    background: linear-gradient(96deg, #1677ff 0%, #30b6f2 48%, #5b6cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 首次进入通过分段裁切模拟逐笔写出，并在末尾保留短暂书写光标。 */
.task-create-slogan.is-writing {
    position: relative;
    clip-path: inset(0 100% 0 0);
    animation: sloganHandwrite 2.3s steps(18, end) forwards;
}

.task-create-slogan.is-writing::after {
    position: absolute;
    content: '';
    top: 17%;
    right: -0.14em;
    width: 0.08em;
    height: 0.8em;
    border-radius: 999px;
    background: var(--color-accent);
    opacity: 0;
    pointer-events: none;
    animation: sloganCursor 520ms step-end 4 2.3s;
}

@keyframes projectorColorFlow {
    0%, 100% { background-position: 0% 45%; }
    50% { background-position: 100% 55%; }
}

@keyframes projectorDashedLight {
    to { stroke-dashoffset: -16; }
}

@keyframes sloganHandwrite {
    to { clip-path: inset(0 0 0 0); }
}

@keyframes sloganCursor {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* 系统要求减少动态时关闭品牌动画，保留静态 Logo 与标题信息。 */
@media (prefers-reduced-motion: reduce) {
    .sidebar-projector-logo,
    .sidebar-projector-icon path:nth-of-type(n + 2),
    .task-create-slogan.is-writing,
    .task-create-slogan.is-writing::after {
        animation: none;
    }

    .task-create-slogan.is-writing { clip-path: inset(0 0 0 0); }
}

/* 未登录卡片只保留登录按钮，不再为已删除说明文字预留高度。 */
.account-unbound-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    text-align: center;
}

.task-create-composer {
    width: 100%;
}

@media (max-width: 640px) {
    .task-create-shell {
        margin-top: 36px;
    }

    .task-create-hero {
        margin-bottom: 28px;
    }
}

/* ==========================================
 * 18. 作品集、分享与 Skill 工作台
 * Hallmark · workbench · existing blue accent · mutually exclusive workspace
 * ========================================== */
.workspace-wide-host {
    max-width: 72rem !important;
}

.task-execution-actions,
.shared-page-actions,
.collection-detail-header > div:last-child,
.skill-editor-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.task-execution-actions button,
.shared-page-actions button,
.collection-detail-header button,
.collection-work-item button,
.skill-catalog-card button,
.content-dialog-card button,
.composer-skill-button {
    min-height: 44px;
    padding-inline: var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-pill);
    background: var(--color-paper-2);
    color: var(--color-ink);
    font-weight: 600;
    white-space: nowrap;
}

.task-execution-actions button:disabled,
.shared-page-actions button:disabled,
.collection-detail-header button:disabled,
.collection-work-item button:disabled,
.skill-catalog-card button:disabled,
.content-dialog-card button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sidebar-task-item.needs-attention {
    border-color: var(--color-danger);
    animation: copiedWorkAttention 1.1s ease-in-out infinite;
}

@keyframes copiedWorkAttention {
    0%, 100% { box-shadow: 0 0 0 0 var(--color-accent-light); }
    50% { box-shadow: 0 0 0 4px var(--color-danger); }
}

.collection-layout {
    display: grid;
    grid-template-columns: minmax(13rem, 0.34fr) minmax(0, 1fr);
    gap: var(--space-lg);
    min-height: 34rem;
}

.collection-index {
    display: grid;
    align-content: start;
    gap: var(--space-xs);
    max-height: 62dvh;
    overflow-y: auto;
}

.collection-index > button {
    display: grid;
    gap: var(--space-2xs);
    min-height: 64px;
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
    color: var(--color-ink);
    text-align: start;
}

.collection-index > button span {
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.collection-index > button.is-active {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
}

.collection-detail {
    min-width: 0;
    padding: var(--space-lg);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-2);
    color: var(--color-ink);
}

.collection-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
    padding-block-end: var(--space-md);
    border-bottom: var(--rule-hairline) solid var(--color-rule);
}

.collection-detail-header h2,
.shared-page-header h1 {
    overflow-wrap: anywhere;
    min-width: 0;
}

.collection-detail-header p {
    margin-block-start: var(--space-xs);
    color: var(--color-neutral);
}

.collection-detail-header .is-danger,
.workspace-link-button.is-danger {
    color: var(--color-error);
}

.collection-work-grid,
.shared-work-list {
    display: grid;
    gap: var(--space-md);
    margin-block-start: var(--space-lg);
}

.collection-work-item {
    display: grid;
    gap: var(--space-xs);
    padding: var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper);
    color: var(--color-ink);
}

.collection-work-item > span {
    color: var(--color-muted);
    font-family: var(--font-outlier);
    font-size: var(--text-xs);
}

.content-action-dialog {
    position: fixed;
    inset: 0;
    width: min(92vw, 34rem);
    height: fit-content;
    max-height: min(82dvh, 42rem);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--color-ink);
}

.content-action-dialog::backdrop {
    background: var(--color-scrim);
    backdrop-filter: blur(10px);
}

.content-dialog-card {
    display: grid;
    gap: var(--space-md);
    max-height: min(82dvh, 42rem);
    overflow-y: auto;
    padding: var(--space-xl);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-paper);
    color: var(--color-ink);
    box-shadow: var(--shadow-lg);
}

.content-dialog-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
}

.content-dialog-card > header p,
.content-dialog-card label small {
    color: var(--color-neutral);
}

.content-dialog-card label {
    display: grid;
    gap: var(--space-xs);
    font-weight: 600;
}

.content-dialog-card input,
.content-dialog-card textarea,
.skill-editor input,
.skill-editor textarea {
    width: 100%;
    min-height: 44px;
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    outline: 2px solid transparent;
    outline-offset: 1px;
    background: var(--color-paper-2);
    color: var(--color-ink);
}

.content-dialog-card textarea,
.skill-editor textarea {
    resize: vertical;
}

.content-dialog-primary {
    border-color: var(--color-accent) !important;
    background: var(--color-accent) !important;
    color: var(--color-accent-ink) !important;
}

/* 分享链接自动复制不可用时，提供始终可见且可手动选择的兼容操作区。 */
.share-link-result input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    cursor: text;
}

.share-link-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.share-copy-status {
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
    color: var(--color-neutral);
    font-size: 0.875rem;
}

.share-copy-status.is-success {
    border-color: color-mix(in srgb, var(--color-accent) 45%, var(--color-rule));
    color: var(--color-accent);
}

.share-copy-status.is-manual {
    border-color: color-mix(in srgb, var(--color-warning) 50%, var(--color-rule));
    color: var(--color-warning);
}

.collection-picker-list {
    display: grid;
    gap: var(--space-xs);
    max-height: 18rem;
    overflow-y: auto;
}

.collection-picker-list > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: start;
}

.collection-picker-list small {
    color: var(--color-muted);
}

.content-dialog-create {
    display: grid;
    gap: var(--space-sm);
    padding-block-start: var(--space-md);
    border-top: var(--rule-hairline) solid var(--color-rule);
}

.shared-content-page {
    max-height: calc(100dvh - 6rem);
    overflow-y: auto;
    padding: var(--space-xl);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-paper);
    color: var(--color-ink);
    box-shadow: var(--shadow-lg);
}

.shared-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    padding-block-end: var(--space-lg);
    border-bottom: var(--rule-hairline) solid var(--color-rule);
}

.shared-page-header > div:first-child > span {
    color: var(--color-accent);
    font-size: var(--text-xs);
    font-weight: 700;
}

.shared-work-card {
    padding: var(--space-lg);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-2);
    color: var(--color-ink);
}

.shared-work-card > header {
    display: grid;
    gap: var(--space-md);
}

.shared-page-heading {
    display: grid;
    gap: var(--space-xs);
}

.shared-by {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    width: fit-content;
    margin-block-start: var(--space-sm);
}

.shared-by img,
.shared-by-fallback {
    width: 38px;
    height: 38px;
    border: var(--rule-hairline) solid var(--color-accent-border);
    border-radius: 50%;
    object-fit: cover;
}

.shared-by-fallback {
    display: grid;
    place-items: center;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-weight: 800;
}

.shared-by > span:last-child {
    display: grid;
    gap: 1px;
}

.shared-by small {
    color: var(--color-muted);
    font-size: var(--text-xs);
}

.shared-work-heading {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.shared-work-order {
    flex: 0 0 auto;
    padding: 0.3rem 0.65rem;
    border: var(--rule-hairline) solid var(--color-accent-border);
    border-radius: var(--radius-pill);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.shared-work-description {
    display: grid;
    gap: var(--space-xs);
    min-width: 0;
}

.shared-work-description > span,
.shared-work-user-input > strong {
    color: var(--color-muted);
    font-size: var(--text-xs);
    font-weight: 700;
}

.shared-work-description h2 {
    margin: 0;
    color: var(--color-ink);
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    line-height: 1.45;
}

.shared-work-user-input {
    display: grid;
    gap: var(--space-xs);
    padding-block-start: var(--space-md);
    border-block-start: var(--rule-hairline) solid var(--color-rule);
}

.shared-work-user-input p {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.75;
}

.shared-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), minmax(0, 1fr)));
    gap: var(--space-md);
    margin-block-start: var(--space-md);
}

.shared-asset-grid figure {
    min-width: 0;
    overflow: hidden;
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper);
    color: var(--color-ink);
}

.shared-asset-grid img,
.shared-asset-grid video {
    width: 100%;
    max-height: 22rem;
    object-fit: contain;
    background: var(--color-paper-3);
}

.shared-asset-grid figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm);
}

.shared-asset-grid figcaption span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shared-file-placeholder {
    display: grid;
    place-items: center;
    min-height: 8rem;
    padding: var(--space-md);
    color: var(--color-neutral);
    overflow-wrap: anywhere;
}

.composer-skill-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: 36px;
    padding-inline: var(--space-sm);
}

.composer-skill-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.prompt-skill-token {
    display: inline-block;
    padding: 1px 7px;
    border: var(--rule-hairline) solid var(--color-accent-border);
    border-radius: var(--radius-pill);
    background: linear-gradient(100deg, var(--color-accent-soft), var(--color-accent-light));
    color: var(--color-accent);
    font-weight: 700;
    white-space: nowrap;
}

.skill-picker-popover {
    position: fixed;
    inset: auto;
    width: min(92vw, 29rem);
    max-height: min(70dvh, 34rem);
    padding: var(--space-md);
    overflow: hidden;
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper);
    color: var(--color-ink);
    box-shadow: var(--shadow-lg);
}

.skill-picker-popover:popover-open {
    display: grid;
    gap: var(--space-sm);
}

.skill-picker-popover > header,
.skill-picker-popover > nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
}

.skill-picker-popover button {
    min-height: 44px;
    border-radius: var(--radius-sm);
    color: var(--color-ink);
}

.skill-picker-popover > nav {
    justify-content: flex-start;
}

.skill-picker-popover > nav button {
    padding-inline: var(--space-sm);
}

.skill-picker-popover > nav button.is-active {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.skill-picker-search input {
    width: 100%;
    min-height: 44px;
    padding-inline: var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
    color: var(--color-ink);
}

.skill-picker-results {
    display: grid;
    gap: var(--space-xs);
    max-height: 21rem;
    overflow-y: auto;
}

.skill-picker-results > button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm);
    text-align: start;
}

.skill-picker-results > button > span:last-child {
    display: grid;
    min-width: 0;
}

.skill-picker-results small {
    overflow: hidden;
    color: var(--color-neutral);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skill-tool-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
}

.skill-picker-empty {
    padding: var(--space-lg);
    color: var(--color-neutral);
    text-align: center;
}

.skills-workspace,
.skill-own-section,
.skill-editor {
    display: grid;
    gap: var(--space-lg);
}

.skill-horizontal-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(16rem, 21rem);
    gap: var(--space-md);
    overflow-x: auto;
    padding-block: var(--space-sm);
    scroll-snap-type: inline mandatory;
}

.skill-catalog-card {
    display: grid;
    align-content: start;
    gap: var(--space-sm);
    min-height: 13rem;
    padding: var(--space-lg);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-2);
    color: var(--color-ink);
    scroll-snap-align: start;
}

.skill-catalog-card > span,
.skill-catalog-card > p {
    color: var(--color-neutral);
}

.skill-catalog-card > div {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-block-start: auto;
}

.skill-editor {
    padding: var(--space-lg);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-2);
    color: var(--color-ink);
}

.skill-editor label {
    display: grid;
    gap: var(--space-xs);
}

.skill-own-section {
    grid-template-columns: minmax(16rem, 0.8fr) minmax(0, 1.2fr);
}

.skill-detail-dialog pre {
    max-height: 55dvh;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (hover: hover) and (pointer: fine) {
    .task-execution-actions button:hover,
    .shared-page-actions button:hover,
    .collection-detail-header button:hover,
    .collection-work-item button:hover,
    .skill-catalog-card button:hover,
    .content-dialog-card button:hover,
    .skill-picker-results > button:hover {
        background: var(--color-paper-3);
        transform: translateY(-1px);
    }
}

@media (max-width: 48rem) {
    #sidebarApp {
        width: 72px;
        flex: 0 0 72px;
    }
    .sidebar-wrapper:not(.collapsed) {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 85vw);
        z-index: 80;
    }
    .collection-layout,
    .skill-own-section {
        grid-template-columns: minmax(0, 1fr);
    }
    .collection-index {
        grid-auto-flow: column;
        grid-auto-columns: minmax(13rem, 70vw);
        overflow-x: auto;
    }
    .collection-detail-header,
    .shared-page-header,
    .task-execution-header {
        align-items: stretch;
        flex-direction: column;
    }
    .task-execution-actions,
    .shared-page-actions,
    .collection-detail-header > div:last-child {
        justify-content: flex-start;
    }
    .shared-content-page {
        padding: var(--space-md);
    }
}

/* ==========================================
 * 22. v3.2 Skills 分栏与锚点式作品集选择器
 * Hallmark · workbench catalog · restrained blue/yellow accents
 * ========================================== */
.skill-catalog-section {
    display: grid;
    gap: var(--space-md);
    min-width: 0;
}

.skill-catalog-section > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.skill-catalog-section > header span {
    display: grid;
    place-items: center;
    min-width: 2rem;
    min-height: 2rem;
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-pill);
    color: var(--color-neutral);
    font-size: var(--text-xs);
}

.skill-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
    gap: var(--space-md);
    min-width: 0;
}

.skill-grid-viewport {
    position: relative;
    min-width: 0;
}

/* 只有内容超过动态行数上限时，网格才成为独立纵向滚动区。 */
.skill-card-grid.is-scrollable {
    max-height: var(--skill-grid-visible-height);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-inline-end: var(--space-xs);
    padding-block-end: var(--space-xl);
    scrollbar-color: var(--color-muted) var(--color-paper-2);
    scrollbar-width: thin;
}

.skill-card-grid.is-scrollable:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

.skill-card-grid.is-scrollable::-webkit-scrollbar {
    width: var(--space-xs);
}

.skill-card-grid.is-scrollable::-webkit-scrollbar-track {
    border-radius: var(--radius-pill);
    background: var(--color-paper-2);
}

.skill-card-grid.is-scrollable::-webkit-scrollbar-thumb {
    border-radius: var(--radius-pill);
    background: var(--color-muted);
}

/* 向下提示固定在分区底部，不占用网格排版空间。 */
.skill-scroll-cue {
    position: absolute;
    inset-inline-start: 50%;
    inset-block-end: var(--space-xs);
    display: grid;
    place-items: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-pill);
    outline: 2px solid transparent;
    outline-offset: 2px;
    background: var(--color-paper);
    color: var(--color-accent);
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
    z-index: 2;
}

.skill-scroll-cue svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.skill-scroll-cue:focus-visible {
    outline-color: var(--color-focus);
}

.skill-scroll-cue:active {
    transform: translateX(-50%) translateY(1px);
}

.skill-scroll-cue:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.skill-catalog-card {
    position: relative;
    min-height: 12rem;
    padding: var(--space-lg);
    outline: 2px solid transparent;
    outline-offset: 2px;
    cursor: pointer;
}

.skill-catalog-card:focus-visible {
    outline-color: var(--color-focus);
}

.skill-card-body {
    display: grid !important;
    align-content: start;
    gap: var(--space-xs) !important;
    margin: 0 !important;
    padding-inline-end: var(--space-xl);
    outline: 2px solid transparent;
    outline-offset: 2px;
    cursor: pointer;
}

.skill-card-body:focus-visible {
    outline-color: var(--color-focus);
}

.skill-card-body > span,
.skill-card-body > p {
    color: var(--color-neutral);
}

.skill-card-body > h3 {
    min-width: 0;
    overflow-wrap: anywhere;
}

.skill-card-body > p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-height: 1.6;
}

.skill-favorite-button {
    position: absolute;
    inset-block-start: var(--space-sm);
    inset-inline-end: var(--space-sm);
    display: grid;
    place-items: center;
    width: 44px;
    min-height: 44px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--color-muted);
}

.skill-favorite-button svg {
    width: 1.35rem;
    height: 1.35rem;
    fill: transparent;
    stroke: currentColor;
    stroke-width: 1.6;
}

.skill-favorite-button.is-favorite {
    color: var(--color-favorite);
    filter: drop-shadow(0 0 7px var(--color-favorite-glow));
}

.skill-favorite-button.is-favorite svg {
    fill: currentColor;
}

.skill-favorite-button.is-animating svg {
    animation: favoriteConfirm 420ms var(--ease-out) both;
}

@keyframes favoriteConfirm {
    0% { transform: scale(0.82); }
    55% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.skill-card-admin-actions,
.collection-work-actions {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) !important;
    margin-block-start: auto !important;
}

.skill-editor-dialog {
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    max-height: min(88dvh, 40rem);
    padding: 0;
    overflow: hidden;
}

.skill-editor-dialog > header {
    align-items: center;
    padding: var(--space-lg) var(--space-xl) var(--space-md);
}

.skill-editor-dialog-body {
    display: grid;
    gap: var(--space-md);
    min-height: 0;
    padding: 0 var(--space-xl) var(--space-md);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.skill-editor-dialog-body > label {
    display: grid;
    gap: var(--space-xs);
}

.skill-editor-dialog textarea {
    height: clamp(9rem, 28dvh, 13rem);
    min-height: 9rem;
    resize: vertical;
    white-space: pre-wrap;
}

/* “公开”是发布设置而非主字段，使用紧凑说明行和右侧开关降低视觉层级。 */
.skill-publish-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.skill-publish-option > div {
    display: grid;
    gap: var(--space-3xs);
    min-width: 0;
}

.skill-publish-option strong {
    color: var(--color-ink);
    font-size: var(--text-sm);
}

.skill-publish-option small {
    color: var(--color-neutral);
    font-size: var(--text-xs);
    font-weight: 400;
}

.skill-visibility-switch {
    position: relative;
    display: inline-flex !important;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 1.5rem;
    cursor: pointer;
}

.skill-visibility-switch input {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100% !important;
    min-height: 0 !important;
    margin: 0;
    opacity: 0;
    cursor: inherit;
}

.skill-visibility-track {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-pill);
    background: var(--color-paper-3);
}

.skill-visibility-track::after {
    position: absolute;
    top: 0.18rem;
    left: 0.18rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: var(--color-paper);
    box-shadow: var(--shadow-sm);
    content: '';
    transition: transform var(--dur-micro) var(--ease-out);
}

.skill-visibility-switch input:checked + .skill-visibility-track {
    border-color: var(--color-accent);
    background: var(--color-accent);
}

.skill-visibility-switch input:checked + .skill-visibility-track::after {
    transform: translateX(1.18rem);
}

.skill-visibility-switch:hover .skill-visibility-track {
    border-color: var(--color-accent-border);
}

.skill-visibility-switch input:focus-visible + .skill-visibility-track {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.skill-visibility-switch:active .skill-visibility-track::after {
    transform: translateX(0.1rem);
}

.skill-visibility-switch input:checked:active + .skill-visibility-track::after {
    transform: translateX(1.08rem);
}

.skill-visibility-switch input:disabled {
    cursor: not-allowed;
}

.skill-visibility-switch input:disabled + .skill-visibility-track {
    opacity: 0.55;
}

.skill-editor-dialog-footer {
    display: flex;
    justify-content: flex-end;
    padding: var(--space-md) var(--space-xl) var(--space-lg);
    border-block-start: var(--rule-hairline) solid var(--color-rule);
    background: var(--color-paper);
}

.skill-editor-dialog-footer .content-dialog-primary {
    width: 100%;
}

@media (max-width: 40rem) {
    .skill-editor-dialog > header {
        padding: var(--space-md);
    }

    .skill-editor-dialog-body {
        padding: 0 var(--space-md) var(--space-md);
    }

    .skill-editor-dialog-footer {
        padding: var(--space-md);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skill-visibility-track::after {
        transition-duration: 0.01ms;
    }
}

.content-dialog-card select,
.collection-popover-form input,
.collection-popover-form textarea {
    width: 100%;
    min-height: 44px;
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    outline: 2px solid transparent;
    outline-offset: 1px;
    background: var(--color-paper-2);
    color: var(--color-ink);
}

.content-dialog-card select:focus-visible,
.collection-popover-form input:focus-visible,
.collection-popover-form textarea:focus-visible {
    outline-color: var(--color-focus);
}

.collection-anchor-popover {
    position: fixed;
    width: min(20rem, calc(100% - 2rem));
    max-height: min(28rem, calc(100dvh - 2rem));
    margin: 0;
    overflow-y: auto;
    padding: var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper);
    color: var(--color-ink);
    box-shadow: var(--shadow-lg);
}

.collection-anchor-popover::backdrop {
    background: transparent;
}

.collection-popover-heading,
.collection-popover-form,
.collection-popover-form header,
.collection-popover-form label {
    display: grid;
    gap: var(--space-xs);
}

.collection-popover-heading,
.collection-popover-form header {
    margin-block-end: var(--space-sm);
}

.collection-popover-heading span,
.collection-popover-form header span {
    color: var(--color-neutral);
    font-size: var(--text-xs);
}

.collection-popover-form textarea {
    min-height: 7rem;
    resize: vertical;
}

.collection-popover-form > div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-xs);
}

.collection-anchor-popover button {
    min-height: 44px;
    padding-inline: var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-pill);
    background: var(--color-paper-2);
    color: var(--color-ink);
    font-weight: 600;
    white-space: nowrap;
}

.collection-anchor-popover button.is-primary {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-accent-ink);
}

.collection-picker-list {
    display: grid;
    gap: var(--space-xs);
}

.collection-picker-list > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-radius: var(--radius-sm);
    text-align: start;
}

.collection-picker-list > button small {
    color: var(--color-neutral);
}

@media (hover: hover) and (pointer: fine) {
    .skill-catalog-card:hover {
        background: var(--color-paper-3);
    }
    .collection-anchor-popover button:hover {
        background: var(--color-paper-3);
    }
    .skill-scroll-cue:hover {
        background: var(--color-paper-3);
    }
}

@media (max-width: 40rem) {
    .skill-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .workspace-heading {
        align-items: center;
    }
    .collection-work-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skill-favorite-button.is-animating svg {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-task-item.needs-attention {
        animation: none;
        box-shadow: 0 0 0 3px var(--color-danger);
    }
}

/* 聊天输入文字和占位文字均跟随当前皮肤切换。 */
.theme-prompt-input {
    color: var(--color-text-primary);
    caret-color: var(--color-accent);
}

.theme-prompt-input::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

/* 富文本聊天编辑器用 data-placeholder 提示；空内容时保持与原 textarea 一致的视觉位置。 */
.prompt-rich-editor {
    min-height: 7.5rem;
    max-height: 15rem;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.prompt-rich-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--color-text-muted);
    pointer-events: none;
}

/* @文件N 是不可编辑的独立引用令牌，前后空格由脚本写入，渐蓝色与正文形成明确区隔。 */
.prompt-mention-token {
    display: inline-block;
    padding: 0 0.22em;
    border-radius: 0.38em;
    background: linear-gradient(96deg, rgba(22, 119, 255, 0.14), rgba(48, 182, 242, 0.18));
    color: #1677ff;
    font-weight: 700;
    line-height: 1.45;
    user-select: all;
}

html.dark .prompt-mention-token {
    background: linear-gradient(96deg, rgba(70, 138, 255, 0.2), rgba(68, 205, 245, 0.22));
    color: #72b7ff;
}

/* 上传的非图片文件名采用主题正文色；白天避免固定浅灰导致视频文件名难以辨识。 */
.media-file-name {
    color: var(--color-text-primary);
}

/* @素材引用菜单绝对定位在聊天输入区域上方层级，位置由光标镜像计算后写入。 */
.attachment-mention-menu {
    position: absolute;
    z-index: 25;
    width: min(248px, calc(100% - 24px));
    max-height: 232px;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid var(--color-card-border);
    border-radius: 14px;
    background: var(--color-panel);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

/* 没有上传素材时仍展示轻量空态，告诉用户 @ 仅能引用当前聊天附件。 */
.attachment-mention-empty {
    margin: 0;
    padding: 10px 12px;
    color: var(--color-text-muted);
    font-size: 13px;
    text-align: center;
}

/* 菜单条目采用可聚焦按钮，鼠标点击和键盘高亮使用同一视觉状态。 */
.attachment-mention-option {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.attachment-mention-option:hover,
.attachment-mention-option.is-active {
    border-color: var(--color-accent-border);
    background: var(--color-accent-light);
    color: var(--color-accent);
}

/* 图片与视频预览保持统一尺寸，视频在加载元数据后显示首帧。 */
.attachment-mention-preview,
.attachment-mention-file-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    overflow: hidden;
    border: 1px solid var(--color-card-border);
    border-radius: 8px;
    background: var(--color-bg-subtle);
    object-fit: cover;
}

.attachment-mention-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 19px;
}

/* 输入区底部边线在明暗皮肤下均保持足够可见性。 */
.theme-prompt-toolbar {
    border-top: 1px solid var(--color-card-border);
}

/* “+”上传按钮采用主题卡片和文字令牌。 */
.theme-plus-button {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    color: var(--color-text-secondary);
}

.theme-plus-button:hover {
    background: var(--color-accent-light);
    border-color: var(--color-accent-border);
    color: var(--color-accent);
}

/* 发送按钮在两套皮肤下统一使用主题强调色。 */
.theme-submit-button {
    background: var(--color-accent);
    border: 1px solid var(--color-accent-border);
    color: #ffffff;
}

.theme-submit-button:hover:not(:disabled) {
    background: var(--color-accent-hover);
    box-shadow: var(--shadow-glow);
}

.theme-submit-button:disabled {
    cursor: wait;
    opacity: 0.68;
}

/* 任务总览当前页签使用语义类，避免脚本写入固定深色文本。 */
.tab-overview-btn.active-tab {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
}

/* 任务为空时禁止清理：降低不透明度并阻断悬停与点击反馈。 */
.overview-cleanup-button:disabled,
.overview-cleanup-button.is-disabled {
    cursor: not-allowed;
    opacity: 0.38;
    color: var(--color-text-muted);
    pointer-events: none;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-queued { background: rgba(148, 163, 184, 0.15); color: #64748b; border: 1px solid rgba(148, 163, 184, 0.25); }
.badge-running { background: rgba(96, 165, 250, 0.15); color: #3b82f6; border: 1px solid rgba(96, 165, 250, 0.3); }
.badge-done { background: rgba(37, 99, 235, 0.14); color: #1d4ed8; border: 1px solid rgba(37, 99, 235, 0.34); }
.badge-partial { background: rgba(245, 158, 11, 0.16); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.42); }
.badge-failed { background: rgba(248, 113, 113, 0.15); color: #ef4444; border: 1px solid rgba(248, 113, 113, 0.3); }
.badge-paused,
.badge-cancelled { background: rgba(148, 163, 184, 0.15); color: #64748b; border: 1px solid rgba(148, 163, 184, 0.25); }

html.dark .badge-queued { color: #94a3b8; }
html.dark .badge-running { color: #60a5fa; }
html.dark .badge-done { color: #60a5fa; }
html.dark .badge-failed { color: #f87171; }
html.dark .badge-paused,
html.dark .badge-cancelled { color: #94a3b8; }

/* 选中任务后在原对话区域展示可交付的执行信息，不渲染 Agent 日志。 */
.task-execution-panel {
    width: min(100%, 880px);
    margin: 0 auto;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    color: var(--color-text-primary);
    border: 1px solid var(--color-panel-border);
    box-shadow: var(--shadow-lg);
}

/* 小屏保留页面边距，任务内容仍在卡片内部纵向滚动而不会撑破应用主区域。 */
@media (max-width: 640px) {
    .task-execution-panel {
        max-height: calc(100vh - 24px);
    }
}

/* 黑夜皮肤为任务进度容器增加可辨别的面板层和柔和投影，避免边框沉入背景。 */
html.dark .task-execution-panel {
    background: rgba(22, 26, 38, 0.9);
    border-color: rgba(148, 163, 184, 0.26);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

.task-execution-header {
    border-color: var(--color-card-border);
}

.task-execution-eyebrow {
    color: var(--color-accent);
}

/* 任务标题与状态徽标共用同一基线，避免“已完成”标签出现上下偏移。 */
.task-progress-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* 标题下方以低强调度展示可审计的开始时间和耗时。 */
.task-execution-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 8px;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.task-execution-meta-row time {
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

.task-execution-section {
    padding: 16px;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: 16px;
}

html.dark .task-execution-section {
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.task-execution-section-title {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
}

.task-execution-user-text {
    margin: 0;
    color: var(--color-text-primary);
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 作品描述只读引用令牌复用聊天框语义，并通过主题令牌保证明暗皮肤对比度。 */
.task-description-token {
    display: inline-block;
    margin-inline: 0.12em;
    padding-inline: 0.3em;
    border: var(--rule-hairline) solid var(--color-accent-border);
    border-radius: var(--radius-pill);
    background: linear-gradient(100deg, var(--color-accent-soft), var(--color-accent-light));
    color: var(--color-accent);
    font-weight: 700;
    line-height: 1.45;
    white-space: nowrap;
}

.task-description-token.is-skill {
    border-style: dashed;
}

.task-execution-muted {
    color: var(--color-text-muted);
}

/* 失败原因独立成卡片，确保审核、参数、网络与 Agent 错误都能清晰读取。 */
.task-execution-failure {
    border-color: rgba(239, 68, 68, 0.42);
    background: rgba(254, 242, 242, 0.78);
}

.task-execution-failure .task-execution-section-title {
    color: #dc2626;
}

.task-execution-failure-message {
    margin: 0;
    color: var(--color-text-primary);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.task-execution-failure-suggestion {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.84rem;
    line-height: 1.55;
}

html.dark .task-execution-failure {
    border-color: rgba(248, 113, 113, 0.38);
    background: rgba(127, 29, 29, 0.22);
}

html.dark .task-execution-failure .task-execution-section-title {
    color: #fca5a5;
}

.task-execution-partial {
    padding: 12px 14px;
    border: 1px solid rgba(245, 158, 11, 0.48);
    border-radius: 12px;
    background: rgba(255, 251, 235, 0.88);
}

.task-execution-partial-title {
    margin: 0 0 4px;
    color: #b45309;
    font-size: 0.9rem;
    font-weight: 700;
}

.task-execution-partial-message {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 0.84rem;
    line-height: 1.6;
}

html.dark .badge-partial { color: #fbbf24; }
html.dark .task-execution-partial {
    border-color: rgba(251, 191, 36, 0.38);
    background: rgba(120, 53, 15, 0.24);
}
html.dark .task-execution-partial-title { color: #fbbf24; }
.task-execution-outputs {
    display: grid;
    gap: 10px;
}

/* 任务需求附件采用紧凑网格，图片、视频与文件卡片均在主页面可直接查看。 */
.task-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.task-artifact-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    background: var(--color-card-hover);
    border: 1px solid var(--color-card-border);
    border-radius: 14px;
}

.task-artifact-heading {
    min-width: 0;
    color: var(--color-text-primary);
    font-size: 0.78rem;
}

.task-artifact-heading strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-artifact-image,
.task-artifact-video {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 10px;
}

.task-artifact-audio {
    width: 100%;
    min-height: 36px;
}

.task-artifact-text {
    max-height: 300px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    color: var(--color-text-primary);
    background: var(--color-panel);
    border: 1px solid var(--color-card-border);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.task-artifact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.task-artifact-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    color: var(--color-accent);
    background: var(--color-accent-light);
    border: 1px solid var(--color-accent-border);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.task-artifact-action-button:hover {
    background: var(--color-accent);
    color: #ffffff;
}

.task-output-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    color: var(--color-text-primary);
    background: var(--color-card-hover);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    transition: border-color 160ms ease, transform 160ms ease;
}

.task-output-card:hover {
    border-color: var(--color-accent-border);
    transform: translateY(-1px);
}

.task-output-card span:last-child {
    color: var(--color-accent);
    font-size: 0.75rem;
    font-weight: 600;
}

/* 极简自定义滚动条 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(140, 140, 140, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(140, 140, 140, 0.45); }
/* 系统工作区 v3：作品、Skill、开发者角色与执行图谱。 */
html,
body {
    overflow-x: clip;
}

.sidebar-system-nav {
    display: grid;
    gap: var(--space-2xs);
    padding-block-start: var(--space-sm);
    border-block-start: var(--rule-hairline) solid var(--color-panel-border);
}

.sidebar-nav-item {
    min-height: 44px;
    padding-inline: var(--space-sm);
    border: var(--rule-hairline) solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    background: transparent;
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: start;
    white-space: nowrap;
    transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}

.sidebar-nav-item.is-active {
    color: var(--color-accent);
    background: var(--color-accent-light);
    border-color: var(--color-accent-border);
}

.workspace-panel {
    display: grid;
    gap: var(--space-xl);
    width: min(100%, 64rem);
    max-height: calc(100dvh - var(--space-2xl));
    overflow-y: auto;
    padding: clamp(var(--space-lg), 4vw, var(--space-xl));
    border: var(--rule-hairline) solid var(--color-panel-border);
    border-radius: var(--radius-lg);
    background: var(--color-panel);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-lg);
}

.workspace-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-lg);
    padding-block-end: var(--space-lg);
    border-block-end: var(--rule-hairline) solid var(--color-panel-border);
}

.workspace-heading h1 {
    min-width: 0;
    overflow-wrap: anywhere;
    font-family: var(--font-body);
    font-size: var(--text-xl);
    font-style: normal;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.workspace-heading p,
.workspace-card p,
.workspace-empty span {
    max-width: 65ch;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.workspace-action-strip,
.skill-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
}

.workspace-action-strip label,
.skill-editor label:not(.workspace-check) {
    display: grid;
    gap: var(--space-xs);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
}

.workspace-action-strip input,
.skill-editor input[type="text"],
.skill-editor textarea {
    width: 100%;
    min-height: 44px;
    padding: var(--space-sm);
    border: var(--rule-hairline) solid var(--color-rule);
    outline: 2px solid transparent;
    outline-offset: 1px;
    border-radius: var(--radius-sm);
    background: var(--color-paper);
    color: var(--color-ink);
    font-family: var(--font-body);
}

.skill-editor textarea {
    min-height: 12rem;
    resize: vertical;
    font-family: var(--font-outlier);
    line-height: 1.6;
}

/* 模态框文本区使用更紧凑的动态高度，覆盖旧页面内嵌编辑器的十二 rem 下限。 */
.skill-editor-dialog textarea {
    height: clamp(9rem, 28dvh, 13rem);
    min-height: 9rem;
}

.workspace-button,
.workspace-link-button,
.account-role-button {
    min-height: 44px;
    padding-inline: var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-pill);
    background: var(--color-paper-2);
    color: var(--color-ink);
    font-weight: 600;
    white-space: nowrap;
    transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}

.workspace-button-primary {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-accent-ink);
}

.workspace-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: var(--space-md);
    margin-block-start: var(--space-sm);
}

.workspace-card,
.workspace-empty {
    display: grid;
    align-content: start;
    gap: var(--space-sm);
    min-width: 0;
    padding: var(--space-lg);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-card);
    color: var(--color-text-primary);
}

.workspace-card > span {
    color: var(--color-muted);
    font-family: var(--font-outlier);
    font-size: var(--text-xs);
}

.workspace-empty {
    grid-column: 1 / -1;
}

.workspace-inline-actions,
.workspace-check {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

.workspace-loading,
.workspace-error {
    padding: var(--space-lg);
    color: var(--color-text-secondary);
}

.workspace-error {
    color: var(--color-error);
}

.execution-graph-host {
    min-height: 24rem;
}

.execution-graph-canvas {
    position: relative;
    min-height: 24rem;
    overflow: auto;
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-2);
}

.execution-graph-lines,
.execution-graph-nodes {
    position: absolute;
    inset: 0;
    min-width: 42rem;
    min-height: 24rem;
}

.execution-graph-lines path {
    fill: none;
    stroke: var(--color-rule);
    stroke-width: 2;
}

.execution-graph-node {
    position: absolute;
    display: grid;
    gap: var(--space-2xs);
    width: 10rem;
    min-height: 5rem;
    padding: var(--space-sm);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper);
    color: var(--color-ink);
    text-align: start;
    cursor: grab;
    touch-action: none;
}

.execution-graph-node > span,
.execution-graph-node > small {
    color: var(--color-muted);
    font-family: var(--font-outlier);
    font-size: var(--text-xs);
}

.execution-graph-detail {
    position: sticky;
    inset-inline-start: calc(100% - 15rem);
    inset-block-start: var(--space-sm);
    display: grid;
    gap: var(--space-sm);
    width: 14rem;
    max-height: 20rem;
    overflow: auto;
    padding: var(--space-sm);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper);
    color: var(--color-ink);
}

.execution-graph-detail pre {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    font-family: var(--font-outlier);
    font-size: var(--text-xs);
}

.developer-agent-log {
    max-height: 22rem;
    overflow: auto;
    padding: var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper-2);
    color: var(--color-ink);
    font-family: var(--font-outlier);
    font-size: var(--text-xs);
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* 普通用户可见的业务日志只呈现脱敏阶段说明，不复用 Agent 原始终端日志样式。 */
.task-business-log {
    display: grid;
    gap: 0.55rem;
    max-height: 18rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.task-business-log-item {
    border-left: 3px solid var(--color-accent);
    border-radius: 0 0.75rem 0.75rem 0;
    background: var(--color-accent-light);
    padding: 0.65rem 0.8rem;
}

.task-business-log-item.is-error {
    border-left-color: var(--color-danger);
}

.task-business-log-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
    color: var(--color-text-secondary);
    font-size: 0.72rem;
}

.task-business-log-item p {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

html.dark .task-business-log-item {
    background: var(--color-accent-light);
}

:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.workspace-button:disabled,
.workspace-link-button:disabled,
.sidebar-nav-item:disabled,
.account-role-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
    .workspace-button:hover,
    .workspace-link-button:hover,
    .sidebar-nav-item:hover,
    .account-role-button:hover {
        transform: translateY(-1px);
        background: var(--color-paper-3);
    }
    .workspace-button-primary:hover {
        background: var(--color-accent);
    }
}

.workspace-button:active,
.workspace-link-button:active,
.sidebar-nav-item:active,
.account-role-button:active {
    transform: translateY(1px);
}

@media (min-width: 40rem) {
    .workspace-action-strip {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
        align-items: end;
    }
}

@media (max-width: 39.99rem) {
    .workspace-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
    .workspace-panel {
        padding: var(--space-md);
        max-height: calc(100dvh - var(--space-lg));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 150ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 150ms !important;
    }
}

/* Hallmark · component: readonly-prompt · genre: atmospheric · theme: Day Foundry
 * states: default · hover · focus · active · disabled · loading · error · success
 * contrast: pass (40–41)
 */
/* 只读作品描述复用聊天框的信息顺序：附件在上，带引用令牌的原始输入在下。 */
.readonly-prompt {
    display: grid;
    gap: var(--space-sm);
    min-width: 0;
}

.readonly-prompt-files {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: stretch;
}

.readonly-file-card {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: var(--space-xs);
    align-items: center;
    width: min(12.5rem, 100%);
    min-height: 4rem;
    padding: var(--space-2xs);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper);
    color: var(--color-ink);
    text-align: left;
    cursor: pointer;
    transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}

.readonly-file-preview {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    overflow: clip;
    border-radius: calc(var(--radius-md) - var(--space-2xs));
    background: var(--color-paper-2);
    color: var(--color-accent);
}

.readonly-file-preview img,
.readonly-file-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.readonly-file-preview.is-error {
    border: var(--rule-hairline) solid var(--color-error);
    color: var(--color-error);
}

.readonly-file-icon {
    font-family: var(--font-outlier);
    font-size: var(--text-md);
    line-height: 1;
}

.readonly-file-meta {
    display: grid;
    gap: var(--space-3xs);
    min-width: 0;
}

.readonly-file-meta strong {
    overflow: hidden;
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 650;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.readonly-file-meta small {
    color: var(--color-neutral);
    font-size: var(--text-xs);
}

.readonly-prompt-text {
    min-width: 0;
    margin: 0;
    color: var(--color-ink);
    font-size: var(--text-base);
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* 可点击的 @文件N 保留令牌视觉，同时使用按钮语义获得键盘操作能力。 */
.task-description-token.is-actionable {
    appearance: none;
    font: inherit;
    cursor: pointer;
    vertical-align: baseline;
}

.readonly-file-menu {
    position: fixed;
    inset: auto;
    z-index: 120;
    width: min(14rem, calc(100vw - 1.5rem));
    margin: 0;
    padding: var(--space-xs);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper);
    color: var(--color-ink);
    box-shadow: 0 1rem 2.6rem var(--color-scrim);
}

.readonly-file-menu:not(:popover-open):not(.is-open) {
    display: none;
}

.readonly-file-menu-heading {
    display: grid;
    gap: var(--space-3xs);
    padding: var(--space-2xs) var(--space-xs) var(--space-xs);
    border-bottom: var(--rule-hairline) solid var(--color-rule);
}

.readonly-file-menu-heading strong {
    color: var(--color-accent);
    font-size: var(--text-xs);
}

.readonly-file-menu-heading span {
    overflow: hidden;
    color: var(--color-ink-2);
    font-size: var(--text-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.readonly-file-menu-action {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 2.75rem;
    margin-top: var(--space-2xs);
    padding: 0 var(--space-sm);
    border: var(--rule-hairline) solid transparent;
    border-radius: var(--radius-sm);
    background: var(--color-paper);
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 650;
    cursor: pointer;
    transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}

.readonly-file-card:focus-visible,
.readonly-file-card.is-focus,
.task-description-token.is-actionable:focus-visible,
.readonly-file-menu-action:focus-visible,
.readonly-preview-close:focus-visible,
.readonly-preview-download:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .readonly-file-card:hover,
    .readonly-file-card.is-hover,
    .readonly-file-menu-action:hover {
        transform: translateY(-1px);
        background: var(--color-paper-2);
        color: var(--color-ink);
    }

    .task-description-token.is-actionable:hover {
        background: var(--color-accent);
        color: var(--color-accent-ink);
    }
}

.readonly-file-card:active,
.readonly-file-card.is-active,
.task-description-token.is-actionable:active,
.readonly-file-menu-action:active,
.readonly-preview-close:active,
.readonly-preview-download:active {
    transform: translateY(1px);
}

.readonly-file-card:disabled,
.readonly-file-menu-action:disabled,
.readonly-preview-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.readonly-file-card[data-state="loading"] {
    background: var(--color-paper-2);
    color: var(--color-neutral);
    cursor: wait;
}

.readonly-file-card[data-state="error"] {
    border-color: var(--color-error);
    background: var(--color-paper);
    color: var(--color-error);
}

.readonly-file-card[data-state="success"] {
    border-color: var(--color-success);
    background: var(--color-paper);
    color: var(--color-success);
}

.readonly-file-menu-action[data-state="loading"],
.readonly-preview-download[data-state="loading"] {
    background: var(--color-paper-2);
    color: var(--color-neutral);
    cursor: wait;
}

.readonly-file-menu-action[data-state="error"],
.readonly-preview-download[data-state="error"] {
    border-color: var(--color-error);
    background: var(--color-paper);
    color: var(--color-error);
}

.readonly-file-menu-action[data-state="success"],
.readonly-preview-download[data-state="success"] {
    border-color: var(--color-success);
    background: var(--color-paper);
    color: var(--color-success);
}

/* 媒体预览使用原生 dialog，保证焦点陷阱、Esc 关闭和遮罩层行为一致。 */
.readonly-preview-dialog {
    position: fixed;
    inset: 0;
    width: min(56rem, calc(100vw - 1.5rem));
    max-width: none;
    height: fit-content;
    max-height: min(82vh, 46rem);
    margin: auto;
    padding: 0;
    overflow: clip;
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-lg);
    background: var(--color-paper);
    color: var(--color-ink);
    box-shadow: 0 1.5rem 4rem var(--color-scrim);
}

.readonly-preview-dialog::backdrop {
    background: var(--color-scrim);
    backdrop-filter: blur(8px);
}

.readonly-preview-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(82vh, 46rem);
}

.readonly-preview-card > header,
.readonly-preview-card > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
}

.readonly-preview-card > header {
    border-bottom: var(--rule-hairline) solid var(--color-rule);
}

.readonly-preview-card > header strong {
    min-width: 0;
    overflow: hidden;
    color: var(--color-ink);
    font-size: var(--text-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.readonly-preview-card > footer {
    justify-content: flex-end;
    border-top: var(--rule-hairline) solid var(--color-rule);
}

.readonly-preview-close,
.readonly-preview-download {
    min-height: 2.75rem;
    padding: 0 var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-pill);
    background: var(--color-paper);
    color: var(--color-ink);
    font-size: var(--text-sm);
    font-weight: 650;
    cursor: pointer;
}

.readonly-preview-download {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: var(--color-accent-ink);
}

.readonly-preview-body {
    display: grid;
    place-items: center;
    min-height: 12rem;
    overflow: auto;
    padding: var(--space-md);
    background: var(--color-paper-2);
    color: var(--color-ink);
}

.readonly-preview-body img,
.readonly-preview-body video {
    display: block;
    max-width: 100%;
    max-height: min(62vh, 36rem);
    object-fit: contain;
}

.readonly-preview-body audio {
    width: min(32rem, 100%);
}

.collection-work-note {
    display: grid;
    gap: var(--space-2xs);
    margin: 0;
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.collection-work-note strong,
.shared-output-heading {
    color: var(--color-neutral);
    font-size: var(--text-xs);
    font-weight: 700;
}

.collection-readonly-prompt,
.shared-work-user-input .readonly-prompt {
    padding: var(--space-sm);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper);
    color: var(--color-ink);
}

.shared-output-heading {
    margin: var(--space-md) 0 var(--space-xs);
}

.shared-asset-grid audio {
    width: 100%;
}

@media (max-width: 39.99rem) {
    .readonly-file-card {
        width: 100%;
    }

    .readonly-preview-dialog {
        width: calc(100vw - 1rem);
    }

    .readonly-preview-card > header,
    .readonly-preview-card > footer {
        padding-inline: var(--space-sm);
    }
}
/* ==========================================
 * 作品明细支持后台
 * Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4
 * Hallmark · macrostructure: Workbench · tone: technical · anchor hue: blue
 * ========================================== */
.support-workspace {
    display: grid;
    gap: var(--space-lg);
    min-width: 0;
}

.support-workspace-heading p {
    max-width: 44rem;
    color: var(--color-neutral);
}

.support-filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: var(--space-md);
    padding: var(--space-lg);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-md);
    background: var(--color-paper-2);
}

.support-filter-bar label {
    display: grid;
    gap: var(--space-xs);
    min-width: 0;
    color: var(--color-neutral);
    font-size: var(--text-xs);
    font-weight: 600;
}

.support-filter-bar input,
.support-filter-bar select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: var(--space-sm) var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    outline: 2px solid transparent;
    outline-offset: 1px;
    background: var(--color-paper);
    color: var(--color-ink);
}

.support-filter-bar input:hover,
.support-filter-bar select:hover {
    border-color: var(--color-muted);
}

.support-filter-bar input:focus-visible,
.support-filter-bar select:focus-visible {
    border-color: var(--color-focus);
    outline-color: var(--color-focus);
}

.support-filter-actions,
.support-pagination {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.support-result-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-neutral);
    font-size: var(--text-sm);
}

.support-work-list {
    display: grid;
    gap: var(--space-xs);
    min-width: 0;
}

.support-work-row {
    display: grid;
    grid-template-columns: minmax(10rem, 0.85fr) minmax(16rem, 1.6fr) auto minmax(9rem, 0.7fr) auto;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
    padding: var(--space-md);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    outline: 2px solid transparent;
    outline-offset: 2px;
    background: var(--color-paper-2);
    color: var(--color-ink);
    transition: transform var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out);
}

.support-work-row:hover {
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

.support-work-row:focus-visible {
    outline-color: var(--color-focus);
}

.support-work-row:active {
    transform: translateY(0);
}

.support-owner-cell {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.support-owner-cell img,
.support-owner-fallback,
.task-support-owner img,
.task-support-owner-fallback {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-pill);
    object-fit: cover;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-weight: 700;
}

.support-owner-cell > span,
.support-work-identity {
    display: grid;
    gap: var(--space-2xs);
    min-width: 0;
}

.support-owner-cell small,
.support-work-row time,
.support-work-identity span,
.task-support-owner small {
    color: var(--color-neutral);
    font-size: var(--text-xs);
}

.support-owner-cell strong,
.support-work-identity strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-work-identity strong {
    font-family: var(--font-outlier);
}

.support-work-identity span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.support-pagination {
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-block-start: var(--space-sm);
    border-top: var(--rule-hairline) solid var(--color-rule);
}

.support-pagination label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-neutral);
    font-size: var(--text-sm);
}

.support-pagination input,
.support-pagination select {
    width: 5rem;
    min-height: 36px;
    padding: var(--space-xs);
    border: var(--rule-hairline) solid var(--color-rule);
    border-radius: var(--radius-sm);
    background: var(--color-paper);
    color: var(--color-ink);
}

.support-pagination span {
    min-width: 7rem;
    color: var(--color-neutral);
    text-align: center;
}

.support-workspace .workspace-button:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.support-workspace .workspace-button:active {
    transform: translateY(1px);
}

.support-workspace .workspace-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.support-workspace .workspace-empty.is-loading {
    color: var(--color-neutral);
}

.support-workspace .workspace-empty.is-error {
    border-color: var(--color-error);
    color: var(--color-error);
}

.task-support-owner {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    min-width: 0;
    padding-block-start: var(--space-xs);
    color: var(--color-neutral);
    font-size: var(--text-xs);
}

.task-support-owner img,
.task-support-owner-fallback {
    width: 1.75rem;
    height: 1.75rem;
}

@media (max-width: 980px) {
    .support-filter-bar {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .support-work-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .support-work-identity {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .support-work-row time {
        grid-column: 1;
    }
}

@media (max-width: 640px) {
    .support-filter-bar {
        grid-template-columns: minmax(0, 1fr);
    }

    .support-filter-actions {
        justify-content: stretch;
    }

    .support-filter-actions button {
        flex: 1 1 0;
    }

    .support-work-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .support-work-identity,
    .support-work-row time {
        grid-column: auto;
        grid-row: auto;
    }

    .support-work-row > button {
        width: 100%;
    }

    .support-pagination {
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    .support-work-row {
        transition-duration: var(--dur-micro);
    }

    .support-work-row:hover,
    .support-work-row:active {
        transform: none;
    }
}

/* Video-output controls: distinguish user-selected output parameters from optional skills. */
.generation-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 0.65rem;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.generation-option-model {
    background: linear-gradient(135deg, #0f766e, #0891b2);
}

.generation-option-speed {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.generation-option-ratio {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.generation-option-resolution {
    background: linear-gradient(135deg, #b45309, #ea580c);
}

.generation-option select {
    min-height: 1.6rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.4rem;
    padding: 0.1rem 0.25rem;
    color: #fff;
    background: rgba(15, 23, 42, 0.32);
    font: inherit;
    cursor: pointer;
}

.generation-option select:focus-visible {
    outline: 2px solid rgba(253, 186, 116, 0.92);
    outline-offset: 2px;
}

.generation-option select:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.generation-reference-adaptive-hint {
    flex-basis: 100%;
    margin: 0.15rem 0 0;
    padding: 0.45rem 0.6rem;
    border: 1px solid rgba(251, 146, 60, 0.9);
    border-radius: 0.5rem;
    background: rgba(154, 52, 18, 0.82);
    color: #ffedd5;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
}

/* Card count shares the output-control row and highlights the extra generation cost. */
.generation-option-cards {
    border-color: rgba(251, 146, 60, 0.72);
    background: linear-gradient(135deg, rgba(194, 65, 12, 0.88), rgba(234, 88, 12, 0.72));
    color: #fff7ed;
}

.generation-option-cards select {
    color: #fff7ed;
    font-weight: 700;
}

.generation-option-cards::before {
    content: "\2726";
    color: #fed7aa;
    margin-right: 0.1rem;
}
/* 创作工作台：把短视频创作与连续长剧情放到同一稳定入口，避免额外页面跳转。 */
.creation-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}
.creation-mode-card {
    display: flex;
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.32);
    color: var(--theme-text, #e2e8f0);
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.creation-mode-card:hover { transform: translateY(-1px); border-color: rgba(56, 189, 248, .72); }
.creation-mode-card.is-active {
    border-color: rgba(34, 211, 238, .9);
    background: linear-gradient(135deg, rgba(8, 145, 178, .36), rgba(30, 64, 175, .34));
    box-shadow: 0 10px 24px rgba(8, 145, 178, .18);
}
.creation-mode-card strong { display: block; font-size: .92rem; }
.creation-mode-card span { display: block; margin-top: 4px; color: rgba(226, 232, 240, .72); font-size: .73rem; line-height: 1.35; }
.long-drama-panel {
    margin: 0 0 16px;
    padding: 15px;
    border: 1px solid rgba(45, 212, 191, .48);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(8, 47, 73, .38), rgba(30, 41, 59, .42));
}
.long-drama-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.long-drama-panel-heading strong, .long-drama-panel-heading span { display: block; }
.long-drama-panel-heading strong { color: #ccfbf1; font-size: .9rem; }
.long-drama-panel-heading span, .long-drama-mode-hint { color: rgba(226, 232, 240, .72); font-size: .74rem; line-height: 1.5; }
.long-drama-auto-button {
    flex: none;
    padding: 7px 10px;
    border: 1px solid rgba(94, 234, 212, .6);
    border-radius: 10px;
    background: rgba(13, 148, 136, .2);
    color: #ccfbf1;
    font-size: .75rem;
}
.long-drama-duration-row { display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 12px; margin-top: 13px; }
.long-drama-duration-row label { color: #f8fafc; font-size: .8rem; font-weight: 700; }
.long-drama-duration-row output { margin-left: 5px; color: #5eead4; }
.long-drama-duration-row input { width: 100%; accent-color: #14b8a6; }
.long-drama-mode-hint { margin: 9px 0 0; }
.long-drama-storyboard { display: grid; gap: 9px; margin-top: 13px; }
.long-drama-segment {
    display: grid;
    grid-template-columns: 30px minmax(110px, .8fr) 78px minmax(190px, 2fr);
    align-items: start;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 12px;
    background: rgba(15, 23, 42, .36);
}
.long-drama-segment-index { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: rgba(20, 184, 166, .22); color: #99f6e4; font-size: .74rem; font-weight: 700; }
.long-drama-segment label { display: grid; gap: 4px; color: rgba(226, 232, 240, .72); font-size: .68rem; }
.long-drama-segment input, .long-drama-segment textarea { box-sizing: border-box; width: 100%; border: 1px solid rgba(148, 163, 184, .28); border-radius: 8px; background: rgba(2, 6, 23, .48); color: #f8fafc; font-size: .75rem; }
.long-drama-segment input { min-height: 31px; padding: 5px 7px; }
.long-drama-segment textarea { min-height: 48px; padding: 6px 7px; resize: vertical; line-height: 1.45; }
@media (max-width: 700px) {
    .creation-mode-switch { grid-template-columns: 1fr; }
    .long-drama-panel-heading { display: grid; }
    .long-drama-auto-button { width: fit-content; }
    .long-drama-segment { grid-template-columns: 28px 1fr 72px; }
    .long-drama-segment-description { grid-column: 2 / -1; }
}

/* 素材库：沿用工作台深色层次和大圆角卡片，源文件始终以私有 OSS 签名地址预览。 */
.material-library-page { width: min(1160px, 100%); margin: 0 auto; color: var(--theme-text, #e2e8f0); }
.material-library-hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding: 26px 30px; border: 1px solid rgba(148,163,184,.28); border-radius: 26px; background: radial-gradient(circle at 92% 12%, rgba(56,189,248,.22), transparent 31%), linear-gradient(135deg, rgba(15,23,42,.92), rgba(30,41,59,.82)); box-shadow: 0 18px 42px rgba(15,23,42,.18); }
.workspace-eyebrow { margin: 0 0 8px; color: #67e8f9; font-size: .7rem; font-weight: 800; letter-spacing: .16em; }
.material-library-hero h2 { margin: 0; color: #fff; font-size: clamp(1.7rem, 3vw, 2.45rem); font-weight: 800; letter-spacing: -.04em; }
.material-library-hero p:not(.workspace-eyebrow) { max-width: 640px; margin: 9px 0 0; color: rgba(226,232,240,.72); font-size: .88rem; line-height: 1.55; }
.material-library-hero-note { flex: none; padding: 9px 12px; border: 1px solid rgba(94,234,212,.42); border-radius: 999px; background: rgba(13,148,136,.15); color: #99f6e4; font-size: .75rem; font-weight: 700; }
.material-library-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.material-library-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid rgba(148,163,184,.24); border-radius: 13px; background: rgba(15,23,42,.55); }
.material-library-tabs button { border: 0; border-radius: 9px; padding: 8px 11px; color: rgba(226,232,240,.68); background: transparent; font-size: .77rem; font-weight: 700; }
.material-library-tabs button.is-active { color: #ecfeff; background: linear-gradient(135deg, #0e7490, #2563eb); box-shadow: 0 5px 14px rgba(37,99,235,.28); }
.material-library-search { display: flex; align-items: center; gap: 7px; flex: 1 1 190px; min-height: 38px; padding: 0 11px; border: 1px solid rgba(148,163,184,.3); border-radius: 12px; background: rgba(15,23,42,.48); color: #94a3b8; }
.material-library-search input, .material-library-toolbar select, .material-library-upload select { min-width: 0; border: 0; outline: 0; color: #e2e8f0; background: transparent; font: inherit; font-size: .78rem; }
.material-library-search input { width: 100%; }
.material-library-toolbar > select, .material-library-upload select { min-height: 38px; padding: 0 10px; border: 1px solid rgba(148,163,184,.3); border-radius: 12px; background: rgba(15,23,42,.48); }
.material-library-toolbar option, .material-library-upload option { color: #111827; background: #fff; }
.material-library-upload { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 13px 15px; border: 1px dashed rgba(56,189,248,.58); border-radius: 16px; background: rgba(14,116,144,.11); }
.material-library-upload > div { flex: 1; min-width: 180px; }
.material-library-upload strong, .material-library-upload span { display: block; }
.material-library-upload strong { color: #e0f2fe; font-size: .82rem; }
.material-library-upload span { margin-top: 3px; color: rgba(226,232,240,.63); font-size: .72rem; }
.material-library-upload-button { cursor: pointer; flex: none; padding: 9px 12px; border-radius: 10px; background: linear-gradient(135deg, #0284c7, #2563eb); color: #fff; font-size: .77rem; font-weight: 800; }
.material-library-readonly { margin: 14px 0 0; padding: 10px 12px; border: 1px solid rgba(251,191,36,.52); border-radius: 12px; background: rgba(120,53,15,.2); color: #fde68a; font-size: .78rem; }
.material-library-status { margin: 16px 1px 12px; color: rgba(226,232,240,.62); font-size: .78rem; }
.material-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px; }
.material-library-card { overflow: hidden; border: 1px solid rgba(148,163,184,.25); border-radius: 17px; background: linear-gradient(155deg, rgba(30,41,59,.84), rgba(15,23,42,.72)); box-shadow: 0 10px 24px rgba(2,6,23,.12); }
.material-library-preview { display: grid; height: 135px; place-items: center; overflow: hidden; background: rgba(2,6,23,.5); }
.material-library-preview img, .material-library-preview video { width: 100%; height: 100%; object-fit: cover; }
.material-library-file-icon { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(125,211,252,.42); border-radius: 15px; color: #7dd3fc; background: rgba(14,116,144,.2); font-size: 1.35rem; }
.material-library-card-body { padding: 11px 12px 8px; }
.material-library-card-body strong, .material-library-card-body span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-library-card-body strong { color: #f8fafc; font-size: .8rem; }
.material-library-card-body span { margin-top: 4px; color: rgba(226,232,240,.58); font-size: .69rem; }
.material-library-card-body .material-library-owner { color: #7dd3fc; }
.material-library-card-actions { display: flex; gap: 7px; padding: 0 12px 12px; }
.material-library-card-actions button { flex: 1; border: 1px solid rgba(56,189,248,.44); border-radius: 9px; padding: 7px 8px; color: #cffafe; background: rgba(8,145,178,.17); font-size: .7rem; font-weight: 700; }
.material-library-card-actions button:hover { border-color: #38bdf8; background: rgba(8,145,178,.34); }
.material-library-card-actions .is-danger { flex: 0; color: #fecaca; border-color: rgba(248,113,113,.38); background: rgba(127,29,29,.15); }
@media (max-width: 680px) { .material-library-hero { display: block; padding: 20px; } .material-library-hero-note { display: inline-block; margin-top: 13px; } .material-library-upload { align-items: flex-start; flex-wrap: wrap; } .material-library-upload-button { margin-left: auto; } }

/* 业务工作台：创作、配置和生成状态使用一致的卡片层级。 */
.task-create-shell {
    width: min(1160px, 100%);
    margin: 28px auto 48px;
}
.task-create-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 18px;
    padding: 27px 30px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 26px;
    background:
        radial-gradient(circle at 92% 12%, rgba(56, 189, 248, .22), transparent 31%),
        linear-gradient(135deg, rgba(15, 23, 42, .94), rgba(30, 41, 59, .84));
    box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}
.task-create-slogan {
    margin: 0;
    font-family: 'JinNianYeYaoJiaYouYa', 'Outfit', 'Inter', sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.16;
    background: none;
    color: #fff;
    -webkit-text-fill-color: currentColor;
}
.task-create-slogan.is-writing,
.task-create-slogan.is-writing::after {
    animation: none;
    clip-path: none;
    opacity: 1;
}
.task-create-subtitle {
    max-width: 650px;
    margin: 9px 0 0;
    color: rgba(226, 232, 240, .72);
    font-size: .88rem;
    line-height: 1.55;
}
.task-create-hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}
.task-create-hero-badges span {
    padding: 8px 10px;
    border: 1px solid rgba(94, 234, 212, .38);
    border-radius: 999px;
    color: #99f6e4;
    background: rgba(13, 148, 136, .15);
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}
.task-create-composer {
    padding: 22px !important;
    border-color: rgba(148, 163, 184, .26) !important;
    border-radius: 26px !important;
    background: linear-gradient(155deg, rgba(30, 41, 59, .82), rgba(15, 23, 42, .73)) !important;
    box-shadow: 0 16px 34px rgba(2, 6, 23, .15) !important;
}
.composer-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 16px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.composer-section-heading p {
    margin: 0 0 4px;
    color: #67e8f9;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .16em;
}
.composer-section-heading strong {
    color: #f8fafc;
    font-size: 1rem;
}
.composer-section-heading > span {
    padding: 6px 9px;
    border: 1px solid rgba(125, 211, 252, .3);
    border-radius: 999px;
    color: #bae6fd;
    background: rgba(14, 116, 144, .15);
    font-size: .7rem;
    font-weight: 700;
}
.generation-control-deck {
    align-items: flex-end !important;
    margin-top: 8px;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 16px;
    background: rgba(2, 6, 23, .22);
}
.generation-control-deck > div:first-child {
    gap: 8px !important;
}
.generation-option {
    min-height: 34px;
    border-color: rgba(255, 255, 255, .18);
    border-radius: 10px;
}
.generation-option-duration {
    background: linear-gradient(135deg, #be185d, #db2777);
}
.generation-option-cards {
    background: linear-gradient(135deg, #0f766e, #16a34a);
}
.generation-reference-adaptive-hint {
    padding: 8px 10px;
    border: 1px solid rgba(250, 204, 21, .4);
    border-radius: 10px;
    color: #fef3c7;
    background: rgba(120, 53, 15, .28);
    font-weight: 600;
}
@media (max-width: 700px) {
    .task-create-shell { margin-top: 16px; }
    .task-create-hero { display: block; padding: 21px; }
    .task-create-hero-badges { justify-content: flex-start; margin-top: 15px; }
    .composer-section-heading { align-items: flex-start; }
    .generation-control-deck { align-items: stretch !important; }
}

/* 业务模板重构：统一为深蓝侧栏、白色顶栏、浅灰蓝画布与白色内容卡片。 */
:root {
    --business-blue: #2563eb;
    --business-deep: #0d2345;
    --business-bg: #f6f9fd;
    --business-line: #dce6f2;
    --business-text: #17263b;
    --business-muted: #74859b;
    --business-card: #ffffff;
    --business-shadow: 0 18px 55px rgba(25, 57, 103, .10);
}
html.light body,
html.dark body {
    background: radial-gradient(circle at 76% 12%, #dcebff 0, transparent 28%), var(--business-bg);
    color: var(--business-text);
    font-family: Inter, Geist, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.business-app-shell {
    display: grid !important;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}
#sidebarApp,
.sidebar-wrapper {
    min-width: 0;
}
.sidebar-wrapper {
    width: 250px !important;
    height: 100vh;
    padding: 18px 14px !important;
    color: #fff !important;
    background: var(--business-deep) !important;
    border: 0 !important;
    box-shadow: none !important;
}
.sidebar-wrapper.collapsed {
    width: 76px !important;
    padding: 14px 10px !important;
}
.sidebar-wrapper .sidebar-header {
    padding: 5px 7px 19px !important;
    border-color: rgba(255, 255, 255, .10) !important;
}
.sidebar-wrapper .sidebar-projector-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4e8cff, #1b63e9);
    box-shadow: none;
    animation: none;
}
.sidebar-wrapper .sidebar-projector-icon { width: 29px; height: 29px; }
.sidebar-wrapper .sidebar-brand h1 { color: #fff; font-size: 15px; }
.sidebar-wrapper .sidebar-brand p { color: #9fb2cf; opacity: 1; }
.sidebar-toggle-button,
.sidebar-wrapper .sidebar-action-circle {
    border: 1px solid rgba(255, 255, 255, .14) !important;
    color: #cfe0f7 !important;
    background: rgba(255, 255, 255, .07) !important;
    box-shadow: none !important;
}
.sidebar-toggle-button:hover,
.sidebar-wrapper .sidebar-action-circle:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .14) !important;
    transform: none !important;
}
.sidebar-wrapper .sidebar-new-task-button {
    width: 23px;
    height: 23px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--business-blue);
}
.sidebar-wrapper .sidebar-work-list {
    max-height: min(calc(100vh - 332px), calc((64px * 7) + (10px * 6)));
}
.sidebar-wrapper .sidebar-task-item {
    color: #cbd8ea;
    background: transparent;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
}
.sidebar-wrapper .sidebar-task-item:hover,
.sidebar-wrapper .sidebar-task-item.is-active {
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border-color: transparent;
    transform: none;
    box-shadow: none;
}
.sidebar-wrapper .sidebar-task-item,
.sidebar-wrapper .sidebar-task-time,
.sidebar-wrapper .sidebar-task-delete,
.sidebar-wrapper .sidebar-task-rename {
    color: inherit;
}
.sidebar-wrapper .sidebar-system-nav {
    border-top: 1px solid rgba(255,255,255,.10);
    padding-top: 13px;
}
.sidebar-wrapper .sidebar-nav-item {
    width: 100%;
    border: 0;
    border-radius: 10px;
    color: #cbd8ea;
    background: transparent;
    text-align: left;
}
.sidebar-wrapper .sidebar-nav-item:hover,
.sidebar-wrapper .sidebar-nav-item.is-active {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}
.sidebar-wrapper .sidebar-footer { border-color: rgba(255,255,255,.10) !important; }

.business-main {
    min-width: 0;
    min-height: 100vh;
    overflow-y: auto;
    background: radial-gradient(circle at 76% 12%, #dcebff 0, transparent 28%), var(--business-bg);
}
.business-topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 28px;
    border-bottom: 1px solid var(--business-line);
    color: var(--business-text);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(16px);
}
.business-topbar-title { font-size: 15px; font-weight: 800; }
.business-topbar-meta {
    padding: 7px 11px;
    border: 1px solid var(--business-line);
    border-radius: 9px;
    color: #526a88;
    background: #fff;
    font-size: 12px;
}
.business-page-canvas {
    width: min(100%, 1500px);
    min-height: calc(100vh - 64px);
    margin: 0 auto;
    padding: 38px 34px 86px;
}

.task-create-shell {
    width: min(100%, 1060px);
    margin: 0 auto;
}
.task-create-hero {
    display: block;
    margin: 0 0 18px;
    padding: 18px 0 0;
    border: 0;
    border-radius: 0;
    text-align: center;
    background: transparent;
    box-shadow: none;
}
.task-create-hero .workspace-eyebrow {
    margin-bottom: 10px;
    color: var(--business-blue);
    font-size: 12px;
    letter-spacing: 3px;
}
.task-create-slogan {
    color: var(--business-text);
    font-family: Inter, Geist, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.18;
    -webkit-text-fill-color: currentColor;
}
.task-create-subtitle {
    margin: 8px 0 0;
    color: var(--business-muted);
    font-size: 16px;
}
.task-create-hero-badges,
.composer-section-heading { display: none; }
.task-create-composer {
    overflow: hidden;
    padding: 0 !important;
    border: 1px solid var(--business-line) !important;
    border-radius: 22px !important;
    background: #fff !important;
    box-shadow: var(--business-shadow) !important;
}
.creation-mode-switch {
    padding: 14px 18px 0;
    border: 0;
    background: #fff;
}
.creation-mode-card {
    min-height: auto;
    padding: 8px 13px;
    border: 1px solid var(--business-line);
    border-radius: 999px;
    color: #58708e;
    background: #fff;
    box-shadow: none;
}
.creation-mode-card:hover {
    border-color: #8db4f3;
    transform: none;
    box-shadow: none;
}
.creation-mode-card.is-active {
    border-color: #86aff2;
    color: #1859be;
    background: #eaf2ff;
}
.creation-mode-card strong { display: inline; font-size: 12px; }
.creation-mode-card span { display: none; }
.long-drama-panel {
    margin: 16px 18px 0;
    padding: 20px;
    border: 1px solid var(--business-line);
    border-radius: 18px;
    color: var(--business-text);
    background: #fff;
    box-shadow: 0 12px 34px rgba(30, 67, 115, .07);
}
.long-drama-panel-heading strong { color: var(--business-text); font-size: 16px; }
.long-drama-panel-heading span,
.long-drama-mode-hint { color: var(--business-muted); }
.long-drama-auto-button {
    border: 0;
    color: var(--business-blue);
    background: transparent;
    box-shadow: none;
}
.long-drama-duration-row label { color: #516b8a; }
.long-drama-duration-row output { color: var(--business-blue); }
.long-drama-duration-row input { accent-color: var(--business-blue); }
.long-drama-segment {
    border-color: var(--business-line);
    background: #f8fbff;
}
.long-drama-segment-index { color: #244e85; background: #dceaff; }
.long-drama-segment label { color: #71849d; }
.long-drama-segment input,
.long-drama-segment textarea {
    border-color: var(--business-line);
    color: var(--business-text);
    background: #fff;
}
.theme-prompt-box {
    margin-top: 14px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.theme-prompt-box:hover,
.theme-prompt-box:focus-within { background: transparent !important; box-shadow: none !important; }
.prompt-rich-editor {
    min-height: 190px;
    padding: 24px !important;
    color: var(--business-text) !important;
    font-size: 16px !important;
}
.prompt-rich-editor::before { color: #94a3b8 !important; }
#mediaContainer { padding: 0 18px; }
.media-pop-card { border-color: #d7e4f3 !important; background: #eef5ff !important; box-shadow: none !important; }
.media-pop-card .media-file-name { color: #315e9c; }
.theme-prompt-box > .mt-2 {
    margin: 0 18px !important;
    border-color: #fecaca !important;
    border-radius: 12px !important;
    color: #b91c1c !important;
    background: #fff7f7 !important;
    box-shadow: none !important;
}
.theme-prompt-toolbar.generation-control-deck {
    display: grid !important;
    grid-template-columns: 58px minmax(126px, 1.05fr) minmax(145px, 1.2fr) minmax(106px, .86fr) minmax(92px, .72fr) minmax(118px, .96fr) minmax(76px, .62fr) minmax(106px, .86fr) 50px;
    align-items: end !important;
    gap: 9px;
    margin-top: 0;
    padding: 14px 18px !important;
    border-top: 1px solid #edf1f6;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    background: #fff;
}
.theme-prompt-toolbar.generation-control-deck > div:first-child {
    display: contents !important;
}
.theme-prompt-toolbar .btn-plus-wrapper {
    grid-column: 1;
    width: 58px !important;
    height: 42px !important;
    border: 1px solid var(--business-line) !important;
    border-radius: 10px !important;
    color: #36516f !important;
    background: #f5f8fc !important;
    box-shadow: none !important;
}
.composer-skill-button,
.generation-option {
    display: grid;
    min-width: 0;
    min-height: 0;
    gap: 4px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #7186a0;
    background: transparent !important;
    box-shadow: none;
    font-size: 10px;
    font-weight: 600;
}
.composer-skill-button { grid-column: 2; }
.generation-option-model { grid-column: 3; }
.generation-option-speed { grid-column: 4; }
.generation-option-duration { grid-column: 5; }
.generation-option-ratio { grid-column: 6; }
.generation-option-resolution { grid-column: 7; }
.generation-option-cards { grid-column: 8; }
.generation-option-audio { grid-column: 2 / span 2; align-self: center; display: flex; }
.composer-skill-button svg { display: none; }
.composer-skill-button,
.generation-option select {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid var(--business-line);
    border-radius: 10px;
    color: #294466 !important;
    background: #f5f8fc !important;
    font: inherit;
    text-align: left;
}
.composer-skill-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 13px;
}
.generation-option select:focus-visible,
.composer-skill-button:focus-visible {
    outline: 2px solid #8eb5f6;
    outline-offset: 1px;
}
.generation-option select:disabled {
    color: #93a3b8 !important;
    background: #eef2f7 !important;
    opacity: 1;
}
.generation-reference-adaptive-hint {
    grid-column: 2 / -2;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: #537095;
    background: #edf5ff;
    font-size: 11px;
    font-weight: 500;
}
.theme-prompt-toolbar .btn-submit-send {
    grid-column: 9;
    width: 48px !important;
    height: 42px !important;
    border-radius: 11px !important;
    color: #fff !important;
    background: var(--business-blue) !important;
    box-shadow: none !important;
}
.theme-prompt-toolbar .btn-submit-send:hover { background: #1d4ed8 !important; transform: none !important; }

.workspace-panel,
.material-library-hero,
.workspace-card,
.support-work-row,
.detail-box,
.work-gallery-card {
    border-color: var(--business-line) !important;
    color: var(--business-text) !important;
    background: var(--business-card) !important;
    box-shadow: 0 10px 28px rgba(36, 77, 136, .08) !important;
}
.workspace-panel,
.material-library-page { color: var(--business-text) !important; }
.workspace-heading h1,
.material-library-hero h2,
.workspace-card strong { color: var(--business-text) !important; }
.workspace-heading p,
.material-library-hero p:not(.workspace-eyebrow),
.workspace-card p,
.material-library-status { color: var(--business-muted) !important; }
.material-library-hero {
    padding: 26px 30px;
    background: #fff !important;
}
.material-library-hero-note {
    border-color: #cfe0f7;
    color: #315e9c;
    background: #eef5ff;
}
.material-library-tabs,
.material-library-search,
.material-library-toolbar > select,
.material-library-upload select {
    border-color: var(--business-line);
    background: #fff;
}
.material-library-tabs { background: #f5f8fc; }
.material-library-tabs button { color: #6c7f98; }
.material-library-tabs button.is-active {
    color: #1855b6;
    background: #eaf2ff;
    box-shadow: none;
}
.material-library-search input,
.material-library-toolbar select,
.material-library-upload select { color: #36516f; }
.material-library-upload {
    border-color: #aac0dc;
    background: #f8fbff;
}
.material-library-upload strong { color: #294466; }
.material-library-upload span { color: #74859b; }
.material-library-upload-button,
.workspace-button-primary {
    background: var(--business-blue) !important;
    box-shadow: none !important;
}
.material-library-grid { gap: 13px; }
.material-library-card {
    border-color: var(--business-line);
    background: #fff;
    box-shadow: none;
}
.material-library-preview { background: #edf4fb; }
.material-library-card-body strong { color: var(--business-text); }
.material-library-card-body span { color: var(--business-muted); }

@media (max-width: 1280px) {
    .theme-prompt-toolbar.generation-control-deck {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .theme-prompt-toolbar .btn-plus-wrapper,
    .composer-skill-button,
    .generation-option-model,
    .generation-option-speed,
    .generation-option-duration,
    .generation-option-ratio,
    .generation-option-resolution,
    .generation-option-cards,
    .generation-option-audio,
    .theme-prompt-toolbar .btn-submit-send {
        grid-column: auto;
    }
    .theme-prompt-toolbar .btn-submit-send { grid-column: span 2; width: 100% !important; }
}
@media (max-width: 760px) {
    .business-app-shell { grid-template-columns: 1fr; }
    #sidebarApp { display: none; }
    .business-page-canvas { padding: 24px 15px 70px; }
    .business-topbar { padding: 0 16px; }
    .business-topbar-meta { display: none; }
    .task-create-subtitle { font-size: 14px; }
    .theme-prompt-toolbar.generation-control-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .theme-prompt-toolbar .btn-submit-send { grid-column: 1 / -1; }
    .creation-mode-switch { display: flex; }
}

/* ==========================================================================
   参考站（pushwebly 创作页）风格复刻：Hero / 提示条 / 创作卡片 / 生成设置栏
   仅覆盖展示样式；所有 select 的 option 值与提交参数保持不变（后端校验兼容）。
   ========================================================================== */

/* Hero 区：眉标 + 主标题 + 副标题，居中于创作卡片上方。 */
.hello { padding: 6px 0 22px; text-align: center; }
.hello .eyebrow {
    color: var(--business-blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
}
.hello h1 {
    margin: 10px 0 0;
    color: var(--business-text);
    font-family: Inter, Geist, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(30px, 4.6vw, 52px);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1.12;
}
.hello p { margin: 12px 0 0; color: var(--business-muted); font-size: 18px; line-height: 1.6; }

/* 素材限制提示条：淡蓝底圆角横幅。 */
.notice {
    margin: 0 0 18px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #eaf3ff;
    color: #4f6787;
    font-size: 13px;
    line-height: 1.6;
}

/* 创作卡片：白底、细描边、大圆角与参考站一致的柔和阴影；同时作为 @浮层的定位容器。 */
.composer {
    position: relative;
    border: 1px solid var(--business-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--business-shadow);
}

/* 素材区：上传的图片/视频位于文字描述上方；空态时不占空间。 */
.files { padding: 14px 18px 0; }
#mediaContainer { padding: 0; margin-bottom: 4px; }
#mediaContainer:empty { display: none; }
.files:has(#mediaContainer:empty) { padding: 0; }
/* 媒体卡片必须横向排列，否则克隆/上传的图片、视频与文件卡会竖向堆叠错位。 */
.files-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
/* 创作模式切换独立成行，位于输入框下方、设置栏上方。 */
.creation-mode-switch { padding: 8px 18px 0; border: 0; background: transparent; }

/* 生成设置栏：双列网格，标题占满整行；底部一行由“预计时间”和发送按钮并列。 */
.bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    align-items: end;
    margin-top: 14px;
    padding: 18px;
    border-top: 1px solid #edf1f6;
}
.config-title { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.config-title b { color: var(--business-text); font-size: 15px; font-weight: 700; }

/* config-pair 透明化后，两个 config-field 直接进入 .bar 网格形成同一行。 */
.config-pair { display: contents; }

/* 独立（非成对）设置项与参考音频行占满整行，避免与成对字段错位。 */
.bar > .config-field { grid-column: 1 / -1; }

/* 设置字段：上标签 + 下控件（白底细描边圆角框）。 */
.config-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.config-field > label[for] { color: #58708e; font-size: 12px; font-weight: 600; }
.config-field select {
    box-sizing: border-box;
    width: 100%;
    height: 41px;
    padding: 0 10px;
    border: 1px solid var(--business-line);
    border-radius: 10px;
    background: #fff;
    color: #294466;
    font-family: inherit;
    font-size: 14px;
}
.config-field select:focus-visible { outline: 2px solid #8eb5f6; outline-offset: 1px; }
.config-field select:disabled { color: #93a3b8; background: #eef2f7; }

/* 按钮型设置项（参考素材“＋”、创作模式“✦ 模式（可选）”）沿用同一控件外观。 */
.config-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    height: 41px;
    padding: 0 10px;
    border: 1px solid var(--business-line);
    border-radius: 10px;
    background: #fff;
    color: #294466;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.config-action:hover { border-color: #8db4f3; background: #f5f9ff; }
.config-action:focus-visible { outline: 2px solid #8eb5f6; outline-offset: 1px; }

/* 参考音频：整行复选框，左标签右勾选项。 */
.config-audio { flex-direction: row; align-items: center; gap: 10px; padding: 0; border: 0; }
.config-audio-label { color: #58708e; font-size: 12px; font-weight: 600; }
.config-audio-check { display: inline-flex; align-items: center; gap: 6px; color: #294466; font-size: 14px; cursor: pointer; }
.config-audio-check input { width: 15px; height: 15px; accent-color: var(--business-blue); }

/* 模型提示 / 参考视频自适应提示：整行浅蓝说明条。 */
.config-hint {
    grid-column: 1 / -1;
    margin: -4px 0 0;
    padding: 8px 10px;
    border-radius: 9px;
    background: #edf5ff;
    color: #537095;
    font-size: 12px;
    line-height: 1.5;
}

/* 预计时长：与发送按钮并列于最后一行。 */
.estimate {
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #58708e;
    font-size: 13px;
    align-self: end;
}

/* 发送按钮：品牌蓝圆形，与预计时长同行靠右。 */
.send {
    grid-column: 2;
    justify-self: end;
    align-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--business-blue);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.send:hover { background: #1d4ed8; transform: translateY(-1px); }
.send:disabled { background: #9db9e8; cursor: not-allowed; transform: none; }

/* 快捷创作入口：胶囊按钮组。 */
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.quick button {
    padding: 8px 14px;
    border: 1px solid var(--business-line);
    border-radius: 999px;
    background: #fff;
    color: #294466;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.quick button:hover { border-color: #8db4f3; background: #f5f9ff; }

/* 示例面板：标题 + 三张示例卡。 */
.panel { margin-top: 26px; }
.panel-head h2 { margin: 0 0 14px; color: var(--business-text); font-size: 18px; font-weight: 700; }
.examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.example {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--business-line);
    border-radius: 14px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.example:hover { border-color: #8db4f3; box-shadow: 0 10px 24px rgba(36, 77, 136, .08); transform: translateY(-2px); }
.example b { color: var(--business-text); font-size: 17px; font-weight: 700; }
.example span { color: var(--business-muted); font-size: 14px; line-height: 1.5; }

@media (max-width: 760px) {
    .hello { padding-top: 2px; }
    .hello p { font-size: 15px; }
    .bar { grid-template-columns: minmax(0, 1fr); }
    .bar > .config-field,
    .config-title,
    .config-hint,
    .estimate { grid-column: 1 / -1; }
    .send { grid-column: 1 / -1; justify-self: end; }
    .examples { grid-template-columns: 1fr; }
    .creation-mode-switch { display: flex; flex-wrap: wrap; }
}

/* ==========================================================================
   侧边栏亮色化：亮色/暗色主题下左侧均保持浅色侧栏 + 深色文字。
   全部使用 !important 强制覆盖此前的深蓝侧栏规则（不与日夜皮肤变量联动）。
   ========================================================================== */
.sidebar-wrapper {
    width: 250px !important;
    color: #294466 !important;
    background: #ffffff !important;
    border-right: 1px solid #e4edf7 !important;
    box-shadow: 0 2px 14px rgba(25, 57, 103, .04) !important;
}
.sidebar-wrapper.collapsed { width: 76px !important; }
.sidebar-wrapper .sidebar-header,
.sidebar-wrapper .sidebar-footer {
    border-color: rgba(13, 35, 69, .08) !important;
}
.sidebar-wrapper .sidebar-brand h1 { color: #17263b !important; }
.sidebar-wrapper .sidebar-brand p { color: #74859b !important; opacity: 1 !important; }
/* Logo 渐变与白色图标保持不变，作为侧栏唯一的品牌色块。 */
.sidebar-wrapper .sidebar-projector-logo {
    background: linear-gradient(135deg, #4e8cff, #1b63e9);
    color: #fff;
    box-shadow: 0 6px 16px rgba(38, 116, 229, .22);
    animation: none;
}
.sidebar-wrapper .sidebar-projector-icon { color: #fff; }

/* 折叠/主题切换等圆形按钮：浅色描边与文字。 */
.sidebar-toggle-button,
.sidebar-wrapper .sidebar-action-circle {
    border: 1px solid #dce6f2 !important;
    color: #4f6787 !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(25, 57, 103, .05) !important;
}
.sidebar-toggle-button:hover,
.sidebar-wrapper .sidebar-action-circle:hover {
    color: #1859be !important;
    background: #eef5ff !important;
    transform: none !important;
}
.sidebar-wrapper .sidebar-new-task-button {
    border: 0;
    color: #fff;
    background: var(--business-blue);
}
.sidebar-wrapper .sidebar-new-task-button:hover { background: #1d4ed8; }

/* 我的作品列表：深色文字，hover 浅蓝高亮。 */
.sidebar-wrapper .sidebar-work-list {
    max-height: min(calc(100vh - 332px), calc((64px * 7) + (10px * 6)));
}
.sidebar-wrapper .sidebar-task-item {
    color: #516b8a !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}
.sidebar-wrapper .sidebar-task-item:hover,
.sidebar-wrapper .sidebar-task-item.is-active {
    color: #1859be !important;
    background: #eef5ff !important;
    border-color: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}
.sidebar-wrapper .sidebar-task-item.needs-attention {
    color: #b45309 !important;
    background: #fff7ed !important;
}
.sidebar-wrapper .sidebar-task-time,
.sidebar-wrapper .sidebar-task-delete,
.sidebar-wrapper .sidebar-task-rename {
    color: #8aa0bd !important;
}
.sidebar-wrapper .sidebar-task-delete:hover,
.sidebar-wrapper .sidebar-task-delete:focus-visible {
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

/* 系统业务导航：浅色分隔线与深色条目。 */
.sidebar-wrapper .sidebar-system-nav {
    border-top: 1px solid rgba(13, 35, 69, .08) !important;
    padding-top: 13px;
}
.sidebar-wrapper .sidebar-nav-item {
    width: 100%;
    border: 0 !important;
    border-radius: 10px !important;
    color: #516b8a !important;
    background: transparent !important;
    text-align: left;
}
.sidebar-wrapper .sidebar-nav-item:hover,
.sidebar-wrapper .sidebar-nav-item.is-active {
    color: #1859be !important;
    background: #eaf2ff !important;
    transform: none !important;
}

/* 状态徽章：浅色侧栏下固定使用浅色方案，不受暗色主题变量影响。 */
.sidebar-wrapper .badge-queued {
    background: rgba(148, 163, 184, .15) !important;
    color: #64748b !important;
    border-color: rgba(148, 163, 184, .25) !important;
}
.sidebar-wrapper .badge-running {
    background: rgba(96, 165, 250, .15) !important;
    color: #2563eb !important;
    border-color: rgba(96, 165, 250, .3) !important;
}
.sidebar-wrapper .badge-done {
    background: rgba(37, 99, 235, .14) !important;
    color: #1d4ed8 !important;
    border-color: rgba(37, 99, 235, .34) !important;
}
.sidebar-wrapper .badge-failed,
.sidebar-wrapper .badge-cancelled,
.sidebar-wrapper .badge-partial {
    background: rgba(248, 113, 113, .15) !important;
    color: #dc2626 !important;
    border-color: rgba(248, 113, 113, .3) !important;
}

/* 原位更换素材：保留 @文件N 绑定，仅更新当前卡片的上传内容。 */
.btn-replace-media {
    flex: none;
    border: 1px solid #1d4ed8;
    border-radius: 7px;
    padding: 4px 8px;
    color: #ffffff;
    background: #2563eb;
    cursor: pointer;
    line-height: 1;
    font-weight: 700;
}
.btn-replace-media:hover { border-color: #1e40af; color: #ffffff; background: #1d4ed8; }
.media-pop-card .btn-replace-media { z-index: 2; border-color: #1d4ed8; color: #fff; background: #2563eb; }

/* 草稿素材预览：图片与视频均可在提交前放大核对。 */
.media-preview-trigger { cursor: zoom-in; }
.media-preview-dialog {
    width: min(900px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    background: #0f172a;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .45);
}
.media-preview-dialog::backdrop { background: rgba(15, 23, 42, .7); }
.media-preview-dialog > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
    padding: 10px 14px 10px 18px;
    color: #eff6ff;
    background: #12284b;
    font-size: 14px;
}
.media-preview-close {
    flex: none;
    padding: 7px 11px;
    border: 1px solid rgba(191, 219, 254, .45);
    border-radius: 8px;
    color: #fff;
    background: #2563eb;
    cursor: pointer;
    font-weight: 700;
}
.media-preview-content {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-height: calc(100vh - 100px);
    object-fit: contain;
    background: #020617;
}
