/* Aurora UI Theme System - Blue-Pink-Purple Gradient Design */

/* === Light Theme (Default) === */
:root {
  /* Background System */
  --theme-background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 50%, #E2E8F0 100%);
  --theme-foreground: #0F172A;
  
  /* Card System with Frosted Glass - Enhanced contrast */
  --theme-card: rgba(255, 255, 255, 0.95);
  --theme-card-border: rgba(71, 85, 105, 0.2);
  --theme-card-hover: rgba(255, 255, 255, 1);
  
  /* UI Elements - WCAG AA Compliant */
  --theme-muted: #F1F5F9;
  --theme-muted-foreground: #475569;
  --theme-border: #CBD5E1;
  --theme-input: #FFFFFF;
  --theme-ring: #6366F1;
  
  /* Aurora Color System - Light Theme */
  --primary-color: #6366F1;
  --primary-hover: #4F46E5;
  --primary-light: #A5B4FC;
  --secondary-color: #EC4899;
  --secondary-hover: #DB2777;
  --accent-color: #C084FC;
  --accent-hover: #A855F7;
  --warning-color: #F59E0B;
  --error-color: #DC2626;
  --success-color: #059669;
  
  /* Aurora Gradient System */
  --theme-gradient-primary: linear-gradient(135deg, #818CF8, #E086F0, #F472B6);
  --theme-gradient-card: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.9), rgba(226, 232, 240, 0.95));
  --theme-gradient-border: linear-gradient(90deg, #818CF8, #F472B6);
  
  
  /* Shadow System */
  --theme-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.08);
  --theme-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.12), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
  --theme-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.15), 0 4px 6px -4px rgba(15, 23, 42, 0.10);
  --theme-shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.20), 0 8px 10px -6px rgba(15, 23, 42, 0.15);
  --theme-shadow-aurora: 0 8px 32px -8px rgba(129, 140, 248, 0.3), 0 0 0 1px rgba(129, 140, 248, 0.15);
  
  
  /* Supporting Colors */
  --theme-foreground-muted: #64748B;
  --theme-muted-background: rgba(129, 140, 248, 0.08);
  
  /* Secondary Gradients */
  --theme-gradient-secondary: linear-gradient(135deg, #F472B6, #E086F0);
  --theme-gradient-accent: linear-gradient(135deg, #E086F0, #818CF8);
  
  /* Frosted Glass System */
  --theme-glass-bg: rgba(248, 250, 252, 0.6);
  --theme-glass-border: rgba(129, 140, 248, 0.2);
  --theme-glass-blur: blur(20px);
}

/* === Dark Theme (Aurora Deep Space) === */
[data-theme="dark"] {
  /* Deep Space Background */
  --theme-background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  --theme-foreground: #F1F5F9;
  
  /* Frosted Glass Cards */
  --theme-card: rgba(30, 41, 59, 0.8);
  --theme-card-border: rgba(129, 140, 248, 0.3);
  --theme-card-hover: rgba(30, 41, 59, 0.95);
  
  /* UI Elements */
  --theme-muted: #1E293B;
  --theme-muted-foreground: #94A3B8;
  --theme-border: #334155;
  --theme-input: #1E293B;
  --theme-ring: #818CF8;
  
  
  /* Aurora Dark Gradients */
  --theme-gradient-primary: linear-gradient(135deg, #818CF8, #E086F0, #F472B6);
  --theme-gradient-card: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
  --theme-gradient-border: linear-gradient(90deg, #818CF8, #F472B6);
  
  
  /* Enhanced Dark Shadows */
  --theme-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --theme-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --theme-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --theme-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.6);
  --theme-shadow-aurora: 0 12px 48px -8px rgba(129, 140, 248, 0.4), 0 0 0 1px rgba(129, 140, 248, 0.25);
  
  
  /* Dark Supporting Colors */
  --theme-foreground-muted: #94A3B8;
  --theme-muted-background: rgba(129, 140, 248, 0.06);
  
  /* Dark Secondary Gradients */
  --theme-gradient-secondary: linear-gradient(135deg, #F472B6, #E086F0);
  --theme-gradient-accent: linear-gradient(135deg, #E086F0, #818CF8);
  
  /* Dark Frosted Glass System */
  --theme-glass-bg: rgba(30, 41, 59, 0.7);
  --theme-glass-border: rgba(129, 140, 248, 0.25);
  --theme-glass-blur: blur(30px);
  
  
  /* Aurora Color Adjustments for Dark Theme */
  --primary-color: #818CF8;
  --primary-hover: #6366F1;
  --primary-light: #A5B4FC;
  --secondary-color: #F472B6;
  --secondary-hover: #EC4899;
  --accent-color: #E086F0;
  --accent-hover: #C084FC;
  --warning-color: #FBBF24;
  --error-color: #F87171;
  --success-color: #4ADE80;
  
  
  /* Inverted Gray Scale for Dark Theme */
  --gray-50: #1E293B;
  --gray-100: #334155;
  --gray-200: #475569;
  --gray-300: #64748B;
  --gray-400: #94A3B8;
  --gray-500: #CBD5E1;
  --gray-600: #E2E8F0;
  --gray-700: #F1F5F9;
  --gray-800: #F8FAFC;
  --gray-900: #FFFFFF;
}

/* 全局过渡动画 */
* {
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础元素应用主题 - 提高优先级 */
body {
  background: var(--theme-background), var(--page-aurora-overlays) !important;
  color: var(--theme-foreground) !important;
}

/* 顶部导航栏样式（明暗双模式） */
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.75));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--theme-card-border);
}

[data-theme="dark"] .app-navbar {
  background: linear-gradient(180deg, rgba(15,23,42,0.85), rgba(15,23,42,0.75));
  border-bottom: 1px solid var(--theme-card-border);
}

.nav-brand {
  font-weight: 700;
  color: var(--theme-foreground);
}

.nav-actions .nav-link {
  color: var(--theme-foreground);
  opacity: 0.8;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
}
.nav-actions .nav-link:hover {
  opacity: 1;
  background-color: var(--theme-muted);
}
.nav-actions .nav-link.active {
  background: var(--theme-gradient-primary);
  color: #fff;
}

/* 雪碧图生成模块：整体容器和预览在暗色下的底色修正 */
[data-theme="dark"] #spritesheet-settings {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.7));
  border-color: var(--theme-card-border) !important;
}
[data-theme="dark"] #spritesheet-preview-container {
  background-color: var(--theme-muted) !important;
  border-color: var(--theme-border) !important;
}
[data-theme="dark"] #spritesheet-canvas { background-color: var(--theme-card) !important; }
[data-theme="dark"] #spritesheet-info { background-color: var(--theme-muted) !important; color: var(--theme-muted-foreground) !important; }

