.result-text {
            line-height: 1.8;
            color: var(--ink);
        }

        /* 标题样式 */
        .result-text h1,
        .result-text h2,
        .result-text h3,
        .result-text h4,
        .result-text h5,
        .result-text h6 {
            margin: 1.5em 0 0.8em;
            font-weight: 700;
            line-height: 1.4;
            color: var(--ink);
        }

        .result-text h1 {
            font-size: 1.8em;
            border-bottom: 2px solid var(--line);
            padding-bottom: 0.3em;
        }

        .result-text h2 {
            font-size: 1.5em;
            border-bottom: 1px solid var(--line-2);
            padding-bottom: 0.3em;
        }

        .result-text h3 {
            font-size: 1.3em;
        }

        .result-text h4 {
            font-size: 1.1em;
        }

        .result-text h5 {
            font-size: 1em;
        }

        .result-text h6 {
            font-size: 0.9em;
            color: #555;
        }

        /* 段落间距 */
        .result-text p {
            margin: 0.8em 0;
        }

        /* 粗体和斜体 */
        .result-text strong {
            font-weight: 700;
            color: var(--ink);
        }

        .result-text em {
            font-style: italic;
            color: var(--ink-2);
        }

        /* 列表样式 */
        .result-text ul,
        .result-text ol {
            margin: 1em 0;
            padding-left: 2em;
        }

        .result-text li {
            margin: 0.5em 0;
            line-height: 1.6;
        }

        .result-text ul {
            list-style-type: disc;
        }

        .result-text ol {
            list-style-type: decimal;
        }

        /* 嵌套列表 */
        .result-text ul ul,
        .result-text ol ul {
            list-style-type: circle;
        }

        .result-text ul ul ul,
        .result-text ol ul ul {
            list-style-type: square;
        }

        /* 引用块 */
        .result-text blockquote {
            margin: 1em 0;
            padding: 0.8em 1.2em;
            border-left: 4px solid var(--brand);
            background: rgba(82, 110, 204, .05);
            border-radius: 0 8px 8px 0;
            color: var(--ink-2);
        }

        .result-text blockquote p {
            margin: 0.5em 0;
        }

        /* 分隔线 */
        .result-text hr {
            margin: 2em 0;
            border: none;
            border-top: 2px solid var(--line);
        }

        /* 链接样式 */
        .result-text a {
            color: var(--brand);
            text-decoration: none;
            border-bottom: 1px solid transparent;
            transition: .15s ease;
        }

        .result-text a:hover {
            border-bottom-color: var(--brand);
        }

        /* 行内代码 */
        .result-text code {
            padding: 2px 6px;
            margin: 0 2px;
            background: rgba(82, 110, 204, .08);
            border: 1px solid rgba(82, 110, 204, .15);
            border-radius: 4px;
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
            font-size: 0.9em;
            color: #c7254e;
        }

        /* 代码块容器 */
        .result-text pre {
            position: relative;
            margin: 1.2em 0;
            padding: 0;
            background: #282c34;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
        }

        .result-text pre code {
            display: block;
            padding: 1.2em;
            margin: 0;
            background: transparent;
            border: none;
            border-radius: 0;
            color: #abb2bf;
            font-size: 0.9em;
            line-height: 1.6;
            overflow-x: auto;
        }

        /* 代码块顶部工具栏 */
        .code-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 12px;
            background: #21252b;
            border-bottom: 1px solid rgba(255, 255, 255, .1);
        }

        .code-language {
            font-size: 11px;
            color: #abb2bf;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .code-copy-btn {
            padding: 4px 10px;
            background: rgba(255, 255, 255, .1);
            border: 1px solid rgba(255, 255, 255, .2);
            border-radius: 4px;
            color: #abb2bf;
            font-size: 11px;
            cursor: pointer;
            transition: .15s ease;
        }

        .code-copy-btn:hover {
            background: rgba(255, 255, 255, .15);
            border-color: rgba(255, 255, 255, .3);
        }

        .code-copy-btn.copied {
            background: rgba(22, 163, 74, .2);
            border-color: rgba(22, 163, 74, .4);
            color: #4ade80;
        }

        /* 表格样式 */
        .result-text table {
            width: 100%;
            margin: 1.5em 0;
            border-collapse: collapse;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
        }

        .result-text thead {
            background: linear-gradient(135deg, rgba(82, 110, 204, .12), rgba(124, 58, 237, .08));
        }

        .result-text th {
            padding: 12px 16px;
            text-align: left;
            font-weight: 700;
            color: var(--ink);
            border-bottom: 2px solid var(--line);
        }

        .result-text td {
            padding: 10px 16px;
            border-bottom: 1px solid var(--line-2);
            color: var(--ink-2);
        }

        .result-text tbody tr:hover {
            background: rgba(82, 110, 204, .03);
        }

        .result-text tbody tr:last-child td {
            border-bottom: none;
        }

        /* 图片样式 */
        .result-text img {
            max-width: 100%;
            height: auto;
            margin: 1em 0;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
        }

        /* 任务列表 */
        .result-text input[type="checkbox"] {
            margin-right: 0.5em;
            cursor: pointer;
        }

        /* 响应式 */
        @media (max-width: 768px) {
            .result-text {
                font-size: 14px;
            }

            .result-text pre code {
                font-size: 12px;
                padding: 1em;
            }

            .result-text table {
                font-size: 12px;
            }

            .result-text th,
            .result-text td {
                padding: 8px 10px;
            }
        }


        :root {
            --bg: #F6F8FC;
            --panel: rgba(255, 255, 255, .86);
            --panel-strong: rgba(255, 255, 255, .96);
            --ink: #0F172A;
            --ink-2: rgba(15, 23, 42, .72);
            --muted: rgba(15, 23, 42, .55);
            --line: rgba(15, 23, 42, .10);
            --line-2: rgba(15, 23, 42, .08);

            --brand: #526ECC;
            --brand-2: #7C3AED;
            --brand-soft: rgba(82, 110, 204, .12);
            --brand-soft-2: rgba(124, 58, 237, .10);

            --success: #16A34A;
            --warning: #F59E0B;

            --radius-card: 14px;
            --radius-pill: 999px;

            --shadow: 0 18px 60px rgba(2, 6, 23, .08);
            --shadow2: 0 10px 26px rgba(2, 6, 23, .08);

            --sidebar-w: 320px;
            --gap: 14px;
            --topbar-h: 56px;
        }

        * {
            box-sizing: border-box
        }

        html,
        body {
            height: 100%
        }

        body {
            margin: 0;
            background: var(--bg);
            color: var(--ink);
            font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
            overflow: hidden;
        }

        .bg {
            position: fixed;
            inset: 0;
            pointer-events: none;
            background:
                radial-gradient(900px 380px at 14% 8%, rgba(82, 110, 204, .20), transparent 58%),
                radial-gradient(820px 380px at 88% 14%, rgba(124, 58, 237, .14), transparent 58%),
                radial-gradient(900px 480px at 60% 84%, rgba(82, 110, 204, .12), transparent 60%),
                linear-gradient(180deg, rgba(255, 255, 255, .0), rgba(255, 255, 255, .45));
            opacity: 1;
        }

        .topbar {
            display: none;
            position: sticky;
            top: 0;
            z-index: 50;
            height: var(--topbar-h);
            padding: 10px 12px;
            background: var(--panel);
            backdrop-filter: blur(14px);
            border-bottom: 1px solid var(--line-2);
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .topbar .left {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0
        }

        .hamburger {
            width: 42px;
            height: 42px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .92);
            color: var(--ink);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .06);
        }

        .hamburger:hover {
            filter: brightness(.98)
        }

       /* 关键 CSS */
.top-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-left: 10px; /* 与汉堡按钮的间距 */
}

        .top-title b {
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        .top-title span {
            font-size: 11px;
            color: #555;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis
        }

        .topbar .right {
            display: flex;
            align-items: center;
            gap: 10px
        }

        .mini-pill {
            height: 36px;
            padding: 0 12px;
            border-radius: 999px;
            border: 1px solid rgba(82, 110, 204, .22);
            background: linear-gradient(135deg, rgba(82, 110, 204, .12), rgba(124, 58, 237, .08));
            color: var(--ink);
            display: flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
            cursor: pointer;
            user-select: none;
            font-size: 13px;
        }

.home-container {
    height: 100%;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    position: relative;
    transition: grid-template-columns .18s ease;
}

.home-container.sidebar-collapsed {
    grid-template-columns: 68px 1fr;
}

        .sidebar {
            height: 100%;
            background: var(--panel);
            backdrop-filter: blur(14px);
            border-right: 1px solid var(--line-2);
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 14px;
            overflow: hidden;
        }

.sidebar-logo {
    position: relative;
            border-radius: 16px;
            padding: 12px;
            background: rgba(255, 255, 255, .92);
            border: 1px solid var(--line);
            box-shadow: var(--shadow2);
            overflow: hidden;
        }

        .logo-shine {
            position: absolute;
            inset: -30%;
            background: linear-gradient(90deg, transparent, rgba(82, 110, 204, .10), transparent);
            transform: translateX(-60%);
            animation: shine 3.2s ease-in-out infinite;
            opacity: .9;
        }

        @keyframes shine {
            0% {
                transform: translateX(-60%) rotate(8deg)
            }

            50% {
                transform: translateX(60%) rotate(8deg)
            }

            100% {
                transform: translateX(60%) rotate(8deg)
            }
        }

        .logo-content {
            position: relative;
            display: flex;
            align-items: center;
            gap: 12px
        }

        .logo-img {
            width: 44px;
            height: 44px;
            border-radius: 14px;
            border: 1px solid rgba(15, 23, 42, .10);
            box-shadow: 0 14px 34px rgba(82, 110, 204, .18);
            object-fit: cover;
            background: rgba(255, 255, 255, .95);
        }

        .logo-text {
            font-size: 16px;
            font-weight: 900;
            letter-spacing: .2px
        }

        .logo-subtitle {
            display: block;
            margin-top: 2px;
            font-size: 13px;
            color: #555
        }

        .selector-container {
            border-radius: 16px;
            padding: 10px;
            background: rgba(255, 255, 255, .92);
            border: 1px solid var(--line);
            box-shadow: 0 10px 24px rgba(2, 6, 23, .06);
        }

        .primary-selector {
            display: flex;
            gap: 8px
        }

        .primary-item {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            height: 42px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .95);
            color: var(--ink-2);
            cursor: pointer;
            transition: .15s ease;
        }

        .primary-item:hover {
            filter: brightness(.98)
        }

        .primary-item-active {
            border-color: rgba(82, 110, 204, .35);
            background: linear-gradient(135deg, rgba(82, 110, 204, .18), rgba(124, 58, 237, .10));
            
            box-shadow: 0 14px 30px rgba(82, 110, 204, .12);
        }

        .primary-label {
            font-size: 13px;
            font-weight: 800
        }

        .secondary-selector {
            margin-top: 10px
        }

        .secondary-track {
            position: relative;
            display: flex;
            gap: 6px;
            padding: 6px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(2, 6, 23, .03);
            overflow: hidden;
        }

        .secondary-slider {
            position: absolute;
            top: 6px;
            bottom: 6px;
            left: 6px;
            width: calc(25% - 0.09375rem);
            border-radius: 12px;
            background: linear-gradient(135deg, rgba(82, 110, 204, .18), rgba(124, 58, 237, .12));
            border: 1px solid rgba(82, 110, 204, .22);
            transition: .18s ease;
            pointer-events: none;
        }

        .secondary-item {
            position: relative;
            flex: 1;
            height: 32px;
            border: 0;
            background: transparent;
            color: #555;
            border-radius: 12px;
            cursor: pointer;
            font-size: 13px;
            user-select: none;
        }

        .secondary-item-active {
            
            font-weight: 900
        }

        .model-list {
            flex: 1;
            overflow: auto;
            padding-right: 6px;
        }

        .model-list::-webkit-scrollbar {
            width: 8px
        }

        .model-list::-webkit-scrollbar-thumb {
            background: rgba(2, 6, 23, .10);
            border-radius: 999px;
        }

        .model-item {
            display: flex;
            gap: 12px;
            padding: 12px;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .92);
            margin-bottom: 10px;
            cursor: pointer;
            transition: .15s ease;
            position: relative;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);
        }

        .model-item:hover {
            filter: brightness(.99)
        }

        .model-item-active {
            border-color: rgba(30, 110, 204, .35);
            background: linear-gradient(135deg, rgba(30, 110, 255, .14), rgba(124, 58, 237, 0.5));
            box-shadow: 0 16px 40px rgba(30, 110, 255, .10);
        }

        .model-indicator {
            position: absolute;
            left: 10px;
            top: 10px;
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: var(--brand);
            box-shadow: 0 0 0 6px rgba(82, 110, 204, .12);
            display: none;
        }

        .model-item-active .model-indicator {
            display: block
        }

        .model-icon {
            width: 34px;
            height: 34px;
            border-radius: 12px;
            border: 1px solid var(--line);
            background: rgba(2, 6, 23, .03);
            object-fit: contain;
            padding: 6px;
        }

        .model-name-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px
        }

        .model-name {
            font-size: 13px;
            font-weight: 950
        }

        .model-tags {
            display: flex;
            gap: 6px;
            flex-wrap: wrap
        }

        .model-tag {
            font-size: 11px;
            padding: 4px 8px;
            border-radius: var(--radius-pill);
            border: 1px solid var(--line);
            color: rgba(15, 23, 42, .78);
            background: rgba(255, 255, 255, .92);
            white-space: nowrap;
        }

        .model-tag-video {
            background-color: rgba(34, 211, 238, .26);
            color: #000;
        }

        .model-tag-image {
            background-color: rgba(245, 158, 11, .28);
            color: #000;
        }

        .model-tag-audio {
            background-color: rgba(248, 113, 113, .22);
            color: #000;
        }

        .model-tag-chat {
            background-color: rgba(82, 110, 204, .28);
            color: #000;
        }

        .model-tag-agent {
            background-color: rgba(34, 197, 94, .24);
            color: #000;
        }

        .model-tag-idea {
            background-color: rgba(236, 72, 153, .22);
            color: #000;
        }

        .model-description {
            margin-top: 6px;
            color: #555;
            font-size: 13px;
            line-height: 1.5;
        }

        .user-section {
            border-radius: 16px;
            padding: 10px;
            background: rgba(255, 255, 255, .92);
            border: 1px solid var(--line);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);
        }

        .user-profile-button {
            flex: 1;
            display: flex;
            gap: 10px;
            align-items: center;
            border: 0;
            background: transparent;
            color: inherit;
            cursor: pointer;
            padding: 8px;
            border-radius: 14px;
        }

        .user-profile-button:hover {
            background: rgba(2, 6, 23, .03)
        }

        .user-avatar {
            width: 34px;
            height: 34px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(2, 6, 23, .03);
        }

        .user-display-name {
            font-size: 13px;
            font-weight: 950
        }

        .user-status-wrapper {
            display: flex;
            gap: 6px;
            align-items: center;
            margin-top: 2px
        }

        .user-status-dot {
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: var(--success);
            box-shadow: 0 0 0 6px rgba(22, 163, 74, .12);
        }

        .user-status-text {
            font-size: 13px;
            color: #555
        }

         .recharge-button {
            border: 1px solid rgba(245, 158, 11, .28);
            background: rgba(245, 158, 11, .10);
            color: var(--ink);
            border-radius: 14px;
            padding: 3px 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            box-shadow: 0 12px 30px rgba(245, 158, 11, .10);
            white-space: nowrap;
        }

        .recharge-button:hover {
            filter: brightness(.98)
        }

        .recharge-activity-tag {
            font-size: 11px;
            padding: 3px 8px;
            border-radius: var(--radius-pill);
            border: 1px solid rgba(245, 158, 11, .32);
            background: rgba(245, 158, 11, .10);
            color: rgba(146, 64, 14, .95);
        }

        .main-content {
            height: 100%;
            position: relative;
            padding: 14px;
            overflow: hidden;
            z-index: 1 !important;
            /* 设置一个较低的值 */
        }

        /* ✅ 确保弹窗在最高层级 */
        .layui-layer {
            z-index: 99999 !important;
        }

        .layui-layer-shade {
            z-index: 99998 !important;
        }

        .sora2-container {
            height: 100%;
            border-radius: 18px;
            border: 1px solid var(--line);
            background: var(--panel);
            backdrop-filter: blur(14px);
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden;
        }

        .edit-image-btn-absolute {
            position: absolute;
            left: 22px;
            top: 22px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .95);
            cursor: pointer;
            z-index: 5;
            user-select: none;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .06);
        }

        .edit-image-btn-absolute:hover {
            filter: brightness(.98)
        }

        .edit-btn-text {
            font-size: 13px;
            color: var(--ink-2)
        }

.sora2-main-content {
            height: 100%;
            display: flex;
            flex-direction: column;
            padding: 18px;
            gap: 14px;
            position: relative;
            padding-left: 318px;
            transition: padding-left .2s ease;
        }

.sora2-main-content.channel-panel-collapsed {
    padding-left: 18px;
}

.channel-workbench-panel {
    position: absolute;
    left: 18px;
    top: 18px;
    bottom: 18px;
    z-index: 8;
    width: 282px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #cfe0f2;
    border-radius: 14px;
    background: #f8fbff;
    box-shadow: 0 10px 28px rgba(30, 64, 175, .08);
    transition: transform .2s ease, opacity .2s ease;
}

.sora2-main-content.channel-panel-collapsed .channel-workbench-panel {
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
}

.channel-workbench-head {
    min-height: 64px;
    padding: 12px 10px 12px 14px;
    border-bottom: 1px solid #dbe8f5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.channel-workbench-head > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.channel-workbench-head strong {
    color: #172033;
    font-size: 15px;
    font-weight: 900;
}

.channel-workbench-head span {
    color: #64748b;
    font-size: 12px;
}

.channel-panel-close,
.channel-panel-open {
    border: 1px solid #cfe0f2;
    background: #fff;
    color: #315c91;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.channel-panel-close {
    width: 30px;
    height: 30px;
    border-radius: 7px;
}

.channel-panel-open {
    position: absolute;
    left: 8px;
    top: 92px;
    z-index: 9;
    width: 32px;
    height: 48px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 8px 20px rgba(30, 64, 175, .12);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity .18s ease, transform .18s ease;
}

.sora2-main-content.channel-panel-collapsed .channel-panel-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.channel-workbench-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: #93b9e7 transparent;
}

.channel-workbench-list::-webkit-scrollbar {
    width: 3px;
}

.channel-workbench-list::-webkit-scrollbar-thumb {
    background: #77a8df;
    border-radius: 999px;
}

.channel-workbench-card {
    width: 100%;
    margin: 0 0 8px;
    padding: 11px;
    border: 1px solid #d6e3f1;
    border-radius: 8px;
    background: #fff;
    color: #172033;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.channel-workbench-card:hover {
    border-color: #8bb9ea;
    transform: translateY(-1px);
}

.channel-workbench-card.active {
    border-color: #52a7f9;
    background: #eaf5ff;
    box-shadow: inset 3px 0 0 #2388eb;
}

.channel-workbench-name {
    display: block;
    overflow: hidden;
    color: #111827;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-workbench-meta {
    margin-top: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 11px;
}

.channel-workbench-cost {
    color: #dc2626;
    font-weight: 900;
}

.channel-workbench-rate {
    color: #16803c;
}

.channel-workbench-empty {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #718096;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.workbench-view-switch {
    margin-left: auto;
    padding: 3px;
    border: 1px solid #d5e2f0;
    border-radius: 9px;
    background: #f4f8fc;
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 0 0 auto;
}

#channelSelector {
    display: none !important;
}

.workbench-view-btn {
    height: 32px;
    padding: 0 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #52657b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
}

.workbench-view-btn.active {
    background: #fff;
    
    box-shadow: 0 2px 8px rgba(30, 64, 175, .12);
}

.channel-sample-stage {
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 18px;
}

.channel-sample-card {
    width: min(920px, 100%);
    border: 1px solid #d8e5f2;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.template-sample-item {
    cursor: pointer;
}

.template-sample-item .template-lazy-media,
.template-sample-item .template-video-badge,
.template-sample-item .template-media-placeholder,
.template-sample-item .template-audio-preview {
    pointer-events: none;
}

.channel-sample-media {
    position: relative;
    min-height: 300px;
    max-height: 58vh;
    background: #111827;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.channel-sample-media video,
.channel-sample-media img {
    display: block;
    width: 100%;
    max-height: 58vh;
    object-fit: contain;
    background: #111827;
}

.channel-sample-empty {
    min-height: 360px;
    padding: 28px;
    color: #64748b;
    background: #f7fbff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.channel-sample-empty i {
    color: #73aee8;
    font-size: 46px;
}

.channel-sample-empty strong {
    color: #1f2937;
    font-size: 16px;
}

.channel-sample-info {
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.channel-sample-copy {
    min-width: 0;
}

.channel-sample-copy h3 {
    margin: 0;
    color: #172033;
    font-size: 16px;
    font-weight: 900;
}

.channel-sample-copy p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}

.channel-sample-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.channel-sample-tags span {
    padding: 4px 7px;
    border: 1px solid #d6e3f1;
    border-radius: 6px;
    color: #42566d;
    background: #f8fbff;
    font-size: 11px;
    white-space: nowrap;
}

.channel-sample-tags .sample-cost {
    color: #dc2626;
    font-weight: 900;
}

@media (max-width: 1100px) {
    .sora2-main-content {
        padding-left: 264px;
    }

    .channel-workbench-panel {
        width: 228px;
    }
}

@media (max-width: 760px) {
    .sora2-main-content {
        padding-left: 12px;
    }

    .channel-workbench-panel {
        width: min(82vw, 300px);
        left: 8px;
        top: 8px;
        bottom: 8px;
        transform: translateX(calc(-100% - 16px));
        opacity: 0;
        pointer-events: none;
    }

    .sora2-main-content.channel-panel-mobile-open .channel-workbench-panel {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .channel-panel-open,
    .sora2-main-content.channel-panel-collapsed .channel-panel-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    .workbench-view-btn span {
        display: none;
    }

    .workbench-view-btn {
        width: 32px;
        padding: 0;
    }
}

        .top-model-info {
            display: flex;
            gap: 16px;
            align-items: center;
            padding: 18px;
            border-radius: 18px;
            border: 1px solid var(--line);
            background:
                radial-gradient(640px 220px at 30% 0%, rgba(82, 110, 204, .14), transparent 60%),
                radial-gradient(640px 220px at 90% 0%, rgba(124, 58, 237, .10), transparent 60%),
                rgba(255, 255, 255, .95);
            box-shadow: 0 12px 30px rgba(2, 6, 23, .05);
            height: 80px;
        }

        .icon-wrapper {
            width: 60px;
            height: 60px;
            border-radius: 22px;
            border: 1px solid var(--line);
            background: rgba(2, 6, 23, .03);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 12px 30px rgba(82, 110, 204, .10);
            overflow: hidden;
            flex: 0 0 auto;

        }

        .icon-img {
            width: 50px;
            height: 50px;
            object-fit: contain
        }

        .detail-text {
            font-size: 13px;
            color: var(--ink-2);
            line-height: 1.65;
            max-width: 76ch;
        }

        .scroll-container {
            flex: 1;
            border-radius: 18px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .92);
            overflow: auto;
            padding: 14px;
            box-shadow: 0 12px 30px rgba(2, 6, 23, .05);
        }

        .scroll-container::-webkit-scrollbar {
            width: 10px
        }

        .scroll-container::-webkit-scrollbar-thumb {
            background: rgba(2, 6, 23, .12);
            border-radius: 999px;
        }

        .scroll-content {
            width: min(1120px, 100%);
            margin: 0 auto;
            display: grid;
            gap: 12px;
        }

        .result-card {
            border-radius: 16px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            padding: 14px;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);

        }

        .result-meta {
            display: flex;
            gap: 10px;
            align-items: center;
            color: var(--ink-2);
            font-size: 13px;
            flex-wrap: wrap;
        }

        .badge {
            font-size: 11px;
            padding: 4px 8px;
            border-radius: 999px;
            border: 1px solid rgba(82, 110, 204, .22);
            background: rgba(82, 110, 204, .10);
            color: var(--ink);
        }

        .result-text {
            margin-top: 8px;
            color: #555;
            font-size: 13px;
            line-height: 1.6;
            word-break: break-word;
            white-space: pre-wrap;
        }

        .result-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .mini-btn {
            height: 34px;
            padding: 0 10px;
            border-radius: 12px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            color: var(--ink-2);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .mini-btn:hover {
            background: rgba(2, 6, 23, .03)
        }

        .result-media {
            margin-top: 10px;
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .result-media img {
            width: 220px;
            max-width: 100%;
            border-radius: 14px;
            border: 1px solid var(--line);
            box-shadow: 0 10px 24px rgba(2, 6, 23, .06);
            background: #fff;
        }

        .bottom-input-wrapper {
            border-radius: 18px;
            border: 1px solid #aaa;
            background: rgba(255, 255, 255, .92);
            padding: 0px;
            box-shadow: 0 12px 30px rgba(2, 6, 23, .05);
        }

        .ai-zhushou-group {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
            flex-wrap: wrap
        }

        .ai-zhushou-btn {
            width: 44px;
            height: 44px;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .95);
            cursor: pointer;
            overflow: hidden;
            padding: 0;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);
        }

        .ai-zhushou-btn img {
            width: 100%;
            height: 100%;
            object-fit: cover
        }

        .ai-zhushou-btn:hover {
            filter: brightness(.98)
        }

        .bottom-container {
            border-radius: 18px;
            border: 1px solid var(--line);
            background: rgba(2, 6, 23, .02);
            padding: 12px;
            position: relative;
        }

        .price-tag {

            padding: 6px 10px;
            border-radius: 999px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .95);
            display: flex;
            gap: 8px;
            align-items: center;
            font-size: 13px;
            color: var(--ink-2);
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);
        }

        .price-type {
            color: #555
        }

        .price-value {
            font-weight: 950
        }

        .top-section {
            display: grid;
            grid-template-columns: 220px 1fr;
            gap: 12px;
            margin-top: 5px;
        }

        /* ✅ 参考图容器（改为弹性布局） */
        /* ✅ 参考图容器 */
        .cankaotu {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-start;
            gap: 12px;
            padding: 12px;
            border: 2px dashed var(--line);
            border-radius: 16px;
            background: rgba(255, 255, 255, .92);
            cursor: pointer;
            transition: all 0.3s ease;
            min-height: 120px;
            width: 100%;
        }

        .cankaotu:hover {
            border-color: rgba(82, 110, 204, .35);
            background: rgba(82, 110, 204, .05);
        }

        /* ✅ 上传按钮区域 */
        .upload-trigger {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100px;
            height: 100px;
            border-radius: 12px;
            background: rgba(255, 255, 255, .96);
            border: 2px dashed var(--line);
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .cankaotu:hover .upload-trigger {
            border-color: rgba(82, 110, 204, .35);
            background: rgba(82, 110, 204, .08);
        }

        .plus-icon {
            font-size: 32px;
            color: var(--ink);
            font-weight: 300;
            line-height: 1;
            margin-bottom: 8px;
        }

        .frame-label {
            font-size: 13px;
            color: #555;
            font-weight: 500;
        }

        /* ✅ 参考图预览容器 */
        .ref-image-preview {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            flex: 1;
            min-width: 0;
        }

        /* 单个预览项 */
        .ref-preview-item {
            position: relative;
            width: 100px;
            height: 100px;
            border-radius: 12px;
            overflow: visible;
            background: rgba(255, 255, 255, .96);
            border: 2px solid var(--line);
            transition: all 0.3s ease;
            cursor: pointer;
            flex-shrink: 0;
        }

        .ref-preview-item:hover {
            border-color: rgba(82, 110, 204, .35);
            transform: translateY(-2px);
            box-shadow: 0 8px 16px rgba(2, 6, 23, .15);
            z-index: 10;
        }

        /* ✅ 图片容器 */
        .ref-preview-item .img-wrapper {
            width: 100%;
            height: 100%;
            border-radius: 10px;
            overflow: hidden;
            position: relative;
        }

        .ref-upload-overlay {
            position: absolute;
            inset: 0;
            z-index: 12;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            gap: 6px;
            padding: 8px;
            background: linear-gradient(180deg, rgba(15, 23, 42, .08), rgba(15, 23, 42, .55));
            pointer-events: none;
        }

        .ref-upload-chip {
            align-self: flex-start;
            max-width: 100%;
            height: 20px;
            padding: 0 7px;
            border-radius: 999px;
            background: rgba(255, 255, 255, .94);
            color: #1d4ed8;
            font-size: 11px;
            line-height: 20px;
            font-weight: 950;
            box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .ref-upload-track {
            height: 6px;
            border-radius: 999px;
            background: rgba(255, 255, 255, .48);
            overflow: hidden;
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
        }

        .ref-upload-track i {
            display: block;
            width: 0;
            height: 100%;
            border-radius: inherit;
            background: linear-gradient(90deg, #2563eb, #22c55e);
            transition: width .18s ease;
        }

        .ref-upload-success .ref-upload-chip {
            color: #15803d;
        }

        .ref-upload-success .ref-upload-track i {
            background: linear-gradient(90deg, #16a34a, #22c55e);
        }

        .ref-upload-error .ref-upload-chip {
            color: #b91c1c;
        }

        .ref-upload-error .ref-upload-track i {
            background: linear-gradient(90deg, #f97316, #ef4444);
        }

        /* 预览图片 */
        .ref-preview-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            pointer-events: none;
            display: block;
        }

        .ref-index-badge {
            position: absolute;
            left: 6px;
            top: 6px;
            z-index: 8;
            height: 20px;
            padding: 0 7px;
            border-radius: 7px;
            background: rgba(15, 23, 42, .72);
            color: #fff;
            font-size: 11px;
            line-height: 20px;
            font-weight: 900;
            box-shadow: 0 4px 10px rgba(15, 23, 42, .16);
        }

        /* ✅ 操作按钮容器（始终显示） */
        .ref-preview-actions {
            position: absolute;
            top: -8px;
            right: -8px;
            display: flex;
            gap: 4px;
            z-index: 20;
            opacity: 1;
            /* ✅ 始终显示 */
        }

        /* ✅ 操作按钮 */
        .ref-action-btn {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid #fff;
            background: rgba(255, 255, 255, .95);
            color: #333;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            transition: all 0.2s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
        }

        .ref-action-btn:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
        }

        .ref-action-btn.delete-btn {
            color: #ef4444;
            background: rgba(254, 242, 242, .95);
            border-color: #fecaca;
        }

        .ref-action-btn.delete-btn:hover {
            background: #ef4444;
            
            border-color: #ef4444;
        }

        .ref-action-btn.edit-btn {
            color: #3b82f6;
            background: rgba(239, 246, 255, .95);
            border-color: #bfdbfe;
        }

        .ref-action-btn.edit-btn:hover {
            background: #3b82f6;
            
            border-color: #3b82f6;
        }

        /* ✅ 响应式 */
        @media (max-width: 768px) {
            .cankaotu {
                flex-direction: column;
            }

            .upload-trigger {
                width: 100%;
            }

            .ref-image-preview {
                width: 100%;
            }
        }

        .plus-icon {
            width: 28px;
            height: 28px;
            border-radius: 10px;
            border: 1px solid var(--line);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--ink);
            font-weight: 900;
            background: rgba(2, 6, 23, .02);
        }

        .frame-label {
            color: var(--ink-2);
            font-size: 12px
        }

        .rich-input {
            min-height: 92px;
            border-radius: 16px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            padding: 12px 12px;
            color: var(--ink);
            outline: none;
            font-size: 13px;
            line-height: 1.6;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);
        }

        .rich-input:empty:before {
            content: attr(data-placeholder);
            color: rgba(15, 23, 42, .62);
            font-weight: 700;
        }

        .bottom-section {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-top: 12px;
        }

        .selectors-scroll {
            flex: 1;
            display: flex;
            gap: 10px;
            overflow: auto;
            padding-bottom: 2px;
            cursor: grab;
        }

        .selectors-scroll::-webkit-scrollbar {
            height: 8px
        }

        .selectors-scroll::-webkit-scrollbar-thumb {
            background: rgba(2, 6, 23, .12);
            border-radius: 999px;
        }

        .selector-btn {
            flex: 0 0 auto;
            height: 40px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            color: var(--ink-2);
            padding: 0 12px;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            white-space: nowrap;
            user-select: none;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);
            position: relative;
        }

        .selector-btn:hover {
            background: rgba(2, 6, 23, .03)
        }

        /* 下拉 */
        .selector-btn .dropdown {
            position: fixed;
            min-width: 160px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .98);
            box-shadow: var(--shadow2);
            display: none;
            z-index: 999;
        }


        .selector-btn .dropdown .item {
            padding: 10px 12px;
            font-size: 12px;
            color: var(--ink-2);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            cursor: pointer;
        }

        .selector-btn .dropdown .item:hover {
            background: rgba(2, 6, 23, .04)
        }

        .selector-btn .dropdown .item.active {
            background: linear-gradient(135deg, rgba(82, 110, 204, .14), rgba(124, 58, 237, .08));
            
            font-weight: 900;
        }

        .send-button {
                    width: 80px;
            height: 46px;
            border-radius: 16px;
            border: 1px solid rgba(82, 110, 204, .35);
            background: linear-gradient(135deg, rgba(82, 110, 204, .75), rgba(124, 58, 237, .45));
            cursor: pointer;
            box-shadow: 0 16px 34px rgba(82, 110, 204, .18);
            display: flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 auto;
            color:#fff;
        }

        .send-button:hover {
            filter: brightness(1.02)
        }

        .drawer-mask {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 80;
            background: rgba(2, 6, 23, .38);
        }

        .drawer {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 999;
            pointer-events: none;
        }

        .drawer .panel {
            pointer-events: auto;
            position: absolute;
            left: 10px;
            top: calc(env(safe-area-inset-top, 0px) + 10px);
            bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
            width: min(360px, calc(100vw - 20px));
            border-radius: 18px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            backdrop-filter: blur(16px);
            box-shadow: var(--shadow);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .drawer.on,
        .drawer-mask.on {
            display: block
        }

        @media (max-width: 980px) {
            .topbar {
                display: flex
            }

            .home-container {
                grid-template-columns: 1fr
            }

            .sidebar {
                display: none
            }

            .main-content {
                padding: 10px;
                height: calc(100vh - var(--topbar-h));
            }

            .sora2-container {
                border-radius: 16px
            }

            .sora2-main-content {
                padding: 12px
            }

            .edit-image-btn-absolute {
                left: 12px;
                top: 12px
            }

            .top-section {
                grid-template-columns: 1fr
            }

            .cankaotu {
                height: 66px
            }

            .rich-input {
                min-height: 84px
            }

            .scroll-container {
                margin-bottom: 10px;
            }
        }

        @media (max-width: 420px) {
            .price-tag {
                position: static;
                margin-bottom: 10px;
                justify-content: flex-start
            }

            .top-section {
                margin-top: 10px;
            }

            .send-button {
                width: 44px;
                height: 44px
            }
        }



        /*模态框*/
        /* ========== 弹窗样式 ========== */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 10000;
            background: rgba(2, 6, 23, 0.5);
            backdrop-filter: blur(8px);
            animation: fadeIn 0.2s ease;
        }

        .modal-overlay.show {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        .modal-container {
            width: min(480px, 100%);
            max-height: 90vh;
            border-radius: 18px;
            border: 1px solid var(--line);
            background: var(--panel-strong);
            backdrop-filter: blur(14px);
            box-shadow: var(--shadow);
            overflow: hidden;
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px) scale(0.95);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

.modal-header {
            padding: 18px 20px;
            border-bottom: 1px solid var(--line);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            background: linear-gradient(135deg, rgba(82, 110, 204, .08), rgba(124, 58, 237, .05));
        }

.layui-layer.task-history-layer {
    border-radius: 14px !important;
    overflow: hidden !important;
    border: 1px solid rgba(82, 110, 204, .16) !important;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .18) !important;
    background: #fff !important;
}

