* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a6fa5;
    --primary-light: #6b8fc7;
    --primary-dark: #34507a;
    --secondary-color: #7c9885;
    --accent-color: #d4a574;
    --text-color: #2c3e50;
    --text-light: #5a6c7d;
    --bg-color: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e1e5e9;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --radius: 12px;
    --radius-sm: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

nav a {
    color: var(--text-light);
    font-weight: 500;
    position: relative;
    padding: 8px 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

main {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 100px 0 80px;
    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,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 24px;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.hero .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 24px;
}

.hero-bio {
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.85;
    line-height: 1.8;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.social-link svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    color: var(--text-color);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 16px auto 0;
    border-radius: 2px;
}

.intro-section {
    background: var(--bg-white);
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.intro-text h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.intro-text p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.skill-tag {
    background: var(--bg-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.intro-image {
    position: relative;
}

.intro-image img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.blog-card-image {
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 24px;
}

.blog-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.blog-card-category {
    color: var(--primary-color);
    font-weight: 500;
}

.blog-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.blog-card h3 a:hover {
    color: var(--primary-color);
}

.blog-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--bg-color);
    color: var(--text-light);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.tag:hover {
    background: var(--primary-light);
    color: white;
}

.categories-section,
.tags-section {
    background: var(--bg-white);
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.category-card:hover {
    background: var(--primary-color);
    color: white;
}

.category-card:hover .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.category-card:hover .category-icon {
    background: rgba(255, 255, 255, 0.2);
}

.category-info h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--bg-white);
    padding: 2px 10px;
    border-radius: 10px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.tags-cloud .tag {
    padding: 8px 20px;
    font-size: 0.95rem;
    cursor: pointer;
}

.tags-cloud .tag:hover {
    background: var(--primary-color);
    color: white;
}

.tags-cloud .tag.large {
    font-size: 1.1rem;
    padding: 10px 24px;
}

.tags-cloud .tag.medium {
    font-size: 1rem;
}

.contact-section {
    background: var(--bg-color);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 1.3rem;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    color: var(--text-light);
}

.contact-item svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
}

.contact-form {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

.article-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 0 60px;
    margin-top: 70px;
}

.article-header .container {
    max-width: 800px;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 16px;
}

.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
}

.article-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.article-tags .tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
}

.article-content h2 {
    font-size: 1.6rem;
    margin: 40px 0 20px;
    color: var(--text-color);
}

.article-content h3 {
    font-size: 1.3rem;
    margin: 30px 0 16px;
    color: var(--text-color);
}

.article-content p {
    margin-bottom: 20px;
    color: var(--text-light);
}

.article-content pre {
    background: var(--text-color);
    color: #f8f8f2;
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 20px 0;
}

.article-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 24px;
    margin: 24px 0;
    color: var(--text-light);
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 10px;
    color: var(--text-light);
}

.article-content img {
    border-radius: var(--radius-sm);
    margin: 24px 0;
}

.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    max-width: 800px;
    margin: 0 auto;
}

.article-nav a {
    padding: 16px 24px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.article-nav a:hover {
    background: var(--primary-color);
    color: white;
}

.related-posts {
    background: var(--bg-color);
    padding: 60px 0;
}

footer {
    background: var(--text-color);
    color: white;
    padding: 40px 0;
    text-align: center;
}

footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-color);
}

footer a:hover {
    text-decoration: underline;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
    margin-top: 70px;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.page-header p {
    opacity: 0.9;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font-weight: 500;
    box-shadow: var(--shadow);
}

.pagination a:hover,
.pagination .current {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 992px) {
    .intro-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .intro-image {
        order: -1;
        max-width: 400px;
        margin: 0 auto;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    nav ul {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        box-shadow: var(--shadow);
        display: none;
    }

    nav ul.active {
        display: flex;
    }

    nav ul li {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding: 80px 0 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section {
        padding: 60px 0;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .article-nav {
        flex-direction: column;
    }

    .contact-form {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .avatar {
        width: 120px;
        height: 120px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .category-list {
        grid-template-columns: 1fr;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-color);
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    z-index: 2000;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
