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

:root {
    --primary-color: #ffffff;
    --secondary-color: #ffffff;
    --accent-color: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #000000;
    --border-color: rgba(255, 255, 255, 0.4);
    --shadow-color: rgba(255, 255, 255, 0.2);
    --gradient-primary: linear-gradient(135deg, #ffffff, #000000);
    --gradient-secondary: linear-gradient(135deg, #ffffff, #000000);
    --font-primary: 'Space Grotesk', sans-serif;
    --font-display: 'Orbitron', sans-serif;
}

body {
    font-family: var(--font-primary);
    background: #050505; /* Fallback */
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    font-weight: 300;
}

/* ===== 宇宙背景 ===== */
#canvas-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-primary);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 导航栏 ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0.3rem;
    max-width: 93%;
    margin: 0 auto;
}

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

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-symbol {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 4px;
    color: var(--text-primary);
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 0.5rem;
    z-index: 1001;
    transition: all 0.3s ease;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 1px;
}

/* 汉堡按钮动画效果 */
.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(7px, -6px);
}

/* ===== 英雄区域 ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

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

.hero-content {
    max-width: 500px;
}

.hero-badge {
    display: inline-block;
    background: transparent;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 400;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-title {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: 10px;
}

.title-word {
    display: block;
    animation: titleReveal 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.title-word:nth-child(1) {
    animation-delay: 0.2s;
}

.title-word:nth-child(2) {
    animation-delay: 0.4s;
}

.title-word:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes titleReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
    line-height: 1.6;
    letter-spacing: 2px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== 按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 15px 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    border-radius: 0; /* Boxy sci-fi look from snippet (snippet didn't specify radius but implied void style usually is sharp, snippet had no radius) - actually snippet default is 0 for buttons usually unless user agent. Snippet didn't have border-radius. */
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    /* Inherits base btn styles which now match the requirement */
} 

.btn-primary:hover {
    /* Inherits base hover */
}

.btn-secondary {
    /* Inherits base btn styles */
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    border-color: #ffffff;
}

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

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

.btn-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

/* ===== 宇宙球体 ===== */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== Quantum Singularity Orb ===== */
.quantum-singularity {
    position: relative;
    width: 380px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 1000px;
    transform: rotateX(60deg) rotateZ(-20deg);
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 70%);
    border-radius: 50%;
    z-index: 10;
}

/* Accretion Disk */
.accretion-disk {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: diskSpin 20s linear infinite;
}

