/* Modern CSS Variables - Purple Gradient Theme */
:root {
    /* Primary Colors - Purple Gradient */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #f3e8ff;
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    
    /* Accent Colors */
    --accent: #06d6a0;
    --accent-dark: #059669;
    --accent-gradient: linear-gradient(135deg, #06d6a0 0%, #059669 100%);
    
    /* Status Colors */
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --success: #10b981;
    --success-light: #ecfdf5;
    --info: #3b82f6;
    --info-light: #eff6ff;
    
    /* Background Colors - Purple Gradient */
    --background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 50%, #e9d5ff 100%);
    --background-secondary: #f9fafb;
    --background-gradient: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 50%, #e9d5ff 100%);
    
    /* Surface Colors */
    --surface: rgba(255, 255, 255, 0.9);
    --surface-elevated: rgba(255, 255, 255, 0.95);
    --surface-glass: rgba(255, 255, 255, 0.85);
    --surface-hover: rgba(248, 250, 252, 0.8);
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border: rgba(226, 232, 240, 0.8);
    --border-light: rgba(241, 245, 249, 0.6);
    --border-strong: rgba(203, 213, 225, 0.9);
    
    /* Interactive States */
    --hover: rgba(248, 250, 252, 0.8);
    --hover-elevated: rgba(139, 92, 246, 0.08);
    --focus: rgba(139, 92, 246, 0.2);
    --active: rgba(139, 92, 246, 0.12);
    
    /* Border Radius */
    --radius-xs: 0.25rem;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-colored: 0 10px 15px -3px rgba(99, 102, 241, 0.1), 0 4px 6px -4px rgba(99, 102, 241, 0.1);
    
    /* Blur Effects */
    --blur-xs: blur(2px);
    --blur-sm: blur(4px);
    --blur-md: blur(8px);
    --blur-lg: blur(16px);
    --blur-xl: blur(24px);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
}

/* Dark Mode - Modern Indigo Fusion Theme */
@media (prefers-color-scheme: dark) {
    :root {
        /* Background Colors */
        --background: #0f172a;
        --background-secondary: #1e293b;
        --background-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        
        /* Surface Colors */
        --surface: #1e293b;
        --surface-elevated: #334155;
        --surface-glass: rgba(30, 41, 59, 0.85);
        --surface-hover: #334155;
        
        /* Text Colors */
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --text-inverse: #0f172a;
        
        /* Border Colors */
        --border: #334155;
        --border-light: #475569;
        --border-strong: #64748b;
        
        /* Interactive States */
        --hover: #334155;
        --hover-elevated: rgba(99, 102, 241, 0.15);
        --focus: rgba(99, 102, 241, 0.3);
        --active: rgba(99, 102, 241, 0.2);
        
        /* Status Colors - Dark Mode Variants */
        --danger-light: #1f1315;
        --warning-light: #1f1611;
        --success-light: #0f1b14;
        --info-light: #0f1419;
        
        /* Shadows - Enhanced for Dark Mode */
        --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
        --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
        --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.5);
        --shadow-colored: 0 10px 15px -3px rgba(99, 102, 241, 0.2), 0 4px 6px -4px rgba(99, 102, 241, 0.2);
    }
}

/* Modern Navigation Bar Styles */
.modern-navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: var(--surface-glass);
    backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

/* Brand Section */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.svg-studio .brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease;
}

.brand-icon:hover {
    transform: scale(1.05);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Desktop Navigation */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--hover-elevated);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-icon {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: all 0.2s ease;
    z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    color: var(--text-primary);
    background: var(--hover);
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.action-btn.secondary:hover {
    background: var(--hover);
    color: var(--text-primary);
}

.action-btn.primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: var(--hover);
}

.hamburger-line {
    width: 1.5rem;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(0.375rem, 0.375rem);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(0.375rem, -0.375rem);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav.active {
    max-height: 100vh;
}

.mobile-nav-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-link {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    transition: color 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary);
}

