/**
 * ========================================
 * 网站主样式表 - 优化版本
 * ========================================
 * 目录：
 * 1. CSS 变量定义（浅色/深色主题）
 * 2. 全局重置与基础样式
 * 3. 元素默认样式
 * 4. 动画定义
 * 5. 布局组件
 * 6. 窗口与头部样式
 * 7. 侧边栏样式
 * 8. 聊天界面样式
 * 9. 模态框与弹窗
 * 10. 表单元素
 * 11. 按钮组件
 * 12. 模型列表
 * 13. Markdown 渲染
 * 14. 代码高亮
 * 15. 媒体元素
 * 16. 工具类
 * 17. 响应式设计
 * ========================================
 */

/* ========================================
   1. CSS 变量定义
   ======================================== */

:root {
  /* ---- 布局尺寸 ---- */
  --full-height: 100%;
  --window-width: 94vw;
  --window-height: 94vh;
  --sidebar-width: 300px;
  --window-content-width: calc(100% - var(--sidebar-width));
  --message-max-width: 95%;

  /* ---- 主题标识 ---- */
  --theme: light;
  --color-scheme: light;
  color-scheme: light;

  /* ---- 基础色板 ---- */
  --white: #fff;
  --black: #303030;
  --gray: #fafafa;
  --silver: #ccc;
  --primary: #1d93ab;
  --second: #e7f8ff;
  --hover-color: #f3f3f3;
  --bar-color: rgba(0, 0, 0, 0.1);
  --theme-color: var(--gray);

  /* ---- 边框与阴影 ---- */
  --border-color: #e5e7eb;
  --border-in-light: 1px solid #dedede;
  --shadow: 50px 50px 100px 10px rgba(0, 0, 0, 0.1);
  --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);

  /* ---- 文本颜色 ---- */
  --placeholder-color: #9ca3af;
  --color-fg-default: #24292f;
  --color-fg-muted: #57606a;
  --color-fg-subtle: #6e7781;

  /* ---- 画布颜色 ---- */
  --color-canvas-default: transparent;
  --color-canvas-subtle: #f6f8fa;

  /* ---- 边框颜色 ---- */
  --color-border-default: #d0d7de;
  --color-border-muted: #d8dee4;
  --color-neutral-muted: rgba(175, 184, 193, 0.2);

  /* ---- 强调色 ---- */
  --color-accent-fg: #0969da;
  --color-accent-emphasis: #0969da;
  --color-attention-subtle: #fff8c5;
  --color-danger-fg: #cf222e;

  /* ---- 代码高亮色（浅色主题） ---- */
  --color-prettylights-syntax-comment: #6e7781;
  --color-prettylights-syntax-constant: #0550ae;
  --color-prettylights-syntax-entity: #8250df;
  --color-prettylights-syntax-storage-modifier-import: #24292f;
  --color-prettylights-syntax-entity-tag: #116329;
  --color-prettylights-syntax-keyword: #cf222e;
  --color-prettylights-syntax-string: #0a3069;
  --color-prettylights-syntax-variable: #953800;
  --color-prettylights-syntax-brackethighlighter-unmatched: #82071e;
  --color-prettylights-syntax-invalid-illegal-text: #f6f8fa;
  --color-prettylights-syntax-invalid-illegal-bg: #82071e;
  --color-prettylights-syntax-carriage-return-text: #f6f8fa;
  --color-prettylights-syntax-carriage-return-bg: #cf222e;
  --color-prettylights-syntax-string-regexp: #116329;
  --color-prettylights-syntax-markup-list: #3b2300;
  --color-prettylights-syntax-markup-heading: #0550ae;
  --color-prettylights-syntax-markup-italic: #24292f;
  --color-prettylights-syntax-markup-bold: #24292f;
  --color-prettylights-syntax-markup-deleted-text: #82071e;
  --color-prettylights-syntax-markup-deleted-bg: #ffebe9;
  --color-prettylights-syntax-markup-inserted-text: #116329;
  --color-prettylights-syntax-markup-inserted-bg: #dafbe1;
  --color-prettylights-syntax-markup-changed-text: #953800;
  --color-prettylights-syntax-markup-changed-bg: #ffd8b5;
  --color-prettylights-syntax-markup-ignored-text: #eaeef2;
  --color-prettylights-syntax-markup-ignored-bg: #0550ae;
  --color-prettylights-syntax-meta-diff-range: #8250df;
  --color-prettylights-syntax-brackethighlighter-angle: #57606a;
  --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
  --color-prettylights-syntax-constant-other-reference-link: #0a3069;
}

/* ---- 深色主题变量覆盖 ---- */
.dark {
  --theme: dark;
  --color-scheme: dark;
  color-scheme: dark;

  /* 基础色板 */
  --white: #1e1e1e;
  --black: #bbb;
  --gray: #151515;
  --silver: #666;
  --second: #1b262a;
  --hover-color: #323232;
  --bar-color: hsla(0, 0%, 100%, 0.1);
  --theme-color: var(--gray);

  /* 边框与阴影 */
  --border-in-light: 1px solid hsla(0, 0%, 100%, 0.192);
  --card-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);

  /* 文本颜色 */
  --color-fg-default: #c9d1d9;
  --color-fg-muted: #8b949e;
  --color-fg-subtle: #6e7681;

  /* 画布颜色 */
  --color-canvas-subtle: #161b22;

  /* 边框颜色 */
  --color-border-default: #30363d;
  --color-border-muted: #21262d;
  --color-neutral-muted: hsla(215, 8%, 47%, 0.4);

  /* 强调色 */
  --color-accent-fg: #58a6ff;
  --color-accent-emphasis: #1f6feb;
  --color-attention-subtle: rgba(187, 128, 9, 0.15);
  --color-danger-fg: #f85149;

  /* 代码高亮色（深色主题） */
  --color-prettylights-syntax-comment: #8b949e;
  --color-prettylights-syntax-constant: #79c0ff;
  --color-prettylights-syntax-entity: #d2a8ff;
  --color-prettylights-syntax-storage-modifier-import: #c9d1d9;
  --color-prettylights-syntax-entity-tag: #7ee787;
  --color-prettylights-syntax-keyword: #ff7b72;
  --color-prettylights-syntax-string: #a5d6ff;
  --color-prettylights-syntax-variable: #ffa657;
  --color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
  --color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
  --color-prettylights-syntax-invalid-illegal-bg: #8e1519;
  --color-prettylights-syntax-carriage-return-text: #f0f6fc;
  --color-prettylights-syntax-carriage-return-bg: #b62324;
  --color-prettylights-syntax-string-regexp: #7ee787;
  --color-prettylights-syntax-markup-list: #f2cc60;
  --color-prettylights-syntax-markup-heading: #1f6feb;
  --color-prettylights-syntax-markup-italic: #c9d1d9;
  --color-prettylights-syntax-markup-bold: #c9d1d9;
  --color-prettylights-syntax-markup-deleted-text: #ffdcd7;
  --color-prettylights-syntax-markup-deleted-bg: #67060c;
  --color-prettylights-syntax-markup-inserted-text: #aff5b4;
  --color-prettylights-syntax-markup-inserted-bg: #033a16;
  --color-prettylights-syntax-markup-changed-text: #ffdfb6;
  --color-prettylights-syntax-markup-changed-bg: #5a1e02;
  --color-prettylights-syntax-markup-ignored-text: #c9d1d9;
  --color-prettylights-syntax-markup-ignored-bg: #1158c7;
  --color-prettylights-syntax-meta-diff-range: #d2a8ff;
  --color-prettylights-syntax-brackethighlighter-angle: #8b949e;
  --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
  --color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
}

/* 深色模式 SVG 反色处理 */
.dark div:not(.no-dark) > svg {
  filter: invert(0.5);
}

/* ========================================
   2. 全局重置与基础样式
   ======================================== */

/* 盒模型统一设置 */
html {
  box-sizing: border-box;
  line-height: 1.3;
  text-size-adjust: 100%;
  tab-size: 4;
}

*,
*::before,
*::after {
  box-sizing: inherit;
  border: 0 solid var(--border-color);
}

/* 文档基础设置 */
html,
body {
  height: var(--full-height);
  margin: 0;
  padding: 0;
  width: 100vw;
}

body {
  font: 14px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: var(--gray);
  color: var(--black);
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  touch-action: pan-x pan-y;
  transition: background-color 0.3s ease;
}

/* ========================================
   3. 元素默认样式重置
   ======================================== */

/* 移除默认 margin 的元素 */
h1, h2, h3, h4, h5, h6,
blockquote, dl, dd, p, pre,
ol, ul, menu, fieldset, legend, figure {
  margin: 0;
}

