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

body {
    font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f5f3ff;
    color: #1a1a2e;
    min-height: 100vh;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* 欢迎区 */
.welcome {
    margin-bottom: 32px;
}

.welcome h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.welcome p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

/* 主网格布局 */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    align-items: start;
}

.left-col,
.right-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hidden {
    display: none !important;
}

/* 模式选择卡片 */
.mode-cards {
    display: flex;
    gap: 12px;
}

.mode-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-card:hover {
    border-color: #7c3aed;
}

.mode-card.active {
    border-color: #7c3aed;
    background: #f5f3ff;
}

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

.upload-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.email-icon {
    background: #7c3aed;
    color: #fff;
}

.mode-card.active .upload-icon {
    background: #7c3aed;
    color: #fff;
}

.mode-card:not(.active) .email-icon {
    background: #ede9fe;
    color: #7c3aed;
}

.mode-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.mode-info p {
    font-size: 12px;
    color: #9ca3af;
}

/* 上传区 */
.upload-area {
    border: 2px dashed #d8b4fe;
    border-radius: 10px;
    padding: 36px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: #faf5ff;
    margin-bottom: 16px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #7c3aed;
    background: #f3e8ff;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-text {
    font-size: 14px;
    color: #6b7280;
    margin-top: 12px;
}

.upload-hint {
    font-size: 12px;
    color: #a78bfa;
    margin-top: 4px;
}

/* 表单 */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    background: #fff;
}

/* 按钮 */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-start {
    margin-top: 4px;
}

/* 日志区 */
.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.log-header .card-title {
    margin-bottom: 0;
}

.btn-clear-log {
    padding: 4px 12px;
    font-size: 12px;
    color: #9ca3af;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-log:hover {
    color: #6b7280;
    border-color: #d1d5db;
}

.log-area {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 16px;
    min-height: 120px;
    max-height: 420px;
    overflow-y: auto;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.8;
    margin-top: 12px;
}

.log-area::-webkit-scrollbar {
    width: 6px;
}

.log-area::-webkit-scrollbar-track {
    background: transparent;
}

.log-area::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

.log-empty {
    color: #6b7280;
    font-family: "Microsoft YaHei", sans-serif;
}

.log-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 2px;
    padding: 3px 0;
}

.log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 7px;
    flex-shrink: 0;
}

.log-dot.success { background: #34d399; }
.log-dot.info { background: #60a5fa; }
.log-dot.error { background: #f87171; }
.log-dot.warning { background: #fbbf24; }

.log-text {
    color: #e5e7eb;
    word-break: break-all;
}

.log-time {
    color: #6b7280;
    font-size: 11px;
    margin-left: 6px;
}

/* 结果区 */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.result-header .card-title {
    margin-bottom: 0;
}

.result-count {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 4px;
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-export:hover {
    background: #6d28d9;
}

.btn-export:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* 表格 */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    padding: 10px 8px;
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
    white-space: nowrap;
}

td {
    padding: 10px 8px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 13px;
}

td:first-child {
    color: #9ca3af;
    text-align: center;
    width: 36px;
}

tr:hover:not(.empty-row) {
    background: #f9fafb;
}

.empty-row td {
    text-align: center;
    color: #9ca3af;
    padding: 32px;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.fail {
    background: #fee2e2;
    color: #991b1b;
}

.amount-cell {
    font-weight: 600;
    color: #7c3aed;
    white-space: nowrap;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.page-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

.page-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
    border-color: #f3f4f6;
}

.page-info {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 8px;
}

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

    .mode-cards {
        flex-direction: column;
    }
}
