/* ============================================================================
   成长档案列表页 — 样式
   文件：frontend/css/portfolio.css
   前缀：.portfolio-
   说明：统计卡片 / 表格 / 状态标签 / 空状态 / 骨架屏 / 筛选区 / 分页
   ============================================================================ */

/* ==================== 容器 ==================== */
.portfolio-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ==================== 顶部操作栏 ==================== */
.portfolio-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.portfolio-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portfolio-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 搜索框 */
.portfolio-search-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.portfolio-search-icon {
    position: absolute;
    left: 10px;
    color: #bbb;
    font-size: 13px;
    pointer-events: none;
}

.portfolio-search {
    padding: 7px 12px 7px 32px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    width: 200px;
    outline: none;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.portfolio-search:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.12);
}

.portfolio-search::placeholder {
    color: #bbb;
}

/* 筛选下拉 */
.portfolio-filter {
    padding: 7px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    outline: none;
    color: #333;
    min-width: 100px;
    transition: border-color 0.2s;
}

.portfolio-filter:focus {
    border-color: #4285f4;
}

/* ==================== 统计卡片 ==================== */
.portfolio-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.portfolio-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}

.portfolio-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.portfolio-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.portfolio-stat-info {
    flex: 1;
    min-width: 0;
}

.portfolio-stat-number {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.portfolio-stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

/* ==================== 表格容器 ==================== */
.portfolio-table-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* ==================== 表格 ==================== */
.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.portfolio-table thead {
    background: #f8f9fa;
}

.portfolio-table th {
    text-align: left;
    padding: 12px 14px;
    color: #666;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
    user-select: none;
}

.portfolio-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}

.portfolio-table tbody tr {
    transition: background 0.15s;
}

.portfolio-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.portfolio-table tbody tr:hover {
    background: #f0f5ff;
}

.portfolio-table tbody tr:last-child td {
    border-bottom: none;
}

/* 单元格样式 */
.portfolio-cell-name .portfolio-name-text {
    font-weight: 500;
    color: #1a1a2e;
}

.portfolio-cell-works {
    text-align: center;
    font-weight: 600;
    color: #4285f4;
}

.portfolio-cell-time {
    color: #888;
    font-size: 12px;
    white-space: nowrap;
}

.portfolio-cell-actions {
    white-space: nowrap;
}

/* ==================== 操作按钮组 ==================== */
.portfolio-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ==================== 按钮 ==================== */
.portfolio-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.portfolio-btn i {
    font-size: 13px;
}

.portfolio-btn-primary {
    background: #4285f4;
    color: #fff;
}

.portfolio-btn-primary:hover {
    background: #3367d6;
}

.portfolio-btn-primary:active {
    background: #2a56c6;
}

.portfolio-btn-success {
    background: #34a853;
    color: #fff;
}

.portfolio-btn-success:hover {
    background: #2d9249;
}

.portfolio-btn-success:active {
    background: #1e7e34;
}

.portfolio-btn-danger {
    background: #fff;
    color: #e53935;
    border: 1px solid #ffcdd2;
}

.portfolio-btn-danger:hover {
    background: #fff5f5;
    border-color: #e53935;
}

.portfolio-btn-outline {
    background: #fff;
    color: #4285f4;
    border: 1px solid #d2e3fc;
}

.portfolio-btn-outline:hover {
    background: #e8f0fe;
    border-color: #4285f4;
}

/* 按钮尺寸 */
.portfolio-btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.portfolio-btn-xs i {
    font-size: 11px;
}

.portfolio-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 状态标签 ==================== */
.portfolio-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.portfolio-tag-draft {
    background: #f0f0f0;
    color: #888;
}

.portfolio-tag-generated {
    background: #e8f0fe;
    color: #4285f4;
}

.portfolio-tag-published {
    background: #e6f4ea;
    color: #34a853;
}

.portfolio-tag-archived {
    background: #fef3e2;
    color: #fa9d14;
}

/* ==================== 空状态 ==================== */
.portfolio-empty {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.portfolio-empty-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 8px;
}

.portfolio-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.portfolio-empty-desc {
    font-size: 14px;
    color: #999;
    margin-bottom: 8px;
    max-width: 360px;
}

/* ==================== 骨架屏 ==================== */
.portfolio-skeleton {
    padding: 20px;
}

