/* ====================================================
   XinLuo — Aceternity UI Inspired Design
   深色模式：纯黑 + 流星 + 发光星星 + 橙色系
   浅色模式：浅灰白 + 极光背景 + 蓝色/淡蓝色系
   字体：Caveat（手写） + Inter（正文）
   ==================================================== */

/* ========== Google Fonts ========== */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Inter:wght@300..900&display=swap');

/* ========== 全局重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root,
html[data-theme="dark"] {
    /* 橙色系主色 */
    --primary:        #f97316;
    --primary-dark:   #ea580c;
    --primary-light:  #fdba74;
    --secondary:      #f59e0b;

    /* 背景 */
    --bg-body:        #000000;
    --bg-surface:     #0a0a0a;
    --bg-card:        #111111;
    --bg-elevated:    #161616;
    --bg-input:       #1a1a1a;

    /* 文字 */
    --text-primary:   #f5f5f5;
    --text-secondary:  #a3a3a3;
    --text-muted:     #666666;
    --text-faint:     #404040;
    --white:          #ffffff;

    /* 边框 */
    --border-subtle:  #1f1f1f;
    --border-card:     #262626;
    --border-input:    #333333;

    /* 渐变 */
    --gradient-1: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
    --gradient-2: linear-gradient(135deg, #1a0a00 0%, #0d0d0d 100%);
    --gradient-3: linear-gradient(135deg, #111 0%, #1a1a1a 100%);

    /* 阴影（橙色辉光） */
    --shadow-sm:  0 2px 8px  rgba(249,115,22,0.08);
    --shadow-md:  0 8px 30px rgba(249,115,22,0.12);
    --shadow-lg:  0 20px 60px rgba(249,115,22,0.15);
    --shadow-glow: 0 0 40px rgba(249,115,22,0.25);

    /* 导航 */
    --nav-bg:          rgba(0,0,0,0.75);
    --nav-bg-scrolled: rgba(5,5,5,0.95);

    /* 页脚 */
    --footer-bg: #050505;

    /* 英雄区 */
    --hero-bg: #000000;

    /* 通用区 */
    --section-alt-bg:  #080808;
    --section-card-bg: #0d0d0d;

    /* 形状装饰色 */
    --shape-diamond: rgba(249,115,22,0.08);
    --shape-circle:   rgba(245,158,11,0.06);
    --shape-square:   rgba(251,146,60,0.06);
    --shape-tri:      rgba(249,115,22,0.05);

    --radius:    14px;
    --radius-lg: 22px;
    --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

html[data-theme="light"] {
    /* 蓝色系主色 */
    --primary:        #3b82f6;
    --primary-dark:   #2563eb;
    --primary-light:  #93c5fd;
    --secondary:      #6366f1;

    /* 背景 */
    --bg-body:        #f0f4f8;
    --bg-surface:     #ffffff;
    --bg-card:        #ffffff;
    --bg-elevated:    #eef2ff;
    --bg-input:       #eef2ff;

    /* 文字 */
    --text-primary:   #1e293b;
    --text-secondary: #475569;
    --text-muted:     #64748b;
    --text-faint:     #94a3b8;
    --white:          #ffffff;

    /* 边框 */
    --border-subtle:  #e2e8f0;
    --border-card:     #e8ecf1;
    --border-input:    #cbd5e1;

    /* 渐变 */
    --gradient-1: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --gradient-2: linear-gradient(135deg, #dbeafe 0%, #eef2ff 100%);
    --gradient-3: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);

    /* 阴影（蓝色辉光） */
    --shadow-sm:  0 2px 8px  rgba(59,130,246,0.06);
    --shadow-md:  0 8px 30px rgba(59,130,246,0.08);
    --shadow-lg:  0 20px 60px rgba(59,130,246,0.10);
    --shadow-glow: 0 0 40px rgba(59,130,246,0.15);

    /* 导航 */
    --nav-bg:          rgba(255,255,255,0.80);
    --nav-bg-scrolled: rgba(255,255,255,0.97);

    /* 页脚 */
    --footer-bg: #0f172a;

    /* 英雄区 */
    --hero-bg: linear-gradient(135deg, #eff6ff 0%, #eef2ff 50%, #f0f4f8 100%);

    /* 通用区 */
    --section-alt-bg:  #ffffff;
    --section-card-bg: #f8fafc;

    /* 形状装饰色 */
    --shape-diamond: rgba(59,130,246,0.07);
    --shape-circle:   rgba(99,102,241,0.06);
    --shape-square:   rgba(59,130,246,0.05);
    --shape-tri:      rgba(99,102,241,0.05);

    --radius:    14px;
    --radius-lg: 22px;
    --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ========== 基础 ========== */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: 'Inter', 'WenQuanYi Micro Hei', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    margin: 0; padding: 0;
}

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

/* ========== Iconify ========== */
iconify-icon {
    display: inline-flex;
    vertical-align: middle;
    color: currentColor;
    flex-shrink: 0;
}

/* ========== 几何形状装饰 ========== */
.shape-diamond {
    position: absolute;
    background: var(--shape-diamond);
    border: 1px solid var(--border-card);
    transform: rotate(45deg);
    border-radius: 4px;
    z-index: 0;
    pointer-events: none;
}
.shape-circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--shape-circle);
    background: transparent;
    z-index: 0;
    pointer-events: none;
}
.shape-square {
    position: absolute;
    border: 2px solid var(--shape-square);
    border-radius: 6px;
    z-index: 0;
    pointer-events: none;
}
.shape-triangle {
    position: absolute;
    width: 0; height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 30px solid var(--shape-tri);
    z-index: 0;
    pointer-events: none;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition);
    padding-top: 1px;
    margin: 0;
}
.navbar.scrolled { background: var(--nav-bg-scrolled); box-shadow: var(--shadow-md); }

