﻿/* WOOD MONITOR - 深色主题样式 */

/* CSS 变量 */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --border-color: #30363d;
    --hover-bg: #1f2937;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部导航栏 */
.top-nav {
    display: flex;
    align-items: center;
    height: 50px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    gap: 30px;
}

.nav-item {
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.nav-item

/* 主内容区 */
.main-container {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 左侧面板：AI推荐官 */
.left-panel {
    flex: 3;
    min-width: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}







.ai-header h3 {
    font-size: 16px;
    color: var(--text-primary);
}





.ai-message.bot {
    border-left: 3px solid var(--accent-blue);
}

.ai-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-message li {
    margin: 5px 0;
}



#aiInput {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

#aiInput:focus {
    outline: none;
    border-color: var(--accent-blue);
}

#aiSendBtn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

#aiSendBtn:hover {
    background: #4a9aef;
}

/* 中间面板：地图区域 */
.center-panel {
    flex: 0.8;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    overflow-y: auto;
}

.map-container {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.map-title {
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.map-box {
    flex: 1;
    min-height: 200px;
    overflow: hidden;
}

.static-map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #1a2332 0%, #0d1117 100%);
    color: var(--text-secondary);
}

.static-map-placeholder p {
    font-size: 18px;
    margin: 10px 0;
}

.static-map-placeholder .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 右侧面板：15个等宽框 */
.right-panel {
    flex: 2;
    min-width: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 15px;
    overflow-y: auto;
}

.right-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px;
}

.grid-item {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 10px;
}

.grid-item:hover {
    background: var(--hover-bg);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.grid-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.grid-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
}

/* AI聊天模块（悬浮） */
#agent {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

#agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: linear-gradient(135deg, #1a2332 0%, #0d1117 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
    font-size: 14px;
    font-weight: 600;
}

#agent-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}

#agent-close:hover {
    color: var(--text-primary);
}

#agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    font-size: 13px;
}

#agent-input {
    display: flex;
    gap: 10px;
    padding: 12px 15px;
    border-top: 1px solid var(--border-color);
}

#agent-input input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

#agent-input input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

#agent-input button {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

#agent-input button:hover {
    background: #4a9aef;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* ========== AI Chat Panel (Homepage) ========== */
/* AI Assistant Panel - right panel bottom with avatar */




















.chat-msg { margin-bottom: 10px; }
.chat-msg.user { text-align: right; }
.chat-msg.user .bubble {
    display: inline-block; max-width: 85%; padding: 8px 12px;
    background: #238636; color: #fff; border-radius: 12px 12px 2px 12px;
    font-size: 13px; word-break: break-word;
}
.chat-msg.ai .bubble {
    display: inline-block; max-width: 90%; padding: 8px 12px;
    background: #21262d; color: #c9d1d9; border: 1px solid #30363d;
    border-radius: 12px 12px 12px 2px; font-size: 13px; word-break: break-word;
}
.chat-msg.sys { text-align: center; font-size: 11px; color: #8b949e; margin: 6px 0; }
.loading-pulse { display: inline-block; color: #8b949e; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:0.4} 50%{opacity:1} }



.ai-chat-input::placeholder { color: #484f58; }
.ai-chat-input:focus { border-color: #58a6ff; }

.ai-chat-send:hover { background: #2ea043; }

/* ===== AI Float Panel (Bottom Right) ===== */


.ai-float-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.ai-float-avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, transparent 60%, #1a2332 100%);
    pointer-events: none;
}


.ai-float-body .chat-msg { margin-bottom: 8px; }
.ai-float-body .chat-msg.user { text-align: right; }
.ai-float-body .chat-msg.user .bubble {
    background: #1f6feb;
    color: #fff;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 12px 12px 4px 12px;
    max-width: 90%;
}
.ai-float-body .chat-msg.ai .bubble {
    background: #21262d;
    color: #c9d1d9;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 12px 12px 12px 4px;
    max-width: 90%;
}
.ai-float-body .chat-msg.sys {
    text-align: center;
    color: #8b949e;
    font-size: 11px;
    margin: 8px 0;
}

.ai-float-input input {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 8px 12px;
    color: #c9d1d9;
    font-size: 12px;
    outline: none;
}
.ai-float-input input::placeholder { color: #484f58; }
.ai-float-input input:focus { border-color: #58a6ff; }
.ai-float-input button {
    padding: 8px 16px;
    background: #238636;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}
.ai-float-input button:hover { background: #2ea043; }


/* Bottom Index Bar */
.index-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.index-card {
    flex: 1 1 0;
    min-width: 130px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.index-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88,166,255,0.15);
}

.index-card-name {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-all;
}

.index-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.index-card-change {
    font-size: 12px;
    font-weight: 600;
}

.index-card-change.up { color: var(--accent-red); }
.index-card-change.down { color: var(--accent-green); }

/* Footer */
footer {
    text-align: center;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}