/* 公共样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: var(--background-color, #f5f7fa);
    color: var(--text-color, #333);
    line-height: 1.6;
}

:root {
    --button-text-color: #ffffff;
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --background-color: #f5f7fa;
    --card-background-color: #ffffff;
    --text-color: #333;
    --title-color: #2c3e50;
    --subtitle-color: #555;
    --border-color: #e9ecef;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo i {
    font-size: 32px;
    margin-right: 15px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
}

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

.merchant-name {
    font-size: 16px;
    font-weight: 500;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 容器样式 */
.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 30px;
}

/* 按钮样式 */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--button-text-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: var(--success-color);
    color: var(--button-text-color);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--button-text-color);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--button-text-color);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 消息提示样式 */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.message.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.message.warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffcc02;
}

.message.info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.message i {
    margin-right: 10px;
    font-size: 20px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.table tr:hover {
    background-color: #f8f9fa;
}

/* 状态标签 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-qualified {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-unqualified {
    background-color: #ffebee;
    color: #c62828;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Merchant Dashboard Specific Styles */
.dashboard-header {
    text-align: center;
    padding: 2rem;
}

.dashboard-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    font-size: 1.1rem;
    color: var(--subtitle-color);
}

.date-filter-card {
    padding: 1.5rem;
}

.date-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.date-filter-form .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.date-filter-form label {
    font-size: 0.9rem;
    color: var(--subtitle-color);
}

.date-filter-form input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.date-filter-form .btn {
    padding: 10px 20px;
    font-size: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card p {
    color: var(--subtitle-color);
    margin-bottom: 0.5rem;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--title-color);
}

.stat-card.penalty h3 {
    color: var(--danger-color);
}

.chart-container {
    height: 400px;
    padding: 2rem;
}

.image-gallery-container h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--title-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.image-date-group {
    margin-bottom: 2rem;
}

.image-date-group h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.image-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-card .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s, background-color 0.3s;
}

.image-card:hover .delete-btn {
    opacity: 1;
}

.image-card .delete-btn:hover {
    background: rgba(220, 53, 69, 1);
}

.no-images {
    text-align: center;
    padding: 3rem;
    color: var(--subtitle-color);
}

.footer {
    text-align: center;
    padding: 2rem 0;
    color: #888;
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* SweetAlert2 弹窗自定义样式 */
.swal2-popup {
   
    align-items: center;
    justify-content: center;
}

.swal2-image-popup .swal2-image {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
}

.swal2-image-container {
    position: relative;
}

.swal-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swal-image-wrapper .swal2-image {
    max-width: 100%;
    max-height: 70vh;
}

.swal2-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 1060; /* 确保在图片之上 */
}

.swal2-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.swal2-nav-btn.prev {
    left: 10px;
}

.swal2-nav-btn.next {
    right: 10px;
}

.swal2-close-button-custom {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #fff;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 1061;
}

.swal2-close-button-custom:hover {
    background: rgba(0,0,0,0.8);
    color: #fff;
}

/* 数据表格样式 */
.data-table-container {
    padding: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.data-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.data-table tbody tr:hover {
    background-color: #e9ecef;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    color: #fff;
    font-size: 0.85em;
    min-width: 60px;
    display: inline-block;
}

.status-qualified {
    background-color: #28a745;
}

.status-unqualified {
    background-color: #dc3545;
}

/* 图片Tab样式 */
.image-tabs .tab-header {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 15px;
}

.image-tabs .tab-link {
    background-color: transparent;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1rem;
    color: #495057;
    transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.image-tabs .tab-link:hover {
    color: #007bff;
}

.image-tabs .tab-link.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
    font-weight: 600;
}

.image-tabs .tab-content {
    display: none;
}

.image-tabs .tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .date-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}


/* 页面头部 */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.page-header .header-content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header .logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.page-header .main-nav {
    display: flex;
    gap: 20px;
}

.page-header .nav-link {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 15px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.page-header .nav-link.active,
.page-header .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.page-header .header-actions .logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.page-header .header-actions .logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* 移动端菜单样式 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-background-color);
    border-radius: 8px;
    margin-top: 1rem;
}

.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.mobile-menu a:hover {
    background-color: var(--primary-color-light);
}

@media (max-width: 768px) {
    .container {
        margin: 10px auto;
        padding: 0 10px;
    }
    
    .upload-container, .recent-uploads {
        padding: 1.5rem;
    }
    
    .upload-header h2 {
        font-size: 1.5rem;
    }
    
    #upload-area {
        padding: 2rem 1rem;
    }
    
    #upload-area i {
        font-size: 3rem;
    }
    
    .recent-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .date-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .date-btn {
        width: 100%;
    }
    
    /* 移动端菜单显示 */
    .desktop-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-menu.active {
        display: flex;
    }
}