:root {
    --primary-color: #0f172a;
    --text-color: #334155;
    --text-light: #64748b;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.7);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --transition-speed: 0.8s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* --- 背景渐变光球 --- */
.glow-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-color);
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.3);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: rgba(147, 51, 234, 0.2);
    bottom: 10vh;
    right: -100px;
    animation-delay: -5s;
}

.glow-3 {
    width: 300px;
    height: 300px;
    background: rgba(16, 185, 129, 0.2);
    top: 40vh;
    left: 20vw;
    animation-delay: -10s;
}

.glow-4 {
    width: 600px;
    height: 600px;
    background: rgba(236, 72, 153, 0.15);
    top: -200px;
    right: 20vw;
    animation-delay: -15s;
}

@keyframes float {
    0% { transform: translate(var(--parallax-x, 0), var(--parallax-y, 0)) scale(var(--parallax-scale, 1)); }
    50% { transform: translate(calc(var(--parallax-x, 0) + 30px), calc(var(--parallax-y, 0) + 50px)) scale(calc(var(--parallax-scale, 1) * 1.1)); }
    100% { transform: translate(calc(var(--parallax-x, 0) - 30px), calc(var(--parallax-y, 0) - 20px)) scale(calc(var(--parallax-scale, 1) * 0.9)); }
}

/* --- 导航栏 (悬浮药丸样式) --- */
.navbar {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1000px;
    padding: 0.6rem 2rem;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.01); /* 降低透明度让背景光球更明显 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* 不再使用 max-width 限制，让它们靠边缘，但保留原本外层的 padding 作为安全距离 */
}

.github-profile {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.8rem;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.1) rotate(5deg);
}

.mobile-nav-title {
    display: none;
    font-weight: 700;
    color: var(--primary-color);
    font-family: "Playfair Display", serif;
    font-size: 1.2rem;
    font-style: italic;
}

/* Navbar 滚动状态 (替代原有 JS 内联样式) */
.navbar.scrolled {
    padding: 0.5rem 2rem;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* --- 基础布局 --- */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.section {
    padding: 10rem 0 6rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-header {
    margin-bottom: 5rem;
}

.section-header.center {
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 3rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: -1px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-top: 1rem;
}

h1, h2, h3, h4 {
    color: var(--primary-color);
}

/* --- 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.primary-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.outline-btn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.outline-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Hero --- */
.hero {
    text-align: center;
    position: relative;
    height: 100vh;
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    transform: translateY(-5vh);
}

.artistic-font {
    font-family: "Playfair Display", serif;
    font-optical-sizing: auto;
    font-style: italic;
}

.hero .title {
    font-size: 7rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #0f172a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .subtitle {
    font-size: 1.3rem;
    color: var(--text-light);
    max-width: 650px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.8;
}

.scroll-indicator {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
    animation: bounce 2s infinite;
    z-index: 10;
}

.scroll-indicator span {
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    letter-spacing: 3px;
}

.arrow {
    width: 2px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--primary-color));
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-15px) translateX(-50%); }
    60% { transform: translateY(-7px) translateX(-50%); }
}

/* --- 项目展示 (大横屏) --- */
.project-card {
    display: flex;
    align-items: center;
    gap: 5rem;
    margin-bottom: 10rem;
}

.project-card.reverse {
    flex-direction: row-reverse;
}

.project-image-wrapper {
    flex: 1.2;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    background: white;
}

.project-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.03);
}

.project-info {
    flex: 1;
}

.project-header {
    margin-bottom: 1.5rem;
}

