:root {
    --bg: #121212;          /* 调亮背景 */
    --panel: #1e1e1e;       /* 调亮面板 */
    --accent: #00ff9d;      /* 秋武绿 */
    --text: #f8f9fa;        /* 高对比度文字 */
    --text-dim: #b5bcc3;    /* 辅助文字，微调亮度 */
    --border: #333;
    --user-bg: #004d33;     /* 用户消息深绿 */
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

body { background: #000; color: var(--text); height: 100vh; display: flex; justify-content: center; overflow: hidden; }

.app-container { width: 100%; max-width: 500px; height: 100%; display: flex; flex-direction: column; background: var(--bg); position: relative; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

/* Header 样式 */
.system-header { padding: 18px 20px; background: var(--panel); border-bottom: 1px solid var(--border); }
.identity-group { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar-img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }
.name { font-weight: bold; font-size: 1.1em; color: var(--accent); letter-spacing: 0.5px; }
.title { font-size: 0.75em; color: var(--text-dim); }

.hp-track { height: 4px; background: #222; border-radius: 2px; margin-top: 5px; overflow: hidden; }
.hp-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #00ff9d, #00a8ff); box-shadow: 0 0 8px var(--accent); }

/* 聊天区域 - 核心修复点 */
.chat-viewport { flex: 1; max-height: calc(100vh - 200px); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }

.message { display: flex; flex-direction: column; max-width: 88%; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.bot-msg { align-self: flex-start; }
.user-msg { align-self: flex-end; }

.bubble { padding: 12px 16px; border-radius: 14px; line-height: 1.6; font-size: 0.95em; word-wrap: break-word; }
.bot-msg .bubble { background: var(--panel); border: 1px solid var(--border); color: var(--text); }
.user-msg .bubble { background: var(--user-bg); color: #fff; border-bottom-right-radius: 2px; }

/* 交互芯片 */
.chips-container { padding: 12px; display: flex; gap: 8px; overflow-x: auto; white-space: nowrap; background: var(--bg); border-top: 1px solid var(--border); }
.chips-container::-webkit-scrollbar { display: none; }
.chip { padding: 7px 15px; background: var(--panel); border: 1px solid var(--accent); color: var(--accent); border-radius: 18px; font-size: 0.85em; cursor: pointer; transition: 0.2s; }
.chip:hover { background: var(--accent); color: #000; }

/* 控制面板 - 解决遮挡 */
.control-panel { padding: 15px 20px env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--border); }
.input-group { display: flex; gap: 10px; margin-bottom: 8px; }
input { flex: 1; background: #2a2a2a; border: 1px solid var(--border); border-radius: 10px; padding: 12px 15px; color: #fff; font-size: 16px; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 5px rgba(0, 255, 157, 0.2); }
#send-btn { background: var(--accent); border: none; border-radius: 10px; width: 50px; cursor: pointer; color: #000; transition: 0.2s; }
#send-btn:active { transform: scale(0.9); }

.sys-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.75em; color: var(--text-dim); }
.reset-btn { background: none; border: none; color: #ff4757; cursor: pointer; display: flex; align-items: center; gap: 4px; }
