/* ==========================================================
   【终极双轨状态栏 UI 美化包 · 全局修复高清晰版】
   核心：保留高奢感，收紧空间，绝佳对比度，完美融合居中补丁
========================================================== */

/* 1. 顶级大模块卡片 (浅色底) */
details.ui-panel {
    background: rgba(250, 248, 255, 0.95);
    border: 1px solid rgba(177, 78, 255, 0.25);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 5px 14px rgba(110, 60, 200, 0.07), inset 0 1px 0 rgba(255,255,255,0.7);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

details.ui-panel:hover {
    box-shadow: 0 8px 20px rgba(110, 60, 200, 0.12);
    transform: translateY(-1px);
}

/* 顶级标题 (默认状态：无横线) */
details.ui-panel > summary {
    font-weight: 800;
    color: #5e28a8;
    font-size: 1.0rem;
    margin-bottom: 0; 
    padding-bottom: 0;
    border-bottom: 1px solid transparent; 
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    user-select: none;
    transition: all 0.3s ease;
}
details.ui-panel > summary::-webkit-details-marker {
    display: none;
}

/* 顶级标题 (展开状态：出现横线并撑开间距) */
details.ui-panel[open] > summary {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(177, 78, 255, 0.15); 
}

/* 2. 剧情正文框 */
.story-text {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 240, 255, 0.85));
    border-left: 4px solid #b14eff;
    border-radius: 8px 12px 12px 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #2a1b3d;
    font-size: 0.9rem;
    line-height: 1.75;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.story-text p {
    text-indent: 2em;
    margin-bottom: 10px;
}
.story-text p:last-child {
    margin-bottom: 0;
}

/* 3. 二级内部折叠模块 (浅色底) */
details.inner-panel {
    background: rgba(240, 235, 248, 0.7);
    border: 1px solid rgba(200, 180, 240, 0.5);
    border-left: 3px solid #d1116b;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0 8px 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

details.inner-panel > summary {
    font-weight: 700;
    color: #a40d54;
    font-size: 0.9rem;
    cursor: pointer;
    margin: 0;
    padding: 2px 0;
    list-style: none;
}
details.inner-panel > summary::-webkit-details-marker {
    display: none;
}

/* 4. 子标题标签 */
.sub-title {
    background: linear-gradient(135deg, #7b2cbf, #9d4edd);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 16px;
    margin-top: 8px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(123, 44, 191, 0.25);
}

/* 5. 统一精简段落间距 */
details.ui-panel p, details.inner-panel p {
    margin-bottom: 5px;
    line-height: 1.55;
    font-size: 0.9rem;
}
details.ui-panel p:last-child, details.inner-panel p:last-child {
    margin-bottom: 0;
}

/* 6. 自定义折叠指示器 */
summary::before {
    content: '▶';
    display: inline-block;
    font-size: 0.7rem;
    width: 16px;
    margin-right: 4px;
    color: #7b2cbf;
    transition: transform 0.2s ease-in-out;
}
details[open] > summary::before {
    transform: rotate(90deg);
}
details.inner-panel > summary::before {
    color: #d1116b;
}

/* ==========================================================
   【新增特化】情报面板居中排版 (配合 HTML 的 center-panel)
========================================================== */
details.center-panel p {
    text-align: center !important;
}
details.center-panel > summary {
    justify-content: center !important; 
    padding-left: 0 !important; 
}
details.center-panel > summary::before {
    margin-right: 6px;
}

/* ==========================================================
   【视觉色彩调度中枢】精准控制所有面板的字色对比度 (告别眼瞎)
========================================================== */

/* A. 浅色底大面板 (玩家/猎物面板) -> 强制使用高对比度深色 */
details.ui-panel {
    color: #1e1233 !important; /* 极深紫黑正文，绝对清晰 */
}
details.ui-panel b, details.ui-panel strong {
    color: #4a1c8c !important; /* 核心修复：极度浓郁的深紫色，取代之前发虚的浅紫 */
    font-weight: 800;
}

/* B. 浅色底内部面板 (身体状态) -> 极致深黑压制，突出 R18 细节 */
details.inner-panel, 
details.inner-panel p, 
details.inner-panel > summary {
    color: #1a1520 !important; /* 极暗夜灰黑，抹除一切反光 */
}
details.inner-panel b, details.inner-panel strong {
    color: #351c54 !important; /* 极深暗紫黑标签，压迫感十足 */
    font-weight: 900 !important;
}
details.inner-panel > summary::before {
    color: #351c54 !important; 
}

/* C. 深色底面板 (思维链专属特权) -> 隔离保护，浅色字护眼 */
details.ui-panel:nth-of-type(1) {
    background: rgba(30, 20, 45, 0.85) !important;
    color: #d6cddf !important; 
    border: 1px solid #48356b !important;
}
details.ui-panel:nth-of-type(1) > summary {
    color: #dcbaff !important;
    border-bottom-color: #48356b !important;
}
details.ui-panel:nth-of-type(1) p {
    color: #d6cddf !important;
}