/* 
 * ---------------------------------
 *   模块一：对话气泡美化 (AI侧) - 古风雅韵
 * ---------------------------------
 */
.group .bg-gray-100\/90 {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFEFD6 100%) !important;
    border: 1.5px solid #E8D5B5 !important;
    border-radius: 12px 12px 12px 4px !important;
    box-shadow: 4px 4px 12px rgba(232, 213, 181, 0.3),
                2px 2px 6px rgba(232, 213, 181, 0.2) !important;
    color: #8B7355 !important;
    padding: 16px 20px !important;
    position: relative !important;
    font-family: "宋体", "SimSun", serif !important;
}

/* 对话气泡的古风装饰效果 */
.group .bg-gray-100\/90::before {
    content: "" !important;
    position: absolute !important;
    top: -2px !important;
    left: -2px !important;
    right: -2px !important;
    bottom: -2px !important;
    border: 1px solid rgba(255, 223, 186, 0.6) !important;
    border-radius: 14px !important;
    pointer-events: none !important;
}

/* 
 * ---------------------------------
 *   模块二：平台按钮美化 - 古风按钮
 * ---------------------------------
 */
/* "mod、流式、评论、回到底部" 等按钮 */
.flex.items-center.gap-2.pb-2 > button {
    background: linear-gradient(to bottom, #FFF0D9 0%, #FFE4B5 100%) !important;
    color: #B8860B !important;
    border: 1.5px solid #E8C39E !important;
    border-radius: 20px !important;
    box-shadow: 2px 2px 8px rgba(184, 134, 11, 0.15) !important;
    font-weight: 500 !important;
    text-transform: none !important;
    transition: all 0.3s ease-in-out !important;
    padding: 8px 20px !important;
    font-family: "楷体", "KaiTi", serif !important;
    position: relative !important;
    overflow: hidden !important;
}

/* 按钮悬停效果 - 古风雅致 */
.flex.items-center.gap-2.pb-2 > button:hover {
    background: linear-gradient(to bottom, #FFE8C8 0%, #FFD89C 100%) !important;
    color: #8B6508 !important;
    transform: translateY(-2px) !important;
    box-shadow: 3px 4px 12px rgba(184, 134, 11, 0.25) !important;
    border-color: #D4A76A !important;
}

/* 按钮点击效果 */
.flex.items-center.gap-2.pb-2 > button:active {
    transform: translateY(0) !important;
    box-shadow: 1px 1px 4px rgba(184, 134, 11, 0.2) !important;
}

/* 
 * ---------------------------------
 *   模块三：多余元素隐藏 (保持不变)
 * ---------------------------------
 */
.MuiButtonBase-root.MuiButton-root.MuiButton-default.css-w13mdt,
.absolute.z-40 .px-4.py-2.hover\:bg-indigo-100:nth-child(5),
.css-nkqe49 {
    /* display: none !important; */ /* 此处保持注释状态，不隐藏 */
}

/* 
 * ---------------------------------
 *   模块四：输入栏美化 - 古风书卷
 * ---------------------------------
 */
#ai-chat-input {
    background: linear-gradient(to bottom, #FFFDF6 0%, #FFF8E8 100%) !important;
    border: 1.5px solid #E8D5B5 !important;
    border-radius: 20px !important;
    color: #8B7355 !important;
    box-shadow: inset 1px 1px 4px rgba(232, 213, 181, 0.3),
                2px 2px 8px rgba(232, 213, 181, 0.2) !important;
    padding: 12px 20px !important;
    font-family: "楷体", "KaiTi", serif !important;
    transition: all 0.3s ease !important;
}

/* 输入框聚焦效果 */
#ai-chat-input:focus {
    outline: none !important;
    border-color: #D4A76A !important;
    box-shadow: inset 1px 1px 6px rgba(212, 167, 106, 0.2),
                0 0 0 2px rgba(212, 167, 106, 0.1) !important;
}

/* 输入框容器透明化，突出输入框本身 */
#ai-chat-bottom-input { 
    background: transparent !important; 
    backdrop-filter: none !important; 
    padding: 10px 0 !important;
}

/* 新增：古风装饰元素 */
#ai-chat-bottom-input::before {
    content: "✒️" !important;
    position: absolute !important;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 18px !important;
    opacity: 0.6 !important;
    z-index: 1 !important;
}

