:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-bg: #eff6ff;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0891b2;
    --info-light: #cffafe;
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-gray: #f8fafc;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --container: 1200px;
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-gray);
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

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

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

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.main-nav { display: flex; gap: 2px; align-items: center; }

.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-bg);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
}

/* ==================== Banner ==================== */
.banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0;
    overflow: hidden;
}

.banner-slider {
    position: relative;
    overflow: hidden;
    aspect-ratio: 21/8;
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
}

.banner-item { display: none; width: 100%; height: 100%; }
.banner-item.active { display: block; }
.banner-item img { width: 100%; height: 100%; object-fit: cover; }
.banner-item a { display: block; width: 100%; height: 100%; position: relative; }

.banner-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
}
.banner-caption h3 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.banner-caption p { font-size: 14px; opacity: 0.9; }

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    background: var(--primary-dark);
}
.banner-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: var(--transition);
}
.banner-dots span.active { background: #fff; }

/* ==================== Sections ==================== */
.section { padding: 40px 0; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

.more-link {
    font-size: 13px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.more-link:hover { color: var(--primary); }

/* ==================== Content Grid ==================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.content-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.content-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
}
.content-card a { display: block; color: inherit; }

.card-img {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-gray);
}
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.content-card:hover .card-img img { transform: scale(1.03); }

.card-body { padding: 16px; }
.card-body h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 6px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.content-card:hover .card-body h3 { color: var(--primary); }

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

.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

/* ==================== Category Layout ==================== */
.category-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}
.category-main { min-width: 0; }

.content-list { display: flex; flex-direction: column; gap: 14px; }

.empty-tip {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    padding: 16px 0;
}
.pagination a, .pagination .page-info {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}
.pagination a.disabled { color: var(--text-muted); pointer-events: none; opacity: 0.5; }
.pagination .page-info { border: none; color: var(--text-muted); }

/* ==================== Sidebar ==================== */
.sidebar-block {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 16px;
}
.sidebar-block h3 {
    font-size: 15px;
    font-weight: 600;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.sidebar-nav li { margin-bottom: 1px; }
.sidebar-nav a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.sidebar-list li { margin-bottom: 8px; }
.sidebar-list a {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sidebar-list a:hover { color: var(--primary); }

/* ==================== Article Detail ==================== */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
}
.article-main { min-width: 0; }

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }

.article-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.article-header { padding: 28px 28px 20px; border-bottom: 1px solid var(--border-light); }
.article-header h1 { font-size: 22px; font-weight: 600; line-height: 1.5; margin-bottom: 10px; color: var(--text); }

.article-subtitle { font-size: 15px; color: var(--text-secondary); margin-bottom: 12px; }

.article-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.article-tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    display: inline-flex;
    padding: 3px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.tag:hover { background: var(--primary); color: #fff; }

.article-cover { margin-bottom: 0; }
.article-cover img { width: 100%; }

.article-content {
    padding: 28px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}
.article-content p { margin-bottom: 14px; }
.article-content img { border-radius: var(--radius); margin: 12px 0; max-width: 100%; }
.article-content h2 { font-size: 18px; font-weight: 600; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.article-content h3 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; }
.article-content ul, .article-content ol { padding-left: 20px; margin-bottom: 14px; }
.article-content li { margin-bottom: 4px; }
.article-content blockquote {
    border-left: 3px solid var(--primary);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--primary-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}
.article-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 3px; font-size: 13px; }
.article-content pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: var(--radius); overflow-x: auto; margin: 12px 0; }
.article-content pre code { background: none; padding: 0; color: inherit; }
.article-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.article-content th, .article-content td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.article-content th { background: var(--bg-gray); font-weight: 600; }

.article-nav {
    padding: 20px 28px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.article-nav > div { flex: 1; max-width: 48%; }
.article-nav-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.article-nav a { font-size: 13px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.article-nav a:hover { color: var(--primary); }

/* ==================== Links ==================== */
.links-section { background: #fff; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.links-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.link-item {
    padding: 6px 14px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.link-item:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

/* ==================== Footer ==================== */
.site-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 36px 0;
}
.footer-info p { font-size: 13px; margin-bottom: 6px; line-height: 1.6; }
.footer-info span { margin-right: 16px; }

/* ==================== Product Cards ==================== */
.product-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border); }
.product-card a { text-decoration: none; display: block; color: inherit; }

.product-img-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-gray);
}
.product-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.product-card:hover .product-img-wrapper img { transform: scale(1.03); }

.product-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; z-index: 2; }
.badge { padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; color: #fff; }
.badge-hot { background: var(--danger); }
.badge-recommend { background: var(--success); }

.product-info { padding: 14px 16px; }
.product-info h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-info .product-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.product-info .product-price { font-size: 18px; font-weight: 700; color: var(--danger); }
.product-info .product-price del { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.product-info .product-meta { display: flex; gap: 8px; font-size: 12px; padding-top: 8px; border-top: 1px solid var(--border-light); margin-top: 8px; color: var(--text-muted); }
.product-info .product-meta .product-category { background: var(--primary-light); color: var(--primary); padding: 1px 6px; border-radius: 3px; }

/* ==================== Page Hero ==================== */
.page-hero { padding: 40px 0; text-align: center; background: var(--primary-bg); border-bottom: 1px solid var(--border-light); }
.page-hero h1 { font-size: 24px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.page-hero p { font-size: 14px; color: var(--text-secondary); }

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

@media (max-width: 992px) {
    .category-layout, .article-layout { grid-template-columns: 1fr; }
    .category-sidebar, .article-sidebar { display: none; }
}

@media (max-width: 768px) {
    :root { --container: 100%; }
    .header-inner { height: 52px; }
    .logo { font-size: 18px; }
    .main-nav {
        display: none;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        flex-direction: column;
        padding: 16px;
        gap: 2px;
        z-index: 999;
        overflow-y: auto;
    }
    .main-nav.show { display: flex; }
    .nav-link { font-size: 15px; padding: 12px 16px; }
    .mobile-menu-btn { display: flex; }
    .content-grid { grid-template-columns: 1fr; gap: 12px; }
    .section { padding: 28px 0; }
    .section-header h2 { font-size: 16px; }
    .banner-slider { aspect-ratio: 16/9; }
    .banner-caption { padding: 20px; }
    .banner-caption h3 { font-size: 18px; }
    .article-header { padding: 20px 16px 14px; }
    .article-header h1 { font-size: 18px; }
    .article-content { padding: 16px; font-size: 14px; }
    .article-nav { flex-direction: column; padding: 16px; }
    .article-nav > div { max-width: 100%; }
    .site-footer { padding: 24px 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .breadcrumb { font-size: 12px; padding: 8px 12px; }
}
