/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* 主内容区 */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    width: 100%;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background-color: #f8f9fa;
}

/* 输入框样式 */
.form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 配置表格特殊样式 */
.config-table th:nth-child(1) { width: 15%; }
.config-table th:nth-child(2) { width: 15%; }
.config-table th:nth-child(3) { width: 15%; }
.config-table th:nth-child(4) { width: 15%; }
.config-table th:nth-child(5) { width: 15%; }
.config-table th:nth-child(6) { width: 25%; }

/* 结果表格特殊样式 */
.result-table th:nth-child(1) { width: 12%; }
.result-table th:nth-child(2) { width: 11%; }
.result-table th:nth-child(3) { width: 11%; }
.result-table th:nth-child(4) { width: 11%; }
.result-table th:nth-child(5) { width: 11%; }
.result-table th:nth-child(6) { width: 11%; }
.result-table th:nth-child(7) { width: 11%; }
.result-table th:nth-child(8) { width: 11%; }
.result-table th:nth-child(9) { width: 11%; }

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-style: italic;
}

/* 文件加载提示卡片 */
.file-prompt-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    color: white;
    text-align: center;
}

.file-prompt-content {
    padding: 4rem 2rem;
}

.file-prompt-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.file-prompt-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.file-prompt-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.file-prompt-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 1.2rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.btn-large:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* 列设置面板 */
.column-settings {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.column-settings-content {
    padding: 1.5rem;
}

.column-settings h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.column-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    min-width: auto;
    flex-shrink: 0;
}

.checkbox-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.checkbox-item span {
    font-size: 0.85rem;
    color: #495057;
    user-select: none;
}

/* 隐藏的列 */
.result-table th.column-hidden,
.result-table td.column-hidden {
    display: none;
}

/* 收起/展开功能 */
.card-body.collapsed {
    display: none;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    margin-right: 0.25rem;
}

.toggle-icon.rotated {
    transform: rotate(-90deg);
}

.btn .toggle-icon {
    vertical-align: middle;
}

/* 底部状态栏 */
.status-bar {
    background-color: #343a40;
    color: white;
    padding: 0.75rem 0;
    margin-top: auto;
}

.status-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name-display {
    font-size: 0.9rem;
    color: #adb5bd;
    margin-left: 1rem;
    font-style: italic;
}

.file-name-display::before {
    content: "当前文件: ";
    color: #6c757d;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #28a745;
    transition: background-color 0.3s ease;
}

.status-indicator.loading {
    background-color: #ffc107;
    animation: pulse 1.5s infinite;
}

.status-indicator.error {
    background-color: #dc3545;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .card-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .file-prompt-content {
        padding: 2rem 1rem;
    }
    
    .file-prompt-content h2 {
        font-size: 1.5rem;
    }
    
    .file-prompt-content p {
        font-size: 1rem;
    }
    
    .file-prompt-features {
        flex-direction: column;
        gap: 1rem;
    }
    
    .feature-item {
        justify-content: center;
    }
    
    .column-checkboxes {
        flex-direction: column;
        gap: 0.4rem;
    }
    
}

/* 动画效果 */
.card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动条样式 */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
