/* 桦戈计费重 - 20列计费重结果表样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 30px 0 20px;
}

.header h1 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.subtitle {
    color: #888;
    font-size: 14px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card h2 {
    font-size: 18px;
    color: #1a1a2e;
    margin-bottom: 12px;
}

/* Upload Section */
.upload-hint {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.file-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .file-grid {
        grid-template-columns: 1fr;
    }
}

.file-slot {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 16px;
    background: #fafafa;
    transition: all 0.2s;
    min-height: 150px;
    display: flex;
    flex-direction: column;
}

.file-slot.has-file {
    border-color: #10b981;
    border-style: solid;
    background: #f0fdf4;
}

.file-slot:hover {
    border-color: #2563eb;
}

.slot-header {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.slot-hint {
    font-size: 11px;
    color: #aaa;
    margin: 6px 0;
    text-align: center;
}

.slot-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.slot-empty {
    color: #ccc;
    font-size: 14px;
}

.slot-uploading {
    color: #2563eb;
    font-size: 14px;
}

.slot-file {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex-wrap: wrap;
    justify-content: center;
}

.file-icon {
    font-size: 18px;
}

.file-name {
    color: #333;
    font-weight: 500;
    word-break: break-all;
    max-width: 140px;
}

.file-size {
    color: #888;
    font-size: 12px;
}

.btn-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-remove:hover {
    background: #fef2f2;
}

.slot-error {
    color: #dc2626;
    font-size: 13px;
    text-align: center;
}

.btn-retry {
    display: block;
    margin: 6px auto 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-retry:hover {
    background: #eee;
}

.upload-actions {
    margin-top: 8px;
    text-align: center;
}

.btn-upload {
    padding: 6px 16px;
    font-size: 13px;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: #dbeafe;
    border-color: #2563eb;
}

/* Drop Zone */
.drop-zone {
    position: relative;
}

.drop-zone.drag-over .file-grid {
    opacity: 0.3;
    pointer-events: none;
}

.drop-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(37, 99, 235, 0.08);
    border: 3px dashed #2563eb;
    border-radius: 12px;
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.drop-zone.drag-over .drop-overlay {
    display: flex;
}

.drop-icon {
    font-size: 48px;
}

.drop-text {
    font-size: 18px;
    font-weight: 600;
    color: #2563eb;
}

@media (max-width: 768px) {
    .drop-icon { font-size: 32px; }
    .drop-text { font-size: 15px; }
}

/* Pipeline Steps */
.pipeline-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 130px;
}

.step-num {
    width: 28px;
    height: 28px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.step-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.step-script {
    font-size: 10px;
    color: #888;
    background: #eee;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.step-arrow {
    font-size: 22px;
    color: #2563eb;
    font-weight: 700;
}

/* Generate Section */
.generate-card {
    text-align: center;
}

/* ===== 命名区（顶部显眼位置） ===== */
.name-card {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border: 2px solid #a5b4fc;
    padding: 16px 24px;
    margin-bottom: 16px;
}

.name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.name-label {
    font-size: 17px;
    font-weight: 700;
    color: #4338ca;
    white-space: nowrap;
}

.name-input {
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #a5b4fc;
    border-radius: 8px;
    width: 320px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
}

.name-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.name-input::placeholder {
    color: #bbb;
    font-size: 13px;
}

.name-suffix {
    font-size: 15px;
    font-weight: 600;
    color: #6366f1;
}

.btn-primary {
    width: 100%;
    max-width: 420px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.5;
}

.btn-primary.ready {
    opacity: 1;
}

.btn-primary:disabled {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:not(:disabled):hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.generate-log {
    margin-top: 16px;
    text-align: left;
}

.generate-log pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.generate-log pre strong {
    color: #89b4fa;
    display: block;
    margin: 4px 0;
}

.log-ok {
    color: #a6e3a1;
}

.log-err {
    color: #f38ba8;
}

.log-error {
    color: #f38ba8;
}

/* Result Section */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.result-meta {
    font-size: 14px;
    color: #333;
}

.result-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-primary-dl {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #059669, #047857);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-dl:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 2px 8px rgba(5,150,105,0.3);
}

.btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #eee;
    color: #333;
}

/* Error Card */
.error-card {
    border-left: 4px solid #dc2626;
}

.error-card h2 {
    color: #dc2626;
}

.error-card p {
    margin-bottom: 16px;
    color: #666;
}

/* History */
.history-card h2 {
    margin-bottom: 16px;
}

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

.history-table thead th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

.history-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.history-table tbody tr:hover {
    background: #f8faff;
}

.history-name {
    font-weight: 500;
    color: #1a1a2e;
    word-break: break-all;
    max-width: 350px;
}

.btn-dl-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
    background: #eff6ff;
}

.btn-dl-link:hover {
    background: #dbeafe;
}

.history-empty {
    color: #aaa;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    color: #aaa;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

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

    .card {
        padding: 16px;
    }

    .file-grid {
        gap: 8px;
    }

    .history-table {
        font-size: 12px;
    }

    .history-table thead th,
    .history-table tbody td {
        padding: 6px 8px;
    }
}