* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6c5ce7;
    --primary-dark: #5546d0;
    --secondary: #00cec9;
    --dark: #1a1a2e;
    --dark-light: #16213e;
    --text: #2d3436;
    --text-light: #636e72;
    --bg: #f5f5fa;
    --white: #fff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --radius: 15px;
    --transition: 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

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

/* ========== Header / Navbar ========== */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--dark);
    font-weight: 700;
}

.logo h1 span {
    color: var(--primary);
    font-weight: 400;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

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

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

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

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text);
    margin: 4px 0;
    border-radius: 2px;
    transition: var(--transition);
}

/* ========== Section Title ========== */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    color: var(--dark);
}

.section-title span {
    color: var(--primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

/* ========== Hero ========== */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 110px 2rem 50px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: var(--white);
    min-height: 50vh;
    overflow: hidden;
    position: relative;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* 高级渐变：深色基底 + 紫青光晕层次 */
    background:
        radial-gradient(ellipse 70% 55% at 78% 18%, rgba(0, 206, 201, 0.28) 0%, transparent 60%),
        radial-gradient(ellipse 60% 65% at 18% 85%, rgba(108, 92, 231, 0.42) 0%, transparent 62%),
        radial-gradient(ellipse 45% 40% at 92% 92%, rgba(139, 127, 240, 0.25) 0%, transparent 60%),
        linear-gradient(135deg, #0d0b1e 0%, #1a1640 38%, #16213e 72%, #0c1a2b 100%);
    pointer-events: none;
}

/* 轻微暗角：为标题文字区域保证对比，不掩盖渐变 */
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(13, 11, 30, 0.55) 0%, rgba(13, 11, 30, 0.12) 55%, transparent 100%),
        linear-gradient(to top, rgba(13, 11, 30, 0.45), transparent 45%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    flex: 1;
    max-width: 640px;
    z-index: 2;
}

.hero-greeting {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.hero-content h2 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-subtitle em {
    color: var(--secondary);
    font-style: normal;
    margin: 0 0.3rem;
}

.hero-desc {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.cta-button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(108, 92, 231, 0.4);
}

.cta-button.outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.cta-button.outline:hover {
    background: var(--white);
    color: var(--dark);
}

/* ========== About ========== */
.about {
    background-color: var(--white);
    padding: 80px 0;
}

.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.stat-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.about-skills h3 {
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.skill-bar {
    margin-bottom: 1.2rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.skill-progress {
    height: 8px;
    background: #e9e9ef;
    border-radius: 50px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 50px;
    transition: width 1s ease;
}

/* ========== Portfolio 板块切换 ========== */
.portfolio {
    padding: 80px 0;
    background-color: var(--bg);
}

.board-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.board-btn {
    background: var(--white);
    color: var(--text);
    border: 2px solid transparent;
    padding: 14px 40px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.board-btn .board-icon {
    color: var(--primary);
    margin-right: 6px;
}

.board-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.board-btn.active {
    background: linear-gradient(135deg, var(--primary), #8b7ff0);
    color: var(--white);
}

.board-btn.active .board-icon {
    color: var(--secondary);
}

.board-panel {
    display: none;
    animation: fadeUp 0.4s ease;
}

.board-panel.active {
    display: block;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* AIGC 二级 Tab */
.sub-tabs {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.sub-btn {
    background: transparent;
    color: var(--text-light);
    border: 2px solid #dcdce6;
    padding: 9px 30px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.sub-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sub-btn.active {
    background: var(--dark);
    border-color: var(--dark);
    color: var(--white);
}

.sub-panel {
    display: none;
    animation: fadeUp 0.4s ease;
}

.sub-panel.active {
    display: block;
}

/* 系列筛选 */
.series-filter {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    margin-bottom: 2.2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--white);
    color: var(--text);
    border: none;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: var(--white);
}

/* ========== 瀑布流图片画廊 ========== */
.gallery-masonry {
    column-count: 4;
    column-gap: 1.2rem;
}

.masonry-item {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 1.2rem;
    break-inside: avoid;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    background: #e9e9ef;
    transition: var(--transition);
}

.masonry-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.masonry-item img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease;
}

.masonry-item:hover img {
    transform: scale(1.06);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 45%, rgba(26, 26, 46, 0.92));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.2rem;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.masonry-item:hover .card-overlay,
.video-item:hover .card-overlay {
    opacity: 1;
}

.card-label {
    color: var(--secondary);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

.card-title {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    background: #e9e9ef;
}

.gallery-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-light);
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* ========== 视频画廊 ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.video-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 16 / 9;
    background: #000;
    cursor: pointer;
    transition: var(--transition);
}

.video-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-item .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    color: var(--white);
    background: rgba(108, 92, 231, 0.85);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: var(--transition);
    pointer-events: none;
    padding-left: 4px;
}

.video-item:hover .play-icon {
    background: var(--primary);
    transform: translate(-50%, -50%) scale(1.12);
}

.video-item .card-overlay {
    opacity: 1;
    background: linear-gradient(transparent 55%, rgba(26, 26, 46, 0.85));
    z-index: 1;
}

/* ========== Lightbox ========== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 1280px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 2;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: var(--primary);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: var(--primary);
}

.lightbox-nav.prev { left: 25px; }
.lightbox-nav.next { right: 25px; }

.lightbox-media {
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-media img {
    width: 100%;
    max-height: 82vh;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
}

.lightbox-media.zoomed img {
    cursor: grab;
}

.lightbox-media.zoomed.dragging img {
    cursor: grabbing;
}

.lightbox-media video {
    width: 100%;
    max-height: 82vh;
    object-fit: contain;
}

.lightbox-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 2rem;
}

.lightbox-info-text {
    flex: 1;
    min-width: 180px;
}

.lightbox-label {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.lightbox-info h3 {
    color: var(--dark);
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.lightbox-count {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* 缩放控件 */
.lightbox-zoom {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.zoom-btn,
.zoom-level {
    border: 1px solid #e3e3ec;
    background: var(--white);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    height: 36px;
    min-width: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.zoom-btn:hover,
.zoom-level:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f4f2ff;
}

/* ========== Footer ========== */
.footer {
    background-color: var(--dark);
    color: var(--white);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    margin-bottom: 1.5rem;
}

.footer-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.footer-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.7;
    transition: var(--transition);
    font-size: 0.9rem;
    cursor: pointer;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--secondary);
}

.footer-copy {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    opacity: 0.6;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .gallery-masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1.5rem;
        gap: 1.2rem;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 86px 1.5rem 28px;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .about-wrapper {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    .gallery-masonry {
        column-count: 2;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .board-btn {
        padding: 12px 28px;
        font-size: 0.95rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .lightbox {
        padding: 1rem;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .lightbox-nav.prev { left: 8px; }
    .lightbox-nav.next { right: 8px; }
}

@media (max-width: 480px) {
    .gallery-masonry {
        column-count: 1;
    }
}
