/* --- 变量定义 (浅色系) --- */
:root {
    --bg-main: #ffffff;       /* 纯白主背景 */
    --bg-secondary: #f8fafc;  /* 浅灰辅助背景 (用于Hero和Footer) */
    --bg-card: #ffffff;       /* 白卡片背景 */
    
    --accent: #0284c7;        /* 专业海洋蓝 */
    --accent-hover: #0369a1;  /* 深蓝色悬停 */
    
    --text-main: #1e293b;     /* 深石板灰主文本 (替代纯黑，更柔和) */
    --text-muted: #64748b;    /* 中灰次级文本 */
    
    --border: #e2e8f0;        /* 极浅灰色边框 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.08); /* 柔和的悬停阴影 */
    
    --font-heading: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* --- 全局样式 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-heading);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* --- 导航栏 --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    /* 浅色透明背景 */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.logo-icon {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
}

.btn-contact {
    border: 1px solid var(--accent);
    padding: 8px 20px;
    border-radius: 4px;
    color: var(--accent) !important;
    font-weight: 600;
}

.btn-contact:hover {
    background: var(--accent);
    color: white !important;
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* --- Hero 区域 --- */
.hero {
    height: 95vh; /* 稍微减小高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    padding: 0 20px;
    /* 使用浅灰背景区分 */
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6; /* 降低粒子透明度 */
}

.hero-content {
    max-width: 800px;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

.badge-new {
    background: #e0f2fe; /* 极浅蓝背景 */
    color: var(--accent);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    border: 1px solid #bae6fd;
    margin-bottom: 20px;
    display: inline-block;
    font-weight: 600;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.gradient-text {
    /* 调整为更深邃的蓝紫色渐变，在浅色上更突出 */
    background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-primary {
    background: var(--accent);
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* --- 主要内容区 --- */
.section-container {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- 筛选器 --- */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: 0.3s;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

/* --- 文章网格 & 卡片 (重点修改) --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px;
}

.post-card {
    background: var(--bg-card);
    border-radius: 16px; /* 更圆润的边角 */
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
    box-shadow: var(--shadow-sm); /* 默认轻微阴影 */
}

.post-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.post-card:hover {
    transform: translateY(-8px);
    /* 浅色系下，悬停依赖柔和的大阴影 */
    box-shadow: var(--shadow-hover);
    border-color: transparent; /* 悬停时隐藏边框，强调阴影 */
}

.card-image {
    height: 220px; /* 稍微加高图片 */
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* 调整遮罩，使图片在浅色背景下不那么沉重，但仍能看清白色文字 */
    background: linear-gradient(to bottom, transparent 20%, rgba(30,41,59,0.7) 100%);
}

.card-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.card-content {
    padding: 25px;
}

.card-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-meta svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5; /* 加粗小图标 */
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-main);
    font-weight: 700;
}

.card-content h3 a:hover {
    color: var(--accent);
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.7;
}

.card-footer {
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.read-more {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    gap: 10px;
    color: var(--accent-hover);
}

/* --- Footer --- */
footer {
    background: var(--bg-secondary); /* 浅灰背景 */
    padding: 80px 20px;
    text-align: center;
    margin-top: 100px;
    border-top: 1px solid var(--border);
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: 2px;
    color: var(--text-main);
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.socials a {
    color: var(--text-muted);
    background: white;
    padding: 10px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.socials a:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: block; }
    .hero h1 { font-size: 2.5rem; }
    .posts-grid { grid-template-columns: 1fr; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 文章模块导航（数据驱动：模块→专辑→文章） --- */
.nav-mod {
    margin: 0 0 54px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .5s ease, transform .5s ease;
}
.nav-mod.visible { opacity: 1; transform: translateY(0); }

.mod-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.mod-head::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 54px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-dark, var(--accent)));
}
.mod-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark, var(--accent)));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .12);
}
.mod-icon svg { width: 18px; height: 18px; }
.mod-head h2 {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: .3px;
    margin: 0;
}
.mod-stat {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}
.mod-desc {
    color: var(--text-muted);
    font-size: .88rem;
    line-height: 1.6;
    margin: 0 0 22px;
    max-width: 760px;
}

