/* --- 全局样式与变量定义 --- */
:root {
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --primary-gradient: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 20px 25px -5px rgba(102, 126, 234, 0.15), 0 8px 10px -6px rgba(102, 126, 234, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* --- 头部样式 --- */
header {
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    padding: 5rem 1rem;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.25rem;
    opacity: 0.9;
    font-weight: 300;
}

/* --- 主内容区样式 --- */
main {
    max-width: 960px;
    margin: -3rem auto 0 auto;
    padding: 0 1rem 3rem 1rem;
    position: relative;
    z-index: 10;
}

section {
    background: var(--bg-white);
    margin-bottom: 2.5rem;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

section p {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* --- "学习内容" 卡片网格 --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.category-item {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.category-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-start);
}

.category-item h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.category-item p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* --- "在线工具" 特别高亮 --- */
.tools .tool-item { /* 增加选择器权重 */
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tools .tool-item:hover {
    transform: scale(1.03);
    box-shadow: 0 25px 50px -12px rgba(102, 126, 234, 0.35);
}

.tools .tool-item h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.tools .tool-item p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- 按钮样式 --- */
.btn {
    text-decoration: none;
    display: inline-block;
    padding: 14px 35px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* 主按钮样式 (工具) */
.tools .btn {
    background: var(--bg-white);
    color: var(--primary-end);
}
.tools .btn:hover {
    background: var(--bg-light);
}

/* === 新增：次要按钮样式 (数据故事) === */
.btn.btn-secondary {
    background: var(--primary-gradient);
    color: white;
}
.btn.btn-secondary:hover {
    box-shadow: var(--shadow-lg);
}


/* === 新增：数据故事模块样式 === */
.featured-project .project-card {
    padding: 2.5rem;
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid var(--primary-start); /* 简洁的顶部高亮 */
    background: var(--bg-white);
}

.featured-project .project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.project-card h3 {
    font-size: 1.75rem;
    color: var(--text-dark);
    font-weight: 600;
}

.project-card .subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: -0.25rem;
    margin-bottom: 1.5rem;
}

.project-card .description {
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}


/* --- 页脚样式 --- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
}

.beian-info a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.beian-info a:hover {
    color: var(--primary-start);
    text-decoration: underline;
}

/* --- 响应式设计 --- */
@media (max-width: 768px) {
    header {
        padding: 4rem 1rem;
        clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%);
    }
    header h1 {
        font-size: 2.2rem;
    }
    header p {
        font-size: 1.1rem;
    }
    main {
        margin-top: -2rem;
    }
    section {
        padding: 1.5rem;
    }
    section h2 {
        font-size: 1.6rem;
    }
}