/* 水平线 */
hr {
  border: 0;
  border-top: 1px solid currentColor;
  color: inherit;
}

/* 链接 */
a {
  color: inherit;
  text-decoration: inherit;
}

/* 加粗文本 */
b,
strong {
  font-weight: bolder;
}

/* 等宽字体元素 */
code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 1em;
}

/* 小号文本 */
small {
  font-size: 80%;
}

/* 上下标 */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  border-color: inherit;
  text-indent: 0;
}

/* 表单元素统一重置 */
button,
input,
optgroup,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-transform: none;
}

/* 按钮类型元素 */
button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

/* 焦点样式 */
:-moz-focusring,
:focus-visible {
  outline: auto;
}

:-moz-ui-invalid {
  box-shadow: none;
}

/* 进度条 */
progress {
  vertical-align: baseline;
}

/* 数字输入框箭头 */
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/* 搜索输入框 */
[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/* 文件上传按钮 */
::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

/* 详情/摘要元素 */
summary {
  display: list-item;
}

/* 占位符文本 */
input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: var(--placeholder-color);
}

/* 禁用状态按钮 */
button[disabled],
[role="button"][disabled] {
  cursor: default;
}

/* 媒体元素 */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  vertical-align: middle;
}

img,
video,
audio {
  max-width: 100%;
  height: auto;
}

/* ========================================
   4. 动画定义
   ======================================== */

/* 从下方滑入动画 */
@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 从上方滑入动画 */
@keyframes slide-in-from-top {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 淡入动画 */
@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 进度条条纹动画 */
@keyframes progress-bar-stripes {
  from { background-position: 40px 0; }
  to { background-position: 0 0; }
}

/* ========================================
   5. 滚动条样式
   ======================================== */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background-color: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: lightgrey;
  background-clip: content-box;
  border: 1px solid transparent;
  border-radius: 10px;
}

/* ========================================
   6. 窗口与头部样式
   ======================================== */

/* 窗口头部容器 */
.window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 8px 16px;
  height: 55px;
  background: var(--theme-color);
  border-bottom: var(--border-in-light);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* 头部标题区域 */
.window-header-title {
  max-width: calc(100% - 100px);
  overflow: hidden;
}

/* 主标题 */
.window-header-main-title {
  display: block;
  max-width: 48vw;
  font-size: 16px;
  font-weight: bolder;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 副标题 */
.window-header-sub-title {
  font-size: 14px;
  margin-top: 2px;
}

.window-header-sub-title span {
  margin-right: 6px;
}

.window-header-sub-title span:last-child {
  margin-right: 0;
}

/* 窗口操作按钮区域 */
.window-actions {
  display: inline-flex;
}

.window-action-button {
  margin-left: 10px;
}

.window-action-button .button_icon-button-icon {
  padding: 15px 9px;
}

/* ========================================
   7. 主容器布局
   ======================================== */

/* 基础容器样式（共用） */
.home_container,
.home_tight-container {
  display: flex;
  overflow: hidden;
  box-sizing: border-box;
  width: var(--window-width);
  height: var(--window-height);
  min-width: 768px;
  min-height: 480px;
  max-width: 1200px;
  border: var(--border-in-light);
  border-radius: 15px;
  box-shadow: var(--shadow);
  color: var(--black);
  background-color: var(--white);
}

/* 紧凑容器（全屏模式） */
.home_tight-container {
  --window-width: 100vw;
  --window-height: var(--full-height);
  --window-content-width: calc(100% - var(--sidebar-width));
  max-width: 100vw;
  max-height: var(--full-height);
  border: none;
  border-radius: 0;
}

/* 窗口内容区域 */
.home_window-content {
  width: var(--window-content-width);
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 移动端专用元素（默认隐藏） */
.home_mobile {
  display: none;
}

/* ========================================
   8. 侧边栏样式
   ======================================== */

/* 侧边栏容器 */
.home_sidebar {
  position: relative;
  top: 0;
  width: var(--sidebar-width);
  padding: 10px;
  background-color: var(--second);
  display: flex;
  flex-direction: column;
  box-shadow: inset -2px 0 2px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  transition: width 0.05s ease;
}

/* 侧边栏头部 */
.home_sidebar-header {
  position: relative;
  padding: 5px 0 10px;
}

/* 侧边栏 Logo */
.home_sidebar-logo {
  width: 40px;
  position: absolute;
  right: 0;
  top: 10px;
}

/* 侧边栏标题 */
.home_sidebar-title {
  font-size: 20px;
  font-weight: 700;
}

.home_sidebar-sub-title {
  font-size: 12px;
  font-weight: 400;
}

/* 侧边栏头部按钮栏 */
.home_sidebar-header-bar {
  display: flex;
  margin-bottom: 20px;
}

.home_sidebar-header-bar .home_sidebar-bar-button {
  flex: 1;
  background: var(--white);
}

.home_sidebar-header-bar .home_sidebar-bar-button:not(:last-child) {
  margin-right: 10px;
}

/* 侧边栏主体（可滚动区域） */
.home_sidebar-body {
  flex: 1;
  overflow: auto;
  overflow-x: hidden;
}

/* 侧边栏尾部 */
.home_sidebar-tail {
  display: flex;
  justify-content: space-between;
  padding-top: 15px;
}

/* 分享按钮 */
#sharebutton {
  margin-top: 10px;
  width: 100%;
  cursor: pointer;
}

/* 公告区域 */
#notice {
  display: none;
  position: relative;
  height: 100%;
}

#notice .noticect {
  height: 100%;
  overflow: auto;
  padding: 20px;
}

/* ========================================
   9. 聊天项目列表
   ======================================== */

