* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* API配置区域 */
.config-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 输入方式选择标签 */
.input-method-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-button:hover {
    color: #3498db;
    background: #f8f9fa;
}

.tab-button.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: #f8f9fa;
}

/* 输入内容区域 */
.input-section {
    margin-bottom: 30px;
}

.input-method {
    display: none;
}

.input-method.active {
    display: block;
}

.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #e8f4f8;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    font-size: 14px;
    color: #0c5460;
}

/* 处理按钮和进度 */
.action-section {
    text-align: center;
    margin-bottom: 30px;
}

.process-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.process-btn:hover {
    background: #2980b9;
}

.process-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.progress-container {
    margin-top: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #666;
}

/* 结果展示区域 */
.results-section {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.export-all-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

/* 新增：插入语料按钮样式 */
.insert-btn {
    background-color: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
    padding: 5px 12px;
    margin-right: 5px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.insert-btn:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.insert-btn:active {
    transform: translateY(1px);
}
    font-size: 14px;
    transition: background 0.3s;
}

.export-all-btn:hover {
    background: #229954;
}

/* 结果项 */
.result-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.result-header {
    background: #e9ecef;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.result-title {
    font-weight: bold;
    color: #495057;
    font-size: 16px;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.edit-btn,
.save-btn,
.cancel-btn,
.export-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.edit-btn {
    background: #ffc107;
    color: #212529;
}

.edit-btn:hover {
    background: #e0a800;
}

.save-btn {
    background: #28a745;
    color: white;
}

.save-btn:hover {
    background: #218838;
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

.cancel-btn:hover {
    background: #5a6268;
}

.export-btn {
    background: #17a2b8;
    color: white;
}

.export-btn:hover {
    background: #138496;
}

.result-content {
    padding: 20px;
}

.result-display {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
}

.result-editor {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
}

.result-editor:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 错误状态 */
.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .input-method-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: 1px solid #ddd;
        border-right: none;
    }
    
    .tab-button.active {
        border-bottom: 1px solid #3498db;
        border-right: none;
    }
    
    .results-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .result-actions {
        flex-wrap: wrap;
    }
}

/* ==================== 新增：资讯卡片样式 ==================== */

/* 顶层模式切换 */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e9ecef;
}

.mode-btn {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.mode-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* 卡片区域容器 */
.card-section {
    display: none;
}

.card-section.active {
    display: block;
}

/* 资讯卡片Tab */
.news-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.news-tab-btn {
    background: none;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.news-tab-btn:hover {
    color: #007bff;
    background: #f8f9fa;
}

.news-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: bold;
}

/* 资讯卡片内容区域 */
.news-content {
    display: none;
}

.news-content.active {
    display: block;
}

.news-content h3 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.news-content h4 {
    color: #495057;
    margin: 20px 0 10px 0;
    font-size: 1.2em;
}

/* 查询区域 */
.query-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* 状态消息 */
.status-message {
    display: inline-block;
    margin-left: 15px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-message.warning {
    background-color: #fff7e6;
    color: #ad6800;
    border: 1px solid #ffd591;
}

/* 结果操作按钮组 */
.results-actions-group {
    display: flex;
    gap: 10px;
}

/* 结果查看Tab */
.result-view-tabs {
    display: flex;
    margin: 15px 0;
    border-bottom: 2px solid #ddd;
}

.result-tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.result-tab-btn:hover {
    color: #007bff;
    background: #f8f9fa;
}

.result-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: bold;
}

.result-tab-content {
    display: none;
}

.result-tab-content.active {
    display: block;
}

/* 复制按钮 */
.copy-btn {
    margin-top: 10px;
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #138496;
}

/* 只读文本框样式 */
textarea[readonly] {
    background-color: #f8f9fa;
    cursor: default;
}

/* ==================== 新增：卡片文件上传样式 ==================== */

/* 上传Tab样式 */
.upload-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.upload-tab-btn {
    background: none;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.upload-tab-btn:hover {
    color: #007bff;
    background: #f8f9fa;
}

.upload-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: bold;
}

/* 上传内容区域 */
.upload-content {
    display: none;
}

.upload-content.active {
    display: block;
}

.section-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}
