/* ===== Theme System ===== */
:root {
    --primary: #00c7be;
    --primary-dark: #00a89c;
    --primary-light: #00d4c8;
    --secondary: #8b5cf6;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-muted: #9ca3af;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f3f4f6;
    --bg-card: #ffffff;
    --bg-hover: #f9fafb;
    --glass: #ffffff;
    --glass-border: #e5e7eb;
    --glass-bg: rgba(255,255,255,0.95);
    --border: #e5e7eb;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --text-dark: #ffffff;
    --text-gray: #9ca3af;
    --text-muted: rgba(255,255,255,0.5);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --bg-primary: #0a0a0a;
    --bg-secondary: #171717;
    --bg-tertiary: #262626;
    --bg-card: #171717;
    --bg-hover: rgba(255,255,255,0.05);
    --glass: rgba(255,255,255,0.06);
    --glass-border: rgba(255,255,255,0.1);
    --glass-bg: rgba(23,23,23,0.95);
    --border: rgba(255,255,255,0.1);
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
}

[data-theme="dark"] body {
    background: var(--bg-primary);
    color: var(--text-dark);
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    background: var(--bg-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Theme Toggle Button ===== */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--glass);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-gray);
    transition: all 0.2s;
}
.theme-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}
.theme-toggle .light-icon { display: none; }
.theme-toggle .dark-icon { display: block; }
[data-theme="dark"] .theme-toggle .light-icon { display: block; }
[data-theme="dark"] .theme-toggle .dark-icon { display: none; }

/* ===== Common Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-gray); }

/* ===== Toast Notification ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow), 0 8px 32px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: slideInRight 0.3s ease;
    pointer-events: auto;
    min-width: 280px;
    max-width: 400px;
}
.toast.removing { animation: slideOutRight 0.3s ease forwards; }
.toast i { font-size: 18px; flex-shrink: 0; }
.toast-success i { color: var(--success); }
.toast-error i { color: var(--danger); }
.toast-warning i { color: var(--warning); }
.toast-info i { color: var(--primary); }
.toast-message { flex: 1; color: var(--text-dark); }
