/* ===== 全局变量 ===== */
:root {
    --primary-400: #22d3ee;
    --primary-500: #06b6d4;
    --primary-600: #0891b2;
    --secondary-400: #60a5fa;
    --secondary-500: #3b82f6;
    --secondary-600: #2563eb;
    --bg-page: #f4f6fa;
    --bg-card: #ffffff;
    --text-title: #0f172a;
    --text-desc: #334155;
    --text-muted: #5f6c80;
    --border-light: #e9edf2;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 12px rgba(0,20,40,0.04);
    --shadow-hover: 0 12px 24px -8px rgba(6,182,212,0.15);
    --radius-card: 20px;
    --transition: all 0.2s ease;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --touch-target-size: 44px;
}

/* 深色模式 */
body.dark-mode {
    --bg-page: #0b1423;
    --bg-card: #1a2639;
    --text-title: #e2eafc;
    --text-desc: #b9d1ec;
    --text-muted: #7f9bc0;
    --border-light: #2d3f5e;
    --shadow-hover: 0 12px 24px -8px #06b6d440;
}

/* 紫罗兰主题 */
body.theme-violet {
    --primary-400: #c084fc;
    --primary-500: #a855f7;
    --primary-600: #9333ea;
    --secondary-400: #f0abfc;
    --secondary-500: #e879f9;
    --secondary-600: #d946ef;
}

/* 薄荷绿主题 */
body.theme-mint {
    --primary-400: #6ee7b7;
    --primary-500: #34d399;
    --primary-600: #10b981;
    --secondary-400: #a7f3d0;
    --secondary-500: #6ee7b7;
    --secondary-600: #34d399;
}

/* 落日橙主题 */
body.theme-sunset {
    --primary-400: #fdba74;
    --primary-500: #fb923c;
    --primary-600: #f97316;
    --secondary-400: #fed7aa;
    --secondary-500: #fdba74;
    --secondary-600: #fb923c;
}

/* 樱花粉主题 */
body.theme-sakura {
    --primary-400: #f9a8d4;
    --primary-500: #f472b6;
    --primary-600: #ec4899;
    --secondary-400: #fbcfe8;
    --secondary-500: #f9a8d4;
    --secondary-600: #f472b6;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-page);
    color: var(--text-title);
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* 头部样式 */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-md) 0;
    margin-bottom: var(--space-lg);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-600);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.site-title i {
    color: var(--secondary-500);
}

.mobile-menu-toggle {
    display: none;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    color: var(--text-title);
    width: var(--touch-target-size);
    height: var(--touch-target-size);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
}

.main-nav {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-title);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    transition: var(--transition);
    font-size: 0.9rem;
    white-space: nowrap;
}

.main-nav a:hover {
    background: var(--primary-500);
    color: white;
}

.main-nav a.active {
    background: var(--primary-500);
    color: white;
    font-weight: 500;
}

.theme-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.theme-toggle {
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    color: var(--text-title);
    width: var(--touch-target-size);
    height: var(--touch-target-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    border-color: var(--primary-400);
    transform: rotate(15deg);
}

.theme-palette {
    position: relative;
}

.theme-palette-btn {
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    color: var(--text-title);
    width: var(--touch-target-size);
    height: var(--touch-target-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.theme-palette-btn:hover {
    border-color: var(--primary-400);
}

.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-card);
    padding: var(--space-sm);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 200;
    width: 180px;
    margin-top: 8px;
}

.theme-dropdown.show {
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    border-radius: 30px;
    transition: var(--transition);
}

.theme-option:hover {
    background: var(--bg-page);
}

.theme-option.active {
    background: var(--primary-500);
    color: white;
}

.theme-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
}

@media (max-width: 700px) {
    .mobile-menu-toggle {
        display: flex;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: var(--space-md);
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
        z-index: 100;
    }
    .main-nav.show {
        display: flex;
    }
    .main-nav a {
        padding: var(--space-sm);
        width: 100%;
        text-align: center;
    }
    .header-inner {
        flex-wrap: wrap;
    }
    .theme-controls {
        margin-left: auto;
    }
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
    color: var(--text-muted);
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--primary-600);
}
.breadcrumb i {
    font-size: 0.7rem;
}

/* 页脚 */
footer {
    text-align: center;
    padding: var(--space-xl) 0;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    margin-top: var(--space-xl);
}
footer a {
    color: var(--primary-500);
    text-decoration: none;
    margin: 0 var(--space-xs);
}
footer a:hover {
    text-decoration: underline;
}

.loading, .error-state, .empty-state {
    text-align: center;
    padding: var(--space-xl);
    background: var(--bg-card);
    border-radius: var(--radius-card);
}