.layui-layer.task-history-layer .layui-layer-title {
    height: 50px !important;
    line-height: 50px !important;
    padding: 0 92px 0 22px !important;
    border-bottom: 1px solid rgba(82, 110, 204, .16) !important;
    background: linear-gradient(135deg, rgba(82, 110, 204, .08), rgba(124, 58, 237, .05)) !important;
    color: #17345d !important;
    font-size: 16px !important;
    font-weight: 900 !important;
}

.layui-layer.task-history-layer .task-history-layer-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #17345d;
}

.layui-layer.task-history-layer .task-history-layer-title i {
    color: #17345d;
    font-size: 15px;
}

.layui-layer.task-history-layer .layui-layer-setwin {
    top: 17px !important;
    right: 18px !important;
}

.layui-layer.task-history-layer .layui-layer-setwin a {
    opacity: .72;
}

.layui-layer.consumption-record-layer .layui-layer-content {
    background: #f7fbff !important;
}

.consumption-record-panel {
    height: 100%;
    padding: 12px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.consumption-record-toolbar {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(82, 110, 204, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.consumption-record-filter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.consumption-record-filter strong {
    height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid #dbe7f4;
    border-radius: 8px;
    background: #fff;
    color: #17345d;
    font-size: 13px;
}

.consumption-refresh-btn {
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #2f8df4, #17a2e8);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(47, 141, 244, .18);
}

.consumption-refresh-btn:hover {
    filter: brightness(1.04);
}

.consumption-record-layer .layui-table-view {
    border: 1px solid rgba(82, 110, 204, .12) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
}

.consumption-record-layer .layui-table-header th {
    background: #f1f7ff !important;
    color: #17345d !important;
    font-weight: 900 !important;
}

.consumption-record-layer .layui-table-cell {
    color: #475569;
    font-size: 13px;
}

.consumption-record-layer .layui-table-body tr:nth-child(even) {
    background: #f8fbff;
}

.consumption-record-layer .layui-table-body tr:hover {
    background: #eef7ff !important;
}

.consumption-record-layer .layui-badge.layui-bg-red {
    background: #ff4d2e !important;
    color: #fff !important;
    font-weight: 900;
}

.consumption-record-layer .layui-badge.layui-bg-green {
    background: #009f88 !important;
    color: #fff !important;
    font-weight: 900;
}

.consumption-record-layer .layui-laypage .layui-laypage-curr .layui-laypage-em {
    background-color: #12b8a6 !important;
}

.layui-layer.auth-layer .layui-layer-content,
.layui-layer.user-center-layer .layui-layer-content {
    background: linear-gradient(180deg, #f7fbff, #ffffff) !important;
    border-radius: 0 0 14px 14px !important;
}

.layui-layer.auth-layer .modern-form {
    padding: 18px;
    background: transparent;
}

.layui-layer.auth-layer .form-group {
    margin-bottom: 14px;
}

.layui-layer.auth-layer .form-label {
    color: #17345d;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 7px;
}

.layui-layer.auth-layer .form-label i {
    color: #2f8df4;
}

.layui-layer.auth-layer .form-input {
    height: 42px;
    border: 1px solid #dbe7f4;
    border-radius: 9px;
    background: rgba(255, 255, 255, .92);
    color: #0f172a;
    font-weight: 700;
}

.layui-layer.auth-layer .form-input:focus {
    border-color: #2f8df4;
    box-shadow: 0 0 0 3px rgba(47, 141, 244, .12);
}

.layui-layer.auth-layer .form-input::placeholder {
    color: #64748b;
    font-weight: 600;
}

.layui-layer.auth-layer .captcha-wrapper {
    gap: 10px;
}

.layui-layer.auth-layer .captcha-image {
    width: 112px !important;
    height: 42px !important;
    border-color: #dbe7f4;
    border-radius: 9px;
    background: #fff;
}

.layui-layer.auth-layer .submit-button {
    height: 44px;
    margin-top: 18px;
    border-radius: 9px;
    background: linear-gradient(135deg, #2f8df4, #12b8a6) !important;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(47, 141, 244, .20);
}

.layui-layer.auth-layer .submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(47, 141, 244, .26);
}

.layui-layer.auth-layer .link-text {
    color: #17345d;
    font-size: 13px;
    font-weight: 900;
}

.layui-layer.auth-layer .link-text:hover {
    
}

.layui-layer.auth-layer .login-toggle-password {
    color: #64748b;
}

.layui-layer.auth-layer .login-toggle-password:hover,
.layui-layer.auth-layer .login-toggle-password.active {
    background: rgba(47, 141, 244, .10);
    
}

.user-center-panel {
    padding: 18px;
    background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.user-center-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(82, 110, 204, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.user-center-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    border: 1px solid #dbe7f4;
    object-fit: cover;
    background: #fff;
}

.user-center-meta {
    min-width: 0;
}

.user-center-name {
    color: #17345d;
    font-size: 17px;
    font-weight: 950;
    line-height: 1.35;
    word-break: break-all;
}

.user-center-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

.user-center-state span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, .14);
}

.user-center-card {
    margin-top: 12px;
    padding: 13px 14px;
    border: 1px solid rgba(82, 110, 204, .12);
    border-radius: 12px;
    background: #ffffff;
}

.user-center-card-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #17345d;
    font-size: 13px;
    font-weight: 950;
}

.user-center-card-label i {
    color: #ef4444;
}

.user-center-card-no {
    margin-top: 7px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.55;
    word-break: break-all;
}

.user-center-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.user-center-btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.user-center-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.user-center-btn-card {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 10px 20px rgba(239, 68, 68, .16);
}

.user-center-btn-logout {
    background: linear-gradient(135deg, #2f8df4, #12b8a6);
    box-shadow: 0 10px 20px rgba(47, 141, 244, .18);
}

        .modal-title {
            font-size: 16px;
            font-weight: 900;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .modal-close {
            width: 32px;
            height: 32px;
            border-radius: 10px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .95);
            color: var(--ink-2);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: .15s ease;
        }

        .modal-close:hover {
            background: rgba(2, 6, 23, .05);
        }

        .modal-body {
            padding: 20px;
            max-height: calc(90vh - 140px);
            overflow: auto;
        }

        .modal-body::-webkit-scrollbar {
            width: 8px;
        }

        .modal-body::-webkit-scrollbar-thumb {
            background: rgba(2, 6, 23, .12);
            border-radius: 999px;
        }

        .modal-input-group {
            margin-bottom: 16px;
        }

        .modal-label {
            display: block;
            font-size: 13px;
            font-weight: 800;
            color: var(--ink);
            margin-bottom: 8px;
        }

        .modal-input {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--line);
            border-radius: 14px;
            background: rgba(255, 255, 255, .96);
            color: var(--ink);
            font-size: 14px;
            outline: none;
            transition: .15s ease;
        }

        .modal-input:focus {
            border-color: rgba(82, 110, 204, .35);
            box-shadow: 0 0 0 4px rgba(82, 110, 204, .10);
        }

        .modal-input::placeholder {
            color: rgba(15, 23, 42, .40);
        }

        .modal-hint {
            margin-top: 6px;
            font-size: 12px;
            color: #555;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .modal-actions {
            display: grid;
            gap: 10px;
            margin-top: 20px;
        }

        .modal-btn {
            width: 100%;
            height: 46px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            color: var(--ink);
            font-size: 14px;
            font-weight: 800;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: .15s ease;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);
        }

        .modal-btn:hover {
            filter: brightness(.98);
        }

        .modal-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .modal-btn-primary {
            border-color: rgba(82, 110, 204, .35);
            background: linear-gradient(135deg, rgba(82, 110, 204, .75), rgba(124, 58, 237, .45));
            color: #fff;
            box-shadow: 0 16px 34px rgba(82, 110, 204, .18);
        }

.modal-btn-warning {
    border-color: rgba(245, 158, 11, .28);
    background: linear-gradient(135deg, rgba(245, 158, 11, .85), rgba(217, 119, 6, .65));
    color: #fff;
    box-shadow: 0 16px 34px rgba(245, 158, 11, .18);
}

.buy-card-modal .modal-title i {
    color: #d97706;
}

.buy-card-intro,
.buy-card-empty-tip {
    margin: 0;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
}

.buy-card-contact-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.buy-card-contact-item {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid rgba(245, 158, 11, .22);
    border-radius: 10px;
    background: #fffaf0;
}

.buy-card-contact-item > i {
    width: 24px;
    color: #d97706;
    font-size: 19px;
    text-align: center;
}

.buy-card-contact-label {
    color: #8a5a12;
    font-size: 13px;
    font-weight: 900;
}

.buy-card-contact-value {
    margin-left: auto;
    min-width: 0;
    color: #17345d;
    font-size: 14px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.buy-card-empty-tip {
    margin-top: 14px;
}

.buy-card-actions {
    margin-top: 16px;
}

        .modal-result {
            margin-top: 16px;
            padding: 14px;
            border-radius: 14px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            display: none;
        }

        .modal-result.show {
            display: block;
        }

        .modal-result-title {
            font-size: 13px;
            font-weight: 800;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .modal-result-content {
            font-size: 12px;
            color: #555;
            line-height: 1.6;
            white-space: pre-wrap;
        }

        .modal-result-success {
            border-color: rgba(22, 163, 74, .28);
            background: rgba(22, 163, 74, .08);
        }

        .modal-result-success .modal-result-title {
            color: var(--success);
        }

        .modal-result-error {
            border-color: rgba(239, 68, 68, .28);
            background: rgba(254, 226, 226, .5);
        }

        .modal-result-error .modal-result-title {
            color: #991b1c;
        }

        .modal-result-error .modal-result-content {
            color: #991b1c;
        }

        @media (max-width: 520px) {
            .modal-container {
                border-radius: 16px;
            }

            .modal-header {
                padding: 14px 16px;
            }

            .modal-body {
                padding: 16px;
            }
        }



        /*========================视频和图片列表======================
/* ========== 图片/视频网格布局 ========== */
        /* 修改这个 CSS 规则（原来是 240px，改为 200px） */
        .media-grid-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            /* ✅ 从 240px 改为 200px */
            gap: 16px;
            padding: 20px;
        }

        .media-card {
            border-radius: 16px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            overflow: hidden;
            box-shadow: 0 10px 24px rgba(2, 6, 23, .05);
            transition: .15s ease;
            position: relative;
            cursor: pointer;
        }

        .media-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 16px 34px rgba(2, 6, 23, .08);
        }

        /* 图片卡片 */
        .media-card-image {
            aspect-ratio: 1;
            position: relative;
            overflow: hidden;
        }

        .media-card-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        /* 视频卡片 */
        .media-card-video {
            aspect-ratio: 16/9;
            position: relative;
            overflow: hidden;
            background: #c6e7ff;
            border: 2px solid #c6e7ff;
        }

        .media-card-video video {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
        }

        .media-card-video .play-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, .3);
            opacity: 1;
            transition: .2s ease;
        }

        .media-card-video:hover .play-overlay {
            opacity: 1;
        }

        .play-icon {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: rgba(255, 255, 255, .95);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: var(--brand);
            box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
        }

        /* 加载中占位 */
        .media-placeholder {
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(82, 110, 204, .08), rgba(124, 58, 237, .05));
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            position: relative;
            overflow: hidden;
        }

        .media-placeholder::before {
            content: '';
            position: absolute;
            inset: -50%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% {
                transform: translateX(-100%) rotate(45deg);
            }

            100% {
                transform: translateX(100%) rotate(45deg);
            }
        }

        .media-placeholder-icon {
            width: 64px;
            height: 64px;
            border-radius: 16px;
            background: rgba(255, 255, 255, .9);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
            color: var(--brand);
            position: relative;
            z-index: 1;
        }

        .media-placeholder-text {
            font-size: 13px;
            color: var(--ink-2);
            font-weight: 600;
            position: relative;
            z-index: 1;
            color: #f00;
        }

        .media-placeholder-spinner {
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* 媒体信息栏 */
        .media-info {
            padding: 12px;
            background: rgba(255, 255, 255, .98);
        }

        .media-time {
            font-size: 11px;
            color: #555;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .media-actions {
            margin-top: 8px;
            display: flex;
            gap: 8px;
        }

        .media-btn {
            flex: 1;
            height: 32px;
            border-radius: 10px;
            border: 1px solid var(--line);
            background: rgba(255, 255, 255, .96);
            color: var(--ink-2);
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: .15s ease;
        }

        .media-btn:hover {
            background: rgba(2, 6, 23, .03);
        }

        /* 响应式 */
        @media (max-width: 768px) {
            .media-grid-container {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 12px;
                padding: 12px;
            }
        }

        /* ✅ 下载提示动画 */
        @keyframes slideIn {
            from {
                transform: translateX(400px);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes slideOut {
            from {
                transform: translateX(0);
                opacity: 1;
            }

            to {
                transform: translateX(400px);
                opacity: 0;
            }
        }

        /* ✅ 媒体提示文字（用于显示 prompt） */
        .media-prompt {
            font-size: 11px;
            color: #555;
            margin-top: 4px;
            line-height: 1.4;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            word-break: break-word;
        }




        /* ✅ 视频预览样式 */
        .ref-preview-item video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            pointer-events: none;
            display: block;
        }

        /* ✅ 视频播放按钮覆盖层 */
        .ref-video-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, .3);
            opacity: 0;
            transition: opacity 0.2s ease;
            pointer-events: none;
        }

        .ref-preview-item:hover .ref-video-overlay {
            opacity: 1;
        }

        .ref-video-play-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: rgba(255, 255, 255, .95);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: var(--brand);
            box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
        }

        /* ✅ 文件类型标签 */
        .ref-file-type {
            position: absolute;
            bottom: 4px;
            left: 4px;
            padding: 2px 6px;
            border-radius: 4px;
            background: rgba(0, 0, 0, .7);
            color: #fff;
            font-size: 10px;
            font-weight: 600;
            z-index: 10;
        }
        
          /* 打开模态框按钮 */
        #openModalBtn {
            margin: 40px;
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            background: #409eff;
            color: #fff;
            cursor: pointer;
        }



        .character-modal-mask {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;

            /* 或者你想更绝对一点 */
            /* width: 100vw; */
            /* height: 100vh; */

            background: rgba(0, 0, 0, 0.4);
            display: none;
            /* 初始隐藏 */
            /* display: flex; /* 打开时记得是 flex */
            align-items: center;
            justify-content: center;
            z-index: 999;
        }

        /* 模态框本体 */
        .character-modal {
            background: #fff;
            border-radius: 6px;
            width: 800px;
            height: 500px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .character-modal-header {
            padding: 10px 16px;
            border-bottom: 1px solid #e5e5e5;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
        }

        .character-modal-close {
            cursor: pointer;
            border: none;
            background: transparent;
            font-size: 18px;
            line-height: 1;
        }

        .character-modal-body {
            flex: 1;
            display: flex;
            min-height: 0;
            /* 让内部 flex 子元素正确滚动 */
        }

        /* 左侧区域 */
        .character-modal-left {
            width: 50%;
            border-right: 1px solid #e5e5e5;
            display: flex;
            flex-direction: column;
            background: #fff;
        }

        .character-left-header {
            padding: 10px 12px;
            border-bottom: 1px solid #f2f2f2;
            flex-shrink: 0;
        }

        .character-btn {
            padding: 4px 10px;
            font-size: 13px;
            border-radius: 4px;
            border: 1px solid #409eff;
            background: #409eff;
            color: #fff;
            cursor: pointer;
        }

        .character-btn.btn-ghost {
            background: #fff;
            color: #409eff;
        }

        .character-role-list {
            flex: 1;
            overflow-y: auto;
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .character-role-list li {
            padding: 6px 6px;
            border-bottom: 1px solid #f5f5f5;
            cursor: pointer;
            font-size: 14px;
            color: #333;
            transition: background 0.2s ease;
        }

        .character-role-list li:hover {
            background: #f9f9f9;
        }

        .character-role-list li.active {
            background: #eef3ff;
            font-weight: 600;
        }

        /* 右侧区域 */
        .character-modal-right {
            flex: 1;
            padding: 16px;
            background: #fafafa;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .character-right-inner {
            width: 100%;
            max-width: 360px;
        }

        .character-right-tip {
            font-size: 13px;
            color: #666;
            margin-bottom: 8px;
        }

        .character-right-image {
            max-width: 100%;
            max-height: 360px;
            object-fit: contain;
            border-radius: 4px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        /* 添加角色表单 */
        .character-form-item {
            margin-bottom: 16px;
            font-size: 14px;
        }

        .character-form-item label {
            display: block;
            margin-bottom: 6px;
            color: #333;
        }

        .character-form-item input[type="text"] {
            width: 100%;
            padding: 6px 8px;
            border-radius: 4px;
            border: 1px solid #dcdfe6;
            box-sizing: border-box;
            outline: none;
            font-size: 14px;
        }

        .character-form-item input[type="text"]:focus {
            border-color: #409eff;
        }

        .character-form-actions {
            text-align: right;
        }



        /* 底部按钮栏 */
        .character-modal-footer {
            padding: 12px 16px;
            border-top: 1px solid #e5e5e5;
            background: #fff;
            text-align: right;
            flex-shrink: 0;
        }

        .character-modal-footer .character-btn {
            margin-left: 10px;
        }


        .layui-btn .layui-btn-sm {
            padding: 0px;
            margin: 0px;
        }


        .input-footer {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            /* ✅ 关键：右对齐 */
            gap: 8px;
            /* 两个元素之间的间距 */
            margin-top: 8px;
        }

        .price-tag {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 6px 12px;
            background: linear-gradient(135deg, #ddd 0%, #eee 100%);
            border-radius: 20px;
            font-size: 13px;
            color: #fff;
            white-space: nowrap;
            color:#000;
        }

        .price-type {
            opacity: 0.9;
        }

        .price-value {
            font-weight: 600;
        }

        .send-button {
            width: 80px;
            height: 46px;
            border-radius: 16px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            flex-shrink: 0;
            color:#fff;
        }

        .send-button:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }

        .send-button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        /* 表单容器 */
        .modern-form {
            padding: 24px;
            background: #fff;
        }

        /* 表单组 */
        .form-group {
            margin-bottom: 20px;
        }

        /* 表单标签 */
        .form-label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            margin-bottom: 8px;
        }

        .form-label i {
            color: #667eea;
            font-size: 16px;
        }

        /* 表单输入框 */
        .form-input {
            width: 100%;
            height: 42px;
            padding: 0 16px;
            font-size: 14px;
            color: #1f2937;
            background: #f9fafb;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            outline: none;
            transition: all 0.3s ease;
            box-sizing: border-box;
        }

        .form-input:focus {
            background: #fff;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .form-input::placeholder {
            color: #9ca3af;
        }

        /* 密码输入框容器 */
        .password-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .password-wrapper .form-input {
            padding-right: 45px;
        }

        /* 密码显示切换按钮 */
        .login-toggle-password {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #9ca3af;
            transition: all 0.3s ease;
            border-radius: 6px;
        }

        .login-toggle-password:hover {
            background: rgba(102, 126, 234, 0.1);
            
        }

        .login-toggle-password.active {
            
        }

        .login-toggle-password.active i::before {
            content: "\f070";
            /* fa-eye-slash */
        }

        /* 验证码容器 */
        .captcha-wrapper {
            display: flex;
            gap: 12px;
            align-items: center;
        }




        /* ✅ 验证码图片样式 */
        .captcha-image {
            width: 120px !important;
            /* 固定宽度 */
            height: 40px !important;
            /* 固定高度 */
            border-radius: 4px;
            cursor: pointer;
            border: 1px solid #e5e7eb;
            object-fit: contain;
            /* 保持图片比例 */
            display: block;
            /* 块级元素 */
            background: #f9fafb;
            /* 背景色 */
        }

        /* ✅ 验证码输入框 */
        .captcha-input {
            flex: 1;
            min-width: 0;
        }

        .captcha-image:hover {
            border-color: #667eea;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
        }

        /* 提交按钮 */
        .submit-button {
            width: 100%;
            height: 46px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            border-radius: 8px;
            color: #fff;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.3s ease;
            margin-top: 24px;
        }

        .submit-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
        }

        .submit-button:active {
            transform: translateY(0);
        }

        /* 表单底部 */
        .form-footer {
            margin-top: 16px;
            text-align: center;
        }

        .link-text {
            color: #667eea;
            font-size: 13px;
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .link-text:hover {
            
            text-decoration: underline;
        }

        /* Layer 弹窗样式覆盖 */
        .layui-layer-title {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #fff;
            font-weight: 600;
            border-radius: 8px 8px 0 0;
        }

        .layui-layer-content {
            border-radius: 0 0 8px 8px;
        }
        .result-media{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}

.media-image img{
  width:120px;
  height:90px;
  object-fit:cover;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.08);
  display:block;
}

.media-video{
  width:120px;
  height:90px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.08);
  background:#f6f7f9;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color:#333;
}

.media-video-icon{
  width:36px;
  height:36px;
  border-radius:50%;
  background:#352ddf;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
}

.media-video-text{
  margin-top:6px;
  font-size:12px;
  opacity:.8;
}



/* ========== 医疗风格主题色 ========== */
:root {
    --bg: #F0F8FF;  /* 浅蓝医疗背景 */
    --panel: rgba(255, 255, 255, .95);
    --panel-strong: rgba(255, 255, 255, .98);
    --ink: #1E3A5F;  /* 深蓝文字 */
    --ink-2: rgba(30, 58, 95, .75);
    --muted: rgba(30, 58, 95, .60);
    --line: rgba(30, 100, 180, .12);
    --line-2: rgba(30, 100, 180, .08);

    --brand: #2E7BC4;  /* 医疗蓝 */
    --brand-2: #1E5A8E;  /* 深医疗蓝 */
    --brand-soft: rgba(46, 123, 196, .12);
    --brand-soft-2: rgba(30, 90, 142, .10);

    --success: #28A745;  /* 健康绿 */
    --warning: #FFC107;  /* 警告黄 */
    --danger: #DC3545;   /* 危险红 */

    --medical-green: #4CAF50;  /* 医疗绿 */
    --medical-red: #E74C3C;    /* 医疗红 */
    
    --radius-card: 12px;
    --radius-pill: 999px;
    --shadow: 0 8px 24px rgba(30, 100, 180, .10);
    --shadow2: 0 4px 12px rgba(30, 100, 180, .08);
}

/* ========== 医疗风格背景 ========== */
body {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: 
        linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 50%, #E1F5FE 100%),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><defs><pattern id="cross" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M10 0v20M0 10h20" stroke="%232196F3" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect fill="url(%23cross)" width="100" height="100"/></svg>');
    background-attachment: fixed;
    color: #1E3A5F;
    min-height: 100vh;
}

.bg {
    background:
        radial-gradient(circle at 20% 20%, rgba(33, 150, 243, .15), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(46, 125, 196, .12), transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, .0), rgba(255, 255, 255, .3));
}

/* ========== Logo区域医疗风格 ========== */
.sidebar-logo {
    background: linear-gradient(135deg, #ffffff 0%, #E3F2FD 100%);
    border: 2px solid rgba(33, 150, 243, .2);
    box-shadow: 0 4px 12px rgba(33, 150, 243, .15);
}

.logo-shine {
    background: linear-gradient(90deg, transparent, rgba(33, 150, 243, .15), transparent);
}

.logo-img {
    border: 2px solid rgba(33, 150, 243, .3);
    box-shadow: 0 4px 12px rgba(33, 150, 243, .2);
}

/* ========== 主按钮医疗风格 ========== */
.primary-item-active {
    border-color: rgba(33, 150, 243, .4);
    background: linear-gradient(135deg, rgba(33, 150, 243, .18), rgba(25, 118, 210, .12));
    
    box-shadow: 0 4px 12px rgba(33, 150, 243, .2);
}

.secondary-slider {
    background: linear-gradient(135deg, rgba(33, 150, 243, .20), rgba(25, 118, 210, .15));
    border: 1px solid rgba(33, 150, 243, .3);
}

/* ========== 模型卡片医疗风格 ========== */
.model-item-active {
    border-color: rgba(33, 150, 243, .4);
    background: linear-gradient(135deg, rgba(227, 242, 253, .95), rgba(187, 222, 251, .85));
    box-shadow: 0 6px 16px rgba(33, 150, 243, .15);
}

.model-indicator {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, .15);
}

/* ========== 标签医疗风格 ========== */
.model-tag-video {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    color: #1565C0;
    border-color: rgba(33, 150, 243, .3);
}

.model-tag-image {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: #2E7D32;
    border-color: rgba(76, 175, 80, .3);
}

.model-tag-audio {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #B91C1C;
    border-color: rgba(248, 113, 113, .35);
}

.model-tag-chat {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #E65100;
    border-color: rgba(255, 152, 0, .3);
}

/* ========== 顶部信息栏医疗风格 ========== */
.top-model-info {
    background:
        radial-gradient(circle at 30% 20%, rgba(33, 150, 243, .12), transparent 60%),
        radial-gradient(circle at 90% 30%, rgba(25, 118, 210, .08), transparent 60%),
        linear-gradient(135deg, #ffffff 0%, #E3F2FD 100%);
    border: 2px solid rgba(33, 150, 243, .15);
    box-shadow: 0 4px 12px rgba(33, 150, 243, .10);
}

.icon-wrapper {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border: 2px solid rgba(33, 150, 243, .2);
    box-shadow: 0 4px 12px rgba(33, 150, 243, .15);
}

/* ========== 发送按钮医疗风格 ========== */
.send-button {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border: 2px solid rgba(25, 118, 210, .3);
    box-shadow: 
        0 4px 12px rgba(33, 150, 243, .25),
        inset 0 1px 0 rgba(255, 255, 255, .3);
}

.send-button:hover {
    background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
    box-shadow: 
        0 6px 16px rgba(33, 150, 243, .35),
        inset 0 1px 0 rgba(255, 255, 255, .3);
    transform: translateY(-1px);
}

/* ========== 充值按钮医疗风格 ========== */
.recharge-button {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    border: 2px solid rgba(76, 175, 80, .3);
    box-shadow: 0 4px 12px rgba(76, 175, 80, .20);
}

.recharge-button:hover {
    background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
}

/* ========== 小按钮医疗风格 ========== */
.mini-pill {
    background: linear-gradient(135deg, rgba(33, 150, 243, .12), rgba(25, 118, 210, .08));
    border-color: rgba(33, 150, 243, .25);
    color: #1565C0;
}

/* ========== 输入框医疗风格 ========== */
.rich-input {
    border: 2px solid rgba(33, 150, 243, .2);
    background: rgba(255, 255, 255, .98);
}

.rich-input:focus {
    border-color: rgba(33, 150, 243, .4);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .1);
}

