/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== 页面头部 ===== */
.page-header {
    text-align: center;
    padding: 40px 20px;
    color: white;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

/* ===== 区域分组 ===== */
.section-group {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

/* ===== 卡片样式 ===== */
.card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.card:last-child {
    margin-bottom: 0;
}

.card h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ===== 按钮样式 ===== */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-link {
    background: transparent;
    color: #667eea;
    border: none;
    padding: 10px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: underline;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-icon {
    font-size: 1.2em;
}

/* ===== 文件上传区域 ===== */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

input[type="file"] {
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    flex: 1;
    min-width: 200px;
}

input[type="file"]:hover {
    border-color: #667eea;
}

.resource-input {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.resource-hint {
    margin-top: 12px;
    color: #888;
    font-size: 0.85rem;
}

.uploaded-resources {
    margin-top: 16px;
}

.uploaded-resources h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #333;
}

.uploaded-resources ul {
    list-style: none;
}

.uploaded-resources li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
}

.resource-type {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.resource-name {
    flex: 1;
    color: #333;
}

.btn-remove {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* ===== AI分析区域 ===== */
.ai-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
}

.ai-options {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.analysis-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
}

.analysis-status.analyzing {
    background: #fff3cd;
    color: #856404;
}

.analysis-status.completed {
    background: #d4edda;
    color: #155724;
}

.analysis-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* 进度条 */
.progress-bar {
    margin-top: 16px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    height: 30px;
    position: relative;
}

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

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

/* ===== 图表区域 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.stat-chart {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-chart h4 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 16px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.distribution-info {
    margin-top: 24px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.distribution-info h4 {
    margin-bottom: 12px;
    color: #333;
}

.distribution-info ul {
    list-style: none;
    padding-left: 0;
}

.distribution-info li {
    padding: 8px 0;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.distribution-info li:last-child {
    border-bottom: none;
}

/* ===== 数据管理区域 ===== */
.action-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.action-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ===== 数据表格 ===== */
.data-table {
    margin-top: 20px;
    overflow-x: auto;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.data-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #333;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 变更标注 */
.data-table td.changed {
    color: #e74c3c;
    text-decoration: line-through;
}

.data-table td.ai-result {
    color: #27ae60;
    font-weight: 600;
}

.data-table tr.changed-row {
    background-color: #fff3cd !important;
    border-left: 4px solid #f39c12;
}

.data-table tr.changed-row:hover {
    background-color: #ffeaa7 !important;
}

.data-table td.original-target {
    color: #7f8c8d;
    font-style: italic;
}

.data-table td.change-info {
    color: #e74c3c;
    font-weight: bold;
}

/* 调整表单 */
.adjust-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.data-table select,
.data-table input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
}

.data-table select:focus,
.data-table input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

/* ===== 状态提示 ===== */
.status-success {
    color: #27ae60;
    font-weight: 500;
    margin-top: 12px;
}

.status-error {
    color: #e74c3c;
    font-weight: 500;
    margin-top: 12px;
}

.status-uploading {
    color: #f39c12;
    font-weight: 500;
    margin-top: 12px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .section-group {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons button {
        width: 100%;
        justify-content: center;
    }
}

/* ===== 打印样式 ===== */
@media print {
    body {
        background: white;
    }
    
    .section-group {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-link {
        display: none;
    }
}