/* 缩放与导出模块：输入框、按钮、比例按钮暗色配色优化 */
[data-theme="dark"] #step4 input[type="number"],
[data-theme="dark"] #step4 .bg-white {
  background-color: var(--theme-input) !important;
  color: var(--theme-foreground) !important;
  border-color: var(--theme-border) !important;
}
[data-theme="dark"] #step4 .text-gray-700 { color: var(--theme-foreground) !important; }
[data-theme="dark"] #step4 .text-gray-600 { color: var(--theme-muted-foreground) !important; }
[data-theme="dark"] #spritesheet-tip {
  background: linear-gradient(90deg, rgba(59,130,246,.12), rgba(168,85,247,.12)) !important;
  border-color: var(--theme-border) !important;
}

/* 尺寸显示框的暗色卡片样式 */
[data-theme="dark"] #original-size-box,
[data-theme="dark"] #output-size-box {
  background-color: color-mix(in oklab, var(--theme-card) 90%, transparent) !important;
  border-color: var(--theme-border) !important;
}
[data-theme="dark"] #original-size-box span,
[data-theme="dark"] #output-size-box span {
  color: var(--theme-muted-foreground) !important;
}

/* 动画预览和雪碧图设置中的组件配色 */
[data-theme="dark"] .parameter-card {
  background: var(--theme-gradient-card) !important;
  border-color: var(--theme-card-border) !important;
}

/* 替换灰色背景的组件为主题色调 */
[data-theme="dark"] .bg-white\/50 {
  background: color-mix(in oklab, var(--theme-card) 60%, transparent) !important;
  border-color: var(--theme-card-border) !important;
}