.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; height: 72px; gap: 12px;
}

/* Logo */
.nav-logo { order: 0; flex: 0 0 auto; }
.logo-text {
    font-family: 'Caveat', cursive;
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
}
html[data-theme="dark"] .logo-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
html[data-theme="light"] .logo-text { color: var(--primary-dark); }

/* 导航菜单 */
.nav-menu {
    order: 1; flex: 1 1 auto;
    display: flex; list-style: none; gap: 6px;
    justify-content: center;
}
.nav-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px; font-weight: 500;
    padding: 8px 16px; border-radius: 8px;
    transition: var(--transition);
    position: relative;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--bg-elevated);
}
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.active {
    color: var(--primary-light);
    background: rgba(249,115,22,0.12);
}
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active {
    color: var(--primary-dark);
    background: rgba(59,130,246,0.08);
}

/* 右侧操作区 */
.nav-actions { order: 2; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

/* 主题切换按钮 */
.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-card);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-glow);
}
html[data-theme="dark"] .theme-toggle { color: var(--primary-light); border-color: #333; }
html[data-theme="light"] .theme-toggle { color: var(--primary-dark); }

.theme-icon { transition: opacity 0.3s ease, transform 0.3s ease; }
html[data-theme="dark"] .theme-icon-sun { display: block; color: #fbbf24; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun { display: none; }
html[data-theme="light"] .theme-icon-moon { display: block; color: var(--primary); }

/* 汉堡按钮 */
.nav-toggle {
    display: none;
    flex-direction: column; cursor: pointer; gap: 5px;
    padding: 8px; border-radius: 8px;
    transition: var(--transition); flex-shrink: 0;
    border: none; background: transparent;
}
.nav-toggle:hover { background: var(--bg-elevated); }
html[data-theme="dark"] .nav-toggle:hover { background: rgba(249,115,22,0.15); }
html[data-theme="dark"] .nav-toggle:hover .bar { background: var(--primary-light); }
html[data-theme="light"] .nav-toggle:hover .bar { background: var(--primary-dark); }
.nav-toggle .bar { width: 25px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }

@media (min-width: 969px) {
    .nav-toggle { display: none !important; }
}

/* ========== 侧边栏 ========== */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed; top: 0; left: 0;
    width: 280px; max-width: 80vw; height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    z-index: 1600;
    display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: var(--shadow-lg);
}
.sidebar.active { transform: translateX(0); }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    min-height: 72px;
}
.sidebar-logo {
    font-family: 'Caveat', cursive;
    font-size: 28px; font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-close {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-card);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}
.sidebar-close:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; overflow-y: auto; }
.sidebar-link {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px; font-weight: 500;
    transition: var(--transition);
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--bg-elevated);
    color: var(--primary);
}
html[data-theme="dark"] .sidebar-link:hover,
html[data-theme="dark"] .sidebar-link.active {
    background: rgba(249,115,22,0.12);
    color: var(--primary-light);
}
html[data-theme="light"] .sidebar-link:hover,
html[data-theme="light"] .sidebar-link.active {
    background: rgba(59,130,246,0.08);
    color: var(--primary-dark);
}
.sidebar-text { flex: 1; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border-subtle); }
.sidebar-theme-toggle {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-card);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit; font-size: 15px; font-weight: 500;
}
.sidebar-theme-toggle:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== 英雄区 ========== */
.hero {
    position: relative;
    min-height: calc(100vh - 72px);
    margin-top: 72px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    background: var(--hero-bg);
}

