/* 科大白 前台样式 — 温暖科普风 */

:root {
    --bg: #fff8f0;
    --bg-soft: #fef3e2;
    --surface: #ffffff;
    --surface-warm: #fff7ec;
    --border: #fde9cf;
    --border-soft: #fef3e2;
    --ink: #1c1917;
    --ink-soft: #44403c;
    --muted: #78716c;
    --muted-light: #a8a29e;
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-fade: #fff7ed;
    --shadow-sm: 0 1px 2px rgba(120, 53, 15, 0.04);
    --shadow: 0 4px 12px rgba(120, 53, 15, 0.06), 0 1px 3px rgba(120, 53, 15, 0.04);
    --shadow-lg: 0 12px 32px rgba(120, 53, 15, 0.08), 0 4px 12px rgba(120, 53, 15, 0.06);
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;
    --sans: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }

/* ============ 夜间模式调色板 ============ */
[data-theme="dark"] {
    --bg: #1a1612;
    --bg-soft: #221c17;
    --surface: #2a231d;
    --surface-warm: #1f1812;
    --border: #3a2e25;
    --border-soft: #2f261f;
    --ink: #fef3e2;
    --ink-soft: #d6c5b3;
    --muted: #968578;
    --muted-light: #6b5f55;
    --primary: #fb923c;
    --primary-hover: #fdba74;
    --primary-fade: #2b1f12;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .site-nav {
    background: rgba(26, 22, 18, 0.88);
}
[data-theme="dark"] .brand-mark {
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.5);
}
[data-theme="dark"] .hero {
    background:
        radial-gradient(circle at 15% 20%, rgba(251, 146, 60, 0.18), transparent 45%),
        radial-gradient(circle at 85% 70%, rgba(244, 114, 182, 0.1), transparent 45%),
        var(--bg);
}
[data-theme="dark"] .hero-title {
    background: linear-gradient(135deg, #fef3e2 30%, #fb923c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
[data-theme="dark"] .cat-hero .hero-title {
    background: linear-gradient(135deg, var(--ink) 20%, var(--cat) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
[data-theme="dark"] .post-body strong { color: #fef3e2; }
[data-theme="dark"] code {
    background: #3a2e25 !important;
    color: #fdba74 !important;
}

/* ============ 顶部导航 ============ */
.site-nav {
    background: rgba(255, 248, 240, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0; z-index: 20;
}
.nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px;
}
.brand {
    display: flex; align-items: center; gap: 11px;
    color: var(--ink);
    font-weight: 700;
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 36px; height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 60%, #ea580c 100%);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800; font-size: 17px;
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.32);
}
.brand-name {
    font-size: 17px; font-weight: 700; letter-spacing: 0.2px;
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    padding: 7px 13px;
    border-radius: var(--radius-pill);
    transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-links a.active { color: var(--ink); background: var(--bg-soft); }
.nav-links a.nav-cat {
    color: var(--muted);
}
.nav-links a.nav-cat:hover {
    color: #fff;
    background: var(--cat, var(--primary));
}
.nav-links a.nav-cat.active {
    color: #fff;
    background: var(--cat, var(--primary));
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    width: 34px; height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: inline-grid; place-items: center;
    transition: border-color 0.15s, background 0.15s, transform 0.2s;
    margin-left: 6px;
    color: var(--ink-soft);
    padding: 0;
}
.theme-toggle:hover {
    border-color: var(--primary);
    transform: rotate(-20deg);
}

/* ============ 阅读进度条 ============ */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #fb923c, #f43f5e, #a855f7);
    z-index: 30;
    transition: width 0.05s linear;
}

/* ============ 文章页 TOC ============ */
.post-toc {
    display: none;
    position: fixed;
    top: 110px;
    right: calc((100vw - 740px) / 2 - 240px);
    width: 220px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 16px 18px;
    z-index: 5;
}
.post-toc-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primary-hover);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.post-toc-list {
    list-style: none;
    padding: 0; margin: 0;
    counter-reset: toc;
}
.post-toc-list li {
    counter-increment: toc;
    margin: 0;
    padding: 0;
}
.post-toc-list a {
    display: block;
    padding: 6px 10px 6px 28px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    border-left: 2px solid var(--border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    position: relative;
}
.post-toc-list a::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute;
    left: 8px;
    top: 7px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--muted-light);
    letter-spacing: -0.5px;
}
.post-toc-list a:hover {
    color: var(--ink);
    border-left-color: var(--muted-light);
}
.post-toc-list a.active {
    color: var(--primary-hover);
    border-left-color: var(--primary);
    font-weight: 600;
}
@media (min-width: 1280px) {
    .post-toc { display: block; }
}

/* ============ 文章页操作按钮 ============ */
.post-actions {
    margin-top: 14px;
    display: flex; gap: 8px; justify-content: center;
}
.copy-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, transform 0.1s;
    font-family: inherit;
}
.copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
}
.copy-btn.copied {
    border-color: #10b981;
    color: #10b981;
}

