/* 隐藏浅蓝色条 */
div[class*="bg-[#c9e1e9]"][class*="top-0"][class*="h-0.5"] {
  display: none !important;
}

/* 隐藏浅粉色条 */
div[class*="bg-[#F1CBCB]"][class*="top-0"][class*="h-0.5"] {
  display: none !important;
}
/* 
 * ================================================================
 *  黑白漫画 · 魔法契约风格（顶部栏终极修复）
 *  强制元素不收缩，增大间距，彻底解决点击重叠问题
 *  全部文字强制黑色，适配手机/电脑
 * ================================================================
 */

/* ---------- 全局基调 ---------- */
body {
    background: #f5f4f0;
    font-family: 'Courier New', 'Hiragino Kaku Gothic Pro', 'Noto Sans JP', sans-serif;
    color: #1a1a1a !important;
}



/* ---------- 对话气泡美化（AI侧） ---------- */
.group .bg-gray-100\/90 {
    background: #f8f6f2 !important;
    border: 2px solid #1a1a1a !important;
    border-radius: 12px !important;
    box-shadow: 3px 3px 0px #1a1a1a !important;
    padding: 14px 18px !important;
    position: relative !important;
    transition: all 0.2s ease !important;
}
.group .bg-gray-100\/90::before {
    content: '✦';
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent !important;
    padding: 0 4px;
    line-height: 1;
}
.group .bg-gray-100\/90:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px #1a1a1a !important;
}

/* ---------- 平台按钮美化 ---------- */
.flex.items-center.gap-2.pb-2 > button {
    background: #f5f4f0 !important;
    border: 2px solid #1a1a1a !important;
    border-radius: 6px !important;
    box-shadow: 2px 2px 0px #1a1a1a !important;
    font-weight: 700 !important;
    text-transform: none !important;
    transition: all 0.1s ease-in-out !important;
    padding: 6px 18px !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    position: relative !important;
}
.flex.items-center.gap-2.pb-2 > button::before {
    content: '◆';
    margin-right: 6px;
    font-size: 10px;
    color: #1a1a1a;
    background: transparent !important;
}
.flex.items-center.gap-2.pb-2 > button:hover {
    background: #e8e6e0 !important;
    transform: translate(2px, 2px) !important;
    box-shadow: 0px 0px 0px #1a1a1a !important;
}
.flex.items-center.gap-2.pb-2 > button:active {
    background: #d4d2cc !important;
}

/* ---------- 输入栏美化 ---------- */
#ai-chat-input {
    background-color: #fafaf8 !important;
    border: 2px solid #1a1a1a !important;
    border-radius: 8px !important;
    box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.03) !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    transition: all 0.25s ease !important;
}
#ai-chat-input:focus {
    border-color: #1a1a1a !important;
    box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(26, 26, 26, 0.15) !important;
    outline: none !important;
}
#ai-chat-bottom-input {
    background: #f5f4f0 !important;
    backdrop-filter: none !important;
    border-top: 2px solid #1a1a1a !important;
    padding: 12px 16px !important;
}

/* ================================================================
 *  顶部栏（终极修复：元素不收缩 + 间距增大）
 * ================================================================ */
.sticky.w-full.top-0.flex.items-center {
    background: #f5f4f0 !important;
    border-bottom: 3px double #1a1a1a !important;
    padding: 10px 14px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1) !important;
    /* 允许换行，但元素不会收缩 */
    flex-wrap: wrap !important;
    /* 增大间距，彻底隔离 */
    gap: 10px 16px !important;
    /* 垂直居中 */
    align-items: center !important;
}

/* 所有顶部栏的子元素：强制不收缩，保持独立尺寸 */
.sticky.w-full.top-0.flex.items-center > * {
    flex: 0 0 auto !important; /* 绝不收缩，绝不放大 */
    min-width: 0 !important;
}

/* 顶部栏内的模型选择器 - 固定宽度，与其他按钮完全分离 */
#ai-model-selector .group.flex.items-center {
    background: rgba(26, 26, 26, 0.06) !important;
    border: 1px solid #1a1a1a !important;
    border-radius: 8px !important;
    padding: 4px 14px !important;
    transition: all 0.25s ease !important;
    flex: 0 0 auto !important; /* 强制固定尺寸 */
    width: auto !important;
    min-width: 80px !important;
    max-width: 140px !important;
}
#ai-model-selector .group.flex.items-center:hover {
    background: rgba(26, 26, 26, 0.12) !important;
    border-color: #1a1a1a !important;
}
#ai-model-selector .truncate.text-\[13px\] {
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* 如果顶部栏空间不足，元素会自动换行到下一行，绝不会重叠 */
@media (max-width: 600px) {
    .sticky.w-full.top-0.flex.items-center {
        padding: 8px 10px !important;
        gap: 8px 12px !important;
    }
    #ai-model-selector .group.flex.items-center {
        min-width: 70px !important;
        max-width: 100px !important;
        padding: 3px 10px !important;
        font-size: 12px !important;
    }
}
/* ================================================================ */



