/* public/style.css - 最终全适配版 (深绿主题) */

/* =========================================
   0. 全局变量定义 (一键换肤)
   ========================================= */
   :root {
    --theme-color: #157a46; /* ✅ 在这里修改颜色，全站自动变 */
}

/* =========================================
   1. 全局基础设置
   ========================================= */
body {
    font-family: "Arial Black", "Helvetica", sans-serif;
    margin: 0;
    background-color: #fff;
    color: #000;
    line-height: 1.2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 90px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s; /* 给所有链接加个过渡动画 */
}

/* =========================================
   2. 布局容器
   ========================================= */
.container,
.header-container,
.footer-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   3. 顶部导航 (Header)
   ========================================= */
header {
    background-color: var(--theme-color); /* ✅ 使用变量 */
    border-bottom: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    color: #fff;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: transform;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); /* 加一点阴影更有层次 */
}

.header-hidden {
    transform: translateY(-100%);
}

.header-container {
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -2px; /* 稍微放开一点点，-3px 太挤了 */
    text-transform: uppercase;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: baseline; /* 确保文字对齐在底线上 */
}

/* 让 The 变得纤细且半透明，起到辅助作用 */
.logo .thin {
    font-weight: 200;
    font-size: 0.7em; /* 缩小 30% */
    opacity: 0.7;
    margin-right: 6px;
}

/* 让 Base 稍微柔和一点，把视觉重心留在中间的 ENT */
.logo .base {
    font-weight: 800; /* 比 ENT 稍细一点点 */
    opacity: 0.9;
}

nav a {
    margin-left: 30px;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.9;
}

nav a:hover {
    color: #fff;
    opacity: 1;
    text-shadow: 0 0 10px rgba(255,255,255,0.3); /* 微微发光 */
}

/* =========================================
   4. 主体布局 (Main Layout)
   ========================================= */
.main-layout {
    display: flex;
    gap: 60px;
    margin-top: 50px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.content-area {
    flex: 2;
}

.sidebar-area {
    flex: 1;
    position: sticky;
    top: 110px;
    height: fit-content;
    background-color: #f9f9f9; /* 稍微调亮一点 */
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #eee;
}

#search-input:focus {
    border-color: var(--theme-color) !important; /* ✅ 使用变量 */
    background-color: #fff;
    outline: none;
}

#search-input::placeholder {
    color: #ccc;
    font-style: italic;
}

.section-title {
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    border-bottom: 4px solid #000;
    padding-bottom: 5px;
    margin-bottom: 40px;
}

/* =========================================
   5. 新闻列表
   ========================================= */
.news-item {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.news-img-box {
    width: 320px;
    height: 180px;
    background-color: #f0f0f0;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
}

.news-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.news-item:hover .news-img-box img {
    transform: scale(1.05); /* 图片轻微放大效果 */
}

.news-meta {
    color: var(--theme-color); /* ✅ 使用变量 */
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.news-title {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
    margin: 0 0 15px 0;
    cursor: pointer;
    transition: 0.2s;
}

.news-title:hover {
    color: var(--theme-color); /* ✅ 使用变量 */
}

.news-author {
    font-size: 11px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
}

/* =========================================
   6. 侧边栏排行
   ========================================= */
.sidebar-title {
    font-size: 20px !important;
    margin-top: 0;
}

.trending-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.trend-rank {
    font-size: 36px;
    font-weight: 900;
    color: var(--theme-color); /* ✅ 使用变量 */
    margin-right: 20px;
    line-height: 1;
    font-family: "Georgia", serif; /* 排名数字用衬线体更好看 */
    opacity: 0.8;
}

.trend-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 4px;
}

.trend-title {
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.3;
}

.trend-title:hover {
    color: var(--theme-color); /* ✅ 使用变量 */
}

/* Top 1 大图样式 */
.trending-top-item {
    cursor: pointer;
    margin-bottom: 30px;
}

.trend-top-img-box {
    width: 100%;
    height: 180px;
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
}

.trend-top-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.trending-top-item:hover .trend-top-img {
    transform: scale(1.03);
}

.trend-top-placeholder {
    width: 100%;
    height: 100%;
    background: var(--theme-color); /* ✅ 使用变量 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 24px;
    color: #fff;
}

.trend-top-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
    margin: 0;
    text-transform: uppercase;
    flex: 1;
}

.trending-top-item:hover .trend-top-title {
    color: var(--theme-color); /* ✅ 使用变量 */
}

/* =========================================
   7. 底部 (Footer)
   ========================================= */
footer {
    background: #f5f5f5;
    padding: 60px 0;
    margin-top: 80px;
    border-top: 2px solid var(--theme-color); /* ✅ 顶部加一条主题色装饰线 */
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-info {
    max-width: 300px;
}

/* ✅ 修复：底部 Logo 强制使用主题色 */
.footer-logo-text {
    color: var(--theme-color) !important; 
    font-size: 28px !important;
    margin-bottom: 15px;
}

.footer-column h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--theme-color); /* ✅ 标题颜色 */
    display: inline-block;
    border-bottom: 2px solid #ddd; /* 下划线 */
    padding-bottom: 5px;
}

.footer-column p {
    color: #555;
    font-size: 14px;
    margin: 8px 0;
    cursor: pointer;
    font-weight: bold;
}

.footer-column p:hover {
    color: var(--theme-color); /* ✅ 使用变量 */
    transform: translateX(5px); /* 悬停时微微右移 */
    transition: transform 0.2s;
}

