/* ========== 毛毛雨小说馆 公共样式 ========== */
:root {
    color-scheme: light;
    scroll-behavior: smooth;
    --bg-main: #f7f7f7;
    --bg-card: #ffffff;
    --bg-item: #f1f1f1;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-body: #333333;
    --border-line: #dddddd;
    --hover-bg: #e8e8e8;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.1);
    --accent-line: #222222;
}
[data-theme="dark"] {
    color-scheme: dark;
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --bg-item: #2a2a2a;
    --text-primary: #eeeeee;
    --text-secondary: #aaaaaa;
    --text-body: #cccccc;
    --border-line: #383838;
    --hover-bg: #353535;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.4);
    --accent-line: #eeeeee;
}

* { box-sizing: border-box; margin: 0; padding: 0; transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.25s ease, opacity 0.25s ease; }

body {
    min-height: 100vh;
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.75;
    background: var(--bg-main);
    color: var(--text-primary);
    letter-spacing: 0.3px;
    opacity: 0;
    animation: pageFadeIn 0.7s ease forwards;
    position: relative;
    overflow-x: hidden;
}

/* 点阵背景 */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: radial-gradient(circle, var(--border-line) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* 自定义滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* 进度条 */
.progress-bar {
    position: fixed; top: 0; left: 0; height: 3px;
    background: var(--accent-line); width: 0%; z-index: 9999;
}

/* 粒子画布 */
#particleCanvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
}

/* 动画 */
@keyframes pageFadeIn { to { opacity: 1; } }
@keyframes titleGlow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.08); } }
@keyframes rotateIcon { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }

/* 浮动按钮 */
.float-btn {
    position: fixed; z-index: 99; width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--border-line); cursor: pointer; font-size: 20px;
    box-shadow: var(--shadow); background: var(--bg-card); color: var(--text-primary);
}
.float-btn:hover { transform: scale(1.12); box-shadow: var(--shadow-hover); }
.theme-switch { top: 24px; right: 24px; }
.theme-switch:hover { animation: rotateIcon 0.4s ease; }
.back-top {
    bottom: 30px; right: 24px; background: var(--text-primary);
    color: var(--bg-card); opacity: 0; pointer-events: none;
    border: none; transform: translateY(10px);
}
.back-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* 页面容器 */
.page-wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px; position: relative; z-index: 2; }

/* 页头 */
header { margin-bottom: 26px; opacity: 0; transform: translateY(15px); transition: 0.6s ease; }
header.show { opacity: 1; transform: translateY(0); }
header h1 { margin: 0 0 12px; font-size: clamp(1.8rem,5vw,2.2rem); font-weight: 500; color: var(--text-primary); animation: titleGlow 4s infinite ease-in-out; }
header p { margin: 0; color: var(--text-secondary); font-size: 1rem; }

/* 文章卡片 */
.article {
    background: var(--bg-card); border-radius: 24px; padding: 28px;
    border: 1px solid var(--border-line); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(20px); transition: 0.7s ease;
    position: relative;
}
.article.show { opacity: 1; transform: translateY(0); }
.article::after {
    content: "◇"; position: absolute; bottom: 10px; right: 16px;
    font-size: 10px; color: var(--border-line); opacity: 0.5; pointer-events: none;
}
.article h2 { margin-top: 0; font-size: 1.8rem; color: var(--text-primary); margin-bottom: 16px; }
.article p { margin: 1.2rem 0 0; line-height: 1.9; color: var(--text-body); font-size: 1.05rem; }

/* 几何分隔线 */
.geo-divider {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin: 10px 0 22px;
}
.geo-divider::before, .geo-divider::after { content: ""; width: 50px; height: 1px; background: var(--border-line); }
.geo-divider span { width: 7px; height: 7px; border: 1px solid var(--border-line); transform: rotate(45deg); display: inline-block; }

/* 返回链接 */
.back-link { display: inline-block; margin-top: 24px; color: var(--text-primary); text-decoration: none; font-weight: 600; border-bottom: 1px solid transparent; padding-bottom: 2px; font-size: 1rem; }
.back-link:hover { opacity: 0.6; border-bottom: 1px solid var(--accent-line); transform: translateX(4px); }

/* 响应式 */
@media (max-width: 680px) {
    .theme-switch { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 18px; }
    .back-top { width: 40px; height: 40px; font-size: 18px; bottom: 20px; right: 12px; }
    .article { padding: 22px; }
    .page-wrap { padding: 24px 16px; }
}