/* 调整输入框内边距，为装饰元素留出空间 */
#ai-chat-input {
    padding-left: 45px !important;
}

/* 
 * ---------------------------------
 *   新增模块：整体背景古风优化
 * ---------------------------------
 */
/* 为整个聊天区域添加古风背景 */
.main-content {
    background: linear-gradient(135deg, #FFFBF0 0%, #FFF5E1 100%) !important;
}

/* 滚动条古风美化 */
::-webkit-scrollbar {
    width: 6px !important;
}

::-webkit-scrollbar-track {
    background: rgba(255, 244, 224, 0.5) !important;
    border-radius: 3px !important;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #E8C39E 0%, #D4A76A 100%) !important;
    border-radius: 3px !important;
}

/* 
 * ---------------------------------
 *   古风折叠状态栏美化
 * ---------------------------------
 */

/* 折叠状态栏整体样式 */
details {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFEFD6 100%) !important;
    border: 1.5px solid #E8D5B5 !important;
    border-radius: 16px !important;
    box-shadow: 4px 4px 12px rgba(232, 213, 181, 0.3),
                2px 2px 6px rgba(232, 213, 181, 0.2) !important;
    margin: 16px 0 !important;
    padding: 0 !important;
    font-family: "楷体", "KaiTi", "宋体", "SimSun", serif !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s ease-in-out !important;
}

/* 状态栏悬停效果 */
details:hover {
    box-shadow: 6px 6px 16px rgba(232, 213, 181, 0.4),
                3px 3px 8px rgba(232, 213, 181, 0.3) !important;
    transform: translateY(-2px) !important;
}

/* 摘要标题样式 */
details summary {
    background: linear-gradient(to bottom, #FFF0D9 0%, #FFE4B5 100%) !important;
    color: #8B4513 !important;
    font-size: 1.2em !important;
    font-weight: bold !important;
    padding: 16px 20px !important;
    cursor: pointer !important;
    list-style: none !important;
    border-bottom: 1px solid transparent !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

/* 移除默认箭头并添加自定义古风图标 */
details summary::-webkit-details-marker {
    display: none !important;
}

details summary::after {
    content: "📜" !important;
    position: absolute !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 1.1em !important;
    transition: transform 0.3s ease !important;
}

/* 展开时的图标旋转 */
details[open] summary::after {
    transform: translateY(-50%) rotate(90deg) !important;
}

/* 摘要悬停效果 */
details summary:hover {
    background: linear-gradient(to bottom, #FFE8C8 0%, #FFD89C 100%) !important;
    color: #654321 !important;
}

/* 内容区域样式 */
details > div {
    padding: 20px !important;
    color: #5D4037 !important;
    font-size: 1.1em !important;
    line-height: 1.6 !important;
    background: rgba(255, 253, 246, 0.8) !important;
    border-top: 1px solid #E8D5B5 !important;
}

/* --- 核心容器：宣纸白底 --- */
.paper-ui-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff; /* 纯白背景 */
    background-image: linear-gradient(to bottom, #ffffff, #fdfbf0); /* 极淡的纸张渐变 */
    color: #2c3e50; /* 深墨色文字 */
    font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
    line-height: 1.6;
    border: 1px solid #e6dcb1; /* 淡金边框 */
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.15); /* 金色微光阴影 */
    position: relative;
    overflow: hidden;
}

/* 顶部装饰：金边 */
.paper-ui-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, #fff, #f0e68c, #ffd700, #fff); /* 金色流光 */
}

/* --- 头部 --- */
.paper-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 15px;
}
.paper-title {
    font-size: 1.4em;
    color: #b8860b; /* 暗金色标题 */
    font-weight: bold;
    letter-spacing: 2px;
}
.paper-date {
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}

