/* 黑龙江省3D校园水质监测系统 - 样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #000510 0%, #0a1628 100%);
}

#container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

/* 面板通用样式 */
.panel {
    position: absolute;
    background: rgba(0, 20, 40, 0.9);
    color: #fff;
    border-radius: 10px;
    border: 2px solid #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    user-select: none;
}

.panel-header:hover {
    background: rgba(0, 212, 255, 0.2);
}

.panel-title {
    font-size: 16px;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.toggle-btn {
    background: none;
    border: none;
    color: #00d4ff;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.toggle-btn:hover {
    transform: scale(1.2);
}

.toggle-btn.collapsed {
    transform: rotate(180deg);
}

.panel-content {
    padding: 15px;
    max-height: 2000px;
    overflow: visible;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.panel-content.collapsed {
    max-height: 0;
    padding: 0 15px;
    opacity: 0;
    overflow: hidden;
}

#info-panel {
    top: 20px;
    left: 20px;
    max-width: 350px;
}

#info-panel h2 {
    font-size: 16px;
    margin-top: 15px;
    margin-bottom: 10px;
    color: #4dd0e1;
}

.campus-info {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    border-left: 3px solid #00d4ff;
}

.status-good {
    color: #4caf50;
}

.status-warning {
    color: #ff9800;
}

.status-danger {
    color: #f44336;
}

.legend {
    bottom: 20px;
    right: 20px;
    min-width: 220px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 10px currentColor;
}

.controls {
    top: 20px;
    right: 20px;
    min-width: 280px;
}

.control-item {
    font-size: 12px;
    margin-bottom: 5px;
    color: #4dd0e1;
}

#stats {
    bottom: 20px;
    left: 20px;
    min-width: 200px;
}

.stat-item {
    font-size: 12px;
    margin-bottom: 5px;
}

/* 控制按钮样式 */
.control-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ctrl-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.ctrl-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.5);
}

.ctrl-btn:active {
    transform: translateY(0);
}

.ctrl-btn.active {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.ctrl-btn.danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* 滑块样式 */
.slider-container {
    margin-bottom: 15px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #4dd0e1;
}

.slider-value {
    color: #00d4ff;
    font-weight: bold;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 212, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 212, 255, 1);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.tooltip {
    position: absolute;
    background: rgba(0, 20, 40, 0.95);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #00d4ff;
    font-size: 12px;
    pointer-events: none;
    display: none;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    max-width: 250px;
}

.tooltip.show {
    display: block;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 3px 0;
}

.data-label {
    color: #4dd0e1;
}

.data-value {
    font-weight: bold;
    color: #00d4ff;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* AI助手样式 */
#ai-panel {
    max-height: 400px;
}

#ai-chat-messages {
    font-size: 12px;
}

.ai-message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 5px;
    line-height: 1.6;
}

.ai-message.user {
    background: rgba(0, 212, 255, 0.2);
    border-left: 3px solid #00d4ff;
}

.ai-message.assistant {
    background: rgba(76, 175, 80, 0.2);
    border-left: 3px solid #4caf50;
}

.ai-message.error {
    background: rgba(244, 67, 54, 0.2);
    border-left: 3px solid #f44336;
}

input[type="text"]#ai-input {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

input[type="text"]#ai-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

input[type="text"]#ai-input:focus {
    outline: none;
    border-color: #4dd0e1;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* 通知消息样式 */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 212, 255, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    z-index: 10000;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
    transition: opacity 0.5s;
}

/* Markdown渲染内容样式 */
.ai-message h1, .ai-message h2, .ai-message h3 {
    color: #00d4ff;
    margin-top: 10px;
    margin-bottom: 8px;
}

.ai-message h1 { font-size: 18px; }
.ai-message h2 { font-size: 16px; }
.ai-message h3 { font-size: 14px; }

.ai-message p {
    margin: 6px 0;
    line-height: 1.6;
}

.ai-message code {
    background: rgba(0, 212, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    color: #00d4ff;
}

.ai-message pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 8px 0;
}

.ai-message pre code {
    background: none;
    padding: 0;
    color: #4dd0e1;
}

.ai-message ul, .ai-message ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-message li {
    margin: 4px 0;
}

.ai-message blockquote {
    border-left: 3px solid #00d4ff;
    padding-left: 10px;
    margin: 8px 0;
    color: #4dd0e1;
    background: rgba(0, 212, 255, 0.1);
    padding: 8px 10px;
    border-radius: 3px;
}

.ai-message table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
    font-size: 11px;
}

.ai-message th, .ai-message td {
    border: 1px solid rgba(0, 212, 255, 0.3);
    padding: 6px;
    text-align: left;
}

.ai-message th {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-weight: bold;
}

.ai-message a {
    color: #00d4ff;
    text-decoration: underline;
}

.ai-message a:hover {
    color: #4dd0e1;
}

/* LaTeX公式样式 */
.ai-message .katex {
    font-size: 1.1em;
}

.ai-message .katex-display {
    margin: 10px 0;
    overflow-x: auto;
    overflow-y: hidden;
}
