/* ═══════════════════════════════════════════
   🌸 复古奶油色 · 樱花点缀主题
   ═══════════════════════════════════════════ */

/* --- 隐藏默认顶部颜色条 --- */
[class*="bg-[#F1CBCB]"],
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* ─── 统一聊天框主体 ─── */
.bg-gray-100\/90.relative.inline-block {
    background:
        radial-gradient(circle, rgba(180,140,100,0.08) 1px, transparent 1px) !important;
    background-size: 12px 12px !important;
    background-color: #FDF6EC !important;
    border: 2.5px dashed #D4B896 !important;
    border-radius: 16px !important;
    box-shadow:
        0 2px 12px rgba(180,140,100,0.13),
        inset 0 1px 4px rgba(255,250,240,0.7) !important;
    position: relative !important;
    isolation: isolate !important;
    overflow: visible !important;
    padding: 18px 20px 14px 20px !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.bg-gray-100\/90.relative.inline-block:hover {
    box-shadow:
        0 4px 20px rgba(180,140,100,0.2),
        inset 0 1px 4px rgba(255,250,240,0.7) !important;
    border-color: #C9A67A !important;
}

/* ─── 樱花角落点缀（左上 + 右下） ─── */
.bg-gray-100\/90.relative.inline-block::before {
    content: '🌸' !important;
    position: absolute !important;
    top: -8px !important;
    left: -6px !important;
    font-size: 20px !important;
    opacity: 0.75 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 1px 2px rgba(200,150,150,0.3)) !important;
    transform: rotate(-15deg) !important;
}

.bg-gray-100\/90.relative.inline-block::after {
    content: '🌸' !important;
    position: absolute !important;
    bottom: -6px !important;
    right: -4px !important;
    font-size: 16px !important;
    opacity: 0.55 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 1px 2px rgba(200,150,150,0.25)) !important;
    transform: rotate(20deg) !important;
}

/* ─── 文本内容样式 ─── */
.markdown-body {
    color: #5C4A3A !important;
    font-family: 'Georgia', 'Noto Serif SC', 'Source Han Serif SC', serif !important;
    font-size: 15px !important;
    line-height: 1.8 !important;
    z-index: 1 !important;
    position: relative !important;
    background: transparent !important;
    letter-spacing: 0.3px !important;
}

.markdown-body strong,
.markdown-body b {
    font-weight: bold !important;
    color: #8B5E3C !important;
}

.markdown-body em,
.markdown-body i {
    color: #B07A5B !important;
    font-style: italic !important;
}

.markdown-body a {
    color: #C97B63 !important;
    text-decoration: underline dashed #D4B896 !important;
    text-underline-offset: 3px !important;
}

.markdown-body code {
    background: rgba(212,184,150,0.2) !important;
    color: #7A5A3E !important;
    border-radius: 4px !important;
    padding: 1px 5px !important;
    font-size: 0.9em !important;
    border: 1px solid rgba(212,184,150,0.35) !important;
}

.markdown-body pre {
    background: #FBF3E4 !important;
    border: 1.5px dashed #D4B896 !important;
    border-radius: 10px !important;
    padding: 14px !important;
}

.markdown-body pre code {
    background: transparent !important;
    border: none !important;
    color: #6B4E37 !important;
}

.markdown-body blockquote {
    border-left: 3px solid #D4B896 !important;
    background: rgba(253,246,236,0.6) !important;
    padding: 8px 14px !important;
    border-radius: 0 8px 8px 0 !important;
    color: #7A6552 !important;
    font-style: italic !important;
}

.markdown-body hr {
    border: none !important;
    border-top: 2px dashed #D4B896 !important;
    margin: 16px 0 !important;
}

/* ─── 底部附加元素 ─── */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary {
    color: #B09A7E !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    transition: color 0.25s ease, background 0.25s ease !important;
}

.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
    color: #8B6F52 !important;
    background: rgba(212,184,150,0.15) !important;
}

.MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    color: #C4A882 !important;
    font-family: 'Georgia', serif !important;
    font-size: 11px !important;
    font-style: italic !important;
}

.text-orange-500 {
    color: #C9976B !important;
    font-size: 11px !important;
}

/* ═══════════════════════════════════════════
   💌 Emoji 波浪弹跳加载动画
   ═══════════════════════════════════════════ */

/* 隐藏默认加载动画 */
.style-module__AtdJSq__dot-flashing.style-module__AtdJSq__text {
    display: none !important;
}

/* 加载容器 */
.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    width: 140px !important;
    min-width: 140px !important;
    height: 46px !important;
    min-height: 46px !important;
    overflow: visible !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
}

