/* ===== Global Styles ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --radius: 12px;
    --max-width: 1200px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header & Navigation ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 22px;
    color: var(--text);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 10px;
    font-size: 18px;
}

.logo-text {
    color: var(--text);
}

.main-nav {
    display: flex;
    gap: 4px;
}

.main-nav a {
    color: var(--text);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--bg-alt);
    color: var(--primary);
}

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

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* ===== Main Content ===== */
main.container {
    flex: 1;
    padding: 32px 20px;
}

/* Home Hero */
.hero {
    background: linear-gradient(135deg, #eff6ff 0%, #fef3c7 100%);
    border-radius: var(--radius);
    padding: 48px 40px;
    margin-bottom: 40px;
    text-align: center;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 12px;
    color: var(--text);
}

.hero p {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title h2 {
    font-size: 24px;
    position: relative;
    padding-left: 14px;
}

.section-title h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background: var(--primary);
    border-radius: 2px;
}

.section-title a {
    font-size: 14px;
    color: var(--text-light);
}

/* Featured Articles */
.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.featured-main {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.3s;
}

.featured-main:hover {
    transform: translateY(-2px);
}

.featured-main img {
    width: 100%;
    height: 360px;
    object-fit: cover;
}

.featured-main .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
}

.featured-main .overlay h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.featured-main .overlay .meta {
    font-size: 13px;
    opacity: 0.85;
}

.featured-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.featured-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    flex: 1;
    cursor: pointer;
    transition: transform 0.3s;
}

.featured-item:hover {
    transform: translateY(-2px);
}

.featured-item img {
    width: 100%;
    height: 100%;
    min-height: 170px;
    object-fit: cover;
}

.featured-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
}

.featured-item .overlay h4 {
    font-size: 15px;
    line-height: 1.4;
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.article-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.3s;
}

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

.article-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-card .card-body {
    padding: 18px;
}

.article-card .category-tag {
    display: inline-block;
    font-size: 12px;
    color: var(--primary);
    background: #eff6ff;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-weight: 500;
}

.article-card h3 {
    font-size: 17px;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text);
}

.article-card .excerpt {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-light);
}

/* Article Detail */
.article-detail {
    max-width: 760px;
    margin: 0 auto;
}

.article-detail .breadcrumb {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.article-detail .category-tag {
    display: inline-block;
    font-size: 13px;
    color: var(--primary);
    background: #eff6ff;
    padding: 4px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

.article-detail h1 {
    font-size: 32px;
    line-height: 1.3;
    margin-bottom: 16px;
}

.article-detail .article-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.article-detail .cover-image {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 32px;
}

.article-detail .article-content {
    font-size: 17px;
    line-height: 1.85;
    color: #334155;
}

.article-detail .article-content p {
    margin-bottom: 20px;
}

.article-detail .article-content h2 {
    font-size: 24px;
    margin: 36px 0 16px;
    color: var(--text);
}

.article-detail .article-content h3 {
    font-size: 20px;
    margin: 28px 0 12px;
    color: var(--text);
}

.article-detail .article-content ul,
.article-detail .article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-detail .article-content li {
    margin-bottom: 10px;
}

.article-detail .article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 24px 0;
    background: var(--bg-alt);
    border-radius: 0 8px 8px 0;
    color: var(--text-light);
    font-style: italic;
}

.article-detail .article-content img {
    border-radius: 8px;
    margin: 24px 0;
}

.article-detail .article-content a {
    text-decoration: underline;
}

/* Related Articles */
.related-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.related-section h3 {
    font-size: 22px;
    margin-bottom: 24px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Category Page */
.category-header {
    margin-bottom: 32px;
}

.category-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.category-header p {
    color: var(--text-light);
}

/* Info Pages */
.info-page {
    max-width: 800px;
    margin: 0 auto;
}

.info-page h1 {
    font-size: 32px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.info-page .content {
    font-size: 16px;
    line-height: 1.85;
    color: #334155;
}

.info-page .content h2 {
    font-size: 22px;
    margin: 32px 0 14px;
    color: var(--text);
}

.info-page .content h3 {
    font-size: 18px;
    margin: 24px 0 10px;
    color: var(--text);
}

.info-page .content p {
    margin-bottom: 16px;
}

.info-page .content ul,
.info-page .content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.info-page .content li {
    margin-bottom: 8px;
}

.info-page .content a {
    text-decoration: underline;
}

.contact-card {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 28px;
    margin: 24px 0;
}

.contact-card p {
    margin-bottom: 12px !important;
}

.contact-card strong {
    color: var(--text);
}

/* Footer */
.site-footer {
    background: #1e293b;
    color: #cbd5e1;
    margin-top: 60px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 48px 20px;
}

.footer-col h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 16px;
}

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

.footer-col ul li {
    margin-bottom: 10px;
    font-size: 14px;
}

.footer-col a {
    color: #cbd5e1;
}

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

.footer-desc {
    font-size: 14px;
    line-height: 1.7;
    margin-top: 12px;
    color: #94a3b8;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding: 20px 0;
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
}

.footer-bottom a {
    color: #cbd5e1;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 0;
    color: var(--text-light);
}

.not-found {
    text-align: center;
    padding: 80px 0;
}

.not-found h1 {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
    .featured-side {
        flex-direction: row;
    }
    .featured-item img {
        min-height: 140px;
    }
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .menu-toggle {
        display: flex;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 12px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .main-nav.open {
        display: flex;
    }
    .main-nav a {
        padding: 12px 14px;
    }
    .hero {
        padding: 32px 20px;
    }
    .hero h1 {
        font-size: 26px;
    }
    .hero p {
        font-size: 15px;
    }
    .featured-main img {
        height: 240px;
    }
    .featured-side {
        flex-direction: column;
    }
    .article-grid {
        grid-template-columns: 1fr;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
    .article-detail h1 {
        font-size: 24px;
    }
    .article-detail .article-content {
        font-size: 16px;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}