/* 聊天项目卡片 */
.home_chat-item {
  position: relative;
  padding: 10px 14px;
  margin: 0 8px 13px 0;
  background-color: var(--white);
  border: 2px solid transparent;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

.home_chat-item:hover {
  background-color: var(--hover-color);
}

/* 选中状态 */
.home_chat-item-selected {
  border-color: var(--primary);
}

/* 聊天项目标题 */
.home_chat-item-title {
  width: 200px;
  font-size: 15px;
  font-weight: bolder;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 删除按钮 */
.home_chat-item-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.home_chat-item-delete:hover {
  opacity: 1;
}

/* 聊天项目信息栏 */
.home_chat-item-info {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #a6a6a6;
}

.home_chat-item-count,
.home_chat-item-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================
   10. 聊天窗口主体
   ======================================== */

/* 聊天容器 */
.home_chat {
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

/* 聊天消息区域 */
.home_chat-body {
  flex: 1;
  overflow: auto;
  padding: 3px 35px 25px;
  margin-bottom: 6px;
  position: relative;
  overscroll-behavior: none;
}

/* 刷新聊天按钮 */
.refreschat {
  width: fit-content;
  max-width: 65%;
  margin: 30px auto 0;
  padding: 6px 22px;
  background: #f4f4f5;
  color: #666;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  opacity: 0.9;
  transition: box-shadow 0.18s, background 0.18s;
}

/* ========================================
   11. 聊天消息样式
   ======================================== */

/* 消息行容器 */
.home_chat-message {
  display: flex;
}

/* 系统消息 */
.home_chat-message.system-message {
  flex-direction: row;
}

/* 用户消息（右对齐） */
.home_chat-message-user {
  display: flex;
  flex-direction: row-reverse;
}

/* 消息内容容器 */
.home_chat-message-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: var(--message-max-width);
  margin-top: 10px;
}

/* 用户消息容器对齐 */
.home_chat-message-user > .home_chat-message-container {
  align-items: flex-end;
}

/* 消息气泡 */
.home_chat-message-item {
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
  margin-top: 30px;
  padding: 10px;
  border: var(--border-in-light);
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.05);
  word-break: break-word;
  user-select: text;
}

/* 用户消息气泡背景 */
.home_chat-message-user > .home_chat-message-container > .home_chat-message-item {
  background-color: var(--second);
}

/* 消息状态 */
.home_chat-message-status {
  margin: 5px 0 1px;
  font-size: 12px;
  color: #aaa;
  line-height: 1;
}

/* 消息顶部操作按钮 */
.home_chat-message-top-actions {
  position: absolute;
  top: -26px;
  right: 20px;
  display: flex;
  flex-direction: row-reverse;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, right 0.3s ease;
}

/* 悬停显示操作按钮 */
.home_chat-message-container:hover .home_chat-message-top-actions {
  opacity: 1;
  right: 10px;
  pointer-events: all;
}

/* 单个操作按钮 */
.home_chat-message-top-action {
  cursor: pointer;
  white-space: nowrap;
  color: var(--black);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.home_chat-message-top-action:hover {
  opacity: 1;
}

.home_chat-message-top-action:not(:first-child) {
  margin-right: 10px;
}

/* AI 按钮区域 */
.ai-button {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  padding-top: 5px;
  box-sizing: border-box;
  font-size: 12px;
  color: #aaa;
}

.ai-button__info {
  color: inherit;
}

/* 复制全部按钮 */
.copyall {
  float: right;
  cursor: pointer;
}

/* 语音按钮 */
.button-yinyu {
  font-size: 16px;
}


/* ========================================
   12. 聊天输入面板
   ======================================== */

/* 输入面板容器 */
.home_chat-input-panel {
  position: relative;
  width: 100%;
  padding: 8px 5px;
  box-sizing: border-box;
  flex-direction: column;
  border-top: var(--border-in-light);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -6px 12px -4px rgba(0, 0, 0, 0.15), var(--card-shadow);
}

/* 输入面板内层 */
.home_chat-input-panel-inner {
  display: flex;
  flex: 1;
}

/* 聊天输入框 */
.home_chat-input {
  width: 100%;
  height: 100%;
  padding: 10px 60px 10px 10px;
  border: var(--border-in-light);
  border-radius: 10px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
  background-color: var(--white);
  color: var(--black);
  font-family: inherit;
  resize: none;
  outline: none;
  overflow-y: auto;
}

.home_chat-input:focus {
  border-color: var(--primary);
}

/* 发送按钮 */
.home_chat-input-send {
  position: absolute;
  right: 12px;
  bottom: 8px;
  padding: 0;
  background-color: #6dc6bd;
  color: #fff;
}

/* 输入操作按钮区域 */
.chat_chat-input-actions {
  display: flex;
  overflow-x: auto;
  line-height: 0.9;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.chat_chat-input-actions::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Edge */
}

/* 单个输入操作按钮 */
.chat_chat-input-actions .chat_chat-input-action {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px;
  margin-bottom: 7px;
  border: var(--border-in-light);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  background-color: var(--white);
  color: var(--black);
  font-size: 12px;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.chat_chat-input-actions .chat_chat-input-action:not(:last-child) {
  margin-right: 8px;
}

.chat_chat-input-action span {
  margin-left: 3px;
}

/* 图标容器（垂直布局） */
.icon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 上传计数 */
.icon-container .upload-count {
  margin: 0;
  font-size: 10px;
  line-height: 0.6;
  color: #ee5c13;
}

/* 模型提示区域 */
.modelno {
  width: 60%;
  margin: 10px auto;
  padding: 5px;
  background-color: #f2f2f2;
  border-radius: 5px;
  text-align: center;
}

/* 模型操作按钮 */
.modelaction {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
  font-size: 14px;
  color: #666;
}

.modelaction span {
  padding: 5px;
  background-color: #007bff;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.modelaction span:hover {
  background-color: #0056b3;
}

/* ========================================
   13. 按钮组件
   ======================================== */

/* 基础图标按钮 */
.button_icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;;
  border: none;
  border-radius: 10px;
  background-color: transparent;
  color: var(--black);
  cursor: pointer;
  outline: none;
  overflow: hidden;
  user-select: none;
  transition: all 0.3s ease;
}

.button_icon-button:hover {
  border-color: var(--primary);
}

.button_icon-button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

/* 按钮文本 */
.button_icon-button-text {
  margin: 0;
  padding: 5px 2px;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 按钮图标 */
.button_icon-button-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 3px 5px;
}

/* 主要按钮样式 */
.button_icon-button.button_primary,
.button_icon-button.button_primaryyy {
  background-color: var(--primary);
  color: #fff;
}

.button_icon-button.button_primary path,
.button_icon-button.button_primaryyy path {
  fill: #fff !important;
}

/* 次要主按钮（居中显示） */
.button_icon-button.button_primaryyy {
  display: none;
  width: 60%;
  margin: 0 auto;
  padding: 4px;
  background-color: #5a98a6;
}

/* 按钮阴影效果 */
.button_shadow {
  background: var(--white);
  box-shadow: var(--card-shadow);
}

/* 按钮边框效果 */
.button_border {
  border: var(--border-in-light);
}

/* Go 按钮 */
#go {
  padding: 6px 10px;
}

/* 可点击元素通用样式 */
.clickable {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.3s ease;
}

.clickable:hover,
.clickable:active {
  opacity: 0.8;
}

/* ========================================
   14. 表单元素
   ======================================== */

/* 下拉选择框 */
select {
  padding: 10px;
  border: var(--border-in-light);
  border-radius: 10px;
  background-color: var(--white);
  color: var(--black);
  text-align: center;
  cursor: pointer;
  appearance: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 标签 */
label {
  cursor: pointer;
}

/* 输入框基础样式 */
input {
  text-align: center;
  font-family: inherit;
}

/* 复选框和滑块通用样式 */
input[type="checkbox"],
input[type="range"] {
  cursor: pointer;
  border: var(--border-in-light);
  border-radius: 5px;
  background-color: var(--white);
  color: var(--black);
  appearance: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 复选框 */
input[type="checkbox"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* 范围滑块 */
input[type="range"] {
  width: 100%;
  background-color: var(--white);
}

/* 滑块滑块头（多浏览器兼容） */
input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 8px;
  margin-left: 5px;
  border: none;
  border-radius: 10px;
  background-color: var(--primary);
  cursor: pointer;
  appearance: none;
  transition: transform 0.3s ease, width 0.3s ease;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 8px;
  border: none;
  border-radius: 10px;
  background-color: var(--primary);
  cursor: pointer;
  transition: transform 0.3s ease, width 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  width: 24px;
  transform: scaleY(1.2);
}

input[type="range"]::-moz-range-thumb:hover {
  width: 24px;
  transform: scaleY(1.2);
}

/* 密码输入容器 */
.password-input-container {
  display: flex;
  justify-content: flex-end;
  max-width: 50%;
}

.password-input-container .password-eye {
  margin-right: 4px;
}

.password-input-container .password-input {
  min-width: 80%;
}

/* ========================================
   15. 模态框与弹窗
   ======================================== */

/* 模态遮罩层 */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: var(--full-height);
  background-color: rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s ease;
}

/* 模态框容器 */
.ui-lib_modal-container {
  --modal-padding: 20px;
  width: 60vw;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  background-color: var(--white);
  animation: slide-in 0.3s ease;
}

/* 模态框头部 */
.ui-lib_modal-container .ui-lib_modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--modal-padding);
  border-bottom: var(--border-in-light);
}

.ui-lib_modal-container .ui-lib_modal-title {
  font-size: 16px;
  font-weight: bolder;
}

.ui-lib_modal-container .ui-lib_modal-close-btn {
  cursor: pointer;
}

.ui-lib_modal-container .ui-lib_modal-close-btn:hover {
  filter: brightness(1.2);
}

/* 模态框内容 */
.ui-lib_modal-container .ui-lib_modal-content {
  max-height: 40vh;
  padding: var(--modal-padding);
  overflow: auto;
}

/* 模态框底部 */
.ui-lib_modal-container .ui-lib_modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: var(--modal-padding);
  border-top: var(--border-in-light);
  box-shadow: var(--shadow);
}

.ui-lib_modal-container .ui-lib_modal-actions {
  display: flex;
  align-items: center;
}

.ui-lib_modal-container .ui-lib_modal-action:not(:last-child) {
  margin-right: 20px;
}

/* 覆盖层（图片预览等） */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background-color: rgba(0, 0, 0, 0.5);
}

.overlay img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 100%;
  max-height: 100%;
  transform: translate(-50%, -50%);
}

/* 复制按钮（覆盖层内） */
.copy-btn {
  position: absolute;
  bottom: 5%;
  left: 50%;
  padding: 10px 20px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.7);
  color: #333;
  font-size: 16px;
  cursor: pointer;
  transform: translateX(-50%);
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

/* 自定义提示框 */
.custom_alert1 {
  background-color: #fff;
  border-radius: 20px;
  text-align: center;
}

.custom_alert1 .layui-layer-content {
  padding: 6px;
  font-size: 16px;
}

/* Layui 关闭按钮 */
.layui-layer-close {
  width: 35px;
  height: 35px;
  background-color: #ffcccc;
  color: white;
  font-size: 35px;
  line-height: 35px;
}

/* 自定义 Layer 样式 */
.layui-layer-mycustom {
  background: transparent !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  overflow: hidden;
}

.layui-layer-mycustom .content {
  padding: 0 !important;
  border-radius: 8px !important;
}

/* ========================================
   16. 下拉菜单（Layui）
   ======================================== */

.layui-menu li,
.layui-menu-body-title,
.layui-menu-body-title a {
  padding: 5px 15px;
  color: var(--black);
}

.layui-panel {
  margin: 5px 0;
  border: var(--border-in-light);
  border-radius: 6px;
  background-color: var(--white);
  box-sizing: border-box;
}

