* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #666;
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    background: #e0e0e0;
    color: #333;
}

.btn:hover {
    background: #d0d0d0;
}

.btn-primary {
    background: #555;
    color: #fff;
}

.btn-primary:hover {
    background: #444;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-success {
    background: #28a745;
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 提示框 */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 应用布局 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: #343a40;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 18px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item .icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.sidebar-footer .icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-footer .user-info {
    flex: 1;
    font-size: 14px;
}

.logout-btn {
    color: #dc3545;
    text-decoration: none;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #f0f2f5;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page h1 {
    margin-bottom: 30px;
    color: #333;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    color: #888;
    margin-top: 5px;
}

/* 卡片 */
.card {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 20px;
    color: #333;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.table tr:hover {
    background: #f8f9fa;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #888;
    background: #fafafa;
}

.upload-area.dragover {
    border-color: #666;
    background: #f5f5f5;
}

.upload-icon {
    margin-bottom: 15px;
    color: #999;
}

.upload-icon svg {
    width: 50px;
    height: 50px;
    stroke-width: 1.5;
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #555;
    width: 0;
    transition: width 0.3s;
}

.progress-text {
    margin-top: 10px;
    color: #666;
}

.upload-result {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.result-stats {
    margin: 15px 0;
}

.result-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.result-row .label {
    width: 140px;
    color: #666;
}

.result-row .value {
    font-weight: 500;
}

.result-row .value.success {
    color: #28a745;
    font-size: 18px;
}

.result-row.highlight {
    background: #fff3cd;
    margin: 0 -10px;
    padding: 8px 10px;
}

.result-row.total {
    background: #d4edda;
    margin: 0 -10px;
    padding: 10px;
    border: none;
}

.country-stats {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #eee;
}

.country-stats h4 {
    margin-bottom: 10px;
    color: #333;
}

.country-stats ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.country-stats li {
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.download-buttons {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.download-buttons .btn {
    margin-right: 10px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filter-bar input[type="date"] {
    width: 140px;
}

.filter-bar input[type="text"] {
    width: 150px;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover,
.pagination .active {
    background: #555;
    color: #fff;
    border-color: #555;
}

.pagination .ellipsis {
    border: none;
    padding: 8px 5px;
}

.pagination .page-jump {
    margin-left: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination .page-jump input {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.pagination-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

/* 日期范围 */
.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

/* 单选组 */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
}

.modal-content h3 {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 复选框 */
.checkbox-cell {
    width: 40px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 状态标签 */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* 响应式 */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }

    .nav-item {
        white-space: nowrap;
    }

    .filter-bar {
        flex-direction: column;
    }
}


/* 日期选择器样式 */
.flatpickr-day.has-data {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.flatpickr-day.has-data:hover {
    background: #c8e6c9;
}

.flatpickr-day.selected {
    background: #555 !important;
    border-color: #555 !important;
}

.flatpickr-day.flatpickr-disabled-date {
    color: #ddd;
}

.flatpickr-calendar {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}


/* 上传模式选择器 */
.upload-mode-selector {
    display: flex;
    gap: 20px;
}

.mode-option {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-option:hover {
    border-color: #888;
}

.mode-option input[type="radio"] {
    margin-top: 3px;
    margin-right: 12px;
}

.mode-option input[type="radio"]:checked+.mode-label {
    color: #333;
}

.mode-option:has(input:checked) {
    border-color: #555;
    background: #f8f9fa;
}

.mode-label {
    display: flex;
    flex-direction: column;
}

.mode-label strong {
    font-size: 15px;
    margin-bottom: 4px;
}

.mode-label small {
    color: #888;
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .upload-mode-selector {
        flex-direction: column;
    }
}