body { margin: 0; padding: 0; font-family: "Microsoft YaHei", sans-serif; background-color: #ffffff; overflow: hidden; }
#header { padding: 12px 20px; background-color: #00459B; color: white; display: flex; gap: 15px; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.3); flex-wrap: wrap; z-index: 2000; position: relative; }

#main-container { position: relative; width: 100%; height: calc(100vh - 65px); overflow: hidden; }
#map { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 1; background-color: #eeeeee; }

/* 面板样式 */
#sidebar { 
    position: absolute; left: 0; top: 0; height: 100%; width: 460px; 
    background: rgba(248, 249, 250, 0.95); border-right: 1px solid #ddd; 
    padding: 15px; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; 
    z-index: 1000; box-shadow: 2px 0 10px rgba(0,0,0,0.1); backdrop-filter: blur(5px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#sidebar.collapsed { transform: translateX(-100%); }

#right-sidebar { 
    position: absolute; right: 0; top: 0; height: 100%; width: 460px; 
    background: rgba(248, 249, 250, 0.95); border-left: 1px solid #ddd; 
    padding: 15px; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; 
    z-index: 1000; box-shadow: -2px 0 10px rgba(0,0,0,0.1); backdrop-filter: blur(5px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(100%); 
}
#right-sidebar.open { transform: translateX(0); }

#sidebarToggleBtn {
    position: absolute; right: -28px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 60px; background: rgba(248, 249, 250, 0.95);
    border: 1px solid #ddd; border-left: none; border-radius: 0 8px 8px 0;
    cursor: pointer; color: #555; font-size: 16px; box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center; z-index: 1000; transition: all 0.2s;
}
#sidebarToggleBtn:hover { color: #00459B; background: #fff; width: 32px; right: -32px; }

#sidebar-resizer { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; background: transparent; z-index: 1001; }
#sidebar-resizer:hover { background: rgba(0, 69, 155, 0.2); }

.sidebar-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #00459B; padding-bottom: 8px; }
.sidebar-title { margin: 0; font-size: 16px; color: #333; font-weight: bold; }
.sidebar-actions { display: flex; gap: 6px; }
.sidebar-actions button { background: transparent; border: none; cursor: pointer; padding: 6px; font-size: 16px; color: #666; transition: color 0.2s; }
.sidebar-actions button:hover { color: #e6194b; }

.map-settings-panel { background: #fff; padding: 12px; border-radius: 6px; border: 1px solid #eee; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 10px; }
.setting-row { display: flex; align-items: flex-start; font-size: 13px; color: #444; }
.setting-label { width: 75px; font-weight: bold; color: #00459B; padding-top: 3px; }
.setting-content { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; }
.setting-content select { padding: 4px 8px; border-radius: 4px; border: 1px solid #ccc; font-size: 13px; outline: none; cursor: pointer; }
.setting-content label { display: flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.setting-content input[type="checkbox"] { cursor: pointer; margin: 0; width: 14px; height: 14px; }
.disabled-label { color: #999; cursor: not-allowed !important; }
.disabled-label input { cursor: not-allowed !important; }

.sidebar-toolbar { display: flex; gap: 10px; align-items: center; background: #fff; padding: 8px; border-radius: 6px; border: 1px solid #eee; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.tool-btn { background: white; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; padding: 6px 12px; font-size: 14px; color: #444; transition: all 0.2s; display: flex; align-items: center; gap: 6px; }
.tool-btn:hover { background: #f0f4f8; border-color: #00459B; color: #00459B; }
.highlight-btn { background: #E2F0FF; color: #00459B; border-color: #00459B; font-weight: bold; }
.highlight-btn:hover { background: #00459B; color: white; }

.layer-table-container { overflow-y: auto; flex: 1; }
.layer-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.layer-table th { background-color: #f0f4f8; color: #333; padding: 10px 8px; font-weight: bold; border-bottom: 2px solid #ddd; white-space: nowrap; position: sticky; top: 0; z-index: 10; }
.layer-table td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
.layer-table tbody tr:hover { background-color: #f5f7fa; }

.color-box { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.index-cell { display: flex; align-items: center; justify-content: center; gap: 8px; }

.info-content { font-size: 14px; color: #444; line-height: 1.6; }
.info-highlight { font-weight: bold; color: #e6194b; font-size: 16px; }
.info-card { background: #fff; padding: 15px; border-radius: 6px; border: 1px solid #eee; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-top: 5px; }

.progress-container { width: 100%; background-color: #e9ecef; border-radius: 4px; overflow: hidden; height: 8px; margin-top: 10px; }
.progress-bar { height: 100%; width: 0%; background-color: #FF8200; transition: width 0.4s ease; }
.progress-bar.loading { background-image: linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent); background-size: 1rem 1rem; animation: progress-stripes 1s linear infinite; }
@keyframes progress-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } }

.logo { height: 32px; object-fit: contain; }
.sys-title { font-size: 18px; letter-spacing: 1px; margin-right: 10px; font-weight: bold; }
.control-group { display: flex; align-items: center; background-color: rgba(255, 255, 255, 0.1); padding: 6px 12px; border-radius: 6px; gap: 8px; border: 1px solid rgba(255, 255, 255, 0.2); }
.group-label { font-size: 14px; font-weight: bold; color: #E2F0FF; }
select, .date-picker { padding: 6px 10px; font-size: 14px; border-radius: 4px; border: 1px solid transparent; outline: none; background-color: white; color: #333; cursor: pointer; width: 140px; }

.primary-btn { padding: 8px 24px; font-size: 15px; cursor: pointer; background-color: #FF8200; color: white; border: none; border-radius: 6px; font-weight: bold; transition: background 0.2s; }
.primary-btn:hover { background-color: #e67300; }
.primary-btn:disabled { background-color: #aaa; cursor: not-allowed; }

.leaflet-right { transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; }
body.right-panel-open .leaflet-right { right: 460px !important; }

/* ================= AI Agent 聊天区域样式 ================= */
#ai-assistant-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 60vh;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0; 
}
.ai-chat-header {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ai-chat-header h3 {
    margin: 0;
    font-size: 15px;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    /* 强制标题不换行，且绝对不被挤压 */
    white-space: nowrap; 
    flex-shrink: 0;   
}
.ai-chat-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #f1f8e9; 
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.ai-msg {
    background: #fff;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 0;
    border: 1px solid #c8e6c9;
}
.user-msg {
    background: #4caf50; 
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}
.ai-chat-input-area {
    display: flex;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #c8e6c9;
}
.ai-chat-input-area input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}
.ai-chat-input-area input:focus {
    border-color: #4caf50;
}
.ai-chat-input-area button {
    background: #2e7d32; 
    color: white;
    border: none;
    border-radius: 6px;
    margin-left: 10px;
    padding: 0 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.ai-chat-input-area button:hover {
    background: #1b5e20;
}
.model-select {
    padding: 4px 28px 4px 8px; 
    border-radius: 4px;
    border: 1px solid #fff;
    font-size: 13px; 
    outline: none;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    
    max-width: 210px;  
    flex: 1;           
    margin-left: 10px; 
    
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center; 
    background-size: 14px; 
}

.model-select option {
    color: #333;
    font-size: 13px; 
    padding: 6px 8px; 
}

.model-select option:disabled {
    color: #999;
    font-style: italic;
}
