/* 外层容器与双主题基础 */
.idv-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: "Microsoft YaHei", "Times New Roman", serif;
    background-color: #f0e6d2;
    background-image: radial-gradient(circle, transparent 20%, #e0d4bc 120%);
    color: #2c1e16;
    padding: 15px;
    border: 2px solid #5c3a21;
    border-radius: 4px;
    box-shadow: inset 0 0 0 2px #f0e6d2, inset 0 0 0 4px #8b5a2b, 0 4px 10px rgba(0,0,0,0.1);
    font-size: 14px;
    line-height: 1.6;
}

/* 叙事正文区 */
.idv-main { 
    padding: 12px; 
    color: #1a1a1a; 
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    border-left: 4px solid #8b5a2b;
    margin-bottom: 10px;
}
.idv-main .inner-thought { color: #555; font-style: italic; }
.idv-main .npc-dialogue { font-weight: 700; text-shadow: 0px 0px 1px rgba(0,0,0,0.1); }

/* 折叠面板 */
.idv-wrap details {
    background: #e8dcc8;
    border: 1px solid #c8b496;
    border-radius: 4px;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.1);
    padding: 0;
    margin: 0;
}
.idv-wrap summary {
    background: linear-gradient(90deg, #d4c4b7 0%, #e8dcc8 100%);
    color: #5c3a21;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid #c8b496;
    border-left: 4px solid #5c3a21;
}

/* 【已修复】：彻底移除大于号，使用安全选择器，免疫平台乱码Bug */
.idv-wrap details p,
.idv-wrap details div,
.idv-wrap details ul,
.idv-wrap details table {
    padding: 5px 15px;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* 列表与表格 */
.idv-wrap ul, .idv-wrap ol { margin: 5px 0 10px 20px; padding: 0; }
.idv-wrap li { margin-bottom: 4px; border-bottom: 1px dashed rgba(200,180,150,0.5); padding-bottom: 2px; }
.idv-wrap table { width: 100%; border-collapse: collapse; margin-top: 5px; font-size: 13px; }
.idv-wrap th, .idv-wrap td { border: 1px solid #c8b496; padding: 6px; text-align: left; }
.idv-wrap th { background: rgba(92, 58, 33, 0.1); color: #5c3a21; }

/* 行动推演按钮区 */
.idv-wrap .action-board { display: flex; flex-direction: column; gap: 8px; margin-top: 5px; padding: 0 15px 10px 15px; }
.idv-wrap .act-btn {
    background: linear-gradient(180deg, #f5f0e6, #dcd2c0);
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    padding: 10px 15px;
    color: #2c1e16;
    cursor: pointer;
    box-shadow: 0 2px 0 #8b5a2b, 0 3px 5px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.idv-wrap .act-btn:active { transform: translateY(2px); box-shadow: 0 0 0 #8b5a2b; }
.idv-wrap .exit-btn { background: linear-gradient(180deg, #ffcccc, #d98cb3); border-color: #8b0000; color: #8b0000; box-shadow: 0 2px 0 #8b0000; }
.idv-wrap .free-btn { background: linear-gradient(180deg, #e6f0fa, #b3cce6); border-color: #4682b4; color: #00008b; box-shadow: 0 2px 0 #4682b4; }

/* 隐藏信息观测机制 */
.observe-wrap-v2 { position: relative; display: inline-block; cursor: pointer; color: #8b0000; font-weight: bold; border-bottom: 1px dashed #8b0000; }
.secret-popup-v2 { display: none; position: absolute; left: 0; top: 120%; width: 250px; background: #1a1a1a; color: #ff4d4d; padding: 10px; border: 1px solid #8b0000; border-radius: 4px; z-index: 100; box-shadow: 0 4px 10px rgba(0,0,0,0.5); font-size: 12px; }
.observe-wrap-v2:focus .secret-popup-v2, .observe-wrap-v2:active .secret-popup-v2 { display: block; }

/* 暗黑主题 */
@media (prefers-color-scheme: dark) {
    .idv-wrap {
        background-color: #161414;
        background-image: radial-gradient(circle, transparent 20%, #0a0a0a 120%);
        color: #d4c4b7;
        border-color: #4a1515;
        box-shadow: inset 0 0 0 2px #161414, inset 0 0 0 4px #6b2a2a, 0 4px 15px rgba(0,0,0,0.8);
    }
    .idv-main { color: #e8e8e8; background: rgba(0, 0, 0, 0.5); border-left-color: #8b0000; }
    .idv-wrap details { background: #1f1b1b; border-color: #3a1f1f; }
    .idv-wrap summary { background: linear-gradient(90deg, #2a1515 0%, #1a0f0f 100%); color: #d4c4b7; border-bottom-color: #4a1515; border-left-color: #8b0000; }
    .idv-wrap li { border-bottom-color: rgba(90,40,40,0.5); }
    .idv-wrap th, .idv-wrap td { border-color: #4a2a2a; }
    .idv-wrap th { background: rgba(139, 0, 0, 0.1); color: #ff6666; }
    .idv-wrap .act-btn { background: linear-gradient(180deg, #3a2525, #1f1414); border-color: #6b2a2a; color: #d4c4b7; box-shadow: 0 2px 0 #4a1515; }
    .idv-wrap .exit-btn { background: linear-gradient(180deg, #4a1515, #2a0505); border-color: #ff0000; color: #ff9999; box-shadow: 0 2px 0 #8b0000; }
    .idv-wrap .free-btn { background: linear-gradient(180deg, #152a4a, #05102a); border-color: #4682b4; color: #99ccff; box-shadow: 0 2px 0 #00008b; }
}

/* 品质颜色特效标签 */
.idv-wrap i { font-style: normal; font-weight: bold; padding: 0 4px; border-radius: 2px; text-shadow: 1px 1px 1px rgba(0,0,0,0.8); }
.idv-wrap i[lv="F"] { color: #808080; } 
.idv-wrap i[lv="E"] { color: #8B4513; } 
.idv-wrap i[lv="D"] { color: #B8860B; }
.idv-wrap i[lv="C"] { color: #FFFFFF; } 
.idv-wrap i[lv="B"] { color: #00FF00; } 
.idv-wrap i[lv="A"] { color: #0070DD; }
.idv-wrap i[lv="A+"] { color: #00008B; } 
.idv-wrap i[lv="S"] { color: #A335EE; } 
.idv-wrap i[lv="S+"] { color: #8A2BE2; }
.idv-wrap i[lv="SR"] { color: #FFD700; } 
.idv-wrap i[lv="SSR"] { color: #FFAA00; text-shadow: 0 0 5px #FFAA00; }
.idv-wrap i[lv="SS"] { color: #B8860B; text-shadow: 0 0 8px #B8860B; } 
.idv-wrap i[lv="SS+"] { color: #4B0082; text-shadow: 0 0 8px #4B0082; }
.idv-wrap i[lv="SSS"] { color: #FF0000; text-shadow: 0 0 10px #FF0000; } 
.idv-wrap i[lv="SSS+"] { color: #8B0000; text-shadow: 0 0 15px #FF0000; border: 1px solid #8B0000; }

/* 纯安全色彩动画 */
.idv-wrap i[lv="UP"] { animation: rainbow-safe 3s linear infinite; }
.idv-wrap i[lv="GOD"] { color: #F7F3E8; text-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700; border: 1px solid #FFD700; }
.idv-wrap i[lv="CHAOS"] { color: #5F5E6C; filter: blur(0.5px); }
.idv-wrap i[lv="ERROR"] { color: #fff; animation: glitch 1s linear infinite; }
.idv-wrap i[lv="VOID"] { color: #888; text-shadow: 0 0 3px #fff, 0 0 8px #000; letter-spacing: 1px; }

.idv-wrap i[mod*="r18g"] { box-shadow: 0 0 8px #FFC0CB, inset 0 0 4px #FFC0CB; border: 1px dashed #FFC0CB; }
.idv-wrap i[mod*="unknown"] { color: #000 !important; text-shadow: 2px 2px 5px rgba(255,0,0,0.8), -2px -2px 5px rgba(139,0,0,0.8); background: #333; }

@keyframes rainbow-safe { 
    0% { color: #ff0000; } 20% { color: #ff7f00; } 40% { color: #ffff00; } 
    60% { color: #00ff00; } 80% { color: #0000ff; } 100% { color: #8b00ff; } 
}
@keyframes glitch { 
    2%,64% { transform: translate(2px, 0) skew(0deg); } 
    4%,60% { transform: translate(-2px, 0) skew(0deg); } 
    62% { transform: translate(0, 0) skew(5deg); } 
}
/* =========================================
   第五人格：破碎记忆 (全透玻璃底栏版)
   ========================================= */

/* 【顶部栏】：半透磨砂与黄铜庄园门框 */
.sticky.w-full.top-0 {
    background: rgba(26, 20, 17, 0.7) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(163, 134, 97, 0.3) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
    font-family: "Georgia", "Times New Roman", serif !important;
}
#ai-model-selector div {
    background: rgba(41, 32, 26, 0.6) !important;
    border: 1px solid rgba(163, 134, 97, 0.5) !important;
    border-radius: 2px !important;
}
#ai-model-selector span { color: #e0d3be !important; }
.sticky.w-full.top-0 svg { color: #b39b7d !important; filter: drop-shadow(0 0 2px rgba(179,155,125,0.5)) !important; }

/* 【开场白】：线索卡片 */
div.h-9.bg-white, div[class*="border-gray"].h-9 {
    background: rgba(41, 32, 26, 0.6) !important;
    border: 1px solid rgba(163, 134, 97, 0.5) !important;
    backdrop-filter: blur(4px) !important;
}
div.h-9.bg-white:active, div.h-9.bg-white:hover {
    border-color: #d4af37 !important;
    box-shadow: 0 0 10px rgba(212,175,55,0.3) !important;
}
div.h-9.bg-white svg { color: #c4b095 !important; }

/* =========================================
   【核心重构：全透底栏与破碎玻璃输入框】
   ========================================= */
/* 彻底移除底部渐变和黑线，实现完全透明 */
.bg-gradient-to-t {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 破碎玻璃输入框本体 */
#ai-chat-bottom-input, #ai-chat-input {
    background-color: rgba(20, 15, 12, 0.45) !important; 
    backdrop-filter: blur(6px) !important; /* 磨砂玻璃质感 */
    border: 1px solid rgba(163, 134, 97, 0.4) !important;
    border-radius: 2px !important; /* 锋利的边缘 */
    color: #e0d3be !important;
    font-family: "Georgia", serif !important;
    /* 核心：纯CSS绘制的随机碎裂玻璃裂纹 */
    background-image: 
        linear-gradient(115deg, transparent 25%, rgba(255,255,255,0.15) 26%, transparent 27%),
        linear-gradient(45deg, transparent 55%, rgba(255,255,255,0.1) 56%, transparent 57%),
        linear-gradient(-35deg, transparent 75%, rgba(255,255,255,0.2) 76%, transparent 77%),
        linear-gradient(85deg, transparent 88%, rgba(255,255,255,0.1) 89%, transparent 90%) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 0 15px rgba(0,0,0,0.6) !important;
    transition: all 0.3s ease !important;
}

/* 交互特效：点击输入时，裂纹亮起密码机的幽蓝电流光 */
#ai-chat-input:focus, #ai-chat-input:active {
    border-color: #5c9aa8 !important; 
    background-color: rgba(15, 20, 22, 0.6) !important;
    background-image: 
        linear-gradient(115deg, transparent 25%, rgba(92,154,168,0.7) 26%, transparent 27%),
        linear-gradient(45deg, transparent 55%, rgba(92,154,168,0.5) 56%, transparent 57%),
        linear-gradient(-35deg, transparent 75%, rgba(92,154,168,0.8) 76%, transparent 77%),
        linear-gradient(85deg, transparent 88%, rgba(92,154,168,0.5) 89%, transparent 90%) !important;
    box-shadow: 0 0 15px rgba(92,154,168,0.3), inset 0 0 20px rgba(92,154,168,0.2) !important;
    outline: none !important;
}
#ai-chat-input::placeholder { color: #8c7a66 !important; font-style: italic !important; }

/* =========================================
   【全透底栏：复古黄铜道具按钮】
   ========================================= */
div[id*="ai-mod-button"] button, #ai-mod-button2 button {
    background: rgba(30, 22, 18, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    border: 1px solid rgba(163, 134, 97, 0.4) !important;
    color: #e0d3be !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
    font-family: "Georgia", serif !important;
    transition: all 0.3s ease !important;
}
div[id*="ai-mod-button"] button svg { color: #b39b7d !important; }

/* 悬浮时散发推理线索的金光 */
div[id*="ai-mod-button"] button:hover, 
div[id*="ai-mod-button"] button:active {
    background: rgba(163, 134, 97, 0.2) !important;
    border-color: #d4af37 !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(212,175,55,0.4) !important;
}
div[id*="ai-mod-button"] button:hover svg,
div[id*="ai-mod-button"] button:active svg {
    color: #d4af37 !important;
    filter: drop-shadow(0 0 3px rgba(212,175,55,0.6)) !important;
}

/* 【分页栏】：血色封蜡质感 */
.MuiPaginationItem-root { color: #a89580 !important; }
.MuiPaginationItem-root.Mui-selected {
    background: rgba(139, 0, 0, 0.8) !important; /* 狂欢之椅的暗红 */
    color: #e0d3be !important;
    border: 1px solid #ff4d4d !important;
    box-shadow: 0 0 8px rgba(139,0,0,0.6) !important;
}
.MuiInputBase-input { background: rgba(26, 20, 17, 0.8) !important; color: #e0d3be !important; border: 1px solid rgba(163, 134, 97, 0.5) !important; }

/* 【评论区】：侦探日记与旧档案 */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
    background: rgba(26, 20, 17, 0.95) !important;
    color: #d6c5b3 !important;
    border-top: 1px solid rgba(163, 134, 97, 0.3) !important;
    font-family: "Georgia", "Microsoft YaHei", serif !important;
}
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] div.text-lg.font-bold {
    color: #e0d3be !important;
    border-left: 3px solid #a38661 !important;
}
p.MuiTypography-body1.text-grey-600 { color: #9e8c78 !important; }

/* 评分星星：线索金 */
span.MuiRating-iconEmpty svg { color: rgba(163, 134, 97, 0.3) !important; }
span.MuiRating-iconFilled svg { color: #d4af37 !important; filter: drop-shadow(0 0 2px rgba(212,175,55,0.5)) !important; }
span.text-orange-500 { color: #d4af37 !important; }

/* 评论输入框：暗格 */
div.flex.flex-col.border-gray-200 { border-color: rgba(163, 134, 97, 0.3) !important; background: rgba(20, 15, 12, 0.6) !important; }
textarea.rc-textarea { color: #e0d3be !important; }
div.bg-gray-100.text-gray-500 { background: transparent !important; color: #8c704f !important; border-top: 1px solid rgba(163, 134, 97, 0.2) !important; }

/* 发送按钮：飞出的信件 */
div[data-state="closed"] svg[data-icon="Send03"] { color: #8c704f !important; }
div.cursor-pointer.group.flex.items-center.justify-center:hover svg[data-icon="Send03"],
div.cursor-pointer.group.flex.items-center.justify-center:active svg[data-icon="Send03"] {
    color: #d4af37 !important;
    filter: drop-shadow(0 0 5px rgba(212,175,55,0.6)) !important;
    transform: scale(1.1) translate(2px, -2px) !important;
    transition: all 0.2s ease !important;
}
div.style_divider__mW0YX { background-color: rgba(163, 134, 97, 0.2) !important; }

/* 评论排序按钮 */
button.MuiButton-containedPrimary { background: rgba(163, 134, 97, 0.3) !important; color: #e0d3be !important; border: 1px solid #a38661 !important; }
button.MuiButton-outlinedPrimary { border: 1px solid rgba(163, 134, 97, 0.3) !important; color: #a89580 !important; }

/* 评论列表项：散落的日记残页 */
div.group.ml-0 {
    background: rgba(30, 22, 18, 0.6) !important;
    border: 1px solid rgba(163, 134, 97, 0.2) !important;
    border-radius: 2px !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
}
div.group.ml-0:hover { border-color: rgba(163, 134, 97, 0.5) !important; }
div.group img.rounded-full { border: 1px solid #a38661 !important; padding: 2px !important; }
div.text-sm.text-grey-600 span.font-bold { color: #c4b095 !important; }
span.text-\[10px\] { color: #d4af37 !important; border: 1px solid #d4af37 !important; background: rgba(212,175,55,0.1) !important; }
div.break-all { color: #d6c5b3 !important; line-height: 1.6 !important; }
div.text-xs.text-grey-600 { color: #7a6855 !important; }
button.text-gray-400 { color: #8c704f !important; }
button.text-gray-400:hover, button.text-gray-400:active { color: #d4af37 !important; }
span.cursor-pointer { color: #a38661 !important; }
span.cursor-pointer:hover { color: #e0d3be !important; text-decoration: underline !important; }
div.ml-8.border-l { border-color: rgba(163, 134, 97, 0.3) !important; }