/* ============================================
   想睡一天的创作空间
   风格：素笺 / 银墨 / 烟紫 / 霁色 / 暗夜
   ============================================ */

/* ---------- 素笺（白） ---------- */
:root[data-theme="light"][data-style="素笺"],
:root[data-theme="light"]:not([data-style]) {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f7;
    --bg-tertiary: #f3f2ef;
    --border-color: #e5e5e2;
    --border-light: #eeeeec;
    --text-primary: #2c2c2c;
    --text-secondary: #5a5a5a;
    --text-muted: #999994;
    --accent: #7a8b6f;
    --accent-hover: #637558;
    --accent-subtle: rgba(122, 139, 111, 0.06);
    --header-bg: rgba(255, 255, 255, 0.92);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.04);
}

/* ---------- 银墨（冷调银灰，纯中性无色相） ---------- */
:root[data-theme="light"][data-style="银墨"] {
    --bg-primary: #f1f1f1;
    --bg-secondary: #e7e7e7;
    --bg-tertiary: #dcdcdc;
    --border-color: #cdcdcd;
    --border-light: #d6d6d6;
    --text-primary: #262626;
    --text-secondary: #525252;
    --text-muted: #8a8a8a;
    --accent: #555555;
    --accent-hover: #3d3d3d;
    --accent-subtle: rgba(80, 80, 80, 0.05);
    --header-bg: rgba(241, 241, 241, 0.92);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
}

/* ---------- 烟紫（淡紫灰调） ---------- */
:root[data-theme="light"][data-style="烟紫"] {
    --bg-primary: #f0eff4;
    --bg-secondary: #e8e6ee;
    --bg-tertiary: #dedce6;
    --border-color: #cfcdd8;
    --border-light: #d9d7e0;
    --text-primary: #2a2a30;
    --text-secondary: #545460;
    --text-muted: #8e8d9a;
    --accent: #7b6f8e;
    --accent-hover: #635878;
    --accent-subtle: rgba(123, 111, 142, 0.06);
    --header-bg: rgba(240, 239, 244, 0.92);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.05);
}

/* ---------- 霁色（雨后天青） ---------- */
:root[data-theme="light"][data-style="霁色"] {
    --bg-primary: #f0f4f9;
    --bg-secondary: #e7ecf4;
    --bg-tertiary: #dde3ee;
    --border-color: #cdd4e2;
    --border-light: #d6dde9;
    --text-primary: #242830;
    --text-secondary: #4a5264;
    --text-muted: #848da0;
    --accent: #5876a0;
    --accent-hover: #456590;
    --accent-subtle: rgba(88, 118, 160, 0.06);
    --header-bg: rgba(240, 244, 249, 0.92);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.04);
}

/* ---------- 暗夜 ---------- */
:root[data-theme="dark"] {
    --bg-primary: #111111;
    --bg-secondary: #191919;
    --bg-tertiary: #1f1f1f;
    --border-color: #2a2a2a;
    --border-light: #222222;
    --text-primary: #d8d8d4;
    --text-secondary: #9a9a96;
    --text-muted: #5e5e5a;
    --accent: #9aab8f;
    --accent-hover: #b0c1a5;
    --accent-subtle: rgba(154, 171, 143, 0.06);
    --header-bg: rgba(17, 17, 17, 0.92);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.2);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    transition: background-color 0.35s, color 0.35s;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
    font-family: 'Noto Serif SC', 'Songti SC', Georgia, serif;
    font-weight: 600; line-height: 1.4;
}


/* ============================================
   顶部导航
   ============================================ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

.header-inner {
    max-width: 840px; margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
}

.site-logo {
    font-size: 0.88rem; font-weight: 500;
    color: var(--text-muted); letter-spacing: 0.06em;
}

.header-actions { display: flex; align-items: center; gap: 6px; }

/* 语言切换 */
.lang-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: all 0.2s;
}

.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* 黑白切换 */
.dark-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    display: flex; align-items: center;
    transition: all 0.2s;
}

.dark-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* 风格选择器 */
.style-picker { position: relative; }

