/* ===== 全局变量与重置 ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-subtle: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --accent-primary: #2563eb;
    --accent-purple: #4f46e5;
    --accent-cyan: #0891b2;
    --accent-pink: #db2777;
    --accent-blue: #2563eb;
    --accent-green: #059669;
    --accent-orange: #ea580c;
    --accent-red: #dc2626;

    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --gradient-secondary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-accent: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --gradient-rainbow: linear-gradient(135deg, #2563eb, #4f46e5, #0891b2, #059669);

    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-hover: #94a3b8;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);
    --shadow-glow: 0 4px 14px rgba(37, 99, 235, 0.25);
    
    --font-mono: 'JetBrains Mono', Consolas, Monaco, 'Courier New', monospace;
    --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC',
                 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none;
    pointer-events: none;
    z-index: -1;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== 鼠标跟随光晕 ===== */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: none;
    display: none;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.cursor-glow.visible {
    opacity: 1;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: all var(--transition-normal);
    background: transparent;
}

.navbar.scrolled {
    background: var(--bg-blur);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-size: 1.25rem;
}

.logo-text {
    letter-spacing: -0.02em;
}

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

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    position: relative;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width var(--transition-normal);
    border-radius: 2px;
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero 区域 ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    /* 纵向排列：滚动提示独占一行，不再绝对定位压住统计数字 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    overflow: hidden;
    padding: 6rem 2rem 3rem;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    display: none;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-cyan);
    bottom: -50px;
    right: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-pink);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.3;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }
    75% {
        transform: translate(40px, 20px) scale(1.05);
    }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
    text-align: center;
    max-width: 900px;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: var(--accent-tint);
    border: 1px solid var(--accent-line);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.55);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 10px rgba(5, 150, 105, 0);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.title-line {
    display: block;
}

.gradient-text {
    color: var(--accent-primary);
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-solid);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.28);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    flex-shrink: 0;
    animation: scrollIndicatorFadeIn 0.8s ease-out 1s both;
}

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

.scroll-mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 13px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 2px;
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(16px);
        opacity: 0;
    }
}

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

/* ===== 通用区块样式 ===== */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-desc {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ===== 作品展示区 ===== */
.works {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.filter-bar {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.625rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-secondary);
}

.filter-btn.active {
    background: var(--accent-solid);
    color: white;
    border-color: transparent;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.work-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.work-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: none;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.work-card:hover .card-glow {
    opacity: 1;
}

/* 封面整块就是链接 */
.card-image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    text-decoration: none;
}

/* 悬停时给一点暗化 + 提示，明确"这块能点" */
.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.work-card:hover .card-image::after,
.card-image:focus-visible::after {
    opacity: 1;
}

.card-cover-hint {
    position: absolute;
    left: 50%;
    bottom: 0.9rem;
    transform: translateX(-50%) translateY(8px);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    z-index: 2;
}

.work-card:hover .card-cover-hint,
.card-image:focus-visible .card-cover-hint {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: transform var(--transition-slow);
}

.work-card:hover .card-placeholder {
    transform: scale(1.1);
}

.gradient-1 { background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%); }
.gradient-2 { background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%); }
.gradient-3 { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }
.gradient-4 { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); }
.gradient-5 { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); }
.gradient-6 { background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%); }

.card-emoji {
    filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.12));
    transition: transform var(--transition-bounce);
}

.work-card:hover .card-emoji {
    transform: scale(1.2) rotate(-5deg);
}

.card-content {
    padding: 1.25rem;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--accent-tint);
    color: var(--accent-primary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.card-title a:hover,
.card-title a:focus-visible {
    color: var(--accent-primary);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 卡片内的博客入口：指向该工具的教程长文 */
.card-blog {
    display: inline-flex;
    align-items: center;
    margin-top: 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast), gap var(--transition-fast);
    gap: 0.15rem;
}

.card-blog:hover,
.card-blog:focus-visible {
    gap: 0.45rem;
    text-decoration: underline;
}

.more-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    min-height: 220px;
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color var(--transition-normal), background var(--transition-normal);
}

.more-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.more-icon {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.more-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.more-card p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ===== 关于我 ===== */
.about {
    padding: 6rem 2rem;
    position: relative;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content .section-tag {
    margin-bottom: 1rem;
}

.about-content .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
}

.about-text {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.skills {
    margin-top: 2rem;
}

.skills-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.skill-tag:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.about-visual {
    display: flex;
    justify-content: center;
}

.code-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    /* 初始 3D 倾斜，hover 时摆正 —— 恢复浅色改版时误删的动效 */
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform var(--transition-slow);
}

.code-card:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.code-header {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.code-dots {
    display: flex;
    gap: 6px;
    margin-right: 1rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.code-filename {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.code-body {
    padding: 1.5rem;
    overflow-x: auto;
}

.code-body pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.8;
}

.code-comment { color: #94a3b8; }
.code-keyword { color: #7c3aed; }
.code-variable { color: #2563eb; }
.code-property { color: #c2410c; }
.code-string { color: #047857; }
.code-method { color: #0891b2; }

/* ===== 联系区域 ===== */
.contact {
    padding: 6rem 2rem;
    text-align: center;
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.contact-desc {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 120px;
}

.contact-link:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-solid);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform var(--transition-bounce);
}

.contact-link:hover .contact-icon {
    transform: scale(1.06);
}

.contact-link span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== 页脚 ===== */
.footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== 回到顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--accent-solid);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.3);
}

/* ===== 滚动显示动画 ===== */
/* 仅在 JS 可用时才隐藏，否则脚本失败会导致整页空白 */
.js .reveal {
    opacity: 0;
    transform: translateY(40px);
}

.reveal {
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* 作品筛选：淡出态（配合 [hidden] 彻底移除布局） */
.work-card[hidden] {
    display: none !important;
}

.work-card.filtered-out {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
}

/* 未开放入口 */
[data-soon] {
    cursor: not-allowed;
}

/* ===== 轻量提示 ===== */
.site-toast {
    position: fixed;
    left: 50%;
    bottom: 6rem;
    transform: translate(-50%, 16px);
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 500;
}

.site-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ===== 响应式设计 ===== */
@media (max-width: 968px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-content .section-title {
        text-align: center;
    }
    
    .about-content .section-tag {
        display: block;
        text-align: center;
    }
    
    .code-card {
        transform: none;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        transition: right var(--transition-normal);
        border-left: 1px solid var(--border-color);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .hero {
        padding: 5rem 1.5rem 3rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-divider {
        height: 30px;
    }
    
    .works,
    .about,
    .contact {
        padding: 4rem 1.5rem;
    }
    
    .works-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .contact-links {
        gap: 1rem;
    }
    
    .contact-link {
        padding: 1rem 1.5rem;
        min-width: 100px;
    }
    
    .cursor-glow {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-divider {
        width: 60px;
        height: 1px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .filter-bar {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .more-card {
        padding: 2rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

/* ===== 滚动条样式 ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ===== 选择文本样式 ===== */
::selection {
    background: var(--accent-tint-stronger);
}

/* ===== 移动端菜单打开时锁定页面滚动 ===== */
body.nav-open {
    overflow: hidden;
}

/* ===== 降低动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    /* 关闭视差与漂浮，直接呈现最终状态 */
    .gradient-orb {
        animation: none !important;
        translate: 0 0 !important;
    }

    .cursor-glow {
        display: none !important;
    }
}
