/* 本地字体定义 */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/SpaceGrotesk-Variable.woff2') format('woff2');
}

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

:root {
    --white: #ffffff;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --black: #0a0a0a;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000000;
    color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Realistic Space Background */
.space-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #000000;
    /* Pure black deep space */
}

/* Milky Way Effect - Hidden for dark aesthetic */
.milky-way {
    display: none;
}

/* Three.js Canvas */
#space-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Subtle Stars */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: white;
    /* Default white */
}

/* Minimalist star colors - mostly whites and weak blues */
.star.blue {
    background: rgba(200, 220, 255, 0.8);
    box-shadow: 0 0 2px 0 rgba(200, 220, 255, 0.2);
}

.star.white {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 2px 0 rgba(255, 255, 255, 0.2);
}

.star.yellow {
    background: rgba(255, 250, 220, 0.8);
}

.star.orange {
    background: rgba(255, 240, 220, 0.7);
}

.star.red {
    background: rgba(255, 230, 230, 0.6);
}

/* Particles - make extremely subtle */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    opacity: 0.3;
    /* Fade out particles */
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Hide extra flashy elements */
.nebula,
.galaxy {
    display: none;
}


/* Content */
.content {
    position: relative;
    z-index: 10;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.hero-content {
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.greeting {
    font-size: 0.875rem;
    color: var(--gray-500);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.name {
    font-size: clamp(3rem, 15vw, 10rem);
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.125rem;
    color: var(--gray-400);
    font-weight: 300;
    margin-bottom: 3rem;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--gray-800);
    border-radius: 50%;
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--gray-500);
    color: var(--white);
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gray-600);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--gray-600), transparent);
    margin: 1rem auto 0;
}

/* About Section - New Design */
.about-section {
    padding: 6rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: start;
}

.about-left,
.about-right {
    display: flex;
    flex-direction: column;
}

.section-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    color: var(--white);
    margin-bottom: 2rem;
}

/* About Card */
.about-card {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--black) 100%);
    border: 1px solid var(--gray-800);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.about-card:hover {
    border-color: var(--gray-700);
    transform: translateY(-2px);
}

.about-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--gray-700);
}

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

.about-info {
    flex: 1;
}

.about-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.about-role {
    font-size: 0.9rem;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
}

.about-bio {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.about-stats {
    display: flex;
    gap: 1.5rem;
}

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

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    display: block;
}

/* Skills Container */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-category {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-color: var(--gray-700);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.category-title svg {
    fill: var(--gray-500);
}

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

.skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--gray-800);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gray-300);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-tag::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--tag-color, var(--gray-500));
    border-radius: 3px 0 0 3px;
}

.skill-tag:hover {
    border-color: var(--tag-color, var(--gray-500));
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    transform: translateY(-1px);
}

@media (max-width: 1024px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-section {
        padding: 4rem 1.5rem;
    }
}

@media (max-width: 600px) {
    .about-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .about-stats {
        justify-content: center;
    }
}

/* Footer */
.footer {
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid var(--gray-800);
}

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

/* Responsive */
@media (max-width: 768px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .social-links {
        gap: 1rem;
    }

    .social-link {
        width: 44px;
        height: 44px;
    }
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.9), transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav.scrolled {
    background: rgba(10, 10, 10, 0.95);
    padding: 1rem 3rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-logo span {
    color: var(--gray-500);
    font-weight: 400;
}

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

.nav-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--white);
    transition: width 0.3s ease;
}

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

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

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--gray-400);
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .nav {
        padding: 1rem 1.5rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--gray-900);
        flex-direction: column;
        padding: 5rem 2rem;
        gap: 2rem;
        transition: right 0.3s ease;
    }

    .nav-links.active {
        right: 0;
    }

    .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);
    }
}


/* Loading */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--gray-800);
    border-top-color: var(--gray-400);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* GitHub Projects Section */
.projects-section {
    padding: 6rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.loading-repos {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--gray-500);
}

.repo-card {
    background: var(--gray-900);
    border: 1px solid var(--gray-800);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: left;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.repo-card:hover {
    border-color: var(--gray-600);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

.repo-icon {
    width: 18px;
    height: 18px;
    fill: var(--gray-400);
    flex-shrink: 0;
}

.repo-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-description {
    font-size: 0.875rem;
    color: var(--gray-400);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.625rem;
}

.repo-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-800);
}

.repo-language {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--gray-400);
}

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

.repo-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.repo-stat svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .projects-section {
        padding: 4rem 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}
