        /* ========== CSS变量系统 - iOS 苹果风格 ========== */
        :root {
            /* === 深色模式背景色 === */
            --bg-primary: #1c1c1e;
            --bg-secondary: #2c2c2e;
            --bg-tertiary: #3a3a3c;
            --bg-hover: #48484a;
            --bg-active: rgba(0, 122, 255, 0.15);
            
            /* === iOS 功能强调色（9色系统） === */
            --accent-blue: #007aff;
            --accent-green: #34c759;
            --accent-orange: #ff9500;
            --accent-pink: #ff2d55;
            --accent-purple: #af52de;
            --accent-red: #ff3b30;
            --accent-teal: #5ac8fa;
            --accent-yellow: #ffcc00;
            --accent-indigo: #5856d6;
            --accent-gray: #8e8e93;
            
            /* === 主强调色（向后兼容） === */
            --accent-primary: var(--accent-blue);
            --accent-hover: #0051d5;
            --accent-active: #0040a8;
            --accent-disabled: #c7c7cc;
            
            /* === 深色模式文字颜色 === */
            --text-primary: #ffffff;
            --text-secondary: rgba(255, 255, 255, 0.85);
            --text-tertiary: rgba(255, 255, 255, 0.60);
            --text-muted: rgba(255, 255, 255, 0.30);
            --text-inverse: #000000;
            
            /* === 深色模式分隔线 === */
            --separator: #48484a;
            --separator-opaque: #3a3a3c;
            
            /* === 深色模式填充色 === */
            --fill-primary: rgba(120, 120, 128, 0.40);
            --fill-secondary: rgba(120, 120, 128, 0.32);
            --fill-tertiary: rgba(118, 118, 128, 0.24);
            
            /* === 语义色（iOS 系统色） === */
            --success: #34c759;
            --warning: #ff9500;
            --error: #ff3b30;
            --info: #007aff;
            
            /* === 系统字体 === */
            --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
            --font-mono: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
            
            /* === iOS 圆角 === */
            --radius-sm: 8px;
            --radius-md: 10px;
            --radius-lg: 12px;
            --radius-xl: 14px;
            
            /* === iOS 过渡动画 === */
            --transition-fast: 100ms cubic-bezier(0.4, 0.0, 0.2, 1);
            --transition-normal: 250ms cubic-bezier(0.4, 0.0, 0.2, 1);
            --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
            --animation-bounce: var(--transition-spring);
        }
        
        /* ========== 丰富动画关键帧 ========== */
        
        /* 面板入场动画 */
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        @keyframes fadeInScale {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }
        
        /* 加载动画 */
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        @keyframes shimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }
        
        @keyframes progressGlow {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        /* 涟漪效果 */
        @keyframes ripple {
            to {
                transform: scale(4);
                opacity: 0;
            }
        }
        
        /* 状态脉冲 */
        @keyframes successPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4); }
            50% { box-shadow: 0 0 0 10px rgba(52, 199, 89, 0); }
        }
        
        @keyframes warningPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.4); }
            50% { box-shadow: 0 0 0 10px rgba(255, 149, 0, 0); }
        }
        
        @keyframes errorPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
            50% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
        }
        
        /* 呼吸效果 */
        @keyframes breathe {
            0%, 100% { opacity: 0.6; }
            50% { opacity: 1; }
        }
        
        /* 弹性入场 */
        @keyframes bounceIn {
            0% { opacity: 0; transform: scale(0.3); }
            50% { transform: scale(1.05); }
            70% { transform: scale(0.9); }
            100% { opacity: 1; transform: scale(1); }
        }
        
        /* 滑动入场 */
        @keyframes slideInRight {
            0% { transform: translateX(100%); opacity: 0; }
            70% { transform: translateX(-10px); }
            100% { transform: translateX(0); opacity: 1; }
        }
        
        @keyframes slideOutRight {
            to { transform: translateX(100%); opacity: 0; }
        }
        
        /* 数字滚动 */
        @keyframes countUp {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        /* 背景特效 */
        @keyframes gradientFlow {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        @keyframes gridPulse {
            0%, 100% { opacity: 0.2; }
            50% { opacity: 0.5; }
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
        }
        
        /* ========== 增强动画关键帧 ========== */

        /* API Key 配额显示 */
        .quota-display {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--bg-tertiary);
            border-radius: var(--radius-md);
            font-size: 13px;
            color: var(--accent-orange);
            font-weight: 500;
        }

        .quota-display i {
            width: 14px;
            height: 14px;
        }

        /* 登出按钮 */
        .btn-logout {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            background: var(--bg-tertiary);
            border: none;
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .btn-logout:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        /* API Key 鉴权弹窗 */
        .auth-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            z-index: 10000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.2s ease-out;
        }

        .auth-modal.show {
            display: flex;
        }

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

        .auth-modal-content {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            padding: 32px;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            animation: fadeInScale 0.25s ease-out;
        }

        @keyframes fadeInScale {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        .auth-modal-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
        }

        .auth-modal-header i {
            width: 28px;
            height: 28px;
            color: var(--accent-blue);
        }

        .auth-modal-header h2 {
            font-size: 20px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0;
        }

        .auth-modal-body {
            margin-bottom: 24px;
        }

        .auth-hint {
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 16px;
        }

        .auth-input {
            width: 100%;
            padding: 14px 16px;
            background: var(--bg-primary);
            border: 1px solid var(--separator);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-size: 15px;
            font-family: var(--font-mono);
            outline: none;
            transition: border-color var(--transition-fast);
        }

        .auth-input:focus {
            border-color: var(--accent-blue);
        }

        .auth-input::placeholder {
            color: var(--text-muted);
        }

        .auth-error {
            color: var(--accent-red);
            font-size: 13px;
            margin-top: 12px;
            min-height: 20px;
        }

        .auth-modal-footer {
            display: flex;
            justify-content: flex-end;
        }

        .btn-auth {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 24px;
            background: var(--accent-blue);
            border: none;
            border-radius: var(--radius-md);
            color: white;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .btn-auth:hover {
            background: var(--accent-hover);
        }

        .btn-auth:active {
            transform: scale(0.98);
        }

        .btn-auth i {
            width: 16px;
            height: 16px;
        }

        /* 禁用状态的按钮样式 */
        .btn-tool:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        /* 页面锁定遮罩 */
        .page-locked .toolbar .btn-tool,
        .page-locked .toolbar input,
        .page-locked .toolbar label {
            pointer-events: none;
            opacity: 0.3;
        }

        .page-locked .canvas-container {
            pointer-events: none;
        }
        
        /* 涟漪效果 */
        @keyframes rippleEffect {
            to {
                transform: scale(4);
                opacity: 0;
            }
        }
        
        /* 状态脉冲 - 增强版 */
        @keyframes successPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.4); }
            50% { box-shadow: 0 0 0 15px rgba(52, 199, 89, 0); }
        }
        
        @keyframes warningPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.4); }
            50% { box-shadow: 0 0 0 15px rgba(255, 149, 0, 0); }
        }
        
        @keyframes errorPulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
            50% { box-shadow: 0 0 0 15px rgba(255, 59, 48, 0); }
        }
        
        /* 呼吸效果 - 增强版 */
        @keyframes breathe {
            0%, 100% { opacity: 0.6; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.05); }
        }
        
        /* 数字滚动动画 */
        @keyframes countUp {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        /* 光标闪烁 */
        @keyframes cursorBlink {
            0%, 100% { border-right-color: var(--accent-blue); }
            50% { border-right-color: transparent; }
        }
        
        /* 文字渐变动画 */
        @keyframes textGradient {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        /* 3D 翻转效果 */
        @keyframes flipIn {
            from {
                transform: perspective(400px) rotateY(90deg);
                opacity: 0;
            }
            to {
                transform: perspective(400px) rotateY(0);
                opacity: 1;
            }
        }
        
        /* 弹性弹出 */
        @keyframes popIn {
            0% { transform: scale(0); opacity: 0; }
            70% { transform: scale(1.1); }
            100% { transform: scale(1); opacity: 1; }
        }
        
        /* 摇摆效果 */
        @keyframes wobble {
            0%, 100% { transform: translateX(0); }
            15% { transform: translateX(-10px) rotate(-5deg); }
            30% { transform: translateX(8px) rotate(3deg); }
            45% { transform: translateX(-6px) rotate(-3deg); }
            60% { transform: translateX(4px) rotate(2deg); }
            75% { transform: translateX(-2px) rotate(-1deg); }
        }
        
        /* 抖动效果 */
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
            20%, 40%, 60%, 80% { transform: translateX(5px); }
        }
        
        /* 心跳效果 */
        @keyframes heartbeat {
            0%, 100% { transform: scale(1); }
            14% { transform: scale(1.1); }
            28% { transform: scale(1); }
            42% { transform: scale(1.1); }
            70% { transform: scale(1); }
        }
        
        /* 闪烁效果 */
        @keyframes flash {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }
        
        /* 旋转进入 */
        @keyframes rotateIn {
            from {
                transform: rotate(-180deg) scale(0);
                opacity: 0;
            }
            to {
                transform: rotate(0) scale(1);
                opacity: 1;
            }
        }
        
        /* 弹跳 */
        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-20px); }
        }
        
        /* 果冻效果 */
        @keyframes jelly {
            0%, 100% { transform: scale(1, 1); }
            25% { transform: scale(0.9, 1.1); }
            50% { transform: scale(1.1, 0.9); }
            75% { transform: scale(0.95, 1.05); }
        }
        
        /* 发光脉冲 */
        @keyframes glowPulse {
            0%, 100% { box-shadow: 0 0 5px var(--accent-blue), 0 0 10px var(--accent-blue); }
            50% { box-shadow: 0 0 20px var(--accent-blue), 0 0 30px var(--accent-blue), 0 0 40px var(--accent-blue); }
        }
        
        /* 扫描线效果 */
        @keyframes scanline {
            0% { transform: translateY(-100%); }
            100% { transform: translateY(100%); }
        }
        
        /* 故障效果 */
        @keyframes glitch {
            0% { transform: translate(0); }
            20% { transform: translate(-2px, 2px); }
            40% { transform: translate(-2px, -2px); }
            60% { transform: translate(2px, 2px); }
            80% { transform: translate(2px, -2px); }
            100% { transform: translate(0); }
        }
        
        /* 缩放脉冲 */
        @keyframes scalePulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }
        
        /* 摇摆灯光 */
        @keyframes swing {
            0%, 100% { transform: rotate(0deg); }
            25% { transform: rotate(5deg); }
            75% { transform: rotate(-5deg); }
        }
        
        /* ========== 动画类 ========== */
        
        .animate-fade-in {
            animation: fadeIn 0.5s ease forwards;
        }
        
        .animate-fade-in-up {
            animation: fadeInUp 0.5s ease forwards;
        }
        
        .animate-fade-in-scale {
            animation: fadeInScale 0.5s ease forwards;
        }
        
        .animate-slide-in-right {
            animation: slideInRight 0.5s ease forwards;
        }
        
        .animate-bounce-in {
            animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
        }
        
        .animate-pop-in {
            animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }
        
        .animate-flip-in {
            animation: flipIn 0.5s ease forwards;
        }
        
        .animate-rotate-in {
            animation: rotateIn 0.5s ease forwards;
        }
        
        .animate-shake {
            animation: shake 0.5s ease;
        }
        
        .animate-wobble {
            animation: wobble 1s ease;
        }
        
        .animate-jelly {
            animation: jelly 0.5s ease;
        }
        
        .animate-heartbeat {
            animation: heartbeat 1.5s ease-in-out infinite;
        }
        
        .animate-flash {
            animation: flash 1s ease infinite;
        }
        
        .animate-bounce {
            animation: bounce 1s ease infinite;
        }
        
        .animate-swing {
            animation: swing 1s ease infinite;
        }
        
        .animate-glow-pulse {
            animation: glowPulse 2s ease-in-out infinite;
        }
        
        .animate-scale-pulse {
            animation: scalePulse 2s ease-in-out infinite;
        }
        
        .animate-float {
            animation: float 3s ease-in-out infinite;
        }
        
        .animate-breathe {
            animation: breathe 2s ease-in-out infinite;
        }
        
        .animate-spin {
            animation: spin 1s linear infinite;
        }
        
        .animate-shimmer {
            background: linear-gradient(90deg, var(--fill-tertiary) 25%, var(--fill-secondary) 50%, var(--fill-tertiary) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
        }
        
        /* 延迟类 */
        .delay-100 { animation-delay: 100ms; }
        .delay-200 { animation-delay: 200ms; }
        .delay-300 { animation-delay: 300ms; }
        .delay-400 { animation-delay: 400ms; }
        .delay-500 { animation-delay: 500ms; }
        .delay-600 { animation-delay: 600ms; }
        .delay-700 { animation-delay: 700ms; }
        .delay-800 { animation-delay: 800ms; }
        
        /* 持续时间类 */
        .duration-200 { animation-duration: 200ms; }
        .duration-300 { animation-duration: 300ms; }
        .duration-500 { animation-duration: 500ms; }
        .duration-700 { animation-duration: 700ms; }
        .duration-1000 { animation-duration: 1000ms; }
        
        /* ========== 交互增强样式 ========== */
        
        /* 3D 卡片效果 */
        .card-3d {
            transform-style: preserve-3d;
            transition: transform 0.3s ease;
        }
        
        .card-3d:hover {
            transform: perspective(1000px) rotateX(2deg) rotateY(2deg) scale3d(1.02, 1.02, 1.02);
        }
        
        /* 磁吸按钮 */
        .btn-magnetic {
            transition: transform 0.2s ease;
        }
        
        /* 涟漪效果容器 */
        .ripple-container {
            position: relative;
            overflow: hidden;
        }
        
        .ripple {
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.4);
            transform: scale(0);
            animation: rippleEffect 0.6s ease-out;
            pointer-events: none;
        }
        
        /* 发光效果 */
        .glow-effect {
            transition: box-shadow 0.3s ease;
        }
        
        .glow-effect:hover {
            box-shadow: 0 0 30px rgba(0, 122, 255, 0.3), 0 0 60px rgba(0, 122, 255, 0.1);
        }
        
        /* 文字渐变动画 */
        .animated-gradient-text {
            background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple), var(--accent-teal), var(--accent-blue));
            background-size: 300% 100%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: textGradient 4s ease infinite;
        }
        
        /* 悬浮阴影 */
        .hover-lift {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        
        .hover-lift:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }
        
        /* 边框发光 */
        .border-glow {
            position: relative;
        }
        
        .border-glow::before {
            content: '';
            position: absolute;
            inset: -2px;
            background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-teal), var(--accent-blue));
            background-size: 300% 300%;
            border-radius: inherit;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s ease;
            animation: textGradient 3s ease infinite;
        }
        
        .border-glow:hover::before {
            opacity: 1;
        }
        
        /* 玻璃态效果 */
        .glass-effect {
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        /* 霓虹效果 */
        .neon-effect {
            text-shadow: 0 0 5px var(--accent-blue), 0 0 10px var(--accent-blue), 0 0 20px var(--accent-blue);
        }
        
        /* 扫描线叠加 */
        .scanline-overlay {
            position: relative;
            overflow: hidden;
        }
        
        .scanline-overlay::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 100%;
            background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
            background-size: 100% 4px;
            pointer-events: none;
            animation: scanline 8s linear infinite;
        }
        
        /* ========== 基础重置 ========== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        html {
            height: 100%;
            overflow: hidden;
        }
        
        body {
            font-family: var(--font-family);
            background: var(--bg-secondary);
            color: var(--text-primary);
            height: 100vh;
            display: flex;
            flex-direction: column;
            line-height: 1.47059;
            letter-spacing: -0.022em;
            overflow: hidden;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        
        /* ========== 头部导航 - iOS 风格 ========== */
        .header {
            background: var(--bg-tertiary);
            padding: 8px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
            /* 完全扁平，无边框和阴影 */
        }
        
        .header-brand {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .header h1 {
            font-size: 20px;
            font-weight: 700;
            letter-spacing: -0.021em;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .header-brand svg {
            color: var(--accent-blue);
            width: 24px;
            height: 24px;
        }
        
        .header-status {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        
        .header .status {
            font-size: 15px;
            font-weight: 500;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .status-indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--success);
            /* 无发光效果 */
        }
        
        .status-indicator.warning {
            background: var(--warning);
        }
        
        .status-indicator.error {
            background: var(--error);
        }
        
        .status-indicator.loading {
            background: var(--accent-blue);
            animation: spin 1s linear infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.7; transform: scale(0.95); }
        }
        
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        /* ========== 主容器 ========== */
        .container {
            padding: 0;
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        
        /* ========== 工具栏设计 - iOS 风格 ========== */
        .toolbar {
            background: var(--bg-primary);
            padding: 8px 12px;
            border-radius: var(--radius-lg);
            margin-bottom: 8px;
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
            flex-shrink: 0;
            /* 完全扁平，无边框和阴影 */
        }
        
        .toolbar-group {
            display: flex;
            gap: 8px;
            align-items: center;
            padding: 0 12px;
            border-right: 1px solid var(--separator-opaque);
        }
        
        .toolbar-group:last-child {
            border-right: none;
            margin-right: auto;
        }
        
        /* iOS 风格按钮基础样式 */
        .toolbar button,
        .toolbar label {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 16px;
            border-radius: var(--radius-md);
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: transform var(--transition-fast), opacity var(--transition-fast);
            border: none;
            white-space: nowrap;
            /* 完全扁平 */
        }
        
        .toolbar button:active:not(:disabled),
        .toolbar label:active {
            transform: scale(0.96);
            opacity: 0.8;
        }
        
        .toolbar button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        
        .toolbar button svg,
        .toolbar label svg {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }
        
        /* 工具栏按钮统一灰色 */
        .toolbar button,
        .toolbar label {
            background: var(--fill-secondary);
            color: var(--text-primary);
        }
        
        /* 激活状态 - 蓝色高亮 */
        .toolbar button.active {
            background: var(--accent-blue);
            color: white;
        }
        
        /* 禁用状态 */
        .toolbar button:disabled {
            opacity: 0.4;
        }
        
        /* 激活状态 */
        .toolbar button.active {
            background: var(--bg-active);
            color: var(--accent-blue);
        }
        
        /* 快捷键标签 */
        .kbd-hint {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-tertiary);
            margin-left: 4px;
            font-family: var(--font-mono);
        }
        
        /* 文件输入隐藏 */
        .toolbar .file-input {
            display: none;
        }
        
        /* ========== 工作区布局 ========== */
        .workspace {
            display: grid;
            grid-template-columns: 1fr 2fr;
            grid-template-rows: 1fr 1fr;
            gap: 2px;
            max-width: 100%;
            padding: 0;
            margin: 0;
            flex: 1;
            overflow: hidden;
            align-items: stretch;
            min-height: 0;
        }

        .left-panels {
            display: flex;
            flex-direction: column;
            gap: 2px;
            grid-row: span 2;
            height: 100%;
            min-height: 0;
            overflow: hidden;
        }
        
        .left-panels .panel {
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        /* 右侧工作区面板：占满高度，与左侧对齐 */
        .workspace .panel.workarea-panel {
            height: 100%;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        .workspace .panel.workarea-panel .canvas-container {
            flex: 1;
            display: flex;
            min-height: 0;
        }

        .workspace .panel.workarea-panel .canvas-wrapper {
            flex: 1;
            min-height: 0;
        }

        /* 工作区 canvas - 使用实际像素尺寸，不用CSS缩放 */
        #canvasFinal {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }
        
        /* ========== 面板设计 - iOS 风格 ========== */
        .panel {
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            padding: 0;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            min-height: 0;
            /* 完全扁平，无边框和阴影 */
        }
        
        .panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background: var(--bg-secondary);
            border-bottom: 0.5px solid var(--separator);
            flex-shrink: 0;
        }
        
        .panel h3 {
            display: flex;
            align-items: center;
            gap: 10px;
            color: var(--text-primary);
            font-size: 18px;
            font-weight: 600;
            letter-spacing: -0.021em;
            margin: 0;
        }
        
        .panel h3 svg {
            width: 18px;
            height: 18px;
            color: var(--accent-blue);
        }
        
        .panel-badge {
            font-size: 12px;
            font-weight: 700;
            padding: 4px 10px;
            border-radius: 100px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        /* Badge 颜色变体 */
        .badge-blue {
            background: rgba(0, 122, 255, 0.15);
            color: var(--accent-blue);
        }
        
        .badge-green {
            background: rgba(52, 199, 89, 0.15);
            color: var(--accent-green);
        }
        
        .badge-orange {
            background: rgba(255, 149, 0, 0.15);
            color: var(--accent-orange);
        }
        
        .badge-gray {
            background: var(--fill-secondary);
            color: var(--text-secondary);
        }
        
        .canvas-container {
            position: relative;
            width: 100%;
            background: var(--bg-secondary);
            border-radius: 0;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 0;
            flex: 1;
            padding: 8px;
        }
        
        .canvas-container.has-image {
            cursor: crosshair;
        }
        
        .canvas-wrapper {
            position: relative;
            max-width: 100%;
            max-height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: var(--radius-md);
            overflow: hidden;
            background: var(--bg-primary);
            border: 0.5px solid var(--separator);
            flex: 1;
            min-height: 0;
            /* 无阴影 */
        }

        /* 保存渲染结果悬浮按钮 */
        .canvas-container .save-render-btn {
            position: absolute;
            bottom: 16px;
            right: 16px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--bg-primary);
            border: 1px solid var(--separator);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
            z-index: 100;
            opacity: 0;
            pointer-events: none;
        }

        .canvas-container .save-render-btn.visible {
            opacity: 1;
            pointer-events: auto;
        }

        .canvas-container .save-render-btn:hover {
            background: var(--accent-blue);
            color: white;
            transform: scale(1.1);
        }

        .canvas-container .save-render-btn:disabled {
            opacity: 0.3 !important;
            cursor: not-allowed;
            transform: none;
        }

        .canvas-container .save-render-btn svg {
            width: 20px;
            height: 20px;
        }

        canvas {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            display: block;
            object-fit: contain;
        }
        
        canvas:hover {
            transform: scale(1.01);
        }
        
        .info-bar {
            padding: 12px 16px;
            background: var(--bg-primary);
            border-top: 0.5px solid var(--separator);
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .info-bar-api {
            justify-content: space-between;
        }

        .info-bar-api .save-render-btn-inline {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            font-size: 12px;
            border-radius: var(--radius-sm);
            background: var(--fill-secondary);
            border: 1px solid var(--separator);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .info-bar-api .save-render-btn-inline:hover:not(:disabled) {
            background: var(--accent-blue);
            color: white;
        }

        .info-bar-api .save-render-btn-inline:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .info-bar-api .save-render-btn-inline svg {
            width: 14px;
            height: 14px;
        }
        
        .info-bar svg {
            width: 14px;
            height: 14px;
            color: var(--text-tertiary);
        }
        
        .info-bar.empty {
            color: var(--text-tertiary);
        }
        
        .info-bar.success {
            color: var(--success);
        }
        
        .info-bar.success svg {
            color: var(--success);
        }
        
        .info-bar.warning {
            color: var(--warning);
        }
        
        .info-bar.warning svg {
            color: var(--warning);
        }
        
        .info-bar.error {
            color: var(--error);
        }
        
        .info-bar.error svg {
            color: var(--error);
        }
        
        /* ========== 模式提示面板 - iOS 风格 ========== */
        .mode-hint {
            background: var(--bg-primary);
            padding: 16px 20px;
            border-radius: var(--radius-lg);
            margin-bottom: 20px;
            display: none;
            border: 0.5px solid var(--separator);
            /* 完全扁平 */
        }
        
        .mode-hint.active {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        
        .mode-hint-header {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .mode-hint-icon {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--accent-blue);
            color: white;
            /* 无阴影 */
        }
        
        .roi-hint .mode-hint-icon {
            background: var(--accent-red);
        }
        
        .draw-hint .mode-hint-icon {
            background: var(--accent-orange);
        }
        
        .split-hint .mode-hint-icon {
            background: var(--accent-purple);
        }
        
        .mode-hint-icon svg {
            width: 20px;
            height: 20px;
        }
        
        .mode-hint-title h4 {
            font-size: 17px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
            letter-spacing: -0.021em;
        }
        
        .mode-hint-title p {
            font-size: 15px;
            color: var(--text-secondary);
            margin: 0;
        }
        
        .btn-row {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }
        
        .mode-hint-title {
            flex: 1;
        }
        
        .mode-hint-title h4 {
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 500;
            margin: 0;
        }
        
        .mode-hint-title p {
            color: var(--text-secondary);
            font-size: 0.75rem;
            margin: 2px 0 0 0;
        }
        
        .mode-hint .btn-row {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        
        .mode-hint button {
            padding: 8px 14px;
            border-radius: var(--radius-md);
            font-size: 0.8rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all var(--transition-fast);
            border: 1px solid transparent;
        }
        
        .mode-hint button.primary {
            background: var(--accent-primary);
            color: var(--text-inverse);
        }
        
        .mode-hint button.primary:hover {
            background: var(--accent-hover);
            box-shadow: var(--shadow-glow);
        }
        
        .mode-hint button.secondary {
            background: transparent;
            border-color: var(--border-light);
            color: var(--text-primary);
        }
        
        .mode-hint button.secondary:hover {
            background: var(--bg-hover);
            border-color: var(--border-color);
        }
        
        .mode-hint button svg {
            width: 14px;
            height: 14px;
        }
        
        /* ROI模式特殊样式 */
        .roi-hint .mode-hint-icon {
            background: linear-gradient(135deg, #ff6b6b, #ee5a24);
        }
        
        /* 手绘模式特殊样式 */
        .draw-hint .mode-hint-icon {
            background: linear-gradient(135deg, #26de81, #20bf6b);
        }
        
        /* 切割模式特殊样式 */
        .split-hint .mode-hint-icon {
            background: linear-gradient(135deg, #a55eea, #8854d0);
        }
        
        /* ========== 颜色选择器弹窗 - iOS 风格 ========== */
        .color-picker-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.4);
            justify-content: center;
            align-items: center;
            z-index: 1000;
            backdrop-filter: blur(10px);
        }
        
        .color-picker-modal.active {
            display: flex;
            animation: fadeIn 0.2s ease;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .color-picker-content {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            padding: 24px;
            width: 480px;
            /* 完全扁平 */
        }
        
        .color-picker-content h4 {
            margin-bottom: 20px;
            color: var(--text-primary);
            text-align: center;
            font-size: 20px;
            font-weight: 700;
            letter-spacing: -0.021em;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        
        .color-picker-content h4 svg {
            width: 20px;
            height: 20px;
            color: var(--accent-blue);
        }
        
        .color-preview-large {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 20px;
            padding: 16px;
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            border: 0.5px solid var(--separator);
        }
        
        .color-swatch-large {
            width: 60px;
            height: 60px;
            border-radius: var(--radius-md);
            border: 0.5px solid var(--separator);
            /* 无阴影 */
        }
        
        .color-info {
            flex: 1;
        }
        
        .color-info-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }
        
        .color-info-row:last-child {
            margin-bottom: 0;
        }
        
        .color-info-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            width: 20px;
            font-weight: 600;
        }
        
        .color-info-label.r { color: #ff6b6b; }
        .color-info-label.g { color: #26de81; }
        .color-info-label.b { color: #4b7bec; }
        
        .color-info-value {
            font-family: var(--font-mono);
            font-size: 0.85rem;
            color: var(--text-primary);
            background: var(--bg-tertiary);
            padding: 4px 10px;
            border-radius: var(--radius-sm);
            min-width: 50px;
            text-align: center;
        }
        
        /* HSL 色相环 - iOS 风格 */
        .hsl-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }
        
        .hue-ring {
            position: relative;
            width: 180px;
            height: 180px;
            border-radius: 50%;
            background: conic-gradient(
                hsl(0, 100%, 50%),
                hsl(60, 100%, 50%),
                hsl(120, 100%, 50%),
                hsl(180, 100%, 50%),
                hsl(240, 100%, 50%),
                hsl(300, 100%, 50%),
                hsl(360, 100%, 50%)
            );
            cursor: crosshair;
            border: 0.5px solid var(--separator);
            /* 无阴影 */
        }
        
        .hue-ring-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: var(--bg-primary);
            border: 0.5px solid var(--separator);
        }
        
        .hue-indicator {
            position: absolute;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 3px solid white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            pointer-events: none;
            transform: translate(-50%, -50%);
            transition: left 0.05s, top 0.05s;
        }
        
        /* 亮度滑块 - iOS 风格 */
        .lightness-section {
            display: flex;
            align-items: center;
            gap: 16px;
            width: 100%;
        }
        
        .lightness-label {
            font-size: 15px;
            font-weight: 500;
            color: var(--text-secondary);
            width: 48px;
        }
        
        .lightness-slider {
            flex: 1;
            -webkit-appearance: none;
            height: 6px;
            border-radius: 3px;
            background: linear-gradient(to right, #000, #fff);
            outline: none;
            cursor: pointer;
        }
        
        .lightness-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: white;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
            border: 0.5px solid var(--separator);
            transition: transform var(--transition-fast);
        }
        
        .lightness-slider::-webkit-slider-thumb:hover {
            transform: scale(1.1);
        }
        
        /* 经典 Windows 颜色选择器 */
        .windows-color-picker {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }
        
        /* 左侧预设色块 */
        .preset-colors {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            grid-template-rows: repeat(8, 1fr);
            gap: 3px;
            width: 114px;
        }
        
        .preset-color {
            width: 20px;
            height: 20px;
            border: 0.5px solid var(--separator);
            cursor: pointer;
            border-radius: var(--radius-sm);
            transition: transform var(--transition-fast);
        }
        
        .preset-color:hover {
            transform: scale(1.15);
            z-index: 1;
            border-color: var(--accent-blue);
        }
        
        .preset-color.selected {
            border: 2px solid var(--accent-blue);
            transform: scale(1.1);
        }
        
        .preset-color:hover {
            border: 2px solid var(--neon-cyan);
            transform: scale(1.2);
            z-index: 1;
            box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
        }
        
        .preset-color.selected {
            border: 2px solid var(--neon-cyan);
            box-shadow: 0 0 15px var(--neon-cyan), 0 0 30px rgba(0, 240, 255, 0.3);
            transform: scale(1.1);
        }
        
        /* 颜色输入区域 */
        .color-input-section {
            margin-top: 16px;
        }
        
        .color-preview-row {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 12px;
        }
        
        .color-preview-box {
            width: 50px;
            height: 36px;
            border-radius: var(--radius-md);
            border: 0.5px solid var(--separator);
            /* 无阴影 */
        }
        
        .color-hex-input {
            flex: 1;
            padding: 10px 14px;
            background: var(--bg-primary);
            border: 0.5px solid var(--separator);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-family: var(--font-mono);
            font-size: 15px;
            text-transform: uppercase;
            transition: all var(--transition-fast);
        }
        
        .color-hex-input:focus {
            outline: none;
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
        }
        
        .color-hex-input::placeholder {
            color: var(--text-muted);
            text-transform: none;
        }
        
        .color-value-section {
            background: var(--bg-primary);
            padding: 14px;
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-color);
        }
        
        .color-value-row {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }
        
        .color-value-row:last-child {
            margin-bottom: 0;
        }
        
        .color-value-row label {
            width: 22px;
            font-size: 0.85rem;
            font-weight: bold;
            text-align: center;
        }
        
        .color-value-row input[type="text"] {
            flex: 1;
            padding: 6px 10px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            font-family: var(--font-mono);
            font-size: 0.85rem;
            text-align: center;
            transition: all var(--transition-fast);
        }
        
        .color-value-row input[type="text"]:focus {
            outline: none;
            border-color: var(--accent-primary);
        } */
        .hsl-canvas-container {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .hsl-canvas {
            cursor: crosshair;
            border: 1px solid #444;
            border-radius: 4px;
        }
        
        /* 水平亮度滑块 */
        .lightness-slider {
            width: 100%;
            height: 24px;
            -webkit-appearance: none;
            background: linear-gradient(to right, #000, #fff);
            border: 1px solid #444;
            border-radius: 4px;
            cursor: pointer;
        }
        
        .lightness-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 16px;
            height: 24px;
            background: #fff;
            border: 1px solid #444;
            cursor: pointer;
            border-radius: 2px;
        }
        
        /* 颜色值显示 */
        .color-value-section {
            margin-top: 15px;
            padding-top: 15px;
            border-top: 1px solid #333;
        }
        
        .color-value-row {
            display: flex;
            align-items: center;
            margin-bottom: 8px;
            gap: 6px;
        }
        
        .color-value-row label {
            width: 18px;
            font-size: 0.85rem;
            font-weight: bold;
        }
        
        .color-value-row input[type="text"] {
            width: 60px;
            padding: 4px 6px;
            background: #0a0a15;
            border: 1px solid #444;
            border-radius: 3px;
            color: #fff;
            font-family: monospace;
            font-size: 0.85rem;
            text-align: center;
        }
        
        .color-value-row input[type="text"]:focus {
            outline: none;
            border-color: #e94560;
        }
        
        .color-preview-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
        }
        
        .color-preview-box {
            width: 40px;
            height: 30px;
            border: 1px solid #666;
        }
        
        .color-hex-input {
            flex: 1;
        }
        
        .color-picker-buttons {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }
        
        .color-picker-buttons button {
            flex: 1;
            padding: 8px;
        }
        
        .color-picker-buttons {
            display: flex;
            gap: 10px;
        }
        
        .color-picker-buttons button {
            flex: 1;
            padding: 10px;
        }

        /* 耗材颜色选择器样式 - 左侧固定面板 */
        .filament-picker-modal {
            display: none;
            position: fixed;
            left: 0;
            top: 60px;
            bottom: 20px;
            width: 550px;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: flex-start;
            padding-top: 15px;
            transition: transform 0.3s ease, opacity 0.3s ease;
        }

        .filament-picker-modal.active {
            display: flex;
            transform: translateX(0);
        }

        .filament-picker-modal:not(.active) {
            transform: translateX(-100%);
        }

        /* ========== 耗材颜色选择器 - iOS 风格 ========== */
        .filament-picker-modal {
            display: none;
            position: fixed;
            left: 0;
            top: 50px;
            bottom: 20px;
            width: 560px;
            background: rgba(0, 0, 0, 0.4);
            z-index: 1000;
            align-items: flex-start;
            padding-top: 20px;
            transition: transform 0.3s ease, opacity 0.3s ease;
            backdrop-filter: blur(10px);
        }

        .filament-picker-modal.active {
            display: flex;
            transform: translateX(0);
            animation: slideInRight 0.3s ease;
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(-20px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .filament-picker-modal:not(.active) {
            transform: translateX(-100%);
        }

        .filament-picker-content {
            background: var(--bg-secondary);
            border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
            padding: 20px;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            /* 完全扁平 */
        }

        .filament-picker-body {
            display: flex;
            gap: 16px;
            flex: 1;
            overflow: hidden;
            margin-top: 10px;
        }

        /* 品牌列表 - iOS 风格 */
        .brand-list {
            width: 160px;
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            padding: 12px;
            overflow-y: auto;
            flex-shrink: 0;
            border: 0.5px solid var(--separator);
        }

        .brand-item {
            padding: 12px;
            cursor: pointer;
            border-radius: var(--radius-md);
            margin-bottom: 4px;
            font-size: 15px;
            font-weight: 500;
            transition: all var(--transition-fast);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-primary);
        }

        .brand-item:hover {
            background: var(--bg-hover);
        }

        .brand-item.active {
            background: var(--bg-active);
            color: var(--accent-blue);
        }

        .brand-count {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-tertiary);
            margin-left: auto;
            background: var(--fill-tertiary);
            padding: 2px 8px;
            border-radius: 100px;
        }

        .brand-item.active .brand-count {
            color: var(--accent-blue);
            background: rgba(0, 122, 255, 0.15);
        }

        /* 颜色网格 - iOS 风格 */
        .color-grid-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            padding: 16px;
            border: 0.5px solid var(--separator);
        }

        .color-grid-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            padding-bottom: 16px;
            border-bottom: 0.5px solid var(--separator);
        }

        .color-grid-header h5 {
            color: var(--text-primary);
            font-size: 17px;
            font-weight: 600;
            margin: 0;
            letter-spacing: -0.021em;
        }

        .color-search {
            padding: 8px 12px;
            border: 0.5px solid var(--separator);
            border-radius: var(--radius-md);
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-size: 15px;
            width: 180px;
            transition: all var(--transition-fast);
        }

        .color-search:focus {
            outline: none;
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
        }

        .color-search::placeholder {
            color: var(--text-tertiary);
        }

        .color-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            overflow-y: auto;
            flex: 1;
            contain: strict;
        }

        /* 占位符样式 - 加载中动画 */
        .color-item-placeholder {
            aspect-ratio: 1;
            border-radius: var(--radius-md);
            background: linear-gradient(90deg, var(--fill-tertiary) 25%, var(--fill-secondary) 50%, var(--fill-tertiary) 75%);
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
        }

        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* 图片懒加载样式 */
        .color-item img.lazy-loading {
            opacity: 0.3;
        }

        .color-item img {
            transition: opacity 0.3s ease;
        }

        .color-item {
            aspect-ratio: 1;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-fast);
            position: relative;
            overflow: hidden;
            border: 0.5px solid var(--separator);
            /* 无阴影 */
        }

        .color-item:hover {
            transform: scale(1.03);
            border-color: var(--accent-blue);
        }

        .color-item.selected {
            border: 2px solid var(--accent-blue);
        }

        .color-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .color-item .color-name {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
            color: white;
            font-size: 0.75rem;
            padding: 20px 8px 8px 8px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: center;
            font-weight: 500;
        }

        .filament-picker-buttons {
            display: flex;
            gap: 10px;
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid var(--border-color);
        }

        .filament-picker-buttons button {
            flex: 1;
            padding: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .filament-picker-buttons button svg {
            width: 16px;
            height: 16px;
        }

        /* 取色笔模式 - iOS 风格 */
        .btn-pick-mode {
            background: var(--accent-purple) !important;
            color: white !important;
            /* 完全扁平 */
        }

        .btn-pick-mode.active {
            background: var(--accent-pink) !important;
            /* 无发光动画 */
        }

        .pick-mode-hint {
            display: none;
            background: rgba(175, 82, 222, 0.15);
            color: var(--accent-purple);
            padding: 12px 16px;
            border-radius: var(--radius-md);
            font-size: 15px;
            font-weight: 500;
            margin-top: 16px;
            text-align: center;
            align-items: center;
            justify-content: center;
            gap: 8px;
            border: 0.5px solid var(--separator);
        }

        .pick-mode-hint.active {
            display: flex;
        }

        .pick-mode-hint svg {
            width: 16px;
            height: 16px;
        }

        .color-item.pick-mode-target {
            cursor: crosshair;
            border: 2px dashed var(--accent-purple);
        }

        .color-item.pick-mode-target::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 24px;
            height: 24px;
            background: rgba(162, 155, 254, 0.3);
            border-radius: 50%;
            border: 2px solid #a29bfe;
            opacity: 0;
            transition: opacity 0.2s;
            pointer-events: none;
        }

        .color-item.pick-mode-target:hover::after {
            opacity: 1;
        }

        /* 选中颜色预览 */
        .selected-color-preview {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px;
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            margin-top: 12px;
            border: 1px solid var(--border-color);
        }

        .selected-color-swatch {
            width: 48px;
            height: 48px;
            border-radius: var(--radius-md);
            border: 3px solid var(--border-light);
            box-shadow: var(--shadow-sm);
        }

        .selected-color-info {
            flex: 1;
        }

        .selected-color-name {
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 500;
            margin-bottom: 4px;
        }

        .selected-color-brand {
            color: var(--text-secondary);
            font-size: 0.75rem;
        }

        .help-text {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 16px;
            text-align: center;
            padding: 10px;
            background: var(--bg-secondary);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-light);
        }

        .pick-mode-hint.active {
            display: block;
        }

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

        .color-item.pick-mode-target {
            cursor: crosshair;
        }

        .color-item.pick-mode-target::after {
            content: '🎨';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 1.5rem;
            opacity: 0;
            transition: opacity 0.2s;
            pointer-events: none;
        }

        .color-item.pick-mode-target:hover::after {
            opacity: 1;
        }

        /* 选中颜色预览 */
        .selected-color-preview {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 10px;
            background: #0a0a15;
            border-radius: 8px;
            margin-top: 10px;
        }

        .selected-color-swatch {
            width: 40px;
            height: 40px;
            border-radius: 6px;
            border: 2px solid #fff;
        }

        .selected-color-info {
            flex: 1;
        }

        .selected-color-name {
            color: #eee;
            font-size: 0.9rem;
            margin-bottom: 4px;
        }

        .selected-color-brand {
            color: #888;
            font-size: 0.8rem;
        }

        /* ========== 帮助文本 ========== */
        .help-text {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 16px;
            text-align: center;
            padding: 10px;
            background: var(--bg-secondary);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-light);
        }
        
        .help-text kbd {
            background: var(--bg-tertiary);
            padding: 2px 6px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-color);
            font-family: var(--font-mono);
            font-size: 0.7rem;
            color: var(--text-secondary);
        }
        
        /* ========== 加载状态 - iOS 风格 ========== */
        .loading {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.4);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            backdrop-filter: blur(10px);
        }
        
        .loading.active {
            display: flex;
            animation: fadeIn 0.3s ease;
        }
        
        .loading-content {
            text-align: center;
            padding: 32px 48px;
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            /* 完全扁平 */
        }
        
        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 3px solid var(--fill-secondary);
            border-top-color: var(--accent-blue);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 16px;
            /* 单色，无发光 */
        }
        
        .loading-text {
            color: var(--text-primary);
            font-size: 17px;
            font-weight: 600;
            margin-bottom: 8px;
            letter-spacing: -0.021em;
        }
        
        .loading-detail {
            color: var(--text-secondary);
            font-size: 15px;
        }
        
        .loading-progress {
            width: 200px;
            height: 4px;
            background: var(--fill-tertiary);
            border-radius: 2px;
            margin: 20px auto 0;
            overflow: hidden;
        }
        
        .loading-progress-bar {
            height: 100%;
            background: var(--accent-blue);
            border-radius: 2px;
            animation: progressPulse 2s ease-in-out infinite;
        }
        
        @keyframes progressPulse {
            0%, 100% { opacity: 0.8; }
            50% { opacity: 1; }
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        /* ========== 遮罩层 ========== */
        .overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.7);
            z-index: 1000;
            backdrop-filter: blur(4px);
        }
        
        .overlay.active {
            display: block;
            animation: fadeIn 0.2s ease;
        }
        
        /* ========== 响应式设计 ========== */
        @media (max-width: 1200px) {
            .workspace {
                grid-template-columns: 1fr 1fr;
            }
            .left-panels {
                grid-row: auto;
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 0;
            }

            .toolbar {
                padding: 10px 12px;
            }

            .toolbar-group {
                padding: 0 4px;
            }

            .toolbar button {
                padding: 6px 10px;
                font-size: 0.75rem;
            }

            .toolbar button svg {
                width: 14px;
                height: 14px;
            }

            .workspace {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .left-panels {
                flex-direction: row;
            }

            .panel-header {
                padding: 8px 12px;
            }

            canvas {
                max-height: 250px;
            }

            /* 工作区 canvas 在移动端也保持放大 */
            #canvasFinal {
                max-height: none;
            }

        }
        
        @media (max-width: 480px) {
            .header {
                padding: 8px 12px;
            }
            
            .header h1 {
                font-size: 0.9rem;
            }
            
            .kbd-hint {
                display: none;
            }
            
            .mode-hint .btn-row {
                flex-direction: column;
            }
            
            .mode-hint button {
                width: 100%;
                justify-content: center;
            }
            
            /* 耗材选择器在小屏幕下的调整 */
            .filament-picker-modal {
                width: 100%;
                top: 0;
                bottom: 0;
                border-radius: 0;
            }
            
            .filament-picker-content {
                border-radius: 0;
            }
            
            .brand-list {
                width: 120px;
            }
            
            .filament-picker-body {
                flex-direction: column;
            }
            
            .color-picker-content {
                width: 95% !important;
                padding: 16px;
            }
        }
        
        /* ========== 高对比度模式支持 ========== */
        @media (prefers-contrast: high) {
            :root {
                --border-color: #666;
                --text-primary: #fff;
                --text-secondary: #ddd;
            }
            
            .toolbar button {
                border-width: 2px;
            }
            
            .panel {
                border-width: 2px;
            }
        }
        
        /* ========== 减少动画模式支持 ========== */
        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }
        
        /* ========== 打印样式 ========== */
        @media print {
            .toolbar,
            .mode-hint,
            .color-picker-modal,
            .filament-picker-modal,
            .loading,
            .overlay,
            .header .status,
            .help-text {
                display: none !important;
            }
            
            .container {
                padding: 0;
            }
            
            .workspace {
                display: block;
            }
            
            .panel {
                page-break-inside: avoid;
                margin-bottom: 20px;
                border: 1px solid #000;
            }
            
            canvas {
                max-height: none;
            }
        }
        
        /* ========== 触摸设备优化 ========== */
        @media (hover: none) and (pointer: coarse) {
            .toolbar button {
                min-height: 44px;
                min-width: 44px;
            }
            
            .color-item {
                min-height: 60px;
            }
            
            canvas {
                cursor: pointer;
            }
            
            .kbd-hint {
                display: none;
            }
        }

        /* API渲染预览模态框 */
        .api-preview-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .api-preview-backdrop {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(10px);
        }

        .api-preview-content {
            position: relative;
            max-width: 95vw;
            max-height: 95vh;
            display: flex;
            flex-direction: column;
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            overflow: hidden;
            z-index: 1;
        }

        .api-preview-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 24px;
            border-bottom: 1px solid var(--border-color);
        }

        .api-preview-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .api-preview-close {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 8px;
            border-radius: var(--radius-md);
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .api-preview-close:hover {
            background: var(--bg-tertiary);
            color: var(--text-primary);
        }

        .api-preview-image-container {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            overflow: auto;
            background: var(--bg-tertiary);
        }

        .api-preview-image-container img {
            max-width: 100%;
            max-height: calc(95vh - 140px);
            object-fit: contain;
            border-radius: var(--radius-md);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        }

        .api-preview-hint {
            padding: 12px 24px;
            text-align: center;
            font-size: 13px;
            color: var(--text-muted);
            background: var(--bg-secondary);
            border-top: 1px solid var(--border-color);
        }

        /* API canvas 可点击指示 */
        #canvasApi {
            cursor: zoom-in;
        }
