/**
 * theme.css - Dashboard 统一样式变量
 * 深色主题 + 绿色强调色 (#4ADE80)
 */
:root,
body.dark-theme {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #4ADE80;
    --accent-dark: #22C55E;
    --accent-light: #86efac;
    --border: #222222;
    --border-light: #333333;
    --error: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --sidebar-width: 260px;
    --sidebar-collapsed: 60px;
    --topbar-height: 60px;
    --primary: #4ADE80;
    --primary-hover: #22C55E;
    --primary-light: #86efac;
    --primary-rgb: 74, 222, 128;
    --primary-dark: #16a34a;
    --border-focus: #4ADE80;
    --border-strong: #333333;
    --bg-input: #111111;
    --radius-lg: 12px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --shadow-primary: 0 4px 12px rgba(74,222,128,0.15);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

body.light-theme {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #22c55e;
    --accent-dark: #16a34a;
    --accent-light: #86efac;
    --border: #e0e0e0;
    --border-light: #d0d0d0;
    --error: #dc2626;
    --warning: #d97706;
    --success: #16a34a;
    --primary: #22c55e;
    --primary-hover: #16a34a;
    --primary-light: #86efac;
    --primary-rgb: 34, 197, 94;
    --primary-dark: #15803d;
    --border-focus: #22c55e;
    --border-strong: #d0d0d0;
    --bg-input: #ffffff;
    --radius-lg: 12px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 12px rgba(34,197,94,0.15);
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

:root,
body.dark-theme {
    --bg-tertiary: #1a1a1a;
    --border-focus: #4ADE80;
    --border-strong: #333333;
    --bg-input: #1a1a1a;
    --error-light: rgba(239,68,68,0.15);
    --warning-light: rgba(245,158,11,0.15);
    --success-light: rgba(34,197,94,0.15);
    --info: #3B82F6;
    --info-light: rgba(59,130,246,0.15);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --radius-full: 9999px;
}

body.light-theme {
    --bg-tertiary: #F3F4F6;
    --border-focus: #22c55e;
    --border-strong: #d0d0d0;
    --bg-input: #ffffff;
    --error-light: #fee2e2;
    --warning-light: #fef3c7;
    --success-light: #d1fae5;
    --info: #3B82F6;
    --info-light: #dbeafe;
}

/* 桌面端最小宽度 */
@media (min-width: 1024px) {
    body {
        min-width: 1024px;
    }
    .app-container {
        min-width: 1024px;
    }
}

/* ============================================
   2026 Polish Layer - 深色毛玻璃 + 微渐变
   ============================================ */
:root,
body.dark-theme {
    --bg-primary: #050807;
    --bg-secondary: rgba(8, 12, 10, 0.86);
    --bg-card: rgba(15, 22, 18, 0.82);
    --bg-hover: rgba(74, 222, 128, 0.08);
    --surface-glass: rgba(14, 20, 17, 0.72);
    --surface-glass-strong: rgba(18, 28, 22, 0.88);
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.13);
    --border-strong: rgba(74, 222, 128, 0.24);
    --text-primary: #F5FFF8;
    --text-secondary: #B8C7BE;
    --text-muted: #718079;
    --accent: #4ADE80;
    --accent-dark: #22C55E;
    --accent-light: #BBF7D0;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 22px 60px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 28px 86px rgba(0, 0, 0, 0.44);
    --shadow-primary: 0 16px 42px rgba(74, 222, 128, 0.18);
    --radius-lg: 18px;
    --radius: 12px;
    --radius-sm: 9px;
}

body {
    background:
        radial-gradient(circle at 12% 8%, rgba(74, 222, 128, 0.13), transparent 28%),
        radial-gradient(circle at 82% 4%, rgba(96, 165, 250, 0.10), transparent 26%),
        radial-gradient(circle at 70% 85%, rgba(34, 197, 94, 0.08), transparent 32%),
        var(--bg-primary);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 72%);
}

::selection {
    background: rgba(74, 222, 128, 0.28);
    color: #fff;
}
