:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --bg: #ffffff;
    --surface: #f8fafc;
    --text: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navbar */
.navbar {
    height: 4rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 50;
    backdrop-filter: blur(8px);
    background-opacity: 0.8;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

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

#theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: var(--transition);
}

#theme-toggle:hover {
    background-color: var(--surface);
}

/* Hero */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.05), transparent);
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

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

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

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

.btn-secondary:hover {
    background-color: var(--border);
}

/* Sections */
.section {
    padding: 5rem 0;
}

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

/* Articles */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.article-card {
    background-color: var(--surface);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}

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

.article-image {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.category {
    color: var(--primary);
    font-weight: 600;
}

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

.article-content p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 2rem;
    background-color: var(--surface);
    border-radius: 1rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.project-card:hover {
    border-color: var(--primary);
}

.project-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.project-card h3 {
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.project-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

/* About */
.about-section {
    background-color: var(--surface);
    border-radius: 2rem;
    padding: 4rem;
    text-align: center;
}

.about-text p {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    font-size: 1.125rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary);
}

/* Footer */
.footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

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

.beian-link {
    opacity: 0.7;
    transition: var(--transition);
}

.beian-link:hover {
    opacity: 1;
}

/* Animations */
.animate-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .nav-links {
        display: none;
    }
}