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

:root {
    --bg: #0d1117;
    --bg-alt: #161b22;
    --bg-card: #1c2128;
    --border: #30363d;
    --text: #e6edf3;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --accent-2: #7ee787;
    --accent-3: #bc8cff;
    --gradient: linear-gradient(135deg, #58a6ff, #bc8cff);
    --radius: 14px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

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

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

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(13, 17, 23, 0.92);
    border-bottom-color: var(--border);
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
}

.logo-icon {
    color: var(--accent);
    font-size: 20px;
}

.logo-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    font-size: 15px;
    color: var(--text-dim);
    transition: var(--transition);
    position: relative;
    padding: 4px 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px;
    background: var(--gradient);
    border-radius: 2px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.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 ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: float 12s ease-in-out infinite;
}

.orb-1 {
    width: 400px; height: 400px;
    background: #58a6ff;
    top: -10%; left: -5%;
}
.orb-2 {
    width: 350px; height: 350px;
    background: #bc8cff;
    bottom: -10%; right: 10%;
    animation-delay: -4s;
}
.orb-3 {
    width: 300px; height: 300px;
    background: #7ee787;
    top: 40%; left: 50%;
    animation-delay: -8s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
    text-align: center;
    z-index: 1;
    padding: 0 24px;
    animation: fadeUp 1s ease-out;
}

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

.hero-greeting {
    color: var(--accent);
    font-size: 18px;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.hero-name {
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: clamp(16px, 3vw, 22px);
    color: var(--text-dim);
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.hero-desc {
    color: var(--text-dim);
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto 36px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn {
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(88, 166, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(88, 166, 255, 0.45);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 1px;
}

.scroll-line {
    width: 1px; height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    margin: 8px auto 0;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== 通用 Section ===== */
.section {
    padding: 100px 0;
    position: relative;
}

.section-alt {
    background: var(--bg-alt);
}

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

.section-tag {
    display: inline-block;
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.section-title {
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 800;
    margin-bottom: 12px;
}

.section-line {
    width: 48px; height: 3px;
    background: var(--gradient);
    border-radius: 3px;
    margin: 0 auto;
}

/* ===== 关于 ===== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
}

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

.about-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.about-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.about-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 作品展示 ===== */

/* ===== 心得笔记 ===== */
.insights-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
}

.insights-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 90px;
    height: fit-content;
}

.filter-btn {
    text-align: left;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

.filter-btn.active {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}

.insight-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.insight-card.hidden {
    display: none;
}

.insight-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.insight-date {
    font-size: 13px;
    color: var(--text-dim);
}

.insight-cat {
    font-size: 12px;
    color: var(--accent-3);
    background: rgba(188, 140, 255, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.insight-title {
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.insight-excerpt {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.6;
}

.insight-link {
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    transition: var(--transition);
}

.insight-link:hover {
    letter-spacing: 1px;
}

/* ===== 联系 ===== */
.contact-wrap {
    text-align: center;
}

.contact-text {
    color: var(--text-dim);
    font-size: 17px;
    margin-bottom: 36px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
    color: var(--accent);
}

.contact-icon {
    font-size: 20px;
}

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

.footer .beian {
    margin-top: 8px;
    font-size: 13px;
}

.footer .beian a {
    color: var(--text-dim);
    text-decoration: none;
    transition: var(--transition);
}

.footer .beian a:hover {
    color: var(--accent);
}

.footer .beian-gongan a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer .beian-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* ===== 滚动动画 ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 64px; left: 0; right: 0;
        background: rgba(13, 17, 23, 0.97);
        backdrop-filter: blur(16px);
        flex-direction: column;
        gap: 0;
        padding: 16px 0;
        border-bottom: 1px solid var(--border);
        transform: translateY(-150%);
        transition: var(--transition);
    }

    .nav-links.open {
        transform: translateY(0);
    }

    .nav-links li {
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 12px;
    }

    .nav-toggle {
        display: flex;
    }

    .insights-layout {
        grid-template-columns: 1fr;
    }

    .insights-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        position: static;
    }

    .filter-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }

    .section {
        padding: 64px 0;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 260px;
        text-align: center;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-item {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}
