/* 基础重置 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-success {
    background: #28a745;
    color: white;
    text-decoration: none;
}

.btn-success:hover {
    background: #218838;
    text-decoration: none;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 提示信息 */
.alert {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    text-align: center;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 顶部导航 */
.navbar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    color: #667eea;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.navbar-user {
    color: #666;
}

/* 主内容区 */
.main-content {
    padding: 80px 24px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 24px;
    margin-bottom: 24px;
    color: #333;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #444;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 10px;
}

/* 上传模块 */
.upload-module {
    margin-bottom: 24px;
}

.upload-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.upload-module-title {
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

.upload-module-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
}

.upload-zone:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.upload-zone.has-file {
    border-color: #28a745;
    background: #f0fff4;
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone-text {
    color: #888;
    font-size: 14px;
}

.upload-zone-text .filename {
    color: #28a745;
    font-weight: 500;
    margin-top: 8px;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .actions {
    white-space: nowrap;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #888;
    padding: 0;
    line-height: 1;
}

.password-toggle:hover {
    color: #667eea;
}

.modal-footer .btn {
    min-width: 80px;
    padding: 10px 20px;
}

/* 进度/加载 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-text {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.progress-bar {
    width: 260px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percent {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 隐藏 */
.hidden {
    display: none !important;
}

/* API测试页面样式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 24px;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.form-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.collapsible-section {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.collapsible-header {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    border-bottom: 1px solid #e9ecef;
}

.collapsible-header:hover {
    background: #f0f2ff;
}

.collapsible-content {
    padding: 16px;
}

.collapsible-content.hidden {
    display: none;
}

.output-area {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    min-height: 200px;
    max-height: 500px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.output-area .json-key {
    color: #9cdcfe;
}

.output-area .json-string {
    color: #ce9178;
}

.output-area .json-number {
    color: #b5cea8;
}

.output-area .json-boolean {
    color: #569cd6;
}

.output-area .json-null {
    color: #569cd6;
}

.debug-info {
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
}

.debug-info pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

.debug-label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
}

/* 数据源切换 */
.source-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: #e9ecef;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.source-toggle-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
}

.source-toggle-btn.active {
    background: white;
    color: #667eea;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.e10-fetch-status {
    font-size: 13px;
    color: #28a745;
    margin-top: 8px;
}

/* 查询条件 */
.condition-row {
    display: grid;
    grid-template-columns: 1fr 100px 1fr 80px auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.condition-row input,
.condition-row select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .condition-row {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 72px 12px 12px;
    }

    .login-card {
        padding: 24px;
        margin: 12px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}