/* 计算引擎页面样式 */
.calculation-main {
    background: var(--bg-secondary);
    padding: 40px 0 80px;
    min-height: calc(100vh - 200px);
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* 计算布局 */
.calculation-layout {
    display: grid;
    grid-template-columns: 320px 380px 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* 面板通用样式 */
.panel-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-tertiary);
}

/* 输入面板 */
.input-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* 输入方式切换 */
.input-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.3s;
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-secondary);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    color: var(--text-secondary);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-area p {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-top: 12px;
}

.file-name {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.btn-remove-file {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-remove-file:hover {
    transform: scale(1.1);
}

/* 提交按钮 */
.btn-submit-calculation {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.btn-submit-calculation:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-submit-calculation:active {
    transform: translateY(0);
}

.btn-submit-calculation:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-submit-calculation svg {
    width: 20px;
    height: 20px;
}

/* 任务面板 */
.task-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* 任务统计 */
.task-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    text-align: center;
    padding: 16px 8px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* 任务列表 */
.task-list {
    max-height: 500px;
    overflow-y: auto;
}

.task-item {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s;
    cursor: pointer;
}

.task-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.task-item.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.task-id {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.task-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.task-status.pending {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.task-status.running {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.task-status.completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.task-status.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.task-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.task-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-info-item svg {
    width: 14px;
    height: 14px;
}

.task-progress {
    margin-top: 12px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: right;
}

.task-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.task-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.task-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.task-action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.task-action-btn.primary:hover {
    background: var(--primary-dark);
}

.task-action-btn.danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.task-action-btn.danger:hover {
    background: var(--danger-color);
    color: white;
}

/* 结果面板 */
.result-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.result-content {
    min-height: 400px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
}

/* 结果数据表格 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.result-table th,
.result-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.result-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.result-table td {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.result-table tr:hover {
    background: var(--bg-secondary);
}

.result-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--primary-color);
}

.btn-copy {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.btn-copy:hover {
    background: var(--primary-color);
    color: white;
}

/* 可视化区域 */
.visualization-area {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.visualization-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.chart-placeholder {
    height: 300px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 2px dashed var(--border-color);
}

/* 日志面板 */
.log-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-tertiary);
}

.log-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-clear-log {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.btn-clear-log:hover {
    background: var(--danger-color);
    color: white;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    min-width: 80px;
}

.log-message {
    color: var(--text-primary);
    flex: 1;
}

.log-entry.info .log-message {
    color: var(--primary-color);
}

.log-entry.success .log-message {
    color: var(--success-color);
}

.log-entry.error .log-message {
    color: var(--danger-color);
}

.log-entry.warning .log-message {
    color: var(--warning-color);
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .calculation-layout {
        grid-template-columns: 300px 350px 1fr;
    }
}

@media (max-width: 1200px) {
    .calculation-layout {
        grid-template-columns: 1fr 1fr;
    }

    .result-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .calculation-layout {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .task-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .task-info {
        grid-template-columns: 1fr;
    }
}
