/* =========================================================================
 * 📌 【第一部分：全局基底重置与去留白】
 * =========================================================================
 */
tk, if, pt, u, n, b, m, r, ts, t, st, bx, ht, ms, ca, cb, cc, qz { 
    display: block !important; 
    box-sizing: border-box !important; 
}
tk { display: none !important; position: absolute !important; }

::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}
::-webkit-scrollbar-track {
    background: #ffffff !important;
    border-left: 1.5px solid #ff4d94 !important;
}
::-webkit-scrollbar-thumb {
    background: #ff4d94 !important;
    border-radius: 4px !important;
}

::selection {
    background: #ff4d94 !important;
    color: #ffffff !important;
}

/* 彻底清除原生小黑三角和“详细信息”字样 */
summary { list-style: none !important; outline: none !important; }
summary::-webkit-details-marker, summary::marker { display: none !important; color: transparent !important; }

/* 外层主气泡大框（强制去除丑陋黑框，套用你的粉色立体硬投影模板） */
.group [class*="bg-gray-100"], 
.group [class*="bg-primary-50"],
.group .bg-gray-100\/90,
.group .bg-primary-500\/10 {
    background: #ffffff !important;
    border: 3px solid #ff4d94 !important; 
    border-radius: 16px !important;
    box-shadow: 4px 4px 0px rgba(255, 77, 148, 0.15) !important; 
    color: #1a0f14 !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    padding: 16px 20px !important;
    margin: 12px 0 !important;
}

/* =========================================================================
 * 📌 【第二部分：主线叙事区与特定高亮】
 * =========================================================================
 */
pt {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 6px 0 !important;
    margin: 6px 0 !important;
    font-size: 14.5px !important;
    line-height: 1.65 !important;
    color: #1a0f14 !important;
}

/* 🔒 男女心声/语言特定高亮 */
p[style*="color: #e0125e"] {
    color: #ff0066 !important;
    font-weight: 800 !important;
    font-style: italic !important;
    background: #fff0f5 !important;
    border: 1.5px dashed #ff4d94 !important;
    padding: 4px 10px !important;
    border-radius: 10px !important;
    display: inline-block !important;
    margin: 4px 0 !important;
}
p[style*="color: #4C72B0"] {
    color: #4C72B0 !important;
    font-weight: 800 !important;
    background: #f0f5ff !important;
    border: 1.5px dashed #4C72B0 !important;
    padding: 4px 10px !important;
    border-radius: 10px !important;
    display: inline-block !important;
    margin: 4px 0 !important;
}

/* IF框体 (用于时间和选择题) */
if {
    background: #fffdfd !important;
    border: 1.5px solid #ff4d94 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    margin: 8px 0 14px 0 !important;
    box-shadow: 2px 2px 0px rgba(255, 77, 148, 0.1) !important;
    color: #3d242c !important;
    font-family: "Microsoft YaHei", sans-serif !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    white-space: pre-wrap !important;
    font-weight: bold !important;
}
if::before {
    content: "SYSTEM / ACTION" !important;
    display: block !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    color: #b3b3b3 !important;
    margin-bottom: 6px !important;
    text-transform: uppercase !important;
}

/* =========================================================================
 * 📌 【第三部分：右侧悬浮面板】
 * =========================================================================
 */

/* 3.1 未展开时的右侧悬浮挂件 (淡粉色竖条) */
.chat-container > div > div:last-child .markdown-body details.sc:not([open]) {
    position: fixed !important;
    right: 0 !important;
    z-index: 1000 !important;
    width: 38px !important;
    background: #fff5f7 !important;
    border: 2px solid #ff4d94 !important;
    border-right: none !important;
    border-radius: 12px 0 0 12px !important;
    margin: 0 !important;
    padding: 10px 2px !important;
}

.chat-container > div > div:last-child .markdown-body details.sc:not([open]) > summary.ss {
    all: initial !important;
    display: block !important;
    cursor: pointer !important;
    font-family: "Microsoft YaHei", sans-serif !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    color: #ff4d94 !important;
    writing-mode: vertical-rl !important;
    text-orientation: mixed !important;
    letter-spacing: 1px !important;
    text-align: center !important;
    margin: 0 auto !important;
}

/* 纵向错开高度定位四大面板 */
.chat-container > div > div:last-child .markdown-body details.sc:nth-of-type(2):not([open]) { top: 120px !important; } 
.chat-container > div > div:last-child .markdown-body details.sc:nth-of-type(3):not([open]) { top: 220px !important; } 
.chat-container > div > div:last-child .markdown-body details.sc:nth-of-type(4):not([open]) { top: 320px !important; } 
.chat-container > div > div:last-child .markdown-body details.sc:nth-of-type(5):not([open]) { top: 420px !important; } 

