/* ========== 全局重置与基础 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #ffffff;
    --body-bg: #f5f6f8;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #8a8a8a;
    --accent-blue: #1890ff;
    --accent-blue-hover: #40a9ff;
    --accent-magenta: #e91e63;
    --border-color: #e8e8e8;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --header-height: 60px;
    --container-width: 1200px;
    --sidebar-width: 300px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--body-bg);
}

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

a:hover {
    color: var(--accent-blue);
}

/* ========== 顶部导航 ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 30px;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-sub {
    font-size: 10px;
    color: var(--text-tertiary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

.main-nav a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav li.active a {
    color: var(--accent-blue);
    background: rgba(24, 144, 255, 0.06);
}

.main-nav .fa-caret-down {
    font-size: 10px;
    opacity: 0.6;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent-blue);
}

.search-box input {
    border: none;
    outline: none;
    padding: 6px 14px;
    font-size: 13px;
    width: 160px;
    background: transparent;
}

.search-box button {
    border: none;
    background: none;
    padding: 6px 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.2s;
}

.search-box button:hover {
    color: var(--accent-blue);
}

.btn-login {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border: 1px solid var(--accent-blue);
    border-radius: 4px;
    color: var(--accent-blue);
    font-size: 13px;
    transition: all 0.2s;
}

.btn-login:hover {
    background: var(--accent-blue);
    color: #fff;
}

/* ========== 主内容容器 ========== */
.main-container {
    max-width: var(--container-width);
    margin: 20px auto;
    padding: 0 20px;
}

.content-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.content-main {
    flex: 1;
    min-width: 0;
}

/* ========== 轮播图 ========== */
.banner-slider {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    height: 380px;
    background: #e0e7ff;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
    display: flex;
    align-items: center;
}

.slide.active {
    opacity: 1;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slide-bg-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.slide-bg-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.slide-bg-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.slide-decor {
    position: relative;
    width: 100%;
    height: 100%;
}

.decor-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
}

.decor-circle-1 {
    width: 200px;
    height: 200px;
    background: #fff;
    top: -40px;
    right: 60px;
}

.decor-circle-2 {
    width: 120px;
    height: 120px;
    background: #ff6b9d;
    bottom: 30px;
    right: 200px;
}

.decor-triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid rgba(255, 255, 255, 0.12);
    top: 40px;
    right: 300px;
    transform: rotate(15deg);
}

.decor-balloon {
    position: absolute;
    width: 50px;
    height: 60px;
    background: rgba(255, 165, 0, 0.2);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    top: 80px;
    right: 100px;
}

.decor-balloon::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    width: 1px;
    height: 20px;
    background: rgba(255, 165, 0, 0.3);
}

.slide-content {
    position: relative;
    z-index: 2;
    padding: 40px 50px;
    max-width: 600px;
}

.slide-content h2 {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 12px;
    line-height: 1.4;
}

.slide-content p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
}

.slider-dots {
    position: absolute;
    bottom: 16px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 3;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: #fff;
    transform: scale(1.2);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 14px;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.45);
}

.slider-prev {
    left: 12px;
}

.slider-next {
    right: 12px;
}

/* ========== 推荐卡片 ========== */
.featured-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.featured-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: var(--primary-bg);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.featured-card-icon {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
}

