/* --- 核心变量系统 (商务科技风) --- */
:root {
    /* 品牌主色：深铁灰 */
    --primary-color: #2c3e50;
    /* 强调色：中原红 */
    --accent-color: #c0392b; 
    /* 辅助色：科技蓝 */
    --secondary-color: #3498db;
    
    --text-main: #222222;
    --text-light: #555555;
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    
    /* 硬朗的投影 */
    --shadow: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-hover: 0 5px 15px rgba(0,0,0,0.15);
    
    /* 极简圆角 */
    --radius: 2px;
    
    --font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* 全局防止横向滚动 */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
    padding-bottom: 70px; /* 移动端底部留白 */
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- 顶部导航栏 --- */
.header {
    background: var(--primary-color);
    color: #fff;
    height: 55px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    width: 100%;
}
.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}
.logo { font-size: 1.1rem; font-weight: 700; letter-spacing: 1px; white-space: nowrap; display: flex; align-items: center; }
.logo::before { content: '💳'; margin-right: 5px; }
.main-nav { display: flex; gap: 15px; flex-shrink: 0; }
.main-nav a { font-size: 0.95rem; color: #ecf0f1; padding: 5px 10px; white-space: nowrap; }
.main-nav a.active { background: rgba(255,255,255,0.1); border-radius: var(--radius); }

/* --- 布局容器 --- */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 25px;
}

/* --- 左侧文章内容区域 --- */
.article-box {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary-color);
    word-wrap: break-word;
    overflow: hidden;
}

.article-header {
    border-bottom: 1px solid #eee;
    margin-bottom: 25px;
    padding-bottom: 15px;
}
.article-h1 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.4;
    font-weight: 700;
}
.article-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 正文内容样式 */
.article-content { font-size: 1.05rem; color: #333; text-align: justify; }
.article-content h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 30px 0 15px;
    padding-left: 10px;
    border-left: 5px solid var(--accent-color);
    line-height: 1.2;
}
.article-content h3 { color: #555; margin: 20px 0 10px; font-weight: bold; }
.article-content p { margin-bottom: 20px; }

/* 锚文本样式 */
.article-content a {
    color: var(--secondary-color);
    font-weight: bold;
    border-bottom: 1px dashed var(--secondary-color);
    word-break: break-all;
}
.article-content a:hover {
    color: var(--accent-color);
    border-bottom-style: solid;
}

/* --- 响应式表格 (关键技术：移动端转卡片) --- */
.table-wrapper { margin: 25px 0; width: 100%; overflow-x: auto; }
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}
.responsive-table th {
    background: var(--primary-color);
    color: #fff;
    padding: 12px;
    text-align: left;
    font-weight: normal;
}
.responsive-table td {
    border: 1px solid #eee;
    padding: 12px;
    vertical-align: top;
}
.responsive-table tr:nth-child(even) { background: #f9f9f9; }

/* --- 重点高亮块 --- */
.highlight-box {
    background: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
    padding: 15px;
    border-radius: 2px;
    margin: 20px 0;
}
.highlight-title { font-weight: bold; margin-bottom: 10px; display: block; }
.important-text { color: #e74c3c; font-weight: bold; }

/* --- 上一篇/下一篇 --- */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.post-nav a { 
    font-size: 0.9rem; 
    color: #666; 
    width: 48%; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    display: inline-block;
}
.post-nav a:hover { color: var(--accent-color); }

/* --- 右侧侧边栏 --- */
.sidebar { display: flex; flex-direction: column; gap: 25px; }
.widget { background: var(--bg-card); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.widget-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* 微信模块 */
.wx-box { text-align: center; border: 1px dashed #ddd; padding: 15px; background: #fdfdfd; }
.wx-box img { width: 140px; height: 140px; margin: 0 auto; max-width: 100%; }
.wx-cta { color: var(--accent-color); font-weight: bold; margin-top: 10px; display: block; }

/* 热门推荐 */
.hot-list li { padding: 8px 0; border-bottom: 1px dashed #eee; }
.hot-list a { font-size: 0.95rem; color: var(--text-main); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-list a:hover { color: var(--accent-color); padding-left: 5px; }

/* 搜索模块 */
.search-form { display: flex; }
.search-input { flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 2px 0 0 2px; }
.search-submit { background: var(--primary-color); color: #fff; border: none; padding: 0 15px; cursor: pointer; border-radius: 0 2px 2px 0; }

/* --- 底部区域 --- */
.footer { background: #1a1a1a; color: #888; padding: 30px 0; margin-top: 40px; text-align: center; }
.footer a { color: #aaa; margin: 0 5px; }

/* --- 悬浮元素 --- */
.float-kefu { position: fixed; left: 0; top: 50%; transform: translateY(-50%); background: var(--accent-color); color: #fff; width: 40px; padding: 10px 5px; text-align: center; cursor: pointer; border-radius: 0 4px 4px 0; z-index: 999; font-size: 13px; transition: width 0.3s; }
.float-kefu:hover { width: 50px; }

.float-right-pc { position: fixed; right: 10px; top: 40%; background: #fff; padding: 10px; border: 1px solid #ddd; text-align: center; width: 140px; z-index: 999; }
.float-right-pc img { width: 100%; margin-bottom: 5px; cursor: zoom-in; }

.float-bottom-mobile { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; border-top: 1px solid #ddd; z-index: 2000; padding: 8px 15px; justify-content: space-between; align-items: center; }
.float-bottom-mobile img { width: 35px; height: 35px; margin-right: 8px; }
.float-btn { background: var(--accent-color); color: #fff; padding: 8px 15px; border-radius: 4px; font-size: 14px; }

/* 模态框 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 3000; justify-content: center; align-items: center; }
.modal-content { max-width: 90%; max-height: 90%; border: 5px solid #fff; }

/* --- 移动端适配查询 (覆盖) --- */
@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; display: block; }
    .article-box { margin-bottom: 25px; padding: 20px 15px; }
    .article-h1 { font-size: 1.4rem; }
}

@media (max-width: 768px) {
    .float-right-pc { display: none; }
    .float-bottom-mobile { display: flex; }
    
    /* 响应式表格核心代码 */
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td {
        display: block; width: 100%; box-sizing: border-box;
    }
    .responsive-table thead { display: none; }
    
    .responsive-table tr {
        margin-bottom: 15px; border: 1px solid #ddd; border-radius: var(--radius);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05); background: #fff !important; overflow: hidden;
    }
    
    .responsive-table td {
        padding: 10px 15px; text-align: left; position: relative;
        padding-left: 40%; border: none; border-bottom: 1px solid #f0f0f0;
        font-size: 0.9rem; min-height: 40px; word-break: break-word;
    }
    
    .responsive-table td::before {
        content: attr(data-label); position: absolute; left: 15px; top: 10px; width: 35%;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: bold; color: var(--primary-color);
    }
    
    .responsive-table td:first-child {
        background: #f5f5f5; padding-left: 15px; text-align: center;
        font-weight: bold; color: var(--accent-color); font-size: 1rem;
    }
    .responsive-table td:first-child::before { display: none; }
    
    .responsive-table td:last-child { border-bottom: none; }
}

@media (max-width: 600px) {
    .nav-container { padding: 0 10px; }
    .logo { font-size: 1rem; margin-right: auto; }
    .main-nav { gap: 5px; }
    .main-nav a { font-size: 0.85rem; padding: 4px 6px; }
}