/* ---------- 浅色模式：极光背景 ---------- */
html[data-theme="light"] .aurora-bg {
    position: absolute; inset: 0;
    overflow: hidden;
    z-index: 0;
}
html[data-theme="light"] .aurora-layer {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: aurora-flow 20s ease-in-out infinite;
}
html[data-theme="light"] .aurora-1 {
    width: 600px; height: 400px;
    top: -10%; left: -5%;
    background: linear-gradient(135deg, rgba(59,130,246,0.3), rgba(99,102,241,0.2));
    animation-duration: 18s;
}
html[data-theme="light"] .aurora-2 {
    width: 500px; height: 500px;
    top: 20%; right: -10%;
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15));
    animation-duration: 25s;
    animation-direction: reverse;
}
html[data-theme="light"] .aurora-3 {
    width: 450px; height: 350px;
    bottom: 10%; left: 20%;
    background: linear-gradient(135deg, rgba(56,189,248,0.2), rgba(59,130,246,0.15));
    animation-duration: 22s;
}
html[data-theme="light"] .aurora-4 {
    width: 550px; height: 450px;
    bottom: -5%; right: 10%;
    background: linear-gradient(135deg, rgba(129,140,248,0.2), rgba(165,180,252,0.1));
    animation-duration: 28s;
    animation-direction: reverse;
}

@keyframes aurora-flow {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 0.4; }
    33% { transform: translate(3%, -2%) scale(1.05) rotate(2deg); opacity: 0.55; }
    66% { transform: translate(-2%, 3%) scale(0.95) rotate(-1deg); opacity: 0.35; }
}

/* ---------- 深色模式：流星效果 ---------- */
html[data-theme="dark"] .meteors-container {
    position: absolute; inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
html[data-theme="dark"] .meteor {
    position: absolute;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, rgba(249,115,22,0.8), transparent);
    border-radius: 50%;
    transform: rotate(215deg);
    animation: meteor-fall linear infinite;
    opacity: 0;
}
html[data-theme="dark"] .meteor::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 4px;
    background: rgba(255,200,100,0.9);
    border-radius: 50%;
    box-shadow: 0 0 12px 2px rgba(249,115,22,0.6);
}
@keyframes meteor-fall {
    0% { opacity: 0; transform: rotate(215deg) translateX(0); }
    5% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; transform: rotate(215deg) translateX(-500px); }
}

/* 为每颗流星设置不同位置/时长/延迟 */
html[data-theme="dark"] .meteor:nth-child(1)  { left: 15%; top: -100px; animation-duration: 4s;  animation-delay: 0s;   height: 90px; }
html[data-theme="dark"] .meteor:nth-child(2)  { left: 35%; top: -80px;  animation-duration: 5s;  animation-delay: 1.2s; height: 70px; }
html[data-theme="dark"] .meteor:nth-child(3)  { left: 55%; top: -120px; animation-duration: 3.5s;animation-delay: 2.5s; height: 100px;}
html[data-theme="dark"] .meteor:nth-child(4)  { left: 70%; top: -60px;  animation-duration: 6s;  animation-delay: 0.8s; height: 60px; }
html[data-theme="dark"] .meteor:nth-child(5)  { left: 85%; top: -90px;  animation-duration: 4.5s;animation-delay: 3s;   height: 80px; }
html[data-theme="dark"] .meteor:nth-child(6)  { left: 8%;  top: -110px; animation-duration: 5.5s;animation-delay: 1.8s; height: 75px; }
html[data-theme="dark"] .meteor:nth-child(7)  { left: 25%; top: -70px;  animation-duration: 3.8s;animation-delay: 4s;   height: 85px; }
html[data-theme="dark"] .meteor:nth-child(8)  { left: 45%; top: -100px; animation-duration: 4.2s;animation-delay: 0.5s; height: 65px; }
html[data-theme="dark"] .meteor:nth-child(9)  { left: 60%; top: -80px;  animation-duration: 5.8s;animation-delay: 2s;   height: 95px; }
html[data-theme="dark"] .meteor:nth-child(10) { left: 78%; top: -130px; animation-duration: 3.6s;animation-delay: 3.5s; height: 55px; }
html[data-theme="dark"] .meteor:nth-child(11) { left: 92%; top: -75px;  animation-duration: 4.8s;animation-delay: 1.5s; height: 88px; }
html[data-theme="dark"] .meteor:nth-child(12) { left: 5%;  top: -95px;  animation-duration: 5.2s;animation-delay: 4.5s; height: 72px; }
html[data-theme="dark"] .meteor:nth-child(13) { left: 20%; top: -115px; animation-duration: 3.9s;animation-delay: 0.3s; height: 82px; }
html[data-theme="dark"] .meteor:nth-child(14) { left: 40%; top: -65px;  animation-duration: 6.2s;animation-delay: 2.8s; height: 58px; }
html[data-theme="dark"] .meteor:nth-child(15) { left: 50%; top: -105px; animation-duration: 4.4s;animation-delay: 1s;   height: 92px; }
html[data-theme="dark"] .meteor:nth-child(16) { left: 65%; top: -85px;  animation-duration: 5.4s;animation-delay: 3.8s; height: 68px; }
html[data-theme="dark"] .meteor:nth-child(17) { left: 75%; top: -125px; animation-duration: 3.7s;animation-delay: 0.7s; height: 78px; }
html[data-theme="dark"] .meteor:nth-child(18) { left: 88%; top: -70px;  animation-duration: 4.6s;animation-delay: 2.2s; height: 87px; }
html[data-theme="dark"] .meteor:nth-child(19) { left: 12%; top: -100px; animation-duration: 5.6s;animation-delay: 4.2s; height: 63px; }
html[data-theme="dark"] .meteor:nth-child(20) { left: 30%; top: -90px;  animation-duration: 4.1s;animation-delay: 1.7s; height: 77px; }