/* 3.2 抽屉点击激活状态 */
.chat-container > div > div:last-child .markdown-body details.sc[open] {
    position: fixed !important;
    right: 20px !important; 
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 9999 !important;
    width: 340px !important; 
    height: 80vh !important;
    background: #ffffff !important;
    border: 2.5px solid #ff4d94 !important;
    border-radius: 16px !important;
    box-shadow: -6px 6px 0px rgba(255, 77, 148, 0.15) !important;
    overflow-y: auto !important;
    padding: 10px 12px 20px 12px !important; 
    margin: 0 !important;
}

/* 抽屉吸顶粉色标题栏 */
.chat-container > div > div:last-child .markdown-body details.sc[open] > summary.ss {
    all: initial !important;
    display: block !important;
    padding: 10px 14px !important;
    background: #fff0f5 !important;
    border-bottom: 2px dashed #ff4d94 !important;
    font-family: "Microsoft YaHei", sans-serif !important;
    font-weight: 900 !important;
    font-size: 14px !important;
    color: #ff4d94 !important;
    cursor: pointer !important;
    position: sticky !important;
    top: -10px !important;
    margin: -10px -12px 10px -12px !important;
    z-index: 10 !important;
}
.chat-container > div > div:last-child .markdown-body details.sc[open] > summary.ss::after {
    content: '【点击此处关闭】' !important;
    float: right !important;
    font-size: 11px !important;
    font-weight: bold !important;
    color: #ff2a85 !important;
}

/* =========================================================================
 * 📌 【第四部分：内部极简自定义标签渲染】
 * =========================================================================
 */

/* 统一内部卡片基础形态 (属性垂直长条流压缩美化) */
u r, n r, bx, st, b, ca {
    display: flex !important;
    flex-direction: column !important; 
    align-items: flex-start !important;
    justify-content: flex-start !important;
    background: #fffdfd !important;
    border: 1.5px solid #ff4d94 !important;
    border-radius: 10px !important;
    padding: 6px 10px !important; 
    margin: 8px 0 !important; 
    box-shadow: 2px 2px 0px rgba(255, 77, 148, 0.1) !important;
    width: 100% !important;
    font-family: "Microsoft YaHei", sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #3d242c !important; 
    word-break: break-all !important;
}

/* 统一小标题注入（去除了下划线，保持极简直白） */
u r::before, n r::before, bx::before, st::before, b::before {
    display: block !important;
    width: 100% !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    color: #ff4d94 !important;
    margin-bottom: 2px !important; /* 压缩空间，取消底部边框 */
}

/* 玩家属性标签自动生成 */
u r:nth-of-type(1)::before { content: "【姓名】" !important; }
u r:nth-of-type(2)::before { content: "【性别】" !important; }
u r:nth-of-type(3)::before { content: "【年龄】" !important; }
u r:nth-of-type(4)::before { content: "【性格】" !important; }
u r:nth-of-type(5)::before { content: "【外貌】" !important; }
u r:nth-of-type(6)::before { content: "【肉棒】" !important; }
u r:nth-of-type(7)::before { content: "【其他设定】" !important; }
u bx::before { content: "【羁绊记录】" !important; }


/* =========================================================================
 * 📌 【角色界面化系统：正常向下拉伸展开】
 * =========================================================================
 */
/* 闭合时的角色外框 */
.cn {
    position: relative !important; /* 相对定位，为了让圆球准确附着在右上角 */
    border: 1.5px dashed #ff4d94 !important;
    border-radius: 12px !important;
    padding: 12px 10px !important;
    margin: 12px 0 !important;
    background: #fffafb !important;
    transition: all 0.3s ease !important;
}

/* 角色属性卡片展开态 (正常向下展开效果) */
.cn[open] {
    background: #ffffff !important;
    border: 1.5px solid #ff4d94 !important; /* 展开时变成实线 */
    box-shadow: 2px 2px 0px rgba(255, 77, 148, 0.1) !important; /* 增加轻微立体感 */
}

/* 角色名字标题栏 */
.ct {
    font-weight: 900 !important;
    color: #ff4d94 !important;
    font-size: 14px !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
    cursor: pointer !important;
}

