/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4472C4;
    --primary-dark: #365A9E;
    --primary-light: #E8EEF8;
    --success: #28a745;
    --success-light: #d4edda;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== 布局容器 ==================== */
.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ==================== 顶部标题栏 ==================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #4472C4 0%, #5B7FD1 100%);
    color: #fff;
    padding: 24px 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 2px;
}

.subtitle {
    font-size: 13px;
    opacity: 0.85;
}

.header-right .btn-outline {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.header-right .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

/* ==================== 统计概览 ==================== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-total { border-left-color: var(--primary); }
.stat-unverified { border-left-color: var(--warning); }
.stat-verified { border-left-color: var(--success); }
.stat-rate { border-left-color: #6f42c1; }

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

.stat-total .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-unverified .stat-icon { background: var(--warning-light); color: #856404; }
.stat-verified .stat-icon { background: var(--success-light); color: var(--success); }
.stat-rate .stat-icon { background: #f0e6ff; color: #6f42c1; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==================== 主内容区 ==================== */
.main-content {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ==================== 面板 ==================== */
.panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.panel-body {
    padding: 24px;
}

/* ==================== 上传区域 ==================== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area.dragover {
    transform: scale(1.02);
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-area:hover .upload-icon,
.upload-area.dragover .upload-icon {
    color: var(--primary);
}

.upload-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.import-result {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.import-result.success {
    background: var(--success-light);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.import-result.error {
    background: var(--danger-light);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==================== 查询栏 ==================== */
.query-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.query-field {
    flex: 1;
    min-width: 160px;
}

/* ==================== 输入框 ==================== */
.input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(68, 114, 196, 0.1);
}

select.input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(68, 114, 196, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: #f5f5f5;
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ==================== 批量操作栏 ==================== */
.batch-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.batch-bar.show {
    display: flex;
}

.batch-info {
    font-size: 14px;
    color: var(--text-primary);
    margin-right: auto;
}

.batch-info strong {
    color: var(--primary);
}

/* ==================== 表格 ==================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

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

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

.col-check { width: 40px; text-align: center; }
.col-id { width: 60px; }
.col-action { width: 140px; text-align: center; }

.data-table th.col-check,
.data-table td.col-check {
    text-align: center;
}

.data-table th.col-action,
.data-table td.col-action {
    text-align: center;
}

/* 复选框 */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.unverified {
    background: var(--warning-light);
    color: #856404;
}

.status-badge.verified {
    background: var(--success-light);
    color: #155724;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.unverified::before { background: var(--warning); }
.status-badge.verified::before { background: var(--success); }

/* 操作按钮 */
.action-btn {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin: 0 2px;
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.action-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-light);
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 15px;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 10px;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

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

.page-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 12px;
}

/* ==================== 危险区域 ==================== */
.danger-zone {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid #f5c6cb;
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}

.danger-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.danger-info strong {
    color: var(--danger);
    font-size: 15px;
}

.danger-info span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==================== Toast 提示 ==================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: slideIn 0.3s ease;
}

.toast.success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.toast.error { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.toast.info { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    to { transform: translateX(120%); opacity: 0; }
}

.toast.removing {
    animation: slideOut 0.3s ease forwards;
}

/* ==================== 确认对话框 ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-icon {
    color: var(--danger);
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn {
    min-width: 100px;
}

/* ==================== 页脚 ==================== */
.app-footer {
    text-align: center;
    padding: 24px 0 12px;
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.8;
    letter-spacing: 0.5px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 16px;
    }

    .app-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .query-bar {
        flex-direction: column;
    }

    .query-field {
        min-width: 100%;
    }
}