/* ---------- 深色模式：发光星星 ---------- */
html[data-theme="dark"] .stars-container {
    position: absolute; inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
html[data-theme="dark"] .star {
    position: absolute;
    width: 3px; height: 3px;
    background: #fff;
    border-radius: 50%;
    animation: star-twinkle ease-in-out infinite;
}
html[data-theme="dark"] .star::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    background: radial-gradient(circle, rgba(255,255,200,0.3) 0%, transparent 70%);
    border-radius: 50%;
}
@keyframes star-twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* 随机分布 20 颗星星 */
html[data-theme="dark"] .star-1  { left: 10%; top: 20%; animation-duration: 2s;  }
html[data-theme="dark"] .star-2  { left: 25%; top: 15%; animation-duration: 3s;  animation-delay: 0.5s; }
html[data-theme="dark"] .star-3  { left: 40%; top: 25%; animation-duration: 2.5s;animation-delay: 1s;   }
html[data-theme="dark"] .star-4  { left: 55%; top: 10%; animation-duration: 3.5s;animation-delay: 0.3s; }
html[data-theme="dark"] .star-5  { left: 70%; top: 30%; animation-duration: 2.2s;animation-delay: 1.5s; }
html[data-theme="dark"] .star-6  { left: 85%; top: 18%; animation-duration: 2.8s;animation-delay: 0.8s; }
html[data-theme="dark"] .star-7  { left: 5%;  top: 40%; animation-duration: 3.2s;animation-delay: 2s;   }
html[data-theme="dark"] .star-8  { left: 20%; top: 50%; animation-duration: 2.4s;animation-delay: 0.6s; }
html[data-theme="dark"] .star-9  { left: 35%; top: 45%; animation-duration: 3.8s;animation-delay: 1.2s; }
html[data-theme="dark"] .star-10 { left: 50%; top: 55%; animation-duration: 2.6s;animation-delay: 0.4s; }
html[data-theme="dark"] .star-11 { left: 65%; top: 48%; animation-duration: 3.4s;animation-delay: 1.8s; }
html[data-theme="dark"] .star-12 { left: 80%; top: 52%; animation-duration: 2.3s;animation-delay: 0.9s; }
html[data-theme="dark"] .star-13 { left: 92%; top: 40%; animation-duration: 3.6s;animation-delay: 2.5s; }
html[data-theme="dark"] .star-14 { left: 15%; top: 65%; animation-duration: 2.7s;animation-delay: 1.4s; }
html[data-theme="dark"] .star-15 { left: 30%; top: 72%; animation-duration: 3.1s;animation-delay: 0.2s; }
html[data-theme="dark"] .star-16 { left: 45%; top: 68%; animation-duration: 2.9s;animation-delay: 1.7s; }
html[data-theme="dark"] .star-17 { left: 60%; top: 75%; animation-duration: 3.3s;animation-delay: 0.7s; }
html[data-theme="dark"] .star-18 { left: 75%; top: 70%; animation-duration: 2.5s;animation-delay: 2.2s; }
html[data-theme="dark"] .star-19 { left: 88%; top: 65%; animation-duration: 3.7s;animation-delay: 1.1s; }
html[data-theme="dark"] .star-20 { left: 50%; top: 35%; animation-duration: 2.1s;animation-delay: 2.8s; width:4px;height:4px;}

/* ---------- Spotlight 效果 ---------- */
.spotlight {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: spotlight-appear 1s ease 0.5s forwards, spotlight-drift 8s ease-in-out 1.5s infinite;
}
html[data-theme="dark"] .spotlight-left {
    width: 500px; height: 500px;
    top: 10%; left: -100px;
    background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
}
html[data-theme="dark"] .spotlight-right {
    width: 600px; height: 600px;
    top: 30%; right: -150px;
    background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, transparent 70%);
    animation-delay: 0.8s, 2s;
}
html[data-theme="light"] .spotlight-left {
    width: 500px; height: 500px;
    top: 10%; left: -100px;
    background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
}
html[data-theme="light"] .spotlight-right {
    width: 600px; height: 600px;
    top: 30%; right: -150px;
    background: radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%);
    animation-delay: 0.8s, 2s;
}
@keyframes spotlight-appear {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes spotlight-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.05); }
}

