.download-toast {
    position: fixed;
    z-index: 10000;
    top: max(24px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--button-elevated);
    color: var(--secondary);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    line-height: 1.5;
    pointer-events: none;
}

        :root, [data-theme="dark"] {
            --primary: #000000;
            --secondary: #e1e1e1;
            --gray: #818181;
            --white: #ffffff;
            --red: #ed2236;
            --green: #37aa42;
            --blue: #2a7ce1;
            --orange: #f19a38;
            --credential-mark: #f5c451;

            --button: #161618;
            --button-hover: #222225;
            --button-press: #28282d;
            --button-active-hover: #f9f9f9;
            --button-stroke: rgba(255, 255, 255, 0.06);
            --button-text: #e1e1e1;
            --button-box-shadow: 0 0 0 1px var(--button-stroke) inset;

            --button-elevated: #282828;
            --button-elevated-hover: #2f2f2f;

            --sidebar-bg: #0c0c0e;
            --sidebar-highlight: var(--secondary);
            --sidebar-stroke: rgba(255, 255, 255, 0.04);

            --content-border: rgba(255, 255, 255, 0.045);
            --content-border-thickness: 1px;

            --input-border: #333338;
            --input-focus-outline: var(--secondary);
            --dialog-backdrop: rgba(0, 0, 0, 0.65);

            --border-radius: 11px;
            --sidebar-width: 80px;
            --sidebar-tab-padding: 8px;
            --input-padding: 12px;
        }

        [data-theme="light"] {
            --primary: #ffffff;
            --secondary: #141416;
            --gray: #75757e;
            --white: #ffffff;
            --red: #ed2236;
            --green: #2fa53a;
            --blue: #2563eb;
            --orange: #ea580c;
            --credential-mark: #ad7600;

            --button: #f4f4f5;
            --button-hover: #eaeaea;
            --button-press: #e0e0e3;
            --button-active-hover: #111111;
            --button-stroke: rgba(0, 0, 0, 0.07);
            --button-text: #18181b;
            --button-box-shadow: 0 0 0 1px var(--button-stroke) inset;

            --button-elevated: #e4e4e7;
            --button-elevated-hover: #d4d4d8;

            --sidebar-bg: #f8f8fa;
            --sidebar-highlight: var(--secondary);
            --sidebar-stroke: rgba(0, 0, 0, 0.05);

            --content-border: rgba(0, 0, 0, 0.06);
            --content-border-thickness: 1px;

            --input-border: #cbd5e1;
            --input-focus-outline: #0f172a;
            --dialog-backdrop: rgba(0, 0, 0, 0.35);
        }

        * {
            box-sizing: border-box;
            font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
            -webkit-tap-highlight-color: transparent;
            margin: 0;
            padding: 0;
        }

        html, body {
            margin: 0;
            padding: 0;
            height: 100vh;
            width: 100vw;
            overflow: hidden;
            background-color: var(--sidebar-bg);
            color: var(--secondary);
            -webkit-font-smoothing: antialiased;
        }

        ::selection {
            color: var(--primary);
            background: var(--secondary);
        }

        /* 布局框架一比一 Cobalt */
        #cobalt-app {
            height: 100%;
            width: 100%;
            display: grid;
            grid-template-columns: calc(var(--sidebar-width) + 8px) 1fr;
            overflow: hidden;
            background-color: var(--sidebar-bg);
            color: var(--secondary);
            position: fixed;
            top: 0;
            left: 0;
        }

        /* 左侧边栏 Sidebar */
        #sidebar {
            background: var(--sidebar-bg);
            height: 100vh;
            width: calc(var(--sidebar-width) + 8px);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 14px 4px 16px 4px;
            border-right: 1px solid var(--sidebar-stroke);
            z-index: 20;
        }

        .sidebar-top {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 16px;
            width: 100%;
        }

        .cobalt-logo-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 48px;
            border-radius: 14px;
            background: transparent;
            cursor: pointer;
            transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .cobalt-logo-btn:hover {
            transform: scale(1.08);
        }
        .cobalt-logo-btn:active {
            transform: scale(0.96);
        }

        /* 左上角静态标准海豚 D Logo */
        .sidebar-static-logo {
            width: 36px;
            height: 36px;
            object-fit: contain;
            display: block;
            pointer-events: none;
            user-select: none;
            -webkit-user-drag: none;
            filter: drop-shadow(0 3px 8px rgba(0, 160, 255, 0.45));
            transition: filter 0.25s ease;
        }
        .cobalt-logo-btn:hover .sidebar-static-logo {
            filter: drop-shadow(0 6px 14px rgba(0, 210, 255, 0.7)) drop-shadow(0 0 8px rgba(0, 102, 255, 0.4));
        }

        .sidebar-tab-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            width: 100%;
            align-items: center;
        }

        .sidebar-tab {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            width: 64px;
            height: 56px;
            border-radius: var(--border-radius);
            background: transparent;
            border: none;
            color: var(--gray);
            cursor: pointer;
            position: relative;
            transition: all 0.15s ease;
            font-size: 11px;
            font-weight: 500;
        }
        .sidebar-tab svg {
            width: 20px;
            height: 20px;
            stroke-width: 1.8;
            stroke: currentColor;
            fill: none;
            transition: stroke 0.15s ease;
        }
        .sidebar-tab:hover {
            color: var(--secondary);
            background: var(--button-hover);
        }
        .sidebar-tab.active {
            color: var(--secondary);
            background: var(--button);
            box-shadow: var(--button-box-shadow);
        }
        .sidebar-tab.active svg {
            stroke: var(--secondary);
        }

        .sidebar-tab .badge {
            position: absolute;
            top: 5px;
            right: 8px;
            background: var(--blue);
            color: #ffffff;
            font-size: 10px;
            font-weight: 600;
            padding: 1px 5px;
            border-radius: 99px;
            line-height: 1.2;
        }

        /* 主工作区画布 (整体居中) */
        #content {
            display: flex;
            flex-direction: column;
            align-items: center;
            height: 100vh;
            overflow-y: auto;
            background-color: var(--primary);
            box-shadow: 0 0 0 var(--content-border-thickness) var(--content-border);
            margin-left: var(--content-border-thickness);
            position: relative;
            scrollbar-width: thin;
            scrollbar-color: var(--input-border) transparent;
        }

        #content::-webkit-scrollbar {
            width: 6px;
        }
        #content::-webkit-scrollbar-thumb {
            background: var(--input-border);
            border-radius: 3px;
        }

        /* 居中核心保存区域 */
        #cobalt-save-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            max-width: 680px;
            width: 100%;
            margin: auto 0;
            padding: 32px 20px;
            gap: 16px;
            box-sizing: border-box;
        }

        /* 页面左上角支持平台微型横幅 SupportedServices */
        #supported-services {
            position: absolute;
            top: 20px;
            left: 24px;
            right: 24px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 6px;
            min-width: 0;
            z-index: 20;
        }

        .services-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 4px 10px;
            border-radius: 99px;
            background: var(--button);
            box-shadow: var(--button-box-shadow);
            font-size: 11px;
            color: var(--gray);
            width: max-content;
            max-width: 100%;
            min-width: 0;
            border: 1px solid var(--border);
        }
        .platform-strip {
            display: flex;
            align-items: center;
            gap: 4px;
            min-width: 0;
            overflow-x: auto;
            overscroll-behavior-x: contain;
            scrollbar-width: none;
        }
        .platform-strip::-webkit-scrollbar {
            display: none;
        }
        .platform-region {
            flex-shrink: 0;
            font-size: 10px;
            color: var(--gray);
        }
        .platform-strip:focus-visible {
            outline: 1px solid var(--blue);
            outline-offset: 2px;
            border-radius: 4px;
        }

        /* 平台标签仅作状态展示，不可点击；标签之间用竖线分隔 */
        .service-item {
            display: inline-flex;
            flex-shrink: 0;
            align-items: center;
            gap: 3px;
            white-space: nowrap;
            padding: 1px 2px;
            border-radius: 6px;
            color: var(--gray);
            user-select: none;
        }
        /* Dim the platform icon and name, keeping the requirement key gold. */
        .service-item > * {
            opacity: 0.45;
            filter: grayscale(0.9);
        }
        .service-item svg {
            width: 14px;
            height: 14px;
            flex-shrink: 0;
        }
        .platform-sep {
            color: var(--gray);
            opacity: 0.4;
            flex-shrink: 0;
            font-size: 11px;
        }

        /* 已就绪支持：一律设为统一草绿色 */
        .service-item.supported {
            font-weight: 500;
            color: var(--green) !important;
        }
        .service-item.supported > * {
            opacity: 1;
            filter: none;
        }

        /* Gold keys identify platforms that require cookies, even before sync. */
        .service-item.credential-required::after {
            content: '';
            width: 14px;
            height: 14px;
            flex: 0 0 14px;
            align-self: center;
            background-color: var(--credential-mark);
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cpath d='m12 12 9 9m-3-3 3-3m-6 0 3-3'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cpath d='m12 12 9 9m-3-3 3-3m-6 0 3-3'/%3E%3C/svg%3E") center / contain no-repeat;
        }

        /* 暂时不支持/未就绪：灰色 */
        .service-item.unsupported {
            color: var(--gray) !important;
        }
        .service-item.unsupported > * {
            opacity: 0.42;
            filter: grayscale(1);
        }

        /* 一键检测按钮 */
        .service-check-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 9px;
            border-radius: 99px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid var(--button-stroke);
            color: var(--secondary);
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
            margin-left: 2px;
            height: 24px;
        }
        .service-check-btn:hover {
            background: var(--button-hover);
            color: var(--blue);
            border-color: var(--blue);
        }
        .service-check-btn.checking svg {
            animation: spin 1s linear infinite;
        }
        .service-check-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* 平台状态说明气泡弹窗 Popover */
        #platform-popover {
            display: none;
            position: absolute;
            top: 42px;
            left: 0;
            z-index: 120;
            width: 290px;
            background: var(--button);
            border: 1px solid var(--button-stroke);
            border-radius: 12px;
            box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
            padding: 12px 14px;
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            animation: popoverFadeIn 0.15s ease-out;
        }
        @keyframes popoverFadeIn {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        #platform-popover.open {
            display: block;
        }

        .hero-mark {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
        }
        .hero-logo-box {
            width: 96px;
            height: 96px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            cursor: pointer;
            position: relative;
        }


        /* ============================================================
           Dolphin 动态海洋舞台系统 (Living Brand Motion System)
           ============================================================ */
        .dolphin-stage {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            user-select: none;
            -webkit-user-drag: none;
            cursor: pointer;
            perspective: 600px;
        }

        .hero-stage {
            width: 90px;
            height: 90px;
        }

        .side-stage {
            width: 38px;
            height: 38px;
        }

        /* 1. D 字母基座：稳固基座，独立呼吸与极光韵律 */
        .d-base-wrap {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: dBaseTide 3.8s ease-in-out infinite;
            pointer-events: none;
            transition: all 0.4s ease;
        }

        .d-base-img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            pointer-events: none;
            user-select: none;
        }

        @keyframes dBaseTide {
            0%, 100% {
                transform: scale(1);
                filter: drop-shadow(0 4px 10px rgba(0, 102, 255, 0.35));
            }
            50% {
                transform: scale(1.025);
                filter: drop-shadow(0 8px 18px rgba(0, 150, 255, 0.6)) drop-shadow(0 0 12px rgba(0, 242, 254, 0.35));
            }
        }

        /* 自然流体力学海豚游弋系统：基于正弦流线与速度矢量切线对齐，丝滑无机械顿挫 */
        .dolphin-swimmer-wrap {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: dolphinLivingSwim 3.4s ease-in-out infinite;
            will-change: transform, filter;
            pointer-events: none;
            transform-origin: 35% 65%;
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
        }

        .dolphin-swimmer-img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            pointer-events: none;
            user-select: none;
        }

        /* 真实海豚水流动力学椭圆游弋关键帧 */
        @keyframes dolphinLivingSwim {
            0% {
                /* 破水上冲：向上冲刺，吻部自然迎水上挑 */
                transform: translate(1px, 2px) rotate(-5.5deg) scale(1.02);
                filter: drop-shadow(0 8px 18px rgba(0, 210, 255, 0.6));
            }
            25% {
                /* 浪尖腾空极值：高度最高，瞬时水平滑翔过顶 */
                transform: translate(3px, -11px) rotate(0deg) scale(1.04);
                filter: drop-shadow(0 16px 30px rgba(0, 242, 254, 0.85)) drop-shadow(0 0 18px rgba(0, 102, 255, 0.5));
            }
            50% {
                /* 顺势入水俯冲：下潜速度最大，吻部顺畅下探 */
                transform: translate(1px, 1px) rotate(4deg) scale(0.99);
                filter: drop-shadow(0 8px 18px rgba(106, 17, 203, 0.55));
            }
            75% {
                /* 谷底回环蓄力：下潜最深，回旋准备迎浪再次跃出 */
                transform: translate(-2px, 6px) rotate(0deg) scale(0.97);
                filter: drop-shadow(0 6px 14px rgba(0, 150, 255, 0.45));
            }
            100% {
                transform: translate(1px, 2px) rotate(-5.5deg) scale(1.02);
                filter: drop-shadow(0 8px 18px rgba(0, 210, 255, 0.6));
            }
        }

        /* 3. 动态水面涟漪光环 (与海豚谷底跃水周期同频扩散) */
        .dolphin-water-effect {
            position: absolute;
            bottom: 4px;
            left: 2px;
            width: 44px;
            height: 24px;
            pointer-events: none;
            overflow: visible;
        }

        .ripple-ring {
            position: absolute;
            left: 50%;
            top: 50%;
            border-radius: 50%;
            border: 2px solid rgba(0, 242, 254, 0.75);
            box-shadow: 0 0 10px rgba(0, 242, 254, 0.55), inset 0 0 6px rgba(0, 242, 254, 0.35);
            transform: translate(-50%, -50%) rotateX(65deg);
            opacity: 0;
            pointer-events: none;
        }

        .ripple-ring.r1 {
            animation: waterSplashRipple 3.4s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
        }
        .ripple-ring.r2 {
            animation: waterSplashRipple 3.4s cubic-bezier(0.1, 0.8, 0.3, 1) 1.1s infinite;
        }

        @keyframes waterSplashRipple {
            0%, 20% {
                width: 6px;
                height: 4px;
                opacity: 0;
                transform: translate(-50%, -50%) rotateX(65deg) scale(0.5);
            }
            30% {
                opacity: 0.9;
            }
            65% {
                width: 62px;
                height: 30px;
                opacity: 0.35;
                transform: translate(-50%, -50%) rotateX(65deg) scale(1.35);
            }
            85%, 100% {
                width: 80px;
                height: 38px;
                opacity: 0;
                transform: translate(-50%, -50%) rotateX(65deg) scale(1.65);
            }
        }

        /* 4. 海豚高精度独立高光掠影 */
        .dolphin-glint {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            -webkit-mask-image: url('/dolphin_body.png');
            -webkit-mask-size: contain;
            -webkit-mask-repeat: no-repeat;
            -webkit-mask-position: center;
            mask-image: url('/dolphin_body.png');
            mask-size: contain;
            mask-repeat: no-repeat;
            mask-position: center;
        }

        .dolphin-glint::after {
            content: '';
            position: absolute;
            top: -60%;
            left: -120%;
            width: 70%;
            height: 220%;
            background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.8) 45%,
                rgba(0, 242, 254, 0.95) 60%,
                rgba(255, 255, 255, 0) 100%
            );
            transform: rotate(26deg);
            animation: dolphinGlintSweep 3.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
        }

        @keyframes dolphinGlintSweep {
            0%, 25% {
                transform: translate3d(-150%, 0, 0) rotate(26deg);
                opacity: 0;
            }
            35% {
                opacity: 0.95;
            }
            65% {
                transform: translate3d(260%, 0, 0) rotate(26deg);
                opacity: 0.95;
            }
            75%, 100% {
                transform: translate3d(260%, 0, 0) rotate(26deg);
                opacity: 0;
            }
        }

        /* 5. 悬停互动：海豚激昂冲跃，底座泛起激越极光 */
        .hero-logo-box:hover .dolphin-swimmer-wrap {
            animation: dolphinHeroLeap 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }
        .hero-logo-box:hover .d-base-wrap {
            transform: scale(1.05);
            filter: drop-shadow(0 8px 24px rgba(0, 210, 255, 0.7));
        }

        @keyframes dolphinHeroLeap {
            0% {
                transform: translate(0px, 0px) rotate(0deg) scale(1, 1);
            }
            45% {
                transform: translate(6px, -20px) rotate(-9deg) scale(1.18, 1.05) skewY(-4deg);
                filter: drop-shadow(0 20px 42px rgba(0, 242, 254, 0.95)) drop-shadow(0 0 32px rgba(106, 17, 203, 0.85));
            }
            75% {
                transform: translate(3px, -12px) rotate(2deg) scale(1.12, 1.02);
            }
            100% {
                transform: translate(4px, -14px) rotate(0deg) scale(1.14, 1.03);
                filter: drop-shadow(0 16px 32px rgba(0, 210, 255, 0.9)) drop-shadow(0 0 24px rgba(0, 102, 255, 0.75));
            }
        }
        .hero-title {
            font-size: 26px;
            font-weight: 600;
            letter-spacing: -0.5px;
            color: var(--secondary);
        }
        .hero-instance-tag {
            font-size: 11.5px;
            color: var(--gray);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .pulse-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background-color: var(--green);
            box-shadow: 0 0 8px var(--green);
            display: inline-block;
            animation: pulse-ring 2s infinite ease-in-out;
        }
        @keyframes pulse-ring {
            0% { transform: scale(0.95); opacity: 0.8; }
            50% { transform: scale(1.2); opacity: 1; }
            100% { transform: scale(0.95); opacity: 0.8; }
        }

        /* 一比一 Cobalt Omnibox */
        #omnibox {
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 640px;
            gap: 8px;
            position: relative;
        }

        #input-container {
            display: flex;
            align-items: center;
            box-shadow: 0 0 0 1.5px var(--input-border) inset;
            outline: 1.5px solid var(--input-border);
            outline-offset: -1.5px;
            border-radius: var(--border-radius);
            background: var(--button);
            font-size: 14.5px;
            height: 50px;
            transition: outline-color 0.15s ease, box-shadow 0.15s ease;
            position: relative;
        }

        #input-container.focused {
            outline: 2px solid var(--input-focus-outline);
            box-shadow: none;
        }

        #input-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 100%;
            color: var(--gray);
            flex-shrink: 0;
            padding-left: 4px;
        }
        #input-icon svg {
            width: 18px;
            height: 18px;
            stroke-width: 1.8;
            stroke: currentColor;
            fill: none;
        }

        #link-area {
            display: flex;
            width: 100%;
            margin: 0;
            padding: 0 6px;
            height: 100%;
            align-items: center;
            border: none;
            outline: none;
            background-color: transparent;
            color: var(--secondary);
            font-size: 14px;
            font-weight: 500;
            flex: 1;
            user-select: text;
            -webkit-user-select: text;
        }
        #link-area::placeholder {
            color: var(--gray);
            opacity: 0.75;
            font-size: 13.5px;
        }

        #clear-button {
            display: none;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border-radius: 6px;
            color: var(--gray);
            background: transparent;
            border: none;
            cursor: pointer;
            margin-right: 6px;
            transition: all 0.15s ease;
        }
        #clear-button:hover {
            color: var(--secondary);
            background: var(--button-hover);
        }
        #clear-button svg {
            width: 14px;
            height: 14px;
            stroke-width: 2;
            stroke: currentColor;
        }
        #input-container.has-content #clear-button {
            display: flex;
        }

        /* Cobalt 标志性 >> 下载按钮 */
        #download-button {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            min-width: 52px;
            width: 52px;
            border-radius: 0;
            border: none;
            border-left: 1.5px var(--input-border) solid;
            border-top-right-radius: var(--border-radius);
            border-bottom-right-radius: var(--border-radius);
            background: none;
            cursor: pointer;
            color: var(--secondary);
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        #download-button:hover:not(:disabled) {
            background: var(--button-hover);
        }
        #download-button:active:not(:disabled) {
            background: var(--button-press);
        }
        #download-button:disabled {
            cursor: not-allowed;
            color: var(--gray);
        }
        #input-container.focused #download-button {
            border-left: 2px var(--input-focus-outline) solid;
        }

        #download-state {
            font-size: 22px;
            font-family: "IBM Plex Mono", monospace;
            font-weight: 500;
            text-align: center;
            letter-spacing: -4.5px;
            margin-right: -4px;
            margin-bottom: 2px;
        }

        /* Omnibox 下方快捷控制栏 */
        #action-container {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            width: 100%;
        }

        /* Cobalt Switcher 经典组合按钮 */
        .switcher {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            border-radius: var(--border-radius);
            background: var(--button);
            box-shadow: var(--button-box-shadow);
            padding: 3px;
            gap: 2px;
        }

        .switcher-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            height: 32px;
            border-radius: calc(var(--border-radius) - 3px);
            border: none;
            background: transparent;
            color: var(--gray);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
        }
        .switcher-btn svg {
            width: 14px;
            height: 14px;
            stroke-width: 1.8;
            stroke: currentColor;
            fill: none;
        }
        .switcher-btn:hover:not(.active) {
            color: var(--secondary);
            background: var(--button-hover);
        }
        .switcher-btn.active {
            background: var(--secondary);
            color: var(--primary);
            font-weight: 600;
            pointer-events: none;
        }
        .switcher-btn.active svg {
            stroke: var(--primary);
        }

        .action-right-group {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .action-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 0 13px;
            height: 38px;
            border-radius: var(--border-radius);
            background: var(--button);
            color: var(--secondary);
            border: none;
            box-shadow: var(--button-box-shadow);
            font-size: 12.5px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
        }
        .action-btn svg {
            width: 15px;
            height: 15px;
            stroke-width: 1.8;
            stroke: currentColor;
            fill: none;
        }
        .action-btn:hover {
            background: var(--button-hover);
        }
        .action-btn:active {
            transform: scale(0.98);
            background: var(--button-press);
        }

        /* 任务队列看板 (Processing Queue) */
        #queue-section {
            width: 100%;
            max-width: 640px;
            margin-top: 10px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .queue-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 2px;
            margin-bottom: 2px;
        }

        .queue-tabs {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            background: var(--button);
            padding: 2.5px;
            border-radius: 99px;
            border: 1px solid var(--border);
        }

        .queue-header.has-retention-hint { gap: 10px; }
        .queue-retention-hint {
            flex: 1;
            color: var(--gray);
            font-size: 11px;
            line-height: 1.5;
        }
        @media (max-width: 600px) {
            .queue-header.has-retention-hint { flex-wrap: wrap; }
            .has-retention-hint .queue-clear-btn { margin-left: auto; }
            .queue-retention-hint { order: 1; flex-basis: 100%; }
        }

        .queue-tab-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 10px;
            border-radius: 99px;
            border: none;
            background: transparent;
            color: var(--gray);
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .queue-tab-btn:hover {
            color: var(--secondary);
        }
        .queue-tab-btn.active {
            background: var(--button-hover);
            color: var(--secondary);
            font-weight: 600;
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        }
        .tab-badge {
            font-size: 10px;
            opacity: 0.8;
        }

        .queue-clear-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 8px;
            border-radius: 6px;
            background: var(--button);
            color: var(--gray);
            border: 1px solid var(--button-stroke);
            box-shadow: var(--button-box-shadow);
            font-size: 11px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .queue-clear-btn:hover {
            color: var(--secondary);
            background: var(--button-hover);
            border-color: var(--input-border);
        }
        .queue-clear-btn:active {
            background: var(--button-press);
            transform: scale(0.97);
        }
        .queue-clear-btn svg {
            width: 12px;
            height: 12px;
        }

        .queue-card {
            background: var(--button);
            box-shadow: var(--button-box-shadow);
            border-radius: var(--border-radius);
            padding: 6px 12px;
            display: flex;
            flex-direction: column;
            gap: 3px;
            transition: border-color 0.15s ease;
        }
        .queue-card:hover {
            box-shadow: 0 0 0 1px var(--input-border) inset;
        }

        .queue-card-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
        }

        .queue-title-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            flex: 1;
        }

        .platform-badge {
            font-size: 10px;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 4px;
            text-transform: uppercase;
            flex-shrink: 0;
        }
        .badge-douyin { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
        .badge-xhs { background: rgba(239, 68, 68, 0.15); color: #f87171; }
        .badge-bili { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
        .badge-yt { background: rgba(220, 38, 38, 0.15); color: #ef4444; }
        .badge-x { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
        .badge-general { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
        .badge-text { background: rgba(16, 185, 129, 0.15); color: #34d399; }
        .badge-audio { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
        .badge-video { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
        .badge-gallery { background: rgba(236, 72, 153, 0.15); color: #f472b6; }

        .queue-title {
            font-size: 13px;
            color: var(--secondary);
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .queue-status-badge {
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .status-completed { color: var(--green); }
        .status-failed { color: var(--red); }
        .status-processing { color: var(--orange); }
        .status-downloading { color: var(--blue); }
        .status-transcribing { color: #38bdf8; font-weight: 500; }
        .status-refining { color: #c084fc; font-weight: 600; text-shadow: 0 0 8px rgba(192, 132, 252, 0.4); }

        /* Cobalt 极简细进度条 */
        .queue-progress-track {
            width: 100%;
            height: 2px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 99px;
            overflow: hidden;
            position: relative;
        }
        .queue-progress-bar {
            height: 100%;
            background: var(--blue);
            border-radius: 99px;
            transition: width 0.3s ease;
        }
        .queue-progress-bar.completed { background: var(--green); }
        .queue-progress-bar.failed { background: var(--red); }
        .queue-progress-bar.processing {
            background: var(--orange);
            animation: pulse-bar 1.5s infinite ease-in-out;
        }
        .queue-progress-bar.downloading {
            background: linear-gradient(90deg, #2563eb, #38bdf8);
            box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
        }
        .queue-progress-bar.transcribing {
            background: linear-gradient(90deg, #0284c7, #06b6d4, #10b981);
            box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
            background-size: 200% 100%;
            animation: flow-shimmer 2s linear infinite;
        }
        .queue-progress-bar.refining {
            background: linear-gradient(90deg, #8b5cf6, #d946ef, #ec4899);
            box-shadow: 0 0 12px rgba(217, 70, 239, 0.6);
            background-size: 200% 100%;
            animation: flow-shimmer 1.8s linear infinite;
        }
        .queue-progress-bar.indeterminate {
            width: 35% !important;
            background: linear-gradient(90deg, var(--blue) 0%, #60a5fa 50%, var(--blue) 100%);
            animation: progress-indeterminate 1.4s infinite ease-in-out;
        }
        @keyframes flow-shimmer {
            0% { background-position: 100% 0; }
            100% { background-position: -100% 0; }
        }
        @keyframes progress-indeterminate {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(350%); }
        }
        @keyframes pulse-bar {
            0% { opacity: 0.6; }
            50% { opacity: 1; }
            100% { opacity: 0.6; }
        }

        .queue-card-bottom {
            display: flex;
            justify-content: space-between;
            align-items: center;
            min-height: 22px;
            font-size: 11px;
            color: var(--gray);
            gap: 8px;
            min-width: 0;
        }

        .queue-message {
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            line-height: 16px;
        }

        .queue-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            flex-wrap: wrap;
            gap: 4px;
        }

        .queue-actions:empty {
            display: none;
        }

        .queue-card .file-action-btn {
            padding: 2px 7px;
            line-height: 16px;
            white-space: nowrap;
        }

        @media (max-width: 600px) {
            .queue-card-top { flex-wrap: wrap; gap: 3px 8px; }
            .queue-title-wrap { flex-basis: 170px; gap: 5px; }
            .queue-card-bottom { flex-wrap: wrap; gap: 3px 8px; }
            .queue-message { flex-basis: 72px; }
            .queue-actions { max-width: 100%; margin-left: auto; }
            .queue-card .file-action-btn { padding: 2px 5px; font-size: 10px; }
        }

        .file-action-btn {
            color: var(--secondary);
            background: var(--button);
            border: 1px solid var(--button-stroke);
            border-radius: 4px;
            padding: 3px 8px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            transition: all 0.15s ease;
            text-decoration: none;
            box-shadow: var(--button-box-shadow);
        }
        .file-action-btn:hover {
            color: var(--blue);
            background: var(--button-hover);
            border-color: var(--blue);
            text-decoration: none;
        }

        .empty-stub {
            background: var(--button);
            box-shadow: var(--button-box-shadow);
            border-radius: var(--border-radius);
            padding: 24px;
            text-align: center;
            color: var(--gray);
            font-size: 12px;
        }

        /* 底部条款与快捷键小提示 */
        #footer-note {
            margin-top: 10px;
            padding: 8px 0 0 0;
            text-align: center;
            font-size: 11px;
            color: var(--gray);
            display: flex;
            flex-direction: column;
            gap: 4px;
            align-items: center;
        }
        .kbd-hint {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            font-size: 10.5px;
            opacity: 0.8;
        }
        kbd {
            background: var(--button);
            border-radius: 4px;
            padding: 1px 4px;
            font-size: 10px;
            box-shadow: var(--button-box-shadow);
            color: var(--secondary);
        }

        /* 模态对话框 Settings Dialog / Login Tip Dialog / Guide Dialog */
        #settings-dialog,
        #login-tip-dialog,
        #guide-dialog {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: var(--dialog-backdrop);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 100;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        #settings-dialog.open,
        #login-tip-dialog.open,
        #guide-dialog.open {
            display: flex;
        }

        .guide-card {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--button-stroke);
            border-radius: 12px;
            padding: 14px 16px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            transition: border-color 0.2s ease;
        }
        .guide-card:hover {
            border-color: rgba(255, 255, 255, 0.12);
        }
        .guide-step-row {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: 13px;
            line-height: 1.6;
            color: var(--secondary);
        }
        .guide-step-num {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--button-hover);
            border: 1px solid var(--button-stroke);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            font-weight: 600;
            color: var(--blue);
            flex-shrink: 0;
            margin-top: 2px;
        }

        #guide-dialog .manual-dialog {
            max-width: 660px;
            max-height: 88vh;
            max-height: 88dvh;
        }
        .manual-dialog .dialog-header {
            border-bottom: 0;
            padding-bottom: 0;
            flex-shrink: 0;
        }
        .manual-tabs {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 16px;
            border-bottom: 1px solid var(--button-stroke);
            flex-shrink: 0;
        }
        .manual-tab {
            background: transparent;
            border: 0;
            border-bottom: 2px solid transparent;
            color: var(--gray);
            font: inherit;
            font-size: 12px;
            text-align: left;
            padding: 6px 2px 12px;
            margin-bottom: -1px;
            cursor: pointer;
        }
        .manual-tab:hover {
            color: var(--secondary);
        }
        .manual-tab[aria-selected="true"] {
            color: var(--blue);
            border-bottom-color: var(--blue);
        }
        .manual-tab:focus-visible,
        .manual-faq summary:focus-visible,
        .manual-panels [role="tabpanel"]:focus-visible,
        .manual-dialog .dialog-close:focus-visible {
            outline: 2px solid var(--blue);
            outline-offset: 2px;
            border-radius: 4px;
        }
        .manual-panels {
            height: 360px;
            min-height: 0;
            overflow-y: auto;
            overscroll-behavior: contain;
            padding: 3px;
            margin: -3px;
            scrollbar-gutter: stable;
        }
        .manual-panels [hidden] {
            display: none;
        }
        .manual-steps {
            gap: 20px;
        }
        .manual-step-desc {
            color: var(--gray);
            margin-top: 4px;
        }
        .manual-platform-groups {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 24px;
        }
        .manual-platform-group h3 {
            font-size: 11px;
            font-weight: 500;
            color: var(--gray);
            margin: 0 0 6px;
        }
        .manual-platform-list {
            margin: 0;
            font-size: 12px;
            line-height: 1.6;
        }
        .manual-platform-list > div {
            display: grid;
            grid-template-columns: minmax(80px, 0.85fr) minmax(0, 1.15fr);
            align-items: baseline;
            gap: 8px;
            padding: 9px 0;
            border-bottom: 1px solid var(--button-stroke);
        }
        .manual-platform-list dt {
            color: var(--secondary);
        }
        .manual-platform-list dd {
            color: var(--gray);
            margin: 0;
        }
        .manual-faq details {
            border-bottom: 1px solid var(--button-stroke);
            padding: 12px 0;
            font-size: 12px;
            line-height: 1.7;
        }
        .manual-faq details:first-child {
            padding-top: 0;
        }
        .manual-faq summary {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 16px;
            cursor: pointer;
            color: var(--secondary);
            list-style: none;
        }
        .manual-faq summary::-webkit-details-marker {
            display: none;
        }
        .manual-faq summary::after {
            content: '+';
            color: var(--gray);
            flex-shrink: 0;
        }
        .manual-faq details[open] summary::after {
            content: '−';
        }
        .manual-faq p {
            margin: 8px 24px 0 0;
            color: var(--gray);
        }

        .dialog-container {
            width: 100%;
            max-width: 480px;
            background: var(--button);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), var(--button-box-shadow);
            border-radius: 14px;
            border: 1px solid var(--button-stroke);
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 16px;
            animation: dialog-pop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
        }
        @keyframes dialog-pop {
            from { transform: scale(0.96); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

        .dialog-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--button-stroke);
            padding-bottom: 12px;
        }
        .dialog-title {
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--secondary);
        }
        .dialog-close {
            background: transparent;
            border: none;
            color: var(--gray);
            cursor: pointer;
            padding: 4px;
            border-radius: 6px;
        }
        .dialog-close:hover {
            color: var(--secondary);
            background: var(--button-hover);
        }

        .dialog-body {
            display: flex;
            flex-direction: column;
            gap: 14px;
            font-size: 12.5px;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .form-label {
            color: var(--gray);
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .form-select, .form-input {
            width: 100%;
            background: var(--sidebar-bg);
            border: 1px solid var(--input-border);
            border-radius: var(--border-radius);
            padding: 8px 12px;
            color: var(--secondary);
            font-size: 12.5px;
            outline: none;
        }
        .form-select:focus, .form-input:focus {
            border-color: var(--input-focus-outline);
        }

        /* 移动端自适应 (Cobalt 底部导航栏模式) */
        @media screen and (max-width: 640px) {
            #cobalt-app {
                grid-template-columns: 1fr;
                grid-template-rows: minmax(0, 1fr) 64px;
            }
            #sidebar {
                grid-row: 2;
                width: 100%;
                height: 64px;
                flex-direction: row;
                border-right: none;
                border-top: 1px solid var(--sidebar-stroke);
                padding: 4px 12px;
            }
            .sidebar-top {
                flex-direction: row;
                justify-content: space-around;
                width: auto;
            }
            .cobalt-logo-btn { display: none; }
            .sidebar-tab-group {
                flex-direction: row;
                justify-content: space-around;
                width: 100%;
            }
            .sidebar-bottom {
                display: flex;
                flex-direction: row;
                width: 100%;
                justify-content: space-around;
            }
            #content {
                order: -1;
                height: auto;
                min-height: 0;
                margin-left: 0;
                padding-bottom: 20px;
            }
            #supported-services {
                position: static;
                margin-top: 16px;
                width: calc(100% - 32px);
                flex-shrink: 0;
            }
            .manual-platform-groups {
                grid-template-columns: 1fr;
                gap: 20px;
            }
            #action-container {
                flex-direction: column;
                gap: 8px;
            }
            .switcher {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                width: 100%;
            }
            .switcher-btn {
                min-width: 0;
                justify-content: center;
            }
            .action-right-group {
                width: 100%;
            }
            .action-btn {
                flex: 1;
                justify-content: center;
            }
        }
    
.remote-session [data-local-only] { display: none !important; }

.queue-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.queue-page-label { color: var(--gray); font-size: 11px; font-variant-numeric: tabular-nums; }
.queue-pagination[hidden] { display: none; }
#queue-pagination button:disabled { opacity: 0.45; cursor: default; }
