﻿/* ===== CSS Variables - 墨绿色 ===== */
:root {
    --bg-primary: #FAF5EF;
    --bg-secondary: #F5EFE6;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FDF9F4;
    --text-primary: #2D2D2D;
    --text-secondary: #5A5A5A;
    --text-muted: #8A8A8A;
    --accent: #2E5A30;
    --accent-hover: #3A7040;
    --accent-glow: rgba(46, 90, 48, 0.1);
    --gold: #B8860B;
    --border: rgba(46, 90, 48, 0.1);
    --border-light: rgba(46, 90, 48, 0.18);
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1100px;
    --nav-height: 60px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ===== Navbar - 毛玻璃 ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height);
    background: rgba(10, 26, 13, 0.25);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    z-index: 1000;
}
.nav-container {
    max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
    height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-size: 1.2rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
    color: rgba(255,255,255,0.65); text-decoration: none; font-size: 0.88rem;
    font-weight: 500; padding: 6px 16px; border-radius: 8px;
    transition: all var(--transition);
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.12); }
.lang-switch {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.85); font-size: 0.78rem; font-weight: 600;
    padding: 4px 10px; border-radius: 6px; cursor: pointer;
    transition: all var(--transition); margin-left: 8px;
    white-space: nowrap;
}
.lang-switch:hover {
    background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.35);
    color: #fff;
}
.hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 8px;
}
.hamburger span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }


/* ===== Polka Dot Background ===== */
.polka-bg {
    background-color: #FDFAF5;
    background-image: radial-gradient(circle, rgba(46,90,48,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ===== Homepage Hero stays dark ===== */

/* ===== Hero Parallax Damping ===== */
.hero {
    height: 100vh; position: sticky; top: 0; z-index: 1; overflow: hidden;
    transition: transform 0.1s ease-out, opacity 0.3s ease;
}
.hero-bg-media {
    position: absolute; inset: -10vh 0 -10vh 0; z-index: 0;
    background: linear-gradient(135deg, #0a1a0d 0%, #0f2414 40%, #162d1c 100%);
    background-size: cover; background-position: center;
    will-change: transform;
}
.hero-bg-media video { width: 100%; height: calc(100% + 20vh); object-fit: cover; }
.hero-bg-media img { width: 100%; height: calc(100% + 20vh); object-fit: cover; }
.hero-overlay {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(10,26,13,0.5) 80%);
    z-index: 1; pointer-events: none;
}
.hero-content {
    position: relative; z-index: 2; text-align: center; max-width: 800px;
    padding: 0 24px; top: 45%; transform: translateY(-50%);
    will-change: transform, opacity;
}
.scroll-indicator {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.5); font-size: 0.8rem; z-index: 2;
    transition: opacity 0.3s ease; will-change: opacity;
}
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }


/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px;
    border-radius: 50px; font-size: 1rem; font-weight: 600; text-decoration: none;
    transition: all var(--transition); cursor: pointer; border: 2px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(46,90,48,0.25); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: rgba(76,175,80,0.1); transform: translateY(-2px); }

/* ===== Sections ===== */
section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-tag { font-size: 0.85rem; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; }
.section-line { width: 48px; height: 3px; background: var(--accent); border-radius: 2px; margin: 16px auto 0; }
/* ===== Full-screen Sections ===== */
.section-full {
    min-height: 100vh; display: flex; align-items: center;
    padding: 80px 0;
}

/* ===== About ===== */
.about { background: var(--bg-secondary); position: relative; z-index: 2; }
.about.polka-bg { background-color: #FDFAF5; background-image: radial-gradient(circle, rgba(46,90,48,0.06) 1px, transparent 1px); background-size: 24px 24px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-avatar {
    width: 200px; height: 200px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #1b5e20);
    display: flex; align-items: center; justify-content: center; margin: 0 auto;
    font-size: 5rem; color: #fff; box-shadow: 0 0 60px rgba(76,175,80,0.2);
}
.about-text h3 { font-size: 1.4rem; margin-bottom: 16px; color: var(--accent); }
.about-text p { color: var(--text-secondary); margin-bottom: 12px; font-size: 1rem; line-height: 1.8; }
.about-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.meta-item {
    display: flex; align-items: center; gap: 8px; padding: 10px 18px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.9rem; color: var(--text-secondary);
}
.meta-item svg { color: var(--accent); flex-shrink: 0; }