/* =========================================
   8. 文章详情页 - 相关推荐
   ========================================= */
.related-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #ddd;
}

.related-header {
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 30px;
    border-left: 10px solid var(--theme-color); /* ✅ 使用变量 */
    padding-left: 15px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.related-card {
    text-decoration: none;
    color: #000;
    display: block;
    transition: opacity 0.3s;
}

.related-card:hover .related-title {
    color: var(--theme-color); /* ✅ 使用变量 */
}

.related-img-box {
    height: 180px;
    background: #eee;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 4px;
}

.related-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-card:hover img {
    transform: scale(1.05);
}

.related-title {
    font-weight: bold;
    font-size: 16px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-date {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    font-weight: bold;
}

/* =========================================
    9. 文章前后翻页 (Navigation)
   ========================================= */
.article-nav-container {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 20px;
}

.nav-card {
    flex: 1;
    padding: 25px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
    min-height: 80px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.nav-card:hover {
    border-color: var(--theme-color); /* ✅ 使用变量 */
    background-color: #f9fdfa; /* 极淡的绿色背景 */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(21, 122, 70, 0.1);
}

.nav-label {
    font-size: 11px;
    font-weight: 900;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.nav-title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    line-height: 1.4;
    font-family: "Georgia", serif;
}

.nav-card.next {
    text-align: right;
    align-items: flex-end;
}

.nav-placeholder {
    flex: 1;
}

/* =========================================
   📱 10. 移动端适配
   ========================================= */
@media screen and (max-width: 768px) {
    .container, .main-layout {
        display: block !important;
        width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box;
    }

    .header-container {
        height: auto !important;
        flex-direction: column;
        padding: 15px 0;
        gap: 15px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    nav a {
        margin-left: 0 !important;
        margin: 0 10px;
    }

    .content-area {
        width: 100% !important;
    }

    .sidebar-area {
        width: 100% !important;
        margin-top: 50px !important;
        border-top: 4px solid #000;
        padding-top: 30px;
        position: static; /* 手机端取消侧边栏固定 */
    }

    .news-item {
        flex-direction: column;
        gap: 15px;
    }

    .news-img-box {
        width: 100% !important;
        height: 200px !important;
    }

    img {
        height: auto !important;
        max-height: 400px !important;
    }

    .article-nav-container {
        flex-direction: column;
    }
    
    .nav-card {
        text-align: center !important;
        align-items: center !important;
    }

    .footer-container {
        flex-direction: column;
        gap: 30px;
    }
}

/* =========================================
   ✨ 排行榜卡片特效补丁
   ========================================= */

/* 给卡片添加一个极其微弱的阴影，增加立体感 */
.trend-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid transparent; /* 预留边框位置 */
}

/* 🔥 鼠标悬停时的特效 */
.trend-card:hover {
    /* 背景色稍微变深一点点 */
    background-color: #f0f4f2 !important; 
    /* 添加一个明显一点的阴影，感觉浮起来了 */
    box-shadow: 0 8px 16px rgba(26, 127, 69, 0.15); 
    /* 鼠标放上去时，加一个细细的主题色边框 */
    border-color: rgba(26, 127, 69, 0.3);
    /* 稍微向上浮动一点点 */
    transform: translateY(-2px);
}

/* =========================================
   🏷️ 新闻分类小标签美化 (变身小按钮)
   ========================================= */

/* 专门针对新闻列表里的分类标签 (如 NEWS, MOVIES) */
.news-content .category-tag {
    display: inline-block;       /* 让背景块撑开 */
    background-color: #1a7f45;   /* 🔥 背景色：主题深绿 */
    color: #ffffff !important;   /* 文字色：纯白 (强制覆盖原来的绿色) */
    
    /* 🎨 形状微调 */
    padding: 3px 8px;            /* 内边距：上下3px，左右8px */
    border-radius: 4px;          /* 圆角：稍微圆润一点 */
    
    /* 🔡 字体微调 */
    font-size: 10px;             /* 字号小一点，更精致 */
    font-weight: 800;            /* 字体加粗 */
    letter-spacing: 0.5px;       /* 字母间距 */
    text-transform: uppercase;   /* 强制大写 */
    
    /* 📐 位置微调 */
    margin-bottom: 8px;          /* 和下面的标题拉开点距离 */
    line-height: 1;              /* 防止行高撑太大 */
}


/* =========================================
   🔢 数字分页美化 (Pro版)
   ========================================= */
   .pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* 按钮之间的间距 */
    margin-top: 50px;
    margin-bottom: 50px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0; /* 默认浅灰边框 */
    background: white;
    color: #333;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px; /* 稍微圆一点 */
    transition: all 0.2s ease;
    padding: 0 12px;
}

/* =========================================
   🎨 详情页分类标签修复补丁 (强制显示背景)
   ========================================= */

   #article-container .category-tag {
    display: inline-block;       /* 让背景块撑开 */
    background-color: #1a7f45;   /* 🔥 强制深绿背景 */
    color: #ffffff !important;   /* 强制白字 */
    
    /* 形状微调 */
    padding: 5px 12px;           /* 内边距：比首页稍微大一点点，更显眼 */
    border-radius: 4px;          /* 圆角 */
    
    /* 字体微调 */
    font-size: 12px;             
    font-weight: 900;            /* 特别加粗 */
    letter-spacing: 1px;         
    text-transform: uppercase;   
    
    /* 位置 */
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(26, 127, 69, 0.2); /* 加一点点投影 */
}