/* ========== 参考图区域医疗风格 ========== */
.cankaotu {
    border: 2px dashed rgba(33, 150, 243, .3);
    background: linear-gradient(135deg, #ffffff 0%, #E3F2FD 50%, #ffffff 100%);
}

.cankaotu:hover {
    border-color: rgba(33, 150, 243, .5);
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 50%, #E3F2FD 100%);
}

.upload-trigger {
    background: linear-gradient(135deg, #ffffff, #E3F2FD);
    border: 2px dashed rgba(33, 150, 243, .3);
}

/* ========== 结果卡片医疗风格 ========== */
.result-card {
    background: linear-gradient(135deg, #ffffff 0%, #F5F5F5 100%);
    border: 1px solid rgba(33, 150, 243, .12);
    box-shadow: 0 2px 8px rgba(33, 150, 243, .08);
}

.badge {
    background: linear-gradient(135deg, rgba(33, 150, 243, .15), rgba(25, 118, 210, .10));
    border-color: rgba(33, 150, 243, .25);
    color: #1565C0;
    font-weight: 600;
}

/* ========== 进度条医疗风格 ========== */
.progress-fill {
    background: linear-gradient(90deg, #2196F3, #1976D2, #0D47A1);
}

/* ========== 表单医疗风格 ========== */
.form-input:focus {
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .1);
}

.submit-button {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    box-shadow: 0 4px 12px rgba(33, 150, 243, .3);
}

.submit-button:hover {
    background: linear-gradient(135deg, #1E88E5 0%, #1565C0 100%);
    box-shadow: 0 6px 16px rgba(33, 150, 243, .4);
}

/* ========== 链接医疗风格 ========== */
.link-text {
    color: #2196F3;
}

.link-text:hover {
    
}

/* ========== 模态框医疗风格 ========== */
.modal-btn-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border-color: rgba(33, 150, 243, .4);
    box-shadow: 0 4px 12px rgba(33, 150, 243, .25);
}

/* ========== 媒体卡片医疗风格 ========== */
.media-card {
    background: #ffffff;
    border: 1px solid rgba(33, 150, 243, .15);
    box-shadow: 0 2px 8px rgba(33, 150, 243, .10);
}

.media-card:hover {
    border-color: rgba(33, 150, 243, .3);
    box-shadow: 0 4px 16px rgba(33, 150, 243, .15);
}

/* ========== 添加医疗十字标识 ========== */
.logo-text::before {
    content: '⚕️';
    margin-right: 8px;
    font-size: 18px;
}

/* ========== 任务进度卡片 ========== */
.media-grid-container .task-progress-card {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    padding: 0;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    overflow: visible;
    cursor: default;
}

.media-grid-container .task-progress-card:hover {
    transform: none;
    border-color: #dbe4f0;
    box-shadow: none;
}

.task-card-title {
    display: none;
}

.task-card-body {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(240px, .9fr) auto;
    grid-template-areas:
        "id status actions"
        "prompt progress actions"
        "time progressText actions"
        "tags tags actions"
        "chat chat chat"
        "refs refs refs";
    align-items: center;
    column-gap: 14px;
    row-gap: 5px;
    margin: 0;
    padding: 9px 12px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    min-height: 0;
}

.task-id {
    grid-area: id;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-prompt,
.task-update-time,
.task-ref-title {
    margin-top: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.25;
    min-width: 0;
}

.task-prompt {
    grid-area: prompt;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-update-time {
    grid-area: time;
    font-size: 11px;
}

.task-tags {
    grid-area: tags;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    margin-top: 0;
    min-width: 0;
    overflow: hidden;
}

.sidebar-collapse-toggle {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 3;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(47, 141, 244, .22);
    border-radius: 9px;
    background: rgba(255, 255, 255, .94);
    color: #17345d;
    cursor: pointer;
    box-shadow: none;
}

.sidebar-collapse-toggle:hover {
    background: #eef7ff;
    border-color: rgba(47, 141, 244, .38);
}

.task-tags span,
.task-status-line span {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 190px;
    min-height: 20px;
    padding: 2px 6px;
    border: 1px solid #b9cdfb;
    border-radius: 4px;
    background: #eef3ff;
    color: #315ed6;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-tags b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-tags .task-kind-image {
    border-color: #a7d8b4;
    background: #ecfdf3;
    color: #208548;
}

.task-tags .task-kind-video {
    border-color: #9fd0ff;
    background: #eef7ff;
    color: #1769c2;
}

.task-tags .task-kind-chat {
    border-color: #dcc7ff;
    background: #f6f0ff;
    color: #6b3fc8;
}

.task-status-line {
    grid-area: status;
    margin-top: 0;
    min-width: 0;
}

.task-status-line span {
    max-width: 100%;
}

.task-progress-track {
    grid-area: progress;
    width: 100%;
    height: 6px;
    margin-top: 0;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.task-progress-track .progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4f7cff, #42b8ff);
    transition: width .25s ease;
}

.task-progress-row {
    grid-area: progressText;
    display: flex;
    justify-content: space-between;
    align-self: end;
    margin-top: -2px;
    color: #64748b;
    font-size: 11px;
}

.task-ref-section {
    grid-area: refs;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px solid #eef2f7;
}

.task-chat-result {
    grid-area: chat;
    min-width: 0;
    margin-top: 3px;
    padding-top: 6px;
    border-top: 1px solid #eef2f7;
}

.task-chat-result .result-text {
    max-height: 96px;
    margin-top: 0;
    overflow: auto;
    color: #334155;
    font-size: 12px;
    line-height: 1.45;
}

.task-chat-result .result-media {
    margin-top: 6px;
}

.task-ref-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 0;
    min-width: 0;
    overflow: hidden;
}

.task-ref-thumb {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    overflow: hidden;
    border-radius: 5px;
    background: #000;
    position: relative;
}

.task-ref-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.task-ref-thumb .task-ref-file-label {
    position: absolute;
    left: 50%;
    bottom: 1px;
    transform: translateX(-50%);
    padding: 1px 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff !important;
    font-size: 9px !important;
    line-height: 1 !important;
    max-width: calc(100% - 4px) !important;
}

.task-open-ref {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    margin-top: 0;
    padding: 3px 9px;
    border: 1px solid #dbe4f0;
    border-radius: 5px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.task-actions {
    grid-area: actions;
    justify-self: end;
    margin-top: 0;
}

.task-actions .media-btn {
    height: 30px;
    padding: 0 10px;
    white-space: nowrap;
}

.task-progress-card .media-placeholder {
    display: none;
}

@media (max-width: 900px) {
    .task-card-body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "id"
            "prompt"
            "status"
            "progress"
            "progressText"
            "tags"
            "time"
            "chat"
            "refs"
            "actions";
        gap: 6px;
        padding: 10px;
    }

    .task-actions {
        justify-self: stretch;
    }

    .task-actions .media-btn {
        width: 100%;
    }
}

/* final override: unfinished history cards use one consistent orange color */
.history-task-card[data-status="processing"],
.history-task-card[data-status="running"],
.history-task-card[data-status="waiting"],
.history-task-card[data-status="pending"],
.history-task-card[data-status="submitted"],
.history-task-card[data-status="processing"] .task-card-body,
.history-task-card[data-status="running"] .task-card-body,
.history-task-card[data-status="waiting"] .task-card-body,
.history-task-card[data-status="pending"] .task-card-body,
.history-task-card[data-status="submitted"] .task-card-body,
.history-task-card[data-status="processing"] .history-result-panel,
.history-task-card[data-status="running"] .history-result-panel,
.history-task-card[data-status="waiting"] .history-result-panel,
.history-task-card[data-status="pending"] .history-result-panel,
.history-task-card[data-status="submitted"] .history-result-panel,
.history-task-card[data-status="processing"] .history-ref-section,
.history-task-card[data-status="running"] .history-ref-section,
.history-task-card[data-status="waiting"] .history-ref-section,
.history-task-card[data-status="pending"] .history-ref-section,
.history-task-card[data-status="submitted"] .history-ref-section,
.history-task-card[data-status="processing"] .history-result-thumb,
.history-task-card[data-status="running"] .history-result-thumb,
.history-task-card[data-status="waiting"] .history-result-thumb,
.history-task-card[data-status="pending"] .history-result-thumb,
.history-task-card[data-status="submitted"] .history-result-thumb,
.task-progress-card[data-status="processing"],
.task-progress-card[data-status="running"],
.task-progress-card[data-status="waiting"],
.task-progress-card[data-status="pending"],
.task-progress-card[data-status="submitted"],
.task-progress-card[data-status="processing"] .task-card-body,
.task-progress-card[data-status="running"] .task-card-body,
.task-progress-card[data-status="waiting"] .task-card-body,
.task-progress-card[data-status="pending"] .task-card-body,
.task-progress-card[data-status="submitted"] .task-card-body,
.task-progress-card[data-status="processing"] .history-result-panel,
.task-progress-card[data-status="running"] .history-result-panel,
.task-progress-card[data-status="waiting"] .history-result-panel,
.task-progress-card[data-status="pending"] .history-result-panel,
.task-progress-card[data-status="submitted"] .history-result-panel,
.task-progress-card[data-status="processing"] .history-ref-section,
.task-progress-card[data-status="running"] .history-ref-section,
.task-progress-card[data-status="waiting"] .history-ref-section,
.task-progress-card[data-status="pending"] .history-ref-section,
.task-progress-card[data-status="submitted"] .history-ref-section,
.task-progress-card[data-status="processing"] .history-result-thumb,
.task-progress-card[data-status="running"] .history-result-thumb,
.task-progress-card[data-status="waiting"] .history-result-thumb,
.task-progress-card[data-status="pending"] .history-result-thumb,
.task-progress-card[data-status="submitted"] .history-result-thumb {
    background: #fff7e6 !important;
    border-color: #f6c86f !important;
}

.history-task-card[data-status="processing"] .task-status-text,
.history-task-card[data-status="running"] .task-status-text,
.history-task-card[data-status="waiting"] .task-status-text,
.history-task-card[data-status="pending"] .task-status-text,
.history-task-card[data-status="submitted"] .task-status-text,
.task-progress-card[data-status="processing"] .task-status-text,
.task-progress-card[data-status="running"] .task-status-text,
.task-progress-card[data-status="waiting"] .task-status-text,
.task-progress-card[data-status="pending"] .task-status-text,
.task-progress-card[data-status="submitted"] .task-status-text {
    background: #ffedc2 !important;
    border-color: #f6c86f !important;
    color: #b45309 !important;
}

/* debug ultimate fix: asset library layout and @ image picker */
.asset-bank-panel {
    width: min(820px, calc(100vw - 28px)) !important;
    overflow-x: hidden !important;
}

.asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)) !important;
    align-items: stretch !important;
}

.asset-thumb {
    min-width: 0 !important;
    overflow: hidden !important;
}

.asset-thumb-main {
    min-width: 0 !important;
}

.asset-thumb-media {
    aspect-ratio: 4 / 3 !important;
}

.asset-thumb-label {
    max-width: 100% !important;
}

.asset-remote-mark {
    justify-self: start;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .12);
    color: #15803d;
    font-size: 11px;
    font-weight: 900;
    line-height: 20px;
}

.asset-local-mark {
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}

.asset-thumb .asset-row-actions {
    justify-content: space-between !important;
}

.asset-thumb .asset-row-actions button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 0 4px !important;
}

.asset-prompt-list {
    overflow: hidden !important;
}

.asset-row {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.asset-prompt-row {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
}

.asset-prompt-text {
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.asset-prompt-text strong,
.asset-prompt-text small {
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.at-image-picker {
    max-width: min(560px, calc(100vw - 24px)) !important;
    max-height: min(420px, calc(100vh - 80px)) !important;
    overflow: auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
}

.at-image-group {
    display: grid;
    gap: 6px;
}

.at-image-group-title {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.at-image-option {
    width: 100% !important;
    justify-content: flex-start !important;
}

.at-image-loading {
    padding: 10px 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

/* debug final override: first/last upload frames and selector row */
.top-section {
    grid-template-columns: 124px minmax(0, 1fr) !important;
    align-items: stretch !important;
}

.top-section:has(.cankaotu.upload-mode-first-last) {
    grid-template-columns: 256px minmax(0, 1fr) !important;
}

.top-section.top-section-first-last {
    grid-template-columns: 256px minmax(0, 1fr) !important;
}

.cankaotu.upload-mode-first-last {
    display: grid !important;
    grid-template-columns: repeat(2, 124px) !important;
    gap: 8px !important;
}

.cankaotu.upload-mode-first-last .upload-trigger {
    width: 124px !important;
}

.selectors-scroll {
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    gap: 8px !important;
    padding: 0 0 4px !important;
}

.selectors-scroll > .selector-btn {
    flex: 0 0 auto !important;
    min-width: 76px !important;
    max-width: 260px !important;
}

.selectors-scroll > .composer-asset-btn {
    flex: 0 0 auto !important;
    min-width: 108px !important;
    max-width: 118px !important;
}

.current-model-pill {
    flex: 0 1 190px !important;
    min-width: 150px !important;
    max-width: 190px !important;
}

.current-model-pill .selector-text,
#channelSelector .selector-text {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

#channelSelector {
    max-width: 300px !important;
}

#channelSelector .selector-text {
    max-width: 220px !important;
}

.bottom-section {
    min-width: 0 !important;
}

@supports not selector(:has(*)) {
    .top-section {
        grid-template-columns: minmax(124px, 256px) minmax(0, 1fr) !important;
    }
}

/* debug final overrides: upload box and asset management */
.cankaotu {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    min-height: 124px !important;
}

.cankaotu .upload-trigger {
    width: 124px !important;
    min-height: 124px !important;
    height: 124px !important;
    border: 2px dashed rgba(82, 170, 255, .45) !important;
    border-radius: 14px !important;
    background: rgba(245, 251, 255, .92) !important;
}

.cankaotu:hover {
    background: transparent !important;
}

.cankaotu:hover .upload-trigger {
    border-color: rgba(82, 170, 255, .72) !important;
    background: rgba(236, 248, 255, .96) !important;
}

.composer-asset-btn {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: 40px !important;
}

.asset-section-title {
    gap: 8px !important;
}

.asset-section-title span {
    margin-right: auto !important;
}

.asset-section-title button {
    height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.asset-section-title button:hover {
    background: rgba(82, 110, 204, .08);
}

.asset-thumb {
    position: relative;
    padding: 8px !important;
}

.asset-thumb-main {
    border: 0;
    padding: 0;
    background: transparent;
    width: 100%;
    display: grid;
    gap: 6px;
    cursor: pointer;
    color: #0f172a;
}

.asset-row-actions {
    display: flex;
    gap: 5px;
    flex: 0 0 auto;
}

.asset-row-actions button {
    width: auto;
    min-width: 38px;
    height: 26px;
    padding: 0 7px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, .10);
    background: rgba(255, 255, 255, .94);
    color: #475569;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.asset-row-actions button:hover {
    
    border-color: rgba(82, 110, 204, .35);
}

.asset-prompt-text {
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: #0f172a;
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 3px;
}

.asset-prompt-text strong,
.asset-prompt-text small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-prompt-text small {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

/* debug: keep composer tools inside the input box */
.bottom-input-wrapper {
    max-width: calc(100% - 16px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: visible !important;
}

.top-section {
    grid-template-columns: 124px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding-right: 46px !important;
}

.rich-input {
    padding-right: 48px !important;
    max-height: 170px !important;
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(82, 110, 204, .35) transparent !important;
}

.rich-input::-webkit-scrollbar {
    width: 4px !important;
}

.rich-input::-webkit-scrollbar-track {
    background: transparent !important;
}

.rich-input::-webkit-scrollbar-thumb {
    background: rgba(82, 110, 204, .35) !important;
    border-radius: 999px !important;
}

.prompt-quick-tools {
    right: 10px !important;
    top: 12px !important;
    transform: none !important;
    display: grid !important;
    gap: 8px !important;
}

.prompt-tool-btn {
    width: 32px !important;
    height: 32px !important;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .08) !important;
}

.prompt-counter {
    top: auto !important;
    right: 96px !important;
    bottom: 16px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #475569 !important;
    font-weight: 900 !important;
    z-index: 14 !important;
}

.input-footer {
    position: relative !important;
    padding-right: 70px !important;
}

.price-tag {
    margin-right: 8px !important;
}

.selector-btn {
    color: #111827 !important;
    font-weight: 800 !important;
}

.selector-btn .selector-text,
.selector-btn i {
    color: #111827 !important;
}

.selector-btn .dropdown .item,
.selector-btn .dropdown .item span,
.selector-btn .dropdown .dropdown-main-text {
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

.selector-btn .dropdown .dropdown-credit-text,
.selector-btn .dropdown .item small {
    color: #dc2626 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

.composer-asset-btn {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    min-width: 104px !important;
    max-width: 116px !important;
    height: 40px !important;
    flex: 0 0 110px !important;
    transform: none !important;
    z-index: 1 !important;
}

.composer-asset-btn .selector-text {
    display: inline-block !important;
    max-width: 64px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

@media (max-width: 900px) {
    .top-section {
        grid-template-columns: 1fr !important;
        padding-right: 0 !important;
    }

    .prompt-quick-tools {
        right: 8px !important;
        top: 8px !important;
        display: flex !important;
    }

    .prompt-counter {
        right: 88px !important;
        bottom: 14px !important;
    }
}

/* final status color lock: unfinished cards must be one-piece orange */
.media-grid-container .history-task-card.history-record-image[data-status="processing"],
.media-grid-container .history-task-card.history-record-image[data-status="running"],
.media-grid-container .history-task-card.history-record-image[data-status="waiting"],
.media-grid-container .history-task-card.history-record-image[data-status="pending"],
.media-grid-container .history-task-card.history-record-image[data-status="submitted"],
.media-grid-container .history-task-card.history-record-video[data-status="processing"],
.media-grid-container .history-task-card.history-record-video[data-status="running"],
.media-grid-container .history-task-card.history-record-video[data-status="waiting"],
.media-grid-container .history-task-card.history-record-video[data-status="pending"],
.media-grid-container .history-task-card.history-record-video[data-status="submitted"],
.media-grid-container .task-progress-card.history-record-image[data-status="processing"],
.media-grid-container .task-progress-card.history-record-image[data-status="running"],
.media-grid-container .task-progress-card.history-record-image[data-status="waiting"],
.media-grid-container .task-progress-card.history-record-image[data-status="pending"],
.media-grid-container .task-progress-card.history-record-image[data-status="submitted"],
.media-grid-container .task-progress-card.history-record-video[data-status="processing"],
.media-grid-container .task-progress-card.history-record-video[data-status="running"],
.media-grid-container .task-progress-card.history-record-video[data-status="waiting"],
.media-grid-container .task-progress-card.history-record-video[data-status="pending"],
.media-grid-container .task-progress-card.history-record-video[data-status="submitted"] {
    background: #fff7e6 !important;
    border-color: #f6c86f !important;
    box-shadow: none !important;
}

.media-grid-container .history-task-card.history-record-image[data-status="processing"] .task-card-body,
.media-grid-container .history-task-card.history-record-image[data-status="running"] .task-card-body,
.media-grid-container .history-task-card.history-record-image[data-status="waiting"] .task-card-body,
.media-grid-container .history-task-card.history-record-image[data-status="pending"] .task-card-body,
.media-grid-container .history-task-card.history-record-image[data-status="submitted"] .task-card-body,
.media-grid-container .history-task-card.history-record-video[data-status="processing"] .task-card-body,
.media-grid-container .history-task-card.history-record-video[data-status="running"] .task-card-body,
.media-grid-container .history-task-card.history-record-video[data-status="waiting"] .task-card-body,
.media-grid-container .history-task-card.history-record-video[data-status="pending"] .task-card-body,
.media-grid-container .history-task-card.history-record-video[data-status="submitted"] .task-card-body,
.media-grid-container .history-task-card.history-record-image[data-status="processing"] .history-result-panel,
.media-grid-container .history-task-card.history-record-image[data-status="running"] .history-result-panel,
.media-grid-container .history-task-card.history-record-image[data-status="waiting"] .history-result-panel,
.media-grid-container .history-task-card.history-record-image[data-status="pending"] .history-result-panel,
.media-grid-container .history-task-card.history-record-image[data-status="submitted"] .history-result-panel,
.media-grid-container .history-task-card.history-record-video[data-status="processing"] .history-result-panel,
.media-grid-container .history-task-card.history-record-video[data-status="running"] .history-result-panel,
.media-grid-container .history-task-card.history-record-video[data-status="waiting"] .history-result-panel,
.media-grid-container .history-task-card.history-record-video[data-status="pending"] .history-result-panel,
.media-grid-container .history-task-card.history-record-video[data-status="submitted"] .history-result-panel,
.media-grid-container .history-task-card.history-record-image[data-status="processing"] .history-ref-section,
.media-grid-container .history-task-card.history-record-image[data-status="running"] .history-ref-section,
.media-grid-container .history-task-card.history-record-image[data-status="waiting"] .history-ref-section,
.media-grid-container .history-task-card.history-record-image[data-status="pending"] .history-ref-section,
.media-grid-container .history-task-card.history-record-image[data-status="submitted"] .history-ref-section,
.media-grid-container .history-task-card.history-record-video[data-status="processing"] .history-ref-section,
.media-grid-container .history-task-card.history-record-video[data-status="running"] .history-ref-section,
.media-grid-container .history-task-card.history-record-video[data-status="waiting"] .history-ref-section,
.media-grid-container .history-task-card.history-record-video[data-status="pending"] .history-ref-section,
.media-grid-container .history-task-card.history-record-video[data-status="submitted"] .history-ref-section,
.media-grid-container .history-task-card.history-record-image[data-status="processing"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-image[data-status="running"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-image[data-status="waiting"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-image[data-status="pending"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-image[data-status="submitted"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-video[data-status="processing"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-video[data-status="running"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-video[data-status="waiting"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-video[data-status="pending"] .history-result-thumb,
.media-grid-container .history-task-card.history-record-video[data-status="submitted"] .history-result-thumb {
    background: #fff7e6 !important;
    border-color: #f6c86f !important;
}

/* debug ultimate fix: asset button must stay in selector flow */
.selectors-scroll {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.selectors-scroll > #composerAssetBtn.composer-asset-btn {
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    min-width: 112px !important;
    max-width: 120px !important;
    height: 40px !important;
    flex: 0 0 112px !important;
    transform: none !important;
    z-index: 1 !important;
}

.selectors-scroll > .selector-btn {
    position: relative !important;
    flex-shrink: 0 !important;
}

.selectors-scroll > #activeModelSelector {
    flex: 0 1 190px !important;
    min-width: 150px !important;
    max-width: 190px !important;
}

/* debug: model name is already shown in the top info area */
#activeModelSelector,
.current-model-pill {
    display: none !important;
}

#add_character_btn {
    display: none !important;
}

/* debug: unify single reference and first/last frame upload sizes */
.top-section {
    --ref-upload-w: 112px;
    --ref-upload-h: 124px;
    grid-template-columns: var(--ref-upload-w) minmax(0, 1fr) !important;
}

.top-section.top-section-first-last,
.top-section:has(.cankaotu.upload-mode-first-last) {
    grid-template-columns: calc(var(--ref-upload-w) * 2 + 8px) minmax(0, 1fr) !important;
}

.cankaotu,
.cankaotu.upload-mode-single-ref,
.cankaotu.upload-mode-first-last {
    min-height: var(--ref-upload-h) !important;
}

.cankaotu.upload-mode-first-last {
    grid-template-columns: repeat(2, var(--ref-upload-w)) !important;
    gap: 8px !important;
}

.cankaotu .upload-trigger,
.cankaotu.upload-mode-first-last .upload-trigger,
.cankaotu.upload-mode-single-ref .upload-trigger {
    width: var(--ref-upload-w) !important;
    min-width: var(--ref-upload-w) !important;
    max-width: var(--ref-upload-w) !important;
    height: var(--ref-upload-h) !important;
    min-height: var(--ref-upload-h) !important;
    max-height: var(--ref-upload-h) !important;
}

/* debug: larger model icons without inner padding */
.model-item > img.model-icon {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    object-fit: cover !important;
    background: #fff !important;
}

.model-item > .model-css-icon {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    padding: 0 !important;
    border-radius: 10px !important;
}

.model-item > .model-css-icon i {
    font-size: 16px !important;
}

/* debug: cleaner logo block */
.sidebar-logo {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 8px 4px !important;
}

.sidebar-logo .logo-shine {
    display: none !important;
}

/* ========== 用户状态点医疗风格 ========== */
.user-status-dot {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, .15);
}

/* ========== 顶部栏医疗风格 ========== */
.topbar {
    background: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(227, 242, 253, .90));
    border-bottom: 2px solid rgba(33, 150, 243, .15);
}

/* ========== 侧边栏医疗风格 ========== */
.sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(227, 242, 253, .90) 100%);
    border-right: 2px solid rgba(33, 150, 243, .15);
}

/* ========== 选择器容器医疗风格 ========== */
.selector-container {
    background: linear-gradient(135deg, #ffffff 0%, #E3F2FD 100%);
    border: 1px solid rgba(33, 150, 243, .2);
}

/* ========== 医疗图标添加 ========== */
.medical-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2L4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5l-8-3zm-1 14h2v2h-2v-2zm0-8h2v6h-2V8z"/></svg>') center/contain;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2L4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5l-8-3zm-1 14h2v2h-2v-2zm0-8h2v6h-2V8z"/></svg>') center/contain;
}

.all-history-button {
            border: 1px solid rgba(245, 158, 11, .28);
            background: rgba(245, 158, 11, .10);
            color: var(--ink);
            border-radius: 14px;
            padding: 3px 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            box-shadow: 0 12px 30px rgba(245, 158, 11, .10);
            white-space: nowrap;
        }

        .all-history-button:hover {
            filter: brightness(.98)
        }
/* debug UI refinements */
.model-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, .18) transparent;
}

.model-list::-webkit-scrollbar {
    width: 4px;
}

.model-list::-webkit-scrollbar-track {
    background: transparent;
}

.model-list::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, .18);
    border-radius: 999px;
}

.model-item {
    gap: 9px;
    padding: 9px 10px;
    margin-bottom: 7px;
    border-radius: 12px;
}

.model-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    padding: 5px;
}

.model-info {
    min-width: 0;
}

.model-name-row {
    align-items: flex-start;
    gap: 6px;
}

.model-name {
    min-width: 0;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 800;
    white-space: normal;
    overflow-wrap: anywhere;
}

.model-tags {
    flex: 0 0 auto;
    gap: 3px;
}

.model-tag {
    font-size: 9px;
    line-height: 1.2;
    padding: 2px 5px;
}

.model-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.35;
}

.model-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 20px 10px;
    color: rgba(15, 23, 42, .55);
    font-size: 12px;
    text-align: center;
}

.model-loading-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid rgba(37, 99, 235, .18);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: model-list-spin .75s linear infinite;
}

@keyframes model-list-spin {
    to {
        transform: rotate(360deg);
    }
}

.model-loading-error {
    color: #b42318;
}

.top-model-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 12px;
    background: rgba(255, 255, 255, .7);
}

.top-model-info .icon-wrapper {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.top-model-info .icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 9px;
}

.top-model-info .detail-text {
    min-width: 0;
    flex: 0 1 240px;
}

.top-bulk-progress-slot {
    flex: 1 1 auto;
    min-width: 220px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.top-workbench-refresh {
    flex: 0 0 auto;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border: 1px solid rgba(47, 141, 244, .22);
    border-radius: 10px;
    background: #fff;
    color: #17345d;
    font-size: 12px;
    font-weight: 950;
    cursor: pointer;
    box-shadow: none;
}

.top-workbench-refresh:hover {
    background: #eef7ff;
    border-color: rgba(47, 141, 244, .36);
}

.top-workbench-refresh:disabled {
    opacity: .68;
    cursor: not-allowed;
}

.top-workbench-refresh.is-loading i {
    color: #2f8df4;
}

.top-model-name {
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.3;
}

.top-model-title-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.top-model-title-row .top-model-name {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-channel-name {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(360px, 34vw);
    padding: 3px 8px;
    border: 1px solid rgba(47, 141, 244, .22);
    border-radius: 6px;
    background: #eef7ff;
    color: #185ca8;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-channel-name[hidden] {
    display: none !important;
}

.task-poll-countdown {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: max-content;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    padding: 2px 8px;
    border: 1px solid #d8e5f5;
    border-radius: 5px;
    background: #fff;
    color: #526579;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.task-poll-countdown[hidden] {
    display: none !important;
}

.task-poll-countdown i {
    color: #2f8df4;
    font-size: 10px;
}

.task-poll-countdown b {
    min-width: 18px;
    color: #185ca8;
    font-size: 11px;
    text-align: center;
}

.task-poll-countdown.is-refreshing i {
    animation: task-poll-countdown-spin .8s linear infinite;
}

@keyframes task-poll-countdown-spin {
    to {
        transform: rotate(360deg);
    }
}

.top-model-info #topModelDesc {
    margin-top: 2px;
    color: var(--ink-2);
    font-size: 11px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.selector-btn .dropdown {
    z-index: 2000;
    max-height: min(260px, 42vh);
    overflow-y: auto;
    scrollbar-width: thin;
}

.selector-btn .dropdown::-webkit-scrollbar {
    width: 4px;
}

.selector-btn .dropdown .item {
    min-height: 34px;
    font-size: 11px;
    line-height: 1.3;
}

.selector-btn .dropdown .item small {
    color: rgba(15, 23, 42, .55);
    font-size: 10px;
    flex: 0 0 auto;
}

.current-model-pill {
    max-width: 180px;
}

.current-model-pill .selector-text {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
}

#channelSelector {
    max-width: 260px;
}

#channelSelector .selector-text {
    max-width: 205px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .top-model-info {
        margin-bottom: 7px;
    }

    .current-model-pill {
        max-width: 135px;
    }

    #channelSelector {
        max-width: 170px;
    }

    #channelSelector .selector-text {
        max-width: 118px;
    }
}

/* Final debug overrides: compact account footer and task rows */
.sidebar .user-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 6px !important;
    padding: 8px !important;
    overflow: hidden;
}

.sidebar .user-profile-button {
    flex: 1 1 auto;
    min-width: 0;
    gap: 7px !important;
    padding: 6px !important;
    overflow: hidden;
}

.sidebar .user-profile-button > div {
    min-width: 0;
}

.sidebar .user-avatar {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px;
    border-radius: 10px !important;
}

.sidebar .user-display-name,
.sidebar .user-status-text {
    max-width: 78px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar .all-history-button,
.sidebar .recharge-button {
    flex: 0 1 auto;
    min-width: 0;
    height: 28px;
    padding: 0 7px !important;
    border-radius: 999px !important;
    font-size: 11px;
    box-shadow: none !important;
}

.sidebar .all-history-button span,
.sidebar .recharge-button span {
    max-width: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar .all-history-button i,
.sidebar .recharge-button i {
    flex: 0 0 auto;
}

.sidebar-credit-panel {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(245, 158, 11, .24);
    border-radius: 12px;
    background: #fffaf0;
    box-sizing: border-box;
}

.sidebar-credit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #17345d;
    font-size: 12px;
    font-weight: 950;
    line-height: 1.2;
}

.sidebar-credit-head span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sidebar-credit-head i {
    color: #f59e0b;
}

.sidebar-credit-head strong {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #dc2626;
    font-size: 14px;
    font-weight: 1000;
}

.sidebar-credit-head strong[data-state="loading"],
.sidebar-credit-head strong[data-state="error"] {
    font-size: 12px;
}

.sidebar-credit-head strong[data-state="loading"] {
    color: #b45309;
}

.sidebar-credit-head strong[data-state="error"] {
    color: #dc2626;
}

.sidebar-card-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 5px;
}