/* 浅色模式隐藏流星和星星 */
html[data-theme="light"] .meteors-container,
html[data-theme="light"] .stars-container { display: none; }
/* 深色模式隐藏极光 */
html[data-theme="dark"] .aurora-bg { display: none; }

/* Hero 装饰 */
.hero .shape-diamond { top: 15%; right: 10%; width: 50px; height: 50px; animation: spin 20s linear infinite; }
.hero .shape-diamond:nth-of-type(2) { top: 70%; left: 8%; width: 30px; height: 30px; animation-duration: 15s; animation-direction: reverse; }
.hero .shape-circle { top: 25%; left: 12%; width: 80px; height: 80px; }
.hero .shape-circle:nth-of-type(2) { bottom: 20%; right: 15%; width: 60px; height: 60px; }
.hero .shape-square { bottom: 30%; left: 18%; width: 40px; height: 40px; transform: rotate(15deg); }
.hero .shape-triangle { top: 60%; right: 20%; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Hero 插画 */
.hero-illustration {
    position: absolute;
    right: 5%; top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    display: flex; flex-direction: column; gap: 16px;
    pointer-events: none;
}
.hero-img {
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    object-fit: cover;
    transition: var(--transition);
}
.hero-img-1 { width: 220px; height: 220px; transform: rotate(-5deg); }
.hero-img-2 { width: 160px; height: 160px; transform: rotate(8deg); margin-left: 60px; }
html[data-theme="dark"] .hero-img { box-shadow: 0 20px 60px rgba(249,115,22,0.15); border: 1px solid var(--border-card); }
html[data-theme="light"] .hero-img { box-shadow: 0 20px 60px rgba(59,130,246,0.10); border: 1px solid var(--border-card); }

.hero-content { position: relative; z-index: 2; text-align: center; padding: 0 24px; max-width: 900px; }

/* Hero 标题 — 手写字体 */
.hero-title { margin-bottom: 32px; animation: fadeInUp 0.8s ease forwards; }
.title-main {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: clamp(72px, 14vw, 140px);
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.05;
}
html[data-theme="dark"] .title-main {
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--secondary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
html[data-theme="light"] .title-main {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.title-sub {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: clamp(14px, 2.5vw, 20px);
    font-weight: 400;
    color: var(--primary);
    margin-top: 12px;
    letter-spacing: 6px;
    text-transform: uppercase;
}

.hero-description {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--text-secondary);
    margin-bottom: 48px; line-height: 1.8;
    animation: fadeInUp 0.8s ease 0.2s forwards; opacity: 0;
}

.hero-buttons {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s forwards; opacity: 0;
}
.hero-buttons .btn { display: inline-flex; align-items: center; gap: 8px; }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 36px; font-size: 16px; font-weight: 600;
    border-radius: 12px; border: none; cursor: pointer;
    transition: var(--transition);
    text-decoration: none; font-family: inherit;
}
.btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 4px 20px var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--shadow-glow); }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-input);
}
.btn-outline:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
    color: var(--primary);
    transform: translateY(-2px);
}
html[data-theme="dark"] .btn-outline:hover { background: rgba(249,115,22,0.08); }
html[data-theme="light"] .btn-outline:hover { background: rgba(59,130,246,0.06); }

.btn-full { width: 100%; }

/* ---------- 「前往博客」按钮（流光描边） ---------- */
.btn-blog {
    position: relative;
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 4px 20px var(--shadow-glow);
    overflow: hidden;
    z-index: 1;
}
.btn-blog::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 10px;
    background: inherit;
    z-index: -1;
}
.btn-blog::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    padding: 2px;
    background: conic-gradient(
        from var(--angle, 0deg),
        var(--primary) 0deg,
        var(--secondary) 90deg,
        var(--primary-light) 180deg,
        var(--secondary) 270deg,
        var(--primary) 360deg
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: blog-border-rotate 3s linear infinite;
    z-index: -2;
}
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@keyframes blog-border-rotate {
    to { --angle: 360deg; }
}
.btn-blog:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--shadow-glow); }

/* ========== 滚动指示器 ========== */
.scroll-indicator {
    position: absolute; bottom: 40px; left: 50%;
    transform: translateX(-50%); z-index: 2;
    cursor: pointer; animation: bounce 2s infinite;
}
.mouse {
    width: 30px; height: 50px;
    border: 2px solid var(--text-faint);
    border-radius: 15px; position: relative; display: block;
}
.mouse::before {
    content: ''; position: absolute;
    top: 10px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 8px;
    background: var(--primary); border-radius: 2px;
    animation: scrollWheel 2s infinite;
}
@keyframes scrollWheel { 0%{opacity:1;top:10px;} 100%{opacity:0;top:30px;} }
@keyframes bounce {
    0%,20%,50%,80%,100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}
