/* --- CSS 变量系统 (洛阳·古都雅韵风) --- */
:root {
    /* 主色调：牡丹紫 - 象征尊贵、稳重 */
    --primary-color: #6A1B9A; 
    /* 辅助色：浅紫背景 */
    --primary-light: #F3E5F5;
    /* 强调色：琉璃黄 - 象征活力、财富 */
    --accent-color: #FFAB00; 
    
    --text-main: #212121;
    --text-light: #757575;
    --bg-body: #FAFAFA;
    --bg-card: #ffffff;
    
    /* 阴影：带有紫色调的柔和阴影 */
    --shadow: 0 4px 12px rgba(106, 27, 154, 0.08);
    --shadow-hover: 0 8px 20px rgba(106, 27, 154, 0.15);
    
    /* 特色圆角：对角切边 (模拟花瓣/叶片，洛阳特色) */
    --radius-leaf: 12px 0 12px 0;
    --radius-btn: 50px;
    
    --font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
}

/* --- 全局重置 --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    outline: none; 
    -webkit-tap-highlight-color: transparent; 
}

/* 防止水平滚动 */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
    padding-bottom: 80px; /* 移动端底部留白，防止悬浮按钮遮挡 */
    word-break: break-word; /* 强制长单词换行 */
}

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

/* --- 顶部导航栏 --- */
.header {
    background: #fff;
    border-bottom: 2px solid var(--primary-light);
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    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.2rem;
    font-weight: bold;
    color: var(--primary-color);
    white-space: nowrap;
    display: flex;
    align-items: center;
}
.logo::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    margin-right: 8px;
}
.main-nav { display: flex; gap: 15px; flex-shrink: 0; }
.main-nav a {
    font-size: 1rem;
    color: var(--text-main);
    padding: 6px 15px;
    border-radius: var(--radius-btn);
    font-weight: 500;
    white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(106, 27, 154, 0.3);
}

@media (max-width: 600px) {
    .nav-container { padding: 0 10px; }
    .logo { font-size: 1.1rem; }
    .main-nav { gap: 5px; }
    .main-nav a { font-size: 0.9rem; padding: 5px 10px; }
}

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

/* --- 左侧文章内容 --- */
.article-box {
    background: #fff;
    padding: 30px;
    border-radius: var(--radius-leaf);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary-color);
}

.article-header { border-bottom: 1px dashed #eee; margin-bottom: 25px; padding-bottom: 15px; }
.article-h1 { font-size: 1.6rem; color: var(--primary-color); margin-bottom: 15px; line-height: 1.3; font-weight: bold; }
.article-meta { color: #999; font-size: 0.85rem; 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(--text-main);
    margin: 30px 0 15px;
    padding-left: 10px;
    border-left: 5px solid var(--accent-color);
    line-height: 1.2;
    font-weight: bold;
}
.article-content h3 { font-size: 1.1rem; color: var(--primary-color); margin: 20px 0 10px; font-weight: bold; }
.article-content p { margin-bottom: 15px; }

/* 锚文本样式 */
.article-content a { color: var(--primary-color); border-bottom: 1px dashed var(--primary-color); font-weight: 500; }
.article-content a:hover { color: var(--accent-color); border-bottom: 1px solid var(--accent-color); }

/* 重点高亮块 */
.highlight-box {
    background-color: var(--primary-light);
    border: 1px solid #e1bee7;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    color: #4a148c;
}
.highlight-title { font-weight: bold; display: block; margin-bottom: 10px; font-size: 1.1rem; }

/* 列表样式 */
.custom-list li { margin-bottom: 8px; position: relative; padding-left: 20px; }
.custom-list li::before { content: '✔'; position: absolute; left: 0; color: var(--accent-color); font-weight: bold; }

/* --- 响应式表格 (核心：手机端转卡片) --- */
.table-wrapper { margin: 25px 0; width: 100%; overflow-x: auto; }
.responsive-table { width: 100%; border-collapse: collapse; border: 1px solid #eee; }
.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: #fcfcfc; }

@media (max-width: 768px) {
    /* 强制表格元素块级显示 */
    .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: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        padding: 10px;
        background: #fff;
    }
    
    /* 单元格样式 */
    .responsive-table td {
        padding: 8px 0;
        text-align: left;
        position: relative;
        padding-left: 40%; /* 留出左侧标签空间 */
        border: none;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.9rem;
        min-height: 40px;
        display: flex;
        align-items: center; /* 垂直居中 */
    }
    
    /* 利用伪元素显示表头标签 */
    .responsive-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 8px;
        width: 35%;
        white-space: nowrap;
        font-weight: bold;
        color: var(--primary-color);
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 最后一列去掉底边框 */
    .responsive-table td:last-child { border-bottom: none; }
    
    /* 第一列作为标题高亮 (块级显示，去除flex布局) */
    .responsive-table td:first-child {
        background: var(--primary-light);
        padding: 10px;
        margin-bottom: 10px;
        padding-left: 10px;
        text-align: center;
        font-weight: bold;
        color: var(--primary-color);
        border-radius: 4px;
        display: block; 
    }
    .responsive-table td:first-child::before { display: none; }
}

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

/* --- 右侧侧边栏 --- */
.sidebar { display: flex; flex-direction: column; gap: 25px; }

.widget {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-leaf);
    box-shadow: var(--shadow);
    border: 1px solid #f0f0f0;
}