.style-picker-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: 'Noto Serif SC', serif;
    display: flex; align-items: center; gap: 4px;
    transition: all 0.2s;
}

.style-picker-btn:hover { border-color: var(--accent); color: var(--accent); }

.style-dropdown {
    display: none;
    position: absolute; top: calc(100% + 6px); right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px; padding: 4px;
    min-width: 100px;
    box-shadow: var(--shadow-md);
    z-index: 200;
}

.style-dropdown.open { display: block; }

.style-option {
    display: block; width: 100%;
    padding: 7px 12px; border: none; background: none;
    border-radius: 5px; cursor: pointer;
    font-size: 0.82rem;
    font-family: 'Noto Serif SC', serif;
    color: var(--text-secondary); text-align: left;
    transition: background 0.15s;
}

.style-option:hover { background: var(--accent-subtle); color: var(--text-primary); }
.style-option.active { color: var(--accent); font-weight: 600; }

.back-link {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-muted); font-size: 0.85rem;
}
.back-link:hover { color: var(--accent); }


/* ============================================
   Hero
   ============================================ */
.hero-section {
    padding: 88px 24px 56px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-primary);
}

.hero-inner { max-width: 560px; margin: 0 auto; }

.hero-title {
    font-size: 1.65rem; font-weight: 600;
    line-height: 1.5; margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: 0.04em;
    background: none;
}

.hero-tags {
    display: flex; justify-content: center;
    gap: 10px; flex-wrap: wrap;
}

.hero-tag {
    font-size: 0.76rem; letter-spacing: 0.1em;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    background-color: transparent;
    padding: 4px 14px; border-radius: 20px;
    transition: all 0.2s;
}

.hero-tag:hover { color: var(--accent); border-color: var(--accent); }


/* ============================================
   板块标签
   ============================================ */
.main-content {
    max-width: 840px; margin: 0 auto; padding: 0 24px 80px;
    background-color: var(--bg-primary);
}

.content-tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-top: 48px; margin-bottom: 8px;
}

.tab-btn {
    background: none; border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 20px; cursor: pointer;
    font-size: 0.78rem; font-family: 'Inter', sans-serif;
    font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted); transition: all 0.2s;
}

.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--text-primary); border-bottom-color: var(--text-primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }


/* ============================================
   文章列表
   ============================================ */

/* ---- 分类 + 标签筛选栏 ---- */
.filter-bar { margin-bottom: 24px; }

.category-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    padding-bottom: 12px; border-bottom: 1px solid var(--border-light);
}

.cat-tab {
    background: none; border: none; cursor: pointer;
    font-family: 'Inter', 'Noto Serif SC', sans-serif;
    font-size: 0.82rem; font-weight: 500;
    color: var(--text-muted); padding: 6px 14px;
    border-radius: 20px; transition: all 0.2s;
}

.cat-tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.cat-tab.active {
    color: var(--bg-primary); background: var(--text-primary);
    font-weight: 600;
}

.tag-cloud {
    display: flex; gap: 6px; flex-wrap: wrap;
    padding-top: 10px;
}

.tag-chip {
    background: var(--bg-tertiary); border: 1px solid transparent;
    color: var(--text-muted); font-family: 'Inter', sans-serif;
    font-size: 0.75rem; padding: 3px 10px; border-radius: 12px;
    cursor: pointer; transition: all 0.2s;
}

.tag-chip:hover { border-color: var(--border-color); color: var(--text-secondary); }
.tag-chip.active {
    background: var(--accent-subtle); border-color: var(--accent);
    color: var(--accent); font-weight: 600;
}

/* ---- 文章卡片 ---- */
.articles-grid { display: flex; flex-direction: column; }

.article-card {
    display: flex; align-items: center; gap: 16px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    background: transparent;
    transition: color 0.2s;
}

.article-card:hover { color: var(--accent); transform: none; box-shadow: none; }
.article-card::before { display: none; }