@keyframes fadeInUp { from{opacity:0;transform:translateY(30px);} to{opacity:1;transform:translateY(0);} }

/* ========== 通用区块 ========== */
section { padding: 100px 0; position: relative; }
.section-header { text-align: center; margin-bottom: 72px; }

.section-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 20px;
    background: var(--bg-elevated);
    color: var(--primary);
    border: 1px solid var(--border-card);
    border-radius: 20px;
    font-size: 14px; font-weight: 600;
    margin-bottom: 16px;
}
html[data-theme="dark"] .section-tag { background: rgba(249,115,22,0.08); border-color: rgba(249,115,22,0.2); }
html[data-theme="light"] .section-tag { background: rgba(59,130,246,0.06); border-color: rgba(59,130,246,0.15); }

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.section-description { font-size: 18px; color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* ========== 关于我们 ========== */
.about { background: var(--section-alt-bg); }
.about-bg-image {
    position: absolute; inset: 0;
    z-index: 0; overflow: hidden;
    opacity: 0.06;
}
html[data-theme="light"] .about-bg-image { opacity: 0.04; }
.about-bg-image img { width: 100%; height: 100%; object-fit: cover; }
.about .container { position: relative; z-index: 1; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }

.about-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 48px 36px; text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-subtle);
    position: relative; overflow: hidden;
}
.about-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0); transform-origin: left;
    transition: var(--transition);
}
.about-card:hover::before { transform: scaleX(1); }
.about-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--border-card); }
html[data-theme="dark"] .about-card:hover { border-color: rgba(249,115,22,0.25); box-shadow: 0 20px 60px rgba(249,115,22,0.08); }
html[data-theme="light"] .about-card:hover { border-color: rgba(59,130,246,0.2); box-shadow: 0 20px 60px rgba(59,130,246,0.06); }

.about-icon-wrap {
    width: 72px; height: 72px;
    margin: 0 auto 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 18px;
    background: var(--bg-elevated);
}
html[data-theme="dark"] .about-icon-wrap { background: rgba(249,115,22,0.08); }
html[data-theme="light"] .about-icon-wrap { background: rgba(59,130,246,0.06); }
.about-icon-svg { color: var(--primary); }
.about-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.about-card p { color: var(--text-muted); line-height: 1.7; }

/* ========== 服务 ========== */
.services { position: relative; overflow: hidden; }
html[data-theme="dark"] .services { background: var(--gradient-2); }
html[data-theme="light"] .services { background: var(--gradient-2); }

/* 服务区背景光束 */
.bg-beams { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.beam {
    position: absolute;
    width: 2px;
    border-radius: 50%;
    filter: blur(1px);
    animation: beam-glow ease-in-out infinite;
}
html[data-theme="dark"] .beam { background: linear-gradient(to bottom, transparent, rgba(249,115,22,0.4), transparent); }
html[data-theme="light"] .beam { background: linear-gradient(to bottom, transparent, rgba(59,130,246,0.3), transparent); }
.beam-1 { left: 15%; top: 0; height: 100%; animation-duration: 6s; }
.beam-2 { left: 50%; top: 0; height: 100%; animation-duration: 8s; animation-delay: 2s; }
.beam-3 { left: 80%; top: 0; height: 100%; animation-duration: 7s; animation-delay: 1s; }
@keyframes beam-glow {
    0%, 100% { opacity: 0.2; transform: scaleX(1); }
    50% { opacity: 0.6; transform: scaleX(2); }
}

.services .container { position: relative; z-index: 1; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; }

.service-card {
    background: var(--section-card-bg);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.service-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0); transform-origin: left;
    transition: var(--transition);
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-glow); }
html[data-theme="dark"] .service-card:hover { border-color: rgba(249,115,22,0.25); }
html[data-theme="light"] .service-card:hover { border-color: rgba(59,130,246,0.2); }

.service-icon-wrap {
    width: 64px; height: 64px;
    margin-bottom: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 16px;
    background: var(--bg-elevated);
}
html[data-theme="dark"] .service-icon-wrap { background: rgba(249,115,22,0.08); }
html[data-theme="light"] .service-icon-wrap { background: rgba(59,130,246,0.06); }
.service-icon-svg { color: var(--primary); }
.service-card h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.service-card p { color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.service-features { list-style: none; padding: 0; }
.service-features li { color: var(--text-muted); font-size: 14px; padding: 6px 0; display: flex; align-items: center; gap: 8px; }
.service-features iconify-icon { color: var(--primary); flex-shrink: 0; }

/* ========== 作品展示 ========== */
.portfolio { background: var(--section-alt-bg); }
.portfolio-filters { display: flex; justify-content: center; gap: 12px; margin-bottom: 48px; flex-wrap: wrap; }

.filter-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 28px; font-size: 15px; font-weight: 500;
    border: 2px solid var(--border-input);
    background: var(--bg-card);
    color: var(--text-muted);
    border-radius: 30px; cursor: pointer;
    transition: var(--transition); font-family: inherit;
}
.filter-btn:hover, .filter-btn.active {
    background: var(--gradient-1);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 15px var(--shadow-glow);
}

