/* ===== CSS Variables ===== */
:root {
    --color-primary: #1a365d;
    --color-primary-light: #2c5282;
    --color-accent: #4299e1;
    --color-text: #2d3748;
    --color-text-light: #718096;
    --color-text-muted: #a0aec0;
    --color-bg: #ffffff;
    --color-bg-secondary: #f7fafc;
    --color-border: #e2e8f0;
    
    --font-display: 'Caveat', cursive;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    --max-width: 1200px;
    --header-height: 64px;
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

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

ul {
    list-style: none;
}

/* ===== Navigation Header ===== */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

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

.logo-link {
    display: flex;
    align-items: center;
}

.brand-logo-img {
    height: 96px;
    width: auto;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    padding: var(--spacing-xs) 0;
    position: relative;
    transition: color var(--transition-fast);
}

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

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

.nav-link:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    color: var(--color-text);
    transition: color var(--transition-fast);
}

.search-btn:hover {
    color: var(--color-accent);
}

/* Language Switch Button */
.lang-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.lang-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform var(--transition-fast);
}

/* ===== Hero Section ===== */
.hero {
    margin-top: var(--header-height);
    min-height: 550px;
    background-color: #000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-bottom: var(--spacing-xl);
}

/* Galaxy background container */
.galaxy-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.galaxy-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Hero image - base layer */
.hero-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.hero-background-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Galaxy layer - on top with blend mode to show only stars */
.galaxy-container {
    z-index: 1 !important;
}

.galaxy-container canvas {
    mix-blend-mode: screen;
    opacity: 0.35;
}

/* Hero Logo Container */
.hero-logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeInUp 1.2s ease-out;
}

.hero-avatar-logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 50%;
    margin-bottom: var(--spacing-lg);
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(255, 255, 255, 0.2));
    opacity: 0.55; /* 降低透明度，让背景更可见 */
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.particles-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.hero-content {
    width: 100%;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0;
    z-index: 1;
    pointer-events: none;
}

/* Work Experience Cards */
.work-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    min-width: 220px;
    pointer-events: auto;
}

.work-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.work-card-inner {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.work-logo {
    flex-shrink: 0;
}

.work-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.work-company {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

.work-role {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin: 0;
}

.work-card-left {
    align-self: flex-start;
    margin-left: -20px;
    margin-top: var(--spacing-xs);
}

.work-card-right {
    align-self: flex-start;
    margin-right: -40px;
    margin-top: var(--spacing-xs);
}

.work-card-img-right {
    max-width: 280px;
}

/* Image-based work card */
.work-card-image {
    padding: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
    margin-left: -20px;
}

.work-card-image:hover {
    transform: scale(1.02);
    box-shadow: none;
}

.work-card-img {
    max-width: 380px;
    height: auto;
    border-radius: 0;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
    transition: filter var(--transition-normal);
}

.work-card-image:hover .work-card-img {
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15));
}

/* ===== Main Content ===== */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* ===== About Section ===== */
.about-section {
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.about-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
}

.profile-image-container {
    position: relative;
}

.profile-image {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    justify-content: center;
}

.social-links a {
    color: var(--color-text-light);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.social-links a:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    position: relative;
}

.about-text p {
    margin-bottom: var(--spacing-md);
    font-size: 1rem;
    color: var(--color-text);
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* ===== Flowing CTA Marquee ===== */
.cta-marquee-section {
    background: #ffffff;
    padding: var(--spacing-md) 0;
    overflow: hidden;
    position: relative;
}

.cta-marquee-section::before,
.cta-marquee-section::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.cta-marquee-section::before {
    left: 0;
    background: linear-gradient(to right, #ffffff, transparent);
}

.cta-marquee-section::after {
    right: 0;
    background: linear-gradient(to left, #ffffff, transparent);
}

.cta-marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 40s linear infinite;
}

.cta-marquee-track:hover {
    animation-play-state: paused;
}

.cta-marquee-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    padding-right: var(--spacing-xl);
}

.cta-item {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: color 0.3s ease, transform 0.3s ease;
    cursor: default;
}

.cta-item:hover {
    color: var(--color-accent);
    transform: scale(1.05);
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ===== Education & Research Section ===== */
.education-section {
    background: var(--color-bg);
    padding: 0;
    margin-top: -1rem;
    width: 100%;
}

.education-image-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.education-banner-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-normal);
}

.education-banner-image:hover {
    transform: scale(1.005);
}

.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.edu-title {
    grid-column: 1 / -1;
    margin-bottom: var(--spacing-lg);
}

.education-section .section-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
}

.education-card {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

.university-logo img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
}

.education-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.education-info ul {
    list-style: disc;
    padding-left: var(--spacing-md);
}

