* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 15px;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

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

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

.update-time {
    font-size: 14px;
    opacity: 0.9;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
}

.stat-card .label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card .value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.table-container {
    padding: 0 30px 30px 30px;
    overflow-x: auto;
}

.filter-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 0 30px;
    align-items: center;
}

.filter-select, .page-size-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 120px;
}

.filter-select:focus, .page-size-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

th.number {
    text-align: right;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

td.number {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

td.error-row {
    color: #dc3545;
    text-align: center;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

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

tfoot {
    background: #f8f9fa;
    font-weight: bold;
}

tfoot td {
    padding: 15px;
    border-top: 2px solid #667eea;
    border-bottom: none;
}

.key-cell {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #495057;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 0 30px;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.pagination-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #667eea;
    color: white;
}

.pagination-btn.active {
    background: #667eea;
    color: white;
}

.pagination-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f8f9fa;
}

.refresh-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.refresh-btn:active {
    transform: translateY(0);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.error {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 12px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header-actions {
        flex-direction: column;
        gap: 10px;
    }

    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
        padding: 20px;
    }

    .table-container {
        padding: 0 15px 20px 15px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 15px;
        margin-bottom: 15px;
    }

    .filter-select, .page-size-select {
        width: 100%;
    }

    .pagination {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }

    .refresh-btn {
        bottom: 15px;
        right: 15px;
        padding: 12px 20px;
        font-size: 14px;
    }
}