:root {
    --panel: #fffdf8;
    --border: #e9d4bf;
    --primary: #d96a2b;
    --primary-dark: #b9531d;
    --text: #5f3a1f;
    --muted: #8f6a4f;
    --bg-light: #fff9f2;
}

* {
    box-sizing: border-box;
}

.page-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    margin-top: 10px;
    align-items: stretch;
}

/* 可视化区域 */
.visualization-section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(217, 106, 43, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.viz-header {
    padding: 12px 16px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viz-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
}

#smo-canvas {
    width: 100%;
    min-height: 400px;
    flex-grow: 1;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.viz-controls {
    padding: 15px 20px;
    background: var(--panel);
    border-top: 1px solid var(--border);
}

.slider-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.slider-row .control-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.slider-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--text);
    font-weight: 500;
}

.slider-row input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.control-group label span {
    font-weight: 600;
    color: var(--primary);
}

/* 控制面板 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(217, 106, 43, 0.08);
}

.panel-card h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: var(--primary-dark);
    border-bottom: 1px dashed var(--border);
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toggle-btn {
    font-size: 0.9rem;
    color: var(--muted);
    transition: transform 0.3s ease;
}

.panel-card.collapsed .toggle-btn {
    transform: rotate(180deg);
}

.panel-body {
    transition: all 0.3s ease;
}

.panel-card.collapsed .panel-body {
    display: none;
}

.panel-card.collapsed h3 {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 按钮组 */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.95rem;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e9d4bf;
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: #dbbc9d;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 滑动条样式 */
.slider-group {
    margin-bottom: 12px;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--text);
}

.slider-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

/* 参数展示表格 */
.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.param-table td {
    padding: 6px 0;
    border-bottom: 1px solid #f0e6da;
}

.param-table td:first-child {
    color: var(--muted);
}

.param-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #eee;
}

.status-playing {
    background: #e3f2fd;
    color: #1976d2;
}

.status-paused {
    background: #fff3e0;
    color: #f57c00;
}

.status-unstarted {
    background: #f5f5f5;
    color: #616161;
}

.status-finished {
    background: #e8f5e9;
    color: #388e3c;
}

/* 响应式 */
@media (max-width: 1000px) {
    .page-container {
        grid-template-columns: 1fr;
    }
}

/* Tooltip style */
.tooltip {
    position: absolute;
    text-align: left;
    padding: 8px 12px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(217, 106, 43, 0.15);
    color: var(--text);
    z-index: 1000;
    line-height: 1.5;
}

.tooltip b {
    color: var(--primary-dark);
}

/* SMO 实验数据面板 */
.smo-data-actions {
    display: grid;
    gap: 10px;
}

.smo-data-actions .btn {
    width: 100%;
    padding: 10px 12px;
}

/* SMO 迭代数据弹窗 */
#smo-iteration-log-modal.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2000;
}

#smo-iteration-log-modal .modal-panel {
    max-width: 1050px;
    width: 96%;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fffdf9 0%, #fff7ef 100%);
    border-radius: 18px;
    border: 1px solid #efd8c4;
    box-shadow: 0 20px 42px rgba(95, 58, 31, 0.22), 0 10px 24px rgba(217, 106, 43, 0.16);
    overflow: hidden;
}

#smo-iteration-log-modal .modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0e0cc;
    background: linear-gradient(180deg, #fff7e3, #fff3d5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#smo-iteration-log-modal .modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: #5d4037;
}

#smo-iteration-log-modal .modal-close {
    cursor: pointer;
    font-size: 21px;
    color: var(--muted);
}

#smo-iteration-log-modal .modal-close:hover {
    color: #c62828;
}

#smo-iteration-log-modal .modal-body {
    padding: 12px 16px 16px;
    overflow: auto;
}

#smo-iteration-log-modal .modal-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    font-size: 13px;
    color: #5f3a1f;
    margin-bottom: 10px;
}

#smo-iteration-log-modal .modal-final-box {
    font-size: 13px;
    color: #b71c1c;
    background: #fff3e0;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

#smo-iteration-log-modal .modal-table th,
#smo-iteration-log-modal .modal-table td {
    padding: 6px 5px;
    border-bottom: 1px solid #e9ddd1;
    text-align: left;
    vertical-align: middle;
}

#smo-iteration-log-modal .modal-table thead th {
    background: linear-gradient(180deg, #ffe9d6 0%, #ffe0c4 100%);
    color: #7a3f1b;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #f0cfaf;
}

#smo-iteration-log-modal .modal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    overflow: hidden;
    border: 1px solid #f0ddcb;
    border-radius: 12px;
    background: #fffdf9;
}

#smo-iteration-log-modal .modal-table thead th:first-child {
    border-top-left-radius: 12px;
}

#smo-iteration-log-modal .modal-table thead th:last-child {
    border-top-right-radius: 12px;
}