.featured-card-1 .featured-card-icon { background: linear-gradient(135deg, #1a237e, #283593); }
.featured-card-2 .featured-card-icon { background: linear-gradient(135deg, #0078d4, #00bcf2); }
.featured-card-3 .featured-card-icon { background: linear-gradient(135deg, #4285f4, #34a853); }
.featured-card-4 .featured-card-icon { background: linear-gradient(135deg, #000, #333); }
.featured-card-5 .featured-card-icon { background: linear-gradient(135deg, #555, #333); }
.featured-card-6 .featured-card-icon { background: linear-gradient(135deg, #2196f3, #00bcd4); }
.featured-card-7 .featured-card-icon { background: linear-gradient(135deg, #1565c0, #0d47a1); }
.featured-card-0 .featured-card-icon { background: linear-gradient(135deg, #24292e, #444c56); }

.featured-card-title {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 文章列表 ========== */
.articles-section {
    background: var(--primary-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    border-left: 3px solid var(--accent-blue);
    padding-left: 10px;
}

.current-cat {
    font-size: 13px;
    color: var(--accent-blue);
    background: rgba(24, 144, 255, 0.08);
    padding: 3px 10px;
    border-radius: 12px;
}

.article-card {
    display: flex;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.article-card:last-child {
    border-bottom: none;
}

.article-thumb {
    flex-shrink: 0;
    width: 200px;
    height: 130px;
    border-radius: 8px;
    overflow: hidden;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.thumb-1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.thumb-2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.thumb-3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.thumb-4 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.thumb-5 { background: linear-gradient(135deg, #fa709a, #fee140); }
.thumb-6 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }

.article-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.article-category {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(24, 144, 255, 0.08);
    color: var(--accent-blue);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-new {
    display: inline-block;
    padding: 1px 8px;
    background: #ff4757;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.article-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 6px;
}

.article-title a {
    color: var(--text-primary);
}

.article-title a:hover {
    color: var(--accent-blue);
}

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

.article-info {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.article-info i {
    margin-right: 3px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 20px;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.page-dots {
    padding: 0 4px;
    color: var(--text-tertiary);
}

.page-info {
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.no-articles {
    text-align: center;
    padding: 60px 0;
    color: var(--text-tertiary);
}

.no-articles i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

.sidebar-section {
    background: var(--primary-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.subscribe-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subscribe-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f5f6f8;
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.subscribe-links a:hover {
    background: rgba(24, 144, 255, 0.08);
    color: var(--accent-blue);
}

.sponsor-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sponsor-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s;
}

.sponsor-item:hover {
    background: #eef1f5;
}

.sponsor-item strong {
    font-size: 13px;
    color: var(--text-primary);
}

.sponsor-item span {
    font-size: 12px;
    color: var(--text-tertiary);
}

.recent-comments {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-item {
    display: flex;
    gap: 10px;
}

.comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 24px;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.comment-author {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-blue);
}

.comment-date {
    font-size: 11px;
    color: var(--text-tertiary);
}

.comment-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 2px;
}

.comment-article {
    font-size: 11px;
    color: var(--text-tertiary);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f5f6f8;
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tag:hover {
    background: rgba(24, 144, 255, 0.08);
    color: var(--accent-blue);
}

/* ========== 文章详情 ========== */
.article-detail {
    background: var(--primary-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.article-detail-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-detail-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
    margin: 10px 0;
    color: var(--text-primary);
}

.article-detail-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.article-detail-meta i {
    margin-right: 4px;
}

.article-detail-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

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

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

.comments-section {
    background: var(--primary-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.comments-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.comment-form {
    margin-bottom: 20px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--accent-blue);
}

.btn-submit {
    padding: 8px 24px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: var(--accent-blue-hover);
}

.comment-item-detail {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-avatar-detail {
    flex-shrink: 0;
    font-size: 32px;
    color: #ccc;
}

.comment-header-detail {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13px;
}

.comment-header-detail strong {
    color: var(--accent-blue);
}

.comment-header-detail span {
    color: var(--text-tertiary);
}

/* ========== 页脚 ========== */
.footer {
    background: var(--primary-bg);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: 40px;
}

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .featured-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
    }

    .main-nav {
        order: 3;
        width: 100%;
    }

    .main-nav ul {
        flex-wrap: wrap;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .featured-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-card {
        flex-direction: column;
    }

    .article-thumb {
        width: 100%;
        height: 160px;
    }

    .banner-slider {
        height: 240px;
    }

    .slide-content h2 {
        font-size: 22px;
    }

    .search-box input {
        width: 100px;
    }
}
