:root {
    --primary: #0052D9;
    --success: #00B42A;
    --warning: #FF7D00;
    --danger: #D93026;
    --light: #F5F7FA;
    --dark: #1D2129;
    --border: #E5E6EB;
    --gray: #86909C;
}

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

body {
    font-family: "Microsoft YaHei", "思源黑体", sans-serif;
    background-color: var(--light);
    padding: 24px;
    color: var(--dark);
    line-height: 1.6;
}

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

h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 24px;
    font-size: 28px;
    font-weight: 700;
}

/* 标签页样式 */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    color: var(--gray);
    background: white;
    border: 1px solid var(--border);
    border-bottom: none;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab:hover {
    color: var(--primary);
    background: #F0F7FF;
}

.tab.active {
    color: var(--primary);
    background: white;
    border-bottom: 2px solid var(--primary);
    font-weight: 600;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    border-left: 4px solid var(--primary);
    padding-left: 12px;
    margin-bottom: 16px;
    color: var(--dark);
}

/* 上传区域样式 - 添加拖拽支持 */
.upload-area {
    border: 2px dashed #C9CDD4;
    border-radius: 8px;
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary);
    background-color: #F0F7FF;
}

/* 拖拽进入时的样式 */
.upload-area.dragover {
    border-color: var(--success) !important;
    background-color: rgba(0, 180, 42, 0.05) !important;
    border-width: 3px;
    animation: pulse 1.5s infinite;
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 180, 42, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 180, 42, 0);
    }
}

/* 拖拽提示文字 */
.upload-area.dragover::before {
    content: '松开鼠标上传文件';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--success);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 180, 42, 0.3);
    pointer-events: none; /* 修复：防止提示文字拦截点击 */
}

/* 拖拽遮罩层 */
.upload-area.dragover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 180, 42, 0.1);
    border-radius: 6px;
    z-index: 1;
    pointer-events: none; /* 修复：让遮罩层不拦截点击 */
}

.upload-area p {
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 600;
    position: relative;
    z-index: 2;
    pointer-events: none; /* 修复：让点击穿透到父元素 */
}

.upload-area span {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.5;
    display: block;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    pointer-events: none; /* 修复：让点击穿透到父元素 */
}

#fileInput {
    display: none;
}

/* 状态样式 */
#uploadStatus {
    margin-top: 16px;
    min-height: 20px;
}

.status {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.status::before {
    font-size: 16px;
}

.status-success {
    background: rgba(0, 180, 42, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 180, 42, 0.2);
}

.status-success::before {
    content: '✅';
}

.status-danger {
    background: rgba(217, 48, 38, 0.1);
    color: var(--danger);
    border: 1px solid rgba(217, 48, 38, 0.2);
}

.status-danger::before {
    content: '❌';
}

.status-info {
    background: rgba(0, 82, 217, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 82, 217, 0.2);
}

.status-info::before {
    content: 'ℹ️';
}

/* AI处理中样式 */
.processing {
    text-align: center;
}

.ai-thinking {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 82, 217, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.thinking-text {
    font-size: 16px;
    color: var(--dark);
    font-weight: 600;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: dot-pulse 1.4s infinite ease-in-out;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dot-pulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 报告操作按钮 */
.report-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: #0047C7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 217, 0.3);
}

.btn-copy {
    background: #F0F7FF;
    color: var(--primary);
    border: 1px solid rgba(0, 82, 217, 0.2);
    flex: 1;
}

.btn-copy:hover:not(:disabled) {
    background: #E6F0FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 82, 217, 0.2);
}

.btn-copy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 报告显示区域 */
.report-display {
    background: #F9FAFB;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
    color: var(--dark);
    position: relative;
}

.report-display::-webkit-scrollbar {
    width: 6px;
}

.report-display::-webkit-scrollbar-track {
    background: rgba(0, 82, 217, 0.05);
    border-radius: 3px;
}

.report-display::-webkit-scrollbar-thumb {
    background: rgba(0, 82, 217, 0.2);
    border-radius: 3px;
}

.report-display::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 82, 217, 0.3);
}

/* 打字机光标 */
.typing-cursor {
    display: inline-block;
    width: 2px;
    background: var(--primary);
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 文件信息显示 */
.file-info {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray);
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        min-width: 120px;
        text-align: center;
        padding: 12px 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    .upload-area {
        padding: 32px 16px;
    }
    
    .report-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 22px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .upload-area p {
        font-size: 14px;
    }
    
    .upload-area span {
        font-size: 12px;
    }
    
    .upload-area.dragover::before {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .report-display {
        font-size: 13px;
        padding: 16px;
    }
}