.portfolio-skeleton-row {
    display: flex;
    gap: 16px;
    padding: 14px 4px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.portfolio-skeleton-row:last-child {
    border-bottom: none;
}

.portfolio-skeleton-cell {
    height: 16px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: portfolio-shimmer 1.5s infinite ease-in-out;
    border-radius: 4px;
}

@keyframes portfolio-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 分页 ==================== */
.portfolio-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    border-radius: 0 0 12px 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.portfolio-pagination-info {
    font-size: 13px;
    color: #888;
}

.portfolio-pagination-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.portfolio-page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #555;
    transition: all 0.15s;
}

.portfolio-page-btn:hover:not(:disabled) {
    background: #f0f5ff;
    border-color: #4285f4;
    color: #4285f4;
}

.portfolio-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.portfolio-page-current {
    font-size: 14px;
    font-weight: 600;
    color: #4285f4;
    min-width: 20px;
    text-align: center;
}

.portfolio-page-sep {
    color: #ccc;
    font-size: 13px;
}

.portfolio-page-total {
    color: #888;
    font-size: 13px;
}

.portfolio-pagination-size select {
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    color: #555;
    outline: none;
}

.portfolio-pagination-size select:focus {
    border-color: #4285f4;
}

/* ==================== 详情弹窗 ==================== */
.portfolio-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: portfolio-fade-in 0.15s ease;
}

@keyframes portfolio-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.portfolio-detail-modal {
    background: #fff;
    border-radius: 14px;
    width: 640px;
    max-width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: portfolio-slide-up 0.2s ease;
}

@keyframes portfolio-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.portfolio-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.portfolio-detail-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.portfolio-detail-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}

.portfolio-detail-close:hover {
    background: #f5f5f5;
    color: #333;
}

.portfolio-detail-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.portfolio-detail-loading,
.portfolio-detail-error {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

.portfolio-detail-error {
    color: #e53935;
}

.portfolio-detail-footer {
    padding: 14px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* 详情字段网格 */
.portfolio-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.portfolio-detail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portfolio-detail-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.portfolio-detail-value {
    font-size: 14px;
    color: #333;
}

/* 详情区块 */
.portfolio-detail-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.portfolio-detail-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.portfolio-detail-json {
    background: #f8f9fa;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    color: #333;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre;
    margin: 0;
}

.portfolio-detail-link {
    color: #4285f4;
    text-decoration: none;
    font-size: 13px;
    word-break: break-all;
}

.portfolio-detail-link:hover {
    text-decoration: underline;
}

/* ==================== Toast 消息 ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toast-in 0.3s ease;
    transition: opacity 0.3s, transform 0.3s;
}

.toast-success {
    background: #34a853;
}

.toast-error {
    background: #e53935;
}

.toast-info {
    background: #4285f4;
}

@keyframes toast-in {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .portfolio-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-detail-modal {
        width: 90vw;
    }
}

@media (max-width: 768px) {
    .portfolio-container {
        padding: 14px;
    }

    .portfolio-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .portfolio-toolbar-left {
        flex-direction: column;
        align-items: stretch;
    }

    .portfolio-search {
        width: 100%;
        box-sizing: border-box;
    }

    .portfolio-filter {
        width: 100%;
    }

    .portfolio-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .portfolio-stat-card {
        padding: 14px;
    }

    .portfolio-stat-number {
        font-size: 20px;
    }

    .portfolio-actions {
        flex-direction: column;
        gap: 4px;
    }

    .portfolio-detail-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-pagination {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}

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

    .portfolio-table {
        font-size: 12px;
    }

    .portfolio-table th,
    .portfolio-table td {
        padding: 8px 10px;
    }
}

/* ============================================================================
   成长档案 3D 作品画廊
   前缀：.portfolio-gallery-
   说明：CSS 3D transforms 轮播 / 瀑布流降级 / Lightbox
   ============================================================================ */

/* ==================== 画廊页面容器 ==================== */
.portfolio-gallery-page {
    min-height: calc(100vh - 60px);
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ==================== 顶部信息栏 ==================== */
.portfolio-gallery-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    z-index: 100;
}

.portfolio-gallery-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.portfolio-gallery-back:hover {
    background: rgba(255, 255, 255, 0.15);
}

.portfolio-gallery-info {
    flex: 1;
    text-align: center;
    padding: 0 20px;
    min-width: 0;
}

.portfolio-gallery-student-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.portfolio-gallery-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-gallery-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: rgba(66, 133, 244, 0.85);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.portfolio-gallery-edit-btn:hover {
    background: #4285f4;
}

/* ==================== 3D 舞台容器 ==================== */
.portfolio-gallery-3d-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px 0;
    overflow: hidden;
}

/* ==================== 加载状态 ==================== */
.portfolio-gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.portfolio-gallery-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: portfolio-gallery-spin 0.8s linear infinite;
}