.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px; }

.portfolio-item {
    border-radius: var(--radius-lg); overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: default;
    border: 1px solid var(--border-subtle);
}
.portfolio-item:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.portfolio-video { cursor: default; }
.portfolio-video-wrap { width: 100%; aspect-ratio: 16/9; position: relative; overflow: hidden; background: #000; }
.bilibili-iframe { width: 100%; height: 100%; border: 0; display: block; }

.portfolio-image { width: 100%; height: 220px; position: relative; overflow: hidden; }
.portfolio-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.portfolio-item:hover .portfolio-image img { transform: scale(1.05); }
.portfolio-category {
    position: absolute; top: 16px; left: 16px;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    color: #fff; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
}
.portfolio-info { padding: 24px; }
.portfolio-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.portfolio-info p { color: var(--text-muted); font-size: 14px; }

/* ========== 联系我们 ========== */
.contact { background: var(--section-alt-bg); }
.contact-bg-image {
    position: absolute; inset: 0;
    z-index: 0; overflow: hidden;
    opacity: 0.05;
}
html[data-theme="light"] .contact-bg-image { opacity: 0.03; }
.contact-bg-image img { width: 100%; height: 100%; object-fit: cover; }
.contact .container { position: relative; z-index: 1; }

.contact-wrapper { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; align-items: start; }

.contact-info { display: flex; flex-direction: column; gap: 28px; }
.contact-item {
    display: flex; gap: 20px; align-items: flex-start;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-subtle);
}
.contact-item:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.contact-icon {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--bg-elevated);
    color: var(--primary);
    flex-shrink: 0;
}
html[data-theme="dark"] .contact-icon { background: rgba(249,115,22,0.08); }
html[data-theme="light"] .contact-icon { background: rgba(59,130,246,0.06); }
.contact-item h4 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.contact-item p { color: var(--text-muted); font-size: 14px; }

.contact-form {
    background: var(--bg-card);
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 14px 20px;
    font-size: 15px;
    border: 2px solid var(--border-input);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit; outline: none;
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px var(--bg-elevated);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* Formspree 状态消息 */
.form-status { margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-size: 14px; text-align: center; }
.form-status.success { background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.form-status.error { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.form-status.loading { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border-card); }

/* ========== 小游戏入口 ========== */
.games-preview { padding: 100px 0; background: var(--section-alt-bg); border-top: 1px solid var(--border-subtle); }
.games-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; max-width: 1000px; margin: 0 auto; }

.game-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 32px; text-align: center;
    text-decoration: none;
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.game-preview-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0); transform-origin: left;
    transition: var(--transition);
}
.game-preview-card:hover::before { transform: scaleX(1); }
.game-preview-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
html[data-theme="dark"] .game-preview-card:hover { border-color: rgba(249,115,22,0.25); }
html[data-theme="light"] .game-preview-card:hover { border-color: rgba(59,130,246,0.2); }

.game-preview-icon {
    width: 72px; height: 72px;
    margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 18px;
    background: var(--bg-elevated);
    color: var(--primary);
}
html[data-theme="dark"] .game-preview-icon { background: rgba(249,115,22,0.08); }
html[data-theme="light"] .game-preview-icon { background: rgba(59,130,246,0.06); }
.game-preview-card h3 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.game-preview-card p { color: var(--text-muted); font-size: 14px; }

/* ========== 页脚 ========== */
.footer { background: var(--footer-bg); padding: 72px 0 24px; border-top: 1px solid var(--border-subtle); position: relative; overflow: hidden; }
.footer-glow {
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    top: -100px; left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(249,115,22,0.06) 0%, transparent 70%);
    pointer-events: none;
}
html[data-theme="light"] .footer-glow { background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 70%); }

.footer-content { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; margin-bottom: 48px; position: relative; z-index: 1; }
.footer-brand h3 {
    font-family: 'Caveat', cursive;
    font-size: 36px; font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 8px;
}
.footer-brand p { color: rgba(255,255,255,0.4); font-size: 15px; }

.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h4 { color: #fff; font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.footer-col a { display: block; color: rgba(255,255,255,0.4); text-decoration: none; font-size: 14px; padding: 6px 0; transition: var(--transition); }
.footer-col a:hover { color: var(--primary-light); transform: translateX(4px); }
html[data-theme="light"] .footer-col a:hover { color: var(--primary-light); }

.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.social-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 500;
    transition: var(--transition); text-decoration: none;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.08);
}
.social-link iconify-icon { flex-shrink: 0; }