/* ---------- 底部栏（浅色） ---------- */
.bg-gradient-to-t {
    background: #f5f4f0 !important;
    border-top: 3px double #1a1a1a !important;
    padding: 12px 0 !important;
}
#ai-chat-input {
    background-color: #fafaf8 !important;
    border: 2px solid #1a1a1a !important;
    box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.06) !important;
}
#ai-chat-input:focus {
    border-color: #1a1a1a !important;
    box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(26, 26, 26, 0.15) !important;
}
#ai-chat-input::placeholder {
    color: #555 !important;
}

/* ---------- 额外：全局细节 ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #e8e6e0;
}
::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #444;
}


/* ---------- 响应式适配 ---------- */
@media (max-width: 480px) {
    .flex.items-center.gap-2.pb-2 > button {
        padding: 4px 12px !important;
        font-size: 11px !important;
    }
    .group .bg-gray-100\/90 {
        padding: 10px 14px !important;
    }
    #ai-chat-input {
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    .bg-gradient-to-t {
        padding: 8px 0 !important;
    }
}
@media (max-width: 380px) {
    .flex.items-center.gap-2.pb-2 > button {
        padding: 3px 10px !important;
        font-size: 10px !important;
    }
}

/* ---------- 魔法点缀 ---------- */
.group .bg-gray-100\/90 .magic-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #ff69b4;
    border-radius: 50%;
    margin: 0 2px;
    opacity: 0.6;
}


















/* 
 * ================================================================
 *  折叠状态栏 · 魔法契约风格（修正版）
 *  移除干扰点击的花边装饰，修复手机端无法点击问题
 *  新增 ✨ 图标展开旋转动画
 * ================================================================
 */

/* ---------- 折叠块整体样式 ---------- */
details {
    background: #f8f6f2 !important;
    border: 2px solid #1a1a1a !important;
    border-radius: 12px !important;
    box-shadow: 3px 3px 0px #1a1a1a !important;
    font-family: 'Courier New', 'Hiragino Kaku Gothic Pro', 'Noto Sans JP', sans-serif;
    padding: 8px 12px !important;
    margin-bottom: 16px !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    /* 避免内容溢出 */
    overflow: hidden !important;
}

details[open] {
    padding-bottom: 16px !important;
}

details:hover {
    transform: translateY(-2px) !important;
    box-shadow: 5px 5px 0px #1a1a1a !important;
}

/* ---------- 折叠状态栏（摘要区域） ---------- */
details summary {
    cursor: pointer !important;
    font-weight: 700 !important;
    font-size: 0.9em !important;
    list-style: none !important;
    padding: 8px 0 !important;
    display: block !important;
    position: relative !important;
    /* 确保点击区域足够大，解决手机端点击问题 */
    min-height: 36px !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
}

/* 移除浏览器默认的三角形图标 */
details summary::-webkit-details-marker {
    display: none !important;
}

/* ---------- ✨ 自定义折叠图标（可旋转） ---------- */
details summary::before {
    content: '✨' !important;
    display: inline-block !important;
    font-size: 0.9em !important;
    color: #1a1a1a !important;
    margin-right: 6px !important;
    transition: transform 0.3s ease !important;
    /* 默认无旋转 */
    transform: rotate(0deg) !important;
}

/* 展开时，✨ 图标旋转 180 度（也可以改成 90 度或 360 度，随您喜好） */
details[open] summary::before {
    transform: rotate(180deg) !important;
}

/* ---------- 内部内容通用 ---------- */
details > *:not(summary) {
    margin-left: 8px !important;
    margin-right: 8px !important;
}

/* ---------- Markdown 表格特殊美化 ---------- */
details table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 12px 0 8px !important;
    font-size: 0.9rem !important;
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
}

details table th,
details table td {
    border: 1px solid #1a1a1a !important;
    padding: 8px 14px !important;
    text-align: left !important;
    vertical-align: middle !important;
}

/* 表头：深色背景，浅色文字 */
details table th {
    background: #1a1a1a !important;
    color: #f5f4f0 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

/* 表体：浅色背景 */
details table td {
    background: #fafaf8 !important;
}

details table tr:nth-child(even) td {
    background: #f0efeb !important;
}

details table tr:hover td {
    background: #e8e6e0 !important;
}

/* ---------- 适配手机端 ---------- */
@media screen and (max-width: 600px) {
    details {
        padding: 6px 10px !important;
    }
    details table th,
    details table td {
        padding: 6px 8px !important;
        font-size: 0.8rem !important;
    }
    details summary {
        font-size: 0.85em !important;
        padding: 6px 0 !important;
        min-height: 32px !important;
    }
}