/* 全局样式设定 */
:root {
    --bg-color: #0b0e14;
    --card-bg: #151a25;
    --primary-color: #5c6ac4;
    --male-color: #4a90e2;
    --female-color: #e24a84;
    --env-color: #2e7d32;
    --text-main: #e2e8f0;
    --text-light: #94a3b8;
    --border-color: #2a3142;
    --font-fam: 'Microsoft YaHei', -apple-system, system-ui, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: var(--font-fam);
    color: var(--text-main);
    transition: background-color 0.8s ease;
}

/* 头部 */
header {
    background-color: var(--card-bg);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.header-content h1 {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: #cbd5e1;
}
.header-content p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
}

/* 布局 */
.container {
    max-width: 1350px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    padding: 0 20px 40px;
}

/* 侧边控制面板 */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 85vh;
    overflow-y: auto;
    padding-right: 5px;
}
.controls-panel::-webkit-scrollbar {
    width: 6px;
}
.controls-panel::-webkit-scrollbar-thumb {
    background-color: #475569;
    border-radius: 4px;
}

/* 卡片面板 */
.panel, .presets, .interpretation-box {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}
.panel h3, .presets h3, .interpretation-box h3 {
    margin-top: 0;
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    color: #e2e8f0;
}
.group-male h3 { color: var(--male-color); border-color: rgba(74, 144, 226, 0.3); }
.group-female h3 { color: var(--female-color); border-color: rgba(226, 74, 132, 0.3); }
.group-env h3 { color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }

/* 滑块样式 */
.control-group { margin-bottom: 12px; }
.control-group label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 5px;
    color: #cbd5e1;
}
.control-group label span {
    font-family: monospace;
    font-weight: bold;
    color: var(--primary-color);
}
input[type=range] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #334155;
    border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    -webkit-appearance: none;
    appearance: none;
    margin-top: -5px;
    box-shadow: 0 0 10px var(--primary-color);
    transition: transform 0.1s;
}
input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.3);
}

.ext-var label span { color: #a855f7; }
.ext-var input[type=range]::-webkit-slider-thumb { background: #a855f7; box-shadow: 0 0 10px #a855f7; }


/* 按钮 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}
.btn:hover { background: #334155; color: #fff; }
.btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(92, 106, 196, 0.4);
}
.preset-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* 右侧可视区 */
.visual-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.visual-box {
    position: relative;
    height: 550px;
    background: #06080b; /* 纯黑背景托底，显现粒子效果 */
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
#simCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 图例 */
.canvas-legend {
    
    
    
    
    background: var(--card-bg);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    color: #94a3b8;
    border: 1px solid var(--border-color);
    line-height: 1.5;
    border: 1px solid rgba(255,255,255,0.05);
}

/* 解读区 */
.dynamic-text {
    line-height: 1.8;
    font-size: 15px;
    color: #e2e8f0;
    background: rgba(92, 106, 196, 0.1);
    padding: 15px;
    border-left: 3px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    min-height: 80px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
    background: var(--card-bg);
    color: #e2e8f0;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    line-height: 1.6;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.close-btn {
    
    top: 15px; 
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}

@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .controls-panel { max-height: none; }
}