.sidebar-card-input {
    width: 100%;
    height: 30px;
    min-width: 0;
    padding: 0 8px;
    border: 1px solid #f6c86f;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-size: 12px;
    font-weight: 800;
    outline: none;
    box-sizing: border-box;
}

.sidebar-card-input::placeholder {
    color: #8a6a31;
    font-weight: 700;
}

.sidebar-card-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .12);
}

.sidebar-card-save,
.sidebar-credit-actions button {
    border: 1px solid #f6c86f;
    border-radius: 8px;
    background: #fff;
    color: #92400e;
    font-size: 12px;
    font-weight: 950;
    cursor: pointer;
}

.sidebar-card-save {
    width: 28px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-credit-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 30px;
    gap: 5px;
}

.sidebar-credit-actions button {
    height: 30px;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 5px;
    white-space: nowrap;
}

.sidebar-credit-actions button:hover,
.sidebar-card-save:hover {
    filter: brightness(.98);
}

.sidebar-credit-actions button:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.sidebar-credit-actions .sidebar-buy-card-btn {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-color: #f59e0b;
    color: #fff;
}

.sidebar-credit-actions .sidebar-more-card-btn {
    width: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    gap: 0 !important;
}

.media-grid-container > .task-progress-card,
#scrollContent.media-grid-container > .task-progress-card {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    cursor: default !important;
}

.media-grid-container > .task-progress-card:hover,
#scrollContent.media-grid-container > .task-progress-card:hover {
    transform: none !important;
}

.task-progress-card .task-card-title {
    display: none !important;
}

.task-progress-card .task-card-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, .75fr) auto !important;
    grid-template-areas:
        "id status actions"
        "prompt progress actions"
        "time progressText actions"
        "tags tags actions"
        "chat chat chat"
        "refs refs refs" !important;
    align-items: center !important;
    gap: 4px 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
}

