/* ===== WePang 模拟经营 Demo — AI Panel Styles ===== */
/* AI 指令联动面板：像素风深色主题 */

/* ── 主布局 ───────────────────────────────────────── */
#appLayout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    background: #0f1020;
    gap: 0;
}

#gameWrap {
    flex-shrink: 0;
    position: relative;
}

/* ── AI 面板容器 ──────────────────────────────────── */
#aiPanel {
    width: 300px;
    min-width: 260px;
    max-width: 320px;
    height: 100vh;
    background: #1a1c2c;
    border-left: 2px solid #3b3a6e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

/* ── 面板头部 ─────────────────────────────────────── */
.ai-panel-header {
    padding: 12px 14px 10px;
    background: #2d2b55;
    border-bottom: 1px solid #5a578e;
    flex-shrink: 0;
}

.ai-panel-title {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #f7d51d;
    letter-spacing: 1px;
}

.ai-panel-sub {
    display: block;
    font-size: 10px;
    color: #8b8fa8;
    margin-top: 3px;
}

/* ── 自动监听状态栏 ───────────────────────────────── */
.ai-watch-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.ai-watch-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #41a6f6;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 5px #41a6f6;
    animation: watchPulse 2s ease-in-out infinite;
}

@keyframes watchPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 5px #41a6f6; }
    50% { opacity: 0.5; box-shadow: 0 0 2px #41a6f6; }
}

.ai-watch-status {
    font-size: 10px;
    color: #41a6f6;
    letter-spacing: 0.5px;
}

/* ── 快捷按钮 ─────────────────────────────────────── */
.ai-quick-btns {
    display: flex;
    gap: 8px;
    padding: 10px 12px 6px;
    flex-shrink: 0;
}

.btn-ai-sim {
    flex: 1;
    background: #2a2850;
    color: #f7d51d;
    border-color: #f7d51d;
    font-size: 11px;
    padding: 6px 8px;
}
.btn-ai-sim:hover { background: #3b3a6e; }

.btn-ai-clear {
    flex: 1;
    background: #2a2850;
    color: #8b8fa8;
    border-color: #5a578e;
    font-size: 11px;
    padding: 6px 8px;
}
.btn-ai-clear:hover { background: #3b3a6e; color: #e8e8e8; }

/* ── 输入区 ───────────────────────────────────────── */
.ai-input-wrap {
    padding: 0 12px 8px;
    flex-shrink: 0;
}

.ai-textarea {
    width: 100%;
    height: 110px;
    background: #0f1020;
    color: #e8e8e8;
    border: 1px solid #5a578e;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    padding: 8px;
    resize: none;
    box-sizing: border-box;
    outline: none;
    display: block;
}

.ai-textarea:focus {
    border-color: #f7d51d;
}

.ai-textarea::placeholder {
    color: #444466;
}

.btn-ai-send {
    width: 100%;
    margin-top: 6px;
    background: #29366f;
    color: #f7d51d;
    border-color: #41a6f6;
    font-size: 12px;
    padding: 8px;
    letter-spacing: 2px;
}
.btn-ai-send:hover {
    background: #3b4fa0;
    border-color: #f7d51d;
}

/* ── 成员快捷区 ───────────────────────────────────── */
.ai-member-title {
    padding: 4px 12px 4px;
    font-size: 10px;
    color: #8b8fa8;
    flex-shrink: 0;
    border-top: 1px solid #2d2b55;
}

#aiMemberBtns {
    padding: 4px 10px 6px;
    flex-shrink: 0;
    max-height: 160px;
    overflow-y: auto;
}

.ai-member-group {
    margin-bottom: 5px;
}

.ai-dept-label {
    display: block;
    font-size: 9px;
    margin-bottom: 3px;
    letter-spacing: 1px;
}

.btn-member-quick {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 6px;
    margin: 2px 2px 0 0;
    background: #0f1020;
    color: #e8e8e8;
    border: 1px solid #3b3a6e;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.15s;
}

.btn-member-quick:hover {
    background: #2d2b55;
    color: #f7d51d;
}

.btn-member-quick span {
    font-size: 10px;
}

/* ── 执行日志 ─────────────────────────────────────── */
.ai-log-title {
    padding: 6px 12px 3px;
    font-size: 10px;
    color: #8b8fa8;
    border-top: 1px solid #2d2b55;
    flex-shrink: 0;
}

#aiLog {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px;
    min-height: 60px;
}

#aiLog::-webkit-scrollbar { width: 4px; }
#aiLog::-webkit-scrollbar-track { background: #0f1020; }
#aiLog::-webkit-scrollbar-thumb { background: #3b3a6e; }

.ai-log-item {
    font-size: 11px;
    line-height: 1.6;
    padding: 3px 0;
    border-bottom: 1px solid #1e1d3a;
    word-break: break-all;
}

.ai-log-ok { color: #38b764; }
.ai-log-warn { color: #ef7d57; }
.ai-log-hint { color: #444466; font-style: italic; }

.ai-task-tag {
    display: inline-block;
    padding: 0 4px;
    background: #29366f;
    color: #41a6f6;
    border: 1px solid #41a6f6;
    font-size: 10px;
}

/* ── 底部说明 ─────────────────────────────────────── */
.ai-panel-footer {
    padding: 8px 12px 10px;
    border-top: 1px solid #2d2b55;
    flex-shrink: 0;
    font-size: 10px;
    color: #8b8fa8;
    line-height: 1.7;
}

.ai-panel-footer p { margin: 0; }
.ai-panel-footer b { color: #f7d51d; }
.ai-hint-dim {
    color: #444466;
    font-size: 9px;
    margin-top: 4px !important;
    line-height: 1.5;
}

/* ── 移动端隐藏 AI 面板 ───────────────────────────── */
@media (max-width: 600px) {
    #aiPanel { display: none !important; }
    #appLayout { flex-direction: column; }
}

/* ── 滚动条美化（成员按钮区） ─────────────────────── */
#aiMemberBtns::-webkit-scrollbar { width: 3px; }
#aiMemberBtns::-webkit-scrollbar-track { background: #0f1020; }
#aiMemberBtns::-webkit-scrollbar-thumb { background: #3b3a6e; }

/* ── WS 状态指示器 ─────────────────────────────────── */
.ai-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.ws-status-badge {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ws-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8b8fa8;
    display: inline-block;
    flex-shrink: 0;
}
.ws-dot.blink {
    background: #38b764;
    animation: wsBlink 1.5s infinite;
}
@keyframes wsBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.ws-label { font-size: 9px; color: #8b8fa8; }
.ai-hr { border: none; border-top: 1px solid #2d2b55; margin: 5px 0; }
