/* 基础样式重置 */
* {
    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.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand h1 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #3498db;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn.primary {
    background: #3498db;
    color: white;
}

.btn.primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn.secondary {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn.secondary:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

.btn.small {
    padding: 8px 16px;
    font-size: 12px;
}

/* 首页横幅 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    margin-top: 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 300;
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.7s forwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1s ease 0.9s forwards;
}

/* 章节通用样式 */
section {
    padding: 80px 0;
}

section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

section h2.animate-in {
    opacity: 1;
    transform: translateY(0);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #3498db;
    border-radius: 2px;
}

/* 项目展示 */
.projects {
    background: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.project-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, #f1f2f6 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.project-card:hover .project-image::before {
    left: 100%;
}

.placeholder-image {
    color: #999;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

.project-card:hover .project-content h3 {
    color: #3498db;
}

.project-content p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag:hover {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.project-links {
    display: flex;
    gap: 1rem;
}

/* 技术分享文章 */
.articles {
    background: #f8f9fa;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #3498db;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.article-card:hover::before {
    transform: scaleY(1);
}

.article-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.12);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.date {
    color: #7f8c8d;
}

.category {
    color: #3498db;
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 12px;
    font-size: 0.8rem;
}

.article-card h3 {
    margin-bottom: 1rem;
}

.article-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.article-card h3 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease;
}

.article-card h3 a:hover {
    color: #3498db;
}

.article-card h3 a:hover::after {
    width: 100%;
}

.article-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 关于我 */
.about {
    background: white;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.skills {
    margin-bottom: 3rem;
}

.skill-category {
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.skill-category.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.skill-category h4 {
    color: #34495e;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: #3498db;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.skill-tag:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.contact-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    position: relative;
    overflow: hidden;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(155, 89, 182, 0.05) 100%);
    z-index: 1;
}

.contact-info p {
    margin-bottom: 0.5rem;
    color: #555;
    position: relative;
    z-index: 2;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #ecf0f1;
    position: relative;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background: #3498db;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.footer-section ul li:hover {
    transform: translateX(5px);
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #3498db;
}

/* 备案信息样式 */
.beian-info {
    border-top: 1px solid #34495e;
    padding-top: 20px;
    margin-top: 20px;
}

.beian-content {
    text-align: center;
}

.copyright {
    color: #bdc3c7;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.beian-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.beian-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.beian-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.2), transparent);
    transition: left 0.5s ease;
}

.beian-link:hover::before {
    left: 100%;
}

.beian-link:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.beian-icon {
    font-size: 1rem;
}

.beian-text {
    font-weight: 400;
    position: relative;
    z-index: 2;
}

.beian-note {
    color: #7f8c8d;
    font-size: 0.75rem;
    margin-top: 10px;
    font-style: italic;
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 动画延迟 */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }

.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; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(6) { animation-delay: 0.6s; }

.skill-category:nth-child(1) { animation-delay: 0.2s; }
.skill-category:nth-child(2) { animation-delay: 0.4s; }
.skill-category:nth-child(3) { animation-delay: 0.6s; }

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .projects-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }

    section {
        padding: 60px 0;
    }

    section h2 {
        font-size: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .beian-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .skill-tags,
    .tech-tags,
    .article-tags {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .project-content,
    .article-card {
        padding: 1rem;
    }

    section h2 {
        font-size: 1.8rem;
    }
}

/* 滚动行为 */
html {
    scroll-behavior: smooth;
}

/* 链接悬停效果 */
a {
    transition: all 0.3s ease;
}

/* 焦点样式 */
button:focus,
.btn:focus,
a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 打字机光标效果 */
.hero-content h2::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