/* ============ Hero ============ */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(251, 146, 60, 0.22), transparent 45%),
        radial-gradient(circle at 85% 70%, rgba(244, 114, 182, 0.15), transparent 45%),
        radial-gradient(circle at 50% 110%, rgba(99, 102, 241, 0.12), transparent 50%),
        var(--bg);
    border-bottom: 1px solid var(--border);
}
.hero::before, .hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.5;
    pointer-events: none;
}
.hero::before {
    top: -80px; left: -80px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, #fbbf24, transparent 70%);
}
.hero::after {
    bottom: -100px; right: -60px;
    width: 320px; height: 320px;
    background: radial-gradient(circle, #f472b6, transparent 70%);
}
.hero-inner {
    position: relative; z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 72px 24px 56px;
    text-align: center;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 1.2px;
    color: var(--primary-hover);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 18px;
    padding: 5px 14px;
    background: rgba(249, 115, 22, 0.1);
    border-radius: var(--radius-pill);
}
.hero-title {
    margin: 0;
    font-size: 60px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.1;
    color: var(--ink);
    background: linear-gradient(135deg, #1c1917 30%, #f97316 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub {
    margin: 18px auto 0;
    max-width: 540px;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.65;
    font-weight: 400;
}

/* 首页 hero 搜索框 + 随机按钮 */
.hero-search {
    margin: 28px auto 0;
    max-width: 520px;
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.hero-search input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.hero-search input[type="search"]:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}
.hero-search-btn {
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: #fff;
    border: 0;
    padding: 0 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}
.hero-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

/* 搜索结果下拉 */
.search-results {
    max-width: 520px;
    margin: 8px auto 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-align: left;
    position: relative;
    z-index: 5;
}
.search-results ul { list-style: none; padding: 6px; margin: 0; }
.search-results li a {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--ink);
    align-items: center;
    transition: background 0.1s;
}
.search-results li a:hover { background: var(--bg-soft); color: var(--ink); }
.sr-title {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sr-title mark { background: rgba(249,115,22,0.18); color: var(--primary-hover); padding: 0 2px; border-radius: 3px; }
.sr-meta {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    flex-shrink: 0;
}
.search-empty, .sr-more {
    padding: 14px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.sr-more { border-top: 1px dashed var(--border); }

/* 首页 hero 下的分类入口（圆形 emoji 按钮） */
.hero-cats {
    margin-top: 40px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-cat {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 12px 14px 14px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--ink-soft);
    width: 88px;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.hero-cat:hover {
    border-color: var(--cat);
    background: var(--cat-fade);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    color: var(--cat);
}
.hero-cat-emoji {
    font-size: 28px;
    line-height: 1;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    background: var(--cat-fade);
    border-radius: 50%;
    transition: background 0.18s, transform 0.18s;
}
.hero-cat:hover .hero-cat-emoji {
    background: var(--cat);
    color: #fff;
    transform: rotate(-8deg) scale(1.05);
}
.hero-cat-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* 分类页 hero */
.cat-hero {
    background:
        radial-gradient(circle at 20% 20%, var(--cat-fade), transparent 50%),
        radial-gradient(circle at 80% 80%, var(--cat-fade), transparent 50%),
        var(--bg);
}
.cat-hero::before, .cat-hero::after { display: none; }
.cat-hero .hero-eyebrow {
    color: var(--cat);
    background: var(--cat-fade);
}
.cat-hero .hero-title {
    background: linear-gradient(135deg, var(--ink) 20%, var(--cat) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ============ 布局容器 ============ */
.layout-index {
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 24px 60px;
}
.layout-article {
    max-width: 740px;
    margin: 0 auto;
    padding: 50px 24px 60px;
}

/* ============ 列表区分隔 ============ */
.section-title {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 28px;
}
.section-title h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ink);
}
.section-title h2::before {
    content: '🌟 ';
    margin-right: 2px;
}
.section-title h2.section-hot::before { content: ''; }
.section-title h2.section-hot {
    background: linear-gradient(135deg, #f97316, #f43f5e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.section-meta {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    background: var(--surface);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

/* ============ 面包屑 ============ */
.breadcrumb {
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--muted);
}
.breadcrumb ol {
    list-style: none;
    padding: 0; margin: 0;
    display: flex; flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.breadcrumb li + li::before {
    content: '/';
    color: var(--muted-light);
    font-weight: 400;
}
.breadcrumb a {
    color: var(--muted);
    transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--primary-hover); }
.breadcrumb [aria-current="page"] {
    color: var(--ink-soft);
    font-weight: 500;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============ 文章卡片网格 ============ */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}
.post-card {
    list-style: none;
}
.post-card-link {
    display: flex; flex-direction: column;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 22px 20px;
    height: 100%;
    color: var(--ink);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.post-card-link::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--card-accent, var(--primary));
    opacity: 0;
    transition: opacity 0.2s;
}
.post-card-link:hover {
    border-color: var(--card-accent, var(--primary));
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--ink);
}
.post-card-link:hover::before { opacity: 1; }
.post-card-num { display: none; } /* 隐藏老版的编号；卡片不需要 */
.post-card-arrow { display: none; }

.post-card-body { display: contents; }
.post-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.45;
    letter-spacing: -0.2px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-meta {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 4px;
}
.post-card-date {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.2px;
}

/* ============ 首页分类预览模块 ============ */
.cat-previews {
    margin-top: 50px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.cat-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--cat);
    border-radius: var(--radius);
    padding: 18px 20px 16px;
    transition: transform 0.18s, box-shadow 0.18s;
}
.cat-preview:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.cat-preview-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}
.cat-preview-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--cat);
    display: flex; align-items: center; gap: 6px;
}
.cat-preview-emoji {
    width: 28px; height: 28px;
    background: var(--cat-fade);
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 15px;
}
.cat-preview-more {
    font-size: 12px;
    color: var(--muted);
}
.cat-preview-more:hover { color: var(--cat); }
.cat-preview-list { list-style: none; padding: 0; margin: 0; }
.cat-preview-list li { margin: 0; }
.cat-preview-list li a {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 8px 0;
    color: var(--ink-soft);
    transition: color 0.15s;
    border-bottom: 1px solid var(--border-soft);
}
.cat-preview-list li:last-child a { border-bottom: 0; }
.cat-preview-list li a:hover { color: var(--cat); }
.cat-preview-title {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.cat-preview-date {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    flex-shrink: 0;
}

/* ============ 分类徽章 ============ */
.cat-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px;
    background: var(--cat-fade);
    color: var(--cat);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.6;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.cat-badge:hover {
    background: var(--cat);
    color: #fff;
    transform: translateY(-1px);
}

/* ============ 文章页 ============ */
.post-head {
    margin-bottom: 36px;
    text-align: center;
}
.post-eyebrow {
    margin-bottom: 18px;
}
.post-eyebrow .cat-badge {
    padding: 5px 14px;
    font-size: 13px;
}
.post-title {
    margin: 0 0 18px;
    font-size: 38px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--ink);
}
.post-lede {
    margin: 0 auto 22px;
    max-width: 560px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink-soft);
}
.post-meta {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--muted);
    font-size: 13px;
    font-family: var(--mono);
    letter-spacing: 0.2px;
    background: var(--surface);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}
