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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background-color: #282828;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 变量定义（颜色和尺寸） ========== */
:root {
    --bg-primary: #282828;
    --bg-secondary: #2f2f2f;
    --bg-overlay: rgba(0, 0, 0, 0.7);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --brand-pink: #FF69B4;
    --brand-pink-hover: #FF1493;
    --hot-green: #00C853;
    --border-color: #404040;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

/* ========== 顶部导航栏样式（重新设计） ========== */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-height);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    overflow: visible; /* 确保子菜单不被裁剪 */
    position: relative; /* 确保定位上下文正确 */
}

/* Logo样式（优化） */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 120px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    padding: 8px 0;
}

.logo:hover {
    transform: none;
}

.logo:hover .logo-number {
    color: var(--brand-pink-hover);
    text-shadow: 0 0 8px rgba(255, 105, 180, 0.5);
}

.logo-number {
    color: var(--brand-pink);
    font-size: 1.1em;
    letter-spacing: -0.5px;
}

.logo-text {
    color: var(--text-primary);
    margin-left: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ========== 主导航菜单样式（重新设计） ========== */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* 改为visible，避免裁剪子菜单 */
    min-width: 0;
    width: 100%;
    position: relative; /* 确保定位上下文正确 */
    z-index: 1002; /* 确保在header之上 */
}

/* 一级导航列表 */
.nav-list {
    display: flex;
    list-style: none;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible; /* 改为visible，避免裁剪子菜单 */
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    max-width: 100%;
    position: relative; /* 确保定位上下文正确 */
    z-index: 1002; /* 确保子菜单可以显示 */
}

/* 隐藏Chrome滚动条 */
.nav-list::-webkit-scrollbar {
    display: none;
}

/* 一级导航项 */
.nav-list > li {
    position: relative;
    list-style: none;
}

/* 一级导航链接 */
.nav-list > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    transition: all var(--transition-speed) ease;
    position: relative;
    line-height: 1.5;
    flex-shrink: 0;
}

.nav-list > li > a:hover {
    background-color: rgba(255, 105, 180, 0.15);
    color: var(--brand-pink);
}


/* 右侧工具图标区样式（优化） */
.header-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    padding-left: 16px;
    border-left: 1px solid var(--border-color);
    min-width: 0;
}

.tool-btn {
    width: 38px;
    height: 38px;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    font-size: 1.05rem;
    position: relative;
}

.tool-btn:hover {
    background-color: rgba(255, 105, 180, 0.15);
    color: var(--brand-pink);
    transform: translateY(-2px);
}

.tool-btn:active {
    transform: translateY(0);
    background-color: rgba(255, 105, 180, 0.25);
}

.tool-btn:focus {
    outline: 2px solid var(--brand-pink);
    outline-offset: 2px;
}

/* 工具按钮提示标签 */
.tool-btn::before {
    content: attr(title);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background-color: rgba(0, 0, 0, 0.85);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-speed) ease;
    z-index: 1001;
}

.tool-btn:hover::before {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* ========== Hero区域样式 ========== */
.hero {
    background-color: #2f2f2f;
    padding: 60px 20px;
    text-align: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========== 主要内容区域样式 ========== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========== 特色文章卡片样式 ========== */
.featured-article {
    position: relative;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    margin-bottom: 40px;
}

/* HOT标签样式（绿色斜角标签） */
.hot-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    width: 120px;
    height: 120px;
    overflow: hidden;
}

.hot-badge::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 120px 120px 0;
    border-color: transparent var(--hot-green) transparent transparent;
}

.hot-text {
    position: absolute;
    top: 20px;
    right: 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: bold;
    transform: rotate(45deg);
    z-index: 11;
}

/* 文章图片容器 */
.article-images {
    display: flex;
    gap: 0;
    width: 100%;
    justify-content: center;
    align-items: center;
}

.article-image-wrapper {
    width: 1300px;
    height: 640px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-primary);
}

.article-image {
    width: 1300px;
    height: 640px;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform var(--transition-speed) ease;
    background-color: var(--bg-primary);
}

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

/* 默认图片样式优化 */
.article-image.default-image {
    object-fit: contain;
    background-color: var(--bg-secondary);
    padding: 20px;
}

.article-image.default-image:hover {
    transform: scale(1);
    filter: brightness(1.1);
}

/* 文章信息覆盖层 */
.article-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--bg-overlay), transparent);
    padding: 40px 30px 30px;
    z-index: 5;
}