.mod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}
/* 空模块占位（内容整理中） */
.mod-empty {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 10px;
    padding: 22px 24px; border-radius: 14px;
    border: 1px dashed var(--border-strong);
    background: var(--bg-card);
    color: var(--text-muted); font-size: .95rem;
}
.mod-empty::before {
    content: ''; flex: 0 0 8px; height: 8px; border-radius: 50%;
    background: var(--accent, #0284c7); opacity: .55;
}
.alb-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all .35s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(18px);
}
.alb-card.visible { opacity: 1; transform: translateY(0); }
.alb-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}
.alb-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 108px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark, var(--accent)));
    position: relative;
}
.alb-cover svg {
    width: 36px;
    height: 36px;
    color: rgba(255, 255, 255, .92);
    stroke-width: 1.6;
    transition: transform .35s ease;
}
.alb-card:hover .alb-cover svg { transform: scale(1.12); }
.alb-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 78% 20%, rgba(255, 255, 255, .28), transparent 55%);
    pointer-events: none;
}
.alb-body {
    padding: 18px 20px 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.alb-title h3 {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
}
.alb-title:hover h3 { color: var(--accent); }
.alb-count {
    align-self: flex-start;
    margin-top: 7px;
    font-family: var(--font-mono);
    font-size: .74rem;
    color: var(--accent);
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 1px 10px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 600;
}
.alb-desc {
    color: var(--text-muted);
    font-size: .85rem;
    line-height: 1.6;
    margin: 10px 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.alb-more {
    margin-top: auto;
    font-size: .86rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid var(--border);
    padding: 13px 20px;
}
.alb-more svg { width: 14px; height: 14px; }
.alb-more:hover { gap: 11px; color: var(--accent-hover); }

@media (max-width: 768px) {
    .mod-grid { grid-template-columns: 1fr; }
    .mod-head h2 { font-size: 1.12rem; }
    .mod-stat { font-size: .72rem; }
}

/* --- 返回官网按钮（区别于导航文字链接/描边按钮：填充渐变胶囊） --- */
.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.btn-site {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    padding: 8px 18px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transition: all .3s ease;
    white-space: nowrap;
}
.btn-site svg { width: 15px; height: 15px; }
.btn-site:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35);
    color: #fff;
}
@media (max-width: 768px) {
    .btn-site { padding: 7px 13px; font-size: .82rem; }
    .nav-right { gap: 10px; }
}

/* --- 个人介绍导航链接（主页） --- */
.nav-about-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-weight: 600; font-size: .9rem;
    padding: 7px 14px; border-radius: 50px;
    border: 1px solid var(--border); background: var(--bg-card);
    transition: all .3s ease; white-space: nowrap;
}
.nav-about-link svg { width: 15px; height: 15px; }
.nav-about-link:hover {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.3);
}
:root[data-theme="dark"] .nav-about-link { background: var(--bg-card); }
@media (max-width: 768px) {
    .nav-about-link { padding: 6px 11px; font-size: .82rem; }
    .nav-about-link span, .nav-about-link { gap: 4px; }
}

