/* 全局基础设置 */
:root {
    --bg-color: #0b0b0d;
    --text-primary: #ffffff;
    --text-secondary: #8b8b99;
    --accent-color: #ff4655;
    --accent-glow: rgba(255, 70, 85, 0.15);
    --nav-height: 80px;
    --nav-bg: rgba(11, 11, 13, 0.85);
    --nav-border: rgba(255, 255, 255, 0.05);
    --card-bg: rgba(255, 255, 255, 0.015);
    --card-border: rgba(255, 255, 255, 0.06);
    --divider-color: #333;
    --equipment-bg: rgba(255, 255, 255, 0.02);
    --equipment-border: #333;
    --scrollbar-thumb: #2a2a2f;
    --scrollbar-thumb-hover: #3a3a3f;
    --orb-opacity-warm: 0.12;
    --orb-opacity-cool: 0.12;
    --grain-opacity: 0.035;
    --lightbox-bg: rgba(5, 5, 7, 0.95);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* 自定义选中颜色 */
::selection {
    background: rgba(255, 70, 85, 0.35);
    color: #fff;
}

/* 暗色滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* =========================================
   氛围层 — 动态光晕 + 胶片颗粒
   ========================================= */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: var(--orb-opacity-warm);
}
.bg-orb--warm {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(255, 70, 85, 0.4) 0%, transparent 70%);
    top: -200px; left: -150px;
    animation: orbDrift1 20s ease-in-out infinite;
}
.bg-orb--cool {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(100, 130, 255, 0.3) 0%, transparent 70%);
    bottom: -150px; right: -150px;
    animation: orbDrift2 25s ease-in-out infinite;
}

.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* 导航栏样式 (Logo左, 标题中, 菜单右) */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
    padding: 0 5%;
    position: sticky;
    top: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--nav-border);
    animation: slideDown 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nav-left, .nav-right {
    flex: 1;
    display: flex;
}

.nav-left { justify-content: flex-start; align-items: center; }
.nav-right { justify-content: flex-end; align-items: center; gap: 1.2rem; }

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: brightness(0.9);
}
.logo:hover {
    transform: scale(1.08);
    filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.site-title {
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-primary);
    opacity: 0.85;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    transition: all 0.35s ease;
    position: relative;
    padding-bottom: 5px;
}
.nav-links a:hover {
    color: var(--text-primary);
    letter-spacing: 2.5px;
}

.nav-links a.active {
    color: var(--text-primary);
}
.nav-links a.active::after {
    width: 100%;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

/* 页面标题 */
.section-title {
    text-align: center;
    margin: 3rem 0 2rem;
}
.section-title h2 {
    font-weight: 300;
    letter-spacing: 8px;
    margin: 0 0 10px;
    text-transform: uppercase;
    animation: clipReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
.section-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

/* 标题装饰线 */
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--accent-color);
    margin: 18px auto 0;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.7s both;
}

/* 响应式画廊布局 */
main { padding: 0 5% 4rem; position: relative; z-index: 2; }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: 20px;
}

/* 画廊包装器 — 裁剪 + 悬停容器 */
.gallery-item-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.5s ease;
}
.gallery-item-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 图片 */
.gallery-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.85) grayscale(10%);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 暗角效果 */
.gallery-item-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.6s ease;
}

/* 悬停渐变遮罩 */
.gallery-item-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* 悬停状态 */
.gallery-item-wrapper:hover {
    z-index: 2;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(255, 70, 85, 0.15),
                inset 0 -4px 0 var(--accent-color);
}
.gallery-item-wrapper:hover .gallery-item {
    filter: brightness(1.05) grayscale(0%) saturate(1.1);
    transform: scale(1.06);
}
.gallery-item-wrapper:hover::before {
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.35);
}
.gallery-item-wrapper:hover::after {
    opacity: 1;
}
.gallery-item-wrapper:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* 悬停文字层 */
.gallery-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 2;
    padding: 24px 20px 18px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.gallery-overlay span {
    color: #fff;
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 400;
}

.span-2-row { grid-row: span 2; }
.span-2-col { grid-column: span 2; }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: var(--lightbox-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    align-items: center; justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    max-width: 90%; max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 60px rgba(0,0,0,0.9);
    animation: zoomIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.92); filter: blur(8px); }
    to { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* 计数器 */
.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    letter-spacing: 3px;
    font-weight: 300;
    pointer-events: none;
}

