:root {
    --excel-bg: #eff6ff;
    --excel-card: #ffffff;
    --excel-text: #1f2937;
    --excel-soft: #6b7280;
    --excel-line: #dbeafe;
    --excel-primary: #2563eb;
    --excel-primary-dark: #1d4ed8;
    --excel-primary-soft: #eff6ff;

    --excel-success-bg: #f0fdf4;
    --excel-success-text: #166534;
    --excel-error-bg: #fef2f2;
    --excel-error-text: #b91c1c;
    --excel-warning-bg: #fff7ed;
    --excel-warning-text: #c2410c;

    --excel-file-bg: #f6fbf8;
    --excel-file-border: #e3efe8;
    --excel-file-name: #6f9582;
    --excel-file-size: #8aad9a;

    --excel-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    --excel-radius: 24px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    background: var(--excel-bg);
    color: var(--excel-text);
}

button,
input {
    font: inherit;
}

a {
    text-decoration: none;
}

.excel-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

.excel-container {
    width: 100%;
    max-width: 760px;
}

.excel-card {
    background: var(--excel-card);
    border-radius: var(--excel-radius);
    box-shadow: var(--excel-shadow);
    padding: 28px;
}

/* 顶部品牌区 */
.excel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.excel-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.excel-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.excel-brand-text {
    font-size: 16px;
    font-weight: 800;
    color: #1f2937;
    letter-spacing: 0.5px;
}

.excel-back-link {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.excel-back-link:hover {
    color: #2563eb;
}

.excel-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    color: #111827;
}

.excel-subtitle {
    margin-top: 8px;
    text-align: center;
    font-size: 14px;
    color: var(--excel-soft);
}

.excel-dropzone {
    margin-top: 24px;
    border: 2px dashed #bfd7ff;
    border-radius: 20px;
    background: #f8fbff;
    padding: 36px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.excel-dropzone:hover,
.excel-dropzone.dragover {
    background: #eef6ff;
    border-color: var(--excel-primary);
}

.excel-dropzone-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.excel-dropzone-text {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.excel-dropzone-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--excel-soft);
}

/* 主按钮：强制固定高度与排版 */
.excel-btn-primary {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px; /* 强制绝对高度 */
    padding: 0 24px; /* 左右间距 */
    box-sizing: border-box; /* 防止内边距撑破高度 */
    border: 0;
    border-radius: 999px;
    background: var(--excel-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1; /* 消除自带行高差异 */
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.excel-btn-primary:hover {
    background: var(--excel-primary-dark);
    transform: translateY(-1px);
}

.excel-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
    transform: none;
}

/* 上传后操作区，按钮固定在列表上方 */
.excel-action-area {
    margin-top: 16px;
    margin-bottom: 14px;
    display: grid;
    gap: 12px;
}

.excel-action-btn {
    width: 100%;
    margin-top: 0;
}

/* 文件统计 */
.excel-stats {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
}

/* 文件列表：固定高度，可滚动，不挤压主按钮 */
.excel-file-list {
    margin-top: 0;
    display: grid;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.excel-file-list::-webkit-scrollbar {
    width: 8px;
}

.excel-file-list::-webkit-scrollbar-thumb {
    background: #dbe7df;
    border-radius: 999px;
}

.excel-file-list::-webkit-scrollbar-track {
    background: transparent;
}

.excel-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--excel-file-bg);
    border: 1px solid var(--excel-file-border);
}

.excel-file-meta {
    min-width: 0;
}

.excel-file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--excel-file-name);
    opacity: 0.9;
    word-break: break-all;
}

.excel-file-size {
    margin-top: 4px;
    font-size: 12px;
    color: var(--excel-file-size);
}

.excel-file-remove {
    border: 0;
    border-radius: 999px;
    background: #eef2ff;
    color: #334155;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.excel-file-remove:hover {
    background: #e2e8f0;
}

.excel-progress {
    margin-top: 18px;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.excel-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width 0.25s ease;
}

.excel-result {
    margin-top: 18px;
}

.excel-alert {
    border-radius: 16px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.excel-alert-success {
    background: var(--excel-success-bg);
    color: var(--excel-success-text);
    border: 1px solid #bbf7d0;
}

.excel-alert-error {
    background: var(--excel-error-bg);
    color: var(--excel-error-text);
    border: 1px solid #fecaca;
}

.excel-alert-warning {
    background: var(--excel-warning-bg);
    color: var(--excel-warning-text);
    border: 1px solid #fdba74;
}

.excel-result-list {
    margin-top: 12px;
    padding-left: 18px;
}

.excel-result-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center; /* 【新增】强制容器内的所有元素在同一水平线上垂直居中 */
}

/* 【新增】精准消除结果区域内按钮自带的 margin 干扰，让它们绝对平齐 */
.excel-result-actions .excel-btn-primary,
.excel-result-actions .excel-btn-secondary {
    margin: 0; 
}

/* 次级按钮：高度与主按钮严丝合缝对齐 */
.excel-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* 给图标和文字留出完美的间距 */
    height: 48px; /* 与主按钮保持绝对一致的高度 */
    padding: 0 24px; 
    box-sizing: border-box;
    border: 0; 
    border-radius: 999px;
    background: var(--excel-primary-soft); 
    color: var(--excel-primary-dark); 
    font-size: 16px; 
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease; 
    text-decoration: none;
}

.excel-btn-secondary:hover {
    background: var(--excel-line); 
    transform: translateY(-1px); 
}

@media (max-width: 640px) {
    .excel-page {
        align-items: flex-start;
        padding: 16px 12px 24px;
    }

    .excel-card {
        padding: 20px;
        border-radius: 20px;
    }

    .excel-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .excel-title {
        font-size: 24px;
    }

    .excel-dropzone {
        padding: 28px 14px;
    }

    .excel-file-list {
        max-height: 240px;
    }

    .excel-file-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .excel-file-remove {
        width: 100%;
    }

    .excel-result-actions {
        flex-direction: column;
    }

    .excel-btn-secondary,
    .excel-btn-primary {
        width: 100%;
    }
}
