/* ================= style.css ================= */
:root {
    --bg-color: #F8F7F4;       
    --surface: #FFFFFF;        
    --surface-hover: #FAFAFA;
    --ink-main: #282826;       
    --ink-muted: #6B6B65;      
    --red-seal: #9B2E2E;       
    --border: #E5E3DD;         
    --shadow: rgba(0, 0, 0, 0.06);
    --char-bg: rgba(0, 0, 0, 0.025);
    --nav-bg: rgba(248, 247, 244, 0.9);
    
    --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
    --font-sans: "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    
    --transition-base: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-theme: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

[data-theme="dark"] {
    --bg-color: #121212;       
    --surface: #1C1C1C;        
    --surface-hover: #242424;
    --ink-main: #E2DFD8;       
    --ink-muted: #8E8B84;      
    --red-seal: #A93838;       
    --border: #2F2F2F;         
    --shadow: rgba(0, 0, 0, 0.5);
    --char-bg: rgba(255, 255, 255, 0.02);
    --nav-bg: rgba(18, 18, 18, 0.9);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-color); color: var(--ink-main);
    font-family: var(--font-serif); line-height: 1.8;
    transition: var(--transition-theme);
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
ul, ol { list-style: none; }

/* ================= 通用布局与组件 ================= */
.section { padding: 100px 0; position: relative; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

.section-header { text-align: center; margin-bottom: 60px; }
.section-label { font-size: 13px; color: var(--red-seal); letter-spacing: 6px; margin-bottom: 16px; font-family: var(--font-sans); display: inline-block; border: 1px solid var(--red-seal); padding: 4px 16px; border-radius: 20px; }
.section-title { font-size: 36px; font-weight: 400; letter-spacing: 8px; color: var(--ink-main); position: relative; }
.section-title::after { content: ''; display: block; width: 32px; height: 2px; background: var(--ink-main); margin: 24px auto 0; transition: var(--transition-theme); }

.view-all-wrap { text-align: center; margin-top: 60px; }
.view-all-btn { display: inline-block; padding: 12px 40px; border: 1px solid var(--border); color: var(--ink-main); letter-spacing: 4px; font-size: 14px; transition: var(--transition-base); background: var(--surface); border-radius: 4px; }
.view-all-btn:hover { border-color: var(--red-seal); color: var(--red-seal); background: var(--bg-color); transform: translateY(-2px); box-shadow: 0 8px 16px var(--shadow); }

/* 渐显动画 */
.fade-in { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ================= 动态页头 ================= */
nav { position: fixed; top: 0; left: 0; width: 100%; background: var(--nav-bg); backdrop-filter: blur(16px); z-index: 100; border-bottom: 1px solid var(--border); transition: var(--transition-theme); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 72px; }
.logo { font-size: 24px; font-weight: 700; letter-spacing: 4px; color: var(--ink-main); }
.logo span { color: var(--red-seal); }
.nav-links { display: flex; align-items: center; gap: 40px; }
.nav-links a.nav-item { font-size: 15px; letter-spacing: 2px; color: var(--ink-muted); transition: var(--transition-base); position: relative; }
.nav-links a.nav-item:hover { color: var(--ink-main); }
.nav-links a.nav-item::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 2px; background: var(--red-seal); transition: var(--transition-base); }
.nav-links a.nav-item:hover::after { width: 100%; }

/* ================= 搜索组件 ================= */
.search-container { position: relative; margin-left: 12px; display: flex; align-items: center; }
.search-input { background: transparent; border: none; border-bottom: 1px solid var(--ink-muted); color: var(--ink-main); font-family: var(--font-serif); font-size: 14px; padding: 4px 8px; width: 120px; transition: var(--transition-base); outline: none; }
.search-input:focus { width: 200px; border-bottom-color: var(--red-seal); }
.search-input::placeholder { color: var(--ink-muted); opacity: 0.6; font-size: 13px; letter-spacing: 2px; }
.search-dropdown { position: absolute; top: 50px; right: 0; width: 320px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 16px 40px var(--shadow); border-radius: 4px; max-height: 400px; overflow-y: auto; opacity: 0; pointer-events: none; transform: translateY(10px); transition: var(--transition-base); z-index: 200; }
.search-dropdown.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.search-dropdown::-webkit-scrollbar { width: 4px; }
.search-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.search-status { padding: 16px; font-size: 13px; color: var(--ink-muted); text-align: center; letter-spacing: 2px; }
.search-item { display: block; padding: 16px; border-bottom: 1px dashed var(--border); transition: var(--transition-base); cursor: pointer; }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg-color); border-left: 2px solid var(--red-seal); padding-left: 14px; }
.search-item-title { font-size: 15px; font-weight: bold; color: var(--ink-main); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.search-item-type { font-size: 11px; color: var(--red-seal); border: 1px solid var(--red-seal); padding: 1px 6px; border-radius: 12px; font-family: var(--font-sans); font-weight: normal; }
.search-item-snippet { font-size: 12px; color: var(--ink-muted); line-height: 1.6; text-align: justify; }
.search-highlight { color: var(--red-seal); font-weight: bold; background: transparent; }

/* ================= 动态页脚与免责声明 ================= */
footer { background: #111111; color: #888888; padding: 80px 24px 60px; text-align: center; border-top: 1px solid #222; }
.footer-logo { font-size: 24px; color: #FFFFFF; letter-spacing: 8px; margin-bottom: 24px; font-weight: bold; font-family: var(--font-serif); }
.footer-text { font-size: 13px; font-family: var(--font-sans); margin-bottom: 12px; letter-spacing: 2px; }
.footer-disclaimer { margin-top: 32px; padding-top: 24px; border-top: 1px dashed #333; font-size: 12px; color: #666; max-width: 800px; margin-left: auto; margin-right: auto; line-height: 2; letter-spacing: 1px; font-family: var(--font-sans); text-align: justify; text-align-last: center; }
.footer-disclaimer strong { color: #999; font-weight: normal; }

/* ================= 悬浮控制面板 ================= */
.floating-controls { position: fixed; bottom: 40px; right: 40px; display: flex; flex-direction: column; gap: 16px; z-index: 99; }
.float-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--ink-main); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px var(--shadow); transition: var(--transition-base); outline: none; }
.float-btn:hover { color: var(--red-seal); border-color: var(--red-seal); transform: translateY(-4px); }
.float-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.moon-icon { display: block; } .sun-icon { display: none; }[data-theme="dark"] .moon-icon { display: none; }[data-theme="dark"] .sun-icon { display: block; }
#btn-btt { opacity: 0; pointer-events: none; transform: translateY(20px); }
#btn-btt.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ================= 首页独有样式 ================= */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; padding-top: 72px; overflow: hidden; }
.hero::before { content: '道'; position: absolute; font-size: 50vh; color: var(--char-bg); z-index: -1; font-family: "KaiTi", "STKaiti", serif; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.hero h1 { font-size: 88px; font-weight: 400; letter-spacing: 32px; margin: 0 0 24px 32px; }
.hero .subtitle { font-size: 20px; color: var(--ink-muted); letter-spacing: 12px; margin-bottom: 48px; font-family: var(--font-sans); }
.hero-axis { display: flex; align-items: center; gap: 24px; font-size: 15px; letter-spacing: 4px; color: var(--red-seal); border: 1px solid var(--border); padding: 16px 40px; border-radius: 40px; background: var(--surface); box-shadow: 0 8px 24px var(--shadow); }
.hero-axis span { display: flex; align-items: center; gap: 12px; }
.hero-axis span::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--red-seal); }

/* 大道演化网格 */
.core-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.core-card { background: var(--surface); border: 1px solid var(--border); padding: 48px 32px; text-align: center; transition: var(--transition-base); border-radius: 6px; }
.core-card:hover { border-color: var(--red-seal); transform: translateY(-8px); box-shadow: 0 16px 32px var(--shadow); }
.core-icon { font-size: 36px; color: var(--red-seal); margin-bottom: 24px; font-family: "KaiTi", "STKaiti", serif; width: 80px; height: 80px; line-height: 80px; border: 1px solid var(--border); border-radius: 50%; margin: 0 auto 24px; }
.core-title { font-size: 22px; font-weight: bold; letter-spacing: 4px; margin-bottom: 16px; }
.core-desc { font-size: 14px; color: var(--ink-muted); line-height: 2.2; }

/* 通用卡片网格 */
.deity-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.deity-card { background: var(--surface); border: 1px solid var(--border); padding: 40px 32px; transition: var(--transition-base); position: relative; overflow: hidden; border-radius: 6px; display: flex; flex-direction: column; min-height: 360px; }
.deity-card:hover { border-color: var(--ink-main); box-shadow: 0 20px 40px var(--shadow); transform: translateY(-8px); }
.deity-bg-char { position: absolute; right: -10px; bottom: -30px; font-size: 150px; color: var(--char-bg); font-family: "KaiTi", "STKaiti", serif; z-index: 0; pointer-events: none; }
.deity-content { position: relative; z-index: 1; flex-grow: 1; display: flex; flex-direction: column; }
.deity-header { display: flex; align-items: center; margin-bottom: 16px; }
.deity-name { font-size: 24px; font-weight: bold; letter-spacing: 2px; }
.deity-tag { border: 1px solid var(--red-seal); color: var(--red-seal); font-size: 12px; padding: 2px 10px; margin-left: 16px; border-radius: 20px; font-family: var(--font-sans); }
.deity-alias { font-size: 13px; color: var(--ink-muted); margin-bottom: 20px; font-family: var(--font-sans); min-height: 42px; }
.deity-desc { font-size: 14px; text-align: justify; line-height: 2; opacity: 0.85; margin-bottom: 24px; }
.card-action { margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--border); text-align: right; }
.card-action a { font-size: 13px; color: var(--red-seal); letter-spacing: 2px; font-family: var(--font-sans); transition: var(--transition-base); }
.card-action a:hover { color: var(--ink-main); padding-right: 8px; }

.classic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.classic-card { padding: 32px 24px; transition: var(--transition-base); border-left: 2px solid var(--border); display: flex; flex-direction: column; min-height: 280px; }
.classic-card:hover { border-left-color: var(--ink-main); background: var(--surface); box-shadow: 0 10px 30px var(--shadow); }
.classic-title { font-size: 22px; font-weight: bold; letter-spacing: 2px; margin-bottom: 12px; }
.classic-author { font-size: 13px; color: var(--ink-muted); margin-bottom: 20px; font-family: var(--font-sans); }
.classic-desc { font-size: 14px; opacity: 0.8; line-height: 2.2; text-align: justify; margin-bottom: 24px; }

/* ================= 全览页独有头部 ================= */
.page-banner { padding: 180px 0 80px; text-align: center; background: var(--surface); border-bottom: 1px solid var(--border); }
.page-banner-title { font-size: 48px; letter-spacing: 16px; margin-left: 8px; margin-bottom: 24px; }
.page-banner-desc { font-size: 16px; color: var(--ink-muted); letter-spacing: 4px; }

/* ================= 详情内容页 (神仙与道经) ================= */
.layout-with-toc { display: flex; align-items: flex-start; gap: 80px; padding-top: 140px; padding-bottom: 120px; }
.page-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-muted); letter-spacing: 2px; margin-bottom: 40px; transition: var(--transition-base); font-family: var(--font-sans); }
.page-back:hover { color: var(--ink-main); transform: translateX(-4px); }