@keyframes portfolio-gallery-spin {
    to { transform: rotate(360deg); }
}

/* ==================== 3D 轮播容器 ==================== */
.portfolio-gallery-3d {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    perspective-origin: 50% 50%;
    position: relative;
}

.portfolio-gallery-3d-stage {
    width: 280px;
    height: 360px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ==================== 作品卡片 ==================== */
.portfolio-gallery-card {
    position: absolute;
    width: 260px;
    height: 340px;
    left: 50%;
    top: 50%;
    margin-left: -130px;
    margin-top: -170px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.6s ease, scale 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
}

.portfolio-gallery-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.portfolio-gallery-card-img-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
}

.portfolio-gallery-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-gallery-card:hover .portfolio-gallery-card-img {
    transform: scale(1.05);
}

.portfolio-gallery-card-info {
    padding: 12px 14px;
    background: #fff;
    flex-shrink: 0;
}

.portfolio-gallery-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portfolio-gallery-card-type {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ==================== 左右箭头 ==================== */
.portfolio-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.portfolio-gallery-arrow:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.portfolio-gallery-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.portfolio-gallery-arrow-left {
    left: 20px;
}

.portfolio-gallery-arrow-right {
    right: 20px;
}

/* ==================== 计数器 ==================== */
.portfolio-gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 50;
}

/* ==================== 空状态 ==================== */
.portfolio-gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
}

.portfolio-gallery-empty .portfolio-empty-icon {
    font-size: 64px;
}

.portfolio-gallery-empty .portfolio-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.portfolio-gallery-empty .portfolio-empty-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    max-width: 360px;
}

/* ==================== 缩略图导航条 ==================== */
.portfolio-gallery-nav {
    flex-shrink: 0;
    padding: 12px 24px 20px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portfolio-gallery-nav-inner {
    display: flex;
    gap: 10px;
    justify-content: center;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.portfolio-gallery-nav-inner::-webkit-scrollbar {
    height: 4px;
}

.portfolio-gallery-nav-inner::-webkit-scrollbar-track {
    background: transparent;
}

.portfolio-gallery-nav-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.portfolio-gallery-nav-dot {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: all 0.25s ease;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.portfolio-gallery-nav-dot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portfolio-gallery-nav-dot:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.3);
}

.portfolio-gallery-nav-dot.active {
    opacity: 1;
    border-color: #4285f4;
    box-shadow: 0 0 12px rgba(66, 133, 244, 0.4);
}

/* ==================== Lightbox ==================== */
.portfolio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.portfolio-lightbox-content {
    position: relative;
    max-width: 85vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    animation: portfolio-lightbox-in 0.3s ease;
}

@keyframes portfolio-lightbox-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.portfolio-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 2;
}

.portfolio-lightbox-close:hover {
    opacity: 1;
}

.portfolio-lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    display: block;
}

.portfolio-lightbox-caption {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    max-width: 600px;
}

/* ==================== 降级：瀑布流布局 ==================== */
.portfolio-gallery-fallback {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.portfolio-gallery-fallback-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.portfolio-gallery-fallback-item {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.portfolio-gallery-fallback-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.portfolio-gallery-fallback-item .portfolio-gallery-card-img-wrap {
    height: 200px;
}

.portfolio-gallery-fallback-item .portfolio-gallery-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .portfolio-gallery-topbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .portfolio-gallery-info {
        order: -1;
        width: 100%;
        text-align: center;
        padding: 0;
    }

    .portfolio-gallery-student-name {
        font-size: 17px;
    }

    .portfolio-gallery-3d-stage {
        width: 200px;
        height: 280px;
    }

    .portfolio-gallery-card {
        width: 190px;
        height: 260px;
        margin-left: -95px;
        margin-top: -130px;
    }

    .portfolio-gallery-arrow {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .portfolio-gallery-arrow-left {
        left: 10px;
    }

    .portfolio-gallery-arrow-right {
        right: 10px;
    }

    .portfolio-gallery-nav-dot {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .portfolio-gallery-3d-stage {
        width: 160px;
        height: 220px;
    }

    .portfolio-gallery-card {
        width: 150px;
        height: 210px;
        margin-left: -75px;
        margin-top: -105px;
    }

    .portfolio-gallery-card-info {
        padding: 8px 10px;
    }

    .portfolio-gallery-card-title {
        font-size: 12px;
    }

    .portfolio-gallery-arrow {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .portfolio-gallery-fallback-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}
