* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部搜索栏 */
.top-search-bar {
    background-color: #2c3e50;
    padding: 8px 0;
}

.search-box {
    display: flex;
    justify-content: flex-end;
}

.search-box form {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px 0 0 4px;
    width: 200px;
    font-size: 14px;
}

.search-btn {
    padding: 8px 16px;
    background-color: #0d6fb8;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.search-btn:hover { background-color: #0a5a9a; }

/* 主导航栏 */
.main-header {
    background-color: #34495e;
    padding: 15px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    display: flex;
    align-items: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.logo-icon {
    background-color: #e74c3c;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 18px;
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: white;
    font-size: 16px;
    padding: 8px 0;
    transition: color 0.3s;
}

.main-nav a:hover, .main-nav a.active { color: #0d6fb8; }

/* 面包屑导航 */
.breadcrumb {    
    padding-top: 20px;    
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-nav {
    color: #666; /* 面包屑统一灰色 */
}

.breadcrumb-nav a {
    color: #666; /* 链接也为灰色 */
}

.breadcrumb-nav a:hover {
    color: #666; /* 悬停保持灰色 */
    text-decoration: underline;
}

.separator {
    color: #999;
}

.current {
    color: #666;
}

/* 面包屑：当前位置图标 */
.breadcrumb-nav .current::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 12-9 12s-9-5-9-12a9 9 0 1 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") no-repeat center/contain; /* 位置图标 */
    vertical-align: -2px;
}

/* 主要内容区域 */
.main-content {
    padding: 20px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.main-column {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
}

.sidebar-widget h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0d6fb8;
    color: #2c3e50;
}

/* 热门文章列表 */
.hot-articles-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.hot-articles-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.hot-articles-list a {
    display: flex;
    gap: 12px;
}

.article-thumb {
    width: 100px;                 /* 放大缩略图 */
    aspect-ratio: 605 / 375;      /* 右侧列表按 605:375 比例 */
    height: auto;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-info h4 {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 5px;
    color: #333;
    display: -webkit-box;           /* 多行省略基础 */
    -webkit-line-clamp: 2;          /* 限制2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.8em;              /* 1.4 * 2 行 */
}

.article-info h4:hover { color: #0d6fb8; }

.article-info {
    display: flex;               /* 侧栏信息容器：上下布局 */
    flex-direction: column;
    min-width: 0;
    min-height: 62px;            /* 与 100px * 375/605 的缩略图高度对齐 */
}

.article-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 10px;
}

.article-info .article-meta {
    margin-top: auto;            /* 将时间/浏览量推到底部 */
    align-items: center;
}

/* 侧栏：时间与浏览量小图标 */
.article-info .article-meta .date::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E") no-repeat center/contain;
    vertical-align: -2px;
}

.article-info .article-meta .views::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") no-repeat center/contain;
    vertical-align: -2px;
}

/* 推荐文章 */
.recommended-articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.recommended-item {
    border-radius: 6px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.recommended-item a {
    display: block;
}

.rec-thumb {
    aspect-ratio: 605 / 375;      /* 推荐文章缩略图 605:375 */
    height: auto;
    overflow: hidden;
}

.rec-thumb img { width: 100%; height: 100%; object-fit: cover; }

.rec-content {
    padding: 10px;
}

.rec-content h4 {
    font-size: 13px;
    line-height: 1.3;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.6em;              /* 1.3 * 2 行 */
}

.rec-content h4:hover { color: #0d6fb8; }

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    background-color: #f0f0f0;
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    transition: all 0.3s;
}

.tag-item:hover { background-color: #0d6fb8; color: white; }

/* 分类导航 */
.category-nav li {
    margin-bottom: 8px;
}

.category-nav a {
    color: #666;
    font-size: 14px;
    padding: 5px 0;
    display: block;
    transition: color 0.3s;
}

.category-nav a:hover { color: #0d6fb8; }

/* 底部 */
.main-footer {
    background-color: #333;
    color: white;
    padding: 40px 0 40px;

}

.footer-content {
    display: flex;
    justify-content: center; /* 居中 */
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-links h4 {
    font-size: 20px;
    font-weight: normal;
    margin-bottom: 15px;
    color: #0d6fb8;
    border-bottom: 2px solid #0d6fb8;
    display: inline-block;
    padding-bottom: 4px;
}

.footer-links {
    text-align: left; /* 改为居左 */
    margin-top: 30px;
}

.footer-links ul {
    display: flex;
    gap: 12px;
    justify-content: flex-start; /* 改为居左 */
    flex-wrap: wrap; /* 小屏自动换行 */
}

.footer-links a {
    color: #373737;
    font-size: 14px;
    margin-right: 10px;
}

.footer-links a:hover { color: #373737; text-decoration: none; }

.footer-logo a {
    display: flex;
    align-items: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.footer-info {
    text-align: center; /* 居中 */
    font-size: 14px;
    color: #fff;
}

.footer-info p {
    margin: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .main-nav ul {
        gap: 15px;
    }
    
    .main-nav a {
        font-size: 14px;
    }
    
    .search-input {
        width: 150px;
    }
    
    .recommended-articles {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-info {
        text-align: center;
    }
    
    /* 移动端隐藏友情链接版块 */
    .footer-links {
        display: none;
    }
    
    /* 移动端隐藏网站描述信息 */
    .footer-info p:first-child {
        display: none;
    }
    
    /* 移动端返回顶部按钮样式调整 */
    .scroll-top-btn {
        width: 45px !important;
        height: 45px !important;
        bottom: 15px !important;
        right: 15px !important;
    }
    
    .scroll-top-btn .icon-arrow-up {
        width: 20px !important;
        height: 20px !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .search-box {
        justify-content: center;
    }
    
    .search-input {
        width: 120px;
    }
}

/* 全站通用图标（SVG 背景版） */
.iconfont {
    display: inline-block;
    width: 1em;
    height: 1em;
    line-height: 1;
    vertical-align: -0.1em;
}

/* 热门图标：火焰 */
.iconfont.icon-hot {
    width: 18px; /* 放大图标 */
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%23ff4d4f'%3E%3Cpath d='M12 2s1 3-1 5-5 3-5 8a6 6 0 0 0 12 0c0-3-2-5-3-6s-1-4-1-7c0 0-1 1-2 3z'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* 回到顶部 向上箭头 */
.icon-arrow-up {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center/contain;
    vertical-align: middle;
}

/* ====== 头部与导航（原 header-nav.css 合并） ====== */
/* 顶部搜索栏样式 */
.top-search-bar { background-color: #ffffff; border-bottom: 1px solid #e0e0e0; padding: 15px 0; }
.header-content { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 8px; }
/* Logo样式 */
.logo a { display: flex; align-items: center; text-decoration: none; color: inherit; }
.logo-icon { display: inline-block; width: 40px; height: 40px; background: linear-gradient(135deg, #ff6b6b, #4ecdc4); color: white; font-size: 24px; font-weight: bold; text-align: center; line-height: 40px; border-radius: 8px; margin-right: 12px; }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 24px; font-weight: bold; color: #0d6fb8; line-height: 1.2; }
.logo-domain { font-size: 12px; color: #6b7280; line-height: 1; margin-top: 2px; }
/* 搜索框样式 */
.search-box { display: flex; align-items: center; position: relative; }
.search-box form { display: flex; align-items: center; }
.search-input { width: 300px; height: 40px; padding: 0 15px; border: 1px solid #d1d5db; border-radius: 6px 0 0 6px; font-size: 14px; color: #374151; background-color: #f9fafb; outline: none; transition: border-color 0.3s ease; }
.search-input:focus { border-color: #0d6fb8; background-color: #ffffff; }
.search-input::placeholder { color: #9ca3af; }
.search-btn { height: 40px; padding: 0 20px; background-color: #0d6fb8; color: white; border: none; border-radius: 0 6px 6px 0; font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color 0.3s ease; }
.search-btn:hover { background-color: #0a5a9a; }
/* 主导航栏样式 */
.main-header { background: linear-gradient(135deg, #0d6fb8 0%, #0a5a9a 100%); padding: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); position: relative; }
/* 移动端汉堡按钮 */
.mobile-nav-toggle { display: none; width: 36px; height: 36px; background: #0d6fb8; color: white; border: none; border-radius: 6px; cursor: pointer; align-items: center; justify-content: center; transition: background-color 0.3s ease; padding: 8px; box-sizing: border-box; flex-direction: column; }
.mobile-nav-toggle:hover { background: #0a5a9a; }
.mobile-nav-toggle .bar { display: block; width: 18px; height: 2px; background: #fff; margin: 2px 0; border-radius: 1px; }
.main-header::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, rgba(13, 111, 184, 0.9) 0%, rgba(10, 90, 154, 0.9) 100%); z-index: 1; }
.main-nav { max-width: 1200px; margin: 0 auto; padding: 0; position: relative; z-index: 2; }
.main-nav ul { display: flex; list-style: none; margin: 0; padding: 0; justify-content: flex-start; align-items: left; height: 52px; }
.main-nav li { margin: 0; position: relative; }
.main-nav a { display: block; padding: 12px 10px; color: white; text-decoration: none; font-size: 18px; transition: all 0.3s ease; border-radius: 8px; position: relative; text-transform: uppercase; letter-spacing: 0.5px; }
.main-nav a::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.1); border-radius: 8px; opacity: 0; transition: opacity 0.3s ease; z-index: -1; }
.main-nav a:hover::before { opacity: 1; }
.main-nav a:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); color: white; }
.main-nav li.active > a { background: #0d5488; border-radius: 0; color: white; }
.main-nav a.active::after { display: none; }
/* 响应式设计（头部与导航） */
@media (max-width: 768px) {
    .header-content { flex-direction: row; justify-content: space-between; align-items: center; gap: 0; }
    /* 移动端logo样式调整 */
    .logo { flex: 1; }
    .logo h1 { margin: 0; }
    .logo img { height: 52px; width: auto; }
    /* 移动端搜索框样式 */
    .search-box { flex-shrink: 0; display: flex; align-items: center; }
    .mobile-nav-toggle { display: flex !important; background: #0d6fb8 !important; }
    .mobile-nav-toggle:hover { background: #0a5a9a !important; }
    .search-form, .search-input, .search-btn { display: none !important; }
    /* 移动端调整搜索框区域布局 */
    .top-search-bar { padding: 10px 0; }
    .main-nav ul { display: none; position: fixed; top: 0; left: 0; right: 0; height: auto; flex-direction: column; gap: 0; padding: 20px; background: rgba(0,0,0,0.95); border-radius: 0; z-index: 99999; overflow-y: auto; max-height: 80vh; }
    /* 导航菜单关闭按钮 */
    .main-nav ul::before { content: '×'; position: absolute; top: 10px; right: 20px; font-size: 30px; color: white; cursor: pointer; z-index: 100000; }
    .main-nav li { margin: 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .main-nav a { padding: 20px 12px; font-size: 18px; margin: 0; text-transform: none; letter-spacing: 0.3px; color: white; display: block; text-align: left; }
    .main-nav a:hover { transform: translateY(-1px); color: white; }
    .main-nav li.active > a { color: white; }
}
/* 展开态 */
.main-header.nav-open .main-nav ul { display: flex; }
@media (max-width: 480px) {
    .logo-icon { width: 35px; height: 35px; font-size: 20px; line-height: 35px; }
    .logo-title { font-size: 20px; }
    .search-input { width: 200px; }
    .main-nav ul { padding: 8px 0; }
    .main-nav a { padding: 10px 15px; font-size: 13px; margin: 3px 2px; }
    .main-nav a.active::after { width: 20px; height: 2px; }
}
