:root {
    --primary: #e31b23;
    --primary-dark: #c4161d;
    --primary-light: #fff0f0;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f8f9fb;
    --white: #ffffff;
    --shadow: 0 2px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.1);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sd: #10b981;
    --smp: #3b82f6;
    --sma: #8b5cf6;
}

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

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 32px;
    color: var(--primary);
}

.logo-text strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.logo-text small {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

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

.main-nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all .2s;
}

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

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 13px;
    width: 180px;
    font-family: var(--font);
}

.header-search button {
    background: var(--primary);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
}

.header-search button .material-symbols-outlined { font-size: 18px; }

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

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 50%, #e31b23 100%);
    color: white;
    padding: 60px 0;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}

.hero-label {
    display: inline-block;
    background: rgba(255,255,255,.15);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero p {
    font-size: 16px;
    opacity: .85;
    margin-bottom: 28px;
    max-width: 520px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stats {
    display: flex;
    gap: 12px;
}

.stat-card {
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius);
    padding: 20px 24px;
    text-align: center;
    min-width: 100px;
    transition: transform .2s;
}

.stat-card:hover { transform: translateY(-2px); }
.stat-level { font-size: 12px; font-weight: 700; opacity: .8; display: block; }
.stat-card strong { font-size: 32px; font-weight: 800; display: block; line-height: 1; margin: 4px 0; }
.stat-card span:last-child { font-size: 12px; opacity: .7; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: white; border-color: rgba(255,255,255,.5); }
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-block { width: 100%; justify-content: center; }

/* Sections */
.section { padding: 48px 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.see-all {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.card-grid-sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}

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

.card-image {
    position: relative;
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f0f0f0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

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

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.badge-sd { background: var(--sd); }
.badge-smp { background: var(--smp); }
.badge-sma { background: var(--sma); }

.card-body { padding: 16px; }

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.type-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

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

.card-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.card-views {
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-views .material-symbols-outlined { font-size: 14px; }

/* Featured Grid */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.featured-main .card-image { aspect-ratio: 16/9; }
.featured-main .card-title { font-size: 18px; }

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

.featured-side .card {
    display: grid;
    grid-template-columns: 140px 1fr;
}

.featured-side .card-image { aspect-ratio: auto; height: 100%; }

/* Sidebar */
.sidebar { position: sticky; top: 80px; }

.sidebar-widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.category-list { list-style: none; }

.category-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    transition: color .2s;
}

.category-list li:last-child a { border-bottom: none; }
.category-list li a:hover { color: var(--primary); }

.cat-level {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.cat-name { flex: 1; }
.cat-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.popular-list { list-style: none; }

.popular-list li a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.popular-list li:last-child a { border-bottom: none; }

.popular-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.popular-meta {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--text-muted);
}

.popular-meta .material-symbols-outlined { font-size: 14px; }

.sidebar-cta {
    background: linear-gradient(135deg, var(--primary), #2d1b69);
    color: white;
}

.sidebar-cta h3 { font-size: 16px; margin-bottom: 8px; }
.sidebar-cta p { font-size: 13px; opacity: .85; margin-bottom: 16px; }
.sidebar-cta .btn-primary { background: white; color: var(--primary); }

/* Filter */
.filter-tabs { display: flex; gap: 4px; }

.filter-tabs a {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all .2s;
}

.filter-tabs a:hover,
.filter-tabs a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Page Header */
.page-header {
    background: var(--white);
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

.page-header h1 {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    margin-bottom: 8px;
}

.page-desc { color: var(--text-muted); font-size: 15px; }

.filter-bar {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.search-result { font-size: 14px; color: var(--text-muted); }

/* Detail Page */
.detail-page { padding: 32px 0 48px; }

.detail-header { margin-bottom: 24px; }

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
}

.detail-badges span {
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--bg);
    font-weight: 600;
}

.detail-header h1 {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-meta .material-symbols-outlined { font-size: 16px; }

.detail-image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.detail-excerpt {
    font-size: 17px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.detail-content {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 32px;
}

.detail-content h3 { margin: 24px 0 12px; font-size: 20px; }
.detail-content ul, .detail-content ol { padding-left: 24px; margin-bottom: 16px; }
.detail-content li { margin-bottom: 6px; }

.download-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--white);
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.download-box h3 { font-size: 16px; margin-bottom: 4px; }
.download-box p { font-size: 13px; color: var(--text-muted); }

.related-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.pagination a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--white);
    transition: all .2s;
}

.pagination a:hover,
.pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .material-symbols-outlined {
    font-size: 64px;
    opacity: .3;
    margin-bottom: 16px;
}

.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }

/* Footer */
.site-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,.8);
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding: 48px 0;
}

.footer-brand h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 12px;
}

.footer-brand p { font-size: 14px; line-height: 1.7; }

.footer-links h4 {
    color: white;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.footer-links a {
    display: block;
    font-size: 14px;
    padding: 6px 0;
    transition: color .2s;
}

.footer-links a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .featured-grid { grid-template-columns: 1fr; }
    .featured-side .card { grid-template-columns: 120px 1fr; }
    .hero .container { grid-template-columns: 1fr; }
    .hero-stats { justify-content: flex-start; }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 12px 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

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

    .header-search { display: none; }

    .header-inner { position: relative; }

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

    .featured-side .card { grid-template-columns: 1fr; }
    .featured-side .card-image { aspect-ratio: 16/10; }

    .hero { padding: 40px 0; }
    .hero-stats { flex-wrap: wrap; }
}