[data-theme="dark"] .bg-white\/80 {
  background: color-mix(in oklab, var(--theme-card) 80%, transparent) !important;
  border-color: var(--theme-card-border) !important;
}

[data-theme="dark"] .bg-gray-100 {
  background: color-mix(in oklab, var(--theme-muted) 80%, var(--theme-card) 20%) !important;
  color: var(--theme-muted-foreground) !important;
}

[data-theme="dark"] .bg-gray-200 {
  background: color-mix(in oklab, var(--theme-muted) 70%, var(--theme-card) 30%) !important;
  color: var(--theme-foreground) !important;
}

[data-theme="dark"] .text-gray-500 {
  color: var(--theme-muted-foreground) !important;
}

[data-theme="dark"] .text-gray-600 {
  color: var(--theme-muted-foreground) !important;
}

[data-theme="dark"] .text-gray-700 {
  color: var(--theme-foreground) !important;
}

[data-theme="dark"] .text-gray-800 {
  color: var(--theme-foreground) !important;
}

[data-theme="dark"] .border-gray-200 {
  border-color: var(--theme-card-border) !important;
}

[data-theme="dark"] .border-gray-300 {
  border-color: var(--theme-border) !important;
}

/* 单选按钮和复选框样式 */
[data-theme="dark"] .form-radio {
  background-color: var(--theme-input) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-ring) !important;
}

[data-theme="dark"] .form-radio:checked {
  background-color: var(--theme-ring) !important;
  border-color: var(--theme-ring) !important;
}


[data-theme="dark"] .border-dashed {
  border-color: color-mix(in oklab, var(--theme-card-border) 80%, transparent) !important;
}

/* 工具按钮组 */
[data-theme="dark"] .tool-btn {
  background: color-mix(in oklab, var(--theme-card) 70%, transparent) !important;
  border-color: var(--theme-card-border) !important;
  color: var(--theme-foreground) !important;
}

[data-theme="dark"] .tool-btn.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.8), rgba(139, 92, 246, 0.8)) !important;
  color: white !important;
  border-color: var(--theme-ring) !important;
}

[data-theme="dark"] .tool-btn:hover {
  background: color-mix(in oklab, var(--theme-card) 90%, var(--theme-ring) 10%) !important;
}

/* 自动对齐内容边界控件 */
[data-theme="dark"] #align-content-group,
[data-theme="dark"] #loop-frame-group {
  background: color-mix(in oklab, var(--theme-card) 60%, transparent) !important;
  border-color: var(--theme-card-border) !important;
}

[data-theme="dark"] .switch-input { 
  background-color: color-mix(in oklab, var(--theme-muted) 65%, transparent) !important; 
}

[data-theme="dark"] .switch-label { 
  color: var(--theme-foreground) !important; 
}

[data-theme="dark"] #align-content-group label,
[data-theme="dark"] #loop-frame-group label { 
  color: var(--theme-foreground) !important; 
}

[data-theme="dark"] #align-content,
[data-theme="dark"] #loop-frame {
  accent-color: var(--theme-ring);
  border-color: var(--theme-border);
}

/* 比例选择按钮：在暗色下提升对比度 */
#step4 .scale-btn { color: #fff; }
[data-theme="dark"] #step4 .scale-btn[data-scale="25"] { background: linear-gradient(90deg, #10b981, #22c55e) !important; }
[data-theme="dark"] #step4 .scale-btn[data-scale="50"] { background: linear-gradient(90deg, #3b82f6, #6366f1) !important; }
[data-theme="dark"] #step4 .scale-btn[data-scale="100"] { background: linear-gradient(90deg, #a855f7, #ec4899) !important; }
[data-theme="dark"] #step4 .scale-btn[data-scale="200"] { background: linear-gradient(90deg, #ec4899, #f97316) !important; }
[data-theme="dark"] #step4 .scale-btn.active { box-shadow: 0 0 0 2px rgba(255,255,255,.15) inset, 0 6px 16px rgba(0,0,0,.4); }

/* 底部操作按钮在暗色下的阴影与对比 */
[data-theme="dark"] #step4 #generate-spritesheet-btn { box-shadow: 0 4px 20px rgba(16,185,129,.35); }
[data-theme="dark"] #step4 #download-spritesheet-btn { box-shadow: 0 4px 20px rgba(147,51,234,.35); }
[data-theme="dark"] #step4 #download-zip-btn { box-shadow: 0 4px 20px rgba(249,115,22,.35); }

