/* 抽凭革命工具 - 样式表（重构版） */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 40px 12px;
    text-align: center;
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区 */
main {
    padding: 24px 32px;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: #333;
}

/* 上传区域 */
.upload-area {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.upload-box {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 28px 32px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    width: 100%;
}

.upload-box:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.upload-box p {
    margin: 4px 0;
    color: #666;
    font-size: 15px;
}

.hint {
    font-size: 0.85rem;
    color: #999;
}

/* 文件信息 */
.file-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 16px;
    margin: 10px 0;
    border-left: 4px solid #667eea;
}

.file-info p {
    margin: 4px 0;
    color: #333;
    font-size: 13px;
}

/* 按钮 */
.btn-primary, .btn-secondary {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    padding: 12px 32px;
    font-size: 1rem;
}

.actions {
    text-align: center;
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 进度条 */
.progress-container {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
}

.progress-anim {
    width: 0%;
    height: 8px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    margin-bottom: 24px;
    transition: width 0.8s ease;
}

.progress-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
}

.progress-hint {
    font-size: 0.9rem;
    color: #999;
}

/* 模式选择 */
.mode-selector {
    max-width: 500px;
    margin: 0 auto 6px;
    text-align: center;
}

.mode-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.mode-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    margin: 0 6px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: top;
}

.mode-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.mode-option input[type="radio"] {
    accent-color: #667eea;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.mode-option input[type="radio"]:checked + .mode-text strong {
    color: #667eea;
}

.mode-option:has(input:checked) {
    border-color: #667eea;
    background: #f0f2ff;
}

.mode-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 2px;
}

.mode-text strong {
    font-size: 1rem;
    color: #333;
}

.mode-text small {
    font-size: 0.8rem;
    color: #999;
}

/* 结果摘要 */
.result-summary {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8f9ff;
    border: 1px solid #e0e4ff;
    border-radius: 12px;
    padding: 16px 24px;
    text-align: center;
    min-width: 100px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
}

/* 确认容器 */
.confirmation-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.ocr-preview {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
}

.ocr-preview h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
}

.text-area {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 表单区域 */
.form-area {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: white;
}

.form-area h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.field-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.confidence-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    background: #f0f0f0;
    color: #666;
}

.confidence-badge.high {
    background: #d4edda;
    color: #155724;
}

.confidence-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.confidence-badge.low {
    background: #f8d7da;
    color: #721c24;
}

.source-text {
    font-size: 0.85rem;
    color: #999;
    margin-top: 6px;
    padding-left: 12px;
    border-left: 2px solid #ddd;
    font-style: italic;
}

/* 完成消息 */
.complete-message {
    text-align: center;
    padding: 60px 40px;
}

.success-icon {
    font-size: 5rem;
    color: #4CAF50;
    margin-bottom: 20px;
}

.complete-message p {
    font-size: 1.2rem;
    color: #333;
    margin: 15px 0;
}

.file-path {
    font-size: 0.9rem;
    color: #999;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin: 20px 0;
}

/* 模态框 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content pre {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #4CAF50;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.notification.error {
    background: #f44336;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

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

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    main {
        padding: 20px;
    }

    .section h2 {
        font-size: 1.4rem;
    }

    .upload-box {
        padding: 40px 20px;
    }

    .actions {
        flex-direction: column;
    }

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