/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #8e937d;
    --bg-dark: #4a4a3d;
    --text: #ffffff;
    --text-sub: #d4c9b0;
    --accent: #a8703f;
    --card: #3d3d32;
    --border: #7a7058;
    --transition: all 0.3s ease;
}

html {
    /* scroll-behavior: smooth 禁掉，防止 Safari 在图片加载时自动滚动 */
    scroll-restoration: manual;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* 导航栏：永远保持 Apple 风格毛玻璃（Hero 区也是） */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* 毛玻璃：50% 透明 + backdrop-filter 模糊 */
    background: linear-gradient(180deg, rgba(74, 74, 61, 0.5) 0%, rgba(142, 147, 125, 0.5) 100%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    /* 平滑过渡：上下滑动、背景、边框都走 ease-out */
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s ease,
                border-color 0.3s ease;
}

.navbar.scrolled {
    /* 滚出 Hero 后依然保持毛玻璃（基础样式已有，这里仅微调 border 颜色） */
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.navbar .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 40px 15px;
}

.logo {
    font-size: 2rem;
    font-weight: 200;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 8px;
    margin-bottom: 4px;
}

/* Hero 区上方的 Navbar：保持毛玻璃，字色保持全白（背景透出深色轮播图） */
.navbar.hero-active {
    /* 保持毛玻璃，不变完全透明 */
    border-bottom-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}
.navbar.hero-active .logo,
.navbar.hero-active .tagline,
.navbar.hero-active .nav-links a {
    color: #fff;
}

.tagline {
    font-size: 10px;
    letter-spacing: 4px;
    color: var(--text-sub);
    text-transform: uppercase;
    margin: 0;
}

.nav-links {
    position: absolute;
    right: 40px;
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-sub);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: var(--transition);
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: var(--text);
    margin: 3px 0;
    transition: var(--transition);
}

/* 英雄区 */
.hero {
    height: 100vh;
    min-height: 600px;
    color: var(--text);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 0;          /* 顶到屏幕顶端 */
    /* 轮播内容下移 150px，给 navbar 留更多空间 */
    padding-top: 150px;
}

/* .hero-split 自己负责填充 hero 高度 */
.hero-split {
    position: absolute;
    inset: 0;       /* 铺满整个 hero */
    padding-top: 150px;  /* 侧轮播图从 Navbar 下方再多走 150px */
    box-sizing: border-box;
    overflow: hidden;  /* 防止侧图浮动超出 hero 范围影响页面高度 */
}

/* ============================================ */
/* Hero 分屏轮播：桌面左右各一张，中间标题       */
/* ============================================ */

/* 高度调低，从 100vh 改为 75vh，上下不裁切两侧图 */
.hero {
    min-height: 75vh !important;
    height: 75vh !important;
    padding: 0 !important;
}

.hero-split {
    position: absolute;
    inset: 0;                  /* 铺满整个 hero */
    display: flex;
    align-items: center;       /* 垂直居中两侧 */
    justify-content: center;
    gap: 24px;
}

/* 左右两侧轮播区：中间有间距、不贴边，固定 2:3 比例 */
.hero-split-side {
    flex: 0 0 auto;            /* 关键：不拉伸 */
    height: 91%;               /* 以高度为基准 (原 70% * 1.3 = 91%) */
    aspect-ratio: 2 / 3;       /* 锁定 2:3 竖版肖像 */
    max-height: 90vh;          /* 原 75vh 同步 +20% */
    position: relative;
    overflow: hidden;
    border-radius: 8px;       /* 悬浮感：圆角 */
    box-shadow:
        0 25px 60px rgba(0,0,0,0.45),     /* 主阴影 */
        0 8px 20px rgba(0,0,0,0.25);      /* 细节阴影 */
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    animation: heroFloat 6s ease-in-out infinite;
}

/* 由中间区控制两侧宽度限制 */
.hero-split-left  { margin-left: 32px; }
.hero-split-right { margin-right: 32px; }