/* 确保容器也使用主题背景 */
.container {
  background-color: transparent;
}

/* 强制应用主题背景色 */
html {
  background: var(--theme-background), var(--page-aurora-overlays) !important;
}

body {
  background: var(--theme-background), var(--page-aurora-overlays) !important;
  color: var(--theme-foreground) !important;
}

/* 更新step-card以使用主题变量 */
.step-card {
  background: var(--theme-gradient-card) !important;
  backdrop-filter: blur(15px);
  border: 1px solid var(--theme-card-border) !important;
  box-shadow: var(--theme-shadow-lg);
}

[data-theme="dark"] .step-card {
  background: var(--theme-gradient-card) !important;
  backdrop-filter: blur(20px);
  border: 1px solid var(--theme-card-border) !important;
}

.step-card:hover {
  box-shadow: var(--theme-shadow-xl);
  border: 1px solid var(--theme-card-border) !important;
}

/* 更新上传区域 */
.upload-zone {
  background: var(--theme-card);
  border-color: var(--theme-border);
}

[data-theme="dark"] .upload-zone {
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.8), 
    rgba(15, 23, 42, 0.6));
  border-color: rgba(129, 140, 248, 0.25);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .upload-zone::before {
  background: linear-gradient(135deg, 
    rgba(79, 70, 229, 0.08) 0%, 
    rgba(139, 92, 246, 0.06) 50%, 
    rgba(217, 70, 239, 0.08) 100%);
}

[data-theme="dark"] .upload-zone::after {
  background: radial-gradient(circle, rgba(129, 140, 248, 0.2) 0%, transparent 60%);
}

