:root {
    --primary: #379fd3;
    --secondary: #8f39ac;
    --gradient: linear-gradient(135deg, #379fd3 0%, #8f39ac 100%);
    --bg: #f8f9fb;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ===== HEADER ===== */
.site-header {
    background: var(--gradient);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-logo img {
    height: 45px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav a {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.15s;
}

.header-nav a:hover { opacity: 1; text-decoration: none; }

.lang-switch {
    display: inline-flex;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    overflow: hidden;
}

.lang-switch a {
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.7;
    transition: all 0.15s;
}

.lang-switch a.active {
    background: rgba(255,255,255,0.2);
    opacity: 1;
}

.lang-switch a:hover { opacity: 1; text-decoration: none; }

/* ===== HERO ===== */
.hero {
    background: var(--gradient);
    padding: 60px 24px 80px;
    text-align: center;
    color: #fff;
}

.hero-inner {
    max-width: 760px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
}

/* ===== SEARCH ===== */
.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: var(--font);
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    outline: none;
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    text-align: left;
}

.search-results.active { display: block; }

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}

.search-result-item:hover { background: #f0f4f8; }
.search-result-item:last-child { border-bottom: none; }

.search-result-item .title {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.search-result-item .category {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== CATEGORY CARDS ===== */
.category-section {
    max-width: 1200px;
    margin: -40px auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.category-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    border-color: var(--primary);
}

.category-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.category-card-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.category-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.category-card .article-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.category-card .description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.category-card .card-arrow {
    margin-top: auto;
    padding-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== FAQ SECTION ===== */
.faq-section {
    max-width: 800px;
    margin: 0 auto 80px;
    padding: 0 24px;
}

.faq-section h2 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
    user-select: none;
}

.faq-question:hover { background: #f8f9fb; }

.faq-question .faq-toggle {
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.2s;
}

.faq-item.open .faq-question .faq-toggle { transform: rotate(180deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 24px;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding-bottom: 18px;
}

.faq-answer p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== CONTENT AREA ===== */
.content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { opacity: 0.5; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ===== ARTICLE LIST (category page) ===== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-list-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.article-list-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.article-list-item h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.article-list-item p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== ARTICLE PAGE ===== */
.article-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: start;
}

.article-sidebar {
    position: sticky;
    top: 88px;
}

.article-sidebar h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.article-sidebar ul {
    list-style: none;
}

.article-sidebar ul li {
    margin-bottom: 6px;
}

.article-sidebar ul li a {
    font-size: 14px;
    color: var(--text-muted);
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.15s;
}

.article-sidebar ul li a:hover {
    background: #f0f4f8;
    color: var(--primary);
    text-decoration: none;
}

.article-sidebar ul li a.active {
    background: rgba(55,159,211,0.1);
    color: var(--primary);
    font-weight: 600;
}

.article-content {
    max-width: 760px;
}

.article-content h1 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.article-content .meta-badges {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-priority-high { background: #fee2e2; color: #dc2626; }
.badge-priority-medium { background: #fef3c7; color: #d97706; }
.badge-priority-low { background: #dbeafe; color: #2563eb; }
.badge-tier { background: #e0e7ff; color: #6366f1; }

.article-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.article-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 20px 0 8px;
}

.article-content p {
    margin-bottom: 14px;
    font-size: 15px;
    color: #374151;
}

.article-content ol, .article-content ul {
    margin: 0 0 16px 20px;
}

.article-content ol li, .article-content ul li {
    margin-bottom: 6px;
    font-size: 15px;
    color: #374151;
}

.article-content strong { color: var(--text); }

.article-content .info-box {
    background: #f0f6fc;
    border: 1px solid #b3d4f0;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 20px 0;
}

.article-content .info-box h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.article-content table th,
.article-content table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.article-content table th {
    background: #f8f9fb;
    font-weight: 600;
}

.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.article-nav a {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #1a1a2e;
    color: #fff;
    padding: 48px 24px 24px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-brand img {
    height: 32px;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 14px;
    opacity: 0.7;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

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

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: color 0.15s;
}

.footer-col ul li a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 13px;
    opacity: 0.6;
}

/* ===== MOBILE MENU ===== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .article-sidebar {
        position: static;
        display: none;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .header-inner { height: 56px; }

    .header-nav { display: none; }

    .header-nav.mobile-open {
        display: flex;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--gradient);
        flex-direction: column;
        padding: 16px 24px;
        gap: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    .mobile-menu-toggle { display: block; }

    .hero { padding: 40px 20px 60px; }
    .hero h1 { font-size: 26px; }
    .hero p { font-size: 16px; }

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

    .category-section { padding: 0 16px; }

    .content-area { padding: 24px 16px 60px; }

    .article-content h1 { font-size: 24px; }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .faq-section { padding: 0 16px; }
    .faq-section h2 { font-size: 22px; }
}