.education-info li {
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.research-interests h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.research-interests ul {
    list-style: disc;
    padding-left: var(--spacing-md);
}

.research-interests li {
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

/* ===== Work Experience Section ===== */
.work-experience-section {
    background: var(--color-bg);
    padding: 0;
    width: 100%;
}

.work-experience-image-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.work-experience-banner-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-normal);
}

.work-experience-banner-image:hover {
    transform: scale(1.005);
}

/* ===== Vibe Code CTA Section ===== */
.vibe-code-section {
    background: #ffffff;
    padding: var(--spacing-2xl) var(--spacing-lg);
    min-height: 500px;
    overflow: hidden;
}

.vibe-code-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
    min-height: 450px;
}

.vibe-code-text {
    color: var(--color-text);
}

.vibe-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.vibe-line {
    display: block;
}

.vibe-line.highlight {
    color: var(--color-accent);
    font-size: 4rem;
}

.vibe-subtitle {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
}

.supercar-text {
    color: #e53e3e;
    font-weight: 600;
}

.vibe-description {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 2.2;
    color: var(--color-text);
    margin-bottom: var(--spacing-xl);
    font-weight: 500;
}

/* Rotating Text CTA */
.rotating-text-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
}

.rotating-text-static {
    color: var(--color-primary);
}

.rotating-text-wrapper {
    display: inline-block;
    overflow: hidden;
    height: 2.2rem;
    background: var(--color-accent);
    color: #ffffff;
    padding: 0.2rem 1rem;
    border-radius: 8px;
}

.rotating-text-items {
    display: flex;
    flex-direction: column;
    animation: rotateText 8s ease-in-out infinite;
}

.rotating-text-item {
    display: block;
    height: 2.2rem;
    line-height: 2.2rem;
    white-space: nowrap;
}

@keyframes rotateText {
    0%, 20% {
        transform: translateY(0);
    }
    25%, 45% {
        transform: translateY(-2.2rem);
    }
    50%, 70% {
        transform: translateY(-4.4rem);
    }
    75%, 95% {
        transform: translateY(-6.6rem);
    }
    100% {
        transform: translateY(0);
    }
}