[data-theme="dark"] .upload-zone:hover {
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 8px 32px -12px rgba(79, 70, 229, 0.3), 
              0 0 0 1px rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .upload-zone:hover label p:first-child {
  color: #60a5fa;
}

.upload-zone.dragover {
  background: var(--primary-light);
  border-color: var(--primary-color);
}

[data-theme="dark"] .upload-zone.dragover {
  background: linear-gradient(135deg, 
    rgba(79, 70, 229, 0.2), 
    rgba(139, 92, 246, 0.15), 
    rgba(217, 70, 239, 0.12));
  border-color: var(--primary-color);
  box-shadow: 0 20px 40px -16px rgba(79, 70, 229, 0.4), 
              0 0 0 2px rgba(129, 140, 248, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 快速预设按钮暗色主题 */
[data-theme="dark"] .quick-preset-btn {
  background: linear-gradient(135deg, 
    rgba(79, 70, 229, 0.15), 
    rgba(139, 92, 246, 0.12));
  color: #60a5fa;
  border-color: rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .quick-preset-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #8b5cf6);
  color: white;
  box-shadow: 0 8px 24px -4px rgba(79, 70, 229, 0.4);
  border-color: #4f46e5;
}

/* 提示卡片暗色主题 */
[data-theme="dark"] .tips-card {
  background: linear-gradient(135deg, 
    rgba(79, 70, 229, 0.12), 
    rgba(139, 92, 246, 0.08), 
    rgba(217, 70, 239, 0.06));
  border-color: rgba(129, 140, 248, 0.25);
  box-shadow: 0 4px 20px -8px rgba(79, 70, 229, 0.3);
}

[data-theme="dark"] .tips-card::before {
  background: linear-gradient(90deg, #4f46e5, #8b5cf6, #d946ef);
}

[data-theme="dark"] .tips-title {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .tips-item {
  color: var(--theme-muted-foreground);
}

[data-theme="dark"] .tips-item:hover {
  color: #60a5fa;
}

/* 片段选择区域暗色主题 */
[data-theme="dark"] .section-label {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] #start-time-label,
[data-theme="dark"] #end-time-label {
  color: var(--theme-muted-foreground);
}

[data-theme="dark"] #start-time-label [data-i18n],
[data-theme="dark"] #end-time-label [data-i18n] {
  color: #60a5fa;
}

[data-theme="dark"] .time-value {
  color: #a78bfa;
  background: linear-gradient(135deg, 
    rgba(79, 70, 229, 0.15), 
    rgba(139, 92, 246, 0.12));
  border-color: rgba(129, 140, 248, 0.25);
}

[data-theme="dark"] .trim-reset-btn {
  background: linear-gradient(135deg, 
    rgba(99, 102, 241, 0.15), 
    rgba(168, 85, 247, 0.12));
  color: #a78bfa;
  border-color: rgba(168, 85, 247, 0.2);
}

[data-theme="dark"] .tips-item::before {
  background: linear-gradient(135deg, #4f46e5, #d946ef);
}

/* 视频预览区域暗色主题 */
[data-theme="dark"] .video-preview-container {
  background: linear-gradient(135deg, 
    rgba(15, 23, 42, 0.95), 
    rgba(30, 41, 59, 0.9));
  border-color: rgba(129, 140, 248, 0.2);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.5), 
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .video-preview-container::before {
  background: linear-gradient(90deg, #4f46e5, #8b5cf6, #d946ef);
}

[data-theme="dark"] .video-controls {
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.08), 
    rgba(15, 23, 42, 0.05));
  border-top-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .video-controls label {
  color: var(--theme-muted-foreground);
}

[data-theme="dark"] .video-controls label:hover {
  color: #60a5fa;
}

[data-theme="dark"] .clip-info {
  color: var(--theme-muted-foreground);
  background: linear-gradient(135deg, 
    rgba(79, 70, 229, 0.12), 
    rgba(139, 92, 246, 0.08));
  border-color: rgba(129, 140, 248, 0.25);
}

[data-theme="dark"] .clip-info span:first-child {
  color: #60a5fa;
}

[data-theme="dark"] .clip-info #clip-length {
  color: #a78bfa;
}

[data-theme="dark"] .trim-section-label {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.btn-primary {
  background: var(--theme-gradient-primary);
  box-shadow: var(--theme-shadow-md);
}

.btn-primary:hover {
  box-shadow: var(--theme-shadow-lg);
}

.btn-secondary {
  background: var(--theme-muted);
  color: var(--theme-muted-foreground);
  border-color: var(--theme-border);
}

.btn-secondary:hover {
  background: var(--theme-border);
}

/* 表单元素适配 */
input, select, textarea {
  background-color: var(--theme-input);
  border-color: var(--theme-border);
  color: var(--theme-foreground);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--theme-ring);
  box-shadow: 0 0 0 3px rgba(var(--theme-ring), 0.1);
}

/* 主题切换器 - 调整位置和样式 */
.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--theme-card);
  border: 2px solid var(--theme-border);
  box-shadow: var(--theme-shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  /* 确保在所有设备上都可见 */
  min-width: 3.5rem;
  min-height: 3.5rem;
}

/* 导航栏内的主题按钮尺寸与定位 */
.theme-toggle.theme-toggle--in-nav {
  position: static;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
}

/* 语言切换按钮（导航内），与主题按钮保持一致的风格 */
.lang-toggle {
  position: static;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  background: var(--theme-card);
  border: 2px solid var(--theme-border);
  color: var(--theme-foreground);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--theme-shadow-lg);
}
.lang-toggle:hover { background: var(--theme-gradient-primary); color: #fff; }

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--theme-shadow-xl);
  background: var(--theme-gradient-primary);
}

.theme-toggle:hover .theme-icon {
  color: white;
  transform: scale(1.1);
}

/* 添加微妙的发光效果让按钮更显眼 */
[data-theme="dark"] .theme-toggle {
  box-shadow: var(--theme-shadow-lg), 0 0 20px rgba(129, 140, 248, 0.2);
}

[data-theme="light"] .theme-toggle {
  box-shadow: var(--theme-shadow-lg), 0 0 10px rgba(59, 130, 246, 0.1);
}

.theme-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--theme-foreground);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 太阳图标 (明亮主题) */
.theme-icon.sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* 月亮图标 (暗色主题) */
.theme-icon.moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
  position: absolute;
}