.task-progress-card .task-id {
    grid-area: id !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

.task-progress-card .task-prompt {
    grid-area: prompt !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    color: #64748b !important;
}

.rich-input .prompt-ref-token,
.task-prompt-text .prompt-ref-token {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
    padding: 0 8px;
    margin: 0 2px;
    border-radius: 999px;
    border: 1px solid transparent;
    vertical-align: middle;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.rich-input .prompt-ref-token i,
.task-prompt-text .prompt-ref-token i {
    font-size: 11px;
}

.rich-input .prompt-ref-token-image,
.task-prompt-text .prompt-ref-token-image {
    background: #eefaf1;
    border-color: #c5ebd1;
    color: #16a34a;
}

.rich-input .prompt-ref-token-video,
.task-prompt-text .prompt-ref-token-video {
    background: #eff6ff;
    border-color: #c9ddff;
    color: #2563eb;
}

.rich-input .prompt-ref-token-audio,
.task-prompt-text .prompt-ref-token-audio {
    background: #fff1f2;
    border-color: #ffd1d8;
    color: #e11d48;
}

.rich-input .prompt-ref-token-document,
.task-prompt-text .prompt-ref-token-document {
    background: #f5f3ff;
    border-color: #d9ccff;
    color: #7c3aed;
}

.rich-input .prompt-ref-token-prompt,
.task-prompt-text .prompt-ref-token-prompt {
    background: #ecfeff;
    border-color: #b9f3f5;
    color: #0f766e;
}

.task-progress-card .task-prompt-label {
    flex: 0 0 auto;
}

.task-progress-card .task-prompt-text {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 78px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-progress-card .task-copy-prompt {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-left: 2px;
    border: 1px solid #dbe4f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.task-progress-card .task-copy-prompt:hover {
    
    border-color: #9fc5ff;
}

.task-progress-card .task-update-time {
    grid-area: time !important;
    min-width: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.task-progress-card .task-elapsed-time {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(47, 141, 244, .10);
    color: #17345d;
    font-style: normal;
    font-size: 11px;
    font-weight: 900;
    vertical-align: middle;
}

.task-progress-card[data-status="failed"] .task-elapsed-time {
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
}

.task-progress-card[data-status="completed"] .task-elapsed-time,
.task-progress-card[data-status="success"] .task-elapsed-time {
    background: rgba(20, 184, 166, .12);
    color: #0f766e;
}

.task-progress-card .task-tags {
    grid-area: tags !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.task-progress-card .task-tags span,
.task-progress-card .task-status-line span {
    min-width: 0 !important;
    max-width: 220px !important;
    height: 20px !important;
    min-height: 20px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    line-height: 20px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
}

.task-progress-card .task-tags b {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: bottom;
}

.task-progress-card .task-status-line {
    grid-area: status !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.task-progress-card .task-status-line span {
    max-width: 100% !important;
}

.task-progress-card .task-progress-track {
    grid-area: progress !important;
    height: 6px !important;
    margin: 0 !important;
}

.task-progress-card .task-progress-row {
    grid-area: progressText !important;
    margin: -1px 0 0 !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.task-progress-card .task-actions {
    grid-area: actions !important;
    justify-self: end !important;
    margin: 0 !important;
}

.task-progress-card .task-actions .media-btn {
    height: 28px !important;
    min-width: 58px !important;
    padding: 0 9px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
}

.task-progress-card .task-chat-result,
.task-progress-card .task-ref-section {
    min-width: 0 !important;
}

.history-video-card {
    background: linear-gradient(135deg, #eaf6ff, #f5fbff) !important;
    border-color: #c7e5ff !important;
}

.history-video-card .history-video-placeholder {
    background: transparent;
}

.history-video-card .media-placeholder::before {
    display: none;
}

.history-video-card .media-placeholder-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #1774d1;
}

.history-video-card .media-placeholder-text {
    color: #315b82;
}

.history-video-card .play-overlay {
    display: none !important;
}

.history-media-prompt {
    display: block;
    max-width: 100%;
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card .media-info {
    min-width: 0;
}

.history-meta-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    margin-top: 7px;
    overflow: hidden;
}

.history-meta-tags span {
    display: inline-block;
    min-width: 0;
    max-width: 84px;
    height: 20px;
    padding: 0 6px;
    border: 1px solid #dbe7f4;
    border-radius: 6px;
    background: #f8fbff;
    color: #52637a;
    font-size: 10px;
    line-height: 19px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-meta-tags .history-kind {
    flex: 0 0 auto;
    max-width: 42px;
    font-weight: 800;
}

.history-meta-tags .history-kind-image {
    border-color: #a7d8b4;
    background: #ecfdf3;
    color: #208548;
}

.history-meta-tags .history-kind-video {
    border-color: #9fd0ff;
    background: #eef7ff;
    color: #1769c2;
}

.history-meta-tags .history-kind-chat {
    border-color: #dcc7ff;
    background: #f6f0ff;
    color: #6b3fc8;
}

.history-meta-tags .history-kind-workflow {
    border-color: #ddc7ff;
    background: #f7f0ff;
    color: #7c3aed;
}

.history-record-video {
    background: #f0f8ff !important;
    border-color: #c8e5ff !important;
}

.history-record-image {
    background: #f0fff6 !important;
    border-color: #c9efd8 !important;
}

.history-record-chat {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
}

.history-record-workflow {
    background: #f7f0ff !important;
    border-color: #ddc7ff !important;
}

.media-card .media-actions {
    flex-wrap: wrap;
    gap: 6px;
}

.media-card .media-actions .media-btn {
    min-width: 0;
    padding: 0 8px;
    white-space: nowrap;
}

.media-card-image .history-lazy-image {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity .18s ease;
}

.media-card.history-image-loaded .history-lazy-image {
    opacity: 1;
}

.history-image-skeleton {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(82, 110, 204, .08), rgba(14, 165, 233, .07));
}

.media-card.history-image-loaded .history-image-skeleton {
    display: none;
}

.history-skeleton-card {
    cursor: default;
}

.history-skeleton-card:hover {
    transform: none;
}

.history-skeleton-media {
    aspect-ratio: 1;
    background: linear-gradient(90deg, #eef5fb 0%, #f8fbff 45%, #eef5fb 100%);
    background-size: 220% 100%;
    animation: historySkeletonPulse 1.1s ease-in-out infinite;
}

.history-skeleton-line,
.history-skeleton-actions span {
    display: block;
    height: 11px;
    border-radius: 999px;
    background: #e7eef6;
}

.history-skeleton-line {
    width: 88%;
    margin-top: 8px;
}

.history-skeleton-line-short {
    width: 56%;
    margin-top: 0;
}

.history-skeleton-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.history-skeleton-actions span {
    width: 64px;
    height: 26px;
    border-radius: 9px;
}

.history-loading-panel {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 220px;
    border: 1px solid rgba(82, 110, 204, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .72);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #17345d;
}

.history-loading-spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(82, 110, 204, .18);
    border-top-color: #526ecc;
    animation: historyLoadingSpin .8s linear infinite;
}

.history-loading-panel strong {
    font-size: 15px;
    font-weight: 900;
}

.history-loading-panel small {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.bulk-submit-progress {
    width: 100%;
    border: 1px solid rgba(82, 110, 204, .16);
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    padding: 12px 14px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
    color: #17345d;
}

.top-bulk-progress-slot:empty {
    display: none;
}

.bulk-submit-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.bulk-submit-progress-head strong {
    font-size: 14px;
    font-weight: 950;
}

.bulk-submit-progress-count {
    color: #dc2626;
    font-size: 14px;
    font-weight: 950;
}

.bulk-submit-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.bulk-submit-progress-track i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    transition: width .22s ease;
}

.bulk-submit-progress-meta {
    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.bulk-submit-progress.is-complete .bulk-submit-progress-track i {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.bulk-submit-progress.has-failed .bulk-submit-progress-track i {
    background: linear-gradient(90deg, #f97316, #ef4444);
}

.top-bulk-progress-slot .bulk-submit-progress {
    max-width: 760px;
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: none;
    background: rgba(248, 250, 252, .96);
}

.top-bulk-progress-slot .bulk-submit-progress-head {
    margin-bottom: 5px;
}

.top-bulk-progress-slot .bulk-submit-progress-head strong,
.top-bulk-progress-slot .bulk-submit-progress-count {
    font-size: 12px;
}

.top-bulk-progress-slot .bulk-submit-progress-track {
    height: 6px;
}

.top-bulk-progress-slot .bulk-submit-progress-meta {
    margin-top: 4px;
    font-size: 11px;
}

@keyframes historyLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

.rich-input.composer-input-blocked {
    background: rgba(248, 250, 252, .92) !important;
    border-color: rgba(148, 163, 184, .38) !important;
}

.rich-input.composer-input-blocked:empty:before {
    color: #dc2626 !important;
    font-weight: 900 !important;
}

.composer-blocked-tip {
    position: absolute;
    right: 14px;
    top: 10px;
    z-index: 12;
    max-width: min(320px, calc(100% - 28px));
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(254, 242, 242, .96);
    border: 1px solid rgba(248, 113, 113, .35);
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(220, 38, 38, .08);
    pointer-events: none;
}

.send-button.send-button-disabled,
.send-button:disabled {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8) !important;
    border-color: rgba(148, 163, 184, .45) !important;
    box-shadow: none !important;
    color: #fff !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.selector-btn.selector-disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
}

.model-item .model-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.model-item .model-name-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

.model-item .model-name {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.model-item .model-tags {
    justify-self: end !important;
    flex: 0 0 auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 64px !important;
}

.model-item .model-tag {
    max-width: 64px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.model-css-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid rgba(148, 190, 224, .45) !important;
    background: #fff !important;
    font-size: 15px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06) !important;
}

.model-css-icon-blue { color: #2563eb !important; background: #eff6ff !important; }
.model-css-icon-green { color: #16a34a !important; background: #f0fdf4 !important; }
.model-css-icon-purple { color: #7c3aed !important; background: #f5f3ff !important; }
.model-css-icon-amber { color: #d97706 !important; background: #fffbeb !important; }
.model-css-icon-red { color: #dc2626 !important; background: #fef2f2 !important; }
.model-css-icon-cyan { color: #0891b2 !important; background: #ecfeff !important; }
.model-css-icon-slate { color: #475569 !important; background: #f8fafc !important; }
.model-css-icon-pink { color: #db2777 !important; background: #fdf2f8 !important; }

.top-section {
    grid-template-columns: auto 1fr !important;
}

.cankaotu.upload-mode-single-ref {
    width: 124px !important;
    min-width: 124px !important;
    min-height: 120px !important;
}

.cankaotu.upload-mode-first-last {
    width: 236px !important;
    min-width: 236px !important;
    min-height: 120px !important;
}

.cankaotu .upload-trigger {
    width: 96px !important;
    height: 96px !important;
}

.cankaotu .upload-limit-text {
    max-width: 88px;
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
}

.cankaotu .upload-limit-count {
    color: #dc2626;
    font-size: 13px;
    font-weight: 950;
    padding: 0 1px;
}

.cankaotu .upload-limit-prefix,
.cankaotu .upload-limit-suffix {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.cankaotu .ref-url-btn {
    margin-top: 4px;
    height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(59, 130, 246, .25);
    border-radius: 999px;
    background: rgba(59, 130, 246, .08);
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
    line-height: 20px;
    cursor: pointer;
}

.cankaotu .ref-url-btn:hover {
    border-color: rgba(59, 130, 246, .42);
    background: rgba(59, 130, 246, .14);
}

.selector-btn .dropdown .item {
    min-height: 40px !important;
    padding: 10px 14px !important;
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
}

.selector-btn .dropdown .item span,
.selector-btn .dropdown .item .dropdown-main-text {
    min-width: 0;
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selector-btn .dropdown .item small,
.selector-btn .dropdown .item .dropdown-credit-text {
    flex: 0 0 auto !important;
    color: #e11d48 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    white-space: nowrap;
}

.selector-btn .dropdown .item.active {
    
}

.main-content {
    padding: 8px !important;
}

.sora2-main-content {
    padding: 10px !important;
    gap: 8px !important;
}

.workflow-workbench {
    position: relative;
    width: 100%;
    min-height: 100%;
    height: 100%;
    border: 1px solid rgba(148, 190, 224, .32);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,.86);
}

.workflow-frame {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 116px);
    border: 0;
    display: block;
    background: #fff;
}

.workflow-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 800;
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(8px);
}

.workflow-workbench .workflow-loading i {
    font-size: 18px;
}

.at-image-picker {
    position: fixed;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 96px;
    padding: 6px;
    border: 1px solid rgba(148, 190, 224, .45);
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
    backdrop-filter: blur(10px);
}

.at-image-option {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 4px 8px 4px 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.at-image-option span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.at-image-option:hover {
    background: #e8f3ff;
}

.at-image-thumb {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dbe7f4;
    flex: 0 0 30px;
}

.at-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.at-image-thumb-file {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f7fb;
}

.at-image-file-icon {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.at-image-file-icon-image {
    color: #16a34a;
}

.at-image-file-icon-video {
    color: #2563eb;
}

.at-image-file-icon-audio {
    color: #d97706;
}

.at-image-file-icon-document {
    color: #7c3aed;
}

.at-image-file-icon-prompt {
    color: #0f766e;
}

.ref-file-placeholder {
    width: 100%;
    height: 100%;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    background: rgba(15, 23, 42, .06);
    color: #334155;
    font-size: 24px;
}

.ref-file-placeholder-audio {
    background: rgba(245, 158, 11, .12);
    color: #d97706;
}

.ref-file-placeholder-document {
    background: rgba(124, 58, 237, .12);
    color: #7c3aed;
}

.top-model-info {
    min-height: 58px !important;
    height: auto !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
}

.top-model-info .icon-wrapper {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px !important;
    border-radius: 10px !important;
}

.top-model-info .icon-img {
    width: 28px !important;
    height: 28px !important;
}

.scroll-container {
    padding: 8px !important;
    border-radius: 12px !important;
}

.media-grid-container {
    gap: 10px !important;
    padding: 8px !important;
}

.media-grid-container.history-view-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
}

.media-grid-container.history-view-list {
    grid-template-columns: 1fr !important;
}

.history-view-list .history-record-card {
    display: grid !important;
    grid-template-columns: 150px minmax(0, 1fr) !important;
    min-height: 118px;
}

.history-view-list .media-card-image,
.history-view-list .media-card-video {
    height: 100%;
    aspect-ratio: auto !important;
}

.history-record-card .media-info {
    padding: 8px !important;
}

.history-record-card .media-actions {
    margin-top: 6px !important;
}

.history-record-card .media-btn {
    height: 28px !important;
    font-size: 11px !important;
}

.history-view-toggle {
    margin-left: auto;
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid #dbe7f4;
    border-radius: 10px;
    background: rgba(255,255,255,.8);
}

.history-view-btn {
    width: 30px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.history-view-btn.active {
    background: #e8f3ff;
    
}

.price-value {
    color: #e11d48 !important;
    font-weight: 950 !important;
}

.task-progress-card[data-status="pending"] .task-progress-track,
.task-progress-card[data-status="waiting"] .task-progress-track,
.task-progress-card[data-status="running"] .task-progress-track,
.task-progress-card[data-status="processing"] .task-progress-track,
.task-progress-card[data-status="submitted"] .task-progress-track {
    height: 8px !important;
    background: #dbeafe !important;
    position: relative;
}

.task-progress-card[data-status="pending"] .task-progress-track::after,
.task-progress-card[data-status="waiting"] .task-progress-track::after,
.task-progress-card[data-status="running"] .task-progress-track::after,
.task-progress-card[data-status="processing"] .task-progress-track::after,
.task-progress-card[data-status="submitted"] .task-progress-track::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(37,99,235,.62), transparent);
    animation: taskProgressSweep 1.1s linear infinite;
}

@keyframes taskProgressSweep {
    from {
        transform: translateX(-110%);
    }
    to {
        transform: translateX(260%);
    }
}

@keyframes historySkeletonPulse {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@media (max-width: 900px) {
    .task-progress-card .task-card-body {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "id"
            "prompt"
            "status"
            "progress"
            "progressText"
            "tags"
            "time"
            "chat"
            "refs"
            "actions" !important;
    }
}

/* debug: left model panel unified card */
.sidebar {
    gap: 10px !important;
}

.sidebar .selector-container {
    margin-bottom: 0 !important;
    border-bottom: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    position: relative !important;
    z-index: 2 !important;
    box-shadow: 0 10px 26px rgba(37, 99, 235, .08) !important;
}

.sidebar .model-list {
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(236,248,255,.86)) !important;
    border: 1px solid rgba(33, 150, 243, .20) !important;
    border-top: 0 !important;
    border-radius: 0 0 16px 16px !important;
    padding: 2px 6px 8px 8px !important;
    margin-top: -10px !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(33, 150, 243, .55) transparent !important;
}

.sidebar .model-list::-webkit-scrollbar {
    width: 3px !important;
}

.sidebar .model-list::-webkit-scrollbar-track {
    background: transparent !important;
}

.sidebar .model-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(33, 150, 243, .78), rgba(14, 165, 233, .45)) !important;
    border-radius: 999px !important;
}

/* debug: keep model/workflow entries inside an independent viewport */
.home-container,
.sidebar,
.main-content,
.sora2-container {
    min-height: 0 !important;
}

.sidebar {
    overflow: hidden !important;
}

.sidebar .model-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* debug: keep generated images close to their real ratio */
.history-record-image .media-card-image {
    aspect-ratio: var(--history-image-ratio, 1 / 1) !important;
    min-height: 92px !important;
    max-height: 260px !important;
    background: #f4fbf7 !important;
}

.history-record-image .media-card-image img.history-lazy-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.history-view-list .history-record-image .media-card-image {
    aspect-ratio: auto !important;
    height: 100% !important;
    min-height: 100px !important;
    max-height: none !important;
}

/* debug: non-blocking append loader */
.scroll-container {
    position: relative !important;
}

.history-append-loader {
    position: sticky;
    left: 50%;
    bottom: 10px;
    z-index: 6;
    width: max-content;
    max-width: calc(100% - 28px);
    margin: 8px auto 2px;
    padding: 7px 12px;
    display: none;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .10);
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.history-append-loader.show {
    display: flex;
}

.history-append-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(37, 99, 235, .18);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: historyAppendSpin .75s linear infinite;
}

@keyframes historyAppendSpin {
    to {
        transform: rotate(360deg);
    }
}

/* debug: history records are list-only */
.history-view-toggle {
    display: none !important;
}

.media-grid-container,
.media-grid-container.history-view-grid,
.media-grid-container.history-view-list {
    grid-template-columns: 1fr !important;
}

/* debug: history records use the same compact task-card layout */
.history-task-card {
    width: 100% !important;
    min-height: 0 !important;
    cursor: default !important;
}

.history-task-card:hover {
    transform: none !important;
}

.history-task-card .task-card-body {
    grid-template-columns: minmax(0, 1fr) 116px auto !important;
    grid-template-areas:
        "id result actions"
        "prompt result actions"
        "time result actions"
        "tags result actions"
        "status result actions"
        "refs result actions"
        "failure result actions" !important;
    gap: 3px 10px !important;
    padding: 7px 10px !important;
}

.history-task-card .task-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    align-self: center !important;
}

.history-result-panel {
    grid-area: result !important;
    align-self: stretch !important;
    width: 116px !important;
    min-width: 0 !important;
}

.history-status-line {
    grid-area: status !important;
    margin: 0 !important;
}

.history-failure-reason {
    grid-area: failure !important;
    min-width: 0 !important;
    max-width: 100% !important;
    color: #dc2626;
    font-size: 11px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-task-card[data-status="failed"] {
    border-color: rgba(239, 68, 68, .55) !important;
    background: #fff1f1 !important;
    box-shadow: 0 8px 22px rgba(239, 68, 68, .08) !important;
}

.history-task-card[data-status="failed"] .task-status-text {
    border-color: rgba(239, 68, 68, .28) !important;
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.history-thumb-failed {
    background: linear-gradient(135deg, #fef2f2, #fff7f7) !important;
    border-color: rgba(239, 68, 68, .28) !important;
}

.history-thumb-failed .history-video-icon {
    color: #dc2626 !important;
}

.history-task-card.history-record-video[data-status="completed"],
.history-task-card.history-record-video[data-status="success"] {
    background: #edf7ff !important;
    border-color: #9fd0ff !important;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .07) !important;
}

.history-task-card.history-record-image[data-status="completed"],
.history-task-card.history-record-image[data-status="success"] {
    background: #effdf5 !important;
    border-color: #9ee6bd !important;
    box-shadow: 0 8px 22px rgba(22, 163, 74, .07) !important;
}

.history-task-card.history-record-chat[data-status="completed"],
.history-task-card.history-record-chat[data-status="success"] {
    background: #fff7ed !important;
    border-color: #fdba74 !important;
    box-shadow: 0 8px 22px rgba(249, 115, 22, .07) !important;
}

.history-task-card.history-record-workflow[data-status="completed"],
.history-task-card.history-record-workflow[data-status="success"] {
    background: #f7f0ff !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 8px 22px rgba(124, 58, 237, .07) !important;
}

.task-progress-card[data-status="failed"],
.media-card[data-status="failed"] {
    background: #fff1f1 !important;
    border-color: rgba(239, 68, 68, .55) !important;
    box-shadow: 0 8px 22px rgba(239, 68, 68, .08) !important;
}

.task-progress-card.history-record-video[data-status="completed"],
.task-progress-card.history-record-video[data-status="success"],
.task-progress-card.history-record-video[data-status="submitted"],
.task-progress-card.history-record-video[data-status="processing"],
.task-progress-card.history-record-video[data-status="running"],
.task-progress-card.history-record-video[data-status="waiting"],
.task-progress-card.history-record-video[data-status="pending"] {
    background: #edf7ff !important;
    border-color: #9fd0ff !important;
}

.task-progress-card.history-record-image[data-status="completed"],
.task-progress-card.history-record-image[data-status="success"],
.task-progress-card.history-record-image[data-status="submitted"],
.task-progress-card.history-record-image[data-status="processing"],
.task-progress-card.history-record-image[data-status="running"],
.task-progress-card.history-record-image[data-status="waiting"],
.task-progress-card.history-record-image[data-status="pending"] {
    background: #effdf5 !important;
    border-color: #9ee6bd !important;
}

/* debug: fill the whole history/task card interior by status */
.history-task-card[data-status="failed"] .task-card-body,
.task-progress-card[data-status="failed"] .task-card-body,
.media-card[data-status="failed"] .task-card-body {
    background: #fff1f1 !important;
}

.history-task-card[data-status="failed"] .history-result-panel,
.history-task-card[data-status="failed"] .history-ref-section,
.task-progress-card[data-status="failed"] .history-result-panel,
.task-progress-card[data-status="failed"] .history-ref-section,
.media-card[data-status="failed"] .history-result-panel,
.media-card[data-status="failed"] .history-ref-section {
    background: #fff1f1 !important;
    border-color: rgba(239, 68, 68, .18) !important;
}

.history-task-card.history-record-video[data-status="completed"] .task-card-body,
.history-task-card.history-record-video[data-status="success"] .task-card-body,
.history-task-card.history-record-video[data-status="processing"] .task-card-body,
.history-task-card.history-record-video[data-status="running"] .task-card-body,
.history-task-card.history-record-video[data-status="waiting"] .task-card-body,
.history-task-card.history-record-video[data-status="pending"] .task-card-body,
.history-task-card.history-record-video[data-status="submitted"] .task-card-body,
.task-progress-card.history-record-video[data-status="completed"] .task-card-body,
.task-progress-card.history-record-video[data-status="success"] .task-card-body,
.task-progress-card.history-record-video[data-status="processing"] .task-card-body,
.task-progress-card.history-record-video[data-status="running"] .task-card-body,
.task-progress-card.history-record-video[data-status="waiting"] .task-card-body,
.task-progress-card.history-record-video[data-status="pending"] .task-card-body,
.task-progress-card.history-record-video[data-status="submitted"] .task-card-body {
    background: #edf7ff !important;
}

.history-task-card.history-record-video .history-result-panel,
.history-task-card.history-record-video .history-ref-section,
.task-progress-card.history-record-video .history-result-panel,
.task-progress-card.history-record-video .history-ref-section {
    background: #edf7ff !important;
    border-color: rgba(37, 99, 235, .16) !important;
}

.history-task-card.history-record-image[data-status="completed"] .task-card-body,
.history-task-card.history-record-image[data-status="success"] .task-card-body,
.history-task-card.history-record-image[data-status="processing"] .task-card-body,
.history-task-card.history-record-image[data-status="running"] .task-card-body,
.history-task-card.history-record-image[data-status="waiting"] .task-card-body,
.history-task-card.history-record-image[data-status="pending"] .task-card-body,
.history-task-card.history-record-image[data-status="submitted"] .task-card-body,
.task-progress-card.history-record-image[data-status="completed"] .task-card-body,
.task-progress-card.history-record-image[data-status="success"] .task-card-body,
.task-progress-card.history-record-image[data-status="processing"] .task-card-body,
.task-progress-card.history-record-image[data-status="running"] .task-card-body,
.task-progress-card.history-record-image[data-status="waiting"] .task-card-body,
.task-progress-card.history-record-image[data-status="pending"] .task-card-body,
.task-progress-card.history-record-image[data-status="submitted"] .task-card-body {
    background: #effdf5 !important;
}

.history-task-card.history-record-image .history-result-panel,
.history-task-card.history-record-image .history-ref-section,
.task-progress-card.history-record-image .history-result-panel,
.task-progress-card.history-record-image .history-ref-section {
    background: #effdf5 !important;
    border-color: rgba(22, 163, 74, .16) !important;
}

.history-result-thumb {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: var(--history-thumb-ratio, 16 / 10);
    min-height: 72px;
    max-height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #dbe7f4;
    border-radius: 8px;
    background: #f8fbff;
    color: #315b82;
    text-decoration: none;
}

.history-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.history-result-thumb.history-thumb-portrait {
    width: 82px;
    margin-left: auto;
    margin-right: auto;
    max-height: 132px;
}

.history-result-video {
    background: linear-gradient(135deg, #eaf6ff, #f7fbff);
    border-color: #bfe0ff;
}

.history-video-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #fff;
    color: #1774d1;
    font-size: 18px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .12);
}

.history-thumb-label {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 3;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .70);
    color: #fff;
    font-size: 10px;
    line-height: 18px;
    font-weight: 800;
}

.history-result-thumb .history-image-skeleton {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1774d1;
    background: linear-gradient(90deg, #eef5fb 0%, #f8fbff 45%, #eef5fb 100%);
    background-size: 220% 100%;
    animation: historySkeletonPulse 1.1s ease-in-out infinite;
}

.history-result-thumb .history-lazy-image {
    position: relative;
    z-index: 2;
    opacity: 0;
}

.history-task-card.history-image-loaded .history-result-thumb .history-lazy-image {
    opacity: 1;
}

.history-task-card.history-image-loaded .history-result-thumb .history-image-skeleton {
    display: none;
}

.history-ref-section {
    grid-area: refs !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    margin-top: 1px !important;
    padding-top: 0 !important;
    border-top: 0 !important;
}

.history-ref-section .task-ref-title {
    flex: 0 0 auto;
    margin: 0 !important;
    font-size: 11px !important;
}

.history-ref-section .task-ref-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.history-ref-section .task-ref-thumb {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    border-radius: 6px !important;
}

.history-no-ref {
    color: #94a3b8;
    font-size: 12px;
}

/* debug: compact history cards so more records fit on screen */
.history-task-card .task-actions .media-btn {
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
}

.history-task-card .task-tags span,
.history-task-card .task-status-line span {
    height: 18px !important;
    min-height: 18px !important;
    line-height: 18px !important;
    font-size: 10px !important;
}

.history-task-card .task-update-time,
.history-task-card .task-prompt,
.history-task-card .task-id {
    line-height: 1.15 !important;
}

.history-task-card .history-result-thumb {
    min-height: 66px !important;
    max-height: 86px !important;
}

/* Processing records should not look like completed image/video cards after refresh. */
.history-task-card[data-status="processing"],
.history-task-card[data-status="running"],
.history-task-card[data-status="waiting"],
.history-task-card[data-status="pending"],
.history-task-card[data-status="submitted"],
.history-task-card[data-status="processing"] .task-card-body,
.history-task-card[data-status="running"] .task-card-body,
.history-task-card[data-status="waiting"] .task-card-body,
.history-task-card[data-status="pending"] .task-card-body,
.history-task-card[data-status="submitted"] .task-card-body,
.task-progress-card[data-status="processing"],
.task-progress-card[data-status="running"],
.task-progress-card[data-status="waiting"],
.task-progress-card[data-status="pending"],
.task-progress-card[data-status="submitted"],
.task-progress-card[data-status="processing"] .task-card-body,
.task-progress-card[data-status="running"] .task-card-body,
.task-progress-card[data-status="waiting"] .task-card-body,
.task-progress-card[data-status="pending"] .task-card-body,
.task-progress-card[data-status="submitted"] .task-card-body {
    background: #fff7e6 !important;
    border-color: #f6c86f !important;
    box-shadow: none !important;
}

.history-task-card[data-status="processing"] .history-result-panel,
.history-task-card[data-status="running"] .history-result-panel,
.history-task-card[data-status="waiting"] .history-result-panel,
.history-task-card[data-status="pending"] .history-result-panel,
.history-task-card[data-status="submitted"] .history-result-panel,
.history-task-card[data-status="processing"] .history-ref-section,
.history-task-card[data-status="running"] .history-ref-section,
.history-task-card[data-status="waiting"] .history-ref-section,
.history-task-card[data-status="pending"] .history-ref-section,
.history-task-card[data-status="submitted"] .history-ref-section,
.history-task-card[data-status="processing"] .history-result-thumb,
.history-task-card[data-status="running"] .history-result-thumb,
.history-task-card[data-status="waiting"] .history-result-thumb,
.history-task-card[data-status="pending"] .history-result-thumb,
.history-task-card[data-status="submitted"] .history-result-thumb,
.task-progress-card[data-status="processing"] .history-result-panel,
.task-progress-card[data-status="running"] .history-result-panel,
.task-progress-card[data-status="waiting"] .history-result-panel,
.task-progress-card[data-status="pending"] .history-result-panel,
.task-progress-card[data-status="submitted"] .history-result-panel,
.task-progress-card[data-status="processing"] .history-ref-section,
.task-progress-card[data-status="running"] .history-ref-section,
.task-progress-card[data-status="waiting"] .history-ref-section,
.task-progress-card[data-status="pending"] .history-ref-section,
.task-progress-card[data-status="submitted"] .history-ref-section,
.task-progress-card[data-status="processing"] .history-result-thumb,
.task-progress-card[data-status="running"] .history-result-thumb,
.task-progress-card[data-status="waiting"] .history-result-thumb,
.task-progress-card[data-status="pending"] .history-result-thumb,
.task-progress-card[data-status="submitted"] .history-result-thumb {
    background: #fff7e6 !important;
    border-color: rgba(245, 158, 11, .24) !important;
}

.history-task-card[data-status="processing"] .task-status-text,
.history-task-card[data-status="running"] .task-status-text,
.history-task-card[data-status="waiting"] .task-status-text,
.history-task-card[data-status="pending"] .task-status-text,
.history-task-card[data-status="submitted"] .task-status-text,
.task-progress-card[data-status="processing"] .task-status-text,
.task-progress-card[data-status="running"] .task-status-text,
.task-progress-card[data-status="waiting"] .task-status-text,
.task-progress-card[data-status="pending"] .task-status-text,
.task-progress-card[data-status="submitted"] .task-status-text {
    background: #ffedc2 !important;
    border-color: #f6c86f !important;
    color: #b45309 !important;
}

/* debug: failed status must override media type colors */
.history-task-card[data-status="failed"],
.history-task-card[data-status="failed"] .task-card-body,
.history-task-card[data-status="failed"] .history-result-panel,
.history-task-card[data-status="failed"] .history-ref-section,
.history-task-card[data-status="failed"] .history-result-thumb,
.task-progress-card[data-status="failed"],
.task-progress-card[data-status="failed"] .task-card-body,
.task-progress-card[data-status="failed"] .history-result-panel,
.task-progress-card[data-status="failed"] .history-ref-section,
.task-progress-card[data-status="failed"] .history-result-thumb,
.media-card[data-status="failed"],
.media-card[data-status="failed"] .task-card-body,
.media-card[data-status="failed"] .history-result-panel,
.media-card[data-status="failed"] .history-ref-section,
.media-card[data-status="failed"] .history-result-thumb {
    background: #fff1f1 !important;
    border-color: rgba(239, 68, 68, .35) !important;
}

.history-task-card[data-status="failed"] .history-ref-section,
.task-progress-card[data-status="failed"] .history-ref-section,
.media-card[data-status="failed"] .history-ref-section {
    border-top-color: rgba(239, 68, 68, .22) !important;
}

.history-task-card[data-status="failed"] .history-thumb-failed,
.task-progress-card[data-status="failed"] .history-thumb-failed,
.media-card[data-status="failed"] .history-thumb-failed {
    background: linear-gradient(135deg, #fff1f1, #ffe4e6) !important;
}

.history-view-grid .history-task-card .task-card-body {
    grid-template-columns: minmax(0, 1fr) 92px !important;
    grid-template-areas:
        "id result"
        "prompt result"
        "time result"
        "tags tags"
        "status status"
        "failure failure"
        "actions actions"
        "refs refs" !important;
    gap: 5px 8px !important;
}

.history-view-grid .history-task-card .history-result-panel {
    width: 92px !important;
}

.history-view-grid .history-task-card .history-result-thumb {
    min-height: 60px !important;
    max-height: 112px !important;
}

.history-view-grid .history-task-card .task-actions {
    flex-direction: row !important;
    justify-self: stretch !important;
}

.history-view-grid .history-task-card .task-actions .media-btn {
    flex: 1 1 0 !important;
}

.history-view-list .history-task-card {
    display: block !important;
    min-height: 0 !important;
}

.history-view-list .history-task-card .task-card-body {
    grid-template-columns: minmax(0, 1fr) 116px auto !important;
}

@media (max-width: 900px) {
    .history-task-card .task-card-body,
    .history-view-list .history-task-card .task-card-body,
    .history-view-grid .history-task-card .task-card-body {
        grid-template-columns: minmax(0, 1fr) 88px !important;
        grid-template-areas:
            "id result"
            "prompt result"
            "time result"
            "tags tags"
            "status status"
            "failure failure"
            "actions actions"
            "refs refs" !important;
    }

    .history-task-card .history-result-panel {
        width: 88px !important;
    }

    .history-task-card .history-result-thumb {
        min-height: 64px !important;
        max-height: 104px !important;
    }

    .history-task-card .task-actions {
        flex-direction: row !important;
        justify-self: stretch !important;
    }
}

/* debug: unify left and right page background */
html,
body {
    background:
        linear-gradient(135deg, #f6fbff 0%, #eef8ff 42%, #ffffff 100%) !important;
}

.bg {
    background:
        radial-gradient(900px 420px at 8% 0%, rgba(33, 150, 243, .16), transparent 62%),
        radial-gradient(820px 460px at 92% 10%, rgba(14, 165, 233, .10), transparent 62%),
        linear-gradient(135deg, rgba(246, 251, 255, .86), rgba(255, 255, 255, .78)) !important;
}

.home-container {
    background: transparent !important;
}

.sidebar {
    background: rgba(255, 255, 255, .46) !important;
    border-right: 1px solid rgba(148, 190, 224, .32) !important;
    box-shadow: 14px 0 34px rgba(14, 88, 148, .05) !important;
}

.main-content {
    background: transparent !important;
}

.sora2-container {
    background: rgba(255, 255, 255, .72) !important;
    border-color: rgba(148, 190, 224, .34) !important;
    box-shadow: 0 16px 44px rgba(14, 88, 148, .08) !important;
}

.sidebar-logo,
.sidebar .selector-container,
.sidebar .model-list,
.top-model-info,
.input-container {
    background-color: rgba(255, 255, 255, .78) !important;
}

/* debug composer assets and prompt tools */
.top-section {
    position: relative;
}

.composer-asset-btn {
    position: absolute;
    left: 236px;
    top: 8px;
    z-index: 12;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(82, 110, 204, .28);
    border-radius: 999px;
    background: linear-gradient(135deg, #eef6ff, #ffffff);
    color: #526ecc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
}

.composer-asset-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(82, 110, 204, .52);
}

.prompt-counter {
    position: absolute;
    right: 12px;
    top: -26px;
    z-index: 12;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    color: rgba(15, 23, 42, .62);
    font-size: 12px;
    line-height: 24px;
    font-weight: 800;
}

.prompt-counter.is-over {
    color: #dc2626;
    background: rgba(220, 38, 38, .10);
}

.prompt-quick-tools {
    position: absolute;
    right: -48px;
    top: 50%;
    z-index: 12;
    transform: translateY(-50%);
    display: grid;
    gap: 8px;
}

.prompt-tool-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, .10);
    background: rgba(255, 255, 255, .96);
    color: rgba(15, 23, 42, .72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
}

.prompt-tool-btn:hover {
    background: #526ecc;
    
}

.asset-bank-modal,
.prompt-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .28);
    backdrop-filter: blur(5px);
}

.asset-bank-modal.show,
.prompt-editor-modal.show {
    display: flex;
}

.asset-bank-panel,
.prompt-editor-panel {
    width: min(720px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, .10);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
    padding: 16px;
}

.asset-bank-header,
.prompt-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #0f172a;
    font-size: 16px;
    margin-bottom: 14px;
}

.asset-bank-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.prompt-editor-header span {
    margin-left: auto;
    color: rgba(15, 23, 42, .58);
    font-size: 12px;
}

.asset-modal-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .06);
    color: #334155;
    cursor: pointer;
}

.asset-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(15, 23, 42, .045);
    margin-bottom: 12px;
}

.asset-tab-btn {
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #334155;
    cursor: pointer;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.asset-tab-btn em {
    color: #dc2626;
    font-size: 11px;
    font-style: normal;
}

.asset-tab-btn.active {
    border-color: rgba(82, 110, 204, .25);
    background: #fff;
    
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.asset-section {
    border-top: 1px solid rgba(15, 23, 42, .08);
    padding-top: 12px;
    margin-top: 12px;
}

.asset-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 10px;
}

.asset-section-title em {
    font-style: normal;
    color: #dc2626;
    font-size: 12px;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    align-items: stretch;
}

.asset-thumb,
.asset-row {
    border: 1px solid rgba(15, 23, 42, .10);
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    color: #0f172a;
}

.asset-thumb {
    padding: 8px;
    display: grid;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.asset-thumb-media {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(82, 110, 204, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.asset-thumb-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-video-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .12);
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.asset-file-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.asset-file-icon-image {
    background: rgba(22, 163, 74, .12);
    color: #16a34a;
}

.asset-file-icon-video {
    background: rgba(37, 99, 235, .12);
    color: #2563eb;
}

.asset-file-icon-audio {
    background: rgba(217, 119, 6, .12);
    color: #d97706;
}

.asset-file-icon-document {
    background: rgba(100, 116, 139, .14);
    color: #475569;
}

.asset-video-play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}

.asset-video-thumb-loading {
    width: 100%;
    height: 100%;
    min-height: 86px;
    display: grid;
    place-items: center;
    gap: 6px;
    color: #2563eb;
    background: linear-gradient(90deg, rgba(226, 232, 240, .70), rgba(248, 250, 252, .96), rgba(226, 232, 240, .70));
    background-size: 220% 100%;
    animation: assetSkeletonLoading 1.1s ease-in-out infinite;
}

.asset-video-thumb-loading i {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(37, 99, 235, .18);
    border-top-color: #2563eb;
    animation: spin 1s linear infinite;
}

.asset-video-thumb-loading b {
    font-size: 12px;
    font-weight: 900;
}

.asset-upload-progress-card {
    border-color: rgba(37, 99, 235, .22);
    background: linear-gradient(180deg, #f8fbff, #fff);
}

.asset-upload-progress-card .asset-thumb-media {
    color: #2563eb;
    font-size: 24px;
}

.asset-upload-bar {
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(37, 99, 235, .12);
}

.asset-upload-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
    transition: width .2s ease;
}

.asset-upload-percent {
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
}

.asset-thumb-label {
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-prompt-list {
    display: grid;
    gap: 8px;
}

.asset-grid .asset-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.asset-grid .asset-row-actions button {
    min-width: 0;
    width: 100%;
    padding: 0 4px;
}

.asset-prompt-list .asset-row-actions {
    display: flex;
    flex-wrap: nowrap;
}

.asset-row {
    min-height: 38px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.asset-index {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(82, 110, 204, .10);
    color: #526ecc;
    font-size: 12px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.asset-prompt-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.asset-empty {
    padding: 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, .04);
    color: rgba(15, 23, 42, .52);
    font-size: 13px;
}

.asset-loading-card {
    pointer-events: none;
    cursor: default;
}

.asset-loading-media,
.asset-loading-line {
    display: block;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(226, 232, 240, .75), rgba(248, 250, 252, .96), rgba(226, 232, 240, .75));
    background-size: 220% 100%;
    animation: assetSkeletonLoading 1.1s ease-in-out infinite;
}

.asset-loading-media {
    width: 100%;
    aspect-ratio: 1;
}

.asset-row .asset-loading-media {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.asset-loading-line {
    width: 100%;
    height: 10px;
}

.asset-loading-line.short {
    width: 64%;
}

@keyframes assetSkeletonLoading {
    0% {
        background-position: 120% 0;
    }
    100% {
        background-position: -120% 0;
    }
}

#promptEditorTextarea {
    width: 100%;
    min-height: 320px;
    resize: vertical;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 12px;
    padding: 12px;
    outline: none;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.65;
}

#promptEditorTextarea:focus {
    border-color: rgba(82, 110, 204, .58);
    box-shadow: 0 0 0 3px rgba(82, 110, 204, .12);
}

.prompt-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.prompt-editor-btn {
    height: 36px;
    padding: 0 16px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font-weight: 800;
}

.prompt-editor-primary {
    background: #526ecc;
    color: #fff;
}

@media (max-width: 900px) {
    .composer-asset-btn {
        left: auto;
        right: 50px;
        top: 8px;
    }

    .prompt-quick-tools {
        right: 8px;
        top: 8px;
        transform: none;
        display: flex;
    }

    .prompt-counter {
        top: -24px;
        right: 8px;
    }
}

/* debug final overrides: composer layout and logo */
.bottom-input-wrapper {
    max-width: calc(100% - 16px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.top-section {
    grid-template-columns: 124px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding-right: 46px !important;
}

.rich-input {
    padding-right: 48px !important;
}

.prompt-quick-tools {
    right: 10px !important;
    top: 12px !important;
    transform: none !important;
    display: grid !important;
    gap: 8px !important;
}

.prompt-counter {
    top: auto !important;
    right: 96px !important;
    bottom: 16px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #475569 !important;
    font-weight: 900 !important;
    z-index: 14 !important;
}

.input-footer {
    position: relative !important;
    padding-right: 70px !important;
}

.selector-btn,
.selector-btn .selector-text,
.selector-btn i {
    color: #111827 !important;
    font-weight: 800 !important;
}

.selector-btn .dropdown .item,
.selector-btn .dropdown .item span,
.selector-btn .dropdown .dropdown-main-text {
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

.selector-btn .dropdown .dropdown-credit-text,
.selector-btn .dropdown .item small {
    color: #dc2626 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

.composer-asset-btn {
    left: 138px !important;
    top: 12px !important;
    width: 28px !important;
    height: 28px !important;
}

.sidebar-logo {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 8px 4px !important;
}

.sidebar-logo .logo-shine {
    display: none !important;
}

.sidebar-logo .logo-text::before {
    content: none !important;
    display: none !important;
}

/* final asset bank tab fixes */
#assetActiveList.asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    align-items: stretch !important;
}

#assetActiveList.asset-grid .asset-thumb {
    min-width: 0 !important;
    overflow: hidden !important;
}

#assetActiveList.asset-grid .asset-row-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
}

#assetActiveList.asset-grid .asset-row-actions button {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 4px !important;
    white-space: nowrap !important;
}

#assetActiveList.asset-prompt-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
}

#assetActiveList.asset-prompt-list .asset-row-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
}

@media (max-width: 900px) {
    .top-section {
        grid-template-columns: 1fr !important;
        padding-right: 0 !important;
    }

    .prompt-quick-tools {
        right: 8px !important;
        top: 8px !important;
        display: flex !important;
    }

    .prompt-counter {
        right: 88px !important;
        bottom: 14px !important;
    }
}

/* final tail override: unfinished history cards must be one-piece orange */
.history-task-card.history-record-image[data-status="processing"],
.history-task-card.history-record-image[data-status="running"],
.history-task-card.history-record-image[data-status="waiting"],
.history-task-card.history-record-image[data-status="pending"],
.history-task-card.history-record-image[data-status="submitted"],
.history-task-card.history-record-video[data-status="processing"],
.history-task-card.history-record-video[data-status="running"],
.history-task-card.history-record-video[data-status="waiting"],
.history-task-card.history-record-video[data-status="pending"],
.history-task-card.history-record-video[data-status="submitted"],
.history-task-card.history-record-image[data-status="processing"] .task-card-body,
.history-task-card.history-record-image[data-status="running"] .task-card-body,
.history-task-card.history-record-image[data-status="waiting"] .task-card-body,
.history-task-card.history-record-image[data-status="pending"] .task-card-body,
.history-task-card.history-record-image[data-status="submitted"] .task-card-body,
.history-task-card.history-record-video[data-status="processing"] .task-card-body,
.history-task-card.history-record-video[data-status="running"] .task-card-body,
.history-task-card.history-record-video[data-status="waiting"] .task-card-body,
.history-task-card.history-record-video[data-status="pending"] .task-card-body,
.history-task-card.history-record-video[data-status="submitted"] .task-card-body,
.history-task-card.history-record-image[data-status="processing"] .history-result-panel,
.history-task-card.history-record-image[data-status="running"] .history-result-panel,
.history-task-card.history-record-image[data-status="waiting"] .history-result-panel,
.history-task-card.history-record-image[data-status="pending"] .history-result-panel,
.history-task-card.history-record-image[data-status="submitted"] .history-result-panel,
.history-task-card.history-record-video[data-status="processing"] .history-result-panel,
.history-task-card.history-record-video[data-status="running"] .history-result-panel,
.history-task-card.history-record-video[data-status="waiting"] .history-result-panel,
.history-task-card.history-record-video[data-status="pending"] .history-result-panel,
.history-task-card.history-record-video[data-status="submitted"] .history-result-panel,
.history-task-card.history-record-image[data-status="processing"] .history-ref-section,
.history-task-card.history-record-image[data-status="running"] .history-ref-section,
.history-task-card.history-record-image[data-status="waiting"] .history-ref-section,
.history-task-card.history-record-image[data-status="pending"] .history-ref-section,
.history-task-card.history-record-image[data-status="submitted"] .history-ref-section,
.history-task-card.history-record-video[data-status="processing"] .history-ref-section,
.history-task-card.history-record-video[data-status="running"] .history-ref-section,
.history-task-card.history-record-video[data-status="waiting"] .history-ref-section,
.history-task-card.history-record-video[data-status="pending"] .history-ref-section,
.history-task-card.history-record-video[data-status="submitted"] .history-ref-section,
.history-task-card.history-record-image[data-status="processing"] .history-result-thumb,
.history-task-card.history-record-image[data-status="running"] .history-result-thumb,
.history-task-card.history-record-image[data-status="waiting"] .history-result-thumb,
.history-task-card.history-record-image[data-status="pending"] .history-result-thumb,
.history-task-card.history-record-image[data-status="submitted"] .history-result-thumb,
.history-task-card.history-record-video[data-status="processing"] .history-result-thumb,
.history-task-card.history-record-video[data-status="running"] .history-result-thumb,
.history-task-card.history-record-video[data-status="waiting"] .history-result-thumb,
.history-task-card.history-record-video[data-status="pending"] .history-result-thumb,
.history-task-card.history-record-video[data-status="submitted"] .history-result-thumb {
    background: #fff7e6 !important;
    border-color: #f6c86f !important;
    box-shadow: none !important;
}

.history-task-card[data-status="processing"] .task-tags span,
.history-task-card[data-status="running"] .task-tags span,
.history-task-card[data-status="waiting"] .task-tags span,
.history-task-card[data-status="pending"] .task-tags span,
.history-task-card[data-status="submitted"] .task-tags span,
.history-task-card[data-status="processing"] .task-status-line span,
.history-task-card[data-status="running"] .task-status-line span,
.history-task-card[data-status="waiting"] .task-status-line span,
.history-task-card[data-status="pending"] .task-status-line span,
.history-task-card[data-status="submitted"] .task-status-line span,
.history-task-card[data-status="processing"] .task-elapsed-time,
.history-task-card[data-status="running"] .task-elapsed-time,
.history-task-card[data-status="waiting"] .task-elapsed-time,
.history-task-card[data-status="pending"] .task-elapsed-time,
.history-task-card[data-status="submitted"] .task-elapsed-time {
    background: #ffedc2 !important;
    border-color: #f6c86f !important;
    color: #b45309 !important;
}

.history-task-card[data-status="processing"] .task-tags b,
.history-task-card[data-status="running"] .task-tags b,
.history-task-card[data-status="waiting"] .task-tags b,
.history-task-card[data-status="pending"] .task-tags b,
.history-task-card[data-status="submitted"] .task-tags b,
.history-task-card[data-status="processing"] .task-type-text,
.history-task-card[data-status="running"] .task-type-text,
.history-task-card[data-status="waiting"] .task-type-text,
.history-task-card[data-status="pending"] .task-type-text,
.history-task-card[data-status="submitted"] .task-type-text {
    color: #92400e !important;
}

/* final tail override: history record cards have no outer shadow */
.media-grid-container .history-task-card,
.media-grid-container .history-record-card,
#scrollContent .history-task-card,
#scrollContent .history-record-card {
    box-shadow: none !important;
}

/* final tail override: top refresh button stays visible */
.top-model-info .detail-text,
.top-model-info .top-bulk-progress-slot {
    min-width: 0 !important;
}

.top-model-info .top-workbench-refresh {
    margin-left: auto !important;
}

/* final tail override: collapsible left sidebar */
.home-container.sidebar-collapsed {
    grid-template-columns: 68px minmax(0, 1fr) !important;
}

.home-container.sidebar-collapsed .sidebar {
    padding: 10px 8px !important;
    gap: 10px !important;
    align-items: stretch !important;
}

.home-container.sidebar-collapsed .sidebar-logo {
    height: 48px !important;
    min-height: 48px !important;
    padding: 7px !important;
    border-radius: 14px !important;
}

.home-container.sidebar-collapsed .sidebar-logo .logo-content {
    justify-content: center !important;
}

.home-container.sidebar-collapsed .sidebar-logo .logo-content > div,
.home-container.sidebar-collapsed .logo-text,
.home-container.sidebar-collapsed .logo-subtitle,
.home-container.sidebar-collapsed .selector-container,
.home-container.sidebar-collapsed .model-list,
.home-container.sidebar-collapsed .user-section,
.home-container.sidebar-collapsed .sidebar-credit-panel {
    display: none !important;
}

.home-container.sidebar-collapsed .sidebar-logo .logo-img {
    width: 34px !important;
    height: 34px !important;
}

.home-container.sidebar-collapsed .sidebar-collapse-toggle {
    right: -6px !important;
    top: 42px !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .10) !important;
}

.drawer .sidebar-collapse-toggle {
    display: none !important;
}

@media (max-width: 900px) {
    .home-container.sidebar-collapsed {
        grid-template-columns: 1fr !important;
    }
}

/* final tail override: collapsed sidebar keeps useful icons visible */
.home-container.sidebar-collapsed .sidebar .selector-container {
    display: block !important;
    padding: 6px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .72) !important;
}

.home-container.sidebar-collapsed .sidebar .primary-selector {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
}

.home-container.sidebar-collapsed .sidebar .primary-item {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    gap: 0 !important;
}

.home-container.sidebar-collapsed .sidebar .primary-label,
.home-container.sidebar-collapsed .sidebar .secondary-selector {
    display: none !important;
}

.home-container.sidebar-collapsed .sidebar .primary-icon {
    margin: 0 !important;
    font-size: 15px !important;
}

.home-container.sidebar-collapsed .sidebar .model-list {
    display: block !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.home-container.sidebar-collapsed .sidebar .model-item {
    width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 auto 8px !important;
    padding: 4px !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    border-radius: 13px !important;
}

.home-container.sidebar-collapsed .sidebar .model-info,
.home-container.sidebar-collapsed .sidebar .model-name-row,
.home-container.sidebar-collapsed .sidebar .model-description,
.home-container.sidebar-collapsed .sidebar .model-tags {
    display: none !important;
}

.home-container.sidebar-collapsed .sidebar .model-icon {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    object-fit: cover !important;
}

.home-container.sidebar-collapsed .sidebar .model-css-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.home-container.sidebar-collapsed .sidebar .model-indicator {
    left: 3px !important;
    top: 3px !important;
    width: 7px !important;
    height: 7px !important;
    box-shadow: 0 0 0 4px rgba(82, 110, 204, .14) !important;
}

.home-container.sidebar-collapsed .sidebar .user-section {
    display: flex !important;
    justify-content: center !important;
    padding: 6px !important;
    border-radius: 14px !important;
}

.home-container.sidebar-collapsed .sidebar .user-profile-button {
    flex: 0 0 auto !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
}

.home-container.sidebar-collapsed .sidebar .user-profile-button > div,
.home-container.sidebar-collapsed .sidebar .all-history-button,
.home-container.sidebar-collapsed .sidebar .recharge-button,
.home-container.sidebar-collapsed .sidebar .sidebar-credit-panel {
    display: none !important;
}

.home-container.sidebar-collapsed .sidebar .user-avatar {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
}

/* final tail override: keep sidebar toggle floating on the sidebar edge */
.sidebar {
    position: relative !important;
    overflow: visible !important;
}

.sidebar-collapse-toggle {
    position: absolute !important;
    top: 22px !important;
    right: -14px !important;
    z-index: 80 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border: 2px solid rgba(47, 141, 244, .42) !important;
    color: #215ca8 !important;
    box-shadow: 0 8px 18px rgba(30, 112, 190, .16) !important;
    cursor: pointer !important;
}

.sidebar-collapse-toggle:hover {
    background: #eef7ff !important;
    border-color: rgba(47, 141, 244, .72) !important;
    
}

.home-container.sidebar-collapsed .sidebar-collapse-toggle {
    top: 68px !important;
    right: -15px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
}

.home-container.sidebar-collapsed .sidebar-logo {
    margin-top: 0 !important;
}

.drawer .sidebar-collapse-toggle {
    display: none !important;
}

/* keep toggle visible when sidebar is narrow */
.home-container.sidebar-collapsed .sidebar {
    overflow: visible !important;
}

.home-container.sidebar-collapsed .sidebar .logo-content {
    padding-right: 28px !important;
}

/* final tail override: reference inputs split by required file type */
.top-section {
    --ref-trigger-w: 104px;
    --ref-trigger-h: 118px;
    grid-template-columns: minmax(104px, max-content) minmax(0, 1fr) !important;
}

.cankaotu,
.cankaotu.upload-mode-single-ref,
.cankaotu.upload-mode-first-last {
    width: auto !important;
    min-width: 104px !important;
    max-width: min(448px, 42vw) !important;
    min-height: var(--ref-trigger-h) !important;
    display: grid !important;
    grid-template-columns: repeat(var(--ref-trigger-count, 1), var(--ref-trigger-w)) !important;
    gap: 8px !important;
    align-content: start !important;
}

.cankaotu .upload-trigger,
.cankaotu.upload-mode-first-last .upload-trigger,
.cankaotu.upload-mode-single-ref .upload-trigger {
    width: var(--ref-trigger-w) !important;
    min-width: var(--ref-trigger-w) !important;
    max-width: var(--ref-trigger-w) !important;
    height: var(--ref-trigger-h) !important;
    min-height: var(--ref-trigger-h) !important;
    max-height: var(--ref-trigger-h) !important;
}

.cankaotu .upload-trigger[data-ref-type="video"] .plus-icon {
    color: #2563eb !important;
}

.cankaotu .upload-trigger[data-ref-type="audio"] .plus-icon {
    color: #e11d48 !important;
}

.cankaotu .upload-trigger[data-ref-type="document"] .plus-icon,
.cankaotu .upload-trigger[data-ref-type="file"] .plus-icon {
    color: #7c3aed !important;
}

.task-ref-thumb-audio,
.task-ref-thumb-video,
.task-ref-thumb-document {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    background: #fff !important;
}

.task-ref-thumb-image {
    background: #eafaf0 !important;
    border: 1px solid #c6edd1 !important;
}

.task-ref-thumb-document {
    background: #f5f3ff !important;
    border: 1px solid #d9ccff !important;
}

.task-ref-thumb-audio .task-ref-file-icon,
.task-ref-thumb-video .task-ref-file-icon,
.task-ref-thumb-document .task-ref-file-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
}

.task-ref-thumb-audio .task-ref-file-icon {
    background: #fff1f2 !important;
    color: #e11d48 !important;
}

.task-ref-thumb-video .task-ref-file-icon {
    background: #eff6ff !important;
    color: #2563eb !important;
}

.task-ref-thumb-document .task-ref-file-icon {
    background: #f5f3ff !important;
    color: #7c3aed !important;
}

.task-ref-file-label {
    max-width: 42px !important;
    color: #475569 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Final layout override: reserve a real column for the channel panel. */
.sora2-main-content {
    position: relative !important;
    padding: 10px 10px 10px 310px !important;
    gap: 8px !important;
    transition: padding-left .2s ease !important;
}

.sora2-main-content.channel-panel-collapsed {
    padding-left: 10px !important;
}

.sora2-main-content.channel-panel-unavailable {
    padding-left: 10px !important;
}

.sora2-main-content.channel-panel-unavailable .channel-workbench-panel,
.sora2-main-content.channel-panel-unavailable .channel-panel-open,
.workbench-view-switch.workbench-view-switch-hidden {
    display: none !important;
}

.channel-workbench-panel {
    left: 10px !important;
    top: 10px !important;
    bottom: 10px !important;
}

@media (max-width: 1100px) and (min-width: 981px) {
    .sora2-main-content {
        padding-left: 254px !important;
    }

    .channel-workbench-panel {
        width: 228px !important;
    }
}

@media (max-width: 980px) {
    .sora2-main-content,
    .sora2-main-content.channel-panel-collapsed {
        padding: 10px !important;
    }

    .channel-workbench-panel {
        left: 8px !important;
        top: 8px !important;
        bottom: 8px !important;
    }
}

/* Final layout: model list and channel list form one collapsible left workspace. */
#sidebarCollapseToggle {
    display: none !important;
}

.sidebar {
    border-right: 0 !important;
    box-shadow: none !important;
}

.home-container {
    grid-template-columns: var(--sidebar-w) 294px minmax(0, 1fr) !important;
    transition: grid-template-columns .2s ease !important;
}

.sora2-main-content {
    padding: 10px !important;
}

.channel-workbench-panel {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: calc(100% - 28px) !important;
    margin: 14px 6px 14px 0 !important;
    z-index: 8 !important;
    border: 1px solid #cfe0f2 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: opacity .16s ease, transform .2s ease !important;
}

.model-item-active {
    border-color: #2f8df4 !important;
    box-shadow: inset 0 0 0 1px rgba(47, 141, 244, .18) !important;
}

.home-container.channel-panel-unavailable {
    grid-template-columns: var(--sidebar-w) 0 minmax(0, 1fr) !important;
}

.home-container.channel-panel-unavailable > .channel-workbench-panel {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(-10px) !important;
}

.home-container.left-workspace-collapsed {
    grid-template-columns: 0 0 minmax(0, 1fr) !important;
}

.home-container.left-workspace-collapsed > .sidebar,
.home-container.left-workspace-collapsed > .channel-workbench-panel {
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-width: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(-14px) !important;
    overflow: hidden !important;
}

.home-container.left-workspace-collapsed > .main-content {
    padding-left: 14px !important;
}

@media (max-width: 1100px) and (min-width: 981px) {
    .home-container {
        grid-template-columns: var(--sidebar-w) 238px minmax(0, 1fr) !important;
    }

    .home-container.channel-panel-unavailable {
        grid-template-columns: var(--sidebar-w) 0 minmax(0, 1fr) !important;
    }

    .home-container.left-workspace-collapsed {
        grid-template-columns: 0 0 minmax(0, 1fr) !important;
    }
}

@media (max-width: 980px) {
    .home-container,
    .home-container.channel-panel-unavailable,
    .home-container.left-workspace-collapsed {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .sora2-main-content {
        padding: 10px !important;
    }

    .home-container > .channel-workbench-panel {
        position: fixed !important;
        left: 8px !important;
        top: 64px !important;
        bottom: 8px !important;
        width: min(82vw, 300px) !important;
        height: auto !important;
        margin: 0 !important;
        z-index: 120 !important;
        transform: translateX(calc(-100% - 18px)) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .home-container.channel-panel-mobile-open > .channel-workbench-panel {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .channel-panel-open,
    .sora2-main-content.channel-panel-collapsed .channel-panel-open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateX(0) !important;
    }
}

/* Final visual pass: pure white surfaces with fewer structural borders. */
html,
body,
.bg,
.home-container,
.topbar,
.sidebar,
.main-content,
.sora2-container,
.sora2-main-content,
.sidebar-logo,
.sidebar .selector-container,
.sidebar .model-list,
.channel-workbench-panel,
.channel-workbench-head,
.channel-workbench-list,
.top-model-info,
.scroll-container,
.scroll-content,
.bottom-input-wrapper,
.bottom-container,
.top-section,
.bottom-section,
.rich-input {
    background: #fff !important;
    background-image: none !important;
}

.sora2-container,
.sidebar-logo,
.sidebar .selector-container,
.sidebar .model-list,
.channel-workbench-panel,
.top-model-info,
.scroll-container {
    border: 0 !important;
    box-shadow: none !important;
}

.sidebar .selector-container {
    border-radius: 12px 12px 0 0 !important;
}

.sidebar .model-list {
    margin-top: -10px !important;
    border-radius: 0 0 12px 12px !important;
    padding-right: 16px !important;
}

.channel-workbench-panel {
    border-radius: 0 !important;
}

.channel-workbench-head {
    border: 0 !important;
    border-bottom: 1px solid #eef0f3 !important;
}

.channel-workbench-card {
    background: #fff !important;
    background-image: none !important;
    border-color: #e5e7eb !important;
    box-shadow: none !important;
    position: relative !important;
    min-height: 60px !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 104px !important;
    grid-template-rows: minmax(46px, auto) !important;
    column-gap: 6px !important;
    row-gap: 0 !important;
    align-items: center !important;
    padding: 6px 8px !important;
    overflow: hidden !important;
}

.channel-workbench-card:hover {
    background: #fff !important;
    border-color: #93b9e7 !important;
}

.channel-workbench-card.active {
    background: #fff !important;
    border-color: #2f8df4 !important;
    box-shadow: inset 3px 0 0 #2f8df4 !important;
}

.channel-workbench-name {
    display: block !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-height: 34px !important;
    color: #111827 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 17px !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    -webkit-box-orient: initial !important;
    -webkit-line-clamp: unset !important;
}

.channel-workbench-meta {
    display: contents !important;
}

.channel-workbench-rate {
    min-width: max-content !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    color: #16803c !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    align-self: auto !important;
    justify-self: end !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: block !important;
}

.channel-workbench-stats {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: stretch !important;
    min-height: 34px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    align-content: center !important;
    justify-items: end !important;
    row-gap: 4px !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.channel-workbench-price-row {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: inline-flex !important;
    align-items: baseline !important;
    justify-content: flex-end !important;
    gap: 0 !important;
    white-space: nowrap !important;
}

.channel-workbench-rate-empty {
    color: #94a3b8 !important;
}

.channel-workbench-cost {
    color: #dc2626 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
}

.channel-workbench-cost-once,
.dropdown-credit-text-once {
    color: #dc2626 !important;
}

.channel-workbench-cost-second,
.dropdown-credit-text-second {
    color: #2563eb !important;
}

.channel-workbench-cost-auto,
.dropdown-credit-text-auto {
    color: #ea580c !important;
}

.channel-workbench-cost-invalid,
.dropdown-credit-text-invalid {
    color: #991b1b !important;
}

.channel-workbench-cost-unknown,
.dropdown-credit-text-unknown {
    color: #64748b !important;
}

.channel-billing-mode {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 16px !important;
    margin-left: 4px !important;
    padding: 0 4px !important;
    border: 1px solid #fdba74 !important;
    border-radius: 3px !important;
    background: #fff7ed !important;
    color: #c2410c !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    line-height: 14px !important;
}

.channel-billing-mode-invalid {
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

.channel-billing-mode-unknown {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
    color: #64748b !important;
}

.channel-workbench-duration {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 16px !important;
    margin-left: 4px !important;
    padding: 0 5px !important;
    border: 1px solid #c4b5fd !important;
    border-radius: 3px !important;
    background: #ede9fe !important;
    color: #6d28d9 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
}

#priceTag {
    max-width: min(520px, calc(100% - 72px)) !important;
}

#priceTag .price-value {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#priceTag[data-billing-mode="auto"] {
    border-color: #fdba74 !important;
    background: #fff7ed !important;
}

#priceTag[data-billing-mode="auto"] .price-type,
#priceTag[data-billing-mode="auto"] .price-value {
    color: #c2410c !important;
}

#priceTag[data-billing-mode="second"] {
    border-color: #93c5fd !important;
    background: #eff6ff !important;
}

#priceTag[data-billing-mode="second"] .price-type,
#priceTag[data-billing-mode="second"] .price-value {
    color: #1d4ed8 !important;
}

#priceTag[data-billing-mode="once"] {
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

#priceTag[data-billing-mode="once"] .price-type,
#priceTag[data-billing-mode="once"] .price-value {
    color: #b91c1c !important;
}

#priceTag[data-billing-mode="invalid"] {
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

#priceTag[data-billing-mode="invalid"] .price-type,
#priceTag[data-billing-mode="invalid"] .price-value {
    color: #991b1b !important;
}

#priceTag[data-billing-mode="unknown"] {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
}

.model-item,
.model-item:hover,
.model-item-active {
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
}

.model-item {
    border-color: #e5e7eb !important;
}

.model-item-active {
    border-color: #2f8df4 !important;
}

.model-item-active::after {
    content: "";
    position: absolute;
    right: -11px;
    top: 50%;
    z-index: 3;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 11px solid #2f8df4;
    transform: translateY(-50%);
    pointer-events: none;
}

.model-item-active::before {
    content: "";
    position: absolute;
    right: -8px;
    top: 50%;
    z-index: 4;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 8px solid #fff;
    transform: translateY(-50%);
    pointer-events: none;
}

.secondary-slider {
    display: none !important;
}

.secondary-item {
    border: 1px solid transparent !important;
}

.secondary-item-active {
    border-color: #2f8df4 !important;
    
}

.primary-item,
.secondary-selector,
.secondary-track,
.secondary-item,
.primary-item-active,
.secondary-item-active,
.workbench-view-switch,
.workbench-view-btn,
.workbench-view-btn.active,
.history-view-toggle,
.history-view-btn,
.history-view-btn.active,
.channel-panel-close,
.channel-panel-open,
.selector-btn,
.composer-asset-btn,
.cankaotu .upload-trigger {
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
}

.bottom-input-wrapper {
    border: 1px solid #d9dee7 !important;
    box-shadow: none !important;
}

/* Left sidebar: media modes and their feature filters. */
.sidebar .primary-selector {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px !important;
}

.sidebar .primary-item {
    min-width: 0;
    height: 42px;
    padding: 3px 2px;
    gap: 4px;
    flex-direction: column;
    font-size: 11px;
}

.sidebar .primary-label {
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
}

.sidebar .secondary-track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.sidebar .secondary-item[hidden],
.sidebar .secondary-selector[hidden],
.sidebar .feature-caption[hidden] {
    display: none !important;
}

.sidebar .secondary-item {
    min-width: 0;
    padding: 0 4px;
    white-space: nowrap;
    font-size: 12px;
}

.sidebar .feature-caption {
    padding: 7px 5px 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}

.home-container.sidebar-collapsed .sidebar .primary-selector {
    grid-template-columns: 1fr !important;
}

.home-container.sidebar-collapsed .sidebar .primary-item {
    flex-direction: row;
}

/* Functional cards stay in the sidebar; models and channels open from the composer. */
.sidebar .secondary-selector {
    display: none !important;
}

.sidebar .model-list {
    margin: 12px 0 8px !important;
    padding: 0 4px 4px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.sidebar .model-list .sidebar-feature-item {
    width: 100%;
    min-height: 68px;
    margin: 0 0 8px !important;
    padding: 10px 9px !important;
    text-align: left;
    color: #172033;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    cursor: pointer;
}

.sidebar .model-list .sidebar-feature-item:hover {
    border-color: #93c5fd !important;
    background: #f8fbff !important;
}

.sidebar .model-list .sidebar-feature-item.model-item-active {
    border-color: #2f8df4 !important;
    background: #f3f8ff !important;
    box-shadow: inset 0 0 0 1px rgba(47, 141, 244, .12) !important;
}

.sidebar .model-list .batch-generate-entry {
    margin-top: 12px !important;
    border-top-color: #cbd5e1 !important;
}

.sidebar-feature-item .model-info {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-feature-item .model-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sidebar-feature-item .model-name {
    font-size: 13px !important;
    white-space: normal !important;
}

.sidebar-feature-item .model-description {
    height: auto !important;
    min-height: 0 !important;
    margin-top: 3px;
    padding: 0 !important;
    color: #667085 !important;
    background: transparent !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
}

.home-container,
.home-container.channel-panel-unavailable,
.home-container.left-workspace-collapsed {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) !important;
}

.home-container > .channel-workbench-panel,
.sora2-main-content .channel-panel-open {
    display: none !important;
}

.sora2-main-content,
.sora2-main-content.channel-panel-collapsed,
.sora2-main-content.channel-panel-unavailable {
    padding: 10px !important;
}

.home-container.left-workspace-collapsed > .sidebar {
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

#channelSelector,
#activeModelSelector,
.current-model-pill {
    display: none !important;
}

.model-picker-popover {
    position: fixed;
    z-index: 10050;
    display: none;
    flex-direction: column;
    width: min(760px, calc(100vw - 24px));
    height: min(430px, calc(100vh - 24px));
    overflow: hidden;
    color: #172033;
    background: #fff;
    border: 1px solid #d9e0e8;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .2);
}

.model-picker-popover.show {
    display: flex;
}

.model-picker-header {
    min-height: 56px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e8edf3;
}

.model-picker-header > div:first-child {
    display: grid;
    gap: 2px;
}

.model-picker-header strong {
    font-size: 14px;
}

.model-picker-header small {
    color: #7b8492;
    font-size: 11px;
}

.model-picker-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-picker-header-actions button {
    min-height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
}

.model-picker-header-actions button:hover {
    background: #f8fafc;
}

.model-picker-header-actions .model-picker-close {
    width: 32px;
    padding: 0;
    font-size: 15px;
}

.model-picker-body {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 82px minmax(0, 1.05fr) minmax(0, .95fr);
}

.model-picker-vendors {
    min-height: 0;
    padding: 7px 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    background: #fafbfc;
    border-right: 1px solid #e8edf3;
}

.model-picker-vendor {
    min-height: 32px;
    padding: 0 7px;
    text-align: left;
    color: #667085;
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
}

.model-picker-vendor:hover,
.model-picker-vendor.active {
    
    background: #eaf2ff;
}

.model-picker-model-column,
.model-picker-channel-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.model-picker-model-column {
    border-right: 1px solid #e8edf3;
}

.model-picker-search {
    height: 38px;
    margin: 9px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #98a2b3;
    border: 1px solid #d8dee8;
    border-radius: 7px;
}

.model-picker-search input,
.model-picker-channel-title input {
    width: 100%;
    min-width: 0;
    color: #172033;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12px;
}

.model-picker-models,
.model-picker-channels {
    min-height: 0;
    flex: 1;
    padding: 0 8px 8px;
    overflow: auto;
}

.model-picker-model,
.model-picker-channel {
    width: 100%;
    min-height: 58px;
    padding: 8px 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    color: #172033;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    cursor: pointer;
}

.model-picker-model:hover,
.model-picker-channel:hover {
    background: #f8fbff;
}

.model-picker-model.active,
.model-picker-channel.active {
    background: #f0f6ff;
}

.model-picker-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    object-fit: contain;
    border-radius: 7px;
}

.model-picker-model-copy,
.model-picker-channel-copy {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 3px;
}

.model-picker-model-copy strong,
.model-picker-channel-copy strong {
    overflow: hidden;
    color: #263244;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-picker-model-copy small,
.model-picker-channel-copy small {
    overflow: hidden;
    color: #8590a0;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-picker-model-price,
.model-picker-channel > b {
    flex: 0 0 auto;
    padding: 4px 6px;
    color: #c2414b;
    background: #fff1f1;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.model-picker-channel-title {
    min-height: 57px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid #e8edf3;
}

.model-picker-channel-title strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-picker-channel-title input {
    height: 25px;
    padding: 0 7px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
}

.model-picker-channel[hidden],
.model-picker-channel-title input[hidden] {
    display: none !important;
}

.model-picker-empty {
    padding: 22px 10px;
    color: #8993a1;
    text-align: center;
    font-size: 11px;
}

.media-settings-popover {
    position: fixed;
    z-index: 10040;
    display: none;
    width: min(360px, calc(100vw - 24px));
    padding: 12px;
    color: #303640;
    background: #fff;
    border: 1px solid #d9e0e8;
    border-radius: 9px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .17);
}

.media-settings-popover.show {
    display: grid;
    gap: 10px;
}

.media-settings-group {
    padding-bottom: 10px;
    border-bottom: 1px solid #e8edf3;
}

.media-settings-group:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.media-settings-group > strong {
    display: block;
    margin-bottom: 7px;
    color: #697586;
    font-size: 11px;
}

.media-settings-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.media-settings-option {
    min-width: 64px;
    min-height: 34px;
    padding: 0 10px;
    color: #505967;
    background: #f5f6f8;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}

.media-settings-option.active {
    
    background: #eaf2ff;
    border-color: #b2ccff;
}

@media (max-width: 760px) {
    .model-picker-popover {
        width: calc(100vw - 20px);
        height: min(76vh, 620px);
    }

    .model-picker-body {
        grid-template-columns: 66px minmax(0, 1fr);
        grid-template-rows: minmax(150px, 1fr) minmax(130px, .8fr);
    }

    .model-picker-vendors {
        grid-row: 1 / span 2;
    }

    .model-picker-model-column {
        border-right: 0;
        border-bottom: 1px solid #e8edf3;
    }

    .model-picker-channel-column {
        grid-column: 2;
    }
}

.bottom-container {
    border: 0 !important;
}

.rich-input,
.cankaotu .upload-trigger,
.selector-btn {
    border-color: #dfe3e8 !important;
}

.top-model-info {
    margin-bottom: 6px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid #eef0f3 !important;
}

.top-model-info .detail-text {
    flex: 1 1 auto !important;
    max-width: none !important;
}

.top-model-title-row {
    width: 100%;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    row-gap: 3px !important;
}

.top-model-title-row .top-model-name {
    flex: 0 0 auto !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

.top-channel-name {
    flex: 1 1 320px !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #185ca8 !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.task-progress-card[data-status="pending"] .task-progress-track,
.task-progress-card[data-status="waiting"] .task-progress-track,
.task-progress-card[data-status="running"] .task-progress-track,
.task-progress-card[data-status="processing"] .task-progress-track,
.task-progress-card[data-status="submitted"] .task-progress-track {
    background: #eef0f3 !important;
}

/* 案例模板：瀑布流、按需加载与详情弹窗 */
.channel-sample-content {
    padding: 10px 12px 24px !important;
    background: #fff !important;
}

.template-sample-shell {
    width: 100%;
}

.template-sample-heading {
    min-height: 38px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.template-sample-heading > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.template-sample-heading strong {
    color: #111827;
    font-size: 14px;
}

.template-sample-heading span {
    color: #6b7280;
    font-size: 12px;
}

.template-sample-loading {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #64748b;
}

.template-sample-loading i {
    color: #2f8df4;
    font-size: 26px;
}

.template-sample-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: start;
    gap: 8px;
    column-count: initial !important;
}

.template-sample-item {
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid #e1e5ea;
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
    break-inside: auto;
    cursor: pointer;
    outline: none;
    transition: border-color .16s ease, transform .16s ease;
}

.template-sample-item:hover,
.template-sample-item:focus-visible {
    border-color: #79ace6;
    transform: translateY(-1px);
}

.template-sample-media {
    position: relative;
    min-height: 105px;
    background: #f3f4f6;
    overflow: hidden;
}

.template-sample-media img,
.template-sample-media video {
    display: block;
    width: 100%;
    height: auto;
    min-height: 105px;
    max-height: 300px;
    object-fit: cover;
}

.template-sample-media video {
    aspect-ratio: 9 / 12;
    background: #111827;
}

.template-media-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    color: #9ca3af;
    background: #f3f4f6;
}

.template-media-placeholder i {
    font-size: 30px;
}

.template-sample-media.is-loaded .template-media-placeholder {
    display: none;
}

.template-video-badge {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    background: rgba(17, 24, 39, .72);
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.template-audio-preview {
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #b42332;
    background: #fff2f3;
}

.template-audio-preview i {
    font-size: 30px;
}

.template-sample-media audio {
    display: block;
    width: calc(100% - 16px);
    height: 36px;
    margin: 8px;
}

.template-sample-copy {
    padding: 7px 8px 8px;
}

.template-sample-copy > strong {
    display: -webkit-box;
    overflow: hidden;
    color: #111827;
    font-size: 12px;
    line-height: 17px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.template-sample-copy > p {
    display: -webkit-box;
    overflow: hidden;
    margin: 5px 0 0;
    color: #4b5563;
    font-size: 11px;
    line-height: 16px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.template-sample-meta {
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid #eef0f3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #6b7280;
    font-size: 10px;
}

.template-sample-meta span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-load-sentinel {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #6b7280;
    font-size: 12px;
}

.template-load-sentinel.is-error {
    cursor: pointer;
    color: #2563eb;
}

.template-load-sentinel.is-loading {
    pointer-events: none;
}

.template-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    padding: 22px;
    background: rgba(15, 23, 42, .45);
    display: none;
    align-items: center;
    justify-content: center;
}

.template-detail-modal.show {
    display: flex;
}

body.template-modal-open {
    overflow: hidden;
}

.template-detail-dialog {
    width: min(980px, 96vw);
    max-height: min(780px, 92vh);
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.template-detail-head {
    min-height: 58px;
    padding: 9px 12px 9px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.template-detail-head > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.template-detail-head span {
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}

.template-detail-head strong {
    overflow: hidden;
    color: #111827;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-detail-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    color: #4b5563;
    background: #f3f4f6;
    cursor: pointer;
}

.template-detail-body {
    min-height: 0;
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(320px, 1.05fr);
    gap: 16px;
    overflow: auto;
}

.template-detail-preview {
    min-height: 320px;
    max-height: 620px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #f3f4f6;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.template-detail-preview img,
.template-detail-preview video {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 620px;
    object-fit: contain;
    background: #111827;
}

.template-detail-audio {
    width: 100%;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    color: #b42332;
}

.template-detail-audio > i {
    font-size: 54px;
}

.template-detail-audio audio {
    width: 100%;
}

.template-detail-info {
    min-width: 0;
}

.template-detail-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.template-detail-facts > div {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.template-detail-facts span,
.template-detail-facts strong {
    display: block;
}

.template-detail-facts span {
    margin-bottom: 3px;
    color: #6b7280;
    font-size: 11px;
}

.template-detail-facts strong {
    color: #111827;
    font-size: 12px;
    line-height: 18px;
    overflow-wrap: anywhere;
}

.template-detail-info section {
    margin-top: 14px;
}

.template-detail-info h4 {
    margin: 0 0 7px;
    color: #111827;
    font-size: 13px;
}

.template-detail-prompt {
    max-height: 210px;
    margin: 0;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    background: #fafafa;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow: auto;
}

.template-detail-refs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.template-detail-ref {
    position: relative;
    width: 82px;
    height: 82px;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    color: #374151;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
}

.template-detail-ref img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-detail-ref > span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 3px 4px;
    color: #fff;
    background: rgba(17, 24, 39, .72);
    font-size: 10px;
    text-align: center;
}

.template-detail-ref-file {
    flex-direction: column;
    gap: 7px;
}

.template-detail-ref-file i {
    color: #2f8df4;
    font-size: 25px;
}

.template-detail-ref-file > span {
    position: static;
    padding: 0;
    color: #4b5563;
    background: transparent;
}

.template-detail-ref-media {
    width: 156px;
    height: 118px;
    padding: 6px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 5px;
}

.template-detail-ref-media video {
    display: block;
    width: 100%;
    height: 78px;
    min-height: 0;
    object-fit: contain;
    background: #111827;
}

.template-detail-ref-media audio {
    display: block;
    width: 100%;
    height: 34px;
}

.template-detail-ref-audio {
    align-items: center;
    justify-content: center;
}

.template-detail-ref-audio > i {
    color: #b42332;
    font-size: 22px;
}

.template-detail-ref-media > a {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #374151;
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

/* Model names are the primary navigation; channel names stay one step quieter. */
.model-item .model-name {
    font-size: 15px !important;
    font-weight: 700 !important;
}

.channel-workbench-card .channel-workbench-name {
    font-size: 13px !important;
    font-weight: 400 !important;
}

.template-detail-empty {
    color: #9ca3af;
    font-size: 12px;
}

.template-detail-actions {
    padding: 11px 14px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.template-detail-actions button {
    min-height: 36px;
    padding: 0 13px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.template-detail-copy {
    border: 1px solid #d1d5db;
    color: #374151;
    background: #fff;
}

.template-detail-use {
    border: 1px solid #1976d2;
    color: #fff;
    background: #1976d2;
}

@media (max-width: 720px) {
    .template-sample-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    .channel-sample-content {
        padding: 8px !important;
    }

    .template-sample-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
    }

    .template-sample-item {
        margin-bottom: 8px;
    }

    .template-detail-modal {
        padding: 8px;
    }

    .template-detail-dialog {
        width: 100%;
        max-height: 96vh;
    }

    .template-detail-body {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .template-detail-preview {
        min-height: 240px;
        max-height: 48vh;
    }

    .template-detail-actions {
        justify-content: stretch;
    }

    .template-detail-actions button {
        flex: 1 1 0;
    }
}

/* Final layout: composer fills the workbench and left columns keep a divider. */
#bottom-section-div.bottom-input-wrapper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
}

#bottom-section-div > .bottom-container {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

.home-container:not(.left-workspace-collapsed) > .sidebar {
    border: 0 !important;
    border-right: 1px solid #e2e7ed !important;
}

.home-container:not(.left-workspace-collapsed) > .channel-workbench-panel {
    border: 0 !important;
    border-right: 1px solid #e2e7ed !important;
}

@media (max-width: 980px) {
    .home-container:not(.left-workspace-collapsed) > .channel-workbench-panel {
        border: 1px solid #e2e7ed !important;
    }
}

/* Compact composer and flat list rows. */
#bottom-section-div.bottom-input-wrapper {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    align-self: center !important;
}

.sidebar .model-list {
    padding: 0 10px 8px !important;
}

.model-item,
.model-item:hover,
.model-item-active {
    margin: 0 !important;
    padding: 10px 6px !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
}

.model-item:hover {
    background: #f8fafc !important;
}

.model-item.model-item-active,
.model-item.model-item-active:hover {
    background: #f3f8ff !important;
    border: 1px solid #2f8df4 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
}

.model-item-active::before,
.model-item-active::after {
    display: block !important;
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    width: 0 !important;
    height: 0 !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}

.model-item-active::after {
    right: -11px !important;
    z-index: 3 !important;
    border-top: 9px solid transparent !important;
    border-bottom: 9px solid transparent !important;
    border-left: 11px solid #2f8df4 !important;
}

.model-item-active::before {
    right: -8px !important;
    z-index: 4 !important;
    border-top: 7px solid transparent !important;
    border-bottom: 7px solid transparent !important;
    border-left: 8px solid #f3f8ff !important;
}

.sidebar .model-list .model-item-inspiration {
    position: sticky !important;
    top: 0 !important;
    z-index: 12 !important;
    margin: 0 0 6px !important;
    padding: 10px 8px !important;
    border: 1px solid #dbe3ee !important;
    background: #fff !important;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .06) !important;
}

.sidebar .model-list .model-item-inspiration:hover {
    background: #fffaf0 !important;
    border-color: #f1c76b !important;
}

.sidebar .model-list .model-item-inspiration.model-item-active {
    background: #fff8e8 !important;
    border-color: #e7a928 !important;
}

.sidebar .model-list .model-item-inspiration::before,
.sidebar .model-list .model-item-inspiration::after {
    display: none !important;
}

.template-pinned-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 4px;
    background: rgba(190, 24, 93, .92);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.inspiration-gallery-shell {
    padding: 2px 4px 20px;
}

.inspiration-gallery-shell .template-sample-heading {
    margin-bottom: 8px;
}

.inspiration-category-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 2px 0 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.inspiration-category-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid #cfd9e7;
    border-radius: 19px;
    background: #fff;
    color: #42516a;
    font-size: 13px;
    font-weight: 700;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.inspiration-category-btn:hover {
    border-color: #86b3eb;
    
}

.inspiration-category-btn.active {
    border-color: #2477e8;
    background: #2477e8;
    
}

.inspiration-template-admin-btn {
    margin-left: auto;
    border-color: #f0c780;
    background: #fffaf0;
    color: #a86406;
}

.inspiration-template-admin-btn:hover {
    border-color: #dc9e31;
    background: #fff5df;
    
}

.inspiration-gallery-shell .template-sample-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.inspiration-template-item {
    border-color: #dce3ec;
    border-radius: 7px;
}

.inspiration-template-item .template-sample-media {
    min-height: 220px;
    aspect-ratio: 4 / 5;
    background: #eef2f7;
}

.inspiration-template-item .template-sample-media img,
.inspiration-template-item .template-sample-media video {
    width: 100%;
    height: 100%;
    min-height: 220px;
    max-height: none;
    object-fit: cover;
}

.inspiration-template-item .template-audio-preview {
    height: 100%;
    min-height: 220px;
}

.inspiration-template-item .template-sample-copy {
    padding: 10px 11px 11px;
}

.inspiration-template-item .template-sample-copy > strong {
    font-size: 13px;
    line-height: 18px;
}

.inspiration-template-item .template-sample-copy > p {
    -webkit-line-clamp: 2;
}

@media (max-width: 1280px) {
    .inspiration-gallery-shell .template-sample-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .inspiration-gallery-shell .template-sample-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .inspiration-category-btn {
        min-height: 34px;
        padding: 0 14px;
    }
}

@media (max-width: 560px) {
    .inspiration-gallery-shell .template-sample-grid {
        grid-template-columns: 1fr !important;
    }
}

.channel-workbench-list {
    padding: 0 10px 8px !important;
}

.channel-workbench-card,
.channel-workbench-card:hover,
.channel-workbench-card.active {
    width: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    transform: none !important;
}

.channel-workbench-card:hover {
    background: #f8fafc !important;
}

.channel-workbench-card.active,
.channel-workbench-card.active:hover {
    background: #f3f8ff !important;
    border: 1px solid #2f8df4 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    overflow: visible !important;
}

.channel-workbench-card.active::before,
.channel-workbench-card.active::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    width: 0 !important;
    height: 0 !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}

.channel-workbench-card.active::after {
    right: -11px !important;
    z-index: 3 !important;
    border-top: 9px solid transparent !important;
    border-bottom: 9px solid transparent !important;
    border-left: 11px solid #2f8df4 !important;
}

.channel-workbench-card.active::before {
    right: -8px !important;
    z-index: 4 !important;
    border-top: 7px solid transparent !important;
    border-bottom: 7px solid transparent !important;
    border-left: 8px solid #f3f8ff !important;
}

/* Responsive home layout: keep the workbench usable on tablets and phones. */
@media (max-width: 980px) {
    html,
    body {
        min-width: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .topbar {
        min-width: 0 !important;
        width: 100% !important;
        padding: 8px 12px !important;
        gap: 8px !important;
    }

    .topbar .left,
    .topbar .right,
    .top-title,
    .top-title > div {
        min-width: 0 !important;
    }

    .top-title {
        flex: 1 1 auto !important;
    }

    .top-title #topbarTitle,
    .top-title #topbarSub {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .home-container,
    .home-container.channel-panel-unavailable,
    .home-container.left-workspace-collapsed {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        min-width: 0 !important;
        height: calc(100vh - 58px) !important;
    }

    .home-container > .sidebar {
        display: none !important;
    }

    .home-container > .main-content {
        grid-column: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .sora2-container,
    .sora2-main-content {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 8px !important;
        overflow: hidden !important;
    }

    .home-container > .channel-workbench-panel {
        display: flex !important;
        position: fixed !important;
        left: 8px !important;
        top: 64px !important;
        bottom: 8px !important;
        width: min(86vw, 320px) !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        z-index: 1200 !important;
        transform: translateX(calc(-100% - 20px)) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        box-shadow: 12px 0 30px rgba(15, 23, 42, .16) !important;
    }

    .home-container.channel-panel-mobile-open > .channel-workbench-panel {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .channel-panel-open,
    .sora2-main-content.channel-panel-collapsed .channel-panel-open {
        display: inline-flex !important;
        position: fixed !important;
        left: 8px !important;
        top: 68px !important;
        z-index: 1100 !important;
        width: 34px !important;
        height: 34px !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .top-model-info {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 66px !important;
        padding: 8px 8px 8px 48px !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        align-items: center !important;
    }

    .top-model-info .icon-wrapper {
        flex: 0 0 34px !important;
        width: 34px !important;
        height: 34px !important;
    }

    .top-model-info .detail-text {
        flex: 1 1 calc(100% - 50px) !important;
        min-width: 0 !important;
    }

    .top-model-title-row {
        min-width: 0 !important;
        width: 100% !important;
    }

    .top-model-title-row .top-model-name,
    .top-channel-name {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .top-model-info .workbench-view-switch {
        order: 10 !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
    }

    .workbench-view-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    .top-workbench-refresh {
        flex: 0 0 auto !important;
        max-width: 42px !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }

    .top-workbench-refresh span {
        display: none !important;
    }

    .scroll-container,
    .scroll-content {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        overflow-x: hidden !important;
    }

    .scroll-content {
        padding: 8px 0 180px !important;
    }

    .history-task-card,
    .result-card,
    .task-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

    #bottom-section-div.bottom-input-wrapper {
        position: absolute !important;
        left: 8px !important;
        right: 8px !important;
        bottom: 8px !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        z-index: 30 !important;
    }

    #bottom-section-div > .bottom-container,
    .bottom-container,
    .top-section,
    .bottom-section,
    .input-container {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box !important;
    }

    .bottom-section,
    .bottom-section > *,
    .composer-toolbar,
    .input-toolbar {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .rich-input,
    .prompt-input,
    [contenteditable="true"] {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
    }
}

@media (max-width: 600px) {
    .topbar {
        min-height: 52px !important;
        padding: 6px 8px !important;
    }

    .topbar .right,
    #topbarModePill {
        display: none !important;
    }

    #openVideoTable {
        width: 34px !important;
        min-width: 34px !important;
        padding: 0 !important;
        overflow: hidden !important;
        font-size: 0 !important;
    }

    #openVideoTable::before {
        content: "\f017";
        font-family: "Font Awesome 6 Free";
        font-size: 14px;
        font-weight: 900;
    }

    .home-container {
        height: calc(100vh - 52px) !important;
    }

    .sora2-main-content {
        padding: 6px !important;
    }

    .top-model-info {
        min-height: 92px !important;
        padding: 8px 6px 6px 46px !important;
    }

    .top-model-info #topModelDesc {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden !important;
        line-height: 1.35 !important;
    }

    .top-model-title-row .top-model-name,
    .top-channel-name {
        font-size: 13px !important;
    }

    .scroll-content {
        padding-bottom: 220px !important;
    }

    #bottom-section-div.bottom-input-wrapper {
        left: 5px !important;
        right: 5px !important;
        bottom: 5px !important;
    }

    .cankaotu,
    .reference-file-list,
    .asset-list {
        max-width: 100% !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
    }

    .bottom-container button,
    .bottom-container .selector-btn {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .channel-workbench-panel {
        width: min(92vw, 320px) !important;
    }
}

@media (max-width: 420px) {
    .topbar .left {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .top-title #topbarTitle {
        font-size: 14px !important;
    }

    .top-title #topbarSub {
        font-size: 10px !important;
    }

    .top-model-info {
        padding-left: 42px !important;
    }

    .top-model-info .icon-wrapper {
        flex-basis: 30px !important;
        width: 30px !important;
        height: 30px !important;
    }

    .top-model-info .top-bulk-progress-slot {
        display: none !important;
    }

    .history-task-card .task-card-body {
        display: block !important;
        padding: 9px !important;
    }

    .history-task-card .task-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        margin-top: 8px !important;
    }

    .history-task-card .history-result-panel {
        margin-top: 8px !important;
    }

    .workbench-view-btn {
        padding-inline: 8px !important;
        font-size: 12px !important;
    }
}

/* Final layout contract: sidebar features, composer model picker, no model rail. */
.sidebar .secondary-selector {
    display: none !important;
}

.sidebar .model-list {
    margin: 12px 0 8px !important;
    padding: 0 4px 4px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.sidebar .model-list .sidebar-feature-item {
    position: relative !important;
    width: 100% !important;
    min-height: 68px !important;
    height: auto !important;
    margin: 0 0 8px !important;
    padding: 10px 9px !important;
    text-align: left !important;
    color: #172033 !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.sidebar .model-list .sidebar-feature-item.model-item-active {
    border-color: #2f8df4 !important;
    background: #f3f8ff !important;
}

.sidebar-feature-item .model-info {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.sidebar-feature-item .model-name {
    font-size: 13px !important;
    white-space: normal !important;
}

.sidebar-feature-item .model-description {
    height: auto !important;
    min-height: 0 !important;
    margin-top: 3px !important;
    padding: 0 !important;
    color: #667085 !important;
    background: transparent !important;
    font-size: 11px !important;
}

.home-container,
.home-container.channel-panel-unavailable,
.home-container.left-workspace-collapsed {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) !important;
}

.home-container > .channel-workbench-panel,
.sora2-main-content .channel-panel-open {
    display: none !important;
}

.sora2-main-content,
.sora2-main-content.channel-panel-collapsed,
.sora2-main-content.channel-panel-unavailable {
    padding: 10px !important;
}

.home-container.left-workspace-collapsed > .sidebar {
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

#channelSelector,
#activeModelSelector,
.current-model-pill {
    display: none !important;
}

.model-picker-popover {
    position: fixed !important;
    z-index: 10050 !important;
    display: none !important;
    flex-direction: column !important;
    width: min(760px, calc(100vw - 24px)) !important;
    height: min(430px, calc(100vh - 24px)) !important;
    overflow: hidden !important;
    color: #172033 !important;
    background: #fff !important;
    border: 1px solid #d9e0e8 !important;
    border-radius: 10px !important;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .2) !important;
}

.model-picker-popover.show {
    display: flex !important;
}

.model-picker-header {
    min-height: 56px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e8edf3;
}

.model-picker-header > div:first-child,
.model-picker-model-copy,
.model-picker-channel-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.model-picker-header-actions {
    display: flex;
    gap: 6px;
}

.model-picker-header-actions button {
    min-height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
}

.model-picker-header-actions .model-picker-close {
    width: 32px;
    padding: 0;
    justify-content: center;
}

.model-picker-body {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: 82px minmax(0, 1.05fr) minmax(0, .95fr);
}

.model-picker-vendors {
    min-height: 0;
    padding: 7px 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    background: #fafbfc;
    border-right: 1px solid #e8edf3;
}

.model-picker-vendor {
    min-height: 32px;
    padding: 0 7px;
    text-align: left;
    color: #667085;
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
}

.model-picker-vendor.active {
    
    background: #eaf2ff;
}

.model-picker-model-column,
.model-picker-channel-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.model-picker-model-column {
    border-right: 1px solid #e8edf3;
}

.model-picker-search {
    height: 38px;
    margin: 9px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d8dee8;
    border-radius: 7px;
}

.model-picker-search input,
.model-picker-channel-title input {
    width: 100%;
    min-width: 0;
    color: #172033;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12px;
}

.model-picker-models,
.model-picker-channels {
    min-height: 0;
    flex: 1;
    padding: 0 8px 8px;
    overflow: auto;
}

.model-picker-model,
.model-picker-channel {
    width: 100%;
    min-height: 58px;
    padding: 8px 7px;
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    color: #172033;
    background: #fff;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    cursor: pointer;
}

.model-picker-model:hover,
.model-picker-channel:hover,
.model-picker-model.active,
.model-picker-channel.active {
    background: #f0f6ff;
}

.model-picker-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    object-fit: contain;
    border-radius: 7px;
}

.model-picker-model-copy,
.model-picker-channel-copy {
    flex: 1;
}

.model-picker-model-copy strong,
.model-picker-channel-copy strong {
    overflow: hidden;
    color: #263244;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-picker-model-copy small,
.model-picker-channel-copy small {
    overflow: hidden;
    color: #8590a0;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-picker-model-price,
.model-picker-channel > b {
    flex: 0 0 auto;
    padding: 4px 6px;
    color: #c2414b;
    background: #fff1f1;
    border-radius: 12px;
    font-size: 10px;
    white-space: nowrap;
}

.model-picker-channel-title {
    min-height: 57px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid #e8edf3;
}

.model-picker-channel-title strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-picker-channel-title input {
    height: 25px;
    padding: 0 7px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
}

.model-picker-channel-title input[hidden] {
    display: none !important;
}

.model-picker-empty {
    padding: 22px 10px;
    color: #8993a1;
    text-align: center;
    font-size: 11px;
}

.media-settings-popover {
    position: fixed !important;
    z-index: 10040 !important;
    display: none !important;
    width: min(360px, calc(100vw - 24px)) !important;
    padding: 12px !important;
    color: #303640 !important;
    background: #fff !important;
    border: 1px solid #d9e0e8 !important;
    border-radius: 9px !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .17) !important;
}

.media-settings-popover.show {
    display: grid !important;
    gap: 10px;
}

.media-settings-group {
    padding-bottom: 10px;
    border-bottom: 1px solid #e8edf3;
}

.media-settings-group:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.media-settings-group > strong {
    display: block;
    margin-bottom: 7px;
    color: #697586;
    font-size: 11px;
}

.media-settings-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.media-settings-option {
    min-width: 64px;
    min-height: 34px;
    padding: 0 10px;
    color: #505967;
    background: #f5f6f8;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}

.media-settings-option.active {
    
    background: #eaf2ff;
    border-color: #b2ccff;
}

@media (max-width: 980px) {
    .home-container,
    .home-container.channel-panel-unavailable,
    .home-container.left-workspace-collapsed {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 760px) {
    .model-picker-popover {
        width: calc(100vw - 20px) !important;
        height: min(76vh, 620px) !important;
    }

    .model-picker-body {
        grid-template-columns: 66px minmax(0, 1fr);
        grid-template-rows: minmax(150px, 1fr) minmax(130px, .8fr);
    }

    .model-picker-vendors {
        grid-row: 1 / span 2;
    }

    .model-picker-model-column {
        border-right: 0;
        border-bottom: 1px solid #e8edf3;
    }

    .model-picker-channel-column {
        grid-column: 2;
    }
}

@media (max-width: 600px) {
    .bottom-section {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        gap: 8px !important;
    }

    .bottom-section > .selectors-scroll {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .bottom-section > .input-footer {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .selectors-scroll > .selector-btn:not(.composer-asset-btn) {
        flex: 0 0 auto !important;
        min-width: 76px !important;
        max-width: none !important;
    }
}

html body .top-model-info .inspiration-software-banner {
    display: none !important;
}

html body .top-model-info.is-inspiration-mode .icon-wrapper {
    display: flex !important;
}

html body .top-model-info.is-inspiration-mode .detail-text {
    display: block !important;
}

.selectors-scroll > #composerModelBtn.composer-model-btn {
    position: static !important;
    flex: 0 0 130px !important;
    width: 130px !important;
    min-width: 130px !important;
    max-width: 150px !important;
    height: 40px !important;
}

.selectors-scroll > #composerAssetBtn.composer-asset-btn {
    flex: 0 0 112px !important;
    min-width: 112px !important;
    max-width: 120px !important;
}

.selectors-scroll > #composerModelBtn.composer-model-btn {
    justify-content: flex-start !important;
    gap: 8px !important;
    overflow: hidden !important;
}

.composer-model-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    object-fit: contain;
    border-radius: 4px;
}

.composer-model-btn .selector-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-picker-channel-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.model-picker-channel-badges > span {
    display: inline-flex;
    min-height: 18px;
    align-items: center;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.channel-duration-badge {
    color: #175cd3;
    background: #eaf2ff;
}

.channel-success-badge.is-good {
    color: #067647;
    background: #dcfae6;
}

.channel-success-badge.is-warning {
    color: #b54708;
    background: #fef0c7;
}

.channel-success-badge.is-low {
    color: #b42318;
    background: #fee4e2;
}

.selectors-scroll > #mediaSettingsButton.media-settings-trigger {
    flex: 0 0 206px !important;
    width: 206px !important;
    min-width: 206px !important;
    max-width: 220px !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 5px 10px !important;
    text-align: left !important;
}

.media-settings-trigger-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    gap: 2px;
}

.media-settings-trigger-copy strong {
    color: #263244;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.media-settings-trigger-copy small {
    overflow: hidden;
    color: #475569;
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-settings-chevron {
    margin-left: auto;
    font-size: 10px;
}

#imageVideoOptions > .selector-btn[data-key="ratio"],
#imageVideoOptions > .selector-btn[data-key="resolution"],
#imageVideoOptions > .selector-btn[data-key="duration"] {
    display: none !important;
}

.media-settings-option[data-settings-key="ratio"] {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 58px;
    padding: 4px 8px;
    flex-direction: column;
    gap: 4px;
}

.media-settings-option[data-settings-key="ratio"]::before {
    content: "";
    width: 22px;
    height: 22px;
    border: 1px solid currentColor;
    border-radius: 0;
}

.media-settings-option[data-settings-key="ratio"][data-value="9:16"]::before,
.media-settings-option[data-settings-key="ratio"][data-value="2:3"]::before {
    width: 13px;
    height: 24px;
}

.media-settings-option[data-settings-key="ratio"][data-value="3:4"]::before {
    width: 18px;
    height: 24px;
}

.media-settings-option[data-settings-key="ratio"][data-value="4:5"]::before {
    width: 19px;
    height: 24px;
}

.media-settings-option[data-settings-key="ratio"][data-value="16:9"]::before,
.media-settings-option[data-settings-key="ratio"][data-value="21:9"]::before {
    width: 24px;
    height: 13px;
}

.media-settings-option[data-settings-key="ratio"][data-value="4:3"]::before {
    width: 24px;
    height: 18px;
}

.media-settings-option[data-settings-key="ratio"][data-value="3:2"]::before {
    width: 24px;
    height: 16px;
}

.media-settings-option[data-settings-key="ratio"][data-value="5:4"]::before {
    width: 24px;
    height: 19px;
}

.media-settings-option:not([data-settings-key="ratio"]) {
    min-width: 103px;
    min-height: 30px;
}

.selectors-scroll > .ai-composer-action {
    flex: 0 0 auto !important;
    min-width: 142px !important;
    max-width: 190px !important;
    height: 40px !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 0 12px !important;
    color: #263244;
    font-size: 12px !important;
    font-weight: 700;
    white-space: nowrap;
}

.ai-composer-action > i {
    color: #2563eb;
    font-size: 14px;
}

.ai-composer-action[hidden] {
    display: none !important;
}

#aiDirectorButton {
    min-width: 132px !important;
}

#promptReverseButton {
    min-width: 170px !important;
}

#promptPolishButton {
    min-width: 136px !important;
}

.ai-feature-modal {
    position: fixed;
    z-index: 18000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .48);
}

.ai-feature-modal.show {
    display: flex;
}

.ai-feature-panel {
    width: min(880px, 100%);
    max-height: min(90vh, 900px);
    overflow: auto;
    padding: 22px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.ai-feature-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ai-feature-header > div {
    display: grid;
    gap: 6px;
}

.ai-feature-header strong {
    color: #172033;
    font-size: 19px;
    line-height: 1.35;
}

.ai-feature-header small {
    color: #667085;
    font-size: 13px;
    line-height: 1.55;
}

.ai-director-panel {
    width: min(920px, 100%);
}

.ai-director-context {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 18px;
}

.ai-director-context span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid #e4e7ec;
    border-radius: 6px;
    color: #475467;
    background: #f9fafb;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.ai-director-context i {
    color: #4f46e5;
}

.ai-director-directions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ai-director-direction,
.ai-director-type,
.ai-director-tab {
    min-width: 0;
    border: 1px solid #dfe3ea;
    border-radius: 7px;
    color: #344054;
    background: #fff;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ai-director-direction {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
    text-align: left;
    font-size: 12px;
    line-height: 1.35;
}

.ai-director-direction-icon {
    display: inline-grid;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    place-items: center;
    border-radius: 50%;
    color: #475467;
    background: #f2f4f7;
    font-size: 10px;
    font-weight: 700;
}

.ai-director-direction:hover,
.ai-director-type:hover,
.ai-director-tab:hover {
    border-color: #98a2b3;
    background: #f9fafb;
}

.ai-director-direction.active,
.ai-director-type.active,
.ai-director-tab.active {
    border-color: #2563eb;
    
    background: #eff6ff;
}

.ai-director-direction.active .ai-director-direction-icon {
    
    background: #2563eb;
}

.ai-director-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 22px 0 12px;
    padding-bottom: 3px;
}

.ai-director-tab {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 700;
}

.ai-director-types {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ai-director-type {
    min-height: 54px;
    padding: 9px 11px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
}

.ai-feature-result {
    display: grid;
    gap: 9px;
    margin-top: 18px;
}

.ai-feature-result[hidden] {
    display: none;
}

.ai-feature-progress {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #eaecf0;
}

.ai-feature-progress > i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #12b76a);
    transition: width .25s ease;
}

.ai-feature-status {
    min-height: 18px;
    color: #667085;
    font-size: 12px;
}

.ai-feature-panel textarea {
    width: 100%;
    min-height: 130px;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    color: #1d2939;
    background: #fff;
    font: inherit;
    font-size: 13px;
    line-height: 1.6;
}

.ai-feature-panel textarea:focus {
    border-color: #84adff;
    outline: 3px solid rgba(46, 144, 250, .12);
}

.ai-feature-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.ai-feature-primary,
.ai-feature-secondary {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    color: #344054;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.ai-feature-primary {
    border-color: #2563eb;
    color: #fff;
    background: #2563eb;
}

.ai-feature-primary:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
}

.ai-feature-secondary:hover {
    background: #f9fafb;
}

.ai-feature-primary:disabled,
.ai-feature-secondary:disabled {
    cursor: wait;
    opacity: .55;
}

.ai-reverse-panel {
    width: min(680px, 100%);
}

.ai-feature-modal.is-video-reverse .ai-reverse-panel {
    width: min(1080px, 100%);
}

.ai-reverse-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
}

.ai-reverse-history[hidden] {
    display: none !important;
}

.ai-reverse-history {
    min-width: 0;
    padding-right: 12px;
    border-right: 1px solid #eaecf0;
}

.ai-reverse-history-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.ai-reverse-history-heading strong {
    color: #344054;
    font-size: 13px;
}

.ai-reverse-history-heading small {
    color: #98a2b3;
    font-size: 11px;
}

.ai-reverse-history-list {
    display: grid;
    max-height: min(58vh, 540px);
    gap: 6px;
    overflow: auto;
    padding-right: 2px;
}

.ai-reverse-history-item {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border: 1px solid #e4e7ec;
    border-radius: 7px;
    color: #344054;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.ai-reverse-history-item > i {
    flex: 0 0 18px;
    color: #667085;
    text-align: center;
}

.ai-reverse-history-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.ai-reverse-history-copy strong,
.ai-reverse-history-copy small {
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-reverse-history-copy strong {
    font-size: 11px;
}

.ai-reverse-history-copy small {
    color: #98a2b3;
    font-size: 10px;
}

.ai-reverse-history-item:hover,
.ai-reverse-history-item.active {
    border-color: #b2ccff;
    color: #344054;
    background: #eff6ff;
}

.ai-reverse-history-item:hover > i,
.ai-reverse-history-item.active > i {
    color: #667085;
}

.ai-reverse-history-empty {
    padding: 16px 8px;
    color: #98a2b3;
    font-size: 12px;
    text-align: center;
}

.ai-reverse-workspace {
    min-width: 0;
}

.ai-reverse-upload {
    display: grid;
    width: 100%;
    min-height: 90px;
    grid-template-columns: 26px 1fr;
    align-content: center;
    justify-content: start;
    gap: 4px 10px;
    padding: 14px;
    border: 1px dashed #98a2b3;
    border-radius: 8px;
    color: #344054;
    background: #fcfcfd;
    text-align: left;
    cursor: pointer;
}

.ai-reverse-upload:hover,
.ai-reverse-upload.is-drag-over {
    border-color: #111;
    background: #f2f2f2;
}

.ai-reverse-upload.is-drag-over {
    border-style: solid;
    box-shadow: inset 0 0 0 1px #111;
}

.ai-reverse-upload > i {
    grid-row: span 2;
    align-self: center;
    color: #2563eb;
    font-size: 19px;
}

.ai-reverse-upload > span {
    font-size: 13px;
    font-weight: 700;
}

.ai-reverse-upload > small {
    overflow: hidden;
    color: #667085;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-reverse-preview {
    display: grid;
    min-height: 0;
    max-height: 280px;
    place-items: center;
    margin: 12px 0;
    overflow: hidden;
    border-radius: 8px;
    background: #f2f4f7;
}

.ai-reverse-preview:empty {
    display: none;
}

.ai-reverse-preview img,
.ai-reverse-preview video {
    display: block;
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
}

.ai-polish-panel {
    width: min(980px, 100%);
}

.ai-polish-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ai-polish-columns label {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.ai-polish-columns label > span {
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

.ai-polish-columns textarea {
    min-height: 230px;
}

.ai-polish-panel > .ai-feature-progress {
    margin-top: 14px;
}

@media (max-width: 680px) {
    .selectors-scroll > .ai-composer-action {
        min-width: 134px !important;
    }

    .ai-feature-modal {
        align-items: flex-end;
        padding: 0;
    }

    .ai-feature-panel {
        width: 100%;
        max-height: 92vh;
        padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
        border-radius: 12px 12px 0 0;
    }

    .ai-feature-header strong {
        font-size: 17px;
    }

    .ai-director-directions,
    .ai-director-types {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-director-direction {
        min-height: 46px;
        font-size: 11px;
    }

    .ai-polish-columns {
        grid-template-columns: 1fr;
    }

    .ai-polish-columns textarea {
        min-height: 130px;
    }

    .ai-reverse-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .ai-reverse-history {
        padding: 0 0 10px;
        border-right: 0;
        border-bottom: 1px solid #eaecf0;
    }

    .ai-reverse-history-list {
        max-height: 132px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-feature-footer > button {
        flex: 1 1 auto;
    }
}

.sora2-main-content.batch-generate-active {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.sora2-main-content.batch-generate-active > .top-model-info {
    display: none !important;
}

.sora2-main-content.batch-generate-active > .scroll-container {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.sora2-main-content.batch-generate-active .batch-generate-content {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.sora2-main-content.batch-generate-active .batch-generate-workbench {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
}

.sora2-main-content.batch-generate-active .batch-generate-workbench .workflow-frame {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
}

/* Global monochrome theme: keep generated media in its original colors. */
:root {
    --brand: #111111 !important;
    --primary: #111111 !important;
    --success: #333333 !important;
    --danger: #111111 !important;
    --bg: #f5f5f5 !important;
    --surface: #ffffff !important;
    --ink: #171717 !important;
    --ink-2: #404040 !important;
    --muted: #737373 !important;
    --line: rgba(0, 0, 0, .14) !important;
    --line-2: rgba(0, 0, 0, .09) !important;
}

body {
    background-color: #f5f5f5;
    color: #171717;
}

.sidebar,
.sidebar-header,
.top-model-info,
.channel-workbench-panel,
.scroll-content,
.workflow-workbench,
.modal-container,
.layui-layer,
.layui-layer-title,
.layui-layer-content,
.layui-layer-btn,
.result-card,
.media-card,
.task-progress-card,
.model-picker,
.model-picker-panel,
.asset-library,
.workbench-view-switch {
    border-color: rgba(0, 0, 0, .13) !important;
    color: #171717;
}

.sidebar,
.sidebar-header,
.top-model-info,
.channel-workbench-panel,
.scroll-content,
.workflow-workbench,
.modal-container,
.layui-layer,
.layui-layer-title,
.layui-layer-content,
.layui-layer-btn,
.result-card,
.media-card,
.task-progress-card,
.model-picker,
.model-picker-panel,
.asset-library,
.workbench-view-switch,
.model-item,
.channel-item,
.secondary-item,
.primary-item {
    background-color: #fff;
    background-image: none;
    box-shadow: none;
}

.model-item:hover,
.channel-item:hover,
.secondary-item:hover,
.primary-item:hover,
.workbench-view-switch button:hover,
.model-picker button:hover {
    background-color: #f2f2f2;
    box-shadow: none;
}

.model-item-active,
.secondary-item-active,
.primary-item-active,
.channel-item-active,
.workbench-view-switch .active,
.model-picker .active {
    background-color: #ededed !important;
    
    box-shadow: inset 3px 0 #111 !important;
}

button,
input,
select,
textarea,
.layui-btn,
.submit-button,
.send-button,
.modal-btn-primary,
.mini-pill,
.badge,
.model-tag,
.model-css-icon,
.feature-icon,
.channel-icon {
    border-color: rgba(0, 0, 0, .18) !important;
    color: #222;
    box-shadow: none;
}

button,
.layui-btn {
    background: #fff !important;
    color: #222 !important;
}

.submit-button,
.send-button,
.modal-btn-primary,
.recharge-button,
.layui-btn-normal,
.layui-btn-danger,
.layui-btn-warm,
.primary-action,
.btn-primary {
    background: #171717 !important;
    color: #fff !important;
}

button:hover:not(:disabled),
.layui-btn:hover,
.submit-button:hover,
.send-button:hover,
.modal-btn-primary:hover,
.recharge-button:hover,
.layui-btn-normal:hover,
.layui-btn-danger:hover,
.layui-btn-warm:hover,
.primary-action:hover,
.btn-primary:hover {
    background: #383838 !important;
    box-shadow: none !important;
}

button:disabled,
.layui-btn-disabled {
    background: #d4d4d4 !important;
    color: #777 !important;
}

input,
select,
textarea,
.rich-input,
.form-input {
    background: #fff !important;
    color: #171717 !important;
    border-color: #c7c7c7 !important;
}

input:focus,
select:focus,
textarea:focus,
.rich-input:focus,
.form-input:focus {
    border-color: #333 !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .08) !important;
}

.model-css-icon-blue,
.model-css-icon-purple,
.model-css-icon-green,
.model-css-icon-amber,
.model-icon,
.feature-icon,
.channel-icon,
.mini-pill,
.badge,
.model-tag,
.progress-fill,
progress,
.layui-progress-bar {
    background: #e8e8e8 !important;
    color: #222 !important;
    border-color: #d0d0d0 !important;
}

.model-icon i,
.feature-icon i,
.channel-icon i,
.model-css-icon i {
    color: #222 !important;
}

i[class*="fa-"],
.layui-icon {
    color: #333;
    filter: grayscale(1);
}

button.submit-button i,
button.send-button i,
button.modal-btn-primary i,
button.recharge-button i,
.layui-btn-normal i,
.layui-btn-danger i,
.layui-btn-warm i,
.primary-action i,
.btn-primary i {
    color: #fff !important;
}

.ok,
.success,
.status-success,
.status-failed,
.status-error,
.layui-bg-green,
.layui-bg-red,
.layui-bg-blue,
.layui-bg-orange {
    background-color: #e8e8e8 !important;
    border-color: #d0d0d0 !important;
    color: #222 !important;
}

.link-text,
a:not(.media-card):not(.batch-link),
.result-text a {
    color: #333 !important;
}

.link-text:hover,
a:not(.media-card):not(.batch-link):hover,
.result-text a:hover {
    
}

.progress-fill,
.layui-progress-bar {
    background: #333 !important;
}

.modal-backdrop,
.layui-layer-shade {
    background-color: rgba(0, 0, 0, .52) !important;
}

.result-card:hover,
.media-card:hover,
.task-progress-card:hover {
    border-color: #999 !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .08) !important;
}

.sidebar .model-list .batch-generate-entry.model-item-active {
    background: #ededed !important;
    
}

/* Flat monochrome mode switch and active feature state. */
.sidebar .selector-container {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.sidebar .primary-selector {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid #bdbdbd !important;
    border-radius: 0 !important;
    background: #fff !important;
}

.sidebar .primary-selector .primary-item,
.sidebar .primary-selector .primary-item:hover {
    display: flex !important;
    min-width: 0 !important;
    height: 58px !important;
    padding: 5px 2px !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 3px !important;
    border: 0 !important;
    border-right: 1px solid #d3d3d3 !important;
    border-radius: 0 !important;
    background: #fff !important;
    
    box-shadow: none !important;
    filter: none !important;
}

.sidebar .primary-selector .primary-item:last-child {
    border-right: 0 !important;
}

.sidebar .primary-selector .primary-item.primary-item-active,
.sidebar .primary-selector .primary-item.primary-item-active:hover {
    background: #e9e9e9 !important;
    
    box-shadow: inset 0 -3px #111 !important;
}

.sidebar .primary-icon {
    display: grid !important;
    place-items: center !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

.sidebar .primary-icon i {
    color: #222 !important;
    font-size: 20px !important;
    filter: grayscale(1) !important;
}

.sidebar .primary-label {
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.sidebar .model-list .sidebar-feature-item.model-item-active,
.sidebar .model-list .sidebar-feature-item.model-item-active:hover,
.sidebar .model-list .batch-generate-entry.model-item-active {
    border: 1px solid #555 !important;
    background: #eaf3ff !important;
    
    box-shadow: none !important;
}

.sidebar .model-list .sidebar-feature-item:hover {
    border-color: #999 !important;
    background: #f7f7f7 !important;
}

.sidebar .model-list .sidebar-feature-item.model-item-active::before,
.sidebar .model-list .sidebar-feature-item.model-item-active::after {
    display: none !important;
    content: none !important;
}

.sidebar .model-list .model-icon,
.sidebar .model-list .model-css-icon,
.sidebar .model-list .model-icon i,
.sidebar .model-list .model-css-icon i {
    background: #e8e8e8 !important;
    color: #222 !important;
    border-color: #d0d0d0 !important;
    filter: grayscale(1) !important;
}

.channel-sample-empty {
    background: #f1f1f1 !important;
    color: #555 !important;
}

.channel-sample-empty i {
    color: #333 !important;
    filter: grayscale(1) !important;
}

.channel-sample-empty strong {
    color: #171717 !important;
}

/* Monochrome loading indicators and text. */
.workflow-loading,
.model-loading,
.template-sample-loading,
.history-loading-panel,
.asset-video-thumb-loading,
.at-image-loading,
.asset-loading-card,
.template-load-sentinel.is-loading {
    color: #111 !important;
}

.workflow-loading *,
.model-loading *,
.template-sample-loading *,
.history-loading-panel *,
.asset-video-thumb-loading *,
.at-image-loading *,
.asset-loading-card *,
.template-load-sentinel.is-loading * {
    color: #111 !important;
}

.workflow-loading i,
.template-sample-loading i,
.history-loading-spinner,
.asset-video-thumb-loading i {
    color: #333 !important;
    filter: grayscale(1) !important;
}

.sidebar .model-list .sidebar-feature-item.model-item-active .model-indicator {
    display: none !important;
}

@keyframes toastCenterIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastCenterOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* Site-wide square-corner system, including older widgets and overlays. */
html body *:not(#square-corner-override),
html body *:not(#square-corner-override)::before,
html body *:not(#square-corner-override)::after {
    border-radius: 0 !important;
}

/* Interactive state changes should not recolor text or nested icons. */
html body button:hover:not(:disabled),
html body [role="button"]:hover,
html body .model-item:hover,
html body .channel-item:hover,
html body .secondary-item:hover,
html body .primary-item:hover,
html body .selector-btn:hover,
html body .composer-asset-btn:hover,
html body .prompt-tool-btn:hover,
html body .asset-tab-btn:hover,
html body .asset-row-actions button:hover,
html body .model-picker-vendor:hover,
html body .model-picker-model:hover,
html body .model-picker-channel:hover,
html body .channel-workbench-card:hover,
html body .workbench-view-btn:hover,
html body .history-view-btn:hover,
html body .channel-panel-close:hover,
html body .channel-panel-open:hover,
html body .asset-modal-close:hover,
html body .upload-trigger:hover,
html body .ref-url-btn:hover,
html body .result-card:hover,
html body .asset-thumb:hover,
html body .asset-row:hover {
    background: #eaf3ff !important;
    background-color: #eaf3ff !important;
    background-image: none !important;
    border-color: #bfdbfe !important;
    box-shadow: none !important;
}

.model-picker-sort {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 9px 8px;
    border-bottom: 1px solid #e5e5e5;
}

.model-picker-sort[hidden] {
    display: none !important;
}

.model-picker-sort-btn {
    display: inline-flex;
    min-width: 0;
    min-height: 29px;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 6px;
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #333 !important;
    font-size: 10px;
    white-space: nowrap;
}

.model-picker-sort-btn.active {
    border-color: #555 !important;
    background: #eee !important;
    
}

.model-picker-loading {
    display: grid;
    min-height: 140px;
    place-content: center;
    justify-items: center;
    gap: 10px;
    color: #111;
    font-size: 12px;
}

.model-picker-loading i {
    color: #111 !important;
    font-size: 20px;
}

.channel-popularity-badge {
    color: #4a4a4a;
    background: #ededed;
}

html body .model-picker-channel:hover .channel-duration-badge,
html body .model-picker-channel:hover .channel-success-badge,
html body .model-picker-channel:hover .channel-popularity-badge {
    border-color: inherit !important;
}

/* Keep reference upload hover high-contrast even when the label receives hover. */
html body .cankaotu:hover .upload-trigger,
html body .cankaotu .upload-trigger:hover {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
}

html body .model-picker-channel:hover > b {
    border-color: inherit !important;
}

html body .selectors-scroll > #composerModelBtn.composer-model-btn {
    flex: 0 0 278px !important;
    width: 278px !important;
    min-width: 260px !important;
    max-width: 310px !important;
    height: 50px !important;
    justify-content: flex-start !important;
    gap: 10px !important;
}

html body #composerModelBtn .composer-model-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 3px;
    text-align: left;
}

html body #composerModelBtn .composer-model-copy strong,
html body #composerModelBtn .composer-model-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body #composerModelBtn .composer-model-copy strong {
    color: #171717;
    font-size: 12px;
    font-weight: 700;
}

html body #composerModelBtn .composer-model-copy small {
    color: #666;
    font-size: 10px;
}

html body .selectors-scroll > .ai-composer-action {
    min-width: 0 !important;
    max-width: 170px !important;
    gap: 5px !important;
    padding-right: 7px !important;
    padding-left: 7px !important;
    font-size: 11px !important;
}

html body #aiDirectorButton {
    min-width: 112px !important;
}

html body #promptReverseButton {
    min-width: 138px !important;
}

html body #promptPolishButton {
    min-width: 116px !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover,
html body .sidebar .model-list .sidebar-feature-item.model-item-active,
html body .sidebar .model-list .sidebar-feature-item.model-item-active:hover {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
    background-image: none !important;
    box-shadow: none !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover .model-name,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-name,
html body .sidebar .model-list .sidebar-feature-item:hover .model-description,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-description {
    border-color: transparent !important;
    background-color: transparent !important;
}

html body .model-item-active,
html body .secondary-item-active,
html body .primary-item-active,
html body .channel-item-active,
html body .workbench-view-switch .active,
html body .model-picker .active {
    background-color: #eaf3ff !important;
    background-image: none !important;
    border-color: #bfdbfe !important;
    box-shadow: none !important;
}

html body .sidebar .primary-selector .primary-item:hover,
html body .sidebar .primary-selector .primary-item.primary-item-active,
html body .sidebar .primary-selector .primary-item.primary-item-active:hover {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
    background-image: none !important;
    box-shadow: none !important;
}

.sidebar .model-list .sidebar-feature-item.feature-fly-in {
    animation: sidebar-feature-fly-in 260ms cubic-bezier(.2, .75, .25, 1) both;
    animation-delay: calc(var(--feature-fly-index, 0) * 45ms);
}

@keyframes sidebar-feature-fly-in {
    from {
        opacity: 0;
        transform: translateX(36px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar .model-list .sidebar-feature-item.feature-fly-in {
        animation: none;
    }
}

html body .top-model-info .icon-wrapper,
html body .top-model-info .icon-wrapper .icon-img {
    box-shadow: none !important;
    filter: none !important;
}

html body .top-model-info .top-feature-icon {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    box-shadow: none !important;
}

html body .top-model-info .top-feature-icon i {
    color: #111 !important;
    font-size: 17px !important;
}

html body .selectors-scroll > #composerModelBtn.composer-model-btn {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

html body #composerModelBtn .composer-model-copy {
    gap: 1px !important;
}

html body .model-picker-model.active,
html body .model-picker-channel.active,
html body .model-picker-model.active:hover,
html body .model-picker-channel.active:hover {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
    background-color: #eaf3ff !important;
    background-image: none !important;
    box-shadow: none !important;
}

html body .model-picker-model.active *,
html body .model-picker-channel.active * {
    border-color: inherit !important;
}

.model-picker-load-error {
    display: grid;
    min-height: 130px;
    align-content: center;
    justify-items: center;
    gap: 10px;
    padding: 16px;
    color: #444;
    text-align: center;
    font-size: 12px;
}

.model-picker-load-error button {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #222;
    background: #fff;
    color: #111;
    cursor: pointer;
}

.model-picker-load-error button:hover {
    background: #000;
    
}

html body .model-picker-popover {
    width: min(960px, calc(100vw - 24px)) !important;
}

html body .model-picker-body {
    grid-template-columns: 72px minmax(210px, .72fr) minmax(370px, 1.28fr) !important;
}

html body .model-picker-channel-copy strong {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    html body .model-picker-body {
        grid-template-columns: 60px minmax(0, 1fr) !important;
        grid-template-rows: minmax(140px, .8fr) minmax(160px, 1fr) !important;
    }
}

html body .feature-workflow-content {
    display: flex !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100%;
    min-height: 0;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

html body .sora2-main-content.feature-workflow-active {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
}

html body .sora2-main-content.feature-workflow-active > .scroll-container {
    display: flex !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
}

html body .feature-page-workbench {
    display: flex !important;
    flex: 1 1 auto !important;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    background: #fff;
}

html body .feature-page-workbench .workflow-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}

html body .feature-page-workbench .workflow-loading {
    color: #111;
    background: #fff;
}

/* Keep recent-history loading and task cards within the workbench column. */
html body .sora2-main-content:not(.feature-workflow-active):not(.batch-generate-active) > .scroll-container {
    display: flex !important;
    flex: 1 1 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    overflow: auto !important;
}

html body #scrollContent.media-grid-container {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-content: start !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

html body #scrollContent .history-loading-panel {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: min(42vh, 360px) !important;
    box-sizing: border-box !important;
}

html body #scrollContent .history-task-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 172px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

html body #scrollContent .history-task-card .task-card-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 112px 150px !important;
    grid-template-areas:
        "id result actions"
        "prompt result actions"
        "time result actions"
        "tags result actions"
        "status result actions"
        "failure result actions"
        "refs refs refs" !important;
    align-items: center !important;
    gap: 2px 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 170px !important;
    align-content: start !important;
    box-sizing: border-box !important;
}

html body #scrollContent .history-task-card .task-card-body > .task-id {
    grid-area: id !important;
}

html body #scrollContent .history-task-card .task-card-body > .task-prompt {
    grid-area: prompt !important;
    width: auto !important;
    height: auto !important;
}

html body #scrollContent .history-task-card .task-card-body > .task-update-time {
    grid-area: time !important;
}

html body #scrollContent .history-task-card .task-card-body > .task-tags {
    grid-area: tags !important;
}

html body #scrollContent .history-task-card .task-card-body > .task-status-line {
    grid-area: status !important;
}

html body #scrollContent .history-task-card .task-card-body > .history-failure-reason {
    grid-area: failure !important;
}

html body #scrollContent .history-task-card .task-card-body > .history-result-panel {
    grid-area: result !important;
    align-self: center !important;
    height: auto !important;
    min-height: 76px !important;
}

html body #scrollContent .history-task-card .task-card-body > .task-actions {
    grid-area: actions !important;
    align-self: center !important;
}

html body #scrollContent .history-task-card .task-card-body > .task-ref-section {
    grid-area: refs !important;
    grid-column: 1 / -1 !important;
    grid-row: 7 !important;
    display: flex !important;
    align-self: start !important;
    min-height: 48px !important;
    margin-top: 0 !important;
    padding: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

html body #scrollContent .history-task-card .task-id,
html body #scrollContent .history-task-card .task-prompt,
html body #scrollContent .history-task-card .task-update-time,
html body #scrollContent .history-task-card .task-tags,
html body #scrollContent .history-task-card .task-status-line,
html body #scrollContent .history-task-card .history-failure-reason,
html body #scrollContent .history-task-card .task-ref-section,
html body #scrollContent .history-task-card .history-result-panel,
html body #scrollContent .history-task-card .task-actions {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

html body #scrollContent .history-task-card .task-prompt-text {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

html body #scrollContent .history-task-card .task-tags {
    flex-wrap: wrap !important;
}

html body #scrollContent .history-task-card .history-ref-section .task-ref-list {
    flex-wrap: wrap !important;
    overflow: visible !important;
    align-items: flex-start !important;
}

