/**
 * 现代化网站样式
 * 简洁大气风格
 */

:root {
    /* 使用主题系统变量 */
    --primary-color: var(--primary);
    --primary-hover: var(--primary-hover);
    --text-primary: var(--text-primary);
    --text-secondary: var(--text-secondary);
    --text-light: var(--text-muted);
    --border-color: var(--border);
    --bg-color: var(--bg-secondary);
    --white: var(--bg-primary);
    --shadow: var(--shadow);
    --shadow-lg: var(--shadow-hover);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-color); }

img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== 头部导航 ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: var(--shadow);
}

.header-inner { background: var(--white); }

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 24px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg { width: 100%; height: 100%; }

/* 搜索框 */
.header-search { flex: 1; max-width: 500px; }

.header-search form {
    display: flex;
    background: #f5f5f5;
    border-radius: 24px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.header-search form:focus-within {
    box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.2);
}

.header-search input {
    flex: 1;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    background: transparent;
    outline: none;
}

.header-search button {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.header-search button:hover { background: var(--primary-hover); }
.header-search button svg { width: 20px; height: 20px; }

/* 用户菜单 */
.header-user { display: flex; align-items: center; gap: 16px; }

.user-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    transition: all 0.2s;
}

.user-link:hover { background: var(--primary-color); color: var(--white); }
.user-link svg { width: 22px; height: 22px; }

/* 分类导航 */
.category-nav { background: var(--white); border-top: 1px solid var(--border-color); }

.main-nav { background: var(--white); border-bottom: 1px solid var(--border-color); }

.main-nav .container { display: flex; align-items: center; }

.nav-list {
    display: flex;
    gap: 0;
    list-style: none;
    overflow-x: auto;
}

.nav-list::-webkit-scrollbar { display: none; }

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-item a,
.nav-link {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
    color: var(--text-primary);
}

.nav-item a:hover,
.nav-link:hover { 
    color: var(--primary-color); 
}

.nav-item a.active,
.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item a.active::after,
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* 下拉菜单 */
.nav-list li.has-sub { position: relative; }

.nav-list li.has-sub > a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-list li.has-sub .arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.nav-list li.has-sub:hover .arrow {
    transform: rotate(180deg);
}

.nav-list .sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    z-index: 100;
}

.nav-list li.has-sub:hover .sub-nav {
    display: block;
}

.nav-list .sub-nav li a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    transition: all 0.2s;
}

.nav-list .sub-nav li a:hover {
    background: #f5f5f5;
    color: var(--primary-color);
}

/* ===== 首页样式 ===== */

/* 顶部广告 */
.ad-header { background: var(--white); padding: 12px 0; border-bottom: 1px solid var(--border-color); }

/* 今日热榜 */
.hot-topics { background: var(--white); border-bottom: 1px solid var(--border-color); padding: 12px 0; }

.hot-topics-inner { display: flex; align-items: center; gap: 16px; }

.hot-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    font-size: 14px;
}

.hot-label .icon { width: 18px; height: 18px; }

.hot-list { display: flex; gap: 24px; overflow-x: auto; }

.hot-item { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 14px; }
.hot-item:hover .hot-title { color: var(--primary-color); }

.hot-num {
    width: 20px;
    height: 20px;
    background: var(--text-light);
    color: var(--white);
    border-radius: 4px;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    font-weight: 600;
}

.hot-num.top { background: var(--primary-color); }

.hot-title { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

/* 精选推荐 */
.featured-section { background: var(--white); padding: 20px 0; margin-bottom: 16px; }

.featured-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }

.featured-card.main {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
}

.featured-card.main .card-image { position: relative; aspect-ratio: 16/9; }

.featured-card.main .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.featured-card.main .card-body { padding: 16px; background: var(--white); }

.featured-card.main .card-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }

.featured-card.main .card-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 12px; }

.card-meta { display: flex; gap: 12px; color: var(--text-light); font-size: 13px; }

/* 侧边推荐 */
.featured-side { display: flex; flex-direction: column; gap: 12px; }

.featured-card.side {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--white);
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.featured-card.side:hover { box-shadow: var(--shadow); }

