/* ========================================
   Fang's Blog - 温暖极简风格
   有触感、有灵魂、拒绝千篇一律
   ======================================== */

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

:root {
    /* 温暖色调 */
    --bg-primary: #faf8f5;
    --bg-secondary: #f5f3f0;
    --text-primary: #2d2d2d;
    --text-secondary: #5a5a5a;
    --accent-warm: #e8a87c;
    --accent-light: #f0c4a4;
    --line-color: #d4cfc9;
    
    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 32px;
    --spacing-lg: 64px;
    --spacing-xl: 120px;
    
    /* 触感效果 */
    --shadow-soft: 0 2px 8px rgba(45, 45, 45, 0.08);
    --shadow-hover: 0 4px 16px rgba(45, 45, 45, 0.12);
    --border-radius: 8px;
}

/* 字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600&family=Noto+Sans+SC:wght@300;400;500&display=swap');

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* Canvas 背景 */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* 纸张纹理效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(232, 168, 124, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(240, 196, 164, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
}

/* 手绘装饰元素 */
.hand-drawn-decoration {
    position: absolute;
    opacity: 0.6;
    pointer-events: none;
}

.top-left {
    top: 100px;
    left: 20px;
    width: 80px;
    height: 80px;
}

.bottom-right {
    bottom: 100px;
    right: 20px;
    width: 100px;
    height: 100px;
}

.hand-drawn {
    width: 100%;
    height: 100%;
}

/* 导航 */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-xl);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: 'Noto Serif SC', serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
}

.logo-icon {
    width: 45px;
    height: 45px;
    transition: transform 0.3s ease;
}

.nav-logo:hover .logo-icon {
    transform: rotate(5deg);
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-warm);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* 主内容区 */
.main-content {
    padding-bottom: var(--spacing-xl);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    margin-bottom: var(--spacing-xl);
    min-height: 500px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.hero-greeting {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.hand-drawn-text {
    font-style: italic;
}

.hero-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 4rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: var(--spacing-sm);
}

.hero-decoration {
    width: 200px;
    height: 60px;
}

.hand-drawn-line {
    width: 100%;
    height: 100%;
}

.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-drawing {
    width: 100%;
    max-width: 350px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(45, 45, 45, 0.1));
}

/* 文章预览区 */
.articles-preview {
    margin-bottom: var(--spacing-xl);
}

.section-header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.hand-drawn-underline {
    width: 80px;
    height: 20px;
    margin: 0 auto;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

/* 文章卡片 */
.article-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-light);
}

.card-illustration {
    margin-bottom: var(--spacing-sm);
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-drawing {
    width: 100%;
    height: 100%;
    max-width: 200px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 300;
}

.card-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.6;
}

.card-link {
    text-decoration: none;
    color: var(--accent-warm);
    font-size: 0.9rem;
    font-weight: 500;
    align-self: flex-start;
    transition: color 0.3s ease;
}

.card-link:hover {
    color: var(--text-primary);
}

/* 关于区域 */
.about-section {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.about-illustration {
    display: flex;
    justify-content: center;
}

.about-drawing {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.about-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-primary);
}

.about-description {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.8;
}

.about-skills {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-xs);
}

.skill-tag {
    padding: 6px 16px;
    background-color: var(--bg-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    border: 1px solid var(--line-color);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: var(--accent-warm);
    color: white;
    border-color: var(--accent-warm);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--line-color);
}

.footer-decoration {
    width: 100px;
    height: 30px;
    margin: 0 auto var(--spacing-sm);
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* 响应式设计 */
@media (max-width: 768px) {
    :root {
        --spacing-xl: 80px;
        --spacing-lg: 48px;
    }
    
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .hero-content {
        order: 2;
    }
    
    .hero-illustration {
        order: 1;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-skills {
        justify-content: center;
    }
    
    .nav {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeIn 0.6s ease forwards;
}

.article-card:nth-child(1) {
    animation-delay: 0.1s;
}

.article-card:nth-child(2) {
    animation-delay: 0.2s;
}

.article-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* 滚动效果 */
main {
    scroll-behavior: smooth;
}

/* 选择效果 */
::selection {
    background-color: var(--accent-warm);
    color: white;
}

::-moz-selection {
    background-color: var(--accent-warm);
    color: white;
}