/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --code-bg: #1e293b;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

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

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

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

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 2rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    gap: 4rem;
}

.hero-content {
    max-width: 500px;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-decoration {
    flex-shrink: 0;
}

.code-block {
    background: var(--code-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 450px;
}

.code-block pre {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    color: #e2e8f0;
    overflow-x: auto;
}

.code-block .keyword {
    color: #c084fc;
}

.code-block .string {
    color: #86efac;
}

.code-block .comment {
    color: #64748b;
}

/* Articles Section */
.articles-section {
    padding: 5rem 0;
    background: var(--bg-color);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-icon {
    font-size: 4rem;
}

.article-content {
    padding: 1.5rem;
}

.article-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.article-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-content h3 a:hover {
    color: var(--primary-color);
}

.article-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-light);
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Categories Section */
.categories-section {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.article-count {
    color: var(--primary-color);
    font-weight: 500;
}

/* About Section */
.about-section {
    padding: 5rem 0;
    background: var(--bg-color);
}

.about-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about-content p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Footer */
.footer {
    padding: 2rem;
    background: var(--code-bg);
    color: #94a3b8;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-decoration {
        display: none;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}

/* Article Page Styles */
.article-page {
    padding-top: 100px;
    min-height: 100vh;
}

.article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 2rem;
    color: white;
    text-align: center;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.article-header .meta {
    opacity: 0.9;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.article-content h2 {
    font-size: 1.75rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.article-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-content pre {
    background: var(--code-bg);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-content code {
    font-family: 'Fira Code', monospace;
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-secondary);
    border-radius: 0 8px 8px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-content th,
.article-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.article-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 2rem;
}

.back-link:hover {
    text-decoration: underline;
}