.mobile-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.mobile-nav-section .mobile-nav-link {
    padding-left: 1rem;
    border-bottom: none;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.action-btn.full-width {
    width: 100%;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Responsive Design */
@media (max-width: 768px) { .svg-studio 
    body {
        padding-top: 3.5rem;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .navbar-actions .action-btn {
        display: none;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
    
    .brand-text {
        font-size: 1.125rem;
    }
}

@media (max-width: 640px) { .svg-studio 
    .language-switcher {
        display: none;
    }
    
    .navbar-container {
        padding: 0 0.75rem;
    }
}

/* Scoped Base styles */
.svg-studio * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.svg-studio {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 4rem;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.svg-studio .app-container {
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.12) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.svg-studio .main-card {
    width: 100%;
    max-width: 1500px;
    background: var(--surface-glass);
    backdrop-filter: var(--blur-md);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(139, 92, 246, 0.1);
    border: 1px solid var(--border-light);
    overflow: hidden;
    position: relative;
}

/* Header styles */
.header {
    background: var(--primary-gradient);
    color: white;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.header-text h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.header-text p {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.01em;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Content layout */
.svg-studio .content {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 450px;
    gap: 2.5rem;
    transition: all 0.3s ease;
    min-height: 600px;
    align-items: start;
}

.svg-studio .left-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    backdrop-filter: var(--blur-sm);
}

.svg-studio .right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    backdrop-filter: var(--blur-sm);
    position: sticky;
    top: 2rem;
}

.svg-studio .left-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.svg-studio .right-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.svg-studio .input-section, .svg-studio .output-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .content {
        grid-template-columns: 1fr 400px;
        gap: 2rem;
    }
}

@media (max-width: 1024px) { .svg-studio 
    .content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .right-panel {
        order: -1;
        position: static;
    }
    
    .left-panel,
    .right-panel {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
        gap: 1rem;
    }
    
    .app-container {
        padding: 1rem;
    }
    
    .left-panel,
    .right-panel {
        padding: 1rem;
        border-radius: var(--radius-md);
    }
}

/* Input styles */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface-glass);
    backdrop-filter: var(--blur-sm);
    color: var(--text-primary);
    position: relative;
}

.input-group textarea {
    height: 200px;
    resize: vertical;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-lg);
    transform: translateY(-1px);
    background: var(--surface-elevated);
}

.input-group input:hover, .input-group textarea:hover {
    border-color: var(--primary-light);
    background: var(--hover-elevated);
    box-shadow: var(--shadow-sm);
}

/* Drag drop hint */
.drag-drop-hint {
    margin-top: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    color: #0369a1;
    font-size: 13px;
    text-align: center;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.drag-drop-hint:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15);
}

/* Upload area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface);
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-md);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: color var(--transition-fast);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-area:hover .upload-icon {
    color: var(--primary);
}

.upload-btn {
    background: none;
    border: none;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}

.upload-btn:hover {
    color: var(--primary-dark);
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}



/* Preview section */
.svg-studio .preview-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.svg-studio .preview-container {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.svg-studio .preview-container.has-content {
    border-color: var(--primary);
    border-style: solid;
    background: var(--surface-elevated);
    box-shadow: var(--shadow-md);
}

.svg-studio .preview-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.svg-studio .preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.svg-studio .preview-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--background);
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

.svg-studio .file-size {
    color: var(--text-muted);
}

.svg-studio .status-indicator {
    color: var(--text-secondary);
    font-weight: 500;
}

/* 导出功能Tab区域样式 */
.svg-studio .export-tabs-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.svg-studio .tab-header {
    display: flex;
    align-items: center;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.svg-studio .tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.svg-studio .tab-btn:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.svg-studio .tab-btn.active {
    color: var(--primary);
    background: var(--surface);
}

.svg-studio .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.svg-studio .size-badge {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

.svg-studio .tab-content {
    display: none;
    padding: 1.5rem;
}

.svg-studio .tab-content.active {
    display: block;
}

/* 预设尺寸选择器样式 */
.svg-studio .preset-sizes {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.svg-studio .preset-sizes h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.svg-studio .preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.svg-studio .preset-btn {
    background: var(--surface-glass);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.svg-studio .preset-btn:hover {
    border-color: var(--primary);
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.svg-studio .preset-btn.active {
    background: var(--primary-gradient);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.svg-studio .preset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.svg-studio .preset-btn:hover::before {
    left: 100%;
}

/* Card styles */
.svg-studio .card {
    background: var(--surface-glass);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.svg-studio .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.svg-studio .card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-2xl);
    transform: translateY(-2px);
    background: var(--surface-elevated);
}

.svg-studio .card:hover::before {
    transform: scaleX(1);
}

.svg-studio .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.svg-studio .card-header:hover {
    background: var(--hover);
}

.svg-studio .card-header h3 {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.svg-studio .card-toggle {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    font-size: 1.2rem;
}

.svg-studio .card[data-expanded="true"] .card-toggle {
    transform: rotate(180deg);
}

.svg-studio .card-content {
    padding: 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
}

.svg-studio .card[data-expanded="true"] .card-content {
    max-height: 1000px;
    opacity: 1;
}

.size-badge {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

/* Size inputs */
.svg-studio .size-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Button styles */
.svg-studio .btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

.svg-studio .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.svg-studio .btn:hover::before {
    left: 100%;
}

.svg-studio .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.svg-studio .btn:disabled::before {
    display: none;
}

.svg-studio .btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--primary-light);
}

.svg-studio .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: var(--accent-gradient);
}

.svg-studio .btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.svg-studio .btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.svg-studio .btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--hover-elevated);
    border-color: var(--primary-light);
}

.svg-studio .btn-accent {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--accent-light);
}

.svg-studio .btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--success) 0%, var(--accent) 100%);
}