/* 展开后的标题栏增加下方分割线 */
.cn[open] > .ct {
    margin-bottom: 10px !important;
    border-bottom: 1px dashed rgba(255, 77, 148, 0.3) !important;
    padding-bottom: 8px !important;
}

/* 角色破格悬浮好感度小圆球 */
ht {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: #fff0f5 !important;
    border: 2px solid #ff4d94 !important;
    color: #ff4d94 !important;
    font-weight: 900 !important;
    font-size: 14px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 2px 2px 0px rgba(255, 77, 148, 0.2) !important;
    z-index: 10 !important; 
}

/* 角色内部属性标签自动生成 */
n r:nth-of-type(1)::before { content: "【姓名】" !important; }
n r:nth-of-type(2)::before { content: "【年龄】" !important; }
n r:nth-of-type(3)::before { content: "【好感度】" !important; }
n r:nth-of-type(4)::before { content: "【性别】" !important; }
n r:nth-of-type(5)::before { content: "【病娇类型】" !important; }
n r:nth-of-type(6)::before { content: "【着装】" !important; }

bx[type="vis"]::before { content: "【外貌】" !important; }
bx[type="sl"]::before { content: "【内心独白】" !important; color: #ff2a85 !important; }

st[type="m"]::before { content: "【嘴唇】" !important; }
st[type="c"]::before { content: "【乳房】" !important; }
st[type="s"]::before { content: "【小穴】" !important; }

b::before { content: "【幕后交流】" !important; color: #e68a00 !important; }
b { border-color: #ffd700 !important; box-shadow: 2px 2px 0px rgba(255, 215, 0, 0.2) !important; }

/* 胶囊特性标签 */
ts { 
    display: flex !important; 
    flex-wrap: wrap !important; 
    gap: 8px !important; 
    margin: 8px 0 !important; 
    width: 100% !important; 
}
t {
    background: #fff0f5 !important;
    border: 1.5px solid #ff4d94 !important;
    color: #ff4d94 !important;
    border-radius: 20px !important;
    padding: 4px 12px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    box-shadow: 1px 1px 0px rgba(255, 77, 148, 0.1) !important;
}

/* =========================================================================
 * 📌 【第五部分：记忆区系统深度贴合】
 * =========================================================================
 */
cb {
    font-weight: 900 !important;
    color: #ff4d94 !important;
    font-size: 13px !important;
    border-bottom: 1px dashed rgba(255, 77, 148, 0.3) !important;
    padding-bottom: 4px !important;
    margin-bottom: 6px !important;
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
}
cc { 
    font-size: 13px !important; 
    color: #3d242c !important; 
    line-height: 1.5 !important;
    width: 100% !important;
}
qz { color: #ff2a85 !important; font-weight: bold !important; font-size: 12px !important; }

/* =========================================================================
 * 📌 【第六部分：平台特定 UI 覆写 (加载动画与输入框)】
 * =========================================================================
 */
/* 稳定加载状态 */
.flex.items-center.justify-center.w-6.h-5 {
    width: auto !important; 
    height: auto !important; 
    padding: 6px 18px !important; 
    background: #ffffff !important; 
    border: 2.5px solid #ff4d94 !important; 
    border-radius: 30px !important; 
    box-shadow: 3px 3px 0px rgba(255, 77, 148, 0.2) !important; 
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    margin: 10px auto !important; 
    animation: m-pulse 0.8s infinite alternate !important;
}
.flex.items-center.justify-center.w-6.h-5 > div, 
[class*="style_dot-flashing"] { 
    display: none !important; 
}
.flex.items-center.justify-center.w-6.h-5::after {
    content: "我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️我爱你！❤️" !important; 
    font-size: 12px !important; 
    font-weight: 900 !important; 
    color: #ff4d94 !important; 
    white-space: nowrap !important;
}

/* 聊天输入框美化 */
#ai-chat-input {
    background-color: #ffffff !important; 
    border: 2.5px solid #ff4d94 !important; 
    border-radius: 30px !important; 
    color: #ff2a85 !important; 
    box-shadow: inset 2px 2px 0px rgba(255, 77, 148, 0.1) !important;
}
#ai-chat-input:focus-within { 
    box-shadow: 3px 3px 0px #ff4d94, inset 2px 2px 0px rgba(255, 77, 148, 0.1) !important; 
}
#ai-chat-bottom-input { 
    background: transparent !important; 
    backdrop-filter: none !important; 
}

/* 呼吸动画关键帧 */
@keyframes m-pulse { 
    0% { transform: scale(0.98); } 
    100% { transform: scale(1.02); } 
}