/* 左侧目录 */
.sidebar-toc { position: sticky; top: 120px; width: 220px; flex-shrink: 0; border-left: 1px solid var(--border); padding-left: 24px; }
.toc-title { font-size: 13px; color: var(--ink-muted); letter-spacing: 4px; margin-bottom: 24px; font-family: var(--font-sans); }
.toc-list li { margin-bottom: 12px; position: relative; }
.toc-link { font-size: 15px; color: var(--ink-muted); transition: var(--transition-base); display: inline-block; line-height: 1.6; }
.toc-link:hover { color: var(--ink-main); }
.toc-link.active { color: var(--red-seal); font-weight: bold; transform: translateX(4px); }
.toc-link.active::before { content: ''; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); width: 4px; height: 16px; background: var(--red-seal); border-radius: 2px; }

/* 右侧正文区域 */
.content-area { flex-grow: 1; max-width: 860px; }
.detail-header { position: relative; margin-bottom: 60px; border-bottom: 1px solid var(--border); padding-bottom: 60px; }
.detail-char { position: absolute; top: -80px; right: 5%; font-size: 260px; color: var(--char-bg); font-family: "KaiTi", "STKaiti", serif; z-index: -1; line-height: 1; pointer-events: none; }
.detail-title { font-size: 48px; font-weight: normal; letter-spacing: 8px; margin-bottom: 16px; }
.detail-meta { font-family: var(--font-sans); color: var(--ink-muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 32px; }
.detail-meta span { display: inline-flex; align-items: center; gap: 8px; }
.detail-meta span::before { content: ''; display: inline-block; width: 4px; height: 4px; background: var(--red-seal); border-radius: 50%; }

/* 正文基础排版 */
.article-body { font-size: 16px; line-height: 2.4; letter-spacing: 1px; text-align: justify; }

/* 二级标题 (章节大纲) */
.article-body h2 { font-size: 24px; font-weight: normal; color: var(--ink-main); margin: 60px 0 32px; position: relative; padding-left: 16px; scroll-margin-top: 100px; font-weight: bold; }
.article-body h2::before { content: '·'; position: absolute; left: 0; color: var(--red-seal); font-weight: bold; }

/* 三级标题 (如：【经典原文】、【白话译文】) */
.article-body h3 { font-size: 17px; color: var(--red-seal); margin: 40px 0 20px; font-weight: bold; border-bottom: 1px dashed var(--border); padding-bottom: 8px; display: inline-block; scroll-margin-top: 100px; }

/* 四级标题 (作为文内小节突出) */
.article-body h4 { font-size: 16px; color: var(--ink-main); font-weight: bold; margin: 24px 0 12px; scroll-margin-top: 100px; }

/* 段落 */
.article-body p { margin-bottom: 24px; text-indent: 2em; }

/* 引用区块 (常用于经文原文展示) */
.article-body blockquote { font-family: "KaiTi", "STKaiti", serif; font-size: 20px; line-height: 2.4; color: var(--ink-main); background: var(--surface-hover); border-left: 4px solid var(--red-seal); padding: 24px 32px; margin: 0 0 32px 0; letter-spacing: 2px; border-radius: 0 4px 4px 0; }
.article-body blockquote p { text-indent: 0; margin-bottom: 12px; }
.article-body blockquote p:last-child { margin-bottom: 0; }

/* 列表排版 */
.article-body ul, .article-body ol { padding-left: 2em; margin-bottom: 24px; color: var(--ink-muted); font-size: 15px; line-height: 2.2; }
.article-body ul li { list-style-type: disc; margin-bottom: 8px; }
.article-body ol li { list-style-type: decimal; margin-bottom: 8px; }

/* 粗体字强调 */
.article-body strong { color: var(--ink-main); font-weight: bold; border-bottom: 1px solid rgba(155, 46, 46, 0.3); padding-bottom: 1px; }

/* 道经专属阅读盒外观 */
.classic-read-box { background: var(--surface); border: 1px solid var(--border); padding: 80px 60px; box-shadow: 0 20px 60px var(--shadow); position: relative; }
.classic-read-box::before, .classic-read-box::after { content: ''; position: absolute; top: 10px; bottom: 10px; width: 1px; background: var(--border); }
.classic-read-box::before { left: 10px; }
.classic-read-box::after { right: 10px; }
.classic-read-box h2 { text-align: center; padding: 0; margin-bottom: 40px; border: none; }
.classic-read-box h2::before { display: none; }

/* ================= 纠错反馈模块 ================= */
.feedback-box { margin-top: 80px; padding: 40px; background: var(--surface-hover); border: 1px dashed var(--border); text-align: center; border-radius: 4px; }
.feedback-box p { font-size: 14px; color: var(--ink-muted); margin-bottom: 20px; text-indent: 0 !important; }
.feedback-box a { display: inline-block; padding: 10px 32px; border: 1px solid var(--red-seal); color: var(--red-seal); font-size: 14px; border-radius: 40px; transition: var(--transition-base); letter-spacing: 2px; }
.feedback-box a:hover { background: var(--red-seal); color: var(--surface); }

/* ================= 移动端适配 ================= */
@media (max-width: 1024px) {
    .core-grid, .deity-grid, .classic-grid { grid-template-columns: repeat(2, 1fr); }
    .layout-with-toc { gap: 40px; }
    .sidebar-toc { width: 180px; }
}
@media (max-width: 768px) {
    .section { padding: 80px 0; }
    .nav-inner { flex-direction: column; height: auto; padding: 16px 0; gap: 16px; }
    .nav-links { gap: 16px; flex-wrap: wrap; justify-content: center; }
    .search-container { margin-left: 0; width: 100%; justify-content: center; margin-top: 8px; }
    .search-input { width: 180px; }
    .search-dropdown { right: 50%; transform: translateX(50%) translateY(10px); width: 90vw; }
    .search-dropdown.show { transform: translateX(50%) translateY(0); }
    .hero { padding-top: 140px; }
    .hero h1 { font-size: 48px; letter-spacing: 16px; margin-left: 8px; }
    .core-grid, .deity-grid, .classic-grid { grid-template-columns: 1fr; }
    .page-banner { padding: 160px 0 60px; }
    .page-banner-title { font-size: 32px; letter-spacing: 8px; }
    .layout-with-toc { flex-direction: column; padding-top: 160px; }
    .sidebar-toc { position: static; width: 100%; border-left: none; border-bottom: 1px solid var(--border); padding-left: 0; padding-bottom: 24px; }
    .toc-list { display: flex; flex-wrap: wrap; gap: 16px; }
    .toc-link.active::before { display: none; }
    .toc-link.active { transform: none; border-bottom: 2px solid var(--red-seal); padding-bottom: 4px; }
    .detail-char { display: none; }
    .detail-meta { flex-direction: column; gap: 8px; }
    .classic-read-box { padding: 40px 24px; }
    .article-body blockquote { font-size: 18px; padding: 16px 20px; }
    .feedback-box { padding: 24px; margin-top: 60px; }
}