* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary-color: #1d1d1f;
    --secondary-color: #86868b;
    --accent-color: #0071e3;
    --bg-light: #fafafa;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow-light: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.12);
    --transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-theme="dark"] {
    --primary-color: #f5f5f7;
    --secondary-color: #a1a1a6;
    --accent-color: #0a84ff;
    --bg-light: #121212;
    --card-bg: #1f1f1f;
    --border-color: #333333;
    --shadow-light: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.4);
}
html {
    scroll-behavior: smooth;
    transition: background-color 0.4s ease, color 0.4s ease;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    color: var(--primary-color);
    background-color: var(--bg-light);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    user-select: none;
    -webkit-user-select: none;
}
/* 交互组件放行文本选中 */
.lang-current, .lang-option, #theme-toggle, .hamburger, .social-btn {
    user-select: text;
    -webkit-user-select: text;
    cursor: pointer;
}
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
ul {
    list-style: none;
}
img {
    max-width: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}
/* 图片加载失败兜底背景 */
img.gallery-img {
    object-fit: cover;
    background: var(--border-color);
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.section-title {
    font-size: 42px;
    font-weight: 600;
    letter-spacing: -0.6px;
    margin-bottom: 32px;
    text-align: center;
    color: var(--primary-color);
}

/* 顶部导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    z-index: 9999;
    transition: var(--transition);
}
/* 导航滚动样式 */
.navbar.scrolled {
    box-shadow: var(--shadow-light);
    background: rgba(255, 255, 255, 0.92);
}
html[data-theme="dark"] .navbar {
    background: rgba(18, 18, 18, 0.85);
}
html[data-theme="dark"] .navbar.scrolled {
    background: rgba(18, 18, 18, 0.92);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.logo {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.4px;
    z-index: 10001;
}
.nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: auto;
}
.hamburger {
    display: none;
}
.nav-menu {
    display: flex;
    gap: 36px;
}
.nav-menu a {
    font-size: 15px;
    font-weight: 400;
    color: var(--primary-color);
    position: relative;
}
.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}
.nav-menu a:hover {
    color: var(--accent-color);
}
.nav-menu a:hover::after {
    width: 100%;
}
.nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
}

/* 语言下拉菜单 */
.lang-dropdown {
    position: relative;
}
.lang-current {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 14px;
}
.lang-current:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}
.lang-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    min-width: 140px;
    display: none;
}
.lang-option {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--primary-color);
    border: none;
    padding: 10px 16px;
    text-align: left;
    transition: var(--transition);
    font-size: 14px;
}
.lang-option:hover {
    background: var(--accent-color);
    color: #fff;
}

/* 夜间模式切换按钮 */
.theme-toggle {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 16px;
}
.theme-toggle:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}
html[data-theme="dark"] .icon-moon { display: none; }
html:not([data-theme="dark"]) .icon-sun { display: none; }

/* 首页大横幅区域 */
.hero {
    width: 100%;
    height: 100vh;
    background: url('../images/hero.webp') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    color: #fff;
    overflow: hidden;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
    animation: fadeUp 1.2s ease-out forwards;
}
.hero h2 {
    font-size: 72px;
    font-weight: 600;
    letter-spacing: -2px;
    margin-bottom: 16px;
}
.hero .subtitle {
    font-size: 24px;
    font-weight: 300;
    opacity: 0.95;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 关于我区域 */
.about {
    padding: 120px 0;
    text-align: center;
}
.about-desc {
    font-size: 19px;
    color: var(--secondary-color);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.9;
}

/* 作品网格区域 - 电脑端固定两列，最大宽度900px居中缩小 */
.gallery-section {
    padding: 100px 0;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin: 20px auto 0;
    padding: 0 24px;
    max-width: 900px;
}
.gallery-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
}
.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* 撑开精美的 2:3 纵向黄金比例尺寸 */
.card-image {
    width: 100%;
    position: relative;
    padding-bottom: 130%;
    overflow: hidden;
}

/* 骨架屏基础样式 */
.img-loading {
    background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}
html[data-theme="dark"] .img-loading {
    background: linear-gradient(90deg, #2c2c2c 25%, #3d3d3d 37%, #2c2c2c 63%);
    background-size: 400% 100%;
}
@keyframes skeleton-loading {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* 让图片完美自适应铺满外容器 */
.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}
.img-loading img {
    opacity: 0;
}
.gallery-card:hover .card-image img {
    transform: scale(1.04);
}

/* 修复：将水印的 z-index 强制提升，并确保过渡顺畅、带有唯美的磨砂玻璃滤镜效果 */
.card-image::after {
    content: attr(data-copyright);
    position: absolute;
    right: 16px;
    bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.45);
    padding: 6px 14px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 50;
    pointer-events: none;
}
.gallery-card:hover .card-image::after {
    opacity: 1;
    transform: translateY(0);
}

.card-info {
    padding: 24px;
}
.card-info p {
    font-size: 17px;
    font-weight: 500;
}

/* 全屏灯箱查看器 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(0,0,0,0.6);
}
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.lightbox-close:hover {
    color: #aaa;
    transform: scale(1.1);
}

/* 联系区域 */
.contact {
    padding: 120px 0;
    text-align: center;
    background: var(--bg-light);
}
.social-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    max-width: 450px;
    margin: 40px auto 0 auto;
    padding: 0 16px;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}
.social-btn:hover {
    color: #ffffff;
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.social-btn:active {
    transform: translateY(-1px);
}

/* 页脚区域 */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-size: 14px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-light);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* 响应式：平板及小屏幕笔记本 */
@media (max-width: 992px) {
    .hero h2 { font-size: 52px; }
    .section-title { font-size: 36px; }
    .gallery-grid {
        max-width: 100%;
    }
}

/* 响应式：手机端还原一行一张卡片 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 24px;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        z-index: 10002;
        transition: var(--transition);
    }
    .hamburger span {
        display: block;
        height: 2px;
        width: 100%;
        background-color: var(--primary-color);
        border-radius: 2px;
        transition: var(--transition);
    }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--card-bg);
        box-shadow: -10px 0 30px rgba(0,0,0,0.05);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        z-index: 10000;
        transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .nav-toggle:checked ~ .nav-menu {
        right: 0;
    }
    .nav-toggle:checked ~ .hamburger span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .nav-toggle:checked ~ .hamburger span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle:checked ~ .hamburger span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    .hero h2 { font-size: 40px; }
    .hero .subtitle { font-size: 18px; }
    /* 手机端还原：一行1张卡片 */
    .gallery-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 24px;
        padding: 0 12px;
        max-width: 100%;
    }
    .lightbox-close { right: 20px; top: 20px; font-size: 30px; }

    .social-buttons { gap: 14px; margin-top: 30px; }
    .social-btn { padding: 14px 20px; font-size: 15px; }
}

/* 响应式：极窄屏手机 同样一行一张 */
@media (max-width: 480px) {
    .logo { font-size: 19px; }
    .theme-toggle { width: 36px; height: 36px; font-size: 14px; }
    .gallery-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 16px;
        padding: 0 12px;
        max-width: 100%;
    }
}

/* 超小屏手机文字适配 */
@media (max-width: 360px) {
    .hero h2 { font-size: 32px; }
    .hero .subtitle { font-size: 16px; }
    .gallery-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 12px;
        max-width: 100%;
    }
}