.article-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.meta-author {
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-separator {
    color: var(--text-muted);
}

.meta-date {
    color: var(--text-secondary);
}

.meta-tags {
    color: var(--brand-pink);
    padding: 2px 8px;
    background-color: rgba(255, 105, 180, 0.1);
    border-radius: 4px;
}

/* ========== 新闻列表样式 ========== */
.content-section {
    margin-top: 40px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.news-item {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    cursor: pointer;
}

.news-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.news-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
    background-color: var(--bg-primary);
}

.news-item:hover .news-thumbnail img {
    transform: scale(1.05);
}

/* 新闻列表默认图片样式 */
.news-thumbnail img.default-image {
    object-fit: contain;
    background-color: var(--bg-secondary);
    padding: 15px;
}

.news-item:hover .news-thumbnail img.default-image {
    transform: scale(1);
    filter: brightness(1.1);
}

/* ========== 新闻加载指示器样式 ========== */
.news-loader {
    text-align: center;
    padding: 40px 20px;
    margin-top: 30px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--brand-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.news-no-more {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 30px;
}

.news-error {
    text-align: center;
    padding: 40px 20px;
    margin-top: 30px;
    color: var(--text-secondary);
}

.news-error div {
    margin-bottom: 15px;
    color: #ff6b6b;
}

.retry-btn {
    padding: 10px 20px;
    background-color: var(--brand-pink);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color var(--transition-speed) ease;
}

.retry-btn:hover {
    background-color: var(--brand-pink-hover);
}

.news-content {
    padding: 16px;
}

.news-title {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.news-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.news-title a:hover {
    color: var(--brand-pink);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.news-source {
    color: var(--text-secondary);
}

.news-time {
    color: var(--text-muted);
}

.news-views {
    color: var(--brand-pink);
    padding: 2px 8px;
    background-color: rgba(255, 105, 180, 0.1);
    border-radius: 4px;
}

/* ========== 页脚样式 ========== */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== 响应式设计 ========== */

/* 平板设备（768px - 1024px） */
@media screen and (max-width: 1024px) {
    .header-container {
        padding: 0 16px;
        gap: 16px;
        grid-template-columns: auto 1fr auto;
    }

    .logo {
        font-size: 1.5rem;
        min-width: 100px;
    }

    .nav-list {
        gap: 1px;
    }

    .nav-list > li > a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .header-tools {
        gap: 3px;
        padding-left: 12px;
    }

    .tool-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-subtitle {
        font-size: 1rem;
    }
}

/* 移动设备（最大768px） */
@media screen and (max-width: 768px) {
    .header-container {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        height: auto;
        min-height: var(--header-height);
        padding: 12px 16px;
        gap: 12px;
    }

    .logo {
        font-size: 1.4rem;
        grid-column: 1;
        grid-row: 1;
        min-width: auto;
        justify-content: flex-start;
    }

    .header-tools {
        grid-column: 2;
        grid-row: 1;
        border-left: none;
        padding-left: 0;
        gap: 2px;
    }

    .tool-btn {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .tool-btn::before {
        display: none; /* 移动端隐藏提示标签 */
    }

    .main-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        margin-top: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .nav-list {
        gap: 1px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .nav-list > li > a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }


    .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .hero {
        padding: 40px 15px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 20px 15px;
    }

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

    .article-image-wrapper {
        width: 100%;
        height: auto;
        max-width: 100%;
        aspect-ratio: 1300 / 640;
    }

    .article-image {
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: contain;
    }

    .article-overlay {
        padding: 30px 20px 20px;
        position: relative;
        background: var(--bg-overlay);
    }

    .article-title {
        font-size: 1.3rem;
    }

    .article-subtitle {
        font-size: 0.95rem;
    }

    .hot-badge {
        width: 100px;
        height: 100px;
    }

    .hot-badge::before {
        border-width: 0 100px 100px 0;
    }

    .hot-text {
        top: 18px;
        right: 8px;
        font-size: 0.75rem;
    }

    /* 移动端新闻列表 */
    .news-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* 小屏幕设备（最大480px） */
@media screen and (max-width: 480px) {
    .header-container {
        padding: 10px 12px;
        gap: 8px;
        grid-template-columns: 1fr auto;
    }

    .logo {
        font-size: 1.3rem;
        min-width: auto;
    }

    .header-tools {
        gap: 1px;
    }

    .tool-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .nav-list > li > a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .article-title {
        font-size: 1.1rem;
    }

    .article-subtitle {
        font-size: 0.9rem;
    }

    .article-meta {
        font-size: 0.8rem;
    }
}

/* ========== 滚动条样式美化（可选） ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* ========== 辅助类（可选） ========== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}
