* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; background-color: #f9f6f0; color: #3d2c1e; line-height: 1.9; transition: background-color 0.3s, color 0.3s; padding-top: 72px; }
a { color: #8b5a2b; text-decoration: none; transition: color 0.2s; }
a:hover { color: #5a3a1a; }
body.dark { background-color: #1e1a16; color: #d4c8b8; }
body.dark a { color: #c9a87c; }
body.dark a:hover { color: #e8d5b8; }
body.dark .header { background-color: #2a2420; border-bottom: 1px solid #3d352e; }
body.dark .breadcrumb a { color: #c9a87c; }
body.dark .breadcrumb a:hover { color: #e8d5b8; }
body.dark .breadcrumb .separator { color: #6a5a4a; }
body.dark .page-title { color: #e8d5b8; }
body.dark .subtitle { color: #b0a090; border-bottom-color: #3d352e; }
body.dark .content-body p { color: #d4c8b8; }
body.dark .content-body h2 { color: #e8d5b8; border-bottom-color: #3d352e; }
body.dark .content-body h3 { color: #e8d5b8; border-bottom-color: #3d352e; }
body.dark .content-body h4 { color: #d4c8b8; }
body.dark .content-body ul li { color: #d4c8b8; }
body.dark .content-body ul li::before { color: #c9a87c; }
body.dark .footer { background-color: #2a2420; border-top: 1px solid #3d352e; }
body.dark .footer-links a { color: #c9a87c; }
body.dark .footer-links a:hover { color: #e8d5b8; }
body.dark .copyright { color: #8a7a6a; }
body.dark .language-switcher button { color: #b0a090; }
body.dark .language-switcher button.active { color: #e8d5b8; border-bottom-color: #c9a87c; }
body.dark .language-switcher button:hover { color: #e8d5b8; }
body.dark .font-btn { color: #b0a090; }
body.dark .font-btn.active { color: #e8d5b8; }
body.dark .font-btn:hover { color: #e8d5b8; }
body.dark .theme-btn { color: #b0a090; }
body.dark .theme-btn:hover { color: #e8d5b8; }
body.dark .page-nav a { color: #c9a87c; border-color: #3d352e; }
body.dark .page-nav a:hover { background-color: #3d352e; color: #e8d5b8; }
body.dark .back-to-top { background-color: #3d352e; color: #d4c8b8; }
body.dark .back-to-top:hover { background-color: #5a4a3a; }
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background-color: #f9f6f0; border-bottom: 1px solid #e8e0d8; transition: background-color 0.3s, border-color 0.3s; height: 64px; display: flex; align-items: center; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo a { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: #8b5a2b; white-space: nowrap; flex-shrink: 0; }
.logo i { font-size: 24px; color: #b8860b; flex-shrink: 0; }
.logo span { letter-spacing: 2px; }
.header-right { display: flex; align-items: center; gap: 20px; flex-shrink: 1; min-width: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 4px; border-right: 1px solid #e0d8d0; padding-right: 16px; flex-shrink: 0; }
.font-btn { background: none; border: none; padding: 4px 8px; font-size: 14px; cursor: pointer; color: #6a5a4a; font-weight: 500; border-radius: 4px; transition: all 0.2s; font-family: inherit; flex-shrink: 0; }
.font-btn:hover { color: #3d2c1e; }
.font-btn.active { color: #8b5a2b; background: rgba(139, 90, 43, 0.1); }
.font-btn[data-size="small"] { font-size: 12px; }
.font-btn[data-size="medium"] { font-size: 15px; }
.font-btn[data-size="large"] { font-size: 18px; }
.theme-btn { background: none; border: none; padding: 4px 8px; font-size: 18px; cursor: pointer; color: #6a5a4a; transition: all 0.2s; border-radius: 4px; flex-shrink: 0; }
.theme-btn:hover { color: #3d2c1e; }
.language-switcher { display: flex; gap: 2px; flex-shrink: 0; }
.language-switcher button { background: none; border: none; padding: 4px 10px; font-size: 13px; cursor: pointer; color: #8a7a6a; font-weight: 500; border-bottom: 2px solid transparent; transition: all 0.2s; font-family: inherit; flex-shrink: 0; }
.language-switcher button.active { color: #8b5a2b; border-bottom-color: #8b5a2b; }
.language-switcher button:hover { color: #3d2c1e; }
.main { min-height: calc(100vh - 180px); padding: 16px 0 40px; }
.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.breadcrumb { font-size: 14px; color: #8a7a6a; padding: 6px 0 14px; border-bottom: 1px solid #eee8e0; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb a { color: #8b5a2b; }
.breadcrumb a:hover { color: #5a3a1a; text-decoration: underline; }
.breadcrumb .separator { color: #c0b0a0; padding: 0 4px; }
.page-title { font-size: 28px; font-weight: 700; color: #3d2c1e; margin-bottom: 4px; line-height: 1.3; padding-bottom: 0; letter-spacing: 1px; } 
.subtitle { font-size: 15px; font-weight: 400; color: #8a7a6a; margin-top: 2px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #eee8e0; line-height: 2; }
.content-body { font-size: 17px; line-height: 1.9; color: #3d2c1e; padding: 2px 0; }

/* ===== 段落 ===== */
.content-body p { margin: 0 0 0.8em 0; text-indent: 2em; padding: 0; line-height: 1.9; }

/* ===== h2 标题 ===== */
.content-body h2 { font-size: 24px; font-weight: 700; color: #3d2c1e; margin: 1.6em 0 0.6em 0; padding-bottom: 8px; border-bottom: 2px solid #e8ddd0; line-height: 1.4; letter-spacing: 1px; position: relative; }
.content-body h2::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 60px; height: 2px; background: #8b5a2b; }

/* ===== h3 标题 ===== */
.content-body h3 { font-size: 20px; font-weight: 600; color: #3d2c1e; margin: 1.4em 0 0.5em 0; padding-left: 14px; line-height: 1.5; border-left: 4px solid #8b5a2b; }

/* ===== h4 标题 ===== */
.content-body h4 { font-size: 18px; font-weight: 600; color: #5a4a3a; margin: 1.2em 0 0.4em 0; line-height: 1.5; }

/* ===== 列表 ===== */
.content-body ul { margin: 0.6em 0 0.8em 2em; padding-left: 0; list-style: none; }
.content-body ul li { position: relative; padding-left: 1.6em; margin-bottom: 0.4em; line-height: 1.8; }
.content-body ul li::before { content: '\2022'; position: absolute; left: 0; color: #8b5a2b; font-size: 1.2em; }

.content-body ol { margin: 0.6em 0 0.8em 2em; padding-left: 0; list-style: none; counter-reset: item; }
.content-body ol li { position: relative; padding-left: 2em; margin-bottom: 0.4em; line-height: 1.8; counter-increment: item; }
.content-body ol li::before { content: counter(item) '.'; position: absolute; left: 0; color: #8b5a2b; font-weight: 600; }

/* ===== 嵌套列表 ===== */
.content-body ul ul { margin: 0.2em 0 0.2em 1.6em; }
.content-body ul ul li::before { content: '\25E6'; }
.content-body ul ul ul li::before { content: '\25AA'; }

/* ===== 其他 ===== */
.content-body br { display: block; content: ''; margin: 0; height: 0.4em; }
.content-body br + br { height: 0.2em; }
.content-body ruby { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; vertical-align: middle; margin: 0 2px; line-height: 1.6; ruby-align: center; }
.content-body ruby rp { display: none; }
.content-body ruby rt { display: block; font-size: 0.7em; line-height: 1.2; font-weight: normal; color: #2a7a9a; text-align: center; font-family: 'Arial', 'Helvetica', sans-serif; letter-spacing: 0.5px; order: -1; }
.content-body ruby { font-size: 1em; font-weight: 500; color: #2c3e50; }
.content-body ruby rt { white-space: nowrap; }
.content-body ruby { padding: 2px 0; }
.content-body p { line-height: 2.6; }
body.dark .content-body rt { color: #8ab4d4; }
.page-nav { display: flex; justify-content: space-between; padding: 20px 0 10px; border-top: 1px solid #eee8e0; margin-top: 20px; gap: 20px; }
.page-nav a { padding: 6px 16px; border: 1px solid #e0d8d0; border-radius: 6px; font-size: 14px; color: #6a5a4a; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; line-height: 1.5; }
.page-nav a:hover { background-color: #f0e8e0; color: #3d2c1e; border-color: #c0b0a0; }
.page-nav .nav-prev { margin-right: auto; }
.page-nav .nav-next { margin-left: auto; }
.footer { background-color: #f9f6f0; border-top: 1px solid #e8e0d8; padding: 28px 0 20px; transition: background-color 0.3s, border-color 0.3s; }
.footer-links { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; margin-bottom: 14px; }
.footer-links a { font-size: 14px; color: #6a5a4a; display: inline-flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: #3d2c1e; }
.copyright { text-align: center; font-size: 13px; color: #aaa090; }
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 44px; height: 44px; border: none; border-radius: 50%; background-color: #e8e0d8; color: #6a5a4a; font-size: 18px; cursor: pointer; transition: all 0.3s; opacity: 0; visibility: hidden; transform: translateY(20px); box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background-color: #d0c8c0; color: #3d2c1e; }

@media (max-width: 768px) {
body { padding-top: 60px; }
.header { height: 60px; }
.header-inner { padding: 0 10px; flex-wrap: nowrap; gap: 4px; }
.logo a { font-size: 15px; gap: 4px; flex-shrink: 0; white-space: nowrap; }
.logo i { font-size: 16px; flex-shrink: 0; }
.logo span { font-size: 14px; letter-spacing: 0.5px; max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.header-right { gap: 6px; flex-shrink: 1; min-width: 0; overflow: hidden; }
.toolbar { padding-right: 6px; gap: 2px; flex-shrink: 0; border-right: 1px solid #ddd6ce; }
.font-btn { padding: 6px 8px; font-size: 14px; flex-shrink: 0; min-width: 32px; text-align: center; }
.font-btn[data-size="small"] { font-size: 12px; }
.font-btn[data-size="medium"] { font-size: 15px; }
.font-btn[data-size="large"] { font-size: 18px; }
.theme-btn { font-size: 16px; padding: 6px 6px; flex-shrink: 0; }
.language-switcher { gap: 1px; flex-shrink: 0; }
.language-switcher button { font-size: 12px; padding: 6px 8px; flex-shrink: 0; min-width: 32px; text-align: center; }
.container { padding: 0 14px; }
.breadcrumb { font-size: 12px; padding: 4px 0 10px; margin-bottom: 12px; }
.page-title { font-size: 22px; margin-bottom: 4px; }
.subtitle { font-size: 15px; margin-bottom: 12px; padding-bottom: 10px; }
.content-body { font-size: 15px; line-height: 1.85; }
.content-body p { margin-bottom: 0.5em; }
.content-body h2 { font-size: 20px; }
.content-body h3 { font-size: 17px; }
.content-body h4 { font-size: 16px; }
.content-body ul { margin-left: 1.2em; }
.content-body ol { margin-left: 1.2em; }
.content-body ul li { padding-left: 1.4em; }
.content-body ol li { padding-left: 1.8em; }
.page-nav { flex-direction: column; gap: 8px; padding: 14px 0 8px; margin-top: 16px; }
.page-nav a { font-size: 13px; padding: 6px 12px; justify-content: center; }
.page-nav .nav-prev { margin-right: 0; }
.page-nav .nav-next { margin-left: 0; }
.footer-links { gap: 14px; }
.footer-links a { font-size: 12px; }
.copyright { font-size: 11px; }
.back-to-top { width: 38px; height: 38px; font-size: 15px; bottom: 20px; right: 20px; }
}

@media (max-width: 600px) {
.header-inner { padding: 0 8px; gap: 3px; }
.logo a { font-size: 13px; gap: 3px; }
.logo i { font-size: 14px; }
.logo span { font-size: 13px; max-width: 140px; letter-spacing: 0; }
.header-right { gap: 4px; }
.toolbar { padding-right: 4px; gap: 1px; }
.font-btn { padding: 5px 6px; font-size: 13px; min-width: 28px; }
.font-btn[data-size="small"] { font-size: 11px; }
.font-btn[data-size="medium"] { font-size: 14px; }
.font-btn[data-size="large"] { font-size: 17px; }
.theme-btn { font-size: 14px; padding: 5px 4px; }
.language-switcher button { font-size: 11px; padding: 5px 6px; min-width: 28px; }
}

@media (max-width: 480px) {
.header { height: 54px; }
body { padding-top: 54px; }
.header-inner { padding: 0 6px; gap: 2px; }
.logo a { font-size: 11px; gap: 2px; }
.logo i { font-size: 12px; }
.logo span { font-size: 12px; max-width: 120px; }
.header-right { gap: 2px; }
.toolbar { padding-right: 3px; gap: 0px; border-right: 1px solid #ddd6ce; }
.font-btn { padding: 4px 5px; font-size: 12px; min-width: 24px; }
.font-btn[data-size="small"] { font-size: 10px; }
.font-btn[data-size="medium"] { font-size: 13px; }
.font-btn[data-size="large"] { font-size: 16px; }
.theme-btn { font-size: 13px; padding: 8px 10px; }
.language-switcher { gap: 0px; }
.language-switcher button { font-size: 10px; padding: 4px 5px; min-width: 24px; }
.container { padding: 0 10px; }
.page-title { font-size: 19px; }
.content-body { font-size: 14px; }
.content-body h2 { font-size: 18px; }
.content-body h3 { font-size: 16px; }
.content-body h4 { font-size: 15px; }
.content-body ul { margin-left: 0.8em; }
.content-body ol { margin-left: 0.8em; }
.content-body ul li { padding-left: 1.2em; }
.content-body ol li { padding-left: 1.6em; }
}

@media (max-width: 380px) {
.header { height: 48px; }
body { padding-top: 48px; }
.header-inner { padding: 0 4px; gap: 1px; }
.logo a { font-size: 9px; gap: 2px; }
.logo i { font-size: 10px; }
.logo span { font-size: 8px; max-width: 40px; }
.header-right { gap: 1px; }
.toolbar { padding-right: 2px; gap: 0px; }
.font-btn { padding: 3px 3px; font-size: 10px; min-width: 20px; }
.font-btn[data-size="small"] { font-size: 8px; }
.font-btn[data-size="medium"] { font-size: 11px; }
.font-btn[data-size="large"] { font-size: 14px; }
.theme-btn { font-size: 10px; padding: 3px 2px; }
.language-switcher button { font-size: 8px; padding: 3px 3px; min-width: 20px; }
}