/* ============================================
   科研导航 - 基础样式（结构 + CSS 变量主题系统）
   默认主题: spring 青春活力
   可选: neon 霓虹紫 / cream 米白绿 / teal 青绿清透
   切换方式: <html data-theme="neon|cream|teal">
   ============================================ */

/* ===== 主题变量 ===== */

/* ---- 默认主题：spring 青春活力 ---- */
:root {
    --body-bg: linear-gradient(135deg, #fff5f0 0%, #f0f7ff 50%, #fdf0ff 100%);
    --spot-bg:
        radial-gradient(560px 400px at 8% 8%, rgba(255, 107, 107, 0.16), transparent 62%),
        radial-gradient(520px 360px at 88% 12%, rgba(77, 150, 255, 0.15), transparent 62%),
        radial-gradient(620px 460px at 75% 88%, rgba(199, 128, 250, 0.14), transparent 62%),
        radial-gradient(420px 320px at 15% 92%, rgba(255, 217, 61, 0.16), transparent 62%);

    --primary: #ff6b6b;
    --primary-2: #ff9f43;
    --accent: #4d96ff;
    --neon: #ff8fab;
    --deep: #d63031;
    --green: #6bcb77;
    --purple: #c780fa;

    --text-primary: #2d3436;
    --text-secondary: #5f6b7a;
    --text-muted: #9aa5b1;

    --card-bg: rgba(255, 255, 255, 0.82);
    --card-border: rgba(255, 255, 255, 0.75);
    --shadow: 0 8px 30px rgba(77, 150, 255, 0.10);
    --shadow-hover: 0 16px 44px rgba(255, 107, 107, 0.18);

    --header-bg: rgba(255, 255, 255, 0.78);
    --header-border: rgba(255, 255, 255, 0.6);
    --logo-grad: linear-gradient(120deg, #ff6b6b, #ff9f43 40%, #4d96ff 80%, #c780fa);
    --title-grad: linear-gradient(120deg, #2d3436 20%, #ff6b6b 55%, #4d96ff 90%);
    --page-header-grad: linear-gradient(120deg, #2d3436, #ff6b6b, #4d96ff);

    --badge-bg: rgba(255, 255, 255, 0.7);
    --badge-border: rgba(77, 150, 255, 0.14);
    --badge-color: var(--text-secondary);

    --icon-g1: linear-gradient(135deg, #ff6b6b, #ff9f43);
    --icon-g2: linear-gradient(135deg, #4d96ff, #00b4d8);
    --icon-g3: linear-gradient(135deg, #6bcb77, #a8e063);
    --icon-s1: rgba(255, 107, 107, 0.35);
    --icon-s2: rgba(77, 150, 255, 0.35);
    --icon-s3: rgba(107, 203, 119, 0.35);

    --item-bg: rgba(255, 255, 255, 0.65);
    --item-border: rgba(77, 150, 255, 0.14);
    --dashed-border: rgba(77, 150, 255, 0.25);

    --tab-grad: linear-gradient(135deg, #ff6b6b, #ff9f43);
    --tab-shadow: rgba(255, 107, 107, 0.3);

    --cover-grad: linear-gradient(135deg, #ffe3d8, #dce9ff);
    --cat-bg: rgba(255, 107, 107, 0.14);
    --cat-color: #ff6b6b;

    --code-bg: #2d3436;
    --code-text: #f8f9fa;
    --code-border: transparent;
    --quote-grad: linear-gradient(90deg, rgba(255, 107, 107, 0.08), transparent);

    --summary-bg: rgba(255, 255, 255, 0.65);
    --summary-border: #ff6b6b;
    --h2-border: rgba(255, 107, 107, 0.25);

    --footer-bg: rgba(255, 255, 255, 0.5);
    --footer-border: rgba(77, 150, 255, 0.12);
}

/* ---- 主题：neon 霓虹紫科技风 ---- */
[data-theme="neon"] {
    --body-bg:
        radial-gradient(1100px 650px at 50% -8%, rgba(124, 58, 237, 0.22), transparent 62%),
        radial-gradient(800px 500px at 92% 45%, rgba(109, 40, 217, 0.10), transparent 60%),
        #0b0b12;
    --spot-bg:
        radial-gradient(560px 400px at 8% 15%, rgba(139, 92, 246, 0.10), transparent 62%),
        radial-gradient(520px 380px at 85% 80%, rgba(124, 58, 237, 0.10), transparent 62%),
        radial-gradient(420px 320px at 60% 95%, rgba(168, 85, 247, 0.08), transparent 62%);

    --primary: #8b5cf6;
    --primary-2: #a78bfa;
    --accent: #7c3aed;
    --neon: #c4b5fd;
    --deep: #6d28d9;
    --purple: #d8b4fe;

    --text-primary: #f5f3ff;
    --text-secondary: #a1a1b0;
    --text-muted: #6f6f80;

    --card-bg: rgba(20, 18, 34, 0.55);
    --card-border: rgba(139, 92, 246, 0.22);
    --shadow: 0 8px 32px rgba(109, 40, 217, 0.18);
    --shadow-hover: 0 16px 48px rgba(139, 92, 246, 0.32);

    --header-bg: rgba(11, 11, 18, 0.7);
    --header-border: rgba(139, 92, 246, 0.15);
    --logo-grad: linear-gradient(120deg, #c4b5fd, #8b5cf6 55%, #6d28d9);
    --title-grad: linear-gradient(120deg, #ffffff 15%, #c4b5fd 50%, #a78bfa 80%);
    --page-header-grad: linear-gradient(120deg, #ffffff 20%, #c4b5fd 60%, #a78bfa);

    --badge-bg: rgba(139, 92, 246, 0.15);
    --badge-border: rgba(167, 139, 250, 0.4);
    --badge-color: #fff;

    --icon-g1: linear-gradient(135deg, #8b5cf6, #a78bfa);
    --icon-g2: linear-gradient(135deg, #7c3aed, #d8b4fe);
    --icon-g3: linear-gradient(135deg, #6d28d9, #a78bfa);
    --icon-s1: rgba(139, 92, 246, 0.55);
    --icon-s2: rgba(124, 58, 237, 0.55);
    --icon-s3: rgba(109, 40, 217, 0.55);

    --item-bg: rgba(139, 92, 246, 0.07);
    --item-border: rgba(139, 92, 246, 0.2);
    --dashed-border: rgba(139, 92, 246, 0.28);

    --tab-grad: linear-gradient(135deg, #7c3aed, #a78bfa);
    --tab-shadow: rgba(139, 92, 246, 0.5);

    --cover-grad: linear-gradient(135deg, #1a1530, #251b45);
    --cat-bg: rgba(139, 92, 246, 0.18);
    --cat-color: #c4b5fd;

    --code-bg: #17152a;
    --code-text: #e9e4ff;
    --code-border: rgba(139, 92, 246, 0.2);
    --quote-grad: linear-gradient(90deg, rgba(139, 92, 246, 0.12), transparent);

    --summary-bg: rgba(139, 92, 246, 0.08);
    --summary-border: #8b5cf6;
    --h2-border: rgba(139, 92, 246, 0.35);

    --footer-bg: rgba(11, 11, 18, 0.6);
    --footer-border: rgba(139, 92, 246, 0.15);
}

/* ---- 主题：cream 米白简约绿 ---- */
[data-theme="cream"] {
    --body-bg:
        radial-gradient(900px 520px at 85% -5%, rgba(168, 195, 160, 0.22), transparent 62%),
        radial-gradient(760px 480px at 5% 88%, rgba(125, 155, 118, 0.16), transparent 60%),
        #f9f7e8;
    --spot-bg:
        radial-gradient(480px 340px at 12% 20%, rgba(125, 155, 118, 0.12), transparent 62%),
        radial-gradient(440px 320px at 88% 72%, rgba(168, 195, 160, 0.14), transparent 62%);

    --primary: #2f5d50;
    --primary-2: #4f7d6a;
    --accent: #7d9b76;
    --neon: #5c8a72;
    --deep: #23493e;

    --text-primary: #24312c;
    --text-secondary: #5c6b64;
    --text-muted: #8a948e;

    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(47, 93, 80, 0.14);
    --shadow: 0 8px 28px rgba(47, 93, 80, 0.08);
    --shadow-hover: 0 16px 40px rgba(47, 93, 80, 0.16);

    --header-bg: rgba(249, 247, 232, 0.82);
    --header-border: rgba(47, 93, 80, 0.10);
    --logo-grad: linear-gradient(120deg, #23493e, #2f5d50 55%, #4f7d6a);
    --title-grad: linear-gradient(120deg, #24312c 15%, #2f5d50 55%, #7d9b76 92%);
    --page-header-grad: linear-gradient(120deg, #24312c 20%, #2f5d50 60%, #7d9b76);

    --badge-bg: rgba(255, 255, 255, 0.6);
    --badge-border: rgba(47, 93, 80, 0.25);
    --badge-color: #2f5d50;

    --icon-g1: linear-gradient(135deg, #2f5d50, #4f7d6a);
    --icon-g2: linear-gradient(135deg, #4f7d6a, #7d9b76);
    --icon-g3: linear-gradient(135deg, #23493e, #5c8a72);
    --icon-s1: rgba(47, 93, 80, 0.30);
    --icon-s2: rgba(79, 125, 106, 0.30);
    --icon-s3: rgba(35, 73, 62, 0.30);

    --item-bg: rgba(255, 255, 255, 0.6);
    --item-border: rgba(47, 93, 80, 0.14);
    --dashed-border: rgba(47, 93, 80, 0.20);

    --tab-grad: linear-gradient(135deg, #2f5d50, #4f7d6a);
    --tab-shadow: rgba(47, 93, 80, 0.30);

    --cover-grad: linear-gradient(135deg, #e8ece0, #dce6da);
    --cat-bg: rgba(47, 93, 80, 0.10);
    --cat-color: #2f5d50;

    --code-bg: #2c3b35;
    --code-text: #e8efe9;
    --code-border: transparent;
    --quote-grad: linear-gradient(90deg, rgba(47, 93, 80, 0.07), transparent);

    --summary-bg: rgba(255, 255, 255, 0.6);
    --summary-border: #2f5d50;
    --h2-border: rgba(47, 93, 80, 0.22);

    --footer-bg: rgba(255, 255, 255, 0.5);
    --footer-border: rgba(47, 93, 80, 0.12);
}

/* ---- 主题：teal 青绿清透 ---- */
[data-theme="teal"] {
    --body-bg:
        radial-gradient(900px 540px at 88% -6%, rgba(97, 191, 173, 0.28), transparent 62%),
        radial-gradient(760px 480px at 4% 90%, rgba(184, 230, 219, 0.30), transparent 60%),
        #eaf6f3;
    --spot-bg:
        radial-gradient(480px 340px at 14% 22%, rgba(97, 191, 173, 0.14), transparent 62%),
        radial-gradient(440px 320px at 86% 74%, rgba(184, 230, 219, 0.20), transparent 62%);

    --primary: #61bfad;
    --primary-2: #4fb5a0;
    --accent: #2c8e7c;
    --neon: #3aa28d;
    --deep: #1f6e5e;
    --green-light: #b8e6db;

    --text-primary: #1e3d35;
    --text-secondary: #5c7a72;
    --text-muted: #8fa9a1;

    --card-bg: rgba(255, 255, 255, 0.74);
    --card-border: rgba(97, 191, 173, 0.18);
    --shadow: 0 8px 28px rgba(44, 142, 124, 0.10);
    --shadow-hover: 0 16px 40px rgba(44, 142, 124, 0.18);

    --header-bg: rgba(234, 246, 243, 0.82);
    --header-border: rgba(97, 191, 173, 0.14);
    --logo-grad: linear-gradient(120deg, #1f6e5e, #2c8e7c 50%, #61bfad);
    --title-grad: linear-gradient(120deg, #1e3d35 15%, #2c8e7c 55%, #61bfad 92%);
    --page-header-grad: linear-gradient(120deg, #1e3d35 20%, #2c8e7c 60%, #61bfad);

    --badge-bg: rgba(255, 255, 255, 0.62);
    --badge-border: rgba(97, 191, 173, 0.30);
    --badge-color: #2c8e7c;

    --icon-g1: linear-gradient(135deg, #61bfad, #4fb5a0);
    --icon-g2: linear-gradient(135deg, #2c8e7c, #61bfad);
    --icon-g3: linear-gradient(135deg, #1f6e5e, #3aa28d);
    --icon-s1: rgba(97, 191, 173, 0.35);
    --icon-s2: rgba(44, 142, 124, 0.35);
    --icon-s3: rgba(31, 110, 94, 0.35);

    --item-bg: rgba(255, 255, 255, 0.62);
    --item-border: rgba(97, 191, 173, 0.18);
    --dashed-border: rgba(97, 191, 173, 0.24);

    --tab-grad: linear-gradient(135deg, #61bfad, #2c8e7c);
    --tab-shadow: rgba(44, 142, 124, 0.35);

    --cover-grad: linear-gradient(135deg, #d9f2ec, #c3e9df);
    --cat-bg: rgba(97, 191, 173, 0.12);
    --cat-color: #2c8e7c;

    --code-bg: #24483f;
    --code-text: #e4f2ee;
    --code-border: transparent;
    --quote-grad: linear-gradient(90deg, rgba(97, 191, 173, 0.09), transparent);

    --summary-bg: rgba(255, 255, 255, 0.62);
    --summary-border: #61bfad;
    --h2-border: rgba(97, 191, 173, 0.28);

    --footer-bg: rgba(255, 255, 255, 0.5);
    --footer-border: rgba(97, 191, 173, 0.16);
}

[data-theme="baipiao"] {
    --body-bg:
        radial-gradient(900px 540px at 88% -6%, rgba(231, 76, 60, 0.06), transparent 62%),
        radial-gradient(760px 480px at 4% 90%, rgba(243, 156, 18, 0.07), transparent 60%),
        #f6f7f9;
    --spot-bg:
        radial-gradient(480px 340px at 14% 22%, rgba(231, 76, 60, 0.05), transparent 62%),
        radial-gradient(440px 320px at 86% 74%, rgba(243, 156, 18, 0.06), transparent 62%);

    --primary: #e74c3c;
    --primary-2: #ff6b5e;
    --accent: #c0392b;
    --neon: #f1948a;
    --deep: #a93226;
    --green-light: #f39c12;

    --text-primary: #2c3e50;
    --text-secondary: #5d6d7e;
    --text-muted: #98a4b3;

    --card-bg: rgba(255, 255, 255, 0.92);
    --card-border: #e6e9ee;
    --shadow: 0 2px 12px rgba(44, 62, 80, 0.06);
    --shadow-hover: 0 10px 28px rgba(231, 76, 60, 0.12);

    --header-bg: rgba(255, 255, 255, 0.92);
    --header-border: #eef0f3;
    --logo-grad: linear-gradient(120deg, #2c3e50, #e74c3c);
    --title-grad: linear-gradient(120deg, #2c3e50 15%, #c0392b 55%, #e74c3c 92%);
    --page-header-grad: linear-gradient(120deg, #2c3e50 20%, #c0392b 60%, #e74c3c);

    --badge-bg: rgba(255, 255, 255, 0.85);
    --badge-border: rgba(231, 76, 60, 0.28);
    --badge-color: #e74c3c;

    --icon-g1: linear-gradient(135deg, #e74c3c, #ff6b5e);
    --icon-g2: linear-gradient(135deg, #f39c12, #e74c3c);
    --icon-g3: linear-gradient(135deg, #2c3e50, #5d6d7e);
    --icon-s1: rgba(231, 76, 60, 0.35);
    --icon-s2: rgba(243, 156, 18, 0.35);
    --icon-s3: rgba(44, 62, 80, 0.35);

    --item-bg: #f8f9fa;
    --item-border: #e6e9ee;
    --dashed-border: #e6e9ee;

    --tab-grad: linear-gradient(135deg, #e74c3c, #f39c12);
    --tab-shadow: rgba(231, 76, 60, 0.35);

    --cover-grad: linear-gradient(135deg, #fdf1ef, #f9fafb);
    --cat-bg: rgba(231, 76, 60, 0.08);
    --cat-color: #e74c3c;

    --code-bg: #2c3e50;
    --code-text: #ecf0f1;
    --code-border: transparent;
    --quote-grad: linear-gradient(90deg, rgba(231, 76, 60, 0.07), transparent);

    --summary-bg: rgba(255, 255, 255, 0.92);
    --summary-border: #e74c3c;
    --h2-border: rgba(231, 76, 60, 0.25);

    --footer-bg: rgba(255, 255, 255, 0.85);
    --footer-border: #eef0f3;
}

/* ===== 基础结构与布局 ===== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.4s ease, color 0.4s ease;
}

/* 背景彩色光斑 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--spot-bg);
    transition: background 0.4s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.loading-tip {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    grid-column: 1 / -1;
}

/* ===== 白票导航布局（baipiao 主题） ===== */
.bp-layout { display: none; }
[data-theme="baipiao"] .bp-layout { display: block; }
[data-theme="baipiao"] .hero,
[data-theme="baipiao"] .nav-section { display: none; }

.bp-hero {
    padding: 64px 0 34px;
    text-align: center;
}
.bp-title {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}
.bp-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    letter-spacing: 3px;
    margin-bottom: 32px;
}
.bp-search {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}
.bp-search input {
    flex: 1;
    min-width: 0;
    padding: 15px 24px;
    border: 2px solid var(--item-border);
    border-radius: 42px;
    font-size: 15px;
    background: var(--card-bg);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.bp-search input::placeholder { color: var(--text-muted); }
.bp-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--cat-bg);
}
.bp-search button {
    flex-shrink: 0;
    padding: 0 32px;
    border: none;
    border-radius: 42px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 18px var(--tab-shadow);
}
.bp-search button:hover {
    background: var(--deep);
    transform: translateY(-2px);
}
.bp-search-hint {
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.bp-nav-container {
    padding: 6px 0 30px;
}
.bp-cat {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 22px 26px 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: box-shadow 0.2s ease;
}
.bp-cat:hover { box-shadow: var(--shadow-hover); }
.bp-cat-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px dashed var(--dashed-border);
}
.bp-cat-icon {
    font-size: 19px;
    line-height: 1;
}
.bp-cat-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.bp-cat-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.bp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 12px;
    background: var(--item-bg);
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    max-width: 100%;
}
.bp-link .favicon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
}
.bp-link .bp-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bp-link:hover {
    background: var(--cat-bg);
    color: var(--primary);
    border-color: var(--item-border);
    transform: translateY(-2px);
}
.bp-search-tip {
    text-align: center;
    color: var(--text-muted);
    padding: 26px 0 10px;
    font-size: 14px;
}
.bp-search-tip a {
    color: var(--primary);
    font-weight: 600;
}
.bp-search-tip a:hover { text-decoration: underline; }

/* ===== 头部 ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    background: var(--logo-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon { font-size: 24px; -webkit-text-fill-color: initial; }

.main-nav {
    display: flex;
    gap: 32px;
}

.main-nav a {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s, transform 0.2s;
}

.main-nav a:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

/* ===== Hero ===== */
.hero {
    padding: 56px 0 40px;
    text-align: center;
    position: relative;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 24px;
    color: var(--badge-color);
    border: 1px solid var(--badge-border);
    background: var(--badge-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    animation: float 4s ease-in-out infinite;
}

.hero-badge.b2 { animation-delay: 0.7s; }
.hero-badge.b3 { animation-delay: 1.4s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.hero-title {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 14px;
    background: var(--title-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

/* ===== 毛玻璃导航块 ===== */
.nav-section {
    padding: 20px 0 40px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.nav-block {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius, 18px);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.nav-block:hover {
    transform: translateY(-4px);
    border-color: var(--item-border);
    box-shadow: var(--shadow-hover);
}

.nav-block-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--dashed-border);
}

/* 分类图标：主题色系渐变循环 */
.nav-block:nth-child(3n+1) .nav-block-icon {
    background: var(--icon-g1);
    box-shadow: 0 4px 14px var(--icon-s1);
}
.nav-block:nth-child(3n+2) .nav-block-icon {
    background: var(--icon-g2);
    box-shadow: 0 4px 14px var(--icon-s2);
}
.nav-block:nth-child(3n+3) .nav-block-icon {
    background: var(--icon-g3);
    box-shadow: 0 4px 14px var(--icon-s3);
}

.nav-block-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 19px;
    color: #fff;
    flex-shrink: 0;
}

.nav-block-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-block-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-item-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--item-bg);
    border: 1.5px solid var(--item-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.25s ease;
}

.nav-item-link:hover {
    background: var(--cat-bg);
    border-color: var(--neon);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.nav-item-link .favicon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

/* ===== 资讯区域 ===== */
.articles-section {
    padding: 40px 0 60px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    position: relative;
    padding-left: 14px;
    color: var(--text-primary);
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 22px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--primary), var(--neon));
}

.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab {
    padding: 7px 18px;
    background: var(--item-bg);
    border: 1.5px solid var(--item-border);
    border-radius: 22px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab:hover {
    border-color: var(--neon);
    color: var(--primary);
    transform: translateY(-1px);
}

.tab.active {
    background: var(--tab-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px var(--tab-shadow);
}

.article-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.article-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius, 18px);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--item-border);
    box-shadow: var(--shadow-hover);
}

.article-cover {
    height: 180px;
    overflow: hidden;
    background: var(--cover-grad);
    position: relative;
}

.article-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.10));
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.article-card:hover .article-cover img { transform: scale(1.05); }

.article-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-category {
    padding: 3px 12px;
    background: var(--cat-bg);
    color: var(--cat-color);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--cat-bg);
}

.article-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-primary);
    transition: color 0.2s;
}

.article-title a:hover { color: var(--primary); }

.article-summary {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
    flex: 1;
}

.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
}

.article-author { color: var(--text-muted); }

.read-more {
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s, color 0.2s;
}

.read-more:hover { gap: 8px; color: var(--deep); }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 16px;
    background: var(--item-bg);
    border: 1.5px solid var(--item-border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.page-btn:hover {
    border-color: var(--neon);
    color: var(--primary);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--tab-grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px var(--tab-shadow);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ===== 列表页头部（Hugo /articles） ===== */
.page-header {
    padding: 50px 0 30px;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 800;
    background: var(--page-header-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.page-header p { color: var(--text-secondary); }

/* ===== 文章详情页 ===== */
.article-detail {
    padding: 30px 0 60px;
}

.article-container {
    max-width: 800px;
}

.article-header {
    margin-bottom: 30px;
}

.article-header .article-title {
    font-size: 32px;
    font-weight: 800;
    margin: 12px 0;
    line-height: 1.3;
    color: var(--text-primary);
}

.article-header .article-summary {
    font-size: 16px;
    color: var(--text-secondary);
    -webkit-line-clamp: unset;
    padding: 14px 18px;
    background: var(--summary-bg);
    border-left: 4px solid var(--summary-border);
    border-radius: 0 12px 12px 0;
}

.article-cover-large {
    margin-bottom: 30px;
    border-radius: var(--radius, 18px);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.article-cover-large img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.article-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-primary);
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius, 18px);
    padding: 32px;
    box-shadow: var(--shadow);
}

.article-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 30px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--h2-border);
}

.article-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 24px 0 12px;
}

.article-content p { margin-bottom: 16px; }

.article-content pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 18px;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid var(--code-border);
}

.article-content code {
    background: var(--cat-bg);
    color: var(--deep);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 14px;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 10px 20px;
    margin: 16px 0;
    background: var(--quote-grad);
    border-radius: 0 12px 12px 0;
    color: var(--text-secondary);
}

.article-content img {
    border-radius: 12px;
    margin: 16px 0;
    box-shadow: var(--shadow);
}

.article-content a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content ul, .article-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.article-content li { margin-bottom: 8px; }

.article-detail-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed var(--dashed-border);
}

.back-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover { color: var(--primary); }

/* ===== 页脚 ===== */
.site-footer {
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--footer-border);
    background: var(--footer-bg);
}

.site-icp {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.site-load-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.85;
}

.site-load-time span {
    font-weight: 600;
    color: var(--primary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .hero-title { font-size: 30px; }
    .hero-subtitle { font-size: 15px; }
    .nav-grid { grid-template-columns: 1fr; }
    .article-list { grid-template-columns: 1fr; }
    .main-nav { gap: 16px; }
    .main-nav a { font-size: 14px; }
    .article-header .article-title { font-size: 24px; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .article-content { padding: 20px; }

    .bp-title { font-size: 30px; }
    .bp-hero { padding: 44px 0 24px; }
    .bp-search { flex-direction: column; }
    .bp-search button { padding: 13px 0; }
    .bp-cat { padding: 18px 18px 16px; }
    .bp-link { padding: 8px 12px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .nav-block { padding: 16px; }
    .hero { padding: 40px 0 20px; }
}
