:root {
    /* 科技感深色主题配色 */
    --bg-dark: #0b0c10;
    --panel-bg: #1f2833;
    --text-main: #c5c6c7;
    --text-muted: #66fcf1;
    /* 弱强调色/青色 */
    --accent-blue: #45a29e;
    --accent-red: #ff3b3b;
    --accent-yellow: #ffc107;

    --bridge-stone: #4e5d6c;
    --bridge-solid: #3a4a58;
    --water-normal: rgba(69, 162, 158, 0.6);
    --water-flood: rgba(31, 71, 136, 0.8);
    --force-support: #66fcf1;

    --grid-color: rgba(102, 252, 241, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* --- 顶部导航 --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(to bottom, rgba(31, 40, 51, 0.95), rgba(11, 12, 16, 0.95));
    border-bottom: 1px solid var(--accent-blue);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(102, 252, 241, 0.4);
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-weight: bold;
}

.nav-btn:hover {
    background: rgba(69, 162, 158, 0.2);
    box-shadow: 0 0 10px rgba(69, 162, 158, 0.5);
}

/* --- 主体布局 --- */
.main-container {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
    height: calc(100vh - 160px);
}

.panel {
    background-color: var(--panel-bg);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(69, 162, 158, 0.2);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.left-panel {
    flex: 6;
}

.right-panel {
    flex: 4;
}

h2 {
    margin-top: 0;
    font-size: 18px;
    color: var(--text-main);
    border-left: 4px solid var(--accent-blue);
    padding-left: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- 可视化区域通用样式 --- */
.viz-container {
    flex: 1;
    background-color: #0d1115;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid #2b3540;
    /* 工程蓝图网格背景 */
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* --- 左侧双栏 --- */
.comparison-view {
    display: flex;
    flex: 1;
    gap: 15px;
    margin-top: 10px;
}

.bridge-scene {
    display: flex;
    flex-direction: column;
}

.scene-title {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: 13px;
    background: rgba(11, 12, 16, 0.8);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--accent-blue);
    color: var(--text-muted);
}

/* --- 动画与特效 --- */
.water-rect {
    transition: y 0.4s ease-out, fill 0.5s;
}

.water-flow {
    stroke-dasharray: 15;
    animation: flow linear infinite;
}

@keyframes flow {
    to {
        stroke-dashoffset: -30;
    }
}

/* 极限过载时的震颤动画 */
@keyframes structural-shake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(1px, 1px) rotate(0.5deg);
    }

    50% {
        transform: translate(-1px, -1px) rotate(-0.5deg);
    }

    75% {
        transform: translate(-2px, 1px) rotate(0deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.critical-danger {
    animation: structural-shake 0.3s infinite;
    filter: drop-shadow(0 0 10px rgba(255, 59, 59, 0.8));
}

/* 受力流光动画 (蚂蚁线) */
.force-flow-line {
    stroke-dasharray: 8 4;
    animation: force-transfer linear infinite;
}

@keyframes force-transfer {
    to {
        stroke-dashoffset: -24;
    }
}

/* 雨水动画 */
.rain-line {
    stroke: rgba(174, 194, 224, 0.6);
    stroke-width: 1.5;
    stroke-linecap: round;
    animation: rain-fall 0.5s linear infinite;
}

@keyframes rain-fall {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    to {
        transform: translateY(300px);
        opacity: 0;
    }
}

/* --- 数据面板与交互层 --- */
.data-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(11, 12, 16, 0.9);
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-blue);
    line-height: 1.8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

.data-overlay:hover {
    border-left-color: var(--text-muted);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
}

.data-value {
    font-weight: bold;
    font-size: 15px;
    display: inline-block;
    width: 40px;
    text-align: right;
}

/* --- Tooltip --- */
.tooltip {
    position: absolute;
    background: rgba(11, 12, 16, 0.95);
    border: 1px solid var(--text-muted);
    padding: 15px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.1s;
    z-index: 200;
    max-width: 240px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    line-height: 1.6;
    color: #fff;
    backdrop-filter: blur(8px);
}

.clickable {
    cursor: pointer;
    transition: all 0.3s;
}

.clickable:hover {
    fill: #7d8c9b;
    /* 悬浮提亮 */
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* --- 底部控制栏 --- */
.bottom-bar {
    background-color: var(--panel-bg);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--accent-blue);
    height: 70px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

button.control-btn {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.2s;
}

button.control-btn:hover {
    background: #35827f;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

button.control-btn:active {
    transform: translateY(1px);
}

button.control-btn.secondary {
    background: #2b3540;
    border: 1px solid #4e5d6c;
}

button.control-btn.secondary:hover {
    background: #3a4a58;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 400px;
}

/* 自定义滑块样式 */
input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    background: #2b3540;
    height: 6px;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(102, 252, 241, 0.8);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.expert-panel {
    display: none;
    position: absolute;
    top: 50px;
    right: 20px;
    background: rgba(11, 12, 16, 0.9);
    border: 1px solid var(--accent-yellow);
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    color: var(--accent-yellow);
    z-index: 50;
}

/* --- 力学参数分析表格 --- */
.mech-analysis-table {
    width: 100%;
    margin-top: 15px;
    border-collapse: collapse;
    font-size: 13px;
    background: rgba(11, 12, 16, 0.4);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(69, 162, 158, 0.2);
}

.mech-analysis-table th {
    text-align: left;
    padding: 8px 12px;
    background: rgba(69, 162, 158, 0.1);
    color: var(--accent-yellow);
    border-bottom: 1px solid rgba(69, 162, 158, 0.3);
    font-size: 14px;
}

.mech-analysis-table tr:hover {
    background: rgba(69, 162, 158, 0.05);
}

.mech-analysis-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mech-analysis-table .label {
    color: var(--text-main);
}

.mech-analysis-table .value {
    color: #fff;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-align: right;
    font-size: 15px;
}

.mech-analysis-table .unit {
    color: var(--accent-blue);
    font-size: 11px;
    text-align: right;
    width: 40px;
}