.close-btn, .nav-btn {
    position: absolute; background: transparent; border: none;
    color: rgba(255, 255, 255, 0.4); cursor: pointer;
    transition: all 0.35s ease;
}
.close-btn:hover, .nav-btn:hover { color: var(--accent-color); transform: scale(1.15); }
.close-btn {
    top: 25px; right: 40px;
    font-size: 45px; font-weight: 100; line-height: 1;
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.close-btn:hover { background: rgba(255,255,255,0.05); }
.nav-btn { top: 50%; transform: translateY(-50%); font-size: 40px; padding: 20px; }
.nav-btn:hover { transform: translateY(-50%) scale(1.15); }
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* =========================================
   About Me 页面 — 强交互高级感
   ========================================= */

/* 鼠标跟随聚光灯 */
.cursor-spotlight {
    position: fixed; pointer-events: none; z-index: 5;
    width: 550px; height: 550px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
    transform: translate(-50%, -50%); opacity: 0;
    transition: opacity 0.4s ease;
}
.cursor-spotlight.active { opacity: 1; }

/* 主布局 */
.about-container {
    display: flex; max-width: 1100px; margin: 4rem auto; gap: 4rem;
    align-items: center; position: relative; z-index: 2;
}

/* 肖像区 — 3D 倾斜 */
.about-image-wrapper { flex: 1; position: relative; perspective: 1000px; }
.about-portrait {
    --tilt-x: 0deg; --tilt-y: 0deg; --shadow-x: -20px; --shadow-y: 20px;
    width: 100%; height: auto; border-radius: 4px;
    filter: grayscale(20%) contrast(1.1);
    transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    box-shadow: var(--shadow-x) var(--shadow-y) 0px rgba(255, 70, 85, 0.12);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
    cursor: crosshair;
}
.about-image-wrapper::after {
    content: ''; position: absolute; inset: 0; border-radius: 4px;
    pointer-events: none; z-index: 2;
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%),
        rgba(255,255,255,0.08) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.3s;
}
.about-image-wrapper:hover::after { opacity: 1; }

/* 文字区 */
.about-content { flex: 1; }
.about-name { font-size: 3.5rem; font-weight: 200; letter-spacing: 4px; margin: 0 0 10px; animation: fadeInUp 0.8s cubic-bezier(0.16,1,0.3,1) 0.1s both; }
.about-subtitle { color: var(--accent-color); font-weight: 400; letter-spacing: 2px; font-size: 1rem; text-transform: uppercase; margin: 0 0 2rem; animation: fadeInUp 0.8s cubic-bezier(0.16,1,0.3,1) 0.2s both; }
.divider { width: 50px; height: 2px; background-color: var(--divider-color); margin-bottom: 2rem; animation: fadeInUp 0.6s ease 0.35s both; }

/* 简介段落 — 悬停滑入 */
.about-bio {
    color: var(--text-secondary); line-height: 1.8; margin-bottom: 1.5rem;
    font-size: 0.95rem; padding: 8px 0 8px 16px; margin-left: -18px;
    border-left: 2px solid transparent; border-radius: 0 2px 2px 0;
    transition: all 0.4s ease;
    animation: fadeInUp 0.8s cubic-bezier(0.16,1,0.3,1) both;
}
.about-bio:nth-child(4) { animation-delay: 0.4s; }
.about-bio:nth-child(5) { animation-delay: 0.55s; }
.about-bio:nth-child(6) { animation-delay: 0.7s; }
.about-bio:hover {
    color: var(--text-primary);
    border-left-color: var(--accent-color);
    transform: translateX(6px);
    background: var(--card-bg);
}

/* 装备列表 — 逐行交互 */
.equipment-list {
    margin-top: 3rem; background: var(--equipment-bg);
    padding: 1.5rem; border-left: 2px solid var(--equipment-border);
    transition: border-color 0.4s ease, background 0.4s ease;
}
.equipment-list:hover { border-left-color: rgba(255,70,85,0.4); background: var(--card-bg); }
.equipment-list h4 { margin: 0 0 1rem; font-weight: 500; letter-spacing: 2px; transition: letter-spacing 0.3s; }
.equipment-list:hover h4 { letter-spacing: 4px; }
.equipment-list ul { list-style: none; padding: 0; margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.8; }
.equipment-list li { padding: 4px 0; transition: all 0.3s ease; position: relative; }
.equipment-list li:hover { color: var(--text-primary); transform: translateX(4px); }
.equipment-list li::before { content: ''; position: absolute; left: -10px; top: 50%; width: 0; height: 1px; background: var(--accent-color); transition: width 0.3s ease; transform: translateY(-50%); }
.equipment-list li:hover::before { width: 6px; }
.equipment-list strong { color: var(--text-primary); }

