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

/* 主题变量定义 */
:root {
    /* 白色主题变量 */
    --bg-color-light: #f9f9f9;
    --text-color-light: #333;
    --container-bg-light: #ffffff;
    --header-gradient-start-light: #6a11cb;
    --header-gradient-end-light: #2575fc;
    --hero-gradient-start-light: rgba(106, 17, 203, 0.8);
    --hero-gradient-end-light: rgba(37, 117, 252, 0.8);
    --philosophy-bg-light: #f0f5ff;
    --about-bg-light: #f5f7ff;
    --card-bg-light: #ffffff;
    --card-hover-light: #f8f9ff;
    --card-shadow-light: 0 5px 15px rgba(0,0,0,0.08);
    --card-hover-shadow-light: 0 10px 25px rgba(0,0,0,0.15);
    --card-border-light: #eee;
    --text-secondary-light: #666;
    --text-accent-light: #2575fc;
    --footer-gradient-start-light: #2575fc;
    --footer-gradient-end-light: #6a11cb;
    --highlight-border-light: #2575fc;
    
    /* 暗色主题变量 */
    --bg-color-dark: #1a1a1a;
    --text-color-dark: #e0e0e0;
    --container-bg-dark: #222222;
    --header-gradient-start-dark: #4a0072;
    --header-gradient-end-dark: #0039a6;
    --hero-gradient-start-dark: rgba(74, 0, 114, 0.8);
    --hero-gradient-end-dark: rgba(0, 57, 166, 0.8);
    --philosophy-bg-dark: #1e1e2e;
    --about-bg-dark: #1e1e2e;
    --card-bg-dark: #2d2d2d;
    --card-hover-dark: #3a3a3a;
    --card-shadow-dark: 0 5px 15px rgba(0,0,0,0.3);
    --card-hover-shadow-dark: 0 10px 25px rgba(0,0,0,0.4);
    --card-border-dark: #444;
    --text-secondary-dark: #aaa;
    --text-accent-dark: #4fc3f7;
    --footer-gradient-start-dark: #0039a6;
    --footer-gradient-end-dark: #4a0072;
    --highlight-border-dark: #4fc3f7;
}