/* ── ::before — 💌 和 🧋 ── */
.flex.items-center.justify-center.w-6.h-5::before {
    content: '' !important;
    position: absolute !important;
    bottom: 4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 140px !important;
    height: 40px !important;
    z-index: 2 !important;
    /* 
       CSP-compatible: data:image/svg+xml inline SMIL animation
       💌 at x=10, 🧋 at x=42 — each bounces with 150ms stagger
    */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='40' viewBox='0 0 140 40'%3E%3Ctext x='10' y='32' font-size='22'%3E%F0%9F%92%8C%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-22;0,0' keyTimes='0;0.35;1' dur='0.85s' begin='0s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3Ctext x='42' y='32' font-size='22'%3E%F0%9F%A7%8B%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-22;0,0' keyTimes='0;0.35;1' dur='0.85s' begin='0.15s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center bottom !important;
    background-size: 140px 40px !important;
}

/* ── ::after — ✏️ 和 🌸 ── */
.flex.items-center.justify-center.w-6.h-5::after {
    content: '' !important;
    position: absolute !important;
    bottom: 4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 140px !important;
    height: 40px !important;
    z-index: 2 !important;
    /* 
       ✏️ at x=74, 🌸 at x=106 — continue the 150ms stagger chain
    */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='40' viewBox='0 0 140 40'%3E%3Ctext x='74' y='32' font-size='22'%3E%E2%9C%8F%EF%B8%8F%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-22;0,0' keyTimes='0;0.35;1' dur='0.85s' begin='0.3s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3Ctext x='106' y='32' font-size='22'%3E%F0%9F%8C%B8%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-22;0,0' keyTimes='0;0.35;1' dur='0.85s' begin='0.45s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center bottom !important;
    background-size: 140px 40px !important;
}

/* ─── 移动端适配 ─── */
@media (max-width: 480px) {
    .bg-gray-100\/90.relative.inline-block {
        padding: 14px 12px 10px 12px !important;
        border-radius: 12px !important;
    }

    .bg-gray-100\/90.relative.inline-block::before {
        font-size: 16px !important;
        top: -6px !important;
        left: -4px !important;
    }

    .bg-gray-100\/90.relative.inline-block::after {
        font-size: 13px !important;
        bottom: -4px !important;
        right: -2px !important;
    }

    .markdown-body {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }

    .flex.items-center.justify-center.w-6.h-5 {
        width: 120px !important;
        min-width: 120px !important;
        height: 42px !important;
    }

    .flex.items-center.justify-center.w-6.h-5::before {
        width: 120px !important;
        background-size: 120px 36px !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='36' viewBox='0 0 120 36'%3E%3Ctext x='5' y='28' font-size='18'%3E%F0%9F%92%8C%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-18;0,0' keyTimes='0;0.35;1' dur='0.85s' begin='0s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3Ctext x='33' y='28' font-size='18'%3E%F0%9F%A7%8B%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-18;0,0' keyTimes='0;0.35;1' dur='0.85s' begin='0.15s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3C/svg%3E") !important;
    }

    .flex.items-center.justify-center.w-6.h-5::after {
        width: 120px !important;
        background-size: 120px 36px !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='36' viewBox='0 0 120 36'%3E%3Ctext x='61' y='28' font-size='18'%3E%E2%9C%8F%EF%B8%8F%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-18;0,0' keyTimes='0;0.35;1' dur='0.85s' begin='0.3s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3Ctext x='89' y='28' font-size='18'%3E%F0%9F%8C%B8%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-18;0,0' keyTimes='0;0.35;1' dur='0.85s' begin='0.45s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3C/svg%3E") !important;
    }
}

/* ─── 低动效偏好 ─── */
@media (prefers-reduced-motion: reduce) {
    .flex.items-center.justify-center.w-6.h-5::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='40' viewBox='0 0 140 40'%3E%3Ctext x='10' y='32' font-size='22'%3E%F0%9F%92%8C%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-8;0,0' keyTimes='0;0.35;1' dur='2s' begin='0s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3Ctext x='42' y='32' font-size='22'%3E%F0%9F%A7%8B%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-8;0,0' keyTimes='0;0.35;1' dur='2s' begin='0.35s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3C/svg%3E") !important;
    }

    .flex.items-center.justify-center.w-6.h-5::after {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='40' viewBox='0 0 140 40'%3E%3Ctext x='74' y='32' font-size='22'%3E%E2%9C%8F%EF%B8%8F%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-8;0,0' keyTimes='0;0.35;1' dur='2s' begin='0.7s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3Ctext x='106' y='32' font-size='22'%3E%F0%9F%8C%B8%3CanimateTransform attributeName='transform' type='translate' values='0,0;0,-8;0,0' keyTimes='0;0.35;1' dur='2s' begin='1.05s' repeatCount='indefinite' calcMode='spline' keySplines='0 0 0.58 1;0.42 0 1 1'/%3E%3C/text%3E%3C/svg%3E") !important;
    }
}