.svg-studio .btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Export buttons */
.svg-studio .export-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

/* Batch section */
.svg-studio .batch-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.svg-studio .batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.svg-studio .batch-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.svg-studio .batch-controls {
    display: flex;
    gap: 0.5rem;
}

.svg-studio .size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.svg-studio .size-option {
    background: var(--surface-glass);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.svg-studio .size-option:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.svg-studio .size-option.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.svg-studio .size-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.svg-studio .size-option:hover::before {
    left: 100%;
}

.svg-studio .selected-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.5rem;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.svg-studio .btn-select-all {
    background-color: var(--primary);
    color: white;
}

.svg-studio .btn-clear-all {
    background-color: var(--surface-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.svg-studio .batch-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.svg-studio #openExportSelectorBtn {
    grid-column: span 2;
}

/* Toast notifications */
.svg-studio .error-toast, .svg-studio .svg-studio .success-toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    font-weight: 500;
}

.svg-studio .error-toast {
    background: var(--danger);
    color: white;
}

.success-toast {
    background: var(--accent);
    color: white;
}

.svg-studio .error-toast.show, .svg-studio .success-toast.show {
    transform: translateX(0);
}

/* Paste indicator */
.svg-studio .paste-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.svg-studio .paste-indicator.show {
    opacity: 1;
}

.upload-area.paste-ready {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    transform: scale(1.02);
}

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

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

/* 全窗口拖拽视觉反馈 */
.svg-studio.drag-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0.1;
    z-index: 9998;
    pointer-events: none;
    animation: dragPulse 1.5s ease-in-out infinite;
}

.svg-studio.drag-active::after {
    content: '拖拽 SVG 文件到任意位置上传';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-xl);
    padding: 2rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    z-index: 9999;
    pointer-events: none;
    box-shadow: var(--shadow-xl);
    animation: dragBounce 0.6s ease-out;
}

@keyframes dragPulse {
    0%, 100% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.2;
    }
}

@keyframes dragBounce {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}



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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-text {
        order: 1;
    }
    
    .language-switcher {
        order: 2;
    }
    
    .app-container {
        padding: 1rem;
    }

    .content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .header-text h1 {
        font-size: 2rem;
    }

    .size-inputs {
        grid-template-columns: 1fr;
    }
    
    .export-buttons,
    .batch-buttons {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        padding: 0.875rem 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    /* 移动端拖拽提示调整 */
    body.drag-active::after {
        font-size: 1rem;
        padding: 1.5rem 2rem;
        max-width: 80%;
        word-wrap: break-word;
    }
    

}

@media (max-width: 640px) {
    .batch-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .size-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .preset-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 0.5rem;
    }
    
    .preset-btn {
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
    }
}

/* Header Styles */
.svg-studio .app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--surface-glass);
    backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.svg-studio .header-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.svg-studio .header-left {
    display: flex;
    align-items: center;
}

.svg-studio .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.3));
}

/* Added: Image logo sizing to handle large source images gracefully */
.svg-studio .brand-logo {
    height: 32px;
    max-height: 36px;
    width: auto;
    display: block;
}

.svg-studio .footer-logo-img {
    height: 20px;
    max-height: 24px;
    width: auto;
    display: block;
}

.svg-studio .brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.svg-studio .brand-subtitle {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary);
}

.svg-studio .header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.svg-studio .header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.125rem;
}

.header-btn:hover {
    background: var(--hover-elevated);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.header-btn:active {
    transform: translateY(0);
}

/* Language Selector Styles */
.svg-studio .language-selector {
    position: relative;
    display: inline-block;
}

.svg-studio .language-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 120px;
    height: 2.5rem;
    padding: 0 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    color: var(--text);
    gap: 0.5rem;
}