/* 主题类选择器 */
body.light-theme {
    background-color: var(--bg-color-light);
    color: var(--text-color-light);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-theme {
    background-color: var(--bg-color-dark);
    color: var(--text-color-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background 0.3s ease;
}

.light-theme header {
    background: linear-gradient(135deg, var(--header-gradient-start-light) 0%, var(--header-gradient-end-light) 100%);
    color: white;
}

.dark-theme header {
    background: linear-gradient(135deg, var(--header-gradient-start-dark) 0%, var(--header-gradient-end-dark) 100%);
    color: white;
}

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

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.light-theme nav ul li a {
    color: white;
}

.dark-theme nav ul li a {
    color: white;
}

.light-theme nav ul li a:hover {
    opacity: 0.8;
}

.dark-theme nav ul li a:hover {
    opacity: 0.8;
}

/* 主要内容区 */
main {
    min-height: calc(100vh - 140px);
}

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 5rem 0;
    margin-bottom: 3rem;
    transition: background 0.3s ease;
}

.light-theme .hero {
    background: linear-gradient(var(--hero-gradient-start-light), var(--hero-gradient-end-light)), url('https://images.unsplash.com/photo-1499951360447-b19be8fe80f5?ixlib=rb-4.0.3') no-repeat center center/cover;
    color: white;
}

.dark-theme .hero {
    background: linear-gradient(var(--hero-gradient-start-dark), var(--hero-gradient-end-dark)), url('https://images.unsplash.com/photo-1499951360447-b19be8fe80f5?ixlib=rb-4.0.3') no-repeat center center/cover;
    color: white;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 哲学部分 */
.philosophy-section {
    padding: 3rem 0;
    transition: background-color 0.3s ease;
}

.light-theme .philosophy-section {
    background-color: var(--philosophy-bg-light);
}

.dark-theme .philosophy-section {
    background-color: var(--philosophy-bg-dark);
}

.light-theme .philosophy-section h2 {
    color: var(--text-accent-light);
}

.dark-theme .philosophy-section h2 {
    color: var(--text-accent-dark);
}

.philosophy-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.light-theme .philosophy-content {
    color: #555;
}

.dark-theme .philosophy-content {
    color: #ccc;
}

.philosophy-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.7;
}

.light-theme .philosophy-highlight {
    background: var(--container-bg-light);
    border-left: 5px solid var(--highlight-border-light);
}

.dark-theme .philosophy-highlight {
    background: var(--container-bg-dark);
    border-left: 5px solid var(--highlight-border-dark);
}

.philosophy-highlight {
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: background 0.3s ease, border 0.3s ease;
}

.light-theme .philosophy-highlight p {
    color: var(--text-accent-light);
}

.dark-theme .philosophy-highlight p {
    color: var(--text-accent-dark);
}

.philosophy-highlight p {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

/* 分类区域 */
.category-section {
    padding: 3rem 0;
    transition: background-color 0.3s ease;
}

.light-theme .category-section {
    background-color: var(--container-bg-light);
}

.dark-theme .category-section {
    background-color: var(--container-bg-dark);
}

.light-theme .category-section h2 {
    color: var(--text-accent-light);
}

.dark-theme .category-section h2 {
    color: var(--text-accent-dark);
}

.category-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.light-theme .category-section p {
    color: var(--text-secondary-light);
}

.dark-theme .category-section p {
    color: var(--text-secondary-dark);
}

.category-section p {
    text-align: center;
    margin-bottom: 2rem;
}

/* 百度地球区域 */
.earth-section {
    padding: 3rem 0;
    background-color: #000;
    color: white;
}

.earth-section h2,
.earth-section p {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.earth-section h2 {
    color: #4fc3f7;
}

.earth-container {
    width: 100%;
    height: 600px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background-color: #000;
    position: relative;
}

.baidu-earth {
    width: 100%;
    height: 100%;
}

/* 网站网格布局 */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.site-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
}

.site-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.site-card h3 {
    margin-bottom: 0.8rem;
    color: #2575fc;
}

.site-card h3 a {
    text-decoration: none;
    color: #2575fc;
    font-size: 1.3rem;
    transition: color 0.3s;
}

.site-card h3 a:hover {
    color: #1a5bb5;
    text-decoration: underline;
}

.site-card p {
    color: #666;
    line-height: 1.5;
}

/* 关于区域 */
.about-section {
    padding: 3rem 0;
    margin-top: 2rem;
    transition: background-color 0.3s ease;
}

.light-theme .about-section {
    background-color: var(--about-bg-light);
}

.dark-theme .about-section {
    background-color: var(--about-bg-dark);
}

.light-theme .about-section h2 {
    color: var(--text-accent-light);
}

.dark-theme .about-section h2 {
    color: var(--text-accent-dark);
}

.about-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.light-theme .about-section p {
    color: #555;
}

.dark-theme .about-section p {
    color: #ccc;
}

.about-section p {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    transition: background 0.3s ease;
}

.light-theme footer {
    background: linear-gradient(135deg, var(--footer-gradient-start-light) 0%, var(--footer-gradient-end-light) 100%);
    color: white;
}

.dark-theme footer {
    background: linear-gradient(135deg, var(--footer-gradient-start-dark) 0%, var(--footer-gradient-end-dark) 100%);
    color: white;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 网站卡片样式 */
.light-theme .site-card {
    background: var(--card-bg-light);
    border: 1px solid var(--card-border-light);
    box-shadow: var(--card-shadow-light);
}

.dark-theme .site-card {
    background: var(--card-bg-dark);
    border: 1px solid var(--card-border-dark);
    box-shadow: var(--card-shadow-dark);
}

.site-card {
    border-radius: 10px;
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s ease, border 0.3s ease;
}

.light-theme .site-card:hover {
    box-shadow: var(--card-hover-shadow-light);
}

.dark-theme .site-card:hover {
    box-shadow: var(--card-hover-shadow-dark);
}

.site-card:hover {
    transform: translateY(-5px);
}

.light-theme .site-card h3 {
    color: var(--text-accent-light);
}

.dark-theme .site-card h3 {
    color: var(--text-accent-dark);
}

.site-card h3 {
    margin-bottom: 0.8rem;
}

.light-theme .site-card h3 a {
    color: var(--text-accent-light);
}

.dark-theme .site-card h3 a {
    color: var(--text-accent-dark);
}

.site-card h3 a {
    text-decoration: none;
    font-size: 1.3rem;
    transition: color 0.3s;
}

.light-theme .site-card h3 a:hover {
    color: #1a5bb5;
}

.dark-theme .site-card h3 a:hover {
    color: #81d4fa;
}

.site-card h3 a:hover {
    text-decoration: underline;
}

.light-theme .site-card p {
    color: var(--text-secondary-light);
}

.dark-theme .site-card p {
    color: var(--text-secondary-dark);
}

.site-card p {
    line-height: 1.5;
}

/* 主题切换按钮样式 */
.theme-toggle-container {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

.light-theme .theme-toggle {
    color: white;
}

.dark-theme .theme-toggle {
    color: white;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sun-icon,
.moon-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.light-theme .sun-icon {
    opacity: 1;
    transform: rotate(0);
}

.light-theme .moon-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.dark-theme .sun-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.dark-theme .moon-icon {
    opacity: 1;
    transform: rotate(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .theme-toggle-container {
        margin-top: 1rem;
        align-self: center;
    }
    
    nav ul li {
        margin: 0 1rem;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .earth-container {
        height: 400px;
    }
    
    .site-grid {
        grid-template-columns: 1fr;
    }
    
    .category-section h2,
    .about-section h2,
    .philosophy-section h2 {
        font-size: 1.7rem;
    }
    
    .earth-section h2,
    .earth-section p {
        font-size: 1.5rem;
    }
    
    .philosophy-highlight p {
        font-size: 1.1rem;
    }
}