*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Microsoft YaHei',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0a1628;color:#e0e6ed;height:100vh;overflow:hidden}
#app{display:flex;flex-direction:column;height:100vh}

.header{
    background:linear-gradient(135deg,#0d2137 0%,#1a3a5c 50%,#0d2137 100%);
    padding:10px 24px;display:flex;justify-content:space-between;align-items:center;
    border-bottom:2px solid #1e4d7a;box-shadow:0 2px 12px rgba(0,0,0,0.3);
}
.header h1{font-size:17px;font-weight:700;letter-spacing:1px;
    background:linear-gradient(90deg,#4fc3f7,#81d4fa,#4fc3f7);
    -webkit-background-clip:text;-webkit-text-fill-color:transparent;
}
.status-bar{display:flex;align-items:center;gap:8px;font-size:12px;color:#78909c}
.status-dot{width:8px;height:8px;border-radius:50%;display:inline-block;transition:all 0.3s}
.status-dot.online{background:#00e676;box-shadow:0 0 8px #00e676}
.status-dot.offline{background:#ff5252;box-shadow:0 0 8px #ff5252}

.main-content{display:flex;flex:1;overflow:hidden}
.gis-panel{flex:1;position:relative;background:#0a1628}
#cesiumContainer{width:100%;height:100%}

/* 实时数据面板 - 左下角 */
.gis-overlay{
    position:absolute;bottom:16px;left:16px;
    background:rgba(10,22,40,0.92);
    border:1px solid rgba(79,195,247,0.3);
    border-radius:12px;padding:14px 16px;
    min-width:240px;max-width:280px;
    backdrop-filter:blur(10px);
    box-shadow:0 4px 20px rgba(0,0,0,0.4);
    z-index:10;
}
.data-card h3{
    font-size:13px;margin-bottom:10px;
    color:#4fc3f7;font-weight:600;
    display:flex;align-items:center;gap:6px;
}
.data-card h3::before{content:"";display:inline-block;width:3px;height:14px;background:#4fc3f7;border-radius:2px}
#realtime-data{font-size:12px;line-height:1.8}
#realtime-data b{color:#81d4fa}
.data-row{display:flex;justify-content:space-between;padding:2px 0;border-bottom:1px solid rgba(30,77,122,0.3)}
.data-row:last-child{border-bottom:none}
.data-label{color:#78909c;font-size:11px}
.data-value{color:#e0e6ed;font-weight:600;font-size:12px}
.data-value.warn{color:#ffa726}
.data-value.danger{color:#ef5350}

/* 图例 - 右下角 */
.gis-legend{
    position:absolute;bottom:16px;right:16px;
    background:rgba(10,22,40,0.92);
    border:1px solid rgba(79,195,247,0.3);
    border-radius:10px;padding:10px 14px;
    backdrop-filter:blur(10px);
    box-shadow:0 4px 20px rgba(0,0,0,0.4);
    z-index:10;
}
.gis-legend h4{font-size:12px;color:#4fc3f7;margin-bottom:6px;font-weight:600}
.legend-item{display:flex;align-items:center;gap:8px;font-size:11px;color:#b0bec5;padding:2px 0}
.legend-dot{width:10px;height:10px;border-radius:50%;border:2px solid rgba(255,255,255,0.6);flex-shrink:0}

/* 传感器信息浮窗 - 右上角，图片为主体 */
.sensor-info-box{
    position:absolute;top:16px;right:16px;
    width:320px;
    background:rgba(10,22,40,0.95);
    border:1px solid rgba(79,195,247,0.4);
    border-radius:14px;
    backdrop-filter:blur(12px);
    box-shadow:0 8px 32px rgba(0,0,0,0.5);
    z-index:20;
    overflow:hidden;
    animation:slideIn 0.3s ease;
}
@keyframes slideIn{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}

/* 图片区域 - 作为主体背景 */
.info-image{
    width:100%;height:200px;
    background-size:cover;background-position:center;
    position:relative;
}
.info-image-overlay{
    position:absolute;bottom:0;left:0;right:0;
    padding:16px;
    background:linear-gradient(transparent 0%, rgba(10,22,40,0.7) 40%, rgba(10,22,40,0.95) 100%);
    display:flex;flex-direction:column;gap:4px;
}
.info-icon-lg{font-size:28px;margin-bottom:4px}
.info-title-lg{font-size:16px;font-weight:700;color:#fff;text-shadow:0 2px 8px rgba(0,0,0,0.5)}
.info-type-lg{font-size:11px;color:rgba(255,255,255,0.7)}

/* 信息主体 */
.info-body{
    padding:14px 16px;
}
.info-desc{
    font-size:12px;color:#b0bec5;line-height:1.6;
    padding-bottom:12px;
    border-bottom:1px solid rgba(30,77,122,0.3);
    margin-bottom:12px;
}

.info-query-btn{
    display:block;width:100%;
    padding:10px;
    border:none;border-radius:8px;
    color:#fff;font-size:13px;font-weight:600;
    cursor:pointer;text-align:center;
    transition:all 0.2s;
    box-shadow:0 2px 8px rgba(0,0,0,0.3);
}
.info-query-btn:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,0.4)}

/* 关闭按钮 */
.info-close{
    position:absolute;top:8px;right:8px;
    background:rgba(0,0,0,0.5);
    border:none;color:#fff;font-size:14px;
    cursor:pointer;width:28px;height:28px;
    border-radius:50%;display:flex;align-items:center;justify-content:center;
    transition:all 0.2s;z-index:5;
    backdrop-filter:blur(4px);
}
.info-close:hover{background:rgba(0,0,0,0.7)}

/* 聊天面板 */
.chat-panel{
    width:400px;display:flex;flex-direction:column;
    background:linear-gradient(180deg,#0d1b2a 0%,#0a1628 100%);
    border-left:2px solid #1e4d7a;
}
.chat-header{
    padding:12px 16px;
    background:rgba(13,33,55,0.95);
    border-bottom:1px solid #1e4d7a;
    display:flex;justify-content:space-between;align-items:center;
}
.chat-header h2{font-size:15px;font-weight:600;display:flex;align-items:center;gap:6px}
.route-badge{
    font-size:10px;padding:3px 10px;
    border-radius:12px;
    background:rgba(79,195,247,0.15);color:#4fc3f7;
    border:1px solid rgba(79,195,247,0.3);
    transition:all 0.3s;
}
.route-badge.data{background:rgba(41,182,246,0.15);color:#29b6f6;border-color:rgba(41,182,246,0.3)}
.route-badge.knowledge{background:rgba(102,187,106,0.15);color:#66bb6a;border-color:rgba(102,187,106,0.3)}
.route-badge.mixed{background:rgba(255,167,38,0.15);color:#ffa726;border-color:rgba(255,167,38,0.3)}

.chat-messages{
    flex:1;overflow-y:auto;padding:14px;
    display:flex;flex-direction:column;gap:10px;
    scroll-behavior:smooth;
}
.message{
    max-width:92%;padding:10px 14px;
    border-radius:14px;font-size:13px;line-height:1.7;
    animation:fadeIn 0.3s ease;
}
@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.message.user{
    align-self:flex-end;
    background:linear-gradient(135deg,#1565c0,#1976d2);
    color:#fff;border-bottom-right-radius:4px;
    box-shadow:0 2px 8px rgba(21,101,192,0.3);
}
.message.assistant{
    align-self:flex-start;
    background:rgba(26,58,92,0.8);
    color:#e0e6ed;border-bottom-left-radius:4px;
    border:1px solid rgba(30,77,122,0.4);
}
.message.system{
    align-self:center;
    background:transparent;color:#546e7a;
    font-size:12px;text-align:center;max-width:100%;
    padding:8px 16px;
}

.chat-input{
    padding:12px 14px;
    background:rgba(13,33,55,0.95);
    border-top:1px solid #1e4d7a;
    display:flex;gap:8px;
}
.chat-input input{
    flex:1;padding:10px 14px;
    background:rgba(26,58,92,0.6);
    border:1px solid rgba(42,90,140,0.6);
    border-radius:10px;color:#e0e6ed;
    font-size:13px;outline:none;
    transition:border-color 0.3s;
}
.chat-input input:focus{border-color:#4fc3f7;box-shadow:0 0 8px rgba(79,195,247,0.2)}
.chat-input input::placeholder{color:#546e7a}
.chat-input button{
    padding:10px 18px;
    background:linear-gradient(135deg,#1565c0,#1976d2);
    border:none;border-radius:10px;color:#fff;
    font-size:13px;font-weight:600;cursor:pointer;
    transition:all 0.2s;
    box-shadow:0 2px 8px rgba(21,101,192,0.3);
}
.chat-input button:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(21,101,192,0.4)}
.chat-input button:active{transform:translateY(0)}

.chat-messages::-webkit-scrollbar{width:4px}
.chat-messages::-webkit-scrollbar-track{background:transparent}
.chat-messages::-webkit-scrollbar-thumb{background:rgba(30,77,122,0.6);border-radius:2px}

@media(max-width:900px){
    .main-content{flex-direction:column}
    .chat-panel{width:100%;height:50%;border-left:none;border-top:2px solid #1e4d7a}
    .gis-panel{height:50%}
    .sensor-info-box{width:260px}
}
