/* ============================================
   个人主页样式表 · DevLog
   现代化设计 · 响应式 · 明暗双主题
   ============================================ */

/* ---------- 主题变量 ---------- */
:root {
    --bg: #fafafa;
    --bg-alt: #f0f0f3;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-soft: #555;
    --text-mute: #888;
    --border: #e4e4ea;
    --accent: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #ec4899;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
    --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --radius: 16px;
    --radius-sm: 10px;
    --maxw: 1140px;
    --header-h: 68px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0d0d14;
    --bg-alt: #14141f;
    --bg-card: #1a1a28;
    --text: #e8e8f0;
    --text-soft: #b0b0c0;
    --text-mute: #787890;
    --border: #2a2a3c;
    --accent: #818cf8;
    --accent-2: #c084fc;
    --accent-3: #f472b6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: var(--gradient); z-index: 1000;
    transition: width 0.1s linear;
}

/* ---------- 导航栏 ---------- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-h);
    display: flex; align-items: center;
    background: rgba(250, 250, 250, 0.7);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}
[data-theme="dark"] .navbar { background: rgba(13, 13, 20, 0.7); }
.navbar.scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.nav-container {
    width: 100%; max-width: var(--maxw); margin: 0 auto;
    padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.2rem; }
.logo-mark { font-family: 'JetBrains Mono', monospace; color: var(--accent); }
.logo-text { letter-spacing: -0.5px; }
.nav-menu { display: flex; gap: 32px; }
.nav-link {
    font-size: 0.95rem; color: var(--text-soft); font-weight: 500;
    position: relative; transition: color var(--transition);
}
.nav-link::after {
    content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 2px;
    background: var(--gradient); transition: width var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 首屏 ---------- */
