﻿:root {
            --primary-color: #1a73e8;
            --bg-color: #ffffff;
            --bg-secondary: #f9f9fa;
            --bg-tertiary: #f0f2f5;
            --border-color: #e0e0e0;
            --text-main: #202124;
            --text-sub: #5f6368;
            --hover-color: #f1f3f4;
            --card-bg: #ffffff;
            --input-bg: #f0f2f5;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
            --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
            --scrollbar-thumb: #dadce0;
            --scrollbar-thumb-hover: #bdc1c6;
            --sidebar-width: 280px;
            --header-height: 60px;
            --content-max-width: 860px;
            --app-height: 100vh;
        }
        
        /* 暗黑模式 */
        [data-theme="dark"] {
            --primary-color: #8ab4f8;
            --bg-color: #1a1a1a;
            --bg-secondary: #242424;
            --bg-tertiary: #2d2d2d;
            --border-color: #3c3c3c;
            --text-main: #e8eaed;
            --text-sub: #9aa0a6;
            --hover-color: #2d2d2d;
            --card-bg: #242424;
            --input-bg: #2d2d2d;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
            --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
            --scrollbar-thumb: #5f6368;
            --scrollbar-thumb-hover: #80868b;
        }
[data-theme="dark"] .sidebar-nav,
[data-theme="dark"] .new-chat-btn,
/* 工具按钮暗黑模式 */
        [data-theme="dark"] .tool-btn { 
            background: var(--card-bg) !important; 
            color: var(--text-main) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .tool-btn:hover { 
            background: var(--hover-color) !important; 
            color: var(--primary-color) !important; 
            border-color: var(--primary-color) !important; 
        }
        
        [data-theme="dark"] .tool-btn.download { 
            color: var(--primary-color) !important; 
        }
[data-theme="dark"] .new-chat-btn:hover,
        [data-theme="dark"] .session-item:hover,
        [data-theme="dark"] .config-btn:hover,
        [data-theme="dark"] .provider-item:hover { 
            background: var(--hover-color) !important; 
        }
        
        [data-theme="dark"] .session-item.active { 
            background: var(--hover-color) !important; 
            color: var(--primary-color) !important; 
            border-color: var(--primary-color) !important;
        }
        
        [data-theme="dark"] .session-item.active::before { 
            background: var(--primary-color) !important; 
        }
        
        [data-theme="dark"] .message-row.user .msg-content { 
            background: var(--bg-tertiary) !important; 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .message-row.bot .msg-content { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
            color: var(--text-main) !important;
        }
[data-theme="dark"] textarea::placeholder,
        [data-theme="dark"] input::placeholder { 
            color: var(--text-sub) !important; 
        }
        
        [data-theme="dark"] .provider-item,
        [data-theme="dark"] .provider-content,
        [data-theme="dark"] .provider-list { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .provider-item.selected { 
            background: var(--hover-color) !important; 
            color: var(--primary-color) !important; 
        }
        
        [data-theme="dark"] .thought-box { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .thought-box summary { 
            color: var(--text-sub) !important; 
        }
        
        [data-theme="dark"] .loading-spinner { 
            border-color: var(--border-color) !important; 
            border-top-color: var(--primary-color) !important; 
        }
[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .config-label,
        [data-theme="dark"] label { 
            color: var(--text-sub) !important; 
        }
        
        [data-theme="dark"] .brand-area,
        [data-theme="dark"] .header-icon-btn,
        [data-theme="dark"] .icon-btn,
        [data-theme="dark"] .session-delete { 
            color: var(--text-sub) !important; 
        }
        
        [data-theme="dark"] .header-icon-btn:hover,
        [data-theme="dark"] .icon-btn:hover { 
            background: var(--hover-color) !important; 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .session-delete:hover { 
            background: var(--hover-color) !important; 
            color: #ff6b6b !important; 
        }
        
        [data-theme="dark"] .config-btn.primary { 
            background: var(--primary-color) !important; 
            color: var(--bg-color) !important; 
            border-color: var(--primary-color) !important; 
        }
        
        [data-theme="dark"] .config-btn.danger { 
            background: #5c2020 !important; 
            color: #ff6b6b !important; 
            border-color: #7c3030 !important; 
        }
        
        [data-theme="dark"] .config-btn:not(.primary):not(.danger) { 
            background: var(--card-bg) !important; 
            color: var(--text-main) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .config-btn:not(.primary):not(.danger):hover { 
            background: var(--hover-color) !important; 
            border-color: var(--primary-color) !important; 
        }
        
        [data-theme="dark"] .feature-btn { 
            background: linear-gradient(135deg, #3d1f1f 0%, var(--card-bg) 100%) !important; 
            border-color: #5c3838 !important; 
            color: #ff6b6b !important; 
        }
        
        [data-theme="dark"] .feature-btn:hover { 
            background: #4a2626 !important; 
            border-color: #6b4545 !important; 
        }
        
        [data-theme="dark"] .tool-nav-btn { 
            background: linear-gradient(135deg, #1a2a3a 0%, var(--card-bg) 100%) !important; 
            border-color: var(--border-color) !important; 
            color: var(--primary-color) !important; 
        }
        
        [data-theme="dark"] .tool-nav-btn:hover { 
            background: var(--hover-color) !important; 
        }
[data-theme="dark"] code,
        [data-theme="dark"] pre { 
            background: var(--input-bg) !important; 
            border-color: var(--border-color) !important; 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .toast { 
            background: var(--card-bg) !important; 
            color: var(--text-main) !important; 
            box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important; 
        }
        
        [data-theme="dark"] .toast.success { 
            background: #1e4620 !important; 
            border-left-color: #4caf50 !important; 
        }
        
        [data-theme="dark"] .toast.error { 
            background: #4a1f1f !important; 
            border-left-color: #f44336 !important; 
        }
        
        [data-theme="dark"] .toast.warning { 
            background: #4a3a1f !important; 
            border-left-color: #ff9800 !important; 
        }
        
        [data-theme="dark"] .generated-image,
        [data-theme="dark"] .shot-img { 
            opacity: 0.95; 
        }
        
        /* 预览图保持正常显示 */
        [data-theme="dark"] .preview-item { 
            background-color: #2d2d2d !important;
            border-color: var(--border-color) !important;
            opacity: 1 !important;
        }
        
        [data-theme="dark"] .preview-close { 
            background: var(--text-sub) !important;
            border-color: var(--border-color) !important;
        }
        
        [data-theme="dark"] .action-btn { 
            color: var(--text-sub) !important; 
        }
        
        [data-theme="dark"] .action-btn:hover { 
            color: var(--primary-color) !important; 
        }
        
        [data-theme="dark"] .provider-collapse summary { 
            background: var(--card-bg) !important; 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .provider-collapse summary:hover { 
            background: var(--hover-color) !important; 
        }
        
        [data-theme="dark"] .res-btn,
        [data-theme="dark"] .ratio-card { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .res-btn.active,
        [data-theme="dark"] .ratio-card.active { 
            background: var(--primary-color) !important; 
            color: var(--bg-color) !important; 
            border-color: var(--primary-color) !important; 
        }
        
        [data-theme="dark"] .mobile-header { 
            background: var(--bg-secondary) !important; 
            border-color: var(--border-color) !important; 
            color: var(--text-main) !important; 
        }
[data-theme="dark"] .shot-img-wrap { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .shot-body { 
            background: var(--card-bg) !important; 
        }
        
        [data-theme="dark"] .shot-title { 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .shot-prompt { 
            background: var(--input-bg) !important; 
            border-color: var(--border-color) !important; 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .shot-footer { 
            background: var(--bg-secondary) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .ref-capsule { 
            background: var(--input-bg) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .add-ref-btn { 
            background: var(--input-bg) !important; 
            border-color: var(--border-color) !important; 
            color: var(--text-sub) !important; 
        }
        
        [data-theme="dark"] .add-ref-btn:hover { 
            background: var(--hover-color) !important; 
            color: var(--text-main) !important; 
        }
[data-theme="dark"] .history-item { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .history-item:hover { 
            background: var(--hover-color) !important; 
        }
/* 主页顶部品牌区域 */
        [data-theme="dark"] .brand-area { 
            color: var(--text-main) !important; 
        }
        
        /* 流式传输开关区域 */
        [data-theme="dark"] label[style*="display: flex"] { 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] div[style*="background: #f8f9fa"] { 
            background: var(--card-bg) !important; 
        }
        
        /* 主页桌面端顶部 */
        [data-theme="dark"] .desktop-header { 
            background: rgba(26, 26, 26, 0.8) !important; 
            backdrop-filter: blur(10px);
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .header-actions { 
            color: var(--text-main) !important; 
        }
/* 小红书分镜卡片 */
        [data-theme="dark"] .shot-card { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .shot-loading { 
            background: rgba(26, 26, 26, 0.9) !important; 
        }
/* 切片工具 */
[data-theme="dark"] .slicer-modal-content { 
            background: var(--card-bg) !important; 
            color: var(--text-main) !important; 
        }
        
        [data-theme="dark"] .slicer-canvas-area { 
            background: var(--input-bg) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .slicer-controls { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
        }
        
        [data-theme="dark"] .slicer-preview-grid { 
            background: var(--input-bg) !important; 
        }
        
        [data-theme="dark"] .slicer-preview-item { 
            background: var(--card-bg) !important; 
            border-color: var(--border-color) !important; 
        }
/* 通用覆盖 - 所有白色背景（排除预览图） */
        [data-theme="dark"] [style*="background:#fff"]:not(.preview-item),
        [data-theme="dark"] [style*="background: #fff"]:not(.preview-item),
        [data-theme="dark"] [style*="background:white"]:not(.preview-item),
        [data-theme="dark"] [style*="background: white"]:not(.preview-item),
        [data-theme="dark"] [style*="background:#ffffff"]:not(.preview-item),
        [data-theme="dark"] [style*="background: #ffffff"]:not(.preview-item) { 
            background: var(--card-bg) !important; 
        }
        
        /* 通用覆盖 - 所有浅灰背景 */
        [data-theme="dark"] [style*="background:#f8f9fa"],
        [data-theme="dark"] [style*="background: #f8f9fa"],
        [data-theme="dark"] [style*="background:#f1f3f4"],
        [data-theme="dark"] [style*="background: #f1f3f4"] { 
            background: var(--input-bg) !important; 
        }
        
        /* 通用覆盖 - 所有深色文字 */
        [data-theme="dark"] [style*="color:#202124"],
        [data-theme="dark"] [style*="color: #202124"],
        [data-theme="dark"] [style*="color:#444"],
        [data-theme="dark"] [style*="color: #444"],
        [data-theme="dark"] [style*="color:#1f1f1f"],
        [data-theme="dark"] [style*="color: #1f1f1f"] { 
            color: var(--text-main) !important; 
        }
        
        /* 通用覆盖 - 所有次要文字 */
        [data-theme="dark"] [style*="color:#5f6368"],
        [data-theme="dark"] [style*="color: #5f6368"],
        [data-theme="dark"] [style*="color:#80868b"],
        [data-theme="dark"] [style*="color: #80868b"],
        [data-theme="dark"] [style*="color:#666"],
        [data-theme="dark"] [style*="color: #666"],
        [data-theme="dark"] [style*="color:#999"],
        [data-theme="dark"] [style*="color: #999"] { 
            color: var(--text-sub) !important; 
        }
        
        /* 通用覆盖 - 所有深色文字 (#333) */
        [data-theme="dark"] [style*="color:#333"],
        [data-theme="dark"] [style*="color: #333"] { 
            color: var(--text-main) !important; 
        }
/* 小红书图片数量输入框 */
/* 通用覆盖 - 所有带边框的输入框 */
        [data-theme="dark"] input[type="number"][style*="border:1px solid #ddd"],
        [data-theme="dark"] input[type="number"][style*="border: 1px solid #ddd"] { 
            background: var(--input-bg) !important; 
            border-color: var(--border-color) !important; 
            color: var(--text-main) !important; 
        }
        
        /* 主题切换按钮 - 移至设置侧边栏 */
        .theme-toggle-btn {
            width: 100%;
            padding: 12px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-main);
            font-weight: 500;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: all 0.2s;
            margin-bottom: 24px;
        }
        .theme-toggle-btn:hover {
            background: var(--hover-color);
            border-color: var(--primary-color);
            color: var(--primary-color);
        }
        .theme-toggle-btn svg {
            width: 18px;
            height: 18px;
            transition: transform 0.3s;
        }
        .theme-toggle-btn:hover svg {
            transform: rotate(20deg);
        }
        .theme-icon-sun { display: none; }
        .theme-icon-moon { display: inline-block; }
        [data-theme="dark"] .theme-icon-sun { display: inline-block; }
        [data-theme="dark"] .theme-icon-moon { display: none; }
        
        @supports (height: 100dvh) { :root { --app-height: 100dvh; } }

        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

        body {
            font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            margin: 0; padding: 0; display: flex; height: var(--app-height); overflow: hidden;
            background-color: var(--bg-color); color: var(--text-main); width: 100%;
        }

        /* 侧边栏样式 */
        .sidebar-nav {
            width: var(--sidebar-width); background-color: var(--bg-secondary); border-right: 1px solid var(--border-color);
            display: flex; flex-direction: column; flex-shrink: 0; height: 100%;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 60; padding-top: 10px;
        }
        
        .new-chat-btn {
            margin: 5px 12px; padding: 12px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px;
            color: var(--text-main); font-weight: 500; cursor: pointer; font-size: 14px;
            display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-sm);
            transition: all 0.2s; flex-shrink: 0; user-select: none;
        }
        .new-chat-btn:hover { background: var(--hover-color); box-shadow: var(--shadow-md); border-color: var(--primary-color); color: var(--primary-color); }
        .new-chat-btn svg { color: var(--text-sub); transition: color 0.2s; }
        .new-chat-btn:hover svg { color: var(--primary-color); }
        .feature-btn { background: linear-gradient(135deg, #fff0f0 0%, #fff 100%); border-color: #fad2cf; color: #d93025; }
        .feature-btn svg { color: #d93025; }
        .feature-btn:hover { background: #fce8e6; border-color: #f9b3b3; }
        .feature-btn:hover svg { color: #b31412; }
        .tool-nav-btn { background: linear-gradient(135deg, #e8f0fe 0%, #fff 100%); border-color: #d2e3fc; color: #1a73e8; }
        .tool-nav-btn svg { color: #1a73e8; }
        .tool-nav-btn:hover { background: #d2e3fc; border-color: #1967d2; }
/* 新的导航卡片样式 */
        .nav-section-title {
            padding: 16px 12px 8px 12px;
            font-size: 11px;
            font-weight: 600;
            color: #5f6368;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
.tool-icon {
            background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
            color: #fff;
        }

        /* 暗黑模式支持 */
        [data-theme="dark"] .nav-section-title {
            color: #9aa0a6;
        }
.session-list { flex: 1; overflow-y: auto; padding: 0 12px; margin-top: 10px; }
        .session-item {
            padding: 10px 12px; margin-bottom: 4px; border-radius: 6px; cursor: pointer; color: #444; font-size: 13px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; justify-content: space-between;
            transition: background 0.15s; position: relative; flex-shrink: 0;
        }
        .session-item:hover { background-color: #eef0f2; }
        .session-item.active { background-color: #e8f0fe; color: #1967d2; font-weight: 500; }
        .session-item.active::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: #1967d2; border-radius: 0 2px 2px 0; }
        .session-delete { opacity: 0; color: #5f6368; padding: 4px; border-radius: 4px; font-size: 16px; line-height: 1; }
        .session-item:hover .session-delete { opacity: 1; }
        .session-delete:hover { background: #dadce0; color: #d93025; }
        .session-loading { font-size: 10px; margin-right: 6px; display: none; }
        .session-item.generating .session-loading { display: inline-block; animation: spin 1s linear infinite; }

        /* 主区域样式 */
        .main-area { flex: 1; display: flex; flex-direction: column; position: relative; background-color: #fff; height: 100%; width: 100%; overflow: hidden; }
        .desktop-header {
            height: var(--header-height); border-bottom: 1px solid var(--border-color);
            display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
            background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); z-index: 10; flex-shrink: 0;
        }
        .brand-area { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; color: #202124; }
        .header-actions { display: flex; gap: 10px; }
        .header-icon-btn {
            width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
            cursor: pointer; color: #5f6368; transition: background 0.2s;
        }
        .header-icon-btn:hover { background: #f1f3f4; color: #202124; }
        .mobile-header {
            display: none; position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
            background: #fff; border-bottom: 1px solid var(--border-color); z-index: 50; align-items: center; padding: 0 20px; justify-content: space-between;
        }

        .chat-container {
            flex: 1; overflow-y: auto; padding: 20px 0 100px 0; display: flex; flex-direction: column; align-items: center;
            scroll-behavior: smooth; width: 100%; -webkit-overflow-scrolling: touch;
        }
        .message-row { width: 100%; max-width: var(--content-max-width); padding: 0 24px; margin-bottom: 24px; display: flex; flex-direction: column; flex-shrink: 0; }
        .message-bubble-container { display: flex; width: 100%; }
        .message-row.user .message-bubble-container { justify-content: flex-end; }
        .message-row.bot .message-bubble-container { justify-content: flex-start; flex-direction: column; align-items: flex-start; width: 100%; }
        .msg-content { padding: 12px 18px; border-radius: 16px; font-size: 15px; line-height: 1.6; word-break: break-word; max-width: 100%; position: relative; }
        .message-row.user .msg-content { background-color: #f0f4f8; border-bottom-right-radius: 4px; max-width: 85%; color: #1f1f1f; }
        .message-row.bot .msg-content { padding: 0; width: 100%; }
        .msg-actions {
            display: flex; gap: 12px; margin-top: 4px; padding: 0 4px; opacity: 0; transition: opacity 0.2s; font-size: 11px; color: #80868b; width: 100%; justify-content: flex-end;
        }
        .message-row:hover .msg-actions { opacity: 1; }
        .action-btn { cursor: pointer; display: flex; align-items: center; gap: 4px; transition: color 0.2s; white-space: nowrap; }
        .action-btn:hover { color: #1a73e8; }

        .empty-state { margin-top: 10vh; text-align: center; color: var(--text-sub); animation: fadeIn 0.5s; padding: 20px; display: flex; flex-direction: column; align-items: center; }
        .google-logo-svg { width: 56px; height: 56px; margin-bottom: 16px; }
        .brand-logo-small { width: 24px; height: 24px; margin-right: 4px; }

        .input-container-outer {
            position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--content-max-width);
            padding: 0 20px; display: flex; flex-direction: column; align-items: center; z-index: 20; pointer-events: none;
        }
        .input-wrapper {
            width: 100%; background: var(--input-bg); border-radius: 24px;
            display: flex; align-items: flex-end; padding: 10px 12px; 
            transition: background 0.2s, box-shadow 0.2s, border-color 0.2s; border: 1px solid transparent; min-height: 52px;
            pointer-events: auto; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }
        .input-wrapper:focus-within { background: #fff; border-color: #dadce0; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
        .input-wrapper.drag-over { 
            background: var(--hover-color) !important; 
            border-color: var(--primary-color) !important; 
            box-shadow: 0 4px 20px rgba(26, 115, 232, 0.2) !important; 
        }
        textarea {
            flex: 1; border: none; background: transparent; padding: 0 8px; margin-bottom: 2px;
            font-size: 16px; resize: none; height: 24px; max-height: 150px;
            outline: none; font-family: inherit; color: var(--text-main); line-height: 24px; overflow-y: auto;
        }
        #file-input { display: none; }
        .icon-btn {
            width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
            cursor: pointer; color: #5f6368; border-radius: 50%; flex-shrink: 0;
            transition: background 0.2s, color 0.2s; margin-bottom: -3px;
        }
        .icon-btn:hover { background: rgba(0,0,0,0.06); color: #202124; }
        .send-btn { color: var(--primary-color); opacity: 0.4; pointer-events: none; }
        .send-btn.active { opacity: 1; pointer-events: auto; }

        .preview-area {
            width: 100%; display: flex; gap: 8px; overflow-x: auto; padding: 0 4px 8px 4px; min-height: 0; transition: all 0.3s; opacity: 0; pointer-events: none;
        }
        .preview-area.has-images { opacity: 1; pointer-events: auto; }
        .preview-item {
            position: relative; width: 56px; height: 56px; border-radius: 8px; border: 1px solid #dadce0; background-size: cover; background-position: center; flex-shrink: 0; background-color: #fff;
        }
        .preview-close {
            position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; background: #5f6368; color: white; border-radius: 50%; font-size: 12px;
            display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid #fff; z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
        }

        /* 设置侧边栏 */
        .settings-sidebar {
            width: 320px; background-color: white; border-left: 1px solid var(--border-color); display: block; height: 100%; overflow-y: auto; flex-shrink: 0;
            position: relative; z-index: 40; transition: transform 0.3s ease;
        }
        .settings-inner { padding: 24px; display: flex; flex-direction: column; min-height: 100%; }
        .config-label { font-size: 13px; color: #5f6368; margin-bottom: 10px; display: block; font-weight: 600; letter-spacing: 0.5px; }
        .provider-collapse { border: 1px solid #dadce0; border-radius: 8px; margin-bottom: 16px; overflow: hidden; flex-shrink: 0; }
        .provider-collapse summary {
            padding: 12px 16px; background: #f8f9fa; cursor: pointer; font-size: 13px; font-weight: 600; color: #444;
            display: flex; justify-content: space-between; align-items: center; outline: none;
        }
        .provider-collapse summary:hover { background: #f1f3f4; }
        .provider-collapse[open] summary { border-bottom: 1px solid #dadce0; }
        .provider-content { padding: 16px; background: #fff; }
        .provider-selector, .api-input-group input, .config-input { width: 100%; padding: 8px; border: 1px solid #dadce0; border-radius: 6px; font-size: 12px; margin-bottom: 10px; }
        .provider-list { max-height: 120px; overflow-y: auto; margin-bottom: 15px; border: 1px solid #eee; border-radius: 6px; background: #fff; }
        .provider-item { padding: 8px 12px; font-size: 12px; border-bottom: 1px solid #f1f1f1; cursor: pointer; display: flex; justify-content: space-between; }
        .provider-item:hover { background: #f1f3f4; }
        .provider-item.selected { background: #e8f0fe; color: #1a73e8; }
        .action-row { display: flex; gap: 8px; }
        .config-btn { flex: 1; padding: 6px; border: 1px solid #dadce0; border-radius: 4px; cursor: pointer; font-size: 12px; background: #fff; color: #444; }
        .config-btn.primary { background: #1a73e8; color: white; border-color: #1a73e8; }
        .config-btn.danger { color: #d93025; border-color: #fce8e6; }
        .res-selector { display: flex; gap: 8px; margin-bottom: 24px; flex-shrink: 0; }
        .res-btn { flex: 1; padding: 8px 0; text-align: center; border: 1px solid #dadce0; border-radius: 6px; font-size: 12px; cursor: pointer; color: #444; }
        .res-btn.active { border-color: #1a73e8; background-color: #e8f0fe; color: #1a73e8; font-weight: 500; }
        .ratio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; flex-shrink: 0; }
        .ratio-card { border: 1px solid #dadce0; border-radius: 8px; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; background: #fff; }
        .ratio-card.active { border-color: #1a73e8; background-color: #e8f0fe; }
        .icon-box { border: 2px solid #9aa0a6; margin-bottom: 4px; border-radius: 2px; box-sizing: content-box; }
        .ratio-card.active .icon-box { border-color: #1a73e8; }
        .ratio-text { font-size: 10px; color: #5f6368; }
        
        .icon-auto { width: 14px; height: 14px; border-style: dashed; }
        .icon-1-1 { width: 14px; height: 14px; }
        .icon-21-9 { width: 20px; height: 8px; }
        .icon-16-9 { width: 18px; height: 10px; }
        .icon-4-3 { width: 16px; height: 12px; }
        .icon-3-2 { width: 18px; height: 12px; }
        .icon-5-4 { width: 15px; height: 12px; }
        .icon-9-16 { width: 10px; height: 18px; }
        .icon-3-4 { width: 12px; height: 16px; }
        .icon-2-3 { width: 12px; height: 18px; }
        .icon-4-5 { width: 12px; height: 15px; }

        .generated-image { max-height: 400px; width: auto; max-width: 100%; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); cursor: zoom-in; border: 1px solid #f0f0f0; display: block; }
        .img-result-group { display: flex; flex-direction: column; align-items: flex-start; margin-top: 8px; width: 100%; }
        details.thought-box { background: #f8f9fa; border: 1px solid #eee; border-radius: 8px; margin-bottom: 8px; overflow: hidden; width: 100%; display: block; clear: both;}
        details.thought-box summary { padding: 10px 14px; cursor: pointer; font-size: 13px; color: #5f6368; font-weight: 500; display: flex; align-items: center; outline: none; }
        details.thought-box summary::-webkit-details-marker { display: none; }
        details.thought-box summary::before { content: '▶'; font-size: 10px; margin-right: 8px; transition: transform 0.2s; display: inline-block; color: #999; }
        details.thought-box[open] summary::before { transform: rotate(90deg); }
        .thought-content { padding: 12px 16px; font-size: 13px; line-height: 1.6; color: #444; border-top: 1px solid #eee; font-family: monospace; white-space: pre-wrap; background-color: #fff; }
        .btn-group { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;}
        .tool-btn { 
            display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; 
            background: #fff; color: #5f6368; border: 1px solid #dadce0; 
            border-radius: 16px; font-size: 12px; text-decoration: none; cursor: pointer; transition: all 0.2s; font-weight: 500;
        }
        .tool-btn:hover { background: #f8f9fa; color: #1a73e8; border-color: #d2e3fc; }
        .tool-btn.download { color: #1a73e8; border-color: #dadce0; }
/* Lightbox & Overlay */
        .lightbox-overlay { display: none; position: fixed; z-index: 4000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); justify-content: center; align-items: center; }
        .lightbox-overlay.active { display: flex; animation: fadeIn 0.2s; }
        .lightbox-img { max-width: 95vw; max-height: 95vh; object-fit: contain; border-radius: 4px; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
        .lightbox-close { position: absolute; top: 24px; right: 24px; color: white; font-size: 32px; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; }
        
        .overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 30; display: none; backdrop-filter: blur(2px); }
        .overlay.active { display: block; }
        .loading-spinner { width: 20px; height: 20px; border: 2px solid #e0e0e0; border-top-color: var(--primary-color); border-radius: 50%; animation: spin 0.8s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.config-group { margin-bottom: 12px; }
        .config-group label { display: block; font-size: 11px; color: #666; margin-bottom: 4px; }
/* 3. 右侧视觉墙 */
.shot-grid { 
    padding: 24px; 
    overflow-y: auto; 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 16px;
}

@media (min-width: 1600px) { 
    .shot-grid { 
        grid-template-columns: repeat(3, 1fr);
    } 
}

@media (max-width: 1024px) {
    .shot-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}

/* 分镜卡片 & 垫图胶囊 */
.shot-card { 
    background: #fff; 
    border-radius: 12px; 
    border: 1px solid #eee; 
    overflow: visible; 
    display: flex; 
    flex-direction: column; 
    transition: all 0.2s; 
    position: relative;
}
.shot-card:hover { border-color: #ffcc00; box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }

.shot-img-wrap {
    width: 100%;
    aspect-ratio: 3/4;
    background: #f0f2f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
    border-radius: 12px 12px 0 0;
}

/* 关键修改：图片默认显示，用透明度控制显隐 */
.shot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.shot-img[src]:not([src=""]) {
    opacity: 1;
}

.shot-card:hover .shot-img { transform: scale(1.02); }

/* 小屏下：单列 & 图片高度自适应，避免被裁切 / 完全看不到 */
@media (max-width: 768px) {
    .shot-grid {
        grid-template-columns: 1fr;
    }
    .shot-img-wrap {
        aspect-ratio: auto;
        height: auto;
    }
    .shot-img {
        height: auto;
    }
}

        /* 错误提示 */
        .shot-error { position: absolute; inset: 0; background: rgba(255,255,255,0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; color: #d93025; font-size: 12px; z-index: 5; }

        /* 美化垫图控件 (胶囊样式) */
        .ref-capsule {
            position: absolute; top: 8px; left: 8px; z-index: 20;
            background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(4px);
            border-radius: 20px; padding: 4px 4px 4px 4px;
            display: flex; align-items: center; gap: 6px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15); border: 1px solid rgba(0,0,0,0.05);
            transition: all 0.2s; max-width: 140px;
        }
        .ref-capsule:hover { background: #fff; transform: scale(1.02); }
        .ref-thumb { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; flex-shrink: 0; }
        .ref-info { font-size: 10px; font-weight: 600; color: #555; margin-right: 2px; white-space: nowrap; }
        .ref-actions { display: flex; gap: 2px; border-left: 1px solid #eee; padding-left: 4px; }
        .ref-icon-btn { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #666; transition: background 0.2s; }
        .ref-icon-btn:hover { background: #f0f0f0; color: #1a73e8; }
        .ref-icon-btn.del:hover { color: #d93025; background: #fee; }

        /* 无垫图时的添加按钮 */
        .add-ref-btn {
            position: absolute; top: 8px; left: 8px; z-index: 20;
            background: rgba(0,0,0,0.05); border: 1px dashed #999; color: #555;
            border-radius: 20px; padding: 4px 10px; font-size: 11px; cursor: pointer;
            display: flex; align-items: center; gap: 4px; transition: all 0.2s;
        }
        .add-ref-btn:hover { background: #fff; border-color: var(--primary-color); color: var(--primary-color); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

        .shot-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
        .shot-title { font-weight: 700; font-size: 13px; color: #202124; display: flex; justify-content: space-between; }
        .shot-prompt { width: 100%; border: 1px solid #eee; background: #f9f9f9; border-radius: 6px; padding: 8px; font-size: 12px; color: #555; min-height: 60px; resize: vertical; outline: none; }
        .shot-prompt:focus { background: #fff; border-color: #ddd; }

        .shot-footer { display: flex; justify-content: space-between; margin-top: auto; padding-top: 8px; }
        .action-pill { padding: 4px 12px; border-radius: 12px; font-size: 11px; cursor: pointer; background: #fff; border: 1px solid #ddd; color: #555; display: flex; align-items: center; gap: 4px; }
        .action-pill:hover { border-color: var(--primary-color); color: var(--primary-color); background: #f0f7ff; }

        .shot-loading { color: #999; font-size: 13px; display: none; flex-direction: column; align-items: center; gap: 8px;}

        /* 触摸反馈 - 移动设备 */
        @media (hover: none) and (pointer: coarse) {
/* 标签页和列表项 */
/* 卡片类 */
/* 输入框和选择器 */
}
/* 响应式 */
        @media (max-width: 1024px) {
.shot-grid { 
                grid-template-columns: 1fr;
                padding: 16px;
            }
}
.radio-label { padding: 6px 12px; cursor: pointer; font-size: 13px; color: #5f6368; border-radius: 6px; transition: all 0.2s; font-weight: 500; display: flex; align-items: center; gap: 6px; }
        .radio-label:hover { color: #202124; background: rgba(255,255,255,0.5); }
        .radio-label input { margin: 0; }
        .radio-label.active { background: #fff; color: #1a73e8; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.split-line { position: absolute; background-color: #1a73e8; z-index: 10; pointer-events: auto; touch-action: none; }
        .split-line.horizontal { width: 100%; height: 2px; cursor: row-resize; }
        .split-line.horizontal::after { content: ''; position: absolute; top: -10px; bottom: -10px; width: 100%; left: 0; }
        .split-line.vertical { height: 100%; width: 2px; cursor: col-resize; }
        .split-line.vertical::after { content: ''; position: absolute; left: -10px; right: -10px; height: 100%; top: 0; }
        .delete-btn-line { position: absolute; width: 28px; height: 28px; background: #d93025; color: white; border-radius: 50%; text-align: center; line-height: 26px; font-size: 16px; cursor: pointer; z-index: 12; display: none; box-shadow: 0 2px 4px rgba(0,0,0,0.2); border: 2px solid white; }
        .split-line:hover .delete-btn-line, .split-line:active .delete-btn-line { display: block; }
.download-hint { position: absolute; inset: 0; background: rgba(26, 115, 232, 0.05); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
/* Toast 增强版 */
        .toast-msg {
            position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
            background: #333; color: white; padding: 12px 24px; border-radius: 30px;
            font-size: 14px; z-index: 5000; display: none; animation: fadeIn 0.3s;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            max-width: 90%;
            word-wrap: break-word;
        }
        .toast-msg.success { background: #1e8e3e; }
        .toast-msg.error { background: #d93025; }
        .toast-msg.warning { background: #f9ab00; }
        .toast-msg.info { background: #1a73e8; }

        /* 全局加载遮罩 */
        .global-loading {
            position: fixed;
            inset: 0;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(4px);
            z-index: 9999;
            display: none;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            gap: 16px;
        }
        .global-loading.active { display: flex; }
        .global-loading-spinner {
            width: 48px;
            height: 48px;
            border: 4px solid #e0e0e0;
            border-top-color: var(--primary-color);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        .global-loading-text {
            font-size: 14px;
            color: #5f6368;
            font-weight: 500;
        }

        /* 进度条 */
        .progress-bar-container {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: #e0e0e0;
            z-index: 9998;
            display: none;
        }
        .progress-bar-container.active { display: block; }
        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-color), #4285f4);
            width: 0%;
            transition: width 0.3s ease;
        }

        /* 错误提示卡片 */
        .error-card {
            background: #fce8e6;
            border: 1px solid #f9b3b3;
            border-radius: 8px;
            padding: 16px;
            margin: 16px 0;
            display: none;
            animation: fadeIn 0.3s;
        }
        .error-card.active { display: block; }
        .error-card-title {
            font-weight: 600;
            color: #d93025;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .error-card-message {
            font-size: 13px;
            color: #5f6368;
            line-height: 1.5;
        }
        .error-card-actions {
            margin-top: 12px;
            display: flex;
            gap: 8px;
        }
        .error-card-btn {
            padding: 6px 16px;
            border-radius: 6px;
            border: 1px solid #d93025;
            background: white;
            color: #d93025;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            transition: all 0.2s;
        }
        .error-card-btn:hover {
            background: #d93025;
            color: white;
        }


        @media (max-width: 768px) {
            body { flex-direction: column; }
            .mobile-header { display: flex; }
            .desktop-header { display: none; }
            .sidebar-nav { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); box-shadow: 5px 0 15px rgba(0,0,0,0.1); padding-top: 0; }
            .sidebar-nav.open { transform: translateX(0); }
            .settings-sidebar { position: fixed; right: 0; top: 0; bottom: 0; transform: translateX(100%); box-shadow: -5px 0 15px rgba(0,0,0,0.1); padding-top: 20px; }
            .settings-sidebar.open { transform: translateX(0); }
            .main-area { height: 100%; padding-top: var(--header-height); display: flex; flex-direction: column; }
            .input-container-outer { padding: 0 16px; bottom: 20px; padding-bottom: env(safe-area-inset-bottom); }
            .chat-container { padding: 20px 0 120px 0; }
            .message-row { padding: 0 16px; }
.delete-btn-line { display: block; transform: scale(0.8); opacity: 0.8; }
}


