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

:root {
    --bg-primary: #faf8f5;
    --bg-secondary: #f5f2ed;
    --text-primary: #3a3632;
    --text-secondary: #6b6560;
    --accent: #c9b8a8;
    --accent-light: #e8ddd2;
    --shadow: rgba(58, 54, 50, 0.08);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Patrick Hand', 'ZCOOL KuaiLe', cursive, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    position: relative;
}

/* 固定背景图 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 20px var(--shadow);
}

.nav-brand {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: flex;
}

.nav-brand span {
    display: inline-block;
}

.nav-brand .color-1 { color: #e74c3c; }
.nav-brand .color-2 { color: #e67e22; }
.nav-brand .color-3 { color: #f1c40f; }
.nav-brand .color-4 { color: #2ecc71; }
.nav-brand .color-5 { color: #1abc9c; }
.nav-brand .color-6 { color: #3498db; }
.nav-brand .color-7 { color: #9b59b6; }
.nav-brand .color-8 { color: #e74c3c; }
.nav-brand .color-9 { color: #e67e22; }
.nav-brand .color-10 { color: #f1c40f; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover {
    color: var(--text-primary);
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* 区块 */
.section {
    padding: 2rem 2rem;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-content {
    max-width: 1200px;
    width: 100%;
}

.section-title {
    font-family: 'ZCOOL KuaiLe', 'Patrick Hand', cursive;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 0.1em;
    color: #5a4a3a;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* 个人介绍 */
.about-text {
    max-width: 700px;
    margin: 0 auto;
    font-family: 'ZCOOL KuaiLe', 'Patrick Hand', cursive;
    font-size: 1.4rem;
    color: #8b4513;
    text-align: center;
    line-height: 2;
}

.about-text .name-highlight {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e74c3c;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.about-text p {
    margin-bottom: 1.5rem;
}

/* ===== 作品展示 - 缩略图网格 ===== */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.works-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow);
    aspect-ratio: 1;
    background: var(--bg-secondary);
}

.works-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.works-thumb:hover img {
    transform: scale(1.12);
    box-shadow: 0 8px 30px rgba(58, 54, 50, 0.2);
}

.works-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    transition: box-shadow 0.4s ease;
    pointer-events: none;
}

.works-thumb:hover::after {
    box-shadow: inset 0 0 0 3px rgba(201, 184, 168, 0.6);
}

/* ===== 大图查看器（Lightbox） ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 60px rgba(0,0,0,0.5);
    animation: lightboxIn 0.3s ease;
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-top: 1rem;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* ===== 散落网格（画的成长） ===== */
.scatter-grid {
    position: relative;
    max-width: 1000px;
    min-height: 500px;
    margin: 0 auto;
    overflow: hidden;
}

.scatter-item {
    position: absolute;
    cursor: pointer;
    transition: transform 0.35s ease, z-index 0s 0.15s, box-shadow 0.35s ease;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(58, 54, 50, 0.15);
    overflow: hidden;
    background: var(--bg-secondary);
}

.scatter-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.4s ease;
}

.scatter-item:hover {
    z-index: 100 !important;
    transform: scale(1.2) rotate(0deg) !important;
    box-shadow: 0 12px 40px rgba(58, 54, 50, 0.3);
}

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

/* ===== IP周边分组展示（3张一组） ===== */
.ip-group-viewer {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
}

.ip-group-track {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
}

.ip-group {
    flex-shrink: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 0.5rem;
}

.ip-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--shadow);
    background: var(--bg-secondary);
    transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.ip-card img {
    width: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.35s ease;
}

.ip-card:hover {
    box-shadow: 0 8px 35px rgba(58, 54, 50, 0.22);
    transform: translateY(-4px);
}

.ip-card:hover img {
    transform: scale(1.03);
}

.ip-card-caption {
    font-family: 'ZCOOL KuaiLe', 'Patrick Hand', cursive;
    font-size: 1.15rem;
    color: #6b6560;
    padding: 0.8rem 0.5rem;
    text-align: center;
    background: rgba(250, 248, 245, 0.9);
}

.ip-group-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.ip-group-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--accent-light);
    border-radius: 50%;
    background: rgba(250, 248, 245, 0.9);
    font-size: 1.4rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ip-group-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--accent-light);
}

.ip-group-dots {
    display: flex;
    gap: 8px;
}

.ip-group-dots .gdot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-light);
    cursor: pointer;
    transition: var(--transition);
}

.ip-group-dots .gdot.active {
    background: var(--accent);
    transform: scale(1.3);
}

/* ===== 系列标签按钮 ===== */
.series-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.series-tab {
    font-family: 'ZCOOL KuaiLe', 'Patrick Hand', cursive;
    font-size: 1.2rem;
    padding: 0.6rem 1.8rem;
    border: 2px solid var(--accent-light);
    border-radius: 25px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.series-tab:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.series-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(201, 184, 168, 0.4);
}

/* ===== 图片画廊（滑动） ===== */
.gallery-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

.gallery-slider {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
    align-items: flex-start;
}

.gallery-slide {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-slider img {
    width: 100%;
    max-width: 900px;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px var(--shadow);
}

.gallery-caption {
    font-family: 'ZCOOL KuaiLe', 'Patrick Hand', cursive;
    font-size: 1.2rem;
    color: #6b6560;
    margin-top: 0.8rem;
    text-align: center;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(250, 248, 245, 0.9);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background: var(--accent-light);
    color: var(--text-primary);
}

.slider-btn.prev { left: 1rem; }
.slider-btn.next { right: 1rem; }

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.gallery-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-light);
    cursor: pointer;
    transition: var(--transition);
}

.gallery-dots .dot.active {
    background: var(--accent);
    transform: scale(1.2);
}

/* 联系我们 */
.contact-info {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    font-family: 'ZCOOL KuaiLe', 'Patrick Hand', cursive;
    font-size: 1.3rem;
}

.contact-label {
    color: #6b6560;
    margin-right: 0.5rem;
}

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

.contact-email:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 页脚 */
.footer {
    background: var(--bg-secondary);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--accent-light);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer .icp a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer .icp a:hover {
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(250, 248, 245, 0.98);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .section {
        padding: 2rem 1rem;
        padding-top: 70px;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .about-text {
        font-size: 1.1rem;
        padding: 0 0.5rem;
    }

    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
    }

    .scatter-grid {
        min-height: 300px;
    }

    .ip-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .ip-card-caption {
        font-size: 0.9rem;
        padding: 0.4rem;
    }

    .ip-group-btn {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .slider-btn.prev { left: 0.5rem; }
    .slider-btn.next { right: 0.5rem; }

    .gallery-slider img {
        max-height: 50vh;
    }

    .gallery-caption {
        font-size: 1rem;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .series-tab {
        font-size: 1rem;
        padding: 0.5rem 1.2rem;
    }
}

/* 触摸滑动支持 */
@media (hover: none) {
    .slider-btn {
        opacity: 0.7;
    }
}