/* Project Page Layout */
.project-page {
    padding-top: 20px; /* Offset for fixed header */
    padding-bottom: 60px;
    min-height: calc(100vh - 300px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #E91E63;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-style: normal;
    color: #999;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.tab-item {
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-item:hover {
    background: #e0e0e0;
}

.tab-item.active {
    background: #1a1a1a;
    color: #fff;
}

/* Project List Grid */
.project-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

/* Project Card */
.project-card {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-tag {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Tag Colors */
.tag-scene-2 { background: #E3F2FD; color: #1976D2; } /* Video Style */
.tag-scene-5 { background: #FFF3E0; color: #F57C00; } /* Product Image */
.tag-scene-4 { background: #F3E5F5; color: #7B1FA2; } /* Wardrobe */
.tag-scene-8 { background: #E8F5E9; color: #388E3C; } /* Video Gen */
.tag-scene-6 { background: #E0F7FA; color: #0097A7; } /* Translate */
.tag-scene-7 { background: #FCE4EC; color: #C2185B; } /* Clarity */
.tag-default { background: #f5f5f5; color: #666; }

.card-menu {
    color: #999;
    font-size: 20px;
    line-height: 1;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-preview img, .card-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover .preview-overlay {
    opacity: 1;
}

/* Status overlays */
.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    z-index: 2;
}
.status-0 { background: rgba(0,0,0,0.6); } /* Pending */
.status-3 { background: rgba(220, 53, 69, 0.8); } /* Failed */

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    color: #999;
    font-size: 12px;
}

.edit-icon {
    margin-right: 6px;
}

/* Loading & Empty States */
.loading-state, .no-more-data, .empty-state {
    text-align: center;
    padding: 40px 0;
    color: #999;
    width: 100%;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #E91E63;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state img {
    width: 120px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Modal */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.preview-modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: -40px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
}

.preview-container {
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-container img, .preview-container video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Slider Controls */
.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.prev-btn, .next-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    padding: 15px 18px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    margin: 0 -80px; /* PC端放在图片外面 */
    transition: background 0.3s;
}
.prev-btn:hover, .next-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.dots-container {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background: #fff;
}

/* Modal Grid View for Multiple Images */
.modal-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-grid-item {
    position: relative;
    aspect-ratio: 1; /* 保持正方形 */
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    pointer-events: none;
}
.modal-grid-item:hover {
    border-color: #E91E63;
}

.modal-grid-item img {
    height: 100%;
    object-fit: cover;
}

/* Modal Back Button */
.modal-back-btn {
    position: absolute;
    top: -40px;
    left: 0;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.mobile-filter-modal {
        display: none;
}
/* Responsive */
@media (max-width: 768px) {
    .modal-grid-view {
        grid-template-columns: repeat(2, 1fr); /* 手机端一行两个 */
        gap: 10px;
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .modal-content {
       max-width: 100%;
        width: 100%;
    }
    .preview-container video {
        max-height: 60vh; /* 视频在手机上不宜过高 */
    }
    
    .prev-btn, .next-btn {
        margin: 0 10px; /* 移动端箭头移到图片内部边缘 */
        padding: 10px 14px;
        font-size: 18px;
        background: rgba(0, 0, 0, 0.3); /* 更透明一点，减少遮挡 */
    }

    .close-modal {
        top: -50px;
        right: 0px; /* 移动端关闭按钮位置调整 */
    }
    
    .dots-container {
        bottom: -30px;
    }
    
    /* 针对手机端优化图片显示 */
    .preview-container img {
        max-height: 70vh;
    }


    .project-list {
        grid-template-columns: 1fr;
    }

    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        width: 100%;
    }
    
    .prev-btn { margin-left: 10px; }
    .next-btn { margin-right: 10px; }

    /* Mobile Filter Logic */
    .filter-tabs {
        display: none; /* Hide PC tabs */
    }

    .mobile-filter-bar {
        display: block !important;
        margin-bottom: 20px;
    }

    .mobile-filter-trigger {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f5f5f5;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 14px;
        color: #333;
        cursor: pointer;
    }

    /* Mobile Filter Modal (Action Sheet Style) */
    .mobile-filter-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1001;
        justify-content: center;
    }

    .mobile-filter-modal.active {
        display: flex;
    }

    .mobile-filter-wrapper {
        width: 100%;
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        max-height: 70vh;
        overflow-y: auto;
        animation: slideUp 0.3s ease-out;
        height: 400px;
        margin-top: 300px;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .mobile-filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
    }

    .mobile-filter-header h3 {
        font-size: 18px;
        font-weight: 600;
        margin: 0;
    }

    .close-filter {
        font-size: 24px;
        color: #999;
        cursor: pointer;
    }

    .mobile-filter-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-filter-list .filter-option {
        padding: 12px 15px;
        background: #f9f9f9;
        border-radius: 8px;
        text-align: center;
        font-size: 15px;
        color: #666;
        cursor: pointer;
    }

    .mobile-filter-list .filter-option.active {
        background: #1a1a1a;
        color: #fff;
    }
}

@media (min-width: 769px) {
    .modal-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        min-width: 400px;
        max-width: 900px;
    }
}

/* 个人中心卡片样式 */
.user-profile-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.user-main-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-wrapper {
    width: 60px;
    height: 60px;
    background: #f0f2f5;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-avatar-img {
    width: 35px;
    height: 35px;
}

.user-top-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.username {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.user-id-tag {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.user-membership {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vip-icon {
    width: 14px;
    height: 14px;
}

.expire-text {
    font-size: 13px;
    color: #666;
}

.user-assets {
    display: flex;
    align-items: center;
    gap: 24px;
}

.asset-item {
    text-align: right;
}

.asset-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.asset-value {
    font-size: 24px;
    font-weight: 700;
    color: #E91E63;
    font-family: 'DIN Alternate', sans-serif;
}

.recharge-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.recharge-btn:hover {
    background: #333;
    transform: translateY(-2px);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .user-profile-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 20px;
    }
    
    .user-assets {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid #eee;
        padding-top: 15px;
    }
    
    .asset-item {
        text-align: left;
    }

    .asset-value {
        font-size: 20px;
    }
}