/* ===== News ===== */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.news-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px;
    transition: all var(--transition); position: relative; overflow: hidden;
}
.news-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--accent); border-radius: 0 2px 2px 0;
}
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-light); }
.news-date { font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.news-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.news-excerpt { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ===== Portfolio / Projects ===== */
.portfolio { background: var(--bg-secondary); }
.port-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 48px; flex-wrap: wrap; }
.port-tab {
    padding: 10px 24px; border-radius: 50px; border: 1px solid var(--border);
    background: transparent; color: var(--text-secondary); cursor: pointer;
    font-size: 0.9rem; font-weight: 500; transition: all var(--transition);
}
.port-tab:hover, .port-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
a.port-card, .port-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: all var(--transition);
}
a.port-card:hover, .port-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-light); }
.port-image {
    height: 200px; display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: rgba(46,90,48,0.2); position: relative; overflow: hidden;
}
.port-image.arch { background: linear-gradient(135deg, #e8ecd5, #d5dcc0); }
.port-image.code { background: linear-gradient(135deg, #e0e8f0, #d0d8e4); }
.port-body { padding: 24px; min-height: 120px; display: flex; flex-direction: column; }
.port-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.port-body p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; flex: 1; }
.port-body h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.port-body p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; line-height: 1.6; }
.port-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.port-tag { padding: 4px 12px; background: rgba(46,90,48,0.08); border-radius: 6px; font-size: 0.78rem; color: var(--accent); }
.port-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 500;
    transition: opacity var(--transition); padding: 4px 0;
}
.port-link:hover { opacity: 0.65; }

/* ===== Medals ===== */
.medal-showcase { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px; }
.medal-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px 16px; text-align: center;
    transition: all var(--transition);
}
.medal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.medal-icon { font-size: 3rem; margin-bottom: 12px; }
.medal-card.gold .medal-icon { filter: drop-shadow(0 0 12px rgba(255,215,0,0.4)); }
.medal-photo {
    width: 100%; aspect-ratio: 1;
    border-radius: var(--radius); overflow: hidden;
    margin-bottom: 12px; background: var(--border);
}
.medal-photo img { width: 100%; height: 100%; object-fit: cover; }
.medal-card.silver .medal-icon { filter: drop-shadow(0 0 12px rgba(192,192,192,0.3)); }
.medal-card.bronze .medal-icon { filter: drop-shadow(0 0 12px rgba(205,127,50,0.3)); }
.medal-name { font-weight: 700; margin-bottom: 4px; font-size: 1rem; }
.medal-event { color: var(--text-secondary); font-size: 0.8rem; margin-bottom: 4px; }
.medal-year { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.gold .medal-name { color: var(--gold); }
.silver .medal-name { color: #c0c0c0; }
.bronze .medal-name { color: #cd7f32; }

/* ===== Gallery ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.gallery-item {
    border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3;
    background: var(--bg-card); position: relative;
    border: 1px solid var(--border);
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
}
.gallery-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.9rem;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
}

/* ===== Contact ===== */
.contact { background: var(--bg-secondary); }
.contact-intro { text-align: center; color: var(--text-secondary); max-width: 520px; margin: 0 auto 40px; font-size: 1.02rem; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }
.contact-link {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 14px 24px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary); text-decoration: none;
    font-weight: 500; transition: all var(--transition);
}
.contact-link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }

/* ===== Footer ===== */
.footer { padding: 40px 0; border-top: 1px solid rgba(46,90,48,0.08); text-align: center; color: var(--text-muted); font-size: 0.88rem; background: var(--bg-primary); }
.footer-domain { margin-top: 4px; font-size: 0.82rem; opacity: 0.5; }

/* ===== Scroll Reveal ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }


/* ===== Gallery Carousel ===== */
.proj-gallery-carousel {
    position: relative; margin-bottom: 16px;
    border-radius: var(--radius); overflow: hidden;
    background: var(--border-cream, #e8ddd0);
}
.proj-gallery-carousel .carousel-view {
    width: 100%; aspect-ratio: 16/10;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.proj-gallery-carousel .carousel-view img {
    width: 100%; height: 100%; object-fit: cover;
    transition: opacity 0.3s ease;
}
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.85); border: 1px solid rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 5; transition: all var(--transition);
    color: var(--text-dark, #1a1a1a);
}
.carousel-btn:hover { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-counter {
    position: absolute; bottom: 12px; right: 16px;
    background: rgba(0,0,0,0.5); color: #fff;
    padding: 2px 10px; border-radius: 12px;
    font-size: 0.78rem; font-weight: 500;
}
.carousel-thumbs {
    display: flex; gap: 8px; padding: 12px 0; overflow-x: auto;
    scroll-behavior: smooth;
}
.carousel-thumbs::-webkit-scrollbar { height: 4px; }
.carousel-thumbs::-webkit-scrollbar-thumb { background: rgba(46,90,48,0.2); border-radius: 2px; }
.carousel-thumb {
    flex-shrink: 0; width: 80px; height: 60px;
    border-radius: 6px; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; transition: all var(--transition);
    opacity: 0.55;
}
.carousel-thumb.active { border-color: var(--accent); opacity: 1; }
.carousel-thumb:hover { opacity: 0.85; }
.carousel-thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 768px) {
    .proj-gallery-carousel .carousel-view { aspect-ratio: 4/3; }
    .carousel-thumb { width: 60px; height: 45px; }
}
/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        position: fixed; top: var(--nav-height); left: 0; right: 0;
        background: rgba(10,26,13,0.95); backdrop-filter: blur(20px);
        flex-direction: column; padding: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        transform: translateY(-100%); opacity: 0; pointer-events: none; transition: all var(--transition);
    }
    .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: all; }
    .hamburger { display: flex; }
    .about-grid { grid-template-columns: 1fr; }
    .port-grid { grid-template-columns: 1fr; } .news-grid { grid-template-columns: repeat(2, 1fr); }
    .medal-showcase { grid-template-columns: repeat(2, 1fr); }
    section { padding: 64px 0; }
}