.language-btn:hover {
    background: var(--hover-elevated);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.language-btn:active {
    transform: translateY(0);
}

.svg-studio .current-lang {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.svg-studio .dropdown-arrow {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
    color: var(--text-secondary);
}

.svg-studio .language-selector.open .dropdown-arrow {
    transform: rotate(180deg);
}

.svg-studio .language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: var(--blur-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
    overflow: hidden;
}

.svg-studio .language-selector.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.svg-studio .language-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.svg-studio .language-option:last-child {
    border-bottom: none;
}

.svg-studio .language-option:hover {
    background: var(--hover);
}

.svg-studio .language-option.active {
    background: var(--primary-light);
    color: var(--primary);
}



.lang-name {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer Styles */
.svg-studio .app-footer {
    background: var(--surface-glass);
    backdrop-filter: var(--blur-md);
    border-top: 1px solid var(--border-light);
    margin-top: 4rem;
}

.svg-studio .footer-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 3rem 2rem 1.5rem;
}

.svg-studio .footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.svg-studio .footer-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.svg-studio .footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.svg-studio .footer-logo {
    font-size: 1.25rem;
}

.svg-studio .footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.svg-studio .footer-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.svg-studio .footer-center {
    display: flex;
    justify-content: center;
}

.svg-studio .footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.svg-studio .footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.svg-studio .footer-link:hover {
    color: var(--primary);
}

.svg-studio .footer-right {
    display: flex;
    justify-content: flex-end;
}

.svg-studio .footer-social {
    display: flex;
    gap: 0.75rem;
}

.svg-studio .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.svg-studio .social-link:hover {
    background: var(--hover-elevated);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.svg-studio .social-icon {
    font-size: 1rem;
}

.svg-studio .footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.svg-studio .footer-copyright {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.svg-studio .footer-copyright p {
    margin: 0;
}

.svg-studio .version-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--primary);
}

/* Layout Adjustments for Header and Footer */
.app-container {
    min-height: calc(100vh - 8rem); /* Subtract header and footer space */
}

/* Responsive Design for Header and Footer */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        height: 3.5rem;
    }
    
    .brand-title {
        font-size: 1.25rem;
    }
    
    .brand-subtitle {
        font-size: 0.75rem;
        padding: 0.125rem 0.375rem;
    }
    
    .header-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-center,
    .footer-right {
        justify-content: center;
    }
    
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-container {
        padding: 2rem 1rem 1rem;
    }
}

/* Modal (export selector) */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: var(--z-modal);
}
.modal.hidden { display: none; }
.modal:not(.hidden) { display: block; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: var(--blur-sm);
}
.modal-content {
    position: relative;
    width: min(720px, 92vw);
    margin: 8vh auto;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
}
.modal-header, .modal-footer {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}
.modal-footer { border-top: 1px solid var(--border-light); border-bottom: none; }
.modal-body { padding: 1rem 1.25rem; max-height: 60vh; overflow: auto; }
.modal-close { background: transparent; border: none; font-size: 1.25rem; color: var(--text-secondary); cursor: pointer; }

/* Export tree */
.tree-row { display: flex; align-items: center; padding: 0.5rem 0; border-bottom: 1px dashed var(--border-light); }
.tree-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.tree-icon { width: 1.25rem; display: inline-flex; justify-content: center; }
.tree-label { flex: 1; color: var(--text-primary); font-weight: 500; }
.tree-summary { color: var(--text-secondary); font-size: 0.875rem; }

@media (prefers-color-scheme: dark) {
  .modal-content { background: var(--surface); }
  .modal-backdrop { background: rgba(0,0,0,0.6); }
}

/* Enhanced Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
    animation: modalFadeIn 0.2s ease-out;
}

.modal.hidden { 
    display: none; 
}

.modal:not(.hidden) { 
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: backdropFadeIn 0.2s ease-out;
}

@keyframes backdropFadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

.modal-content {
    position: relative;
    width: min(800px, 95vw);
    max-height: 85vh;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    backdrop-filter: blur(20px);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.modal-close:hover {
    background: var(--hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem 2rem;
    max-height: 50vh;
    overflow-y: auto;
    background: var(--surface);
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: var(--surface-elevated);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

/* Enhanced Export Tree Styles */
.group-toolbar {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(255, 255, 255, 0.5) 100%);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--text-primary);
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
}

.group-toggle:hover {
    background: var(--hover);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.group-toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.tree-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.tree-row:hover {
    background: var(--hover);
    border-radius: 8px;
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    cursor: pointer;
}

.tree-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 6px;
    padding: 0.25rem;
}

.tree-label {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.tree-summary {
    color: var(--text-secondary);
    font-size: 0.875rem;
    background: var(--background-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.tree-item input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: rgba(17, 24, 39, 0.95);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .modal-header {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(17, 24, 39, 0.8) 100%);
    }
    
    .group-toolbar {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(17, 24, 39, 0.5) 100%);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .tree-row:hover {
        background: rgba(55, 65, 81, 0.3);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .group-toolbar {
        padding: 0.75rem;
    }
    
    .group-toggle {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}
