/* =========================================
   互动式 AI 小说 - 护眼舒适版 (极致空间压缩 & 防崩溃版)
========================================= */

/* 1. 核心容器：大幅减少四周留白，贴近手机边缘 */
article.ai-rpg-ui {
    background-color: #262423 !important;
    color: #d4c5b7;
    padding: 12px 8px; /* 【大幅缩小】将左右边距从 20px 降至 8px */
    border-radius: 8px;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    box-sizing: border-box;
}

article.ai-rpg-ui h3 {
    color: #8fa08e; 
    border-bottom: 1px dashed #5c635b;
    padding-bottom: 6px;
    margin-top: 16px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

/* 2. 时空座标等 div 区块：取消框线套娃，改用极简左侧线 */
article.ai-rpg-ui > div {
    background-color: rgba(44, 41, 40, 0.5) !important; /* 半透明底色，减少厚重感 */
    border: none !important; 
    border-left: 3px solid #5c635b !important; /* 仅保留左侧引导线 */
    border-radius: 0 4px 4px 0;
    padding: 6px 8px; /* 极小化内边距 */
    margin-bottom: 12px;
}

/* 3. 📖 文本区：保持实体书阅读感，但取消多余 padding */
article.ai-rpg-ui p {
    font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "PMingLiU", serif !important;
    font-size: 1.05em !important;
    line-height: 1.8 !important;
    color: #e6d8cb !important;
    padding: 4px 2px;
    margin: 8px 0;
    text-indent: 2em;
    text-align: justify;
}

/* 4. 折叠面板 (Details)：压缩嵌套间距 */
article.ai-rpg-ui details {
    background-color: #2a2726;
    border: 1px solid #3c3836;
    border-radius: 6px;
    padding: 8px; /* 【缩小留白】从 14px 降至 8px */
    margin-bottom: 10px;
}

/* 嵌套的第二层 details：直接融入背景，不再额外增加内边距 */
article.ai-rpg-ui details details {
    background-color: transparent;
    border: none;
    border-top: 1px dashed #3c3836;
    border-radius: 0;
    margin-top: 8px;
    padding: 8px 2px 0 2px; /* 左右几乎 0 留白 */
}

article.ai-rpg-ui summary {
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    color: #b5a89d;
    padding: 4px 0;
    outline: none;
}

/* 5. Markdown 状态面板 (Pre & Code)：释放横向空间 */
article.ai-rpg-ui pre {
    background-color: #1e1c1b !important;
    border: 1px solid #332f2d;
    border-radius: 6px;
    padding: 10px 8px; /* 【缩小留白】释放代码块的横向空间 */
    margin: 6px 0;
    overflow-x: auto;
}

article.ai-rpg-ui pre code {
    background-color: transparent;
    color: #a39c96;
    padding: 0;
    font-size: 0.9em;
    white-space: pre-wrap; /* 允许代码块内过长文字自动换行，防止撑破屏幕 */
}

/* 6. 行内数据标签与列表 */
article.ai-rpg-ui code {
    background-color: #383432;
    color: #d1b498; 
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
    padding: 2px 4px;
    border-radius: 3px;
}

article.ai-rpg-ui ul {
    list-style-type: none;
    padding-left: 4px;
    margin: 6px 0;
}

article.ai-rpg-ui li {
    margin-bottom: 6px;
    padding: 4px 6px;
    border-left: 3px solid #6b736a;
    font-size: 0.95em;
}

article.ai-rpg-ui hr {
    border: 0;
    height: 1px;
    background-color: #4b4442;
    margin: 16px 0;
}