.widget-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: bold;
    position: relative;
    padding-left: 10px;
    border-left: 4px solid var(--accent-color);
}

/* 热门推荐 */
.hot-list li { padding: 10px 0; border-bottom: 1px dashed #f0f0f0; }
.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(--primary-color); padding-left: 5px; }
.hot-list span { color: var(--accent-color); margin-right: 5px; font-weight: bold; }

/* 微信模块 */
.wx-box { text-align: center; background: var(--primary-light); padding: 15px; border-radius: 8px; }
.wx-box img { width: 140px; height: 140px; margin: 0 auto 10px; border: 2px solid #fff; border-radius: 8px; }
.wx-desc { font-size: 0.9rem; color: var(--primary-color); font-weight: bold; }

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

/* --- 响应式布局修正 --- */
@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; }
}

/* --- 底部 & 悬浮 (复用) --- */
.footer { background-color: #2e003e; color: #e1bee7; padding: 30px 0; margin-top: 40px; text-align: center; font-size: 0.9rem; }
.footer a { color: #fff; margin: 0 5px; }

.float-kefu { position: fixed; left: 10px; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; background: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 10px rgba(106, 27, 154, 0.4); cursor: pointer; z-index: 999; font-size: 12px; line-height: 1.2; }
.float-right-pc { position: fixed; right: 20px; top: 40%; background: #fff; padding: 10px; border-radius: var(--radius-leaf); box-shadow: 0 5px 15px rgba(0,0,0,0.1); z-index: 999; text-align: center; border: 2px solid var(--primary-light); }
.float-right-pc img { width: 120px; height: 120px; margin-bottom: 5px; cursor: zoom-in; }

.float-bottom-mobile { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 2000; padding: 10px 15px; justify-content: space-between; align-items: center; }
.float-wx-box { display: flex; align-items: center; font-size: 0.9rem; color: #333; }
.float-wx-box img { width: 40px; height: 40px; margin-right: 10px; border-radius: 5px; }
.float-call-btn { background: var(--primary-color); color: #fff; padding: 8px 20px; border-radius: 50px; font-weight: bold; }

@media (max-width: 768px) { .float-right-pc { display: none; } .float-bottom-mobile { display: flex; } }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(46, 0, 62, 0.85); z-index: 3000; justify-content: center; align-items: center; }
.modal img { max-width: 80%; max-height: 80%; border: 4px solid #fff; border-radius: 10px; }