.featured-card.side .card-image {
    width: 100px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.featured-card.side .card-image img { width: 100%; height: 100%; object-fit: cover; }

.featured-card.side .card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.category-tag { color: var(--primary-color); font-size: 12px; margin-bottom: 4px; }

.featured-card.side .card-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 主内容区 */
.main-wrapper { padding: 16px 0 40px; }

.content-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }

/* 分类Tab */
.content-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab { padding: 8px 16px; border-radius: 20px; font-size: 15px; white-space: nowrap; transition: all 0.2s; }
.tab:hover { background: rgba(230, 0, 18, 0.08); }
.tab.active { background: var(--primary-color); color: var(--white); }

/* 文章列表 */
.article-list { display: flex; flex-direction: column; gap: 16px; }

.article-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.article-item:hover { box-shadow: var(--shadow); }

.article-thumb { width: 140px; height: 100px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }

.article-thumb img { width: 100%; height: 100%; object-fit: cover; }

.article-info { flex: 1; display: flex; flex-direction: column; }

.article-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-desc {
    color: var(--text-secondary);
    font-size: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta { display: flex; gap: 12px; color: var(--text-light); font-size: 13px; margin-top: 8px; }
.article-meta .category { color: var(--primary-color); }

.infeed-ad { width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-color); }

/* 加载更多 */
.load-more { text-align: center; padding: 24px 0; }

.btn-load {
    padding: 12px 48px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load:hover { background: var(--primary-color); color: var(--white); border-color: var(--primary-color); }

/* 侧边栏 */
.content-sidebar { display: flex; flex-direction: column; gap: 16px; }

/* 侧边搜索 */
.sidebar-search form { display: flex; background: var(--white); border-radius: 24px; overflow: hidden; padding: 4px; }
.sidebar-search input { flex: 1; border: none; padding: 10px 16px; font-size: 14px; outline: none; }

.sidebar-search button {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-search button svg { width: 20px; height: 20px; }

/* 侧边组件 */
.sidebar-widget { background: var(--white); border-radius: 8px; padding: 16px; }

.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.widget-title .icon { width: 20px; height: 20px; color: var(--primary-color); }

/* 热门列表 */
.hot-list { list-style: none; }

.hot-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.hot-item:last-child { border-bottom: none; }

.hot-item .rank {
    width: 20px;
    height: 20px;
    background: var(--text-light);
    color: var(--white);
    border-radius: 4px;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.hot-item .rank.top { background: var(--primary-color); }

.hot-link { flex: 1; }
.hot-link .hot-title { display: block; font-size: 14px; line-height: 1.5; margin-bottom: 4px; }
.hot-views { font-size: 12px; color: var(--text-light); }

/* 分类网格 */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.category-item {
    padding: 10px 8px;
    background: #f8f8f8;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s;
}

.category-item:hover { background: var(--primary-color); color: var(--white); }

/* 分类列表（带二级分类） */
.category-list { display: flex; flex-direction: column; gap: 12px; }

.category-group { }

.category-main {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
}

.category-main:hover {
    background: var(--primary-color);
    color: var(--white);
}

.category-children {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0 0 12px;
}

.category-child {
    padding: 5px 10px;
    background: #f8f8f8;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.category-child:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* 广告位 */
.sidebar-ad { background: var(--white); border-radius: 8px; overflow: hidden; min-height: 100px; }
.comment-empty { color: var(--text-light); text-align: center; padding: 20px 0; font-size: 14px; }

/* ===== 页脚 ===== */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }

/* 关于我们 */
.footer-about { }

.footer-about .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.footer-about p { color: var(--text-secondary); font-size: 14px; line-height: 1.8; }

.footer-social { display: flex; gap: 12px; margin-top: 16px; }

.social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    transition: all 0.2s;
}

.social-link:hover { background: var(--primary-color); color: var(--white); }
.social-link svg { width: 18px; height: 18px; }

/* 快速链接 */
.footer-links h4 { font-size: 16px; font-weight: 600; margin-bottom: 20px; }

.footer-links ul { list-style: none; }

.footer-links li { margin-bottom: 12px; }

.footer-links a { color: var(--text-secondary); font-size: 14px; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary-color); }

/* 备案信息 */
.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 13px;
}

.footer-bottom a { color: var(--text-light); }
.footer-bottom a:hover { color: var(--primary-color); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .content-layout { grid-template-columns: 1fr; }
    .content-sidebar { display: none; }
    .featured-grid { grid-template-columns: 1fr; }
    .featured-side { display: none; }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 30px; }
}