.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; text-align: center; padding: 100px 24px 60px;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 75%);
    opacity: 0.5;
}
.orb {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35;
    animation: float 14s ease-in-out infinite;
}
.orb-1 { width: 480px; height: 480px; background: var(--accent); top: -120px; left: -100px; }
.orb-2 { width: 420px; height: 420px; background: var(--accent-3); bottom: -120px; right: -80px; animation-delay: -7s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.1); }
}
.hero-content { position: relative; z-index: 1; max-width: 760px; }
.hero-greeting { font-size: 1.1rem; color: var(--text-soft); margin-bottom: 16px; }
.hero-title { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 700; line-height: 1.15; letter-spacing: -1px; }
.gradient-text {
    background: var(--gradient); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle { font-size: clamp(1rem, 2.5vw, 1.25rem); color: var(--text-soft); margin: 20px 0 36px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 13px 30px; border-radius: 50px; font-weight: 600; font-size: 0.98rem;
    cursor: pointer; border: none; transition: var(--transition); font-family: inherit;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(99, 102, 241, 0.45); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

.hero-stats {
    display: flex; align-items: center; justify-content: center; gap: 28px;
    margin-top: 56px; flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num {
    font-family: 'JetBrains Mono', monospace; font-size: 2rem; font-weight: 700;
    background: var(--gradient); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.85rem; color: var(--text-mute); margin-top: 2px; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

.scroll-indicator {
    position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
    width: 26px; height: 42px; border: 2px solid var(--text-mute); border-radius: 14px;
    display: flex; justify-content: center; padding-top: 7px;
}
.scroll-indicator span {
    width: 4px; height: 8px; background: var(--text-mute); border-radius: 2px;
    animation: scrollDot 1.8s infinite;
}
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(-4px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- 通用 Section ---------- */
.section { padding: 100px 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-tag {
    font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--accent);
    letter-spacing: 1px; display: block; margin-bottom: 12px;
}
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.5px; }
.section-desc { color: var(--text-soft); margin-top: 14px; }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.about-text p { margin-bottom: 18px; color: var(--text-soft); font-size: 1.05rem; }
.about-text strong { color: var(--text); }
.about-philosophy {
    font-style: italic; font-size: 1.15rem !important; color: var(--accent) !important;
    font-weight: 500; padding-left: 20px; border-left: 3px solid var(--accent);
}
.about-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 36px; text-align: center; box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.about-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-icon { font-size: 2.6rem; margin-bottom: 16px; }
.about-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.about-card p { color: var(--text-soft); }

/* ---------- 技术栈 ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.skill-category {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; transition: var(--transition);
}
.skill-category:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.skill-category h3 { font-size: 1.1rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.skill-category h3::before { content: ''; width: 4px; height: 18px; background: var(--gradient); border-radius: 2px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
    padding: 7px 16px; background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: 50px; font-size: 0.9rem; color: var(--text-soft);
    transition: var(--transition); font-family: 'JetBrains Mono', monospace;
}
.tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }

/* ---------- 学习笔记 ---------- */
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.note-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; cursor: pointer; transition: var(--transition);
    display: flex; flex-direction: column;
}
.note-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.note-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.note-cat {
    font-size: 0.78rem; font-weight: 600; color: var(--accent);
    background: rgba(99, 102, 241, 0.1); padding: 4px 12px; border-radius: 50px;
}
.note-date { font-size: 0.8rem; color: var(--text-mute); font-family: 'JetBrains Mono', monospace; }
.note-card h3 { font-size: 1.18rem; margin-bottom: 10px; transition: var(--transition); }
.note-card:hover h3 { color: var(--accent); }
.note-card p { color: var(--text-soft); font-size: 0.95rem; flex-grow: 1; }
.note-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.note-read { font-size: 0.82rem; color: var(--text-mute); }
.note-arrow { color: var(--accent); font-size: 1.2rem; transition: var(--transition); }
.note-card:hover .note-arrow { transform: translateX(4px); }

/* ---------- 实践项目 ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.project-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px 28px; transition: var(--transition); text-align: center;
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.project-thumb {
    font-size: 3rem; width: 84px; height: 84px; margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-alt); border-radius: 50%; transition: var(--transition);
}
.project-card:hover .project-thumb { transform: scale(1.1) rotate(-6deg); }
.project-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.project-card p { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 18px; }
.project-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.project-tags span {
    font-size: 0.78rem; padding: 4px 12px; border-radius: 50px;
    background: var(--bg-alt); color: var(--text-mute); font-family: 'JetBrains Mono', monospace;
}

/* ---------- 联系 ---------- */
.contact-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 880px; margin: 0 auto; }
.contact-item {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px 24px; text-align: center; transition: var(--transition);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.contact-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.contact-icon { font-size: 2.2rem; margin-bottom: 8px; }
.contact-label { font-weight: 600; }
.contact-value { color: var(--text-mute); font-size: 0.9rem; font-family: 'JetBrains Mono', monospace; }

/* ---------- 页脚 ---------- */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-top: 56px; }
.footer-inner {
    display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; padding-bottom: 36px;
}
.footer-brand { font-weight: 700; font-size: 1.15rem; display: flex; flex-direction: column; gap: 10px; }
.footer-brand p { font-size: 0.9rem; font-weight: 400; color: var(--text-soft); }
.footer-filing p { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 10px; line-height: 1.8; }
.footer-site-name { font-weight: 600 !important; color: var(--text) !important; }
.footer-icp { margin-top: 14px !important; }
.icp-link {
    display: inline-block; padding: 6px 16px; border: 1px solid var(--border); border-radius: 50px;
    font-size: 0.88rem; color: var(--text-soft); transition: var(--transition);
    font-family: 'JetBrains Mono', monospace;
}
.icp-link:hover { color: var(--accent); border-color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding: 22px 0; text-align: center; }
.footer-bottom p { font-size: 0.85rem; color: var(--text-mute); }

/* ---------- 回到顶部 ---------- */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px; width: 46px; height: 46px;
    border-radius: 50%; border: none; cursor: pointer; z-index: 90;
    background: var(--gradient); color: #fff; box-shadow: var(--shadow-md);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(20px); transition: var(--transition);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ---------- 滚动揭示动画 ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .about-grid, .footer-inner { grid-template-columns: 1fr; }
    .skills-grid, .notes-grid, .projects-grid, .contact-links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
    .nav-menu {
        position: fixed; top: var(--header-h); left: 0; right: 0;
        background: var(--bg-card); flex-direction: column; gap: 0;
        padding: 12px 24px; border-bottom: 1px solid var(--border);
        transform: translateY(-130%); transition: var(--transition); box-shadow: var(--shadow-md);
    }
    .nav-menu.open { transform: translateY(0); }
    .nav-menu li { padding: 12px 0; border-bottom: 1px solid var(--border); }
    .nav-menu li:last-child { border-bottom: none; }
    .nav-toggle { display: flex; }
    .skills-grid, .notes-grid, .projects-grid, .contact-links { grid-template-columns: 1fr; }
    .hero-stats { gap: 18px; }
    .stat-divider { display: none; }
    .section { padding: 70px 0; }
    .filing-break { display: none; }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}
