/* ============================================
   作品集网站 - 主样式表 v2
   参考：GGAC.com + 魔灯游戏场景官网
   风格：暗色艺术展示平台
   ============================================ */

/* CSS 变量 */
:root {
    --bg-body: #0d0d12;
    --bg-card: #16161e;
    --bg-card-hover: #1e1e2a;
    --bg-surface: #12121a;
    --bg-nav: rgba(13, 13, 18, 0.92);
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555566;
    --accent: #7c5cfc;
    --accent-light: #a78bfa;
    --accent-glow: rgba(124, 92, 252, 0.25);
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --tag-bg: rgba(124, 92, 252, 0.12);
    --tag-color: #a78bfa;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 2px 16px rgba(0,0,0,0.4);
    --shadow-hover: 0 8px 32px rgba(124,92,252,0.18);
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
}

img {
    max-width: 100%;
    display: block;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ============================================
   密码验证
   ============================================ */
.password-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.password-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 56px 48px;
    text-align: center;
    max-width: 420px;
    width: 92%;
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.5s ease;
}

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

.password-icon {
    font-size: 52px;
    margin-bottom: 20px;
}

.password-box h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.password-box p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 14px;
}

#password-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: 2px;
    transition: var(--transition);
}

#password-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#password-input::placeholder {
    letter-spacing: 0;
    color: var(--text-muted);
}

#password-btn {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    transition: var(--transition);
}

#password-btn:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-hover);
}

.password-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 14px;
    display: none;
}

.password-error.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 32px;
}

.nav-left,
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-left {
    flex: 1;
    gap: 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.nav-brand:hover { opacity: 0.7; }

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

.brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-link {
    padding: 8px 18px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.nav-link.active {
    color: #fff;
    background: var(--accent);
}

/* ============================================
   Hero 区域（首页）
   ============================================ */
.hero {
    position: relative;
    padding: 100px 40px 80px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.5;
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--accent-light);
    margin-bottom: 10px;
    letter-spacing: 6px;
    font-weight: 500;
}

.hero-desc {
    font-size: 15px;
    color: var(--text-muted);
}

/* ============================================
   首页分类网格
   ============================================ */
.categories-section {
    padding: 20px 0 100px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}

.category-card-cover {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
    position: relative;
    overflow: hidden;
}

.category-card-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(transparent, var(--bg-card));
}

.category-card-info {
    padding: 16px 18px 18px;
    position: relative;
}

.category-card-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.category-card-count {
    display: inline-block;
    padding: 3px 12px;
    background: var(--tag-bg);
    color: var(--tag-color);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   分类页
   ============================================ */
.category-header {
    padding: 40px 0 20px;
}

.category-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
}

.category-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

/* 筛选标签栏 */
.filter-section {
    padding: 16px 0 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    padding: 7px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.filter-tag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.filter-tag.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ============================================
   作品卡片网格（分类页）
   ============================================ */
.works-section {
    padding: 0 0 60px;
}

/* 区域标题 */
.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.section-icon {
    font-size: 26px;
    line-height: 1;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0;
}

.section-count {
    font-size: 13px;
    color: #888;
    background: rgba(255,255,255,0.05);
    padding: 3px 12px;
    border-radius: 20px;
    margin-left: auto;
}

/* 视频区域与图片区域之间的分隔 */
#image-section {
    margin-top: 20px;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.work-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
}

.work-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
}

.work-card-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-surface);
}

.work-card-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.work-card:hover .work-card-cover-wrap img {
    transform: scale(1.05);
}

.work-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
}

/* 类型角标 */
.work-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    font-size: 11px;
    color: #fff;
    font-weight: 600;
}

.work-card-info {
    padding: 14px 16px 16px;
}

.work-card-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-card-subtitle {
    font-size: 12px;
    color: var(--accent-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.work-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.work-card-tag {
    padding: 3px 10px;
    background: rgba(0, 206, 201, 0.1);
    color: #00cec9;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.no-works {
    text-align: center;
    padding: 100px 0;
    color: var(--text-muted);
    font-size: 16px;
}

/* ============================================
   作品详情页
   ============================================ */
.work-detail {
    padding: 32px 0 100px;
}

.work-header {
    margin-bottom: 28px;
}

.work-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 1px;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.work-tag {
    padding: 5px 16px;
    background: var(--tag-bg);
    color: var(--tag-color);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

/* 视频播放器 */
.work-video-section {
    margin-bottom: 32px;
}

.video-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 18px;
    background: var(--bg-surface);
}

/* 图片画廊 */
.work-gallery-section {
    margin-bottom: 32px;
}

.gallery-main {
    position: relative;
    width: 100%;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    margin-bottom: 10px;
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    color: #fff;
    border-radius: 50%;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
}

.gallery-main:hover .gallery-prev,
.gallery-main:hover .gallery-next {
    opacity: 1;
}

.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.gallery-prev:hover, .gallery-next:hover {
    background: var(--accent);
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.gallery-thumbs img {
    width: 88px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.4;
    transition: var(--transition);
    flex-shrink: 0;
    border: 2px solid transparent;
}

.gallery-thumbs img.active,
.gallery-thumbs img:hover {
    opacity: 1;
    border-color: var(--accent);
}

/* 作品信息 */
.work-info {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 36px;
}

.work-desc h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
}

.work-desc p {
    color: var(--text-secondary);
    line-height: 1.9;
    font-size: 14px;
}

.work-meta {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.meta-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.meta-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* 灯箱 */
.lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    cursor: zoom-out;
}

.lightbox.hidden { display: none; }

.lightbox-close {
    position: absolute;
    top: 24px; right: 32px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 9999;
    transition: color 0.2s;
    line-height: 1;
}

.lightbox-close:hover { color: var(--accent-light); }

#lightbox-img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    border-radius: 4px;
}

/* 自定义分享链接 */
.external-link-section {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.external-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.external-link-btn:hover {
    background: var(--accent-light);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* ============================================
   通用
   ============================================ */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 8px 0;
    margin-bottom: 16px;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--accent-light);
}

/* ============================================
   数据加载状态提示
   ============================================ */
.data-status {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10000;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    pointer-events: none;
    animation: fadeInUp 0.3s ease;
}
.data-status.success { display: none; }
.data-status.loading {
    background: rgba(124, 92, 252, 0.15);
    color: var(--accent-light);
    border: 1px solid rgba(124, 92, 252, 0.3);
}
.data-status.cache {
    background: rgba(253, 203, 110, 0.15);
    color: #fdcb6e;
    border: 1px solid rgba(253, 203, 110, 0.3);
}
.data-status.fallback {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ============================================
   关于我（首页底部）
   ============================================ */
.about-section {
    padding: 80px 0 100px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.about-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.about-intro {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 2;
    max-width: 760px;
    margin-bottom: 36px;
    white-space: pre-wrap;
}

.about-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 48px;
    max-width: 900px;
}

.about-skill-tag {
    padding: 9px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.about-skill-tag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(124,92,252,0.08);
}

.about-contact {
    max-width: 900px;
    border-top: 1px solid var(--border);
    padding-top: 32px;
}

.contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.contact-row:last-child {
    margin-bottom: 0;
}

.contact-item {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.contact-label {
    min-width: 42px;
    font-size: 14px;
    color: var(--accent-light);
    font-weight: 600;
}

.contact-value {
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
}

@media (max-width: 768px) {
    .about-title {
        font-size: 28px;
    }
    .contact-row {
        grid-template-columns: 1fr;
    }
}

/* 页脚 */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1100px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 32px;
    }

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

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .work-info {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 60px 16px 40px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
}