.article-card.featured {
    padding: 28px 0; background: transparent;
    border-radius: 0; border-bottom: 1px solid var(--border-color);
}
.article-card.featured .card-title { font-size: 1.25rem; }
.article-card.featured .card-summary { font-size: 0.92rem; }

.card-badge {
    position: static; font-size: 0.68rem; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 3px;
    flex-shrink: 0; align-self: flex-start; margin-top: 4px;
    background: var(--bg-tertiary); color: var(--text-muted);
}

.type-md, .type-pdf { background: var(--bg-tertiary); color: var(--text-muted); }

.card-body { flex: 1; min-width: 0; }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; line-height: 1.45; }

.card-summary {
    color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

.card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.card-tag {
    font-size: 0.72rem; color: var(--accent); background: var(--accent-subtle);
    padding: 1px 7px; border-radius: 8px; font-family: 'Inter', sans-serif;
}

.series-badge {
    display: inline-block; font-size: 0.72rem; font-weight: 500;
    color: var(--text-muted); background: var(--bg-tertiary);
    padding: 2px 8px; border-radius: 8px; margin-bottom: 6px;
    font-family: 'Inter', sans-serif;
}

.card-meta { display: flex; gap: 14px; font-size: 0.78rem; color: var(--text-muted); }
.meta-date::before { display: none; }

.card-arrow { flex-shrink: 0; color: var(--border-color); transition: all 0.2s; }
.article-card:hover .card-arrow { color: var(--accent); transform: translateX(3px); }

.loading-placeholder, .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 0.9rem; }
.error-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.error-state code { display: inline-block; margin-top: 8px; padding: 3px 10px; background: var(--bg-tertiary); border-radius: 4px; font-size: 0.82rem; }


/* ============================================
   视频板块
   ============================================ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px; padding-top: 16px;
}

.video-card {
    border: 1px solid var(--border-light);
    border-radius: 10px; overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-secondary);
}

.video-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

.video-embed {
    position: relative; width: 100%; padding-top: 56.25%; /* 16:9 */
    background: var(--bg-tertiary);
}

.video-embed iframe {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; border: none;
}

.video-thumb {
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); overflow: hidden;
}

.video-thumb iframe { width: 100%; height: 100%; border: none; }

.video-info { padding: 14px 16px; }
.video-title { font-family: 'Noto Serif SC', serif; font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); line-height: 1.4; }
.video-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }


/* ============================================
   底部
   ============================================ */
.site-footer { border-top: 1px solid var(--border-light); background-color: var(--bg-primary); }

.footer-inner {
    max-width: 840px; margin: 0 auto; padding: 40px 24px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}

.footer-section h4 { font-size: 0.78rem; font-family: 'Inter', sans-serif; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; color: var(--text-muted); }
.footer-section p { color: var(--text-muted); font-size: 0.82rem; }

.footer-copy { grid-column: span 2; text-align: center; padding-top: 20px; border-top: 1px solid var(--border-light); }
.footer-copy p { color: var(--text-muted); font-size: 0.75rem; }


/* ============================================
   阅读器
   ============================================ */
.reading-progress-bar { position: fixed; top: 0; left: 0; width: 0; height: 2px; background: var(--accent); z-index: 200; transition: width 0.1s linear; }

.article-layout { max-width: 1060px; margin: 0 auto; padding: 48px 24px 80px; display: flex; gap: 56px; align-items: flex-start; }

.toc-sidebar { position: sticky; top: 80px; width: 200px; flex-shrink: 0; max-height: calc(100vh - 120px); overflow-y: auto; }
.toc-header { font-family: 'Inter', sans-serif; font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border-light); }
.toc-nav { display: flex; flex-direction: column; }
.toc-item { display: block; padding: 5px 10px; font-size: 0.8rem; color: var(--text-muted); border-left: 1px solid transparent; transition: all 0.15s; line-height: 1.4; }
.toc-item:hover { color: var(--text-secondary); }
.toc-item.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.toc-h3 { padding-left: 22px; font-size: 0.78rem; }