.layui-menu {
  margin: 5px 0;
  background-color: var(--white);
}

.layui-menu .layui-menu-item-group > .layui-menu-body-title {
  color: var(--black);
}

/* ========================================
   17. 模型列表组件
   ======================================== */

/* 模型列表外层容器 */
.home_prompt-hints {
  display: flex;
  flex-direction: column;
  max-width: 500px;
  height: 50vh;
  margin: 10px;
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  z-index: 10000;
  overflow: hidden;
  will-change: transform;
}

/* 模型列表头部（固定定位） */
.model-list-header {
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
  padding: 16px 0 8px;
  background: var(--white);
  box-shadow: 0 1px 8px rgba(66, 182, 250, 0.08);
  flex-shrink: 0;
  contain: layout paint;
}

/* 按钮容器 */
.model-btns-container {
  position: relative;
  width: 100%;
  padding: 0 8px;
  box-sizing: border-box;
}

/* 横向滚动按钮区 */
.model-btns {
  display: flex;
  gap: 10px;
  padding: 0 2px;
  white-space: nowrap;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  
  /* 隐藏滚动条 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.model-btns::-webkit-scrollbar {
  height: 0;
  display: none;
}

/* 模型分类按钮 */
.model-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--white);
  color: var(--black);
  font-size: 14px;
  font-weight: 500;
  line-height: 32px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  scroll-snap-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: color 0.18s, background 0.18s, box-shadow 0.18s, border-color 0.18s;
  will-change: box-shadow;
}

.model-btn i {
  margin-inline-end: 6px;
  font-size: 18px;
  pointer-events: none;
}

.model-btn i:last-child {
  margin-inline-end: 0;
}

/* 按钮悬停状态 */
.model-btn:not(.active):hover {
  border-color: var(--primary);
  background: var(--hover-color);
  color: var(--primary);
  box-shadow: 0 6px 18px -6px rgba(66, 182, 250, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 按钮激活状态 */
.model-btn.active {
  border-color: var(--primary);
  background: var(--second);
  color: var(--primary);
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(66, 182, 250, 0.14);
}

/* 模型内容滚动区域 */
.model-content-area {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  margin: 3px 0 6px;
  padding: 2px 0;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  animation: fadein 0.18s;
  
  /* 美化滚动条 */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.model-content-area::-webkit-scrollbar {
  width: 6px;
}

.model-content-area::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

/* 模型提示项 */
.home_prompt-hints .home_prompt-hint {
  margin: 4px 12px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--black);
  cursor: pointer;
  transition: border-color 0.22s, background 0.18s, color 0.18s;
}

.home_prompt-hints .home_prompt-hint:hover {
  border-color: var(--primary);
}

/* 模型激活状态 */
.modelactive {
  border-color: var(--primary) !important;
  background: var(--hover-color) !important;
  color: var(--primary) !important;
}

/* 提示项标题和内容 */
.home_prompt-hints .home_prompt-hint .home_hint-title,
.home_prompt-hints .home_prompt-hint .home_hint-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home_prompt-hints .home_prompt-hint .home_hint-title {
  font-size: 13px;
  font-weight: bold;
}

.home_prompt-hints .home_prompt-hint .home_hint-title span {
  white-space: nowrap;
}

/* 模型 Logo、标题、设置 */
.home_prompt-hints .home_prompt-hint .mlogo,
.home_prompt-hints .home_prompt-hint .mtitle,
.home_prompt-hints .home_prompt-hint .msets {
  display: inline-block;
  vertical-align: middle;
}

.home_prompt-hints .mlogo img {
  width: 20px;
  height: 20px;
  margin-right: 3px;
  border-radius: 50%;
  object-fit: cover;
}

.home_prompt-hints .mtitle {
  margin-right: 10px;
  font-size: 13px;
}

.home_prompt-hints .msets {
  color: #d53535;
}

.home_prompt-hints .home_hint-content {
  font-size: 12px;
}

/* 指令和模型按钮图标 */
#model_button .item-content,
#myrole .item-content {
  display: flex;
  align-items: center;
}

#model_button .item-content img,
#myrole .item-content img {
  width: 18px;
  height: 18px;
  margin-right: 3px;
  border-radius: 35%;
  overflow: hidden;
}

/* ========================================
   18. 进度条组件
   ======================================== */

/* 进度条容器 */
.progress {
  position: relative;
  width: 310px;
  height: 25px;
  margin: 0 auto;
  border-radius: 5px;
  background-color: #e9ecef;
  overflow: hidden;
}

/* 进度条填充 */
.progress-bar {
  width: 0%;
  height: 100%;
  background-color: #007bff;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px;
  transition: width 0.3s ease-in-out;
}

/* 进度条百分比文字 */
.progress-percent {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  padding: 0 10px;
  color: #ccc;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateY(-50%);
}

/* 危险状态进度条 */
.progress-bar-danger {
  background-color: #dc3545;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  animation: progress-bar-stripes 1s linear infinite;
}

/* ========================================
   19. 登录面板
   ======================================== */

.login-option {
  display: flex;
  cursor: pointer;
}

.login-option .btn {
  width: 100%;
  height: 50px;
  font-size: 16px;
  line-height: 50px;
  text-align: center;
}

.btn-weixin {
  background-color: rgb(79, 128, 225);
  color: #fff;
}

.btn-email {
  background-color: #fff;
  color: #000;
}

/* ========================================
   20. 充值面板
   ======================================== */

#buypanel {
  height: 100%;
}

/* 产品容器 */
.products-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 80%;
}

/* 单个产品项 */
.product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 85%;
  padding: 10px;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
}

.product:hover {
  background-color: #f5f5f5;
}

.product.selected {
  background-color: #e1f9fe;
}

.product-name {
  width: 30%;
  font-weight: bold;
}

.product-price,
.product-limit,
.product-days {
  margin-right: 10px;
  color: #666;
  font-size: 0.8em;
}

.product-price {
  color: green;
}

/* 支付容器 */
.payment-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20%;
}

.payment-button {
  margin: 5px;
  padding: 5px 10px;
  border: none;
  background-color: #007bff;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

/* ========================================
   21. 悬浮按钮
   ======================================== */

#floating-circle {
  position: fixed;
  right: 80px;
  bottom: 60px;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

#floating-circle:hover {
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#floating-circle i {
  color: #156b80;
  font-size: 24px;
  transition: color 0.3s ease;
}

#floating-circle:hover i {
  color: #555;
}

/* 录音按钮 */
#recordingbutton {
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ========================================
   22. 提示词展开/收起
   ======================================== */

.tishici {
  position: relative;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0.3em 0.5em;
  padding-bottom: 1.8em;
  color: var(--color-fg-default);
  font-size: 1em;
  font-style: italic;
  line-height: 1.6;
  white-space: pre-line;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tishici.expanded {
  -webkit-line-clamp: unset;
}

.tishici::after {
  content: "[展开]";
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 55px;
  padding: 2px 10px;
  border-radius: 15px;
  background-color: #666;
  color: #fff;
  font-size: 0.8em;
  font-style: normal;
  line-height: 1.8em;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s;
}

.tishici::after:hover {
  background-color: #555;
}

.tishici.expanded::after {
  content: "[收起]";
}

/* ========================================
   23. 问题标签
   ======================================== */

.wenti {
  display: inline-block;
  margin: 3px 10px;
  padding: 5px;
  border-radius: 5px;
  background-color: var(--second);
  color: var(--black);
  transition: background-color 0.3s;
}

.wenti:hover {
  background-color: #d0d0d0;
}

.wenti:active {
  background-color: var(--hover-color);
}

/* ========================================
   24. MJ 按钮组
   ======================================== */

.mjbutton {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: auto;
  padding: 15px;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0f8ff, #e6f7ff);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mjbutton button {
  padding: 10px;
  border: none;
  border-radius: 5px;
  background-color: #007bff;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.mjbutton button:hover {
  background-color: #0056b3;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

/* ========================================
   25. 工具类
   ======================================== */

/* 单行文本省略 */
.one-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 用户头像 */
.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: var(--border-in-light);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}

/* 链接样式 */
.link {
  color: var(--primary);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.link:hover {
  color: var(--accent-emphasis);
  text-decoration: underline;
}

/* 错误信息容器 */
.error {
  width: 80%;
  padding: 20px;
  border: var(--border-in-light);
  border-radius: 20px;
  background-color: var(--white);
  color: var(--black);
  box-shadow: var(--card-shadow);
  overflow: auto;
}

.error pre {
  overflow: auto;
}

/* 数学公式溢出处理 */
.math {
  overflow-x: auto;
}

/* 导出内容 */
.home_export-content {
  padding: 10px !important;
  white-space: break-spaces;
}

/* 代码块强制换行 */
pre,
code {
  white-space: pre-wrap !important;
  word-break: break-all !important;
}

/* 代码块复制按钮 */
pre {
  position: relative;
}

pre:hover .copy-code-button {
  opacity: 0.5;
  pointer-events: all;
  transform: translateX(0);
}

.copy-code-button {
  position: absolute;
  top: 1em;
  right: 10px;
  padding: 0 5px;
  border: var(--border-in-light);
  border-radius: 10px;
  background-color: var(--black);
  color: var(--white);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.copy-code-button::after {
  content: "copy";
}

.copy-code-button:hover {
  opacity: 1;
}

/* ========================================
   26. Markdown 渲染样式
   ======================================== */

.markdown-body {
  /* 基础变量 */
  --font-size: 16px;
  --line-height: 1.5;
  --font-weight-semibold: 600;
  --base-text-weight-normal: 400;

  margin: 0;
  color: var(--color-fg-default);
  background-color: var(--color-canvas-default);
  font-size: var(--font-size);
  line-height: var(--line-height);
  word-wrap: break-word;
  text-size-adjust: 100%;
}

/* 清除浮动 */
.markdown-body::before,
.markdown-body::after {
  display: table;
  content: "";
}

.markdown-body::after {
  clear: both;
}

/* 首尾元素边距处理 */
.markdown-body > :first-child {
  margin-top: 0 !important;
}

.markdown-body > :last-child {
  margin-bottom: 0 !important;
}

/* ---- 标题样式 ---- */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 24px 0 16px;
  padding-bottom: 0.3em;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
}

.markdown-body h1 {
  font-size: 2em;
  border-bottom: 1px solid var(--color-border-muted);
}

.markdown-body h2 {
  font-size: 1.5em;
  border-bottom: 1px solid var(--color-border-muted);
}

.markdown-body h3 {
  font-size: 1.25em;
}

.markdown-body h4 {
  font-size: 1em;
}

.markdown-body h5 {
  font-size: 0.875em;
}

.markdown-body h6 {
  font-size: 0.85em;
  color: var(--color-fg-muted);
}

/* 标题内代码 */
.markdown-body h1 code,
.markdown-body h1 tt,
.markdown-body h2 code,
.markdown-body h2 tt,
.markdown-body h3 code,
.markdown-body h3 tt,
.markdown-body h4 code,
.markdown-body h4 tt,
.markdown-body h5 code,
.markdown-body h5 tt,
.markdown-body h6 code,
.markdown-body h6 tt {
  padding: 0 0.2em;
  font-size: inherit;
}

/* 摘要内标题 */
.markdown-body summary h1,
.markdown-body summary h2,
.markdown-body summary h3,
.markdown-body summary h4,
.markdown-body summary h5,
.markdown-body summary h6 {
  display: inline-block;
}

.markdown-body summary h1 .anchor,
.markdown-body summary h2 .anchor,
.markdown-body summary h3 .anchor,
.markdown-body summary h4 .anchor,
.markdown-body summary h5 .anchor,
.markdown-body summary h6 .anchor {
  margin-left: -40px;
}

.markdown-body summary h1,
.markdown-body summary h2 {
  padding-bottom: 0;
  border-bottom: 0;
}

/* ---- 锚点样式 ---- */
.markdown-body .anchor {
  float: left;
  margin-left: -20px;
  padding-right: 4px;
  line-height: 1;
}

.markdown-body .anchor:focus {
  outline: none;
}

.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
  color: var(--color-fg-default);
  vertical-align: middle;
  visibility: hidden;
}

.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
  text-decoration: none;
}

.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
  visibility: visible;
}

/* 标题悬停锚点图标 */
.markdown-body h1:hover .anchor .octicon-link::before,
.markdown-body h2:hover .anchor .octicon-link::before,
.markdown-body h3:hover .anchor .octicon-link::before,
.markdown-body h4:hover .anchor .octicon-link::before,
.markdown-body h5:hover .anchor .octicon-link::before,
.markdown-body h6:hover .anchor .octicon-link::before {
  content: " ";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
  -webkit-mask-image: none;
}

/* ---- 链接样式 ---- */
.markdown-body a {
  color: var(--color-accent-fg);
  text-decoration: none;
  background-color: transparent;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body a:not([href]) {
  color: inherit;
  text-decoration: none;
}

.markdown-body .absent {
  color: var(--color-danger-fg);
}

/* ---- 文本样式 ---- */
.markdown-body abbr[title] {
  border-bottom: none;
  text-decoration: underline dotted;
}

.markdown-body b,
.markdown-body strong {
  font-weight: var(--font-weight-semibold);
}

.markdown-body dfn {
  font-style: italic;
}

.markdown-body mark {
  background-color: var(--color-attention-subtle);
  color: var(--color-fg-default);
}

.markdown-body small {
  font-size: 90%;
}

.markdown-body sub,
.markdown-body sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}

.markdown-body sub {
  bottom: 0.25em;
}

.markdown-body sup {
  top: 0.5em;
}

/* 隐藏元素 */
.markdown-body [hidden] {
  display: none !important;
}

/* ---- 引用块 ---- */
.markdown-body blockquote {
  margin: 0;
  padding: 0 1em;
  color: var(--color-fg-muted);
  border-left: 0.25em solid var(--color-border-default);
}

.markdown-body blockquote > :first-child {
  margin-top: 0;
}

.markdown-body blockquote > :last-child {
  margin-bottom: 0;
}

/* ---- 列表样式 ---- */
.markdown-body ol,
.markdown-body ul {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 2em;
}

.markdown-body ol ol,
.markdown-body ul ol {
  list-style-type: lower-roman;
}

.markdown-body ol ol ol,
.markdown-body ol ul ol,
.markdown-body ul ol ol,
.markdown-body ul ul ol {
  list-style-type: lower-alpha;
}

.markdown-body ol ol,
.markdown-body ol ul,
.markdown-body ul ol,
.markdown-body ul ul {
  margin-top: 0;
  margin-bottom: 0;
}

.markdown-body ol.no-list,
.markdown-body ul.no-list {
  padding: 0;
  list-style-type: none;
}

.markdown-body ol[type="a"] {
  list-style-type: lower-alpha;
}

.markdown-body ol[type="A"] {
  list-style-type: upper-alpha;
}

.markdown-body ol[type="i"] {
  list-style-type: lower-roman;
}

.markdown-body ol[type="I"] {
  list-style-type: upper-roman;
}

.markdown-body div > ol:not([type]),
.markdown-body ol[type="1"] {
  list-style-type: decimal;
}

.markdown-body li {
  list-style-type: decimal;
}

.markdown-body li > p {
  margin-top: 16px;
}

.markdown-body li + li {
  margin-top: 0.25em;
}

/* ---- 定义列表 ---- */
.markdown-body dd {
  margin-left: 0;
}

.markdown-body dl {
  padding: 0;
}

.markdown-body dl dt {
  margin-top: 16px;
  padding: 0;
  font-size: 1em;
  font-style: italic;
  font-weight: var(--font-weight-semibold);
}

.markdown-body dl dd {
  margin-bottom: 16px;
  padding: 0 16px;
}

/* ---- 水平线 ---- */
.markdown-body hr {
  height: 0.25em;
  margin: 24px 0;
  padding: 0;
  border: 0;
  background-color: var(--color-border-default);
  overflow: hidden;
  box-sizing: content-box;
}

.markdown-body hr::before,
.markdown-body hr::after {
  display: table;
  content: "";
}

.markdown-body hr::after {
  clear: both;
}

/* ---- 段落 ---- */
.markdown-body p {
  padding: 3px;
}

/* ---- 块级元素通用边距 ---- */
.markdown-body blockquote,
.markdown-body details,
.markdown-body dl,
.markdown-body ol,
.markdown-body pre,
.markdown-body table,
.markdown-body ul {
  margin-top: 0;
  margin-bottom: 10px;
}

/* ---- 表格样式 ---- */
.markdown-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  overflow: auto;
}

.markdown-body td,
.markdown-body th {
  padding: 0;
}

.markdown-body table th {
  font-weight: var(--font-weight-semibold);
}

.markdown-body table td,
.markdown-body table th {
  padding: 6px 13px;
  border: 1px solid var(--color-border-default);
}

.markdown-body table tr {
  background-color: var(--color-canvas-default);
  border-top: 1px solid var(--color-border-muted);
}

.markdown-body table tr:nth-child(2n) {
  background-color: var(--color-canvas-subtle);
}

.markdown-body table img {
  background-color: transparent;
}

/* ---- 键盘按键 ---- */
.markdown-body kbd {
  display: inline-block;
  padding: 3px 5px;
  border: 1px solid var(--color-neutral-muted);
  border-radius: 6px;
  background-color: var(--color-canvas-subtle);
  color: var(--color-fg-default);
  font: 11px ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 10px;
  vertical-align: middle;
  box-shadow: inset 0 -1px 0 var(--color-neutral-muted);
}

/* ---- 代码样式 ---- */
.markdown-body code,
.markdown-body pre,
.markdown-body samp,
.markdown-body tt {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.markdown-body pre {
  margin-top: 0;
  margin-bottom: 0;
  word-wrap: normal;
}

.markdown-body code,
.markdown-body tt {
  margin: 0;
  padding: 0.2em 0.4em;
  border-radius: 6px;
  background-color: var(--color-neutral-muted);
  font-size: 85%;
  white-space: break-spaces;
}

.markdown-body code br,
.markdown-body tt br {
  display: none;
}

.markdown-body del code {
  text-decoration: inherit;
}

.markdown-body samp {
  font-size: 85%;
}

.markdown-body pre code {
  font-size: 100%;
}

.markdown-body pre > code {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  word-break: normal;
  white-space: pre;
}

/* 高亮代码块 */
.markdown-body .highlight {
  margin-bottom: 16px;
}

.markdown-body .highlight pre {
  margin-bottom: 0;
  word-break: normal;
}

.markdown-body .highlight pre,
.markdown-body pre {
  padding: 16px 16px 8px;
  border-radius: 6px;
  font-size: 85%;
  line-height: 1.45;
  overflow: auto;
}

.markdown-body pre code,
.markdown-body pre tt {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background-color: transparent;
  line-height: inherit;
  word-wrap: normal;
  overflow-x: scroll;
}

/* ---- 详情/摘要元素 ---- */
.markdown-body details,
.markdown-body figcaption,
.markdown-body figure {
  display: block;
}

.markdown-body figure {
  margin: 1em 40px;
}

.markdown-body summary {
  cursor: pointer;
}

.markdown-body details:not([open]) > :not(summary) {
  display: none !important;
}

/* ---- 图片样式 ---- */
.markdown-body img[align="right"] {
  padding-left: 20px;
}

.markdown-body img[align="left"] {
  padding-right: 20px;
}

/* Emoji 样式 */
.markdown-body .emoji {
  max-width: none;
  vertical-align: text-top;
  background-color: transparent;
}

.markdown-body g-emoji {
  display: inline-block;
  min-width: 1ch;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 1em;
  font-style: normal !important;
  font-weight: var(--base-text-weight-normal);
  line-height: 1;
  vertical-align: -0.075em;
}

.markdown-body g-emoji img {
  width: 1em;
  height: 1em;
}

/* ---- 图片框架 ---- */
.markdown-body span.frame {
  display: block;
  overflow: hidden;
}

.markdown-body span.frame > span {
  display: block;
  float: left;
  width: auto;
  margin: 13px 0 0;
  padding: 7px;
  border: 1px solid var(--color-border-default);
  overflow: hidden;
}

.markdown-body span.frame span img {
  display: block;
  float: left;
}

.markdown-body span.frame span span {
  display: block;
  padding: 5px 0 0;
  color: var(--color-fg-default);
  clear: both;
}

/* 居中对齐 */
.markdown-body span.align-center {
  display: block;
  overflow: hidden;
  clear: both;
}

.markdown-body span.align-center > span {
  display: block;
  margin: 13px auto 0;
  overflow: hidden;
  text-align: center;
}

.markdown-body span.align-center span img {
  margin: 0 auto;
  text-align: center;
}

/* 右对齐 */
.markdown-body span.align-right {
  display: block;
  overflow: hidden;
  clear: both;
}

.markdown-body span.align-right > span {
  display: block;
  margin: 13px 0 0;
  overflow: hidden;
  text-align: right;
}

.markdown-body span.align-right span img {
  margin: 0;
  text-align: right;
}

/* 左浮动 */
.markdown-body span.float-left {
  display: block;
  float: left;
  margin-right: 13px;
  overflow: hidden;
}

.markdown-body span.float-left span {
  margin: 13px 0 0;
}

/* 右浮动 */
.markdown-body span.float-right {
  display: block;
  float: right;
  margin-left: 13px;
  overflow: hidden;
}

.markdown-body span.float-right > span {
  display: block;
  margin: 13px auto 0;
  overflow: hidden;
  text-align: right;
}

/* ---- CSV 数据表格 ---- */
.markdown-body .csv-data td,
.markdown-body .csv-data th {
  padding: 5px;
  font-size: 12px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}

.markdown-body .csv-data .blob-num {
  padding: 10px 8px 9px;
  border: 0;
  background: var(--color-canvas-default);
  text-align: right;
}

.markdown-body .csv-data tr {
  border-top: 0;
}

.markdown-body .csv-data th {
  border-top: 0;
  background: var(--color-canvas-subtle);
  font-weight: var(--font-weight-semibold);
}

/* ---- 脚注样式 ---- */
.markdown-body [data-footnote-ref]::before {
  content: "[";
}

.markdown-body [data-footnote-ref]::after {
  content: "]";
}

.markdown-body .footnotes {
  border-top: 1px solid var(--color-border-default);
  color: var(--color-fg-muted);
  font-size: 12px;
}

.markdown-body .footnotes ol {
  padding-left: 16px;
}

.markdown-body .footnotes ol ul {
  display: inline-block;
  margin-top: 16px;
  padding-left: 16px;
}

.markdown-body .footnotes li {
  position: relative;
}

.markdown-body .footnotes li:target::before {
  position: absolute;
  top: -8px;
  right: -8px;
  bottom: -8px;
  left: -24px;
  content: "";
  border: 2px solid var(--color-accent-emphasis);
  border-radius: 6px;
  pointer-events: none;
}

.markdown-body .footnotes li:target {
  color: var(--color-fg-default);
}

.markdown-body .footnotes .data-footnote-backref g-emoji {
  font-family: monospace;
}

/* ---- Octicon 图标 ---- */
.markdown-body .octicon {
  display: inline-block;
  overflow: visible !important;
  vertical-align: text-bottom;
  fill: currentColor;
}

/* ---- 任务列表 ---- */
.markdown-body .task-list-item {
  list-style-type: none;
}

.markdown-body .task-list-item label {
  font-weight: var(--base-text-weight-normal);
}

.markdown-body .task-list-item.enabled label {
  cursor: pointer;
}

.markdown-body .task-list-item + .task-list-item {
  margin-top: 4px;
}

.markdown-body .task-list-item .handle {
  display: none;
}

.markdown-body .task-list-item-checkbox {
  margin: 0 0.2em 0.25em -1.4em;
  vertical-align: middle;
}

.markdown-body .contains-task-list:dir(rtl) .task-list-item-checkbox {
  margin: 0 -1.6em 0.25em 0.2em;
}

.markdown-body .contains-task-list {
  position: relative;
}

.markdown-body .contains-task-list:focus-within .task-list-item-convert-container,
.markdown-body .contains-task-list:hover .task-list-item-convert-container {
  display: block;
  width: auto;
  height: 24px;
  overflow: visible;
  clip: auto;
}

/* ---- 输入框样式 ---- */
.markdown-body input {
  margin: 0;
  font: inherit;
  overflow: visible;
}

.markdown-body input::placeholder {
  color: var(--color-fg-subtle);
  opacity: 1;
}

.markdown-body input[type="button"],
.markdown-body input[type="reset"],
.markdown-body input[type="submit"] {
  -webkit-appearance: button;
}

.markdown-body input[type="checkbox"],
.markdown-body input[type="radio"] {
  padding: 0;
  box-sizing: border-box;
}

.markdown-body input[type="number"]::-webkit-inner-spin-button,
.markdown-body input[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

.markdown-body input[type="search"]::-webkit-search-cancel-button,
.markdown-body input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

.markdown-body input::-webkit-inner-spin-button,
.markdown-body input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

/* ---- 日历选择器 ---- */
.markdown-body ::-webkit-calendar-picker-indicator {
  filter: invert(50%);
}

/* ---- 聚焦样式 ---- */
.markdown-body a:focus,
.markdown-body a:focus-visible,
.markdown-body [role="button"]:focus,
.markdown-body [role="button"]:focus-visible,
.markdown-body input[type="checkbox"]:focus,
.markdown-body input[type="checkbox"]:focus-visible,
.markdown-body input[type="radio"]:focus,
.markdown-body input[type="radio"]:focus-visible {
  outline: 2px solid var(--color-accent-fg);
  outline-offset: -2px;
  box-shadow: none;
}

.markdown-body a:not([class]):focus,
.markdown-body a:not([class]):focus-visible,
.markdown-body [role="button"]:focus,
.markdown-body [role="button"]:focus-visible,
.markdown-body input[type="checkbox"]:focus,
.markdown-body input[type="checkbox"]:focus-visible,
.markdown-body input[type="radio"]:focus,
.markdown-body input[type="radio"]:focus-visible {
  outline-offset: 0;
}

.markdown-body a:focus:not(:focus-visible),
.markdown-body [role="button"]:focus:not(:focus-visible),
.markdown-body input[type="checkbox"]:focus:not(:focus-visible),
.markdown-body input[type="radio"]:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   27. 代码高亮样式（Prettylights）
   ======================================== */

.markdown-body .pl-c {
  color: var(--color-prettylights-syntax-comment);
}

.markdown-body .pl-c1,
.markdown-body .pl-s .pl-v {
  color: var(--color-prettylights-syntax-constant);
}

.markdown-body .pl-e,
.markdown-body .pl-en {
  color: var(--color-prettylights-syntax-entity);
}

.markdown-body .pl-s .pl-s1,
.markdown-body .pl-smi {
  color: var(--color-prettylights-syntax-storage-modifier-import);
}

.markdown-body .pl-ent {
  color: var(--color-prettylights-syntax-entity-tag);
}

.markdown-body .pl-k {
  color: var(--color-prettylights-syntax-keyword);
}

.markdown-body .pl-pds,
.markdown-body .pl-s,
.markdown-body .pl-s .pl-pse .pl-s1,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre {
  color: var(--color-prettylights-syntax-string);
}

.markdown-body .pl-smw,
.markdown-body .pl-v {
  color: var(--color-prettylights-syntax-variable);
}

.markdown-body .pl-bu {
  color: var(--color-prettylights-syntax-brackethighlighter-unmatched);
}

.markdown-body .pl-ii {
  color: var(--color-prettylights-syntax-invalid-illegal-text);
  background-color: var(--color-prettylights-syntax-invalid-illegal-bg);
}

.markdown-body .pl-c2 {
  color: var(--color-prettylights-syntax-carriage-return-text);
  background-color: var(--color-prettylights-syntax-carriage-return-bg);
}

.markdown-body .pl-sr .pl-cce {
  color: var(--color-prettylights-syntax-string-regexp);
  font-weight: 700;
}

.markdown-body .pl-ml {
  color: var(--color-prettylights-syntax-markup-list);
}

.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
  color: var(--color-prettylights-syntax-markup-heading);
  font-weight: 700;
}

.markdown-body .pl-mi {
  color: var(--color-prettylights-syntax-markup-italic);
  font-style: italic;
}

.markdown-body .pl-mb {
  color: var(--color-prettylights-syntax-markup-bold);
  font-weight: 700;
}

.markdown-body .pl-md {
  color: var(--color-prettylights-syntax-markup-deleted-text);
  background-color: var(--color-prettylights-syntax-markup-deleted-bg);
}

.markdown-body .pl-mi1 {
  color: var(--color-prettylights-syntax-markup-inserted-text);
  background-color: var(--color-prettylights-syntax-markup-inserted-bg);
}

.markdown-body .pl-mc {
  color: var(--color-prettylights-syntax-markup-changed-text);
  background-color: var(--color-prettylights-syntax-markup-changed-bg);
}

.markdown-body .pl-mi2 {
  color: var(--color-prettylights-syntax-markup-ignored-text);
  background-color: var(--color-prettylights-syntax-markup-ignored-bg);
}

.markdown-body .pl-mdr {
  color: var(--color-prettylights-syntax-meta-diff-range);
  font-weight: 700;
}

.markdown-body .pl-ba {
  color: var(--color-prettylights-syntax-brackethighlighter-angle);
}

.markdown-body .pl-sg {
  color: var(--color-prettylights-syntax-sublimelinter-gutter-mark);
}

.markdown-body .pl-corl {
  color: var(--color-prettylights-syntax-constant-other-reference-link);
  text-decoration: underline;
}

/* ========================================
   28. 代码高亮样式（HLJS - Tokyo Night）
   ======================================== */

/* 基础代码块样式 */
.markdown-body pre {
  padding: 0;
}

.markdown-body code,
.markdown-body pre {
  font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
}

.markdown-body pre code {
  display: block;
  padding: 1em;
  overflow-x: auto;
}

.markdown-body code {
  padding: 1px 3px;
}

/* HLJS 基础主题 */
.markdown-body .hljs,
.markdown-body pre {
  background: #1a1b26;
  color: #cbd2ea;
}

/* 注释和元信息 */
.markdown-body .hljs-comment,
.markdown-body .hljs-meta {
  color: #565f89;
}

/* 删除、标签、选择器等 */
.markdown-body .hljs-deletion,
.markdown-body .hljs-doctag,
.markdown-body .hljs-regexp,
.markdown-body .hljs-selector-attr,
.markdown-body .hljs-selector-class,
.markdown-body .hljs-selector-id,
.markdown-body .hljs-selector-pseudo,
.markdown-body .hljs-tag,
.markdown-body .hljs-template-tag,
.markdown-body .hljs-variable.language_ {
  color: #f7768e;
}

/* 链接、数字、类型等 */
.markdown-body .hljs-link,
.markdown-body .hljs-literal,
.markdown-body .hljs-number,
.markdown-body .hljs-params,
.markdown-body .hljs-template-variable,
.markdown-body .hljs-type,
.markdown-body .hljs-variable {
  color: #ff9e64;
}

/* 属性和内置函数 */
.markdown-body .hljs-attribute,
.markdown-body .hljs-built_in {
  color: #e0af68;
}

/* 关键字、属性、标题等 */
.markdown-body .hljs-keyword,
.markdown-body .hljs-property,
.markdown-body .hljs-subst,
.markdown-body .hljs-title,
.markdown-body .hljs-title.class_,
.markdown-body .hljs-title.class_.inherited__,
.markdown-body .hljs-title.function_ {
  color: #7dcfff;
}

/* 选择器标签 */
.markdown-body .hljs-selector-tag {
  color: #73daca;
}

/* 添加、符号、字符串等 */
.markdown-body .hljs-addition,
.markdown-body .hljs-bullet,
.markdown-body .hljs-quote,
.markdown-body .hljs-string,
.markdown-body .hljs-symbol {
  color: #9ece6a;
}

/* 代码、公式、章节 */
.markdown-body .hljs-code,
.markdown-body .hljs-formula,
.markdown-body .hljs-section {
  color: #7aa2f7;
}

/* 属性、转义字符、关键字、名称、运算符 */
.markdown-body .hljs-attr,
.markdown-body .hljs-char.escape_,
.markdown-body .hljs-keyword,
.markdown-body .hljs-name,
.markdown-body .hljs-operator {
  color: #bb9af7;
}

/* 标点符号 */
.markdown-body .hljs-punctuation {
  color: #c0caf5;
}

/* 强调样式 */
.markdown-body .hljs-emphasis {
  font-style: italic;
}

.markdown-body .hljs-strong {
  font-weight: 700;
}

/* ========================================
   29. HLJS 默认高亮主题（浅色备用）
   ======================================== */

pre code.hljs {
  display: block;
  padding: 1em;
  overflow-x: auto;
}

code.hljs {
  padding: 1px 3px;
}

.hljs {
  background: #f3f3f3;
  color: #444;
}

.hljs-comment {
  color: #697070;
}

.hljs-punctuation,
.hljs-tag {
  color: rgba(68, 68, 68, 0.667);
}

.hljs-tag .hljs-attr,
.hljs-tag .hljs-name {
  color: #444;
}

.hljs-attribute,
.hljs-doctag,
.hljs-keyword,
.hljs-meta .hljs-keyword,
.hljs-name,
.hljs-selector-tag {
  font-weight: 700;
}

.hljs-deletion,
.hljs-number,
.hljs-quote,
.hljs-selector-class,
.hljs-selector-id,
.hljs-string,
.hljs-template-tag,
.hljs-type {
  color: #800;
}

.hljs-section,
.hljs-title {
  color: #800;
  font-weight: 700;
}

.hljs-link,
.hljs-operator,
.hljs-regexp,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-symbol,
.hljs-template-variable,
.hljs-variable {
  color: #ab5656;
}

.hljs-literal {
  color: #695;
}

.hljs-addition,
.hljs-built_in,
.hljs-bullet,
.hljs-code {
  color: #397300;
}

.hljs-meta {
  color: #1f7199;
}

.hljs-meta .hljs-string {
  color: #38a;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

/* ========================================
   30. 音频播放器样式
   ======================================== */

.audio-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 16px;
  padding: 10px;
  border: var(--border-in-light);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--card-shadow);
  box-sizing: border-box;
  overflow: hidden;
}

.audio-wrapper audio {
  flex: 1;
  height: 45px;
  margin: 0 3px;
  border-radius: 6px;
  background-color: var(--second);
  color: var(--black);
  outline: none;
}

/* Webkit 媒体控件美化 */
.audio-wrapper audio::-webkit-media-controls-panel {
  background-color: var(--second);
  color: var(--black);
}

.audio-wrapper audio::-webkit-media-controls-play-button,
.audio-wrapper audio::-webkit-media-controls-pause-button {
  width: 32px;
  height: 32px;
  margin: 2px;
  border-radius: 50%;
  background-color: var(--primary);
}

.audio-wrapper audio::-webkit-media-controls-timeline,
.audio-wrapper audio::-webkit-media-controls-volume-slider {
  height: 8px;
  margin: 0 auto 10px;
  border-radius: 5px;
  background-color: var(--bar-color);
}

/* ========================================
   31. 图片显示与上传
   ======================================== */

/* 图片上传容器 */
.image-upload-wrapper {
  position: relative;
  padding: 3px;
}

/* 上传进度指示器 */
.upload-progress {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 10px;
  font-weight: bold;
  opacity: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}

.image-upload-wrapper:hover .upload-progress {
  opacity: 1;
}

/* 图片通用样式 */
.markdown-body img,
.markdown-body p img,
.image-upload-wrapper {
  display: inline-block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 5px;
  background-color: var(--color-canvas-default);
  vertical-align: middle;
  box-sizing: border-box;
  transition: transform 0.3s;
}

.markdown-body p img:hover,
.markdown-body p img:active,
.image-upload-wrapper:hover,
.image-upload-wrapper:active {
  cursor: pointer;
  transform: scale(1.1);
}

/* 单图占满宽度 */
.markdown-body p img:first-child:last-child,
.image-upload-wrapper:first-child:last-child {
  display: block;
  width: calc(100% - 10px);
  margin: 5px auto;
}

/* 奇数图片最后一张占满宽度 */
.markdown-body p img:last-child:nth-child(odd),
.image-upload-wrapper:last-child:nth-child(odd) {
  display: block;
  width: calc(100% - 10px);
  margin: 5px auto;
}

/* 偶数图片并排显示 */
.markdown-body p img:nth-child(even),
.markdown-body p img:nth-child(odd):not(:last-child),
.image-upload-wrapper:nth-child(even),
.image-upload-wrapper:nth-child(odd):not(:last-child) {
  display: inline-block;
  width: calc(50% - 10px);
}

/* 图片预览覆盖层 */
.overlay img {
  position: relative;
  max-width: 100%;
  max-height: 100%;
}

/* ========================================
   32. 响应式设计
   ======================================== */

/* ---- 移动端小屏幕 (max-width: 600px) ---- */
@media only screen and (max-width: 600px) {
  :root {
    --window-width: 100vw;
    --window-height: var(--full-height);
    --sidebar-width: 100vw;
    --window-content-width: var(--window-width);
    --message-max-width: 100%;
  }

  body {
    background-color: var(--second);
  }

  .no-mobile {
    display: none;
  }

  .modal-mask {
    align-items: flex-end;
  }

  /* 模型列表适配 */
  .home_prompt-hints {
    max-width: 96vw;
    margin: 4vw 2vw;
  }

  .model-btns {
    gap: 8px;
  }

  .model-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }

  /* 提示词适配 */
  .tishici {
    padding-bottom: 1.6em;
    font-size: 0.9em;
  }

  .tishici::after {
    min-width: 46px;
    padding: 1.2px 8px;
    font-size: 0.9em;
  }

  /* 悬浮按钮适配 */
  #floating-circle {
    right: 25px;
    bottom: 25px;
    width: 30px;
    height: 30px;
  }

  #floating-circle i {
    font-size: 20px;
  }
}

/* ---- 移动端平板 (max-width: 768px) ---- */
@media only screen and (max-width: 768px) {
  .home_container {
    min-height: unset;
    max-height: unset;
    min-width: unset;
    border: none;
    border-radius: 0;
  }

  .home_window-content {
    width: 100% !important;
  }

  .home_sidebar {
    position: absolute;
    left: -100%;
    z-index: 1000;
    height: var(--full-height);
    box-shadow: none;
    transition: all 0.3s ease;
  }

  .home_sidebar-show {
    left: 0;
  }

  .home_mobile,
  .mobilec {
    display: block !important;
  }

  .max_min {
    display: none;
  }

  .home_chat-body {
    padding: 2px 15px 15px;
  }

  .home_chat-input {
    font-size: 12px;
  }

  /* 模态框适配 */
  .ui-lib_modal-container {
    width: 100vw;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .ui-lib_modal-container .ui-lib_modal-content {
    max-height: 50vh;
  }

  /* MJ 按钮适配 */
  .mjbutton {
    gap: 8px;
    padding: 10px;
  }

  .mjbutton button {
    padding: 8px;
    font-size: 14px;
  }
}

/* ---- PC端隐藏移动端元素 (min-width: 769px) ---- */
@media only screen and (min-width: 769px) {
  .home_mobile,
  .mobilec {
    display: none !important;
  }
}

/* ---- 中型屏幕 (769px - 900px) ---- */
@media only screen and (min-width: 769px) and (max-width: 900px) {
  :root {
    --sidebar-width: 220px;
  }

  .home_chat-item-title {
    width: 130px;
    font-size: 13px;
  }

  .button_icon-button-text {
  font-size: 13px;
}

/* 按钮图标 */
.button_icon-button-icon {
  width: 9px;
  height: 9px;
}

 .home_chat-item {
    margin: 0 6px 10px 0;
    padding: 5px ;
  }

}

/* ---- 中型屏幕 (769px - 1024px) ---- */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }

  /* 按钮文本 */
.button_icon-button-text {
  font-size: 14px;
}

/* 按钮图标 */
.button_icon-button-icon {
  width: 10px;
  height: 10px;
}


  .home_chat-item-title {
    width: 150px;
    font-size: 14px;
  }

  .home_sidebar-title {
    font-size: 18px;
  }

  .home_chat-item {
    margin: 0 6px 10px 0;
    padding: 6px 8px;
  }

  .home_sidebar-body {
    padding-right: 4px;
  }

  .home_window-content {
    width: calc(100% - var(--sidebar-width));
  }
  
}

/* ---- 深色模式媒体查询 ---- */
@media (prefers-color-scheme: dark) {
  div:not(.no-dark) > svg {
    filter: invert(0.5);
  }

  /* 音频播放器深色适配 */
  .audio-wrapper {
    background: var(--dark-background);
    border: var(--border-in-dark);
  }

  .audio-wrapper audio::-webkit-media-controls-panel {
    background-color: var(--dark-second);
    color: var(--white);
  }

  .audio-wrapper audio::-webkit-media-controls-current-time-display,
  .audio-wrapper audio::-webkit-media-controls-time-remaining-display {
    color: var(--white);
  }
}


/* 块级公式容器 */
.katex-block {
 overflow-x: auto;
 max-width: 100%;
 padding: 8px 0;
 margin: 4px 0;
 -webkit-overflow-scrolling: touch;
}

.katex-block::-webkit-scrollbar {
 height: 4px;
}

.katex-block::-webkit-scrollbar-thumb {
 background: rgba(0,0,0,0.2);
 border-radius: 2px;
}

.katex-block .katex-display {
 margin: 0;
 overflow-x: visible;
}

/* 行内公式 */
.katex-inline {
 display: inline-block;
 vertical-align: middle;
}


/* ==================== 上传类型选择器样式 ==================== */
.upload-type-selector {
     padding: 10px;
}

.upload-type-option {
     display: flex;
     align-items: center;
     padding: 12px 15px;
     margin: 5px 0;
     border-radius: 8px;
     cursor: pointer;
     transition: all 0.2s ease;
     background: var(--hover);
}

.upload-type-option:hover {
     background: var(--bar-color);
     transform: translateX(5px);
}

.upload-type-option i {
     font-size: 22px;
     margin-right: 12px;
     color: var(--primary);
}

.upload-type-option .type-name {
     flex: 1;
     font-size: 15px;
     font-weight: 500;
}

.upload-type-option .type-limit {
     font-size: 12px;
     color: var(--black-a5);
}


.video-preview,
.audio-preview,
.document-preview {
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     min-width: 100px;
     min-height: 80px;
     padding: 10px;
}

.video-info {
     position: absolute;
     bottom: 5px;
     left: 5px;
     right: 5px;
     display: flex;
     justify-content: space-between;
     font-size: 12px;
     color: #fff;
     text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.audio-filename,
.document-filename {
     font-size: 12px;
     margin-top: 5px;
     color: var(--black-a7);
}