/* 发票管理系统 - 响应式CSS样式 */

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* 上传区域样式 */
.upload-section {
    padding: 40px;
    border-bottom: 1px solid #eee;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

.upload-area p {
    margin: 10px 0;
    color: #666;
    font-size: 1.1rem;
}

.upload-area p:first-child {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

/* 文件列表区域 */
.file-list-section {
    padding: 40px;
}

.file-list {
    display: grid;
    gap: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.file-info {
    flex: 1;
    display: flex;
    gap: 20px;
    align-items: center;
}

.file-name {
    font-weight: 600;
    color: #333;
    min-width: 200px;
}

.file-size, .file-date {
    color: #666;
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* 文件类型标识 */
.file-type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.file-type-pdf {
    background: #dc3545;
    color: white;
}

.file-type-image {
    background: #28a745;
    color: white;
}

/* 识别结果区域 */
.results-section {
    padding: 40px;
    background: #f8f9fa;
}

.result-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.result-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.result-item {
    display: flex;
    flex-direction: column;
}

.result-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.result-value {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

/* 进度条和加载动画 */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 2rem;
        padding: 20px;
    }
    
    .upload-section, .file-list-section, .results-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .result-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
        padding: 15px;
    }
    
    .upload-area {
        padding: 30px 10px;
    }
    
    .upload-area p {
        font-size: 1rem;
    }
    
    .upload-area p:first-child {
        font-size: 1.1rem;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}