/* ═══ B平台表格修正(自动注入)═══ */
.rili-markdown-renderer table { display:table!important; table-layout:auto!important; width:100%!important; border-collapse:collapse!important; }
.rili-markdown-renderer table caption { display:table-caption!important; caption-side:top!important; text-align:center!important; padding:8px!important; }
.rili-markdown-renderer thead { display:table-header-group!important; }
.rili-markdown-renderer tbody { display:table-row-group!important; }
.rili-markdown-renderer tr { display:table-row!important; }
.rili-markdown-renderer th, .rili-markdown-renderer td { display:table-cell!important; }

/* ═══ B平台按钮组保护(自动注入 — 防止按钮消失)═══ */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5,
.is-user .bg-muted.rounded.flex.p-0\.5,
.is-assistant .bg-muted.rounded.flex.p-0\.5 {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  position: relative !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  pointer-events: auto !important;
  clip: auto !important;
  clip-path: none !important;
}
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5 > button,
.is-user .bg-muted.rounded.flex.p-0\.5 > button,
.is-assistant .bg-muted.rounded.flex.p-0\.5 > button {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  clip: auto !important;
  clip-path: none !important;
}
.flex.items-center.gap-1.ml-auto.md\:opacity-0.group-hover\:opacity-100 {
  visibility: visible !important;
  display: flex !important;
  pointer-events: auto !important;
  overflow: visible !important;
}
.flex.w-full.items-center.justify-between.gap-2.px-2 {
  display: flex !important;
  visibility: visible !important;
  overflow: visible !important;
}

