/* base.css — 变量 / 重置 / 容器 / 卡片 / 入场 / 响应式 / 光晕 / 粒子 */

:root {
    --bg-1: #a1c4fd; --bg-2: #c2e9fb; --bg-3: #fbc2eb; --bg-4: #a6c1ee;
    --text: #1f2933; --text-soft: #52606d;
    --card-bg: rgba(255, 255, 255, 0.55);
    --card-border: rgba(255, 255, 255, 0.65);
    --card-shadow: 0 8px 32px rgba(31, 41, 67, 0.18);
    --accent: #4f8cff;
    --accent-soft: rgba(79, 140, 255, 0.15);
    --tag-bg: rgba(79, 140, 255, 0.12);
    --tag-text: #2f6bd0;
    --node: rgba(79, 140, 255, 0.25);
}
[data-theme="dark"] {
    --bg-1: #0f2027; --bg-2: #203a43; --bg-3: #2c5364; --bg-4: #1a1a2e;
    --text: #e8eef5; --text-soft: #9aa5b1;
    --card-bg: rgba(30, 40, 60, 0.45);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --accent: #6ea8ff;
    --accent-soft: rgba(110, 168, 255, 0.18);
    --tag-bg: rgba(110, 168, 255, 0.16);
    --tag-text: #9cc0ff;
    --node: rgba(110, 168, 255, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text); line-height: 1.6; overflow-x: hidden;
    background: linear-gradient(135deg, var(--bg-1), var(--bg-2), var(--bg-3), var(--bg-4));
    background-size: 400% 400%; animation: gradientShift 18s ease infinite;
    transition: color 0.4s ease;
}
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* 顶部控件 */
.top-controls { position: fixed; top: 18px; right: 18px; display: flex; gap: 8px; z-index: 100; }
.ctrl-btn, .theme-toggle {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--card-border); background: var(--card-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--text); box-shadow: var(--card-shadow); font-weight: 700;
    transition: transform 0.3s ease, background 0.4s ease, color 0.25s ease;
}
.ctrl-btn:hover, .theme-toggle:hover { transform: scale(1.08); background: var(--accent); color: #fff; }
.theme-toggle:hover { transform: scale(1.08) rotate(15deg); }
.theme-toggle svg { width: 20px; height: 20px; }
[data-theme="dark"] .icon-sun { display: block; } [data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; } .icon-moon { display: block; }

.accent-wrap { position: relative; }
.accent-pop {
    position: absolute; top: 52px; right: 0;
    display: flex; gap: 8px; padding: 10px;
    background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px;
    backdrop-filter: blur(16px); box-shadow: var(--card-shadow);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all 0.2s ease; z-index: 101;
}
.accent-pop.open { opacity: 1; visibility: visible; transform: translateY(0); }
.accent-dot { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform 0.2s ease; }
.accent-dot:hover { transform: scale(1.15); }
.accent-dot.active { border-color: var(--text); }

/* Flow 连线 */
.flow-rail { position: fixed; left: 28px; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, transparent, var(--node), transparent); z-index: 1; pointer-events: none; }
.flow-node { position: fixed; left: 23px; width: 12px; height: 12px; border-radius: 50%; background: var(--card-bg); border: 2px solid var(--node); transform: translateX(0) scale(0.6); transition: all 0.5s ease; z-index: 2; pointer-events: none; }
.flow-node.active { background: var(--accent); border-color: var(--accent); transform: scale(1); box-shadow: 0 0 14px var(--accent); }

/* 容器 + 卡片 */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 60px 48px 40px; display: flex; flex-direction: column; gap: 28px; }
.card {
    width: 100%; background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 20px; box-shadow: var(--card-shadow);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    padding: 36px; transition: background 0.4s ease, border 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(31, 41, 67, 0.22); }

/* 区块标题 */
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.section-num { font-size: 0.78rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; letter-spacing: 1px; }
.section-title { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.section-title .emoji { margin-right: 6px; }

/* 入场 */
.iUp { opacity: 0; transform: translateY(16px); animation: fadeUp 0.6s ease forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.iUp:nth-child(1) { animation-delay: 0.05s; } .iUp:nth-child(2) { animation-delay: 0.15s; }
.iUp:nth-child(3) { animation-delay: 0.25s; } .iUp:nth-child(4) { animation-delay: 0.35s; } .iUp:nth-child(5) { animation-delay: 0.45s; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* 通用按钮 */
.btn { padding: 9px 18px; border-radius: 999px; border: none; background: var(--accent); color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px var(--accent-soft); }
.btn-ghost { background: var(--accent-soft); color: var(--accent); }
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* 鼠标光晕 */
.cursor-glow { position: fixed; top: 0; left: 0; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; z-index: 0; mix-blend-mode: soft-light; }

/* 进度条 */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), #c2e9fb); z-index: 200; transition: width 0.1s linear; }

/* 返回顶部 */
.to-top { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--card-border); background: var(--card-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--text); font-size: 1.2rem; cursor: pointer; box-shadow: var(--card-shadow); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease, background 0.25s ease, color 0.25s ease; z-index: 90; }
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

/* 响应式 */
@media (max-width: 768px) {
    .flow-rail, .flow-node { display: none; }
    .container { padding: 48px 16px 32px; }
    .card { padding: 26px 20px; }
    .top-controls { top: 12px; right: 12px; gap: 6px; }
    .ctrl-btn, .theme-toggle { width: 40px; height: 40px; }
    .cursor-glow { display: none; }
}
@media (max-width: 1024px) and (min-width: 769px) {
    .notes { grid-template-columns: 1fr; }
    .projects { grid-template-columns: repeat(2, 1fr); }
    .project-card.featured { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
    .iUp, .reveal { animation: none; opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}
