/* --- CSS 变量 --- */
:root {
    --primary-color: #009688;
    --primary-dark: #00796b;
    --secondary-color: #f5f5f5;
    --text-main: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --highlight-bg: #fff3cd;
    --highlight-text: #856404;
}

/* --- 基础重置 --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    outline: none; 
}

body { 
    font-family: var(--font-stack); 
    color: var(--text-main); 
    background-color: #f9f9f9; 
    line-height: 1.8; 
}

a { 
    text-decoration: none; 
    color: inherit; 
    transition: 0.3s; 
}

a:hover { 
    color: var(--primary-color); 
}

ul { 
    list-style: none; 
}

img { 
    max-width: 100%; 
    display: block; 
}

/* --- 顶部导航 --- */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 999;
    height: 60px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 15px;
    white-space: nowrap;
}

.logo a {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu a {
    font-size: 16px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
}

.nav-menu a.active {
    background-color: var(--primary-color);
    color: var(--white);
}

@media (max-width: 768px) {
    .nav-container { 
        padding: 0 10px; 
    }
    .logo a { 
        font-size: 16px; 
    }
    .nav-menu { 
        gap: 5px; 
    }
    .nav-menu a { 
        font-size: 14px; 
        padding: 5px 8px; 
    }
}

/* --- 主体布局 --- */
.main-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    display: flex;
    gap: 20px;
}

.article-content {
    flex: 3;
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.right-sidebar {
    flex: 1;
    min-width: 300px;
}

/* --- 文章头部 --- */
.article-header {
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.article-title {
    font-size: 32px;
    line-height: 1.4;
    margin-bottom: 15px;
    color: var(--text-main);
}

.article-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 14px;
    flex-wrap: wrap;
}

.article-meta span::before {
    margin-right: 5px;
}

.meta-date::before { 
    content: '📅'; 
}

.meta-views::before { 
    content: '👁'; 
}

.meta-cat::before { 
    content: '📁'; 
}

/* --- 文章正文 --- */
.article-body {
    font-size: 16px;
    line-height: 1.9;
}

.article-body h2 {
    font-size: 24px;
    margin: 30px 0 15px;
    padding-left: 12px;
    border-left: 4px solid var(--primary-color);
    color: var(--text-main);
}

.article-body h3 {
    font-size: 20px;
    margin: 25px 0 12px;
    color: var(--primary-dark);
}

.article-body p {
    margin-bottom: 16px;
    text-align: justify;
}

.article-body strong {
    color: var(--primary-color);
    font-weight: 600;
}

.article-body em {
    background: var(--highlight-bg);
    color: var(--highlight-text);
    padding: 2px 6px;
    border-radius: 3px;
    font-style: normal;
}

/* 内链样式 */
.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

/* 重点标记 */
.highlight-box {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.highlight-box p {
    margin: 0;
    color: var(--highlight-text);
    font-weight: 500;
}

/* 列表样式 */
.article-body ul, 
.article-body ol {
    margin: 15px 0 15px 25px;
}

.article-body ul li, 
.article-body ol li {
    margin-bottom: 10px;
    padding-left: 10px;
}

.article-body ul li {
    list-style: none;
    position: relative;
}

.article-body ul li::before {
    content: '●';
    color: var(--primary-color);
    position: absolute;
    left: -15px;
}

/* 表格样式 - 支持移动端横向滚动 */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 25px 0;
    -webkit-overflow-scrolling: touch;
}

.article-body table {
    width: 100%;
    min-width: 600px; /* 设置最小宽度，小屏幕可以滚动 */
    border-collapse: collapse;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article-body table thead {
    background: var(--primary-color);
    color: var(--white);
}

.article-body table th,
.article-body table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.article-body table th {
    font-weight: 600;
}

.article-body table tbody tr:nth-child(even) {
    background: var(--secondary-color);
}

.article-body table tbody tr:hover {
    background: #e0f7f4;
}

/* 微信订阅模块 */
.wx-subscribe {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
    text-align: center;
    border: 2px dashed var(--primary-color);
}

.wx-subscribe h3 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 20px;
}

.wx-subscribe .qr-code {
    width: 150px;
    height: 150px;
    margin: 15px auto;
    background: var(--white);
    border: 3px solid var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.wx-subscribe p {
    color: var(--text-main);
    font-size: 14px;
    margin: 10px 0;
}

.wx-phone {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: bold;
    margin-top: 10px;
}

/* 上一篇/下一篇导航 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 40px 0;
    padding-top: 30px;
    border-top: 2px solid var(--secondary-color);
}

.nav-item {
    flex: 1;
    padding: 15px;
    background: var(--secondary-color);
    border-radius: 6px;
    transition: all 0.3s;
}

.nav-item:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.nav-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.nav-item:hover .nav-label {
    color: rgba(255,255,255,0.8);
}

.nav-title {
    font-size: 15px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-prev { 
    text-align: left; 
}

.nav-next { 
    text-align: right; 
}

@media (max-width: 768px) {
    .post-navigation {
        flex-direction: column;
    }
}

/* --- 侧边栏 --- */
.sidebar-widget {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 18px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* 热门推荐列表 */
.hot-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    position: relative;
    padding-left: 20px;
}

.hot-list li:last-child {
    border-bottom: none;
}

.hot-list li::before {
    content: '●';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-size: 10px;
    top: 14px;
}

.hot-list li a {
    font-size: 14px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s;
}

.hot-list li a:hover {
    padding-left: 5px;
}

/* 关注微信 */
.wx-widget-img {
    width: 150px;
    height: 150px;
    margin: 15px auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.wx-widget p {
    text-align: center;
    margin-top: 10px;
    color: var(--text-light);
    font-size: 14px;
}

.wx-widget .phone {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    .article-content {
        padding: 20px;
    }
    .article-title {
        font-size: 24px;
    }
    .right-sidebar {
        order: -1;
    }
}

/* --- 底部 --- */
footer {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
    margin-top: 40px;
}

footer a {
    color: #bdc3c7;
}

footer a:hover {
    color: var(--white);
}

/* --- 悬浮组件 --- */
.float-left-kf {
    position: fixed;
    left: 20px;
    top: 50%;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    font-size: 12px;
    text-align: center;
}

.mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    display: none;
}

.mobile-btn {
    text-align: center;
    flex: 1;
    font-size: 14px;
}

@media (max-width: 768px) {
    .mobile-bottom-bar { 
        display: flex; 
    }
    body { 
        padding-bottom: 60px; 
    }
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    cursor: pointer;
}