/* 中等屏：两侧缩小、间距压缩 */
@media (max-width: 1280px) {
    .hero-split {
        gap: 12px;
    }
    .hero-split-center {
        flex: 0 0 220px;       /* 中间变窄（原 280 -22%）让两侧有空间变大 */
        padding: 0 12px;
    }
    .hero-split-left  { margin-left: 16px; }
    .hero-split-right { margin-right: 16px; }
}

/* 悬浮动效 */
@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.hero-split-side:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 35px 80px rgba(0,0,0,0.55),
        0 12px 28px rgba(0,0,0,0.35);
}

.hero-split-side .hero-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: 8px;
}

.hero-split-side .hero-slide {
    position: absolute;
    inset: 0;
    /* 纯缩放不裁切：整图缩放至填满框 (轻微拉伸但保留完整人脸) */
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    animation: heroZoom 20s ease-out forwards;
}

.hero-split-side .hero-slide.active {
    opacity: 1;
}

/* 中间标题区：狭窄、与页面背景融为一体 */
.hero-split-center {
    flex: 0 0 360px;          /* 固定宽度 360px */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 0 24px;
    text-align: center;
    background: transparent;  /* 与页面背景--bg (橄榄绿) 融合 */
    border-radius: 0;
}

/* 不需要中间遮罩了 */
.hero-center-mask { display: none; }

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 24px;
    max-width: 600px;
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    width: fit-content;
    margin: 0 auto;
    text-align: center;
    animation: bounce 2s infinite;
    z-index: 3;
}

@keyframes heroZoom {
    from { transform: scale(1.08); }
    to   { transform: scale(1.0); }
}

/* ============================================ */
/* 手机版：单张全屏背景 + 标题叠加             */
/* ============================================ */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh !important;
        height: 100vh !important;       /* 手机恢复全屏高度 */
        padding: 0 !important;
    }
    .hero-split {
        position: absolute;             /* 保持桌面端写法 */
        inset: 0;
        display: block;                 /* 手机不用 flex */
    }
    .hero-split-side {
        display: none;                  /* 隐藏两侧轮播 */
    }
    .hero-split-center {
        position: absolute;             /* 手机铺满 */
        inset: 0;
        flex: none;                     /* 覆盖桌面端的 flex: 0 0 360px */
        width: 100%;
        height: 100%;
        padding: 0 20px;
        display: block;                 /* 手机不用 flex 居中 */
    }
    /* 手机端轮播图：保持 2:3 比例，卡片悬浮风格，居中显示 (缩小 15%) */
    .hero-mobile-bg {
        position: absolute;
        top: 100px;                     /* 避开 Navbar (~70px) + 浮动动效空间 (30px) */
        left: 50%;
        /* 用 margin-left 负向避免被 heroFloat 动画覆盖 */
        width: min(calc((100vw - 40px) * 0.85), calc((100vh - 70px - 100px) * 2 / 3 * 0.85));
        margin-left: calc(min(calc((100vw - 40px) * 0.85), calc((100vh - 70px - 100px) * 2 / 3 * 0.85)) / -2);
        aspect-ratio: 2 / 3;
        z-index: 0;
        overflow: hidden;
        border-radius: 8px;
        box-shadow:
            0 25px 60px rgba(0,0,0,0.45),
            0 8px 20px rgba(0,0,0,0.25);
        animation: heroFloat 6s ease-in-out infinite;
    }
    .hero-mobile-bg .hero-slide {
        position: absolute;
        inset: 0;
        background-size: 100% 100%;     /* 纯缩放不裁切，保持原比例 (框也是 2:3) */
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0;
        transition: opacity 1.2s ease-in-out;
    }
    .hero-mobile-bg .hero-slide.active {
        opacity: 1;
    }
    /* 手机端中间区域需有暗色遮罩让文字可读 */
    .hero-split-center::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg,
            rgba(0,0,0,0.45) 0%,
            rgba(0,0,0,0.25) 30%,
            rgba(0,0,0,0.3) 60%,
            rgba(0,0,0,0.7) 100%);
        z-index: 1;
        pointer-events: none;
    }
    /* 文字内容浮在背景层之上，放在屏幕底部 (避开卡片人物脸部核心) */
    .hero-content {
        position: absolute;
        z-index: 2;
        left: 0;
        right: 0;
        bottom: 50px;                   /* 屏幕底部 50px，不与卡片重叠 */
        padding: 0 20px;
        text-align: center;
    }
    /* 桌面端隐藏手机背景层 */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(0,0,0,0.55) 0%,
            rgba(0,0,0,0.35) 40%,
            rgba(0,0,0,0.45) 70%,
            rgba(0,0,0,0.65) 100%);
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 200;
    margin-bottom: 0.5rem;
    letter-spacing: 8px;
    animation: fadeInUp 1s ease;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.6);
}