@media (max-width: 768px) {
    .header-content { padding: 12px 0; }
    .logo { font-size: 18px; }
    .logo-icon { width: 28px; height: 28px; }
    .header-search { display: none; }
    .article-item { flex-direction: column; }
    .article-thumb { width: 100%; height: 180px; }
    .hot-list { display: none; }
    .footer-inner { grid-template-columns: 1fr; text-align: center; }
    .footer-bottom { flex-direction: column; gap: 12px; }
    .nav-link { padding: 10px 14px; font-size: 14px; }
}

/* ===== 广告占位符 ===== */
.ad-placeholder {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ===== 文章详情页 ===== */
.article-detail { max-width: 800px; margin: 0 auto; }

.article-header { background: var(--white); padding: 30px 0 20px; margin-bottom: 16px; }

.article-category { display: inline-block; padding: 4px 12px; background: var(--primary-color); color: var(--white); border-radius: 4px; font-size: 13px; margin-bottom: 16px; }

.article-title { font-size: 28px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; }

.article-meta { display: flex; align-items: center; gap: 20px; color: var(--text-secondary); font-size: 14px; }
.article-meta .author { color: var(--primary-color); font-weight: 500; }

.article-cover { width: 100%; max-height: 500px; object-fit: cover; border-radius: 12px; margin-bottom: 24px; }

.article-content { background: var(--white); padding: 30px; border-radius: 12px; font-size: 16px; line-height: 1.8; }

.article-content p { margin-bottom: 16px; }

.article-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }

.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-color); }

.tag { padding: 6px 14px; background: #f5f5f5; border-radius: 20px; font-size: 13px; color: var(--text-secondary); }

/* 相关文章 */
.related-articles { margin-top: 40px; }

.related-title { font-size: 20px; font-weight: 600; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--primary-color); display: inline-block; }

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.related-card { background: var(--white); border-radius: 8px; overflow: hidden; transition: box-shadow 0.2s; }
.related-card:hover { box-shadow: var(--shadow); }

.related-card img { width: 100%; height: 140px; object-fit: cover; }

.related-card-body { padding: 12px; }

.related-card-title { font-size: 14px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 悬浮广告 ===== */
.float-ad {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    animation: floatIn 0.5s ease-out;
}

@keyframes floatIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.float-ad-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #333;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

/* ===== 分类页 ===== */
.category-header { background: var(--white); padding: 30px; border-radius: 12px; margin-bottom: 16px; }
.category-header h1 { font-size: 28px; margin-bottom: 8px; }
.category-header p { color: var(--text-secondary); }

/* ===== 搜索页 ===== */
.search-header { background: var(--white); padding: 30px; border-radius: 12px; margin-bottom: 20px; text-align: center; }
.search-result-count { color: var(--primary-color); font-weight: 600; }

/* ===== V3 头部样式 ===== */
:root {
    --accent-primary: #4f46e5;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --bg-secondary: #f8fafc;
}

.site-header-v3 {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.site-header-v3 .header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-header-v3 .header-top {
    height: 72px;
    display: flex;
    align-items: center;
}

.site-header-v3 .logo-v3 {
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    margin-right: 40px;
}

.site-header-v3 .logo-image-v3 {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.site-header-v3 .header-search-v3 {
    flex: 1;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.site-header-v3 .header-search-v3 form {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 4px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.site-header-v3 .header-search-v3 form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.site-header-v3 .header-search-v3 input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}

.site-header-v3 .header-search-v3 button {
    background: var(--accent-gradient);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.3s;
}

.site-header-v3 .header-search-v3 button:hover {
    transform: scale(1.05);
}

.site-header-v3 .header-banner {
    background: var(--bg-secondary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.site-header-v3 .header-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.site-header-v3 .nav-category {
    display: flex;
    align-items: center;
    overflow-x: auto;
    gap: 4px;
}

.site-header-v3 .nav-item-v3 {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-size: 15px;
    white-space: nowrap;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.site-header-v3 .nav-item-v3:hover,
.site-header-v3 .nav-item-v3.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

@media (max-width: 768px) {
    .site-header-v3 .header-search-v3 {
        display: none;
    }
    .site-header-v3 .logo-v3 {
        font-size: 18px;
    }
}