/* 暗色主题下的图标切换 */
[data-theme="dark"] .theme-icon.sun {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .theme-icon.moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* 滑块组件适配 */
.themed-slider {
  background: var(--theme-muted);
}

.themed-slider::-webkit-slider-thumb {
  background: var(--theme-gradient-primary);
  border: 2px solid var(--theme-card);
  box-shadow: 0 2px 8px rgba(var(--primary-color), 0.3);
}

.themed-slider::-moz-range-thumb {
  background: var(--theme-gradient-primary);
  border: 2px solid var(--theme-card);
  box-shadow: 0 2px 8px rgba(var(--primary-color), 0.3);
}

/* 帧容器适配 */
.frame-container {
  background: var(--theme-card);
  border-color: var(--theme-border);
}

.frame-container:hover {
  box-shadow: var(--theme-shadow-md);
}

.frame-container.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-color), 0.2);
}

/* 特殊效果 - 暗色下的发光效果 */
[data-theme="dark"] .step-card::before {
  background: var(--theme-gradient-border);
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .btn-primary {
  box-shadow: var(--theme-shadow-md), 0 0 20px rgba(79, 70, 229, 0.3);
}

[data-theme="dark"] .btn-primary:hover {
  box-shadow: var(--theme-shadow-lg), 0 0 30px rgba(79, 70, 229, 0.4);
}

/* Tailwind类覆盖 - 确保暗色模式生效 */
[data-theme="dark"] .bg-gray-100,
[data-theme="dark"] body.bg-gray-100 {
  background-color: var(--theme-background) !important;
}

/* 常见 Tailwind 背景/边框/文字在暗色下的统一覆盖 */
[data-theme="dark"] .bg-white { background-color: var(--theme-card) !important; }
[data-theme="dark"] .bg-gray-50 { background-color: var(--theme-muted) !important; }
[data-theme="dark"] .bg-gray-100 { background-color: var(--theme-muted) !important; }
[data-theme="dark"] .bg-gray-200 { background-color: var(--theme-muted) !important; }
[data-theme="dark"] .border-gray-100 { border-color: var(--theme-border) !important; }
[data-theme="dark"] .border-gray-200 { border-color: var(--theme-border) !important; }
[data-theme="dark"] .text-gray-700 { color: var(--theme-foreground) !important; }
[data-theme="dark"] .text-gray-800 { color: var(--theme-foreground) !important; }
[data-theme="dark"] .text-gray-900 { color: var(--theme-foreground) !important; }
[data-theme="dark"] .text-gray-600 { color: var(--theme-muted-foreground) !important; }

/* 成功/错误/警告/信息 提示的亮色背景在暗色下的替换 */
[data-theme="dark"] .bg-green-50 { background-color: color-mix(in oklab, #22c55e 12%, transparent) !important; }
[data-theme="dark"] .border-green-200 { border-color: color-mix(in oklab, #22c55e 45%, var(--theme-border)) !important; }
[data-theme="dark"] .bg-red-50 { background-color: color-mix(in oklab, #ef4444 12%, transparent) !important; }
[data-theme="dark"] .border-red-200 { border-color: color-mix(in oklab, #ef4444 45%, var(--theme-border)) !important; }
[data-theme="dark"] .bg-yellow-50 { background-color: color-mix(in oklab, #f59e0b 12%, transparent) !important; }
[data-theme="dark"] .border-yellow-200 { border-color: color-mix(in oklab, #f59e0b 45%, var(--theme-border)) !important; }
[data-theme="dark"] .bg-blue-50 { background-color: color-mix(in oklab, #3b82f6 12%, transparent) !important; }
[data-theme="dark"] .border-blue-200 { border-color: color-mix(in oklab, #3b82f6 45%, var(--theme-border)) !important; }

/* 通知/模态内关闭按钮悬停态在暗色下不要变亮 */
[data-theme="dark"] .notification .close-btn:hover,
[data-theme="dark"] #modal .close-btn:hover,
[data-theme="dark"] .hover\:bg-gray-100:hover { background-color: var(--theme-muted) !important; }

[data-theme="dark"] .text-gray-800,
[data-theme="dark"] body.text-gray-800 {
  color: var(--theme-foreground) !important;
}

[data-theme="dark"] .text-gray-900 {
  color: var(--theme-foreground) !important;
}

[data-theme="dark"] .text-gray-600 {
  color: var(--theme-muted-foreground) !important;
}

[data-theme="dark"] .text-blue-600 {
  color: #60a5fa !important;
}

[data-theme="dark"] .text-gray-500 {
  color: var(--theme-muted-foreground) !important;
}

/* 强制覆盖任何可能的Tailwind背景色 */
[data-theme="dark"] body {
  background-color: var(--theme-background) !important;
  color: var(--theme-foreground) !important;
}

/* 确保所有渐变文字在暗色下也清晰可见 */
[data-theme="dark"] .step-header {
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 暗色下主页标题可读性增强 */
[data-theme="dark"] h1[data-i18n="app.title"],
.dark h1[data-i18n="app.title"] {
  color: #F1F5F9 !important;
}

/* 动画预览控制按钮 */
[data-theme="dark"] #animation-play-btn {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] #animation-stop-btn {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] #animation-reset-btn {
  background: linear-gradient(135deg, #475569, #64748b) !important;
  box-shadow: 0 4px 20px rgba(100, 116, 139, 0.2);
}

/* 应用动画按钮 */
[data-theme="dark"] #apply-animation-btn {
  background: linear-gradient(135deg, #7c3aed, #3b82f6) !important;
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
}

/* 确保文本输入框也使用主题色 */
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="text"] {
  background-color: var(--theme-input) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-foreground) !important;
}

[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="text"]:focus {
  border-color: var(--theme-ring) !important;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--theme-ring) 20%, transparent) !important;
}

/* 控制面板样式 - 在暗色主题下使用主题变量 */
.control-panel {
  background: var(--theme-card);
  border-color: var(--theme-border);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .control-panel {
  background: var(--theme-gradient-card);
  border-color: var(--theme-card-border);
  backdrop-filter: blur(20px);
}

/* 进度条容器在暗色主题下的样式 */
[data-theme="dark"] #extract-progress-container,
[data-theme="dark"] #upload-progress-container {
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.95), 
    rgba(15, 23, 42, 0.9));
  border-color: rgba(129, 140, 248, 0.2);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.4), 
              0 2px 8px -4px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .control-panel.progress-container {
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.95), 
    rgba(15, 23, 42, 0.9));
  border-color: rgba(129, 140, 248, 0.2);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.4), 
              0 2px 8px -4px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .control-panel.progress-container::before {
  background: linear-gradient(90deg, 
    transparent, 
    rgba(129, 140, 248, 0.8), 
    transparent);
}

/* 暗色主题下的进度条样式 */
[data-theme="dark"] .progress-bar {
  background: linear-gradient(90deg, 
    #4f46e5 0%, 
    #8b5cf6 50%, 
    #d946ef 100%);
  box-shadow: 0 2px 12px -2px rgba(79, 70, 229, 0.5), 
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .progress-track {
  background: linear-gradient(to right, 
    rgba(79, 70, 229, 0.15), 
    rgba(139, 92, 246, 0.12), 
    rgba(217, 70, 239, 0.15));
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .progress-text {
  color: var(--theme-foreground);
}

[data-theme="dark"] .progress-status {
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 确保控制面板内的按钮在暗色主题下也有适当的样式 */
[data-theme="dark"] .control-panel button {
  background: var(--theme-muted);
  color: var(--theme-foreground);
  border-color: var(--theme-border);
}

[data-theme="dark"] .control-panel button:hover {
  background: var(--theme-border);
}

[data-theme="dark"] .control-panel button.bg-blue-600 {
  background: var(--theme-gradient-primary) !important;
  color: white !important;
}

[data-theme="dark"] .control-panel button.bg-blue-600:hover {
  background: linear-gradient(135deg, #4338ca, #7c3aed, #be185d) !important;
}

/* 滑块值徽章样式 */
.slider-value-badge {
  background: var(--theme-muted);
  border: 1px solid var(--theme-border);
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--theme-foreground);
  min-width: 2.5rem;
  text-align: center;
  box-shadow: var(--theme-shadow-sm);
}

[data-theme="dark"] .slider-value-badge {
  background: var(--theme-muted);
  border-color: var(--theme-border);
  color: var(--theme-foreground);
  box-shadow: var(--theme-shadow-md);
}

/* Parameter Slider Container - Aurora Style */
.parameter-slider-container {
  background: var(--theme-card);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.parameter-slider-container:hover {
  border-color: var(--theme-ring);
  box-shadow: var(--theme-shadow-aurora);
  transform: translateY(-1px);
}

[data-theme="dark"] .parameter-slider-container {
  background: var(--theme-glass-bg);
  backdrop-filter: var(--theme-glass-blur);
  border-color: var(--theme-glass-border);
}

[data-theme="dark"] .parameter-slider-container:hover {
  border-color: var(--theme-ring);
  box-shadow: var(--theme-shadow-aurora);
}

/* === Aurora UI Core Components === */

/* Frosted Glass Base Class */
.aurora-glass {
  background: var(--theme-glass-bg);
  backdrop-filter: var(--theme-glass-blur);
  -webkit-backdrop-filter: var(--theme-glass-blur);
  border: 1px solid var(--theme-glass-border);
  box-shadow: var(--theme-shadow-aurora);
}

[data-theme="dark"] .aurora-glass {
  background: rgba(28, 18, 58, 0.4);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-color: rgba(122, 77, 255, 0.3);
  box-shadow: 0 10px 40px -10px rgba(76, 42, 188, 0.3), 0 0 0 1px rgba(122, 77, 255, 0.2);
}

/* Aurora Glass Card */
.aurora-glass-card {
  background: var(--theme-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--theme-card-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--theme-shadow-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aurora-glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--theme-shadow-xl);
  border-color: var(--primary-color);
}

[data-theme="dark"] .aurora-glass-card {
  background: var(--theme-glass-bg);
  backdrop-filter: var(--theme-glass-blur);
  -webkit-backdrop-filter: var(--theme-glass-blur);
  border-color: var(--theme-glass-border);
}

/* Aurora Gradient Text */
.aurora-text-gradient {
  background: var(--theme-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: var(--font-bold);
}

/* Aurora Button System */
.aurora-btn-primary {
  background: var(--theme-gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  padding: 0.75rem 1.5rem;
  font-weight: var(--font-semibold);
  font-size: 0.875rem;
  box-shadow: var(--theme-shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.aurora-btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--theme-shadow-xl), 0 0 30px rgba(129, 140, 248, 0.4);
}

.aurora-btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.aurora-btn-secondary {
  background: var(--theme-muted-background);
  color: var(--theme-foreground);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-xl);
  padding: 0.75rem 1.5rem;
  font-weight: var(--font-medium);
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.aurora-btn-secondary:hover {
  background: var(--theme-gradient-primary);
  color: white;
  border-color: transparent;
  transform: translateY(-1px);
}

/* Aurora Status Tags */
.aurora-status-tag {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: var(--font-bold);
  border: 1px solid;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.aurora-status-success {
  background: color-mix(in oklab, var(--success-color) 20%, transparent);
  color: var(--success-color);
  border-color: var(--success-color);
}

.aurora-status-warning {
  background: color-mix(in oklab, var(--warning-color) 20%, transparent);
  color: var(--warning-color);
  border-color: var(--warning-color);
}

.aurora-status-error {
  background: color-mix(in oklab, var(--error-color) 20%, transparent);
  color: var(--error-color);
  border-color: var(--error-color);
}

.aurora-status-primary {
  background: color-mix(in oklab, var(--primary-color) 20%, transparent);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Aurora Input System */
.aurora-input {
  background: var(--theme-input);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  color: var(--theme-foreground);
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aurora-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary-color) 15%, transparent);
}

[data-theme="dark"] .aurora-input {
  background: var(--theme-glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: var(--theme-glass-border);
}

/* Tooltip暗色主题修复 */
[data-theme="dark"] .tooltip::after {
  background: #374151;
  color: #f9fafb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .tooltip::before {
  border-top-color: #374151;
}

/* Aurora Scroll System */
.aurora-scroll::-webkit-scrollbar {
  width: 8px;
}

.aurora-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.aurora-scroll::-webkit-scrollbar-thumb {
  background: var(--theme-gradient-primary);
  border-radius: 4px;
}

.aurora-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--theme-gradient-secondary);
}

/* Aurora Loading Animation */
.aurora-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: aurora-spin 1s linear infinite;
}

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

/* Aurora Pulse Animation */
.aurora-pulse {
  animation: aurora-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Aurora Glow Effect */
.aurora-glow {
  position: relative;
}

.aurora-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--theme-gradient-primary);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  filter: blur(6px);
}

.aurora-glow:hover::before {
  opacity: 0.7;
}