.tag {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.project-info h3 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.project-info p {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

/* --- MChat (1:1 应用图标) --- */
.mchat-card {
    gap: 6rem;
}

.app-icon-wrapper {
    flex: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.app-bg-glow {
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
    z-index: 1;
}

.app-icon {
    width: 250px;
    height: 250px;
    border-radius: 50px; /* 圆角矩形，类似iOS图标 */
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.03);
    position: relative;
    z-index: 2;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mchat-card:hover .app-icon {
    transform: translateY(-10px) scale(1.02);
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-info {
    flex: 1.2;
}

/* --- 占位符 --- */
.placeholder {
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: #f1f5f9;
    display: none;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1rem;
    text-align: center;
}

.placeholder.app-placeholder {
    min-height: 100%;
}

.placeholder.portrait {
    min-height: 100%;
}

/* --- 游戏合集 (扇形卡片) --- */
.glass-section {
    position: relative;
    overflow-x: hidden;
}

.fan-cards-container {
    position: relative;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    margin-top: 2rem;
}

.fan-card {
    position: absolute;
    width: 320px;
    height: 480px;
    border-radius: 24px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: bottom center;
    cursor: pointer;
    outline: none;
    overflow: hidden;
}

/* 扇形分布默认状态 */
.fan-card.card-1 { transform: translateX(-40%) rotate(-8deg) translateY(20px); z-index: 1; }
.fan-card.card-2 { transform: translateX(0) rotate(0deg) translateY(0); z-index: 3; }
.fan-card.card-3 { transform: translateX(40%) rotate(8deg) translateY(20px); z-index: 2; }

/* 悬浮展开效果 */
.fan-cards-container:hover .fan-card.card-1 { transform: translateX(-60%) rotate(-15deg) translateY(30px); }
.fan-cards-container:hover .fan-card.card-2 { transform: translateX(0) translateY(-20px); box-shadow: 0 30px 60px rgba(0,0,0,0.15); }
.fan-cards-container:hover .fan-card.card-3 { transform: translateX(60%) rotate(15deg) translateY(30px); }

/* 活动状态 (JS控制轮播时的状态) */
.fan-card.active {
    transform: translateX(0) rotate(0deg) translateY(-20px) !important;
    z-index: 10 !important;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}

.fan-card.prev-card {
    transform: translateX(-50%) rotate(-10deg) translateY(20px) !important;
    z-index: 5 !important;
}

.fan-card.next-card {
    transform: translateX(50%) rotate(10deg) translateY(20px) !important;
    z-index: 5 !important;
}

.card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-img-wrapper {
    height: 60%;
    width: 100%;
    overflow: hidden;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.fan-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-content {
    height: 40%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background: white;
}

.card-content h4 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.card-content p {
    font-size: 0.95rem;
    color: var(--text-light);
    flex-grow: 1;
}

.play-btn {
    align-self: flex-start;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    transition: gap 0.3s;
    gap: 5px;
}

.play-btn::after {
    content: '→';
    font-size: 1.2rem;
}

.play-btn:hover {
    gap: 10px;
}

.fan-controls {
    position: absolute;
    bottom: -40px;
    display: flex;
    gap: 1rem;
    z-index: 20;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: all 0.2s;
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* --- Footer --- */
.footer {
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9) 20%, white);
    padding: 6rem 0 2rem;
    margin-top: 5rem;
    border-top: 1px solid rgba(255,255,255,0.5);
    position: relative;
    z-index: 5;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4rem;
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.footer-brand {
    flex: 1;
    min-width: 300px;
}

.footer-logo {
    font-family: "Playfair Display", serif;
    font-size: 2.5rem;
    font-weight: 800;
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-slogan {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.8;
}

.footer-nav {
    display: flex;
    gap: 5rem;
    flex-wrap: wrap;
}

.footer-column h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.footer-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-column a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.footer-column a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.95rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.back-to-top a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s;
}

.back-to-top a:hover {
    opacity: 0.7;
}

/* --- 滚动动画类 --- */
.scroll-element {
    opacity: 0;
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: opacity, transform;
}

.scroll-element.fade-up { transform: translateY(60px); }
.scroll-element.slide-in-left { transform: translateX(-80px); }
.scroll-element.slide-in-right { transform: translateX(80px); }
.scroll-element.scale-up { transform: scale(0.85); }

.scroll-element.is-visible {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* --- Lenis 平滑滚动修正 --- */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* --- 响应式 --- */
@media (max-width: 960px) {
    .project-card, .project-card.reverse {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }
    
    .btn-group {
        justify-content: center;
    }

    .project-header {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .app-icon {
        width: 200px;
        height: 200px;
    }

    .fan-cards-container {
        height: 500px;
    }
    
    .fan-card {
        width: 280px;
        height: 420px;
    }

    /* 手机端禁用复杂的Hover扇形展开，直接堆叠或依赖点击/按钮切换 */
    .fan-cards-container:hover .fan-card {
        transform: inherit;
    }
    
    .fan-card.card-1 { transform: translateX(-20px) rotate(-5deg) translateY(10px); }
    .fan-card.card-3 { transform: translateX(20px) rotate(5deg) translateY(10px); }
}

@media (max-width: 600px) {
    .footer-top {
        flex-direction: column;
        gap: 3rem;
    }
    
    .footer-nav {
        gap: 3rem;
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .hero .title { font-size: 3.5rem; }
    .section-title { font-size: 2.2rem; }
    
    .navbar {
        top: 1rem;
        width: max-content;
        padding: 0.5rem 1rem;
        border-radius: 50px;
    }
    
    /* 覆盖 scrolled 状态下的 padding 以适应移动端 */
    .navbar.scrolled {
        padding: 0.5rem 1rem;
    }

    .nav-content {
        justify-content: center;
        width: auto;
    }

    .nav-links { display: none; /* 移动端可以考虑隐藏或做汉堡菜单 */ }

    .mobile-nav-title {
        display: block; /* 在移动端显示标题 */
    }
    
    .avatar {
        width: 40px;
        height: 40px;
    }
    
    .fan-cards-container {
        height: 450px;
    }

    .fan-card {
        width: 220px;
        height: 380px;
    }

    .card-content {
        padding: 1.2rem 1rem;
    }

    .card-content h4 {
        font-size: 1.2rem;
    }

    .card-content p {
        font-size: 0.85rem;
    }
    
    .fan-card.card-1 { transform: translateX(-10px) rotate(-3deg); }
    .fan-card.card-3 { transform: translateX(10px) rotate(3deg); }
}