.article-main { flex: 1; min-width: 0; max-width: 680px; }
.article-meta { margin-bottom: 56px; padding-bottom: 32px; border-bottom: 1px solid var(--border-light); }
.article-title { font-size: 2rem; line-height: 1.4; margin-bottom: 16px; font-weight: 600; }
.article-info { display: flex; gap: 20px; color: var(--text-muted); font-size: 0.82rem; }
.info-item { display: inline-flex; align-items: center; gap: 5px; }

/* 版本追踪 */
.version-info { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-light); }

.version-dates {
    display: block; font-size: 0.78rem; color: var(--text-muted);
    font-family: 'Inter', sans-serif; letter-spacing: 0.02em;
}

.version-history { margin-top: 10px; }

.version-history summary {
    font-size: 0.76rem; color: var(--accent); cursor: pointer;
    font-family: 'Inter', sans-serif; letter-spacing: 0.02em;
    user-select: none; list-style: none;
}

.version-history summary::before { content: '▸ '; }
.version-history[open] summary::before { content: '▾ '; }

.version-history summary:hover { text-decoration: underline; }

.version-history ul {
    margin-top: 8px; padding-left: 0; list-style: none;
}

.version-history li {
    font-size: 0.78rem; color: var(--text-muted);
    padding: 4px 0; border-bottom: 1px dotted var(--border-light);
    font-family: 'Inter', sans-serif;
}

.version-history li:last-child { border-bottom: none; }

.version-history time {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary); font-weight: 500;
    margin-right: 6px;
}

/* Markdown */
.markdown-body { font-family: 'Noto Serif SC', Georgia, serif; font-size: 1.02rem; line-height: 2; color: var(--text-primary); }
.markdown-body h1 { font-size: 1.6rem; margin-top: 3em; margin-bottom: 0.8em; padding-bottom: 0.4em; border-bottom: 1px solid var(--border-light); }
.markdown-body h2 { font-size: 1.3rem; margin-top: 3em; margin-bottom: 0.8em; padding-bottom: 0.4em; border-bottom: 1px solid var(--border-light); }
.markdown-body h3 { font-size: 1.1rem; margin-top: 2.4em; margin-bottom: 0.6em; }
.markdown-body p { margin-bottom: 1.8em; text-align: justify; }
.markdown-body strong { font-weight: 600; }
.markdown-body em { font-style: italic; color: var(--text-secondary); }
.markdown-body blockquote { margin: 2.4em 0; padding: 16px 20px; border-left: 2px solid var(--accent); color: var(--text-secondary); font-style: italic; font-size: 0.98rem; }
.markdown-body blockquote p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin-bottom: 1.8em; padding-left: 1.6em; }
.markdown-body li { margin-bottom: 0.4em; }
.markdown-body img { max-width: 100%; border-radius: 4px; margin: 2.4em 0; }
.table-wrapper { overflow-x: auto; margin: 2.4em 0; }
.markdown-body table { width: 100%; border-collapse: collapse; font-family: 'Inter', sans-serif; font-size: 0.86rem; }
.markdown-body thead { border-bottom: 2px solid var(--text-primary); }
.markdown-body th { text-align: left; padding: 8px 12px; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.markdown-body td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
.markdown-body tbody tr:hover { background: var(--accent-subtle); }
.markdown-body tbody tr:last-child td { border-bottom: none; }

.pdf-viewer { width: 100%; height: 85vh; border: 1px solid var(--border-color); }
.loading-state { display: flex; flex-direction: column; align-items: center; padding: 80px 20px; color: var(--text-muted); }
.loading-spinner { width: 24px; height: 24px; border: 2px solid var(--border-color); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.article-picker { max-width: 680px; margin: 0 auto; }
.picker-title { font-size: 0.78rem; font-family: 'Inter', sans-serif; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 20px; }
.picker-list { display: flex; flex-direction: column; }
.picker-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border-light); color: var(--text-primary); font-size: 0.95rem; transition: color 0.2s; }
.picker-item:hover { color: var(--accent); }
.picker-item-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 2px 8px; background: var(--bg-tertiary); border-radius: 3px; }