html body #scrollContent .history-task-card .history-ref-section .task-ref-thumb {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
    overflow: hidden !important;
}

html body #scrollContent .history-task-card .history-ref-section .task-ref-thumb-audio .task-ref-file-icon,
html body #scrollContent .history-task-card .history-ref-section .task-ref-thumb-video .task-ref-file-icon,
html body #scrollContent .history-task-card .history-ref-section .task-ref-thumb-document .task-ref-file-icon {
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 13px !important;
    line-height: 1 !important;
}

html body #scrollContent .history-task-card .history-ref-section .task-ref-file-label {
    display: block !important;
    max-width: 36px !important;
    font-size: 9px !important;
    line-height: 1 !important;
}

html body #scrollContent .history-task-card .history-ref-section .task-ref-thumb-audio .task-ref-file-label,
html body #scrollContent .history-task-card .history-ref-section .task-ref-thumb-video .task-ref-file-label,
html body #scrollContent .history-task-card .history-ref-section .task-ref-thumb-document .task-ref-file-label {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
}

html body #scrollContent .history-task-card .history-result-panel {
    width: 112px !important;
}

html body #scrollContent .history-task-card .history-result-thumb {
    display: flex !important;
    width: 100% !important;
    height: 76px !important;
    min-height: 76px !important;
    max-height: 76px !important;
    aspect-ratio: auto !important;
}