/* --- Punishing: Gray Raven UI Theme - v5.5 (Pseudo-element Fix) --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&family=Orbitron:wght@500;700&display=swap');
.a {
    --bg-p: transparent; 
    --bg-s: #ffffff;   
    --bdr: #d1d5db;         
    --acc: #3b82f6;         
    --pos: #22c55e;       
    --hl: #f59e0b;      
    --neg: #ef4444;       
    --tx-p: #1f2937;   
    --tx-s: #6b7280; 
    --tx-l: #111827;
    --overlay: rgba(40,42,54,.97);
    --glow: rgba(59, 130, 246, 0.4);
    background-color: var(--bg-p);
    color: var(--tx-p);
    font-family: 'Roboto Condensed', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.7;
}
.a details { margin-bottom: 8px; border: none; background: none; border-radius: 4px; }
.a summary {
    list-style: none;
    background-color: #111827; 
    color: #ffffff; 
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
}
.a summary:hover { background-color: #374151; }
.a summary::-webkit-details-marker { display: none; }
.a summary::before { content: '■'; font-size: 0.8em; color: var(--acc); transition: transform 0.3s ease-in-out; }
.a details[open] > summary::before { transform: rotate(90deg); }
.a .b { background-color: #f9fafb; border: 1px solid var(--bdr); border-top: none; padding: 12px; }
.a .c {
    background:rgba(255,255,255,.7);
    border:1px solid var(--bdr);
    border-radius:8px;
    padding:5px 12px;
    display:flex;
    justify-content:flex-start;
    align-items:center;
    flex-wrap:wrap;
    margin-bottom:6px
}
.a .c:last-child { margin-bottom: 0; }
.a .c.d { flex-direction:column; align-items:flex-start; }
.a .c.d span { padding-top: 5px; line-height: 1.8; }
.a .c info {
    color: var(--tx-l);
    font-weight:700;
    margin-right:8px;
    display:flex;
    align-items:center;
    font-family: 'Roboto Condensed', sans-serif;
}
.a .c info::before{content:'✧';margin-right:4px;color:var(--acc)}
.a .c span { text-align: left; word-break: break-all; }
.a .e { background-color: var(--bg-s); border: 1px solid var(--bdr); padding: 1em 1.5em; margin: 10px 0; border-radius: 4px; }
.a .e p { margin-bottom: 1em; }
.a .e p:last-child { margin-bottom: 0; }
.a .f { color: var(--acc); font-weight: bold; border-left: 3px solid var(--acc); padding-left: 1em; margin: 1em 0; }
.a T {
    position: relative;
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted var(--acc);
    padding: 0 3px;
    border-radius: 3px;
    transition: all .2s ease;
    font-weight: 700;
    color: var(--acc);
}
.a T:hover { background: rgba(59, 130, 246, 0.1); }
.a T::before { content: "\2060"; }
.a T Ti {
    visibility: hidden; opacity: 0;
    position: absolute; 
    z-index: 9999;
    bottom: 140%; left: 0;
    width: max-content;
    min-width: 24ch;
    max-width: 450px;
    white-space: normal;
    background-color: var(--overlay);
    color: #f8f8f2;
    text-align: left;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: .9em;
    border: 1px solid var(--acc);
    box-shadow: 0 0 20px var(--glow);
    transition: opacity .3s ease, visibility .3s ease;
    pointer-events: none;
}
.a T Ti::after {
    content: ""; position: absolute;
    top: 100%; left: 15px; margin-left: -6px;
    border-width: 6px; border-style: solid;
    border-color: var(--acc) transparent transparent transparent;
}
.a T:hover Ti { visibility: visible; opacity: 1; }
.a T Ti span { color: var(--acc); font-weight: 700; }
.a T Ti hr { border: 0; height: 1px; background: #4b5563; margin: 8px 0; }
.a T Ti i { font-style: normal; }
.a .af { color: var(--pos) !important; font-weight: bold; }
.a .ag { color: var(--hl) !important; font-weight: bold; }
.a .ah { color: var(--neg) !important; font-weight: bold; }
.a .i { background: #e5e7eb; border: 1px solid #9ca3af; border-top: none; padding: 8px; }
.a .j { background: #f9fafb; border-radius: 3px; margin-bottom: 6px; padding: 8px 12px; border-left: 3px solid var(--tx-s); }
.a .j:last-child { margin-bottom: 0; }
.a .k { font-weight: 700; font-family: 'Orbitron', sans-serif; color: var(--tx-p); margin-bottom: 4px; display: flex; align-items: center; }
.a .k::before { content: '■'; margin-right: 8px; color: var(--tx-s); }
.a .l { font-size: 0.95em; color: var(--tx-s); padding-left: 1.5em; }
.a .k.ai { border-color: var(--hl); } .a .k.ai::before { color: var(--hl); }
.a .k.aj { border-color: var(--acc); } .a .k.aj::before { color: var(--acc); }
.a .k.ak { border-color: var(--hl); } .a .k.ak::before { color: var(--hl); }
.a .k.al { border-color: var(--pos); } .a .k.al::before { color: var(--pos); }
.a .m { background: #dbe1e8; border: 1px solid #9ca3af; border-top: none; border-radius: 0 0 4px 4px; display: flex; flex-direction: column; }
.a .n { background: #f9fafb; padding: 8px 12px; border-bottom: 1px solid var(--bdr); display: flex; justify-content: space-between; align-items: center; font-family: 'Orbitron', sans-serif; font-weight: 700; }
.a .n i { font-style: normal; margin-right: 5px; }
.a .o { 
    padding: 10px; 
    overflow: visible !important; 
    max-height: none !important; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}
.a .p { display: flex; gap: 10px; max-width: 85%; }
.a .q { width: 40px; height: 40px; border-radius: 50%; background-color: var(--tx-s); background-size: cover; background-position: center; flex-shrink: 0; }
.a .r { display: flex; flex-direction: column; }
.a .s { font-size: 0.8em; color: var(--tx-s); margin-bottom: 2px; }
.a .t { background: #fff; padding: 8px 12px; border-radius: 12px; border-top-left-radius: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.a .u { align-self: center; background: rgba(107, 114, 128, 0.2); color: var(--tx-s); font-size: 0.8em; padding: 2px 8px; border-radius: 10px; }
.a .u i { font-style: normal; margin-right: 4px; }
.a .am::before { content: '👥'; } .a .an::before { content: '→'; } .a .ao::before { content: '←'; } .a .ap::before { content: '👉'; } .a .aq::before { content: '🔇'; }
.a .v { background-color: var(--bg-s); border: 1px solid var(--bdr); padding: 12px; margin-top: 10px; border-radius: 4px; }
.a .v h3 { margin-top: 0; text-align: center; color: var(--tx-l); font-family: 'Orbitron', sans-serif; text-transform: uppercase;}
.a .v ol { list-style: none; padding-left: 0; counter-reset: v-c; margin-bottom: 0;}
.a .v li { background: transparent; border: 1px solid var(--bdr); padding: 8px 12px 8px 35px; margin-bottom: 6px; cursor: pointer; position: relative; transition: all .2s ease; border-radius: 4px; }
.a .v li:last-child { margin-bottom: 0; }
.a .v li:hover { background: rgba(59, 130, 246, 0.1); border-color: var(--acc); color: var(--acc); font-weight: bold; }
.a .v li::before { counter-increment: v-c; content: counter(v-c); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--acc); font-weight: 700; font-family: 'Orbitron', sans-serif; }
.a .w { border: 0; height: 1px; background: var(--bdr); margin: 15px 0; }
.a .x { flex-grow: 1; height: 35px; outline: none; }
.a .y { padding-left: 1em; font-style: italic; color: var(--tx-s); }
.a .z { display: contents; } 
.a .aa { margin-bottom: 15px; } 
.a .aa:last-child { margin-bottom: 0; }
.a .ab { margin-bottom: 15px; } 
.a .ac { width: 100%; border-collapse: collapse; font-size: .9em; margin-top: 8px; }
.a .ac th, .a .ac td { padding: 6px 8px; text-align: left; border: 1px solid var(--bdr); }
.a .ac thead th { background-color: #e5e7eb; color: var(--tx-l); font-weight: 700; }
.a .ac tbody tr:hover { background-color: rgba(59, 130, 246, 0.1); }
.a .ad { padding: 12px; }
.a .ae { font-weight: bold; color: var(--acc); }
.a .c.ar { background: #1f2937; border-color: var(--acc); align-items: center; }
.a .c.ar info { color: #f9fafb; }
.a .x::-webkit-media-controls-panel { background-color: rgba(255, 255, 255, 0.1); border-radius: 5px; }
.a .x::-webkit-media-controls-play-button { background-color: var(--acc); border-radius: 50%; margin: 5px; }
.a .x::-webkit-media-controls-current-time-display, 
.a .x::-webkit-media-controls-time-remaining-display { color: #d1d5db; }
.a .x::-webkit-media-controls-volume-slider-container { display: none; }
.a .x::-webkit-media-controls-mute-button { display: none; }

/* --- Platform Overrides & Final Integrations --- */
[class*="bg-[#F1CBCB]"],
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* --- THE FIX: Properly separated pseudo-element selectors --- */
/* Main bubble container */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted {
    background: #FFFFFF !important;
    border: 1px solid rgba(0, 150, 220, 0.4) !important;
    padding: 20px 25px !important;
    position: relative !important;
    box-shadow: 
        inset 0 0 15px rgba(200, 230, 255, 0.75),
        0 0 25px rgba(0, 180, 255, 0.5) !important;
    transition: box-shadow 0.3s ease-in-out !important;
    clip-path: none !important;
    border-radius: 8px !important;
}