.hero-subtitle {
    font-size: 10px;
    font-weight: 300;
    margin-bottom: 1rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s backwards;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.hero-tagline {
    font-size: 15px;
    font-weight: 300;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 36px;
    color: var(--text-sub);
    font-style: italic;
    letter-spacing: 1px;
    animation: fadeInUp 1s ease 0.4s backwards;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.hero-cta {
    display: inline-block;
    padding: 12px 32px;
    border: 1px solid rgba(255,255,255,0.6);
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 300;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.6s backwards;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
}

.hero-cta:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
    transform: translateY(-2px);
}

/* View Portfolio 链接点击时手动平滑滚动 */
.hero-cta, .scroll-link {
    cursor: pointer;
}
JS_EOF

.scroll-indicator span {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    margin: 0 auto;
}

/* 章节标题 */
.section-label {
    font-size: 11px;
    letter-spacing: 6px;
    color: var(--text-sub);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 11px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-sub);
    letter-spacing: 6px;
    text-transform: uppercase;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--border);
    margin: 15px auto 0;
}

/* 关于区域 */
.about {
    padding: 100px 40px 30px;
    background: transparent;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-sub);
    font-weight: 300;
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

/* 分隔线 */
.divider {
    max-width: 200px;
    margin: 30px auto;
    height: 1px;
    background: var(--border);
}

/* 作品集 */
.portfolio {
    padding: 30px 40px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    background: var(--card);
    transition: transform 0.3s ease, opacity 0.3s ease;
    /* aspect-ratio 动态从 JS 传入（照片原始宽高比） */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

@media (hover: hover) and (pointer: fine) {
    .gallery-item:hover {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
}

.load-more-btn {
    display: inline-block;
    padding: 11px 36px;
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text-sub);
    font-size: 12px;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    background: transparent;
    margin: 30px auto 50px;
}

.load-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* 联系方式 */
.contact {
    padding: 30px 40px;
    background: transparent;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-email {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.contact-email a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.contact-email a:hover {
    color: var(--accent);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 18px;
    background: transparent;
    color: var(--text-sub);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 30px;
    transition: var(--transition);
    font-size: 12px;
    letter-spacing: 2px;
}

.social-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

/* 页脚 */
.footer {
    padding: 30px 40px;
    background: transparent;
    color: var(--text-sub);
    text-align: center;
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2001;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 3rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2001;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

/* 灯箱右下角图片名：小、不显眼、但可读 */
.modal-caption {
    display: block;
    position: absolute;
    right: 24px;
    bottom: 24px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0.5px;
    user-select: all;          /* 客户能复制选中，方便查询 */
    cursor: text;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: auto;      /* 允许选中 */
}
@media (max-width: 768px) {
    .modal-caption {
        right: 16px;
        bottom: 16px;
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-dark);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 50px;
        transition: var(--transition);
    }

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

    .mobile-menu-btn {
        display: flex;
    }

    .hero-title {
        font-size: 2rem;
        letter-spacing: 4px;
    }

    .hero-subtitle {
        font-size: 9px;
        letter-spacing: 3px;
    }

    .section-title {
        font-size: 10px;
        letter-spacing: 4px;
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);  /* 手机端3列，不再单列 */
        gap: 6px;
    }

    .about-text {
        font-size: 14px;
    }

    .modal-nav {
        width: 45px;
        height: 45px;
        font-size: 2rem;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }

    .site-header,
    .section,
    .about,
    .portfolio,
    .contact {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
        letter-spacing: 3px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);  /* 超窄屏也是 2 列，不再 1 列 */
        gap: 4px;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .logo {
        font-size: 1.3rem;
        letter-spacing: 4px;
    }
}