/* ===== Project Detail - ArchDaily Style ===== */
.project-detail {
    --bg-cream: #FAF5EF;
    --bg-white: #FFFFFF;
    --text-dark: #1a1a1a;
    --text-body: #3d3d3d;
    --text-meta: #777;
    --green-dark: #2E5A30;
    --green-mid: #4a7c4f;
    --green-light: #e8f0e8;
    --border-cream: #e8ddd0;
    --shadow-soft: 0 2px 16px rgba(0,0,0,0.06);
    background: var(--bg-cream);
    color: var(--text-body);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding-top: var(--nav-height);
}

/* Hero */
.proj-hero {
    position: relative; width: 100%; height: 55vh; min-height: 380px;
    background: linear-gradient(135deg, #d5c9b5, #c4b99a);
    overflow: hidden;
}
.proj-hero img { width: 100%; height: 100%; object-fit: cover; }
.proj-hero .proj-hero-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 4rem; color: rgba(46,90,48,0.12);
    background: linear-gradient(135deg, #ede4d3, #e0d5c0);
}

/* Content Wrapper */
.proj-content { max-width: 860px; margin: 0 auto; padding: 0 24px 80px; }

/* Header Block */
.proj-header {
    background: var(--bg-white); border-radius: var(--radius-lg);
    padding: 40px 48px; margin-top: -48px; position: relative; z-index: 2;
    box-shadow: var(--shadow-soft); border: 1px solid var(--border-cream);
}

.proj-category-tag {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    background: var(--green-light, #e8f0e8); color: var(--green-dark, #2E5A30);
    font-size: 0.78rem; font-weight: 600; margin-right: 8px; margin-bottom: 4px;
}
.proj-header .proj-category {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    background: var(--green-light); color: var(--green-dark);
    font-size: 0.78rem; font-weight: 600; margin-bottom: 16px;
}
.proj-header h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800;
    letter-spacing: -0.02em; color: var(--text-dark); line-height: 1.25; margin-bottom: 20px;
}
.proj-meta {
    display: flex; flex-wrap: wrap; gap: 24px;
    padding-top: 20px; border-top: 1px solid var(--border-cream);
}
.proj-meta-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9rem; color: var(--text-meta);
}
.proj-meta-item svg { flex-shrink: 0; color: var(--green-dark); opacity: 0.6; }

/* Body */
.proj-body {
    margin-top: 48px; font-size: 1.05rem; line-height: 1.85; color: var(--text-body);
}
.proj-body h2 {
    font-size: 1.45rem; font-weight: 700; color: var(--green-dark);
    margin: 48px 0 16px; letter-spacing: -0.01em;
}
.proj-body h3 {
    font-size: 1.15rem; font-weight: 600; color: var(--text-dark);
    margin: 32px 0 12px;
}
.proj-body p { margin-bottom: 18px; }
.proj-body ul, .proj-body ol { margin: 12px 0 18px 24px; }
.proj-body li { margin-bottom: 6px; }
.proj-body strong { color: var(--text-dark); }
.proj-body img {
    max-width: 100%; border-radius: var(--radius); margin: 24px 0;
    box-shadow: var(--shadow-soft);
}
.proj-body blockquote {
    border-left: 3px solid var(--green-mid); padding: 8px 20px;
    margin: 24px 0; background: var(--green-light); border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--green-dark); font-style: italic;
}
.proj-body a { color: var(--green-mid); text-decoration: underline; }
.proj-body hr { border: none; border-top: 1px solid var(--border-cream); margin: 40px 0; }

/* Gallery */
.proj-gallery { margin-top: 64px; }
.proj-gallery h2 {
    font-size: 1.3rem; font-weight: 700; color: var(--green-dark);
    margin-bottom: 24px; letter-spacing: -0.01em;
}
.proj-gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.proj-gallery-item {
    border-radius: var(--radius); overflow: hidden;
    aspect-ratio: 4/3; background: var(--border-cream);
    cursor: pointer; transition: all var(--transition);
}
.proj-gallery-item:hover { transform: scale(1.02); box-shadow: var(--shadow-soft); }
.proj-gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* Back Link */
.proj-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--green-mid); text-decoration: none; font-size: 0.9rem; font-weight: 500;
    margin: 80px 0 0; transition: opacity var(--transition);
}
.proj-back:hover { opacity: 0.65; }

/* Not found */
.proj-notfound {
    text-align: center; padding: 120px 24px;
}
.proj-notfound h2 { font-size: 1.6rem; color: var(--green-dark); margin-bottom: 12px; }
.proj-notfound p { color: var(--text-meta); margin-bottom: 24px; }

/* Footer override for light bg */

@media (max-width: 768px) {
    .proj-header { padding: 28px 24px; }
    .proj-meta { gap: 16px; }
    .proj-body { font-size: 1rem; }
    .proj-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}