/* 联系按钮 — 磁吸发光 */
.contact-btn {
    --btn-mx: 0px; --btn-my: 0px;
    display: inline-block; margin-top: 3rem; padding: 12px 30px;
    border: 1px solid var(--accent-color); color: var(--accent-color);
    text-decoration: none; letter-spacing: 2px; text-transform: uppercase;
    font-size: 0.8rem; position: relative;
    transform: translate(var(--btn-mx), var(--btn-my));
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1), transform 0.25s ease-out;
    z-index: 1;
}
.contact-btn::before { content: ''; position: absolute; inset: -1px; z-index: -1; background: var(--accent-color); border-radius: inherit; opacity: 0; transition: opacity 0.4s; }
.contact-btn:hover { color: #fff; border-color: transparent; box-shadow: 0 0 30px rgba(255,70,85,0.25), 0 0 60px rgba(255,70,85,0.08); letter-spacing: 4px; }
.contact-btn:hover::before { opacity: 1; }

/* 减弱动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .gallery-item-wrapper {
        opacity: 1;
        transform: none;
    }
}

/* 移动端适配 */
@media (max-width: 900px) {
    .about-container { flex-direction: column; text-align: center; }
    .about-portrait {
        box-shadow: -20px 20px 0px rgba(255,70,85,0.1);
        transform: none !important; cursor: default;
    }
    .about-image-wrapper { perspective: none; }
    .about-image-wrapper::after { display: none; }
    .about-bio { margin-left: 0; padding-left: 0; border-left: none; }
    .about-bio:hover { transform: none; border-left-color: transparent; }
    .equipment-list li:hover { transform: none; }
    .equipment-list li::before { display: none; }
    .divider { margin: 0 auto 2rem; }
    .equipment-list { text-align: left; }
    .contact-btn:hover { letter-spacing: 2px; }
    .cursor-spotlight { display: none; }
}

@media (max-width: 768px) {
    .navbar { flex-direction: column; height: auto; padding: 1.5rem 5%; gap: 1rem; }
    .nav-center { position: relative; left: 0; transform: none; }
    .nav-links { gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
    .span-2-col { grid-column: span 1; }
    .nav-btn { padding: 10px; font-size: 30px; }
    .prev-btn { left: 0; } .next-btn { right: 0; }
    .close-btn { top: 15px; right: 20px; font-size: 35px; }

    /* 移动端隐藏背景光晕以提升性能 */
    .bg-orb { display: none; }
    .grain-overlay { opacity: 0.02; }

    /* 减弱悬停缩放 */
    .gallery-item-wrapper:hover .gallery-item {
        transform: scale(1.03);
    }
}

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-100%); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes orbDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(40px, -25px) scale(1.06); }
    50%      { transform: translate(-15px, -40px) scale(0.94); }
    75%      { transform: translate(-35px, 10px) scale(1.04); }
}

@keyframes orbDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(-30px, 20px) scale(1.08); }
    50%      { transform: translate(20px, 30px) scale(0.92); }
    75%      { transform: translate(25px, -15px) scale(1.05); }
}

@keyframes clipReveal {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

/* =========================================
   页脚 — 版权标注 & 访问统计
   ========================================= */
.site-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(11, 11, 13, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2rem 5% 2.5rem;
    margin-top: 2rem;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.footer-copyright p {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 300;
}
.footer-brand {
    color: var(--text-primary);
    font-weight: 400;
}
.footer-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
}
.footer-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.65;
    transition: opacity 0.35s ease;
}
.footer-counter:hover { opacity: 1; }
.counter-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-color);
}
.counter-text {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 300;
}
.counter-text strong {
    color: var(--text-primary);
    font-weight: 400;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    .footer-divider {
        width: 40px;
        height: 1px;
    }
}
