/* =============================================
   电商AI图片生成平台 - 自定义样式
   ============================================= */

:root {
    --primary-color: #4361ee;
    --primary-light: #e8ecff;
    --success-color: #2ec4b6;
    --warning-color: #ff9f1c;
    --danger-color: #e71d36;
    --dark-color: #2b2d42;
    --gray-light: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #f5f7fb;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Task Card */
.task-card {
    cursor: pointer;
    overflow: hidden;
}
.task-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background-color: #e9ecef;
}
.task-card .card-img-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), #dbeafe);
    color: var(--primary-color);
    font-size: 3rem;
}

/* Status Badge */
.badge-pending { background-color: #6c757d; }
.badge-prompt_generating { background-color: #fd7e14; }
.badge-generating { background-color: var(--warning-color); }
.badge-completed { background-color: var(--success-color); }
.badge-partial { background-color: #6f42c1; }
.badge-failed { background-color: var(--danger-color); }

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.image-grid-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}
.image-grid-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.image-grid-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
}
.image-grid-item:hover .overlay {
    opacity: 1;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbfc;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

/* Reference Image Preview */
.ref-preview {
    display: inline-block;
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0.25rem;
    border-radius: 8px;
    overflow: hidden;
}
.ref-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ref-preview .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

/* Template Card */
.template-card .before-after {
    display: flex;
    gap: 4px;
    height: 160px;
}
.template-card .before-after img {
    flex: 1;
    object-fit: cover;
    border-radius: 4px;
}

/* Dashboard Stats */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: #fff;
}
.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
}
.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Progress Bar Animation */
.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: #fff;
    padding: 4rem 0;
}
.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Feature Cards */
.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
}
.feature-card .icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Admin Sidebar */
.admin-sidebar .nav-link {
    color: #555;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin-bottom: 2px;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section { padding: 2rem 0; }
    .hero-section h1 { font-size: 1.75rem; }
    .image-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Toast */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

/* Mode Selector */
.mode-card {
    cursor: pointer;
    border: 2px solid #dee2e6;
    transition: all 0.2s;
}
.mode-card:hover {
    transform: translateY(-2px);
}
.mode-card.active {
    border-width: 2px;
    background: linear-gradient(135deg, #f8f9ff, #fff);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.15);
}
.mode-card.active.border-warning {
    background: linear-gradient(135deg, #fffcf5, #fff);
    box-shadow: 0 4px 15px rgba(255, 159, 28, 0.15);
}
