/* ========================================
   裴钰·梧桐里7号 · 复古剪报档案册风
   作者：兴趣使然的人
   ======================================== */

/* ===== 整体页面背景（精准版） =====
   只给聊天主区域加背景，不影响工具栏与按钮 */

/* 方案A：给最外层body所在容器加背景，但留出工具栏的"安全区" */
.MuiContainer-root {
    background-image: url('https://backup.fukit.cn/autoupload/fr/pqzzs3ZFrwepMM0XV0lrfwtma4eeycMErCXrvI_uALCyl5f0KlZfm6UsKj-HyTuv/20260624/WSFv/1080X1920/955c5107-28d5-4b76-bc90-851383d90725.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #c9a876;
}

/* 关键修复：给工具栏区域强制加一层半透明底色，
   这样按钮文字才有对比度，不会被背景图吞掉 */

/* 第一排工具栏所在的容器 */
.MuiButton-textPrimary {
    background: rgba(255, 250, 240, 0.75) !important;
    color: #8b6914 !important;
    border-radius: 6px !important;
    margin: 2px !important;
    backdrop-filter: blur(4px);
    transition: all 0.25s ease;
}

.MuiButton-textPrimary:hover {
    background: rgba(212, 169, 106, 0.35) !important;
    color: #5c4033 !important;
}

/* 第二排工具栏（Mod/记忆增强/调试等） */
.MuiButton-outlinedPrimary {
    background: rgba(255, 250, 240, 0.78) !important;
    border-color: #d4a96a !important;
    color: #8b6914 !important;
    backdrop-filter: blur(4px);
    transition: all 0.25s ease;
}

.MuiButton-outlinedPrimary:hover {
    background: rgba(212, 169, 106, 0.32) !important;
    border-color: #b8860b !important;
    color: #5c4033 !important;
}

/* 翻页区域同样处理 */
.MuiPaginationItem-root {
    background: rgba(255, 250, 240, 0.7) !important;
    color: #8b6914 !important;
    backdrop-filter: blur(3px);
    margin: 0 2px !important;
}

.MuiPaginationItem-root.Mui-selected {
    background: rgba(212, 169, 106, 0.5) !important;
    color: #5c4033 !important;
}

/* ===== 思维链隐藏 ===== */
think {
    display: none !important;
}

/* ===== AI回复主容器：撕纸档案卡 ===== */
scene {
    display: block;
    position: relative;
    background:
        linear-gradient(135deg, rgba(245, 232, 208, 0.96) 0%, rgba(232, 213, 176, 0.96) 100%);
    padding: 36px 24px 28px;
    margin: 18px 4px;
    color: #5c4033;
    font-family: "Noto Serif SC", "Songti SC", "STSong", "PingFang SC", serif;
    line-height: 1.85;
    font-size: 14.5px;
    border-radius: 3px;
    box-shadow:
        inset 0 0 80px rgba(184, 134, 11, 0.08),
        inset 0 0 0 1px rgba(184, 134, 11, 0.15),
        0 6px 24px rgba(92, 64, 51, 0.28),
        0 2px 6px rgba(92, 64, 51, 0.15);
}

/* 顶部撕纸锯齿 */
scene::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 10px;
    background:
        radial-gradient(circle at 6px 10px, transparent 5px, #f5e8d0 5.5px) 0 0/14px 10px;
    filter: drop-shadow(0 1px 1px rgba(92, 64, 51, 0.15));
}

/* 顶部装订针 */
scene::after {
    content: '✣';
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 14px;
    color: rgba(139, 105, 20, 0.55);
    transform: rotate(15deg);
}

/* ===== 正文区域：手稿纸 ===== */
text {
    display: block;
    margin: 14px 0 18px;
    padding: 18px 20px;
    background: rgba(255, 250, 240, 0.55);
    border-left: 3px double #b8860b;
    border-right: 1px dashed rgba(139, 105, 20, 0.35);
    border-radius: 2px;
    position: relative;
    box-shadow: inset 0 0 30px rgba(212, 169, 106, 0.08);
}

text::before {
    content: '"';
    position: absolute;
    top: -8px;
    left: 10px;
    font-size: 52px;
    color: rgba(184, 134, 11, 0.22);
    font-family: Georgia, "Noto Serif SC", serif;
    line-height: 1;
    pointer-events: none;
}

text::after {
    content: '❦';
    position: absolute;
    bottom: 6px;
    right: 12px;
    font-size: 14px;
    color: rgba(139, 105, 20, 0.4);
}

text p {
    margin: 0 0 12px 0;
    text-indent: 2em;
    text-align: justify;
    color: #4a3525;
    letter-spacing: 0.3px;
}

text p:last-child {
    margin-bottom: 0;
}

/* ===== 状态栏卡片：档案折页 ===== */
scene details {
    margin: 14px 0;
    background:
        linear-gradient(to bottom, rgba(255, 250, 240, 0.88), rgba(245, 232, 208, 0.88));
    border: 1px solid rgba(184, 134, 11, 0.4);
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
    box-shadow:
        0 2px 8px rgba(92, 64, 51, 0.15),
        inset 0 0 20px rgba(212, 169, 106, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

scene details:hover {
    border-color: #b8860b;
    box-shadow:
        0 4px 14px rgba(92, 64, 51, 0.28),
        inset 0 0 24px rgba(212, 169, 106, 0.18);
    transform: translateY(-1px);
}

scene details[open] {
    background:
        linear-gradient(to bottom, rgba(255, 252, 245, 0.92), rgba(245, 232, 208, 0.92));
}

/* 折页右上角小装饰 */
scene details::before {
    content: '※';
    position: absolute;
    top: 9px;
    right: 12px;
    color: rgba(139, 105, 20, 0.45);
    font-size: 12px;
    z-index: 1;
    pointer-events: none;
}

/* ===== summary 标题栏 ===== */
scene details summary {
    list-style: none;
    cursor: pointer;
    padding: 11px 16px 11px 34px;
    background:
        linear-gradient(135deg, rgba(212, 169, 106, 0.28) 0%, rgba(184, 134, 11, 0.15) 100%);
    color: #5c4033;
    font-weight: 700;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 14px;
    letter-spacing: 1.5px;
    border-bottom: 1px dashed rgba(139, 105, 20, 0.3);
    position: relative;
    transition: background 0.3s ease;
    user-select: none;
}

scene details summary::-webkit-details-marker {
    display: none;
}

scene details summary::before {
    content: '◆';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    color: #8b6914;
    font-size: 10px;
    transition: transform 0.35s ease, color 0.3s ease;
}

scene details[open] summary::before {
    transform: translateY(-50%) rotate(90deg);
    color: #b8860b;
}

scene details summary:hover {
    background:
        linear-gradient(135deg, rgba(212, 169, 106, 0.42) 0%, rgba(184, 134, 11, 0.25) 100%);
    color: #4a3525;
}

/* ===== details 内 p 标签样式 ===== */
scene details p {
    margin: 0;
    padding: 7px 18px;
    color: #4a3525;
    line-height: 1.75;
    font-size: 13.5px;
    border-bottom: 1px dotted rgba(184, 134, 11, 0.18);
}

scene details p:first-of-type {
    padding-top: 12px;
}

scene details p:last-of-type {
    padding-bottom: 12px;
    border-bottom: none;
}

scene details p strong {
    color: #8b6914;
    font-weight: 700;
    margin-right: 6px;
    letter-spacing: 0.5px;
}

/* details 内 markdown 内容（记忆区/行动推荐用） */
scene details ul,
scene details ol {
    padding: 10px 18px 12px 38px;
    margin: 0;
    color: #4a3525;
    line-height: 1.85;
    font-size: 13.5px;
}

scene details li {
    margin: 5px 0;
    padding-bottom: 4px;
    border-bottom: 1px dotted rgba(184, 134, 11, 0.12);
}

scene details li:last-child {
    border-bottom: none;
}

scene details strong {
    color: #8b6914;
    font-weight: 700;
}

scene details em {
    color: #6b4f37;
    font-style: italic;
}

/* ===== 时空信息（第一个details）特化：档案标签头 ===== */
scene details:first-of-type {
    background:
        linear-gradient(135deg, rgba(255, 248, 230, 0.94), rgba(245, 232, 208, 0.94));
    border: 1px double #b8860b;
}

scene details:first-of-type summary {
    background:
        linear-gradient(135deg, rgba(184, 134, 11, 0.32) 0%, rgba(139, 105, 20, 0.2) 100%);
    text-align: center;
    letter-spacing: 4px;
    padding-left: 16px;
}

scene details:first-of-type summary::before {
    display: none;
}

scene details:first-of-type p {
    text-align: center;
    font-style: italic;
    color: #6b4f37;
    border-bottom: 1px dotted rgba(184, 134, 11, 0.12);
    letter-spacing: 1px;
}

/* ===== 行动推荐（最后一个details）特化：便签纸 ===== */
scene details:last-of-type {
    background:
        linear-gradient(135deg, rgba(255, 248, 230, 0.92), rgba(245, 232, 208, 0.92));
    border-style: dashed;
    border-color: #d4a96a;
    border-width: 1.5px;
}

scene details:last-of-type summary {
    background:
        linear-gradient(135deg, rgba(212, 169, 106, 0.38) 0%, rgba(184, 134, 11, 0.22) 100%);
}

scene details:last-of-type li {
    list-style: none;
    position: relative;
    padding-left: 22px;
    transition: all 0.25s ease;
    cursor: pointer;
    border-bottom: 1px dotted rgba(184, 134, 11, 0.18);
}

scene details:last-of-type li::before {
    content: '✿';
    position: absolute;
    left: 0;
    top: 5px;
    color: #b8860b;
    font-size: 12px;
    transition: transform 0.3s ease;
}

scene details:last-of-type li:hover {
    color: #8b4513;
    transform: translateX(4px);
    background: rgba(212, 169, 106, 0.12);
    padding-left: 26px;
}

scene details:last-of-type li:hover::before {
    transform: rotate(72deg);
    color: #8b4513;
}

/* ===== 滚动条统一色调 ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(245, 232, 208, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #d4a96a, #b8860b);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #b8860b, #8b6914);
}