.vibe-code-model {
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vibe-code-model model-viewer {
    width: 100%;
    height: 100%;
    --poster-color: transparent;
}

/* Responsive for Vibe Code Section */
@media (max-width: 900px) {
    .vibe-code-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .vibe-title {
        font-size: 2.5rem;
    }
    
    .vibe-line.highlight {
        font-size: 3rem;
    }
    
    .vibe-code-model {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .vibe-title {
        font-size: 2rem;
    }
    
    .vibe-line.highlight {
        font-size: 2.5rem;
    }
    
    .vibe-subtitle {
        font-size: 1.5rem;
    }
}

/* ===== Footer ===== */
/* ===== Footer with Threads Effect ===== */
.footer {
    position: relative;
    background: #000000;
    border-top: none;
    padding: 0;
    text-align: center;
    min-height: 300px;
    overflow: hidden;
}

.threads-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.threads-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.footer-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.footer-brand {
    margin-bottom: var(--spacing-md);
}

.footer-brand .brand-logo-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    filter: brightness(1.2);
    transition: transform 0.3s ease;
}

.footer-brand .brand-logo-img:hover {
    transform: scale(1.1);
}

.footer-tagline {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.footer-social {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.footer-social a:hover {
    background: rgba(66, 153, 225, 0.3);
    color: #fff;
    transform: translateY(-3px);
    text-decoration: none;
}

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

.footer p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
}

.footer a:hover {
    color: #fff;
    text-decoration: none;
}

/* ===== Responsive Design ===== */
@media (max-width: 900px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .profile-image-container {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .section-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: var(--spacing-md);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero {
        min-height: 350px;
    }
    
    .hero-content {
        flex-direction: row;
        gap: var(--spacing-sm);
        padding: 0 var(--spacing-md);
        bottom: var(--spacing-md);
    }
    
    .work-card {
        min-width: 140px;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .work-company {
        font-size: 0.9rem;
    }
    
    .work-role {
        font-size: 0.75rem;
    }
    
    .education-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .education-info ul,
    .research-interests ul {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 0.9rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .about-section,
    .education-section,
    .publications-section {
        padding: var(--spacing-xl) var(--spacing-sm);
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-section,
.education-section,
.publications-section {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== Print Styles ===== */
@media print {
    .nav-header,
    .search-btn,
    .social-links {
        display: none;
    }
    
    .hero {
        margin-top: 0;
        min-height: 200px;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    body {
        font-size: 12pt;
    }
}

/* ===== Portfolio Section ===== */
.portfolio-section {
    padding: var(--spacing-2xl) var(--spacing-lg);
    padding-right: calc(var(--spacing-lg) + 120px);
    background: #fff;
    min-height: 650px;
    overflow: visible;
    position: relative;
    z-index: 5; /* 确保不被其他元素遮挡 */
}

.portfolio-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.portfolio-text {
    padding-right: var(--spacing-xl);
}

.portfolio-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.portfolio-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), #ff6b6b);
    border-radius: 2px;
}

.portfolio-description {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.highlight-travel {
    color: #3b82f6;
    font-weight: 600;
}

.highlight-gym {
    color: #ef4444;
    font-weight: 600;
}

.portfolio-cta {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Card Swap Container */
.portfolio-cards {
    position: relative;
    height: 580px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 20px;
}

.card-swap-container {
    position: relative;
    width: 480px;
    height: 520px;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.swap-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 420px;
    height: 510px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: box-shadow 0.3s ease;
}

.swap-card:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.swap-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

/* Responsive Portfolio */
@media (max-width: 900px) {
    .portfolio-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .portfolio-text {
        padding-right: 0;
        text-align: center;
    }
    
    .portfolio-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .portfolio-cards {
        height: 400px;
    }
    
    .card-swap-container {
        transform: scale(0.85);
    }
}

@media (max-width: 900px) {
    .portfolio-section {
        padding-right: var(--spacing-lg); /* 移动端移除额外的右侧 padding */
    }
    
    .portfolio-cta {
        margin-bottom: var(--spacing-lg); /* 中等屏幕增加底部间距 */
    }
}

@media (max-width: 480px) {
    .portfolio-section {
        padding: var(--spacing-xl) var(--spacing-sm);
        padding-right: var(--spacing-sm); /* 小屏幕进一步减小 */
    }
    
    .portfolio-title {
        font-size: 2rem;
    }
    
    .portfolio-description {
        font-size: 1.1rem;
    }
    
    .portfolio-cta {
        margin-bottom: var(--spacing-xl); /* 移动端增加底部间距，避免被卡片遮挡 */
    }
    
    .card-swap-container {
        transform: scale(0.7);
    }
    
    .portfolio-cards {
        height: 320px;
    }
}

/* ===== Goodbye Section ===== */
.goodbye-section {
    background: #fff;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.goodbye-container {
    width: 100%;
    height: 400px;
    position: relative;
}

.goodbye-container canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -o-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.goodbye-container pre {
    margin: 0;
    user-select: none;
    padding: 0;
    line-height: 1em;
    text-align: left;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    /* 黑色渐变系 */
    background-image: linear-gradient(135deg, #000000 0%, #1a1a1a 25%, #333333 50%, #1a1a1a 75%, #000000 100%);
    background-attachment: fixed;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    z-index: 1; /* 降低 z-index 避免遮挡其他内容 */
}

@media (max-width: 768px) {
    .goodbye-section {
        min-height: 300px;
    }
    
    .goodbye-container {
        height: 300px;
    }
}

/* ===== Language Switcher ===== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 12px;
    padding: 4px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: 24px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    position: relative;
    overflow: hidden;
}

.lang-switcher::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, transparent 100%);
    pointer-events: none;
}

.lang-toggle {
    background: none;
    border: none;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    letter-spacing: 0.02em;
}

.lang-toggle:hover {
    color: var(--color-accent);
    transform: scale(1.05);
}

.lang-toggle.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.lang-toggle.active:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.lang-divider {
    display: none;
}

@media (max-width: 768px) {
    .lang-switcher {
        margin-left: 0;
        margin-top: 16px;
    }
}

/* ===== Chinese Font for Titles ===== */
html[lang="zh-CN"] .section-title,
html[lang="zh-CN"] .page-title,
html[lang="zh-CN"] .vibe-title,
html[lang="zh-CN"] .portfolio-title,
html[lang="zh-CN"] .cv-section-title,
html[lang="zh-CN"] .section-heading,
html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2 {
    font-family: 'ZCOOL KuaiLe', 'Long Cang', 'Caveat', cursive !important;
}

html[lang="zh-CN"] .cta-item {
    font-family: 'ZCOOL KuaiLe', 'Long Cang', 'Caveat', cursive !important;
}

html[lang="zh-CN"] .vibe-subtitle,
html[lang="zh-CN"] .vibe-description,
html[lang="zh-CN"] .portfolio-description,
html[lang="zh-CN"] .portfolio-cta {
    font-family: 'ZCOOL KuaiLe', 'Long Cang', 'Caveat', cursive !important;
}

html[lang="zh-CN"] .rotating-text-container {
    font-family: 'ZCOOL KuaiLe', 'Long Cang', 'Caveat', cursive !important;
}

html[lang="zh-CN"] .vibe-line {
    font-family: 'ZCOOL KuaiLe', 'Long Cang', 'Caveat', cursive !important;
}