.post-meta .dot { color: var(--muted-light); }

.post-body {
    font-size: 17px;
    line-height: 1.9;
    color: var(--ink-soft);
}
.post-body p { margin: 1.2em 0; }
.post-body h2 {
    margin: 2em 0 0.6em;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--ink);
    line-height: 1.4;
    padding-left: 14px;
    border-left: 4px solid var(--primary);
    border-radius: 2px;
}
.post-body h3 {
    margin: 1.6em 0 0.4em;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}
.post-body a {
    color: var(--primary-hover);
    border-bottom: 2px solid rgba(249, 115, 22, 0.3);
    transition: border-color 0.15s, background 0.15s;
    padding: 0 2px;
}
.post-body a:hover {
    border-bottom-color: var(--primary);
    background: var(--primary-fade);
}
.post-body strong { color: var(--ink); font-weight: 700; }
.post-body em { font-style: italic; }
.post-body blockquote {
    margin: 1.6em 0;
    padding: 14px 20px;
    background: var(--surface-warm);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--ink-soft);
}
.post-body code {
    background: var(--bg-soft);
    color: var(--primary-hover);
    padding: 1px 8px;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.92em;
    font-weight: 500;
}
.post-body ul, .post-body ol { padding-left: 24px; }
.post-body li { margin: 0.5em 0; }