/* --- 首页统计横幅（P0） --- */
.stats-band {
    max-width: 1200px;
    margin: 0 auto;
    padding: 44px 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.stat-cell {
    flex: 1 1 150px;
    max-width: 210px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 12px;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s ease, transform .5s ease;
}
.stat-cell.visible { opacity: 1; transform: translateY(0); }
.stat-num {
    display: block;
    font-family: var(--font-mono);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, #0284c7, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
}
@media (max-width: 768px) {
    .stats-band { gap: 12px; padding-top: 28px; }
    .stat-num { font-size: 1.9rem; }
}
/* --- P1：深色模式（主页） --- */
:root[data-theme="dark"] {
    --bg-main: #0b1220; --bg-secondary: #0f172a; --bg-card: #101a2e;
    --text-main: #e5edf7; --text-muted: #94a3b8; --border: #1e293b;
    --accent: #38bdf8; --accent-hover: #7dd3fc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.5); --shadow-hover: 0 20px 40px rgba(0,0,0,.5);
}
:root[data-theme="dark"] .navbar { background: rgba(11,18,32,.88); }
:root[data-theme="dark"] .hero { background: var(--bg-secondary); }
:root[data-theme="dark"] .filter-btn { background: var(--bg-card); }
:root[data-theme="dark"] .btn-secondary { background: var(--bg-card); }
:root[data-theme="dark"] .badge-new { background: rgba(2,132,199,.22); border-color: rgba(186,230,253,.3); }
:root[data-theme="dark"] .mod-stat, :root[data-theme="dark"] .alb-count { background: rgba(2,132,199,.18); border-color: rgba(186,230,253,.25); color: #7dd3fc; }
:root[data-theme="dark"] .alb-card, :root[data-theme="dark"] .stat-cell, :root[data-theme="dark"] .hot-card, :root[data-theme="dark"] .recent-card { background: var(--bg-card); }

/* P2：最近更新 */
#recent { padding-top: 1rem; }
#recent .section-header { margin-bottom: 1.4rem; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.recent-card { display: flex; flex-direction: column; gap: .4rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 1.05rem 1.15rem; text-decoration: none; color: var(--text-main); border-top: 3px solid var(--accent); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.recent-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(2,132,199,.12); border-color: var(--accent); }
.recent-mod { font-size: .76rem; font-weight: 700; letter-spacing: .02em; }
.recent-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.4; margin: .15rem 0; }
.recent-date { font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted); }
@media (max-width: 600px) { .recent-grid { grid-template-columns: 1fr 1fr; } }

/* --- P1：主题切换按钮（主页导航） --- */
.theme-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-muted); cursor: pointer; transition: all .3s ease; flex-shrink: 0;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { width: 17px; height: 17px; }

/* --- P1：返回顶部 --- */
.to-top {
    position: fixed; right: 22px; bottom: 26px; width: 42px; height: 42px; border-radius: 50%;
    border: 0; background: linear-gradient(135deg, #0284c7, #4f46e5); color: #fff;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(2,132,199,.35);
    opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease; z-index: 900;
}
.to-top svg { width: 18px; height: 18px; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); }
@media (max-width: 768px) { .to-top { right: 14px; bottom: 18px; width: 38px; height: 38px; } }

/* --- P1：热门文章 Top3 --- */
.hot-wrap { margin-bottom: 46px; }
.hot-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.hot-head h2 { font-size: 1.25rem; font-weight: 800; color: var(--text-main); }
.hot-sub { font-size: .85rem; color: var(--text-muted); }
.hot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hot-card {
    position: relative; display: flex; flex-direction: column; gap: 8px;
    padding: 18px 18px 16px 56px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm);
    transition: all .3s ease;
}
.hot-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--accent); }
.hot-rank {
    position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 9px;
    background: linear-gradient(135deg, #0284c7, #4f46e5); color: #fff;
    font-family: var(--font-mono); font-size: .95rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.hot-card:nth-child(1) .hot-rank { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.hot-card h3 { font-size: .98rem; font-weight: 700; line-height: 1.4; color: var(--text-main); }
.hot-card:hover h3 { color: var(--accent); }
.hot-meta { display: flex; align-items: center; gap: 10px; font-size: .76rem; color: var(--text-muted); font-family: var(--font-mono); flex-wrap: wrap; }
@media (max-width: 768px) { .hot-grid { grid-template-columns: 1fr; } }