/* Top-left bracket (::before) */
.is-user > .border.border-muted::before,
.is-assistant > .border.border-muted::before {
    content: '' !important;
    position: absolute !important;
    width: 15px !important;
    height: 15px !important;
    border-color: #00BFFF !important;
    filter: drop-shadow(0 0 2px #00BFFF) !important;
    display: block !important;
    top: 6px !important;
    left: 6px !important;
    border-top: 2px solid !important;
    border-left: 2px solid !important;
}

/* Bottom-right bracket (::after) */
.is-user > .border.border-muted::after,
.is-assistant > .border.border-muted::after {
    content: '' !important;
    position: absolute !important;
    width: 15px !important;
    height: 15px !important;
    border-color: #00BFFF !important;
    filter: drop-shadow(0 0 2px #00BFFF) !important;
    display: block !important;
    bottom: 6px !important;
    right: 6px !important;
    border-bottom: 2px solid !important;
    border-right: 2px solid !important;
}

.rili-markdown-renderer {
    color: #212529 !important;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif !important;
    font-weight: 500 !important;
    line-height: 1.7 !important;
}

.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    color: #495057 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: color 0.2s ease, background-color 0.2s ease !important;
    margin-top: 10px !important;
}
.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7:hover{
    color: #00BFFF !important;
    background-color: rgba(0, 180, 255, 0.08) !important;
}

.flex.w-full.items-center.justify-between.gap-2.px-2 > p.MuiTypography-root.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
  color: #adb5bd !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  font-family: 'Helvetica Neue', Arial, sans-serif !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
}
.flex.w-full.items-center.justify-between.gap-2.px-2 > p.MuiTypography-root.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground::after {
  content: '查看血清消耗' !important;
  background: #343a40 !important;
  color: #f8f9fa !important;
  border: 1px solid #495057 !important;
  border-radius: 0 !important;
  padding: 3px 8px !important;
  font-size: 11px !important;
  margin-left: 12px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.flex.w-full.items-center.justify-between.gap-2.px-2 > p.MuiTypography-root.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground:hover::after {
  background: #ffc107 !important;
  border-color: #ffc107 !important;
  color: #000000 !important;
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.5) !important;
  text-shadow: none !important;
}
.flex.w-full.items-center.justify-between.gap-2.px-2 > p.MuiTypography-root.css-1x48u03 {
  color: #ffc107 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 2px 8px !important;
  margin-left: 5px !important;
  opacity: 0 !important;
  max-width: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  transition: opacity 0.3s ease, max-width 0.4s ease, padding 0.4s ease !important;
}
.flex.w-full.items-center.justify-between.gap-2.px-2 > p.MuiTypography-root.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground:hover ~ p.MuiTypography-root.css-1x48u03 {
  opacity: 1 !important;
  max-width: 200px !important;
}
/* ═══ B平台加载动画适配 ═══ */
.flex.items-center.justify-center.size-6 { opacity: 1 !important; }
.flex.items-center.justify-center.size-6 > .flex.gap-2 { display: none !important; }
.is-assistant.w-fit { width: 100% !important; }
.is-assistant > .border.border-muted:has(.flex.items-center.justify-center.size-6) {
  width: 100% !important; background: transparent !important;
  border: none !important; padding: 0 !important;
}
.is-assistant .space-y-3:has(.flex.items-center.justify-center.size-6) {
  display: flex; justify-content: center; width: 100%;
}