html body #scrollContent .history-task-card .task-actions {
    display: flex !important;
    flex-direction: column !important;
    align-self: center !important;
    gap: 5px !important;
}

html body #scrollContent .history-task-card .task-actions .media-btn {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

@media (max-width: 900px) {
    html body #scrollContent .history-task-card .task-card-body {
        grid-template-columns: minmax(0, 1fr) 88px !important;
        grid-template-areas:
            "id result"
            "prompt result"
            "time result"
            "tags result"
            "status result"
            "failure result"
            "actions actions"
            "refs refs" !important;
    }

    html body #scrollContent .history-task-card .task-card-body > .task-ref-section {
        grid-row: 8 !important;
    }

    html body #scrollContent .history-task-card .history-result-panel {
        width: 88px !important;
    }

    html body #scrollContent .history-task-card .history-result-thumb {
        height: 68px !important;
        min-height: 68px !important;
        max-height: 68px !important;
    }

    html body #scrollContent .history-task-card .task-actions {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    html body #scrollContent .history-task-card .task-actions .media-btn {
        width: auto !important;
        flex: 1 1 110px !important;
    }
}

/* AI director modal grouping and action order */
html body .ai-director-group {
    display: grid;
    gap: 9px;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid #d8d8d8;
    background: #fff;
}