/* GitHub */
.social-github { color: #c9d1d9; border-color: rgba(201,209,217,0.3); }
.social-github:hover { background: #24292e; color: #fff; border-color: #24292e; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(36,41,46,0.5); }
/* Bilibili */
.social-bilibili { color: #00a1d6; border-color: rgba(0,161,214,0.3); }
.social-bilibili:hover { background: #00a1d6; color: #fff; border-color: #00a1d6; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,161,214,0.4); }
/* 抖音 */
.social-douyin { color: #fe2c55; border-color: rgba(254,44,85,0.3); }
.social-douyin:hover { background: linear-gradient(135deg,#25f4ee 0%,#fe2c55 100%); color: #fff; border-color: transparent; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(254,44,85,0.4); }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 24px; text-align: center; position: relative; z-index: 1; }
.footer-bottom p { color: rgba(255,255,255,0.3); font-size: 14px; }

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

/* ========== 响应式 ========== */
@media (max-width: 968px) {
    .nav-container { justify-content: flex-start; gap: 8px; }
    .nav-menu { display: none; }
    .nav-logo { order: 1; flex: 1; text-align: center; }
    .nav-actions { order: 2; flex: 0 0 auto; }
    .nav-toggle { order: 0; display: flex !important; }

    .hero-illustration { right: 2%; gap: 8px; }
    .hero-img-1 { width: 120px; height: 120px; }
    .hero-img-2 { width: 90px; height: 90px; margin-left: 30px; }

    .contact-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .footer-content { grid-template-columns: 1fr; }
    .footer-links { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    section { padding: 60px 0; }
    .hero-stats { gap: 24px; margin-top: 48px; }
    .stat-item { min-width: 80px; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .contact-form { padding: 28px; }
    .footer-links { grid-template-columns: 1fr; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .btn { width: 100%; max-width: 280px; }
    .theme-toggle { width: 38px; height: 38px; }
    .hero-illustration { display: none; }
}

/* ====================================================
   MOUSE-FOLLOW EFFECTS — 鼠标跟随动态效果
   ==================================================== */

/* ---------- 全局鼠标 Spotlight ---------- */
.cursor-spotlight {
    position: fixed;
    top: 0; left: 0;
    width: 520px; height: 520px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: transform;
    mix-blend-mode: screen;
}
html[data-theme="dark"] .cursor-spotlight {
    background: radial-gradient(
        circle,
        rgba(249,115,22,0.10) 0%,
        rgba(249,115,22,0.04) 40%,
        transparent 70%
    );
}
html[data-theme="light"] .cursor-spotlight {
    background: radial-gradient(
        circle,
        rgba(59,130,246,0.10) 0%,
        rgba(99,102,241,0.04) 40%,
        transparent 70%
    );
    mix-blend-mode: multiply;
}
/* 鼠标移动时显示 */
body.cursor-active .cursor-spotlight { opacity: 1; }

/* ---------- 卡片光标辉光覆盖层 ---------- */
.card-glow-overlay {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    overflow: hidden;
}
/* 确保卡片内容在辉光之上 */
.about-card > *, .service-card > *, .portfolio-item > *,
.game-preview-card > *, .contact-item > * {
    position: relative;
    z-index: 1;
}
/* portfolio-item 特殊处理：图片区域不受影响 */
.portfolio-item .portfolio-image { z-index: 1; }

/* ---------- 3D 倾斜的过渡控制 ---------- */
.about-card, .service-card, .portfolio-item,
.game-preview-card, .contact-item, .contact-form {
    transition: transform 0.15s ease-out, box-shadow var(--transition), border-color var(--transition);
    transform-style: preserve-3d;
}
/* 鼠标离开时恢复过渡要更慢一些 */
.about-card:not(:hover), .service-card:not(:hover), .portfolio-item:not(:hover),
.game-preview-card:not(:hover), .contact-item:not(:hover), .contact-form:not(:hover) {
    transition: transform 0.5s ease-out, box-shadow var(--transition), border-color var(--transition);
}

/* ---------- 主题色辉光变量 ---------- */
html[data-theme="dark"] {
    --glow-color: rgba(249,115,22,0.10);
}
html[data-theme="light"] {
    --glow-color: rgba(59,130,246,0.08);
}

/* ========== Turnstile 进站验证闸门 ========== */
.turnstile-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.turnstile-gate.passed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
html[data-theme="light"] .turnstile-gate {
    background: rgba(240, 244, 248, 0.92);
}

.gate-box {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 56px 48px 48px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: gateFadeIn 0.5s ease;
}
@keyframes gateFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-logo {
    font-family: 'Caveat', cursive;
    font-size: 42px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.gate-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 28px;
}

.turnstile-widget {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    min-height: 65px;
}

.gate-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.gate-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 16px;
    min-height: 20px;
}

.gate-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.gate-retry:hover {
    border-color: var(--primary);
    color: var(--primary);
}