/* 延伸阅读卡片 */
.related {
    margin: 36px 0;
    padding: 22px 24px;
    background: var(--surface-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.related h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-hover);
    display: flex; align-items: center; gap: 6px;
}
.related h3::before {
    content: '📖';
    font-size: 16px;
}
.related ul { list-style: none; padding: 0; margin: 0; }
.related li {
    margin: 8px 0;
    font-size: 15px;
}
.related li a {
    color: var(--ink);
    border-bottom: 0;
    transition: color 0.15s;
    padding: 0;
    background: transparent;
}
.related li a::before { content: '→ '; color: var(--primary); font-weight: 700; }
.related li a:hover { color: var(--primary-hover); background: transparent; border-bottom: 0; }

/* 上一篇 / 下一篇 */
.post-nav {
    margin-top: 50px;
    padding-top: 32px;
    border-top: 2px dashed var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.post-nav-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
    min-height: 80px;
}
.post-nav-card:not(.disabled):hover {
    border-color: var(--primary);
    background: var(--primary-fade);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.post-nav-card .lbl {
    font-size: 12px;
    color: var(--primary-hover);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 700;
}
.post-nav-card .ttl {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-nav-card.right { text-align: right; align-items: flex-end; }
.post-nav-card.disabled {
    opacity: 0.45;
    background: transparent;
    cursor: default;
}

/* ============ 分页 ============ */
.pagination {
    margin-top: 44px;
    display: flex; gap: 8px; align-items: center; justify-content: center;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--ink);
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}
.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
    transform: translateY(-1px);
}
.pagination .cur {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagination .disabled { opacity: 0.4; cursor: default; background: transparent; }

/* ============ 空状态 ============ */
.empty-state {
    text-align: center;
    padding: 70px 20px;
    color: var(--muted);
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
}
.empty-emoji { font-size: 52px; margin-bottom: 14px; line-height: 1; }

/* ============ 页脚 ============ */
.site-foot {
    border-top: 1px solid var(--border);
    background: var(--surface-warm);
    margin-top: 70px;
}
.foot-friends {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 24px 14px;
    border-bottom: 1px dashed var(--border);
    display: flex; align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--ink-soft);
    font-size: 13px;
}
.foot-friends-label {
    color: var(--primary-hover);
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.4px;
}
.foot-friends-list {
    display: flex; gap: 6px 14px; flex-wrap: wrap;
    align-items: baseline;
}
.foot-friends-list a {
    color: var(--ink-soft);
    transition: color 0.15s;
}
.foot-friends-list a:hover { color: var(--primary-hover); }
.foot-friends-more { font-size: 12px; color: var(--muted) !important; }
.foot-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
.foot-inner .sep { margin: 0 10px; color: var(--muted-light); }
.foot-inner a { color: var(--muted); }
.foot-inner a:hover { color: var(--primary-hover); }

/* ============ /links 友链页 ============ */
.links-grid {
    list-style: none;
    padding: 0; margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.link-card a {
    display: flex; flex-direction: column; gap: 6px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--ink);
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
    height: 100%;
}
.link-card a:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.link-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.1px;
}
.link-card-desc {
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.55;
    flex: 1;
}
.link-card-url {
    color: var(--muted);
    font-size: 12px;
    font-family: var(--mono);
    margin-top: 6px;
    letter-spacing: 0.2px;
}
.links-apply {
    margin-top: 40px;
    padding: 22px 26px;
    background: var(--surface-warm);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--ink-soft);
}
.links-apply h3 {
    margin: 0 0 8px;
    color: var(--primary-hover);
    font-size: 15px;
    font-weight: 700;
}
.links-apply p { margin: 0; font-size: 14px; line-height: 1.7; }

/* ============ 广告位 ============ */
.ad-slot { margin: 24px 0; }
.ad-slot:empty { display: none; margin: 0; }

/* ============ 响应式 ============ */
@media (max-width: 720px) {
    .nav-inner {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .brand { justify-content: center; }
    .nav-links {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links a { white-space: nowrap; flex-shrink: 0; font-size: 13px; padding: 7px 12px; }
    .hero-inner { padding: 48px 18px 40px; }
    .hero-title { font-size: 42px; letter-spacing: -1px; }
    .hero-sub { font-size: 15px; }
    .hero-cats { gap: 10px; margin-top: 32px; }
    .hero-cat { width: 80px; padding: 10px 8px 12px; }
    .hero-cat-emoji { width: 38px; height: 38px; font-size: 22px; }
    .layout-index, .layout-article { padding: 36px 16px 48px; }
    .post-list { gap: 14px; }
    .post-title { font-size: 28px; letter-spacing: -0.4px; }
    .post-body { font-size: 16px; line-height: 1.85; }
    .post-body h2 { font-size: 21px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-card.right { text-align: left; align-items: flex-start; }
}
@media (max-width: 480px) {
    .hero-title { font-size: 36px; }
    .post-list { grid-template-columns: 1fr; }
}
