/* --- 基础样式 --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #000;
    overflow: hidden;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    color: white;
}

#particleCanvas {
    position: fixed; top: 0; left: 0; z-index: -1;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle at center, rgba(35, 35, 60, 0.4) 0%, transparent 80%);
    position: relative;
    z-index: 1;
}

/* --- UI 遮罩层 --- */
#uiOverlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.2);
    z-index: 998;
    display: none;
    /* 移除 backdrop-filter，只保留半透明遮罩 */
}

/* --- 头部与角色区 --- */
.header { margin-top: 30px; font-size: 12px; letter-spacing: 5px; opacity: 0.4; }

.character-zone { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; width: 100%; }

.glow {
    position: absolute; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255, 200, 50, 0.12) 0%, transparent 65%);
    pointer-events: none;
    mix-blend-mode: screen;
}

/* --- 对话框设计 --- */
.chat-display {
    width: 90%; max-width: 600px;
    padding: 25px; text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease-out;
}

.ai-text { font-size: 18px; margin-bottom: 8px; line-height: 1.6; font-weight: 300; }
.subtitle { font-size: 13px; color: rgba(255,255,255,0.4); }

#saveMemoryBtn {
    display: none; cursor: pointer; font-size: 11px; opacity: 0.6;
    margin-top: 15px; transition: opacity 0.3s;
}
#saveMemoryBtn:hover { opacity: 1; }

/* --- 输入区 --- */
.input-area {
    width: 100%; max-width: 500px; padding: 0 20px 40px;
    display: flex; gap: 12px;
}

input {
    flex: 1; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
    padding: 14px 20px; border-radius: 30px; color: white; outline: none; transition: 0.3s;
}
input:focus { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }

button {
    background: #fff; color: #000; border: none; padding: 0 25px;
    border-radius: 30px; cursor: pointer; font-weight: 600; transition: transform 0.2s;
}
button:active { transform: scale(0.92); }

/* --- 设置面板 & 记忆列表 --- */
#settingsPanel {
    position: fixed; top: 20px; right: 20px; z-index: 1000;
    width: 320px; padding: 25px;
    background: rgba(30, 30, 40, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    opacity: 0; visibility: hidden;
    transform: translateX(40px);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#settingsPanel.active { opacity: 1; visibility: visible; transform: translateX(0); }

#toggleSettings {
    position: fixed; top: 20px; right: 20px; z-index: 1001;
    background: transparent; color: #fff; opacity: 0.3; padding: 10px; font-size: 20px;
}

textarea {
    width: 100%; height: 110px; background: rgba(0,0,0,0.3); color: #fff;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
    padding: 12px; font-size: 13px; resize: none; margin-top: 15px; outline: none;
}

.primary-btn { width: 100%; margin-top: 15px; padding: 12px 0; }

.memory-list { margin-top: 15px; max-height: 220px; overflow-y: auto; }
.memory-item {
    background: rgba(255,255,255,0.04); padding: 12px; border-radius: 12px;
    margin-bottom: 10px; cursor: pointer; transition: 0.2s;
    display: flex; justify-content: space-between; align-items: center; border: 1px solid transparent;
}
.memory-item:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }