/* ========================================================
   圆桌主题  (roundtable_theme.css)
   通过 body.roundtable 类名激活，不影响其他主题
   v2 —— 对齐 roundtable-main 原版质感：
   ① 补齐灵魂字体（Noto Serif SC 衬线正文 / Fira Code 等宽 / ZCOOL KuaiLe）
   ② 气泡按角色淡染品牌色（原版 .codex-dim / .claude-dim 手法）
   ③ 去掉玻璃 inset 高光，换成原版的暖棕扩散纸影
   ④ 小灵魂件：入场动画 / 5px 细滚动条 / 头像描边圆环
   ======================================================== */

@import url("https://fonts.font.im/css2?family=Inter:wght@400;500;600&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Noto+Serif+SC:wght@400;500;600&family=Fira+Code:wght@400;500&family=ZCOOL+KuaiLe&display=swap");

body.roundtable {
  --rt-bg: #f7f3eb;
  --rt-paper: rgba(255, 253, 248, 0.72);
  --rt-paper-strong: rgba(255, 253, 248, 0.92);
  --rt-paper-soft: rgba(255, 255, 255, 0.48);
  --rt-ink: #29241f;
  --rt-ink-2: #6f665d;
  --rt-muted: #968b80;
  --rt-line: rgba(54, 46, 38, 0.14);
  --rt-line-soft: rgba(54, 46, 38, 0.08);
  --rt-brand-gemini: #408b7b;
  --rt-brand-claude: #b97a63;
  --rt-brand-deepseek: #8d82a8;
  --rt-brand-user: #776b61;
  /* 原版影子：极淡、极扩散、暖棕色，没有任何玻璃高光 */
  --rt-shadow: 0 22px 70px rgba(67, 52, 35, 0.10);
  --rt-shadow-soft: 0 10px 36px rgba(67, 52, 35, 0.07);
  --rt-shadow-bubble: 0 8px 22px rgba(67, 52, 35, 0.045);
  font-family: Inter, "Noto Serif SC", sans-serif;
}

/* ── ③ 纸感替换玻璃感 ──────────────────────────────
   玻璃变量以行内 style 挂在根容器（[data-accent]）上，
   这里用 !important 重定义变量本体：所有引用这些变量的
   卡片/面板/气泡会自动换成纸影，inset 白高光整组消失。 */
body.roundtable [data-accent] {
  --lian-glass-card-shadow: var(--rt-shadow) !important;
  --lian-glass-shadow: var(--rt-shadow-soft) !important;
  /* 原版毛玻璃只有 blur，没有过饱和（saturate 会让纸变"塑料"） */
  --lian-glass-blur: blur(24px) !important;
  --lian-glass-deep-blur: blur(32px) !important;
}

/* ── ① 字体：手账的灵魂 ──────────────────────────── */

/* 标题：Playfair Display 衬线（原版 .side-head h1 / .paper-head h2） */
body.roundtable .rt-Heading,
body.roundtable h1,
body.roundtable h2,
body.roundtable h3 {
  font-family: "Playfair Display", "Noto Serif SC", serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.005em;
}

/* 消息正文：Noto Serif SC 衬线 + 1.75 行高（原版 .text 的排印） */
body.roundtable .lian-msg-row [data-bubble-role] {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif !important;
  line-height: 1.75;
}

/* 时间戳等小字：Fira Code 等宽（原版 .meta time / .topic-meta） */
body.roundtable .lian-msg-row [data-bubble-role] ~ * time,
body.roundtable .lian-msg-row time {
  font-family: "Fira Code", monospace !important;
  font-size: 10px;
}

/* ── ② 气泡：每人一色淡染（原版 .codex-dim 手法）──────
   :not([style*="padding: 0px"]) 跳过纯表情包气泡（padding 为 0），
   避免贴纸背后出现色块。 */
body.roundtable .lian-msg-row [data-bubble-role="assistant"]:not([style*="padding: 0px"]) {
  background: var(--lian-bubble-bg, rgba(185, 122, 99, 0.13)) !important;
  border-color: var(--rt-line-soft) !important;
  box-shadow: var(--rt-shadow-bubble) !important;
}

body.roundtable .lian-msg-row [data-bubble-role="user"]:not([style*="padding: 0px"]) {
  background: var(--lian-bubble-bg, rgba(92, 80, 68, 0.10)) !important;
  border-color: var(--rt-line-soft) !important;
  box-shadow: var(--rt-shadow-bubble) !important;
}

/* 水珠模式（lian-droplet）有自己的高光体系，圆桌下让位给纸感 */
body.roundtable .lian-droplet::before,
body.roundtable .lian-droplet::after {
  opacity: 0.22;
}

/* 头像：细描边圆环 + 半透明纸底（原版 .avatar） */
body.roundtable .lian-msg-row .rt-AvatarRoot,
body.roundtable .lian-msg-row .lian-avatar-poke img {
  border: 1px solid rgba(54, 46, 38, 0.22);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

/* ── ④ 小灵魂件 ─────────────────────────────────── */

/* 消息入场：上浮 + 微缩放（原版 @keyframes msg-in） */
@keyframes rt-msg-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

body.roundtable .lian-msg-row {
  animation: rt-msg-in 240ms cubic-bezier(0.2, 0.6, 0.3, 1);
}

/* 5px 细圆滚动条（原版 ::-webkit-scrollbar） */
body.roundtable ::-webkit-scrollbar { width: 5px; height: 5px; }
body.roundtable ::-webkit-scrollbar-track { background: transparent; }
body.roundtable ::-webkit-scrollbar-thumb {
  background: rgba(111, 143, 167, 0.24);
  border-radius: 999px;
}
body.roundtable ::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 143, 167, 0.42);
}

/* 侧栏会话行：原版 .room-item 的柔和悬停 */
body.roundtable .lian-conv-row {
  border-radius: 18px !important;
  transition: background 0.14s ease;
}
body.roundtable .lian-conv-row:hover {
  background: rgba(255, 255, 255, 0.62) !important;
}

/* ── 按钮 / 输入框 / 面板（v1 保留 + 微调）────────── */

body.roundtable .chakra-button,
body.roundtable .rt-Button,
body.roundtable button[class*="radix"]:not(.lian-composer-send-btn):not(.lian-composer-plus-btn):not(.lian-composer-color-btn) {
  border-radius: 999px !important;
  transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

body.roundtable .chakra-button:hover,
body.roundtable .rt-Button:hover,
body.roundtable button[class*="radix"]:hover {
  transform: translateY(-1px);
}

body.roundtable textarea,
body.roundtable input[type="text"],
body.roundtable .lian-rich-editor,
body.roundtable .lian-composer-bar {
  background: rgba(255, 253, 248, 0.54) !important;
  border: 1px solid var(--rt-line) !important;
  border-radius: 28px !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

body.roundtable textarea:focus,
body.roundtable input[type="text"]:focus,
body.roundtable .lian-rich-editor:focus-within,
body.roundtable .lian-composer-bar:focus-within {
  border-color: rgba(64, 139, 123, 0.42) !important;
  box-shadow: 0 0 0 2px rgba(64, 139, 123, 0.12) !important;
}

/* 作曲条：原版 .interject 的悬浮纸片影 */
body.roundtable .lian-composer-bar {
  background: rgba(255, 253, 248, 0.84) !important;
  box-shadow: 0 20px 54px rgba(67, 52, 35, 0.12) !important;
}

body.roundtable .lian-glass-card,
body.roundtable .lian-glass-panel-deep,
body.roundtable #lian-sidebar-panel,
body.roundtable #lian-settings-panel {
  border-radius: 28px !important;
}