header.flex.justify-between { position: relative; overflow: visible; }

/* ===== 顶部栏美化 ===== */
header.flex.justify-between {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
  border-bottom: 2px solid #000000 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 
              0 0 20px rgba(255, 255, 255, 0.3) inset !important;
  backdrop-filter: blur(10px) !important;
}
#nav-middle .group.flex.items-center {
  background: #ffffff !important;
  border: 1px solid #000000 !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
#nav-middle .group.flex.items-center:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
              0 0 12px rgba(255, 255, 255, 0.5) inset !important;
  transform: translateY(-1px) !important;
}
#nav-middle button:has(> .flex-1.truncate.text-left) .flex-1.truncate.text-left {
  color: #000000 !important;
  font-weight: 600 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: 0.3px !important;
}
#nav-middle .shrink-0.flex.items-center svg {
  color: #000000 !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)) !important;
}
header.flex.justify-between.w-full.top-0 svg.lucide-clock-8 {
  color: #000000 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)) !important;
  transition: transform 0.3s ease !important;
}
header.flex.justify-between.w-full.top-0 svg.lucide-clock-8:hover {
  transform: scale(1.1) !important;
}
header.flex.justify-between.w-full.top-0 span.MuiBadge-dot.md\:hidden {
  background: #000000 !important;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6) !important;
}
header.flex.justify-between.w-full.top-0 button.MuiIconButton-root:has(svg.lucide-music-2) {
  background: #ffffff !important;
  border: 1px solid #000000 !important;
  transition: all 0.3s ease !important;
}
header.flex.justify-between.w-full.top-0 button.MuiIconButton-root:has(svg.lucide-music-2):hover {
  background: #f0f0f0 !important;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3) !important;
}
#nav-right button {
  background: #ffffff !important;
  border: 1px solid #000000 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
}
#nav-right button:hover {
  background: #000000 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}
#nav-right button svg {
  color: #000000 !important;
  transition: color 0.3s ease !important;
}
#nav-right button:hover svg {
  color: #ffffff !important;
}
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"] {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%) !important;
  border: 1px solid #000000 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
}
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"]:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2),
              0 0 10px rgba(255, 255, 255, 0.4) inset !important;
  transform: translateY(-1px) !important;
}
div.flex.items-center.h-9.cursor-pointer.group svg[data-icon="SlidersH"],
div.flex.items-center.h-9.cursor-pointer.group svgbutton:has(> .flex-1.truncate.text-left) svg {
  color: #000000 !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15)) !important;
}
#ai-mod-button2 button.MuiButton-root {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%) !important;
  border: 1px solid #000000 !important;
  color: #000000 !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
#ai-mod-button2 button.MuiButton-root:hover {
  background: #000000 !important;
  color: #ffffff !important;
  box-shadow: 0 4px