/* 
 * 主样式表
 * 包含网站的基本样式、布局和颜色方案
 */

/* ---------- 基本设置 ---------- */
:root {
    /* 主色调 */
    --primary-color: #333;
    --secondary-color: #666;
    --accent-color: #f0f0f0;
    --background-color: #ffffff;
    --text-color: #333;
    --link-color: #007bff;
    --link-hover-color: #0056b3;
    
    /* 字体 */
    --font-family: 'Noto Sans SC', sans-serif;
    
    /* 间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* 过渡效果 */
    --transition-speed: 0.3s;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

a:hover {
    color: var(--link-hover-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- 加载屏幕 ---------- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- 按钮样式 ---------- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: #000;
    color: white;
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ---------- 头部导航 ---------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: all var(--transition-speed) ease;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.header.scrolled {
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav ul {
    display: flex;
}

.nav li {
    margin-left: 2rem;
}

.nav a {
    color: var(--primary-color);
    font-weight: 500;
    position: relative;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed) ease;
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

/* ---------- 英雄区域 ---------- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 var(--spacing-lg);
    overflow: hidden;
}

.hero-content {
    width: 50%;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-lg);
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
}

.hero-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    z-index: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* ---------- 章节通用样式 ---------- */
section {
    padding: var(--spacing-xl) var(--spacing-lg);
}

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

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.section-header p {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* ---------- 精选作品 ---------- */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.work-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed) ease;
}

.work-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.work-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: all var(--transition-speed) ease;
}

.work-item:hover img {
    transform: scale(1.05);
}

.work-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    transform: translateY(0);
    transition: all var(--transition-speed) ease;
}

.work-info h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.work-info p {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    opacity: 0.8;
}

.view-more {
    color: white;
    font-weight: 500;
    display: inline-block;
    position: relative;
}

.view-more::after {
    content: '→';
    margin-left: 5px;
    transition: all var(--transition-speed) ease;
}

.view-more:hover::after {
    margin-left: 10px;
}

/* ---------- 关于我预览 ---------- */
.about-preview {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.about-content {
    flex: 1;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.about-content p {
    margin-bottom: var(--spacing-md);
}

.about-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ---------- 最新文章 ---------- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.article-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed) ease;
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.article-image {
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-speed) ease;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: var(--spacing-md);
}

.article-content h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
}

.article-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.article-excerpt {
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
    color: var(--secondary-color);
}

.read-more {
    font-weight: 500;
    position: relative;
}

.read-more::after {
    content: '→';
    margin-left: 5px;
    transition: all var(--transition-speed) ease;
}

.read-more:hover::after {
    margin-left: 10px;
}

.view-all {
    text-align: center;
}

/* ---------- 社交媒体连接 ---------- */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg);
    border-radius: 10px;
    transition: all var(--transition-speed) ease;
    background-color: #f8f8f8;
}

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

.social-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-icon svg {
    width: 30px;
    height: 30px;
    transition: all var(--transition-speed) ease;
}

.social-item span {
    font-weight: 500;
    color: var(--primary-color);
}

.xiaohongshu:hover {
    background-color: #ff2442;
    color: white;
}

.xiaohongshu:hover .social-icon svg {
    fill: #ff2442;
}

.weibo:hover {
    background-color: #e6162d;
    color: white;
}

.weibo:hover .social-icon svg {
    fill: #e6162d;
}

.wechat:hover {
    background-color: #07c160;
    color: white;
}

.wechat:hover .social-icon svg {
    fill: #07c160;
}

.instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.instagram:hover .social-icon svg {
    fill: #bc1888;
}

/* ---------- 页脚 ---------- */
.footer {
    background-color: #f8f8f8;
    padding-top: var(--spacing-xl);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.footer-logo {
    margin-bottom: var(--spacing-lg);
}

.footer-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xl);
}

.footer-links h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
}

.footer-links ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-links ul li a {
    color: var(--secondary-color);
}

.footer-links ul li a:hover {
    color: var(--primary-color);
}

.footer-contact p {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-xs);
}

.footer-bottom {
    text-align: center;
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-lg);
    border-top: 1px solid #eee;
}

.footer-bottom p {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ---------- 响应式设计 ---------- */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .about-preview {
        flex-direction: column;
    }
    
    .about-image {
        width: 100%;
        margin-top: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: white;
        padding: 80px 20px 20px;
        transition: all 0.4s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav ul {
        flex-direction: column;
    }
    
    .nav li {
        margin: 0 0 20px 0;
    }
    
    .menu-toggle {
        display: flex;
        z-index: 101;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        height: auto;
        padding-top: 100px;
        padding-bottom: 50px;
    }
    
    .hero-content {
        width: 100%;
        margin-bottom: 50px;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        position: relative;
        width: 100%;
        height: 50vh;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-links {
        flex-direction: column;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .works-grid,
    .articles-grid,
    .social-grid {
        grid-template-columns: 1fr;
    }
} 