html body .ai-director-group > h3 {
    margin: 0;
    color: #111;
    font-size: 13px;
    font-weight: 700;
}

html body .ai-director-context {
    margin: 0;
}

html body .ai-director-directions,
html body .ai-director-types {
    gap: 7px;
}

html body .ai-director-tabs {
    gap: 0;
    margin: 0 0 2px;
    padding: 0;
    border-bottom: 1px solid #ccc;
}

html body .ai-director-tab {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-bottom: 0;
    background: #fff;
    color: #333;
}

html body .ai-director-tab:hover {
    background: #f2f2f2;
    
}

html body .ai-director-tab.active {
    border-color: #bfdbfe;
    background: #eaf3ff;
}

html body .ai-director-direction,
html body .ai-director-type {
    border-color: #ccc;
    border-radius: 0;
    color: #222;
    background: #fff;
}

html body .ai-director-direction:hover,
html body .ai-director-type:hover {
    border-color: #bfdbfe;
    background: #eaf3ff;
}

html body .ai-director-direction.active,
html body .ai-director-type.active {
    border-color: #bfdbfe;
    background: #eaf3ff;
}

html body .ai-director-actions {
    justify-content: flex-start;
    margin-top: 12px;
}

html body .ai-director-actions > button {
    min-width: 150px;
    border-radius: 0;
}

html body .ai-director-actions > #aiDirectorClear {
    border-color: #111;
    background: #fff;
    color: #111;
}

html body .ai-director-actions > #aiDirectorClear:hover:not(:disabled) {
    background: #eaf3ff;
}

html body .ai-director-actions > button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

@media (max-width: 680px) {
    html body .ai-director-actions {
        justify-content: stretch;
    }

    html body .ai-director-actions > button {
        min-width: 0;
        flex: 1 1 100%;
    }
}

html body .cankaotu.reference-material-missing .upload-trigger {
    border: 2px solid #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .22), 0 0 16px rgba(220, 38, 38, .45) !important;
    animation: reference-missing-pulse 1.2s ease-in-out infinite;
}

@keyframes reference-missing-pulse {
    50% {
        box-shadow: 0 0 0 5px rgba(220, 38, 38, .16), 0 0 20px rgba(220, 38, 38, .55);
    }
}

html body #aiDirectorModal .ai-director-direction.active,
html body #aiDirectorModal .ai-director-direction.active:hover,
html body #aiDirectorModal .ai-director-type.active,
html body #aiDirectorModal .ai-director-type.active:hover,
html body #aiDirectorModal .ai-director-tab.active,
html body #aiDirectorModal .ai-director-tab.active:hover {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
}

/* Compact, grouped feature navigation; existing workbench controls stay in place. */
html body .sidebar .model-list .sidebar-feature-group {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

html body .sidebar .model-list .sidebar-feature-group-title {
    margin: 15px 9px 5px;
    padding: 0;
    color: #666;
    font-size: 11px;
    font-weight: 500;
    line-height: 18px;
}

html body .sidebar .model-list .sidebar-feature-group:first-child .sidebar-feature-group-title {
    margin-top: 2px;
}

html body .home-container.sidebar-collapsed .sidebar .model-list .sidebar-feature-group-title {
    display: none !important;
}

html body .sidebar .model-list .sidebar-feature-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 9px !important;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 0 2px !important;
    padding: 5px 8px !important;
    border: 1px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #111 !important;
    box-shadow: none !important;
}

html body .sidebar .model-list .sidebar-feature-item::before,
html body .sidebar .model-list .sidebar-feature-item::after {
    display: none !important;
}

html body .sidebar .model-list .sidebar-feature-item .model-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 28px !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #ddd !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
    filter: none !important;
}

html body .sidebar .model-list .sidebar-feature-item .model-icon i {
    padding: 0 !important;
    background: transparent !important;
    color: inherit !important;
    font-size: 16px !important;
    text-shadow: none !important;
    box-shadow: none !important;
    filter: none !important;
}

html body .sidebar .model-list .sidebar-feature-item .model-name-row {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .sidebar .model-list .sidebar-feature-item .model-name {
    display: block !important;
    margin: 0 !important;
    color: #111 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 18px !important;
}

html body .sidebar .model-list .sidebar-feature-item .model-description {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden !important;
    margin-top: 1px !important;
    border: 0 !important;
    background: transparent !important;
    color: #666 !important;
    font-size: 11px !important;
    line-height: 14px !important;
    white-space: normal !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover,
html body .sidebar .model-list .sidebar-feature-item.model-item-active,
html body .sidebar .model-list .sidebar-feature-item:focus-visible {
    border-color: #000 !important;
    background: #000 !important;
    
}

html body .sidebar .model-list .sidebar-feature-item:hover .model-name,
html body .sidebar .model-list .sidebar-feature-item:hover .model-description,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-name,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-description,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-name,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-description {
    
}

html body .sidebar .model-list .sidebar-feature-item .model-icon > .sidebar-feature-icon-image {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

html body .sidebar .model-list .sidebar-feature-item .model-icon > svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    color: inherit !important;
    stroke: currentColor !important;
}

html body .top-feature-icon > svg {
    width: 20px;
    height: 20px;
}

html body .scroll-content.feature-sample-content {
    display: flex;
    min-height: 100%;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #fff;
}

html body .feature-sample-stage {
    display: flex;
    width: 100%;
    min-height: 100%;
    align-items: center;
    justify-content: center;
}

html body .feature-sample-figure {
    display: flex;
    width: min(100%, 1180px);
    max-height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto;
}

html body .feature-sample-figure img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 250px);
    object-fit: contain;
    border: 1px solid #e5e5e5;
    border-radius: 0;
    background: #f6f6f6;
}

html body .feature-sample-figure figcaption {
    display: flex;
    max-width: 100%;
    flex-direction: column;
    gap: 3px;
    text-align: center;
}

html body .feature-sample-figure figcaption strong {
    color: #111;
    font-size: 14px;
    font-weight: 600;
}

html body .feature-sample-figure figcaption span {
    color: #666;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 720px) {
    html body .scroll-content.feature-sample-content {
        padding: 12px;
    }

    html body .feature-sample-figure img {
        max-height: calc(100vh - 220px);
    }
}

/* Keep the sidebar scrollbar quiet until the pointer enters the list. */
html body .sidebar .model-list {
    scrollbar-color: transparent transparent !important;
    scrollbar-gutter: stable;
}

html body .sidebar .model-list:hover,
html body .sidebar .model-list:focus-within {
    scrollbar-color: #c8c8c8 transparent !important;
}

html body .sidebar .model-list::-webkit-scrollbar-thumb {
    background: transparent !important;
}

html body .sidebar .model-list:hover::-webkit-scrollbar-thumb,
html body .sidebar .model-list:focus-within::-webkit-scrollbar-thumb {
    background: #c8c8c8 !important;
}

html body .sidebar .model-list .sidebar-feature-item .model-icon,
html body .sidebar .model-list .sidebar-feature-item:hover .model-icon,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-icon,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-icon {
    border-color: #d4d4d4 !important;
    background: #fff !important;
    
    box-shadow: none !important;
}

html body .sidebar .model-list .sidebar-feature-item .model-icon i,
html body .sidebar .model-list .sidebar-feature-item:hover .model-icon i,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-icon i,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-icon i {
    
    background: transparent !important;
    filter: none !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover .model-icon > svg,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-icon > svg,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-icon > svg,
html body .sidebar .model-list .sidebar-feature-item:hover .model-icon > svg *,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-icon > svg *,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-icon > svg * {
    
    stroke: #111 !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover .model-icon > .sidebar-feature-icon-image,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-icon > .sidebar-feature-icon-image,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-icon > .sidebar-feature-icon-image {
    opacity: 1 !important;
    filter: none !important;
}

html body .sidebar-logo .logo-img,
html body .top-model-info .icon-wrapper,
html body .top-model-info .icon-wrapper .icon-img,
html body .top-model-info .top-feature-icon {
    border-color: #d4d4d4 !important;
    box-shadow: none !important;
}

html body .sidebar-logo .logo-img,
html body .top-model-info .icon-wrapper .icon-img {
    border-width: 1px !important;
}

html body .top-model-info .icon-wrapper,
html body .top-model-info .top-feature-icon {
    background: #fff !important;
}

html body .sidebar .model-list .batch-generate-entry {
    margin-top: 0 !important;
    border-top-color: transparent !important;
}

html body .sidebar .model-list .sidebar-free-video-row {
    display: flex;
    min-width: 0;
    align-items: stretch;
    gap: 5px;
}

html body .sidebar .model-list .sidebar-free-video-row > .sidebar-feature-item {
    min-width: 0;
    flex: 1 1 auto;
}

html body .sidebar .model-list .sidebar-director-shortcut {
    display: inline-flex;
    min-width: 66px;
    min-height: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 0 8px;
    border: 1px solid #111;
    background: #fff;
    color: #111;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

html body .sidebar .model-list .sidebar-director-shortcut:hover,
html body .sidebar .model-list .sidebar-director-shortcut:focus-visible {
    border-color: #bfdbfe;
    background: #eaf3ff;
}

html body .cankaotu:hover .upload-trigger:not(:hover) {
    border-color: #d2d2d2 !important;
    background: #fff !important;
}

html body .top-section:has(.upload-trigger[data-ref-role="edit-person-reference"]) {
    --ref-trigger-w: 116px;
    --ref-trigger-h: 122px;
}

html body .cankaotu .upload-trigger:hover {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
}

html body .cankaotu .upload-trigger[data-ref-role="edit-person-reference"] .upload-limit-text {
    display: grid;
    max-width: 98px;
    gap: 2px;
    margin-top: 3px;
    text-align: center;
}

html body .cankaotu .upload-trigger[data-ref-role="edit-person-reference"] .upload-limit-count {
    color: #333 !important;
    font-size: 10px;
    font-weight: 700;
}

html body .cankaotu .upload-trigger[data-ref-role="edit-person-reference"] .upload-use-cases {
    color: #666 !important;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.25;
}

html body .cankaotu .upload-trigger:hover .ref-url-btn,
html body .cankaotu .upload-trigger:hover .ref-url-btn:hover {
    border: 1px solid #777 !important;
    background: #fff !important;
}

@media (max-width: 420px) {
    html body .sidebar .model-list .sidebar-director-shortcut {
        min-width: 60px;
        padding: 0 6px;
        font-size: 10px;
    }
}

html body .sidebar .model-list .sidebar-director-entry {
    margin-top: 3px !important;
    border-color: transparent !important;
    background: #fff !important;
}

html body .sidebar .model-list .sidebar-director-entry .model-icon {
    background: #111 !important;
    color: #fff !important;
}

html body .sidebar .model-list .sidebar-director-entry .model-icon i {
    color: #fff !important;
}

html body .sidebar .model-list .sidebar-director-entry:hover,
html body .sidebar .model-list .sidebar-director-entry:focus-visible {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
}

html body .sidebar .model-list .sidebar-director-entry:hover .model-icon,
html body .sidebar .model-list .sidebar-director-entry:focus-visible .model-icon {
    border-color: inherit !important;
}

html body #aiDirectorModal .ai-director-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

html body #aiDirectorModal .ai-director-type {
    display: grid;
    min-height: 68px;
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid #d4d4d4;
    background: #fff;
    color: #171717;
    text-align: left;
}

html body #aiDirectorModal .ai-director-type:hover {
    border-color: #777;
    background: #f7f7f7;
}

html body #aiDirectorModal .ai-director-type.active,
html body #aiDirectorModal .ai-director-type.active:hover {
    border-color: #bfdbfe;
    background: #eaf3ff;
}

html body #aiDirectorModal .ai-director-type-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #dedede;
    background: #f3f3f3;
    color: #111;
    font-size: 15px;
}

html body #aiDirectorModal .ai-director-type.active .ai-director-type-icon {
    border-color: #fff;
    background: #fff;
    
}

html body #aiDirectorModal .ai-director-type-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

html body #aiDirectorModal .ai-director-type-copy strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body #aiDirectorModal .ai-director-type-copy small {
    display: -webkit-box;
    overflow: hidden;
    color: #666;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

html body #aiDirectorModal .ai-director-type-check {
    color: transparent;
    font-size: 12px;
}

html body #aiDirectorModal .ai-director-type.active .ai-director-type-check {
    
}

@media (max-width: 600px) {
    html body #aiDirectorModal .ai-director-types {
        grid-template-columns: minmax(0, 1fr);
    }
}

html body .sidebar .model-list .sidebar-free-video-row {
    position: relative !important;
    display: block !important;
    min-width: 0 !important;
    margin: 0 0 8px !important;
}

html body .sidebar .model-list .sidebar-free-video-row > .sidebar-feature-item {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 68px !important;
    margin: 0 !important;
    padding-right: 92px !important;
}

html body .sidebar .model-list .sidebar-free-video-row > .sidebar-director-shortcut {
    position: absolute !important;
    z-index: 2;
    top: 50%;
    right: 9px;
    display: inline-flex !important;
    min-width: 68px !important;
    min-height: 32px !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 5px !important;
    transform: translateY(-50%);
    box-sizing: border-box;
    border: 1px solid #d71920 !important;
    background: #fff !important;
    color: #d71920 !important;
    font-size: 11px !important;
    font-weight: 700;
    white-space: nowrap;
}

html body .sidebar .model-list .sidebar-free-video-row:has(> .sidebar-feature-item.model-item-active) > .sidebar-director-shortcut {
    background: #fff !important;
    
}

html body .sidebar .model-list .sidebar-free-video-row > .sidebar-director-shortcut:hover,
html body .sidebar .model-list .sidebar-free-video-row > .sidebar-director-shortcut:focus-visible {
    transform: translateY(-50%);
    border-color: #fff !important;
    background: #fff !important;
    
    outline: 1px solid #d71920;
}

/* Keep hover feedback on the individual feature row, never the whole sidebar list. */
html body .sidebar .model-list,
html body .sidebar .model-list:hover,
html body .sidebar .model-list:focus-within,
html body .sidebar .model-list .sidebar-feature-group,
html body .sidebar .model-list .sidebar-feature-group:hover,
html body .sidebar .model-list .sidebar-feature-row,
html body .sidebar .model-list .sidebar-feature-row:hover {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

html body .sidebar .model-list .sidebar-feature-item {
    position: relative !important;
    padding-right: 30px !important;
    transition: background-color .14s ease, border-color .14s ease !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover,
html body .sidebar .model-list .sidebar-feature-item:focus-visible,
html body .sidebar .model-list .sidebar-feature-item.model-item-active,
html body .sidebar .model-list .sidebar-feature-item.model-item-active:hover {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
    background-image: none !important;
    
    box-shadow: none !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover .model-name,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-name,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-name,
html body .sidebar .model-list .sidebar-feature-item:hover .model-tag,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-tag,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-tag {
    
}

html body .sidebar .model-list .sidebar-feature-item:hover .model-description,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-description,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-description {
    
}

html body .sidebar .model-list .sidebar-feature-item.model-item-active::before,
html body .sidebar .model-list .sidebar-feature-item.model-item-active::after {
    display: block !important;
    content: none;
    border: 0 !important;
}

html body .sidebar .model-list .sidebar-feature-item.model-item-active::after {
    content: "\2713" !important;
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    z-index: 2 !important;
    display: grid !important;
    width: 16px !important;
    height: 16px !important;
    place-items: center !important;
    border: 1px solid #93bce8 !important;
    background: #fff !important;
    color: #2874c8 !important;
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}

/* A compact check marks selected mode and feature tabs without changing their text. */
html body .sidebar .primary-selector .primary-item,
html body .sidebar .secondary-track .secondary-item {
    position: relative !important;
}

html body .sidebar .primary-selector .primary-item.primary-item-active::after,
html body .sidebar .secondary-track .secondary-item.secondary-item-active::after {
    content: "\2713" !important;
    position: absolute !important;
    top: 4px !important;
    right: 5px !important;
    display: grid !important;
    width: 14px !important;
    height: 14px !important;
    place-items: center !important;
    border: 1px solid #93bce8 !important;
    background: #fff !important;
    color: #2874c8 !important;
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    pointer-events: none !important;
}

/* Focus changes only the text field border; preserve its existing surface. */
html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):focus,
html body select:focus,
html body textarea:focus,
html body .rich-input:focus,
html body .form-input:focus,
html body [contenteditable="true"]:focus {
    border-color: #64748b !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Make the sidebar surface lighter than selected rows. */
html body .home-container > .sidebar {
    background: #f5f9ff !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover,
html body .sidebar .model-list .sidebar-feature-item:focus-visible {
    border-color: #c7ddf8 !important;
    background: #edf5ff !important;
}

html body .sidebar .model-list .sidebar-feature-item.model-item-active,
html body .sidebar .model-list .sidebar-feature-item.model-item-active:hover {
    border-color: #9fc5f2 !important;
    background: #e3efff !important;
}

/* Mark the selected vendor, model and channel without recoloring their content. */
html body .model-picker-vendor,
html body .model-picker-model,
html body .model-picker-channel {
    position: relative;
}

html body .model-picker-vendor.active,
html body .model-picker-model.active,
html body .model-picker-channel.active {
    padding-right: 34px;
}

html body .model-picker-vendor.active::after,
html body .model-picker-model.active::after,
html body .model-picker-channel.active::after {
    content: "\2713";
    position: absolute;
    top: 50%;
    right: 9px;
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid #9fc5f2;
    background: #fff;
    color: #2874c8;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

/* Show selection consistently in every AI director choice group. */
html body #aiDirectorModal .ai-director-direction,
html body #aiDirectorModal .ai-director-tab {
    position: relative;
}

html body #aiDirectorModal .ai-director-direction.active,
html body #aiDirectorModal .ai-director-tab.active {
    padding-right: 31px;
}

html body #aiDirectorModal .ai-director-direction.active::after,
html body #aiDirectorModal .ai-director-tab.active::after {
    content: "\2713";
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid #9fc5f2;
    background: #fff;
    color: #2874c8;
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

html body #aiDirectorModal .ai-director-type.active .ai-director-type-check {
    color: #2874c8 !important;
}

html body #aiDirectorModal .ai-director-types {
    gap: 6px !important;
}

html body #aiDirectorModal .ai-director-type {
    min-height: 54px !important;
    grid-template-columns: 28px minmax(0, 1fr) 14px !important;
    gap: 7px !important;
    padding: 6px 8px !important;
}

html body #aiDirectorModal .ai-director-type-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 13px !important;
}

html body #aiDirectorModal .ai-director-type-copy {
    gap: 2px !important;
}

html body #aiDirectorModal .ai-director-type-copy strong {
    font-size: 11px !important;
    line-height: 1.2 !important;
}

html body #aiDirectorModal .ai-director-type-copy small {
    font-size: 10px !important;
    line-height: 1.25 !important;
}

/* Keep newly submitted and rerun task cards from collapsing into a progress line. */
html body #scrollContent.media-grid-container > .task-progress-card,
html body #scrollContent.media-grid-container > .history-task-card {
    min-height: 172px !important;
    height: auto !important;
}

html body #scrollContent.media-grid-container > .task-progress-card > .task-card-body,
html body #scrollContent.media-grid-container > .history-task-card > .task-card-body {
    min-height: 170px !important;
    height: auto !important;
    align-content: start !important;
}

/* Align the polling status with the workbench tabs and keep active labels transparent. */
html body .top-model-info #taskPollCountdown {
    align-self: center !important;
    margin-left: 0 !important;
}

html body .top-model-info #topWorkbenchRefreshBtn {
    align-self: center !important;
    margin-left: 0 !important;
}

@media (max-width: 768px) {
    html body .top-model-info #workbenchViewSwitch {
        order: 10 !important;
    }

    html body .top-model-info #taskPollCountdown {
        order: 11 !important;
    }

    html body .top-model-info #topWorkbenchRefreshBtn {
        order: 12 !important;
    }
}

html body .sidebar .primary-selector .primary-item.primary-item-active::after {
    content: none !important;
    display: none !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover,
html body .sidebar .model-list .sidebar-feature-item:focus-visible,
html body .sidebar .model-list .sidebar-feature-item.model-item-active,
html body .sidebar .model-list .sidebar-feature-item.model-item-active:hover {
    border-color: #bfdbfe !important;
    background: #eaf3ff !important;
    background-color: #eaf3ff !important;
    background-image: none !important;
}

html body .sidebar .model-list .sidebar-feature-item:hover .model-name,
html body .sidebar .model-list .sidebar-feature-item:hover .model-description,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-name,
html body .sidebar .model-list .sidebar-feature-item:focus-visible .model-description,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-name,
html body .sidebar .model-list .sidebar-feature-item.model-item-active .model-description {
    border-color: transparent !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}
