/* 弹窗模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}
.modal-close:hover { background: rgba(239, 68, 68, 0.3); border-color: #ef4444; }
.modal-video { max-width: 80vw; max-height: 80vh; }
.modal-video video { width: 100%; height: 100%; max-height: 80vh; border-radius: 12px; }
.modal-gallery { padding: 2rem; max-width: 92vw; max-height: 92vh; overflow-y: auto; }
.modal-gallery h3 { margin-bottom: 1.5rem; font-size: 1.5rem; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}
.gallery-grid img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: pointer;
}
.gallery-grid img:hover { transform: scale(1.05); }

.gallery-group-label {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0.8rem 0 0.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0.2rem;
}
.gallery-group-label:first-child { padding-top: 0; }

/* 灯箱 */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
    user-select: none;
}
.lightbox-close {
    position: fixed;
    top: 1.2rem; right: 1.5rem;
    font-size: 2.2rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    z-index: 10000;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-arrow {
    position: fixed;
    top: 50%; transform: translateY(-50%);
    font-size: 2.5rem;
    color: #fff;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    z-index: 10000;
    padding: 0.5rem 1rem;
    user-select: none;
}
.lightbox-arrow:hover { opacity: 1; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-counter {
    position: fixed;
    bottom: 1.5rem; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    z-index: 10000;
}
.modal-placeholder {
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}
.modal-placeholder .icon { font-size: 4rem; margin-bottom: 1rem; }

/* 项目卡片可点击指示 */
.project-card, .showcase-card {
    cursor: pointer;
    position: relative;
}
.project-card::after, .showcase-card::after {
    content: '点击查看';
    position: absolute;
    top: 1rem; right: 1rem;
    padding: 0.3rem 0.8rem;
    background: rgba(99, 102, 241, 0.8);
    border-radius: 20px;
    font-size: 0.75rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.project-card:hover::after, .showcase-card:hover::after { opacity: 1; }

/* ── Gallery Tabs ─────────────────────────────────────────── */
.gallery-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.gallery-tab {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.gallery-tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
.gallery-tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    color: #fff;
}

/* ── Gallery Panels ──────────────────────────────────────── */
.gallery-panel { width: 100%; }
/* 3D 预览面板 — 撑满弹窗 */
#galleryPanel3d {
    min-height: 70vh;
    width: 100%;
    position: relative;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
}
#galleryPanel3d canvas {
    width: 100% !important;
    height: calc(100% - 50px) !important;
    display: block;
}

/* 3D 控制面板 */
.viewer3d-controls {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 1.5rem;
    z-index: 10;
    pointer-events: none;
}
.control-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    pointer-events: auto;
}
.control-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-right: 0.25rem;
}
.display-mode-btn, .env-btn {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.display-mode-btn:hover, .env-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.display-mode-btn.active, .env-btn.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
    color: #fff;
}

/* 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    user-select: none;
    padding: 0.35rem 0.7rem;
    background: rgba(0,0,0,0.4);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    transition: all 0.2s;
    pointer-events: auto;
}
.checkbox-label:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #8b5cf6;
    cursor: pointer;
}

/* ── 3D Viewer Placeholder ──────────────────────────────── */
.viewer3d-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 0.75rem;
    color: rgba(255,255,255,0.7);
}
.viewer3d-icon { font-size: 4rem; opacity: 0.5; }
.viewer3d-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}
.viewer3d-desc {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.45);
    text-align: center;
    line-height: 1.6;
    margin: 0;
}
.viewer3d-badge {
    margin-top: 0.5rem;
    padding: 0.3rem 1rem;
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.4);
    border-radius: 2rem;
    font-size: 0.75rem;
    color: #a5b4fc;
    letter-spacing: 0.05em;
}

/* 模型选择器 */
.model-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.model-btn {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.model-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.model-hint {
    color: var(--text-dim);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

/* 视频选择器 */
.video-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.video-btn {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.video-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* 媒体类型选择器（视频/图片）带缩略图 */
.media-selector {
    display: none; /* 现在用 gallery-tabs 了 */
}

/* 横向滚动布局 */
.gallery-grid.horizontal-scroll {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.gallery-grid.horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}

.gallery-grid.horizontal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-grid.horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* 横向视频卡片 */
.gallery-grid.horizontal-scroll .showcase-card {
    flex: 0 0 280px;
    height: 180px;
    scroll-snap-align: start;
    position: relative;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.gallery-grid.horizontal-scroll .showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.25);
    border-color: var(--primary);
}

.gallery-grid.horizontal-scroll .card-video-preview {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e1e2e, #2d2d44);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-grid.horizontal-scroll .card-video-preview .play-icon {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    opacity: 0.9;
}

.gallery-grid.horizontal-scroll .showcase-card:hover .play-icon {
    opacity: 1;
    transform: scale(1.1);
}

.gallery-grid.horizontal-scroll .card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 横向图片缩略图 */
.gallery-grid.horizontal-scroll .lightbox-thumb {
    flex: 0 0 260px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.gallery-grid.horizontal-scroll .lightbox-thumb:hover {
    border-color: var(--primary);
    transform: scale(1.02);
}

.gallery-grid.horizontal-scroll .lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── 链接选择页面 ───────────────────────────────────────── */
.gallery-grid.links-grid {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 2rem;
    gap: 1.5rem;
    grid-template-columns: unset !important;
}

.links-container {
    text-align: center;
    width: 100%;
    max-width: 480px;
}

.links-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.link-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25);
}

.link-card:hover::before {
    opacity: 1;
}

.link-icon {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.link-name {
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.link-arrow {
    margin-left: auto;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--accent);
}

.link-card:hover .link-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* 视频卡片列表（参考 showcase-card） */