.article-footer-section { margin-top: 80px; }
.divider-ornament { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; color: var(--text-muted); }
.divider-ornament span { flex: 1; height: 1px; background: var(--border-light); }
.echo-title { font-family: 'Noto Serif SC', serif; font-size: 0.95rem; color: var(--text-muted); margin-bottom: 6px; }

/* Giscus 骨架屏 */
.giscus-loading { padding: 24px 0; }

.giscus-skeleton {
    display: flex; gap: 14px; padding: 20px;
    border: 1px solid var(--border-light); border-radius: 8px;
}

.skeleton-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-tertiary); flex-shrink: 0;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }

.skeleton-line {
    height: 12px; border-radius: 6px;
    background: var(--bg-tertiary);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line:nth-child(2) { animation-delay: 0.2s; }

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Giscus iframe 渐入 */
.giscus { transition: opacity 0.3s ease; }
.giscus iframe { border-radius: 8px !important; }


/* ============================================
   连载导航 (Series Navigation)
   ============================================ */
.series-nav {
    border: 1px solid var(--border-light); border-radius: 12px;
    padding: 20px 24px; margin-bottom: 32px;
    background: var(--bg-secondary);
}

.series-nav-title {
    font-size: 0.82rem; font-weight: 600; color: var(--accent);
    margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
    font-family: 'Inter', sans-serif; letter-spacing: 0.02em;
}

.series-nav-title svg { flex-shrink: 0; }

.series-list { list-style: none; padding: 0; margin: 0; }

.series-list li {
    padding: 6px 0;
}

.series-list li a {
    font-size: 0.88rem; color: var(--text-muted);
    transition: color 0.15s; display: flex; align-items: baseline; gap: 8px;
}

.series-list li a:hover { color: var(--accent); }

.series-list li.current a {
    color: var(--text-primary); font-weight: 600;
}

.series-list li .series-num {
    font-size: 0.72rem; color: var(--text-muted);
    min-width: 18px; text-align: right;
    font-family: 'Inter', sans-serif; font-weight: 500;
}

.series-pager {
    display: flex; justify-content: space-between;
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.series-pager a {
    font-size: 0.82rem; color: var(--accent);
    transition: opacity 0.15s; display: flex; align-items: center; gap: 4px;
}

.series-pager a:hover { opacity: 0.7; }
.series-pager a.disabled { color: var(--text-muted); pointer-events: none; opacity: 0.4; }


/* ============================================
   相关文章推荐 (Related Posts)
   ============================================ */
.related-section {
    margin-top: 48px; margin-bottom: 32px;
}

.related-title {
    font-size: 0.82rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
    display: flex; align-items: center; gap: 8px;
}

.related-title::before, .related-title::after {
    content: ''; flex: 1; height: 1px; background: var(--border-light);
}

.related-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.related-card {
    display: block; padding: 16px; border: 1px solid var(--border-light);
    border-radius: 10px; transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-primary);
}

.related-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

.related-card-title {
    font-size: 0.9rem; font-weight: 600; margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.related-card-meta {
    font-size: 0.75rem; color: var(--text-muted);
}


/* ============================================
   响应式
   ============================================ */
@media (max-width: 900px) { .toc-sidebar { display: none; } .article-layout { padding: 24px 20px 60px; } .article-title { font-size: 1.5rem; } }

@media (max-width: 640px) {
    .hero-title { font-size: 1.3rem; }
    .hero-section { padding: 64px 20px 44px; }
    .main-content { padding: 0 20px 60px; }
    .header-inner { padding: 12px 16px; }
    .article-card { padding: 20px 0; }
    .card-badge, .card-arrow { display: none; }
    .footer-inner { grid-template-columns: 1fr; padding: 28px 20px; }
    .footer-copy { grid-column: span 1; }
    .markdown-body { font-size: 0.98rem; line-height: 1.85; }
    .markdown-body p { text-align: left; }
    .video-grid { grid-template-columns: 1fr; }
    .hero-tags { gap: 6px; }
    .hero-tag { font-size: 0.7rem; padding: 3px 10px; }
}