.disk-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.ring-1 {
    width: 360px;
    height: 360px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
    filter: blur(0.5px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.ring-2 {
    width: 280px;
    height: 280px;
    border: 8px solid rgba(255, 255, 255, 0.05);
    border-left: 8px solid rgba(255, 255, 255, 0.3);
    border-right: 8px solid rgba(255, 255, 255, 0.3);
    filter: blur(4px);
    animation: pulseRing 6s ease-in-out infinite alternate;
}

.ring-3 {
    width: 200px;
    height: 200px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    animation: spinReverse 20s linear infinite;
}

@keyframes diskSpin {
    0% {
        transform: rotateZ(0deg);
    }

    100% {
        transform: rotateZ(360deg);
    }
}

@keyframes spinReverse {
    0% {
        transform: translate(-50%, -50%) rotateZ(360deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateZ(0deg);
    }
}

@keyframes pulseRing {
    0% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Event Horizon */
.event-horizon {
    position: absolute;
    width: 80px;
    height: 80px;
    transform-style: preserve-3d;
    transform: rotateX(-60deg);
    /* Counteract container rotation to face viewer */
    z-index: 10;
}

.singularity-core {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 50%;
    box-shadow:
        0 0 20px #000,
        0 0 40px rgba(255, 255, 255, 0.1),
        0 0 80px rgba(255, 255, 255, 0.1);
}

.photon-ring {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 15px #fff, 0 0 30px rgba(255, 255, 255, 0.3);
    opacity: 0.9;
    animation: photonPulse 3s ease-in-out infinite;
}

@keyframes photonPulse {

    100% {
        box-shadow: 0 0 15px #fff, 0 0 30px rgba(255, 255, 255, 0.3);
        opacity: 0.9;
    }

    50% {
        box-shadow: 0 0 20px #fff, 0 0 40px rgba(255, 255, 255, 0.5);
        opacity: 1;
    }
}

/* Energy Jets */
.energy-jets {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    pointer-events: none;
}

.jet {
    position: absolute;
    left: 50%;
    width: 4px;
    height: 150px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
    filter: blur(2px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transform-origin: bottom center;
}

.jet-top {
    bottom: 50%;
    transform: translateX(-50%) rotateX(-90deg);
    background: linear-gradient(to top, rgba(255, 255, 255, 0.9), transparent);
}

.jet-bottom {
    top: 50%;
    transform: translateX(-50%) rotateX(90deg);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), transparent);
}

/* 3D Particles */
.particles-3d {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: particleCloudSpin 30s linear infinite;
}

.p3d {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px #fff;
}

.p1 {
    top: 20%;
    left: 20%;
    transform: translateZ(50px);
}

.p2 {
    top: 80%;
    left: 80%;
    transform: translateZ(-50px);
}

.p3 {
    top: 20%;
    left: 80%;
    transform: translateZ(20px);
}

.p4 {
    top: 80%;
    left: 20%;
    transform: translateZ(-20px);
}

@keyframes particleCloudSpin {
    0% {
        transform: rotateZ(0deg);
    }

    100% {
        transform: rotateZ(360deg);
    }
}

/* ===== 通用容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== 章节样式 ===== */
section {
    padding: 6rem 0;
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    position: relative;
}

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

/* ===== 关于区域 ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-paragraph {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(255, 255, 255, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.stat-card:nth-child(1) .stat-icon {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.stat-card:nth-child(2) .stat-icon {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.stat-card:nth-child(3) .stat-icon {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ===== 项目区域 ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.project-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.project-orb {
    width: 60px;
    height: 60px;
    background: #000000;
    border: 1px solid #ffffff;
    border-radius: 50%;
    animation: projectPulse 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

@keyframes projectPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff; /* Explicitly white */
    margin-bottom: 0.5rem;
    text-align: center;
}

.more-projects {
    text-align: center;
    margin-top: 2rem;
}

/* ===== 联系区域 ===== */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.contact-card:hover::before {
    left: 100%;
}

.contact-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

/* 去除链接下划线并继承文字颜色 */
.contact-card.contact-card--glow {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 隐隐约约发亮的效果 */
.contact-card--glow {
    box-shadow: 0 0 0 rgba(0, 212, 255, 0);
}

.contact-card--glow::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 12px;
    pointer-events: none;
    background: radial-gradient(120px 60px at 20% 10%, rgba(0, 212, 255, 0.12), transparent 60%),
        radial-gradient(160px 80px at 80% 120%, rgba(255, 107, 107, 0.08), transparent 60%);
    filter: blur(6px);
    opacity: 0.6;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

@keyframes softPulseGlow {

    0%,
    100% {
        box-shadow: 0 0 18px rgba(0, 212, 255, 0.10), 0 0 36px rgba(0, 212, 255, 0.06);
    }

    50% {
        box-shadow: 0 0 26px rgba(0, 212, 255, 0.16), 0 0 52px rgba(0, 212, 255, 0.10);
    }
}

.contact-card--glow {
    animation: softPulseGlow 3.2s ease-in-out infinite;
}

.contact-card--glow:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 0 28px rgba(0, 212, 255, 0.18), 0 0 60px rgba(0, 212, 255, 0.12);
}

.contact-card--glow:hover::after {
    opacity: 0.9;
    filter: blur(8px);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-info h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.contact-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== 页脚 ===== */
.footer {
    background: rgba(10, 10, 10, 0.8);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    position: relative;
    z-index: 2;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    /* 移动端菜单展开样式 */
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 1rem 0;
        gap: 0;
        animation: slideDown 0.3s ease-out;
    }

    .nav-links.open .nav-link {
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
        font-size: 1.1rem;
    }

    .nav-links.open .nav-link:last-child {
        border-bottom: none;
    }

    .nav-links.open .nav-link:hover {
        background: rgba(0, 212, 255, 0.1);
        color: var(--primary-color);
    }

    .nav-toggle {
        display: flex;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .cosmic-orb {
        width: 200px;
        height: 200px;
    }

    .orb-core {
        width: 80px;
        height: 80px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    .contact-cards {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 2rem;
    }
}