/* --- 折叠栏 (Details/Summary) --- */
.paper-details {
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.paper-summary {
    padding: 10px 15px;
    background: #fffde7; /* 极浅的黄色背景 */
    cursor: pointer;
    font-weight: bold;
    color: #5d4037; /* 棕色文字 */
    list-style: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent;
}
.paper-summary:hover {
    background: #fff9c4; /* 悬停加深黄色 */
    color: #b8860b;
}
.paper-summary::-webkit-details-marker {
    display: none;
}
.paper-summary::after {
    content: "▼";
    margin-left: auto;
    font-size: 0.8em;
    color: #d4af37;
    transition: transform 0.2s;
}
.paper-details[open] .paper-summary {
    border-bottom-color: #f0f0f0;
}
.paper-details[open] .paper-summary::after {
    transform: rotate(180deg);
}
.paper-panel-content {
    padding: 15px;
    background: #ffffff;
    font-size: 0.9em;
}

/* --- 正文区域 --- */
.paper-story-body {
    margin: 25px 0;
    padding: 15px;
    background: #fffefb; /* 极淡的米色块 */
    border-left: 3px solid #f0e68c; /* 黄色竖条装饰 */
    font-size: 1.05em;
    color: #333;
    text-align: justify;
}
.paper-story-body p {
    margin-bottom: 1.2em;
    text-indent: 2em;
}
.paper-story-body .dialogue {
    color: #00796b; /* 竹青色对话，古风感 */
    font-weight: 500;
}

/* --- 信息网格 --- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.info-item {
    background: #fdfbf0; /* 米黄色背景 */
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #f3e5ab;
}
.info-item.full-width {
    grid-column: span 2;
    border-left: 3px solid #b8860b;
}
.info-item .label {
    display: block;
    font-size: 0.75em;
    color: #8d6e63; /* 浅棕色标签 */
    margin-bottom: 2px;
}
.info-item .value {
    color: #3e2723;
}

/* --- 角色卡片 --- */
.char-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.npc-card {
    border-top: 3px solid #d32f2f; /* 丹红 */
}
.user-card {
    border-top: 3px solid #81c784; /* 柳绿 */
}
.char-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 5px;
}
.char-name { font-weight: bold; color: #333; }
.char-mood { font-size: 0.85em; color: #999; }

.desc-text {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* 进度条 */
.stat-group { margin-bottom: 8px; }
.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    margin-bottom: 3px;
    color: #666;
}
.progress-bar {
    height: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}
.progress-fill { height: 100%; transition: width 0.5s ease; }
.red-fill { background: linear-gradient(90deg, #e57373, #ef5350); } /* 柔和红 */
.dark-fill { background: linear-gradient(90deg, #90a4ae, #546e7a); } /* 蓝灰 */

.guide-box {
    margin-top: 10px;
    background: #fffde7;
    border: 1px dashed #fbc02d;
    padding: 8px;
    font-size: 0.85em;
    color: #f57f17;
    border-radius: 4px;
}

/* --- 记忆回溯 (Scroll Box) --- */
.paper-scroll-box {
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
}
.paper-scroll-box::-webkit-scrollbar { width: 6px; }
.paper-scroll-box::-webkit-scrollbar-track { background: #f0f0f0; }
.paper-scroll-box::-webkit-scrollbar-thumb { background: #dce775; border-radius: 3px; }

.log-entry {
    font-size: 0.85em;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    color: #555;
}
.log-entry.new { color: #333; background: #fffde7; padding-left: 5px; }
.log-time { color: #b8860b; margin-right: 5px; font-weight: bold; }

/* --- 选项按钮 --- */
.paper-options {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}
.option-btn {
    background: #ffffff;
    border: 1px solid #f0e68c; /* 浅黄边框 */
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: #5d4037;
    font-weight: 500;
}
.option-btn:hover {
    background: #fff9c4; /* 悬停变黄 */
    border-color: #fbc02d;
    transform: translateX(5px);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
}

/* --- 背包与成就 --- */
.inventory-grid, .achievement-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.item-tag {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 4px 10px;
    font-size: 0.8em;
    color: #555;
    border-radius: 12px; /* 圆角标签 */
}
.item-tag.rare {
    background: #fffde7;
    border-color: #ffd700;
    color: #f57f17;
}
.ach-item {
    width: 100%;
    padding: 5px;
    border-bottom: 1px dashed #eee;
    font-size: 0.9em;
    color: #444;
}
.ach-item.gold { color: #f57f17; font-weight: bold; }
.ach-desc { font-size: 0.8em; color: #999; margin-left: 5px; font-weight: normal; }

/* --- 移动端适配 --- */
@media (max-width: 600px) {
    .info-grid { grid-template-columns: 1fr; }
    .info-item.full-width { grid-column: span 1; }
    .paper-story-body { font-size: 1em; padding: 10px; }
}