/* ==================================================
   斗罗紫韵 · 全局主题美化
   风格：紫极魔瞳 · 幽冥魂环 · 星斗紫霞 · 深邃玄幻
   覆盖：状态栏/记忆区/聊天气泡/输入框/按钮/滚动条
   ================================================== */

/* ---------- 全局背景与字体 ---------- */
body, #app, .main-container {
    background: #1e1a2e;
    background-image:
        radial-gradient(ellipse at 25% 25%, rgba(150, 100, 255, 0.2), transparent 55%),
        radial-gradient(ellipse at 75% 75%, rgba(120, 60, 220, 0.18), transparent 50%),
        radial-gradient(ellipse at 60% 40%, rgba(200, 120, 255, 0.08), transparent 40%),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 4px);
    color: #d8c8f0;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: #1e1a2e;
    border-left: 1px solid #7a5ab0;
}
::-webkit-scrollbar-thumb {
    background: #9a7ad0;
    border: 2px solid #1e1a2e;
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: #b89ae8;
}

/* ---------- 折叠块（状态栏基础容器） ---------- */
details {
    background: #f5f0ff;               /* 浅紫底 */
    border: 2px solid #a08ad0;
    border-radius: 20px;
    margin: 16px 0;
    width: 100%;
    box-shadow:
        inset 0 0 25px rgba(160, 120, 230, 0.3),
        0 0 15px rgba(120, 80, 220, 0.4);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

/* 紫色魂环光晕装饰 */
details::before {
    content: "";
    position: absolute;
    top: -30px; right: -30px;
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 3px solid rgba(160, 120, 240, 0.6);
    box-shadow: 0 0 25px rgba(140, 100, 230, 0.6), inset 0 0 25px rgba(140, 100, 230, 0.3);
    pointer-events: none;
    z-index: 0;
    animation: soulRingFloatPurple 5s ease-in-out infinite;
}
@keyframes soulRingFloatPurple {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

details[open] {
    border-color: #b89ae8;
    box-shadow:
        inset 0 0 30px rgba(160, 120, 230, 0.4),
        0 0 25px rgba(130, 90, 230, 0.6);
}

/* 标题栏 —— 紫极武魂 */
summary {
    cursor: pointer;
    padding: 14px 20px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #8a6ad8, #6a4ab8);
    border-bottom: 2px solid #b8a0e8;
    border-radius: 18px 18px 0 0;
    letter-spacing: 1.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    list-style: none;
    position: relative;
    z-index: 2;
}
summary:hover {
    background: linear-gradient(135deg, #9a7ae8, #7a5ac8);
    text-shadow: 0 0 8px #fff;
}
summary::-webkit-details-marker { display: none; }
summary::before {
    content: "🔮";   /* 紫极魔瞳 */
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px #fff);
}

/* 内部内容区 */
details div, details .panel, details .stats-panel {
    color: #3a2058;
    padding: 16px 18px;
    line-height: 1.75;
    font-size: 0.88rem;
    background: rgba(245, 240, 255, 0.9);
    border-top: 2px solid #b8a0e8;
    border-radius: 0 0 18px 18px;
    position: relative;
    z-index: 1;
}

/* 状态行 */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px dashed #b8a0e0;
    transition: background 0.2s;
}
.stat-row:hover { background: rgba(235, 225, 255, 0.5); }
.stat-row:last-child { border-bottom: none; }
.stat-row span:first-child {
    min-width: 100px;
    color: #6a4a9a;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.stat-row span:last-child {
    min-width: 45px;
    text-align: right;
    color: #4a2a7a;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(160, 120, 240, 0.4);
}

/* 进度条 —— 魂力条（紫韵） */
.progress-bar {
    background: #d8c8f0;
    border-radius: 20px;
    height: 14px;
    width: 55%;
    overflow: hidden;
    border: 2px solid #a08ad0;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.1), 0 0 6px rgba(130, 90, 230, 0.3);
}
.progress-fill {
    background: linear-gradient(90deg, #a080e0, #8a6ad8, #b090f0);
    height: 100%;
    border-radius: 20px;
    transition: width 0.4s;
    box-shadow: inset 0 0 6px rgba(255,255,255,0.6), 0 0 8px #c0a8f8;
}

/* 记忆表格 */
.memory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 10px;
    border: 2px solid #a08ad0;
    background: #f5f0ff;
    border-radius: 10px;
    overflow: hidden;
}
.memory-table th {
    background: #8a6ad8;
    color: #fff;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #b8a0e8;
    letter-spacing: 1px;
}
.memory-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #d0c0f0;
    color: #3a2058;
}
.memory-table tr:hover td { background: #ede4ff; }

/* 长记忆卡片 */
.long-memory {
    background: #f8f4ff;
    border-left: 5px solid #8a6ad8;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #3a2058;
    box-shadow: inset 0 0 8px rgba(160, 120, 230, 0.25);
    border-radius: 12px;
}

/* ---------- 聊天气泡美化 ---------- */
.message, .mes {
    background: #f5f0ff;
    border: 2px solid #a08ad0;
    border-radius: 16px;
    padding: 10px 14px;
    margin: 8px 0;
    color: #3a2058;
    box-shadow: 0 2px 8px rgba(120, 80, 200, 0.2);
}
.mes_text {
    color: #3a2058;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 头像边框 */
.avatar, .character_avatar, .user_avatar {
    border: 3px solid #8a6ad8;
    border-radius: 50%;
    box-shadow: 0 0 8px #c0a8f8;
}

/* 名字标签 */
.name_text, .character_name, .user_name {
    color: #d0c0f8;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px #000;
}

/* ---------- 输入框与按钮 ---------- */
textarea, input[type="text"], input[type="search"], .chat_textarea {
    background: #f5f0ff;
    border: 2px solid #a08ad0;
    border-radius: 12px;
    padding: 8px;
    color: #3a2058;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    box-shadow: inset 0 0 5px rgba(160, 120, 230, 0.3);
}
textarea:focus, input:focus {
    outline: none;
    border-color: #b8a0e8;
    box-shadow: 0 0 10px #d0c0f8;
}

button, .menu_button, .send_button {
    background: linear-gradient(135deg, #8a6ad8, #6a4ab8);
    border: 2px solid #b8a0e8;
    border-radius: 20px;
    color: #fff;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 3px #fff;
    transition: all 0.2s;
    box-shadow: 0 0 8px #c0a8f8;
}
button:hover, .menu_button:hover, .send_button:hover {
    background: linear-gradient(135deg, #9a7ae8, #7a5ac8);
    box-shadow: 0 0 15px #d8c8ff;
}

/* ---------- 斗罗特色装饰 ---------- */
.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #a08ad0, #8a6ad8, #a08ad0, transparent);
    margin: 14px 0;
}

.value-up { color: #3a9a6a; font-weight: bold; text-shadow: 0 0 4px #00ffcc; }
.value-down { color: #cc4455; font-weight: bold; text-shadow: 0 0 4px #ff88aa; }

.glow-text {
    color: #c8b0f8;
    font-size: 0.7rem;
    margin-left: 6px;
    animation: soulGlowPurple 2s infinite;
}
@keyframes soulGlowPurple {
    0%, 100% { text-shadow: 0 0 3px #c8b0f8; }
    50% { text-shadow: 0 0 12px #a080ff; }
}