:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

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

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

.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 68px;
}

.logo a {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.logo img {
    height: 36px;
    width: auto;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 4px;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    font-weight: 500;
    transition: all var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: rgba(99,102,241,0.08);
}

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

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 0 0 1.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

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

.breadcrumb .separator {
    display: inline-block;
    margin: 0 8px;
    color: var(--text-light);
    user-select: none;
    font-size: 0.75rem;
}

.breadcrumb .current {
    color: var(--text);
    font-weight: 500;
}

.site-main {
    padding: 2.5rem 0;
    min-height: calc(100vh - 300px);
}

.site-footer {
    background: var(--bg-dark);
    color: #cbd5e1;
    padding: 3rem 0 0;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 2rem;
}

.footer-brand h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.footer-brand p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-links h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.875rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.25rem 0;
    text-align: center;
}

.footer-bottom p {
    color: #64748b;
    font-size: 0.825rem;
}

.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all var(--transition);
    z-index: 90;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, #a78bfa 100%);
    border-radius: var(--radius-lg);
    padding: 3.5rem 3rem;
    margin-bottom: 2.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.05rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    max-width: 600px;
    line-height: 1.7;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
}

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

.article-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.article-image {
    position: relative;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.article-content {
    padding: 1.25rem 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-content h3 {
    margin-bottom: 0.6rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
}

.article-content h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition);
}

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

.article-meta {
    color: var(--text-light);
    font-size: 0.825rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.article-meta .author::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--primary-light);
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.article-meta .category a {
    background: rgba(99,102,241,0.08);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-meta .category a:hover {
    background: rgba(99,102,241,0.15);
}

.excerpt {
    color: var(--text-secondary);
    margin-top: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-detail,
.page-detail {
    width: 100%;
}

.article-detail > article,
.page-detail > article {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.article-detail h1 {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.article-detail .article-meta {
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.article-detail .article-image {
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.article-detail .article-image img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--radius);
}

.content-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
}

.content-body h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

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

.content-body p {
    margin-bottom: 1.25rem;
}

.content-body ul, .content-body ol {
    margin: 1rem 0 1.25rem 1.5rem;
}

.content-body li {
    margin-bottom: 0.4rem;
}

.content-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: rgba(99,102,241,0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.content-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.content-body code {
    background: rgba(99,102,241,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

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

.content-body img {
    border-radius: var(--radius-sm);
    margin: 1rem 0;
}

.content-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.content-body a:hover {
    color: var(--primary-dark);
}

.article-tags {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.article-tags .tag {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(99,102,241,0.06);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.825rem;
    font-weight: 500;
    transition: all var(--transition);
}

.article-tags .tag:hover {
    background: rgba(99,102,241,0.12);
}

.category-page .category-header,
.search-page .search-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.category-page h1,
.search-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.category-desc {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.search-count {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.page-detail h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.page-detail .page-image {
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.page-detail .page-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
}

.page-meta {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.875rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 2.5rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.04);
}

.pagination .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.925rem;
    transition: all var(--transition);
}

.btn:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.no-content {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    font-size: 1rem;
}

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.error-content {
    text-align: center;
}

.error-content h1 {
    font-size: 6rem;
    color: var(--primary);
    font-weight: 800;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.auth-container {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--bg);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.auth-link {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.925rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

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

.article-card {
    animation: fadeInUp 0.4s ease both;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }
.article-card:nth-child(7) { animation-delay: 0.35s; }
.article-card:nth-child(8) { animation-delay: 0.4s; }
.article-card:nth-child(9) { animation-delay: 0.45s; }
.article-card:nth-child(10) { animation-delay: 0.5s; }

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        padding: 1rem 0;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav a {
        display: block;
        padding: 12px 24px;
        border-radius: 0;
    }

    .main-nav a:hover {
        background: rgba(99,102,241,0.06);
    }

    .hero {
        padding: 2rem 1.5rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

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

    .article-detail > article,
    .page-detail > article {
        padding: 1.5rem;
    }

    .article-detail h1,
    .page-detail h1 {
        font-size: 1.4rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .category-page .category-header,
    .search-page .search-header {
        padding: 1.5rem;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        height: 56px;
    }

    .site-main {
        padding: 1.5rem 0;
    }

    .hero {
        padding: 1.5rem 1.25rem;
        border-radius: var(--radius);
    }

    .hero h1 {
        font-size: 1.3rem;
    }
}
