/* 全局布局与变量 */
:root {
  --sidebar-width: 350px;
  --sidebar-min-width: 180px;
  --sidebar-max-width: 600px;
  --dpr-paper-content-max-width: 780px;
  --dpr-paper-content-gap-desktop: 120px;
  --dpr-paper-content-gap-mobile: 36px;
}

/* 全局缩放重置为1 */
html {
  zoom: 1;
}

/* Markdown 正文区域字体放大 */
.markdown-section {
  font-size: 1.1rem !important;
}

/* 禁用 Docsify 原生的标题锚点点击功能（只禁用点击，不隐藏） */
.markdown-section h1 a,
.markdown-section h2 a,
.markdown-section h3 a,
.markdown-section h4 a,
.markdown-section h5 a,
.markdown-section h6 a {
  pointer-events: none;
  cursor: default;
  /* 保持标题样式不变 */
  color: inherit !important;
  text-decoration: none !important;
}

/* 禁用标题本身的锚点跳转 */
.markdown-section h1[id],
.markdown-section h2[id],
.markdown-section h3[id],
.markdown-section h4[id],
.markdown-section h5[id],
.markdown-section h6[id] {
  cursor: default;
}

/* 确保链接和标题颜色正常 - 使用红色（和 Evidence 标签一致） */
.markdown-section a,
.markdown-section a:link,
.markdown-section a:visited {
  color: #e74c3c !important;
}
.markdown-section a:hover {
  color: #c0392b !important;
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section h5,
.markdown-section h6 {
  color: #e74c3c !important;
}

/* 确保正文文字颜色正常 */
.markdown-section,
.markdown-section p,
.markdown-section div,
.markdown-section span,
.markdown-section li,
.markdown-section td,
.markdown-section th {
  color: #34495e !important;
}

/* 链接文字颜色保护 */
.markdown-section a,
.markdown-section a *,
.markdown-section a span {
  color: #e74c3c !important;
}

/* Markdown 正文中所有段落的行高 */
.markdown-section p,
.markdown-section > .dpr-page-content > p {
  line-height: 1.8 !important;
}

/* 首页公告栏：浅蓝色双波浪边框卡片 */
.markdown-section .dpr-home-notice-card {
  position: relative;
  margin: 6px 0 10px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  border: 1px solid #b7dcff;
  background: linear-gradient(180deg, #f7fcff 0%, #edf7ff 100%);
  box-shadow: 0 4px 14px rgba(102, 170, 232, 0.14);
  overflow: hidden;
}

.markdown-section .dpr-home-notice-card::before,
.markdown-section .dpr-home-notice-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  opacity: 0.75;
  background-image:
    radial-gradient(circle at 8px 12px, transparent 8px, #9bcfff 8.8px, #9bcfff 9.6px, transparent 10.4px),
    radial-gradient(circle at 20px 12px, transparent 8px, #c3e4ff 8.8px, #c3e4ff 9.6px, transparent 10.4px);
  background-size: 24px 14px, 24px 14px;
  background-repeat: repeat-x;
}

.markdown-section .dpr-home-notice-card::before {
  top: 0;
}

.markdown-section .dpr-home-notice-card::after {
  bottom: 0;
  transform: rotate(180deg);
}

.markdown-section .dpr-home-notice-title {
  margin: 0 0 8px !important;
  color: #2f7ebf !important;
  font-size: 1.03rem !important;
  font-weight: 700;
}

.markdown-section .dpr-home-notice-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.markdown-section .dpr-home-notice-list li {
  margin: 5px 0;
  color: #2e5f87 !important;
}

.markdown-section .dpr-home-notice-list a {
  color: #1d78c1 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 首页宣传栏：浅紫色双波浪边框卡片 */
.markdown-section .dpr-home-promo-card {
  position: relative;
  margin: 10px 0 6px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  border: 1px solid #d9c7ff;
  background: linear-gradient(180deg, #fcf8ff 0%, #f5eeff 100%);
  box-shadow: 0 4px 14px rgba(154, 126, 210, 0.16);
  overflow: hidden;
}

.markdown-section .dpr-home-promo-card::before,
.markdown-section .dpr-home-promo-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  opacity: 0.78;
  background-image:
    radial-gradient(circle at 8px 12px, transparent 8px, #c8a9ff 8.8px, #c8a9ff 9.6px, transparent 10.4px),
    radial-gradient(circle at 20px 12px, transparent 8px, #e1ccff 8.8px, #e1ccff 9.6px, transparent 10.4px);
  background-size: 24px 14px, 24px 14px;
  background-repeat: repeat-x;
}

.markdown-section .dpr-home-promo-card::before {
  top: 0;
}

.markdown-section .dpr-home-promo-card::after {
  bottom: 0;
  transform: rotate(180deg);
}

.markdown-section .dpr-home-promo-title {
  margin: 0 0 8px !important;
  color: #7a4ec6 !important;
  font-size: 1.03rem !important;
  font-weight: 700;
}

.markdown-section .dpr-home-promo-list {
  margin: 0;
  padding-left: 18px;
}

.markdown-section .dpr-home-promo-list li {
  margin: 6px 0;
  color: #5d438b !important;
}

/* 侧边栏字体放大 */
.sidebar {
  font-size: 1.1rem !important;
  line-height: 1.6 !important;
}

/* 聊天区域字体放大 */
#paper-chat-container {
  font-size: 1.1rem !important;
  line-height: 1.6 !important;
}

/* 论文页标题区域字体放大 */
.paper-title-row h1 {
  font-size: 1.1rem !important;
  line-height: 1.6 !important;
}
.paper-title-zh,
.paper-title-en {
  font-size: 1.5rem !important;
  line-height: 1.6 !important;
}

/* 论文页元数据区域（Evidence/Authors等）字体放大 */
.paper-meta-left,
.paper-meta-right {
  font-size: 1.0rem !important;
  line-height: 1.6 !important;
}
.paper-meta-left p,
.paper-meta-right p {
  font-size: 1.0rem !important;
  line-height: 1.6 !important;
}

/* 论文页速览区域字体放大 */
.paper-glance-section {
  font-size: 1.0rem !important;
  line-height: 1.6 !important;
}
.paper-glance-title {
  font-size: 1.0rem !important;
  line-height: 1.6 !important;
}
.paper-glance-label {
  font-size: 1.0rem !important;
  line-height: 1.6 !important;
}
.paper-glance-content {
  font-size: 1.0rem !important;
  line-height: 1.6 !important;
}
.paper-glance-tldr {
  font-size: 1.0rem !important;
  line-height: 1.6 !important;
}

.katex .katex-mathml {
  display: none !important;
}

/* 公共研讨区容器 */
#paper-chat-container {
  margin-top: 40px;
  padding-top: 10px;
  border-top: 1px solid #eaecef;
  background: transparent;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  width: min(var(--dpr-paper-content-max-width), 100%);
  max-width: var(--dpr-paper-content-max-width);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* 消息列表 */
#chat-history {
  flex: 0 0 auto;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-bottom: 16px;
  border: none;
}

/* 去掉历史区域专门的滚动条样式，使用正文默认样式 */
.msg-item {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

/* AI 思考动画图标 */
.ai-thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  vertical-align: middle;
}
.ai-thinking-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  animation: ai-thinking-pulse 1.4s ease-in-out infinite;
}
.ai-thinking-indicator .dot:nth-child(1) {
  animation-delay: 0s;
}
.ai-thinking-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}
.ai-thinking-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ai-thinking-pulse {
  0%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 用户与 AI 消息对话布局 */
.msg-content {
  margin-top: 4px;
  line-height: 1.6;
  color: #34495e;
}
.msg-content sup {
  vertical-align: super;
  font-size: 0.75em;
}

/* AI 回复中的段落和公式间距优化 */
.msg-content-ai p {
  margin: 0.5em 0;
}
.msg-content-ai p:first-child {
  margin-top: 0;
}
.msg-content-ai p:last-child {
  margin-bottom: 0;
}

/* KaTeX 公式在聊天区域的样式优化 */
.msg-content .katex-display {
  margin: 0.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.msg-content .katex-display > .katex {
  white-space: nowrap;
}

/* 用户消息：右侧灰色圆角气泡 */
.msg-content-user {
  align-self: flex-end;
  max-width: 70%;
  padding: 4px 10px;
  border-radius: 14px;
  border-top-right-radius: 4px;
  background-color: rgb(233, 238, 246);
  color: #444;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg-content-user p {
  margin: 0;
}

/* 大模型回答：左侧直接按正文展示，不加气泡背景 */
.msg-content-ai {
  align-self: flex-start;
  max-width: 100%;
}

/* 隐藏常规角色标签，仅在“思考过程”里使用 */
.msg-role {
  font-size: 0.9rem;
}
.msg-role.user,
.msg-role.ai {
  display: none;
}

/* 历史记录中的思考过程容器样式 */
.thinking-history-container {
  margin-top: 8px;
  border-left: 3px solid #ddd;
  padding-left: 8px;
  font-size: 0.85rem;
  color: #666;
}
.thinking-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.thinking-history-toggle {
  margin-left: 8px;
  font-size: 0.7rem;
  padding: 3px 10px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.5);
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
.thinking-history-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.2);
  color: rgba(0, 0, 0, 0.7);
}
.thinking-history-toggle:active {
  background: rgba(0, 0, 0, 0.12);
}
.thinking-history-content.thinking-collapsed {
  max-height: 6em;
  overflow: hidden;
}
.msg-time {
  font-size: 0.75rem;
  color: #aaa;
  display: block;
  margin-bottom: 4px;
}
.msg-time.msg-time-user {
  text-align: right;
}
.msg-time.msg-time-ai {
  text-align: left;
}

/* 私人研讨区输入区域：仿 Gemini 浮动输入框，固定在页面底部 */
#paper-chat-container {
  position: relative;
  background: transparent; /* 聊天区背景透明，融入页面 */
  padding-bottom: 120px; /* 为浮动输入框预留空间 */
}

/* 纯白遮罩：从输入框顶部到页面底部 */
#paper-chat-container::before {
  content: '';
  position: fixed;
  left: var(--sidebar-width, 260px);
  right: 0;
  bottom: 0;
  height: 135px; /* 覆盖输入框及其下方区域 */
  background: #ffffff;
  z-index: 1498;
  pointer-events: none;
  /* 与正文区域一起在侧边栏开合时平滑移动，避免瞬间跳变露出文字 */
  transition: left 0.25s ease-out;
}

/* 渐变遮罩：在输入框上方向上延展40px */
#paper-chat-container::after {
  content: '';
  position: fixed;
  left: var(--sidebar-width, 260px);
  right: 0;
  bottom: 135px; /* 从纯白遮罩顶部开始 */
  height: 40px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
  z-index: 1498;
  transition: left 0.25s ease-out;
}

/* 当侧边栏收起（body.close）时，底部白色遮罩也从屏幕最左侧开始覆盖，避免留出未遮罩区域 */
body.close #paper-chat-container::before,
body.close #paper-chat-container::after {
  left: 0;
}

/* 大屏幕下：在左侧 sidebar 底部增加一条纯白遮罩带，
   避免论文列表文字出现在底部按钮所在的行 */
@media (min-width: 1024px) {
  .sidebar::after {
    content: '';
    position: fixed;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width, 260px);
    height: 48px;
    background: #ffffff;
    pointer-events: none;
    z-index: 1500;
  }
}

#paper-chat-container .input-area {
  position: fixed;
  /* 相对于文档内容区域居中：排除侧边栏宽度 */
  left: calc(
    var(--sidebar-width, 260px) +
    (100% - var(--sidebar-width, 260px)) / 2
  );
  /* 强制限制：左边界不能小于侧边栏右边界 */
  min-width: 300px;
  bottom: 24px;
  max-width: min(var(--dpr-paper-content-max-width), calc(100% - var(--sidebar-width, 260px) - 40px));
  width: min(var(--dpr-paper-content-max-width), calc(100% - var(--dpr-paper-content-gap-desktop)));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  margin-top: 0;
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 8px 32px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1500;
  box-sizing: border-box;
  /* 默认用于 sidebar 展开/收起时的平滑过渡 */
  transition: left 0.25s ease-out, transform 0.25s ease-out,
    max-width 0.25s ease-out;
  transform: translateX(-50%);
  overflow: hidden; /* 遮住内部内容的左右和下边，配合圆角 */
}

/* 输入框获得焦点时的效果 */
#paper-chat-container .input-area:focus-within {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 8px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(66, 185, 131, 0.3);
}

/* 当侧边栏收起（body.close）时，输入框改为整个视口居中 */
body.close #paper-chat-container .input-area {
  left: 50%;
}

/* 工作流触发面板 */
#dpr-workflow-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  z-index: 10050;
  opacity: 0;
  transition: opacity 0.16s ease-out;
}

#dpr-workflow-overlay.show {
  opacity: 1;
}

#dpr-workflow-panel {
  width: min(880px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 24px));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#dpr-workflow-header {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

#dpr-workflow-body {
  flex: 1;
  padding: 10px 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

#dpr-workflow-status {
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#dpr-workflow-status.is-waiting::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(21, 101, 192, 0.22);
  animation: dpr-workflow-status-pulse 1.25s ease-out infinite;
}

#dpr-workflow-status.is-waiting::after {
  content: "";
  width: 24px;
  height: 6px;
  flex: 0 0 24px;
  border-radius: 999px;
  background:
    radial-gradient(circle, currentColor 0 58%, transparent 62%) 0 50% / 6px 6px no-repeat,
    radial-gradient(circle, currentColor 0 58%, transparent 62%) 50% 50% / 6px 6px no-repeat,
    radial-gradient(circle, currentColor 0 58%, transparent 62%) 100% 50% / 6px 6px no-repeat;
  opacity: 0.45;
  animation: dpr-workflow-status-dots 1s ease-in-out infinite;
}

@keyframes dpr-workflow-status-pulse {
  0% {
    transform: scale(0.88);
    box-shadow: 0 0 0 0 rgba(21, 101, 192, 0.22);
    opacity: 0.72;
  }
  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(21, 101, 192, 0);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(21, 101, 192, 0);
    opacity: 0.76;
  }
}

@keyframes dpr-workflow-status-dots {
  0%,
  100% {
    opacity: 0.38;
    transform: translateX(0);
  }
  50% {
    opacity: 0.92;
    transform: translateX(2px);
  }
}

.dpr-wf-card {
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

/* 最近运行列表 */
.dpr-wf-recent-block {
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
  margin-top: 8px;
}
.dpr-wf-recent-block:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.dpr-wf-recent-block-title {
  font-weight: 600;
  color: #555;
  font-size: 12px;
  margin-bottom: 6px;
}

.dpr-wf-recent-item {
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.dpr-wf-recent-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.dpr-wf-recent-item.is-active {
  background: rgba(0, 0, 0, 0.08);
}

.dpr-wf-recent-item:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

#dpr-workflow-recent.is-loading {
  opacity: 0.75;
}

#dpr-workflow-recent.is-loading::after {
  content: "刷新中…";
  display: block;
  margin-top: 6px;
  color: #999;
  font-size: 11px;
}

.dpr-wf-recent-item:focus-visible {
  outline: 2px solid rgba(23, 162, 184, 0.35);
  outline-offset: 2px;
}

.dpr-wf-recent-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dpr-wf-recent-badge {
  font-weight: 600;
  font-size: 12px;
}

.dpr-wf-recent-time {
  color: #888;
  font-size: 11px;
  white-space: nowrap;
}

.dpr-wf-recent-sub {
  margin-top: 2px;
  color: #777;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dpr-wf-job {
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
  margin-top: 8px;
}

.dpr-wf-job-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.dpr-wf-job-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.dpr-wf-job-meta-text {
  color: #666;
  font-size: 12px;
}

.dpr-wf-substeps {
  border: 1px dashed #eee;
  border-radius: 8px;
  background: #fafafa;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.dpr-wf-substep-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 12px;
  color: #555;
}

.dpr-wf-substep-line {
  color: #555;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dpr-wf-steps {
  color: #333;
}

.dpr-wf-step {
  color: #555;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 侧边栏宽度拖拽时：禁用底部遮罩/输入框的 left 动画，让拖拽更跟手 */
body.sidebar-resizing #paper-chat-container::before,
body.sidebar-resizing #paper-chat-container::after,
body.sidebar-resizing #paper-chat-container .input-area,
body.sidebar-resizing .sidebar::after {
  transition: none !important;
}

/* 侧边栏论文条目：整行可点击 + 标题/链接/评分与标签同行展示 */
.sidebar-nav .dpr-sidebar-item-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  margin: 2px 0;
  border-radius: 8px;
  text-decoration: none !important;
  color: inherit;
  background: transparent;
}

/* hover/active 的底色统一由"整行"控制，避免出现只包住文字的小矩形 */
/* 移除 a 标签的 hover 背景，避免与整行背景冲突 */
.sidebar-nav li:hover > a.dpr-sidebar-item-link,
.sidebar-nav li.active > a.dpr-sidebar-item-link,
.sidebar-nav a.dpr-sidebar-item-link.active {
  background: transparent !important;
}

.sidebar-nav .dpr-sidebar-title {
  display: block;
  line-height: 1.25;
}

.sidebar-nav .dpr-sidebar-link-line {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.2;
  color: #3c3c3c;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sidebar-nav li.sidebar-paper-item:hover .dpr-sidebar-link-line,
.sidebar-nav li.sidebar-paper-item.active .dpr-sidebar-link-line,
.sidebar-nav li.sidebar-paper-item > a.active .dpr-sidebar-link-line,
.sidebar-nav li.active > a .dpr-sidebar-link-line {
  color: #3c3c3c;
}

.sidebar-nav .dpr-sidebar-score-empty {
  font-size: 11px;
  color: #999;
}

/* 让高亮底色覆盖到整行（包含 li 自带的内边距区域） */
.sidebar-nav li > a.dpr-sidebar-item-link {
  margin-left: -10px;
  margin-right: -10px;
}

.sidebar-nav .dpr-sidebar-meta-line {
  margin-top: 2px;
  min-height: 16px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 6px;
}

.sidebar-nav .dpr-sidebar-meta-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  overflow: hidden;
}

.sidebar-nav .dpr-sidebar-tags {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sidebar-nav .dpr-sidebar-tag {
  display: inline-block;
  font-size: 11px;
  line-height: 1.4;
  padding: 2px 6px;
  border-radius: 4px;
  background: transparent;
  color: #777;
}

/* 关键词标签：冷灰/蓝灰（与浅蓝/浅紫区分，且避免绿/青） */
.sidebar-nav .dpr-sidebar-tag-keyword {
  /* 稍微偏米色的冷灰（greige），避免偏黄过暖 */
  background-color: #f5f3ef;
  color: #3b3a36;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

/* 查询标签 - 蓝色背景 + 深蓝文字 */
.sidebar-nav .dpr-sidebar-tag-query {
  background-color: #e3f2fd;
  color: #1565c0;
  border-radius: 4px;
}

/* 论文标签 - 紫色背景 + 深紫文字 */
.sidebar-nav .dpr-sidebar-tag-paper {
  background-color: #f5f0ff;
  color: #5a2bb8;
  border-radius: 4px;
}

.sidebar-nav .dpr-sidebar-tag-other {
  background: rgba(0, 0, 0, 0.06);
  color: #555;
  border-radius: 4px;
}

/* 评分星星标签：5 星占位，支持半星 */
.sidebar-nav .dpr-sidebar-tag-score {
  background: transparent;
  color: #b26a00;
}

.sidebar-nav .dpr-sidebar-tag-score .dpr-stars {
  position: relative;
  display: inline-block;
  line-height: 1;
  /* 减少字符间距，避免“闪/眼花” */
  letter-spacing: 0.1px;
  vertical-align: middle;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-nav .dpr-sidebar-tag-score .dpr-stars-bg {
  /* 空星使用“☆”轮廓字符：更清晰，不依赖灰度差异 */
  color: rgba(0, 0, 0, 0.55);
}

.sidebar-nav .dpr-sidebar-tag-score .dpr-stars-fill {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #f5b301;
}

#paper-chat-container #user-input {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: 0;
  resize: none;
  background: transparent;
  max-height: 160px;
  min-height: 24px;
  line-height: 1.6;
  font-size: 15px;
  overflow-y: auto;
  color: #1f1f1f;
}
#paper-chat-container #user-input:focus {
  outline: none;
}

#paper-chat-container #send-btn {
  padding: 0 20px;
  height: 36px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

#paper-chat-container #send-btn:not(:disabled):hover {
  background: #3ba876;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(66, 185, 131, 0.3);
}

/* 聊天：最近提问按钮 + 面板（仅本机 localStorage） */
#paper-chat-container .chat-questions-toggle-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  color: rgba(0, 0, 0, 0.72);
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}
#paper-chat-container .chat-questions-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

#paper-chat-container .chat-questions-panel {
  position: fixed;
  left: calc(
    var(--sidebar-width, 260px) +
    (100% - var(--sidebar-width, 260px)) / 2
  );
  transform: translateX(-50%);
  bottom: 76px; /* 在 input-area（bottom:24px）之上 */
  max-width: min(var(--dpr-paper-content-max-width), calc(100% - var(--sidebar-width, 260px) - 40px));
  width: min(var(--dpr-paper-content-max-width), calc(100% - var(--dpr-paper-content-gap-desktop)));
  max-height: 46vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 10px 10px 12px;
  z-index: 1502;
  box-sizing: border-box;
}
body.close #paper-chat-container .chat-questions-panel {
  left: 50%;
}

#paper-chat-container .chat-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 8px;
}
#paper-chat-container .chat-q-title {
  font-weight: 600;
  color: rgba(0, 0, 0, 0.78);
}
#paper-chat-container .chat-q-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  color: rgba(0, 0, 0, 0.55);
}
#paper-chat-container .chat-q-close:hover {
  color: rgba(0, 0, 0, 0.78);
}

#paper-chat-container .chat-q-section {
  margin-top: 8px;
}
#paper-chat-container .chat-q-section-title {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
  margin: 6px 2px;
}
#paper-chat-container .chat-q-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#paper-chat-container .chat-q-empty {
  color: rgba(0, 0, 0, 0.45);
  font-size: 12px;
  padding: 6px 4px;
}
#paper-chat-container .chat-q-item {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
#paper-chat-container .chat-q-use {
  flex: 1;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.78);
}
#paper-chat-container .chat-q-use:hover {
  background: rgba(0, 0, 0, 0.05);
}
#paper-chat-container .chat-q-pin {
  width: 40px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  cursor: pointer;
}
#paper-chat-container .chat-q-pin:hover {
  background: rgba(0, 0, 0, 0.05);
}
#paper-chat-container .chat-q-item.is-pinned .chat-q-use {
  background: rgba(62, 175, 124, 0.08);
  border-color: rgba(62, 175, 124, 0.18);
}

/* 输入框滚动条样式与关键词面板一致，隐藏上下小三角 */
#paper-chat-container #user-input {
  scrollbar-width: thin;
  scrollbar-color: #c7c1b8 #ece7df;
}
#paper-chat-container #user-input::-webkit-scrollbar {
  width: 6px;
}
#paper-chat-container #user-input::-webkit-scrollbar-track {
  background: #f5f3ef;
  border-radius: 3px;
}
#paper-chat-container #user-input::-webkit-scrollbar-thumb {
  background: #c7c1b8;
  border-radius: 3px;
}
#paper-chat-container #user-input::-webkit-scrollbar-thumb:hover {
  background: #b1aba2;
}
#paper-chat-container #user-input::-webkit-scrollbar-button {
  height: 0;
  display: none;
}
#send-btn {
  padding: 0 20px;
  background: #42b983;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
#send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 聊天区底部工具条与设置面板 */
.chat-footer {
  position: fixed;
  left: calc(
    var(--sidebar-width, 260px) +
    (100% - var(--sidebar-width, 260px)) / 2
  );
  bottom: 36px;
  transform: translateX(calc(-50% + 5px));
  max-width: min(var(--dpr-paper-content-max-width), calc(100% - var(--sidebar-width, 260px) - 40px));
  width: min(var(--dpr-paper-content-max-width), calc(100% - var(--dpr-paper-content-gap-desktop)));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #666;
  z-index: 1501;
  transition: left 0.25s ease-out, transform 0.25s ease-out,
    max-width 0.25s ease-out;
}

/* 当正在拖拽侧边栏或调整窗口尺寸时，禁用过渡，让布局“跟手” */
body.sidebar-resizing #paper-chat-container .input-area,
body.sidebar-resizing .chat-footer,
body.dpr-resizing #paper-chat-container .input-area,
body.dpr-resizing .chat-footer,
body.sidebar-resizing .content,
body.dpr-resizing .content {
  transition: none !important;
}

/* 侧边栏收起时footer也居中 */
body.close .chat-footer {
  left: 50%;
}
.chat-footer #chat-llm-model-select {
  padding: 6px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  background: rgba(248, 249, 250, 0.9);
  backdrop-filter: blur(8px);
  font-size: 12px;
  color: #5f6368;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
}

.chat-footer #chat-llm-model-select:hover {
  background: rgba(232, 234, 237, 0.95);
  border-color: rgba(0, 0, 0, 0.12);
}

.chat-footer #chat-llm-model-select:focus {
  outline: none;
  border-color: rgba(66, 185, 131, 0.4);
  background: rgba(255, 255, 255, 0.95);
}

/* 聊天区底部的侧边栏开关与后台管理按钮（仅在小屏幕下显示） */
.chat-footer-controls {
  display: none; /* 默认宽屏不显示，改在侧边栏下方显示 */
  align-items: center;
  gap: 4px;
  position: relative;
}

.chat-footer-icon-btn {
  width: 25px;
  height: 25px;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  color: #888;
  border-radius: 4px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.chat-footer-icon-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.chat-quick-run-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.chat-quick-run-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.chat-quick-run-modal-panel {
  width: min(720px, 90vw);
  max-height: 85vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease-out;
}

.chat-quick-run-modal.is-open .chat-quick-run-modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.chat-quick-run-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eceff5;
}

.chat-quick-run-title {
  margin: 0;
  font-size: 14px;
  color: #2f4069;
  font-weight: 600;
}

.chat-quick-run-close-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #d9d9d9;
  background: #f7f8fb;
  color: #666;
  border-radius: 4px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.chat-quick-run-divider {
  height: 1px;
  background: #eceff5;
  margin: 6px 0 12px;
}

.chat-quick-run-close-btn:hover {
  background: #e5e9f2;
}

.chat-quick-run-item {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e3e6ed;
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
}

.chat-quick-run-item:hover {
  background: #f4f8ff;
  border-color: #cfe0ff;
}

.chat-quick-run-item--disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: #e3e6ed;
  background: #f7f8fb;
}

.chat-quick-run-item--disabled:hover {
  background: #f7f8fb;
  border-color: #e3e6ed;
}

.chat-quick-run-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.chat-quick-run-row label {
  font-size: 11px;
  color: #666;
}

.chat-quick-run-modal select,
.chat-quick-run-run-btn {
  width: 100%;
  box-sizing: border-box;
  border-radius: 7px;
  border: 1px solid #d8dee9;
  padding: 6px 8px;
  font-size: 12px;
  background: #fff;
}

.chat-quick-run-run-btn {
  margin-top: 2px;
}

.chat-quick-run-run-btn:hover {
  background: #f4f8ff;
}

.chat-quick-run-msg {
  margin-top: 4px;
  min-height: 14px;
  font-size: 11px;
  color: #999;
}

@media (max-width: 1023px) {
  .chat-footer-controls {
    display: flex;
  }
  .chat-footer-icon-btn {
    display: flex;
  }
  #chat-quick-run-btn {
    display: none !important;
  }
  /* 小屏时隐藏左下角固定的图标，只保留聊天区里的两个按钮 */
  .custom-toggle-btn,
  .sidebar-toggle {
    display: none;
  }
  .chat-footer {
    justify-content: flex-start;
    gap: 4px;
    padding-left: 5px;
  }
  .chat-model-select {
    margin-left: 0;
  }
}

.chat-settings-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #f8f8f8;
  cursor: pointer;
}
.chat-settings-btn:hover {
  background: #f0f0f0;
}
.chat-model-select {
  margin-left: 8px;
  font-size: 12px;
  padding: 3px 6px;
}
.chat-status {
  margin-left: 8px;
  font-size: 12px;
  color: #888;
}
.chat-settings-panel {
  margin-top: 8px;
  padding: 8px;
  border-radius: 4px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  font-size: 12px;
}
.chat-settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.chat-settings-row label {
  flex: 0 0 64px;
  text-align: right;
}
.chat-settings-row input,
.chat-settings-row select {
  flex: 1;
  padding: 4px 6px;
  font-size: 12px;
}
.chat-settings-inline-status {
  flex: 0 0 auto;
  font-size: 11px;
  color: #999;
}
.chat-settings-actions {
  text-align: right;
  margin-top: 4px;
}
.chat-settings-actions button {
  padding: 4px 10px;
  font-size: 12px;
  margin-left: 6px;
}
.chat-settings-hint {
  margin-top: 4px;
  font-size: 11px;
  color: #999;
}

/* 首次进入时的密钥解锁遮罩与对话框 */
.secret-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease-out;
  pointer-events: none;
}
.secret-gate-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.secret-gate-hidden {
  display: none;
}
.secret-gate-modal {
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  padding: 16px 18px 14px 18px;
  box-sizing: border-box;
  transform: scale(0.96) translateY(12px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease-out;
}
.secret-gate-overlay.show .secret-gate-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.secret-gate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.secret-gate-btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
  background: #fff;
}
.secret-gate-btn.primary {
  background: #3b8eed;
  border-color: #3b8eed;
  color: #fff;
}
.secret-gate-btn.primary:disabled,
.secret-gate-btn.secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.secret-gate-btn.secondary {
  background: #f8f8f8;
}

/* 初始化配置向导中的模型价格提示小气泡 */
.secret-model-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid #999;
  font-size: 11px;
  line-height: 16px;
  color: #666;
  cursor: default;
  position: relative;
}
.secret-model-tip-popup {
  display: none;
  position: absolute;
  top: 120%;
  left: 0;
  z-index: 2100;
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  max-width: 280px;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.secret-model-tip:hover .secret-model-tip-popup {
  display: block;
}

/* 覆盖 Docsify 主题默认的中间滚动容器，只保留最外层页面滚动 */
.content {
  height: auto !important;
  overflow: visible !important;
  left: 0 !important;
  margin-left: var(--sidebar-width, 260px) !important;
  padding-left: 0 !important;
  display: flex !important;
  justify-content: center !important;
  /* 默认在 sidebar 展开/收起（body.close 切换）时做轻微过渡 */
  transition: margin-left 0.25s ease-out !important;
}

body.close .content {
  margin-left: 0 !important;
}

body.close #sidebar-resizer {
  display: none !important;
}

.markdown-section {
  max-width: 900px !important;
  width: 100% !important;
  /* 增加底部留白：让页面滚动到底时内容刚好停在浮动聊天框上方，包含渐变区域 */
  padding: 30px 60px 200px 60px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

/* 微宽屏/窄屏：正文左右留白收紧，避免内容区域过窄 */
@media (max-width: 1023px) {
  .markdown-section {
    padding: 22px 18px 200px 18px !important;
  }
}

/* 论文页标题条：英文右侧、中文左侧，中间竖线，整体高度约 3 行 */
body.dpr-paper-page .dpr-title-bar {
  display: flex;
  align-items: stretch;
  gap: 14px;
  padding: 10px 12px;
  margin: 0 0 10px 0;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fff;
  height: 96px; /* 固定高度：约 3 行（受 line-height 影响） */
  overflow: hidden;
}

body.dpr-paper-page .dpr-title-cn,
body.dpr-paper-page .dpr-title-en {
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.22;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

body.dpr-paper-page .dpr-title-cn {
  text-align: left;
  font-weight: 600;
  color: #1f1f1f;
  order: 0;
}

body.dpr-paper-page .dpr-title-en {
  text-align: left;
  font-weight: 600;
  color: #1f1f1f;
  order: 2;
}

body.dpr-paper-page .dpr-title-sep {
  width: 1px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 1px;
  order: 1;
}

/* 只有一个标题时：占满左侧，右侧隐藏 */
body.dpr-paper-page .dpr-title-bar.dpr-title-single .dpr-title-sep,
body.dpr-paper-page .dpr-title-bar.dpr-title-single .dpr-title-en {
  display: none;
}

/* 极窄屏：标题条改为上下布局，减少"卡片里只剩一条窄列"的观感 */
@media (max-width: 767px) {
  body.dpr-paper-page .dpr-title-bar {
    height: auto;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
  }

  body.dpr-paper-page .dpr-title-sep {
    display: none;
  }

  body.dpr-paper-page .dpr-title-cn,
  body.dpr-paper-page .dpr-title-en {
    flex: none !important;  /* 取消 flex: 1 1 0，避免高度塌陷 */
    -webkit-line-clamp: 4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* 隐藏原始 h1（保留在 DOM 中供解析/复制兜底），避免重复显示 */
body.dpr-paper-page .markdown-section h1.dpr-title-hidden {
  position: absolute;
  left: -99999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

/* 论文页“整页切换”动效：左右滑动/方向键切换时，正文区域做轻量滑入滑出 */
body.dpr-paper-page .markdown-section .dpr-page-content {
  position: relative;
  /* 让动效前后字体观感一致（避免 subpixel ↔ grayscale 的切换感） */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  /* 固定在合成层：尽量避免“动画时/静止后”字体栅格化策略不同导致的观感变化 */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-exit,
body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-enter {
  will-change: transform, opacity;
}

/* 退场：当前页淡出 + 向左右微移 */
body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-exit {
  transition: transform var(--dpr-transition-ms, 320ms) ease-out,
    opacity var(--dpr-transition-ms, 320ms) ease-out;
  opacity: 0;
}
body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-exit.dpr-page-exit-left {
  transform: translate3d(-36px, 0, 0);
}
body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-exit.dpr-page-exit-right {
  transform: translate3d(36px, 0, 0);
}

/* 入场：新页从左右微移位置淡入，active 时过渡到静止态 */
body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-enter {
  transition: none;
  opacity: 0;
}
body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-enter.enter-from-left {
  transform: translate3d(-36px, 0, 0);
}
body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-enter.enter-from-right {
  transform: translate3d(36px, 0, 0);
}
body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-enter.dpr-page-enter-active {
  transition: transform var(--dpr-transition-ms, 320ms)
      cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity var(--dpr-transition-ms, 320ms) cubic-bezier(0.2, 0.9, 0.2, 1);
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-exit,
  body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-enter,
  body.dpr-paper-page .markdown-section .dpr-page-content.dpr-page-enter.dpr-page-enter-active {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* 兼容 Docsify vue 主题对 `.markdown-section > *` 的样式（引入 dpr-page-content 包装层后需要补回） */
.markdown-section > .dpr-page-content > * {
  box-sizing: border-box;
  font-size: inherit;
}
.markdown-section > .dpr-page-content > :first-child {
  margin-top: 0 !important;
}
/* 避免主题的 `.markdown-section>:not(h1..h6) code` 误作用到包装层，先还原，再按原规则应用到包装层的直接子元素 */
.markdown-section > .dpr-page-content code {
  font-size: inherit;
}
.markdown-section > .dpr-page-content > :not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) code {
  font-size: 0.8rem;
}

article.markdown-section {
  max-width: 900px !important;
  width: 100% !important;
  padding: 30px 60px 200px 60px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

/* 移动端布局适配：在小屏幕下让内容区域占满宽度，并简化左右留白，
   同时将浮动聊天输入框与底部工具条改为相对视口居中，不改变 Docsify 自带的侧边栏开合行为 */
@media (max-width: 1023px) {
  .content {
    margin-left: 0 !important;
    padding-left: 0 !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  /* 小屏：减少横向"整页滑动/回退"动效带来的干扰 */
  html,
  body {
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    /* 移动端体验：不展示滚动条（仍可滚动），避免 F12/窄屏下总有"横/竖条"干扰视觉 */
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .markdown-section,
  article.markdown-section {
    max-width: 100% !important;
    padding: 16px 16px 160px 16px !important;
    margin: 0 !important;
    width: 100% !important;
    overflow-x: hidden;
  }

  /* 小屏：正文里长公式/表格/代码块容易触发"整页横向溢出"，统一做兜底约束 */
  article.markdown-section img,
  article.markdown-section video,
  article.markdown-section canvas,
  article.markdown-section svg {
    max-width: 100%;
    height: auto;
  }

  article.markdown-section pre,
  article.markdown-section code {
    max-width: 100%;
  }

  article.markdown-section pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  article.markdown-section table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* KaTeX 展示公式：超宽时允许块内横向滚动，避免把整页撑宽 */
  article.markdown-section .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  #paper-chat-container {
    padding-bottom: 140px;
  }

  #paper-chat-container::before {
    left: 0;
    height: 120px;
  }

  #paper-chat-container::after {
    left: 0;
    bottom: 120px;
  }

  #paper-chat-container .input-area {
    left: 50%;
    width: calc(100% - var(--dpr-paper-content-gap-mobile));
    max-width: calc(100% - var(--dpr-paper-content-gap-mobile));
    min-width: 0;
  }

  #paper-chat-container .chat-questions-panel {
    left: 50%;
    width: calc(100% - var(--dpr-paper-content-gap-mobile));
    max-width: calc(100% - var(--dpr-paper-content-gap-mobile));
  }

  .chat-footer {
    left: 50%;
    width: calc(100% - var(--dpr-paper-content-gap-mobile));
    max-width: calc(100% - var(--dpr-paper-content-gap-mobile));
  }
}

/* 小屏幕下：展开侧边栏时占满全屏宽度，便于专注浏览论文列表 */
@media (max-width: 1023px) {
  .sidebar {
    left: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    transform: translateX(-100%) !important;
    overflow-x: hidden !important;
    scrollbar-width: none;
  }

  body.close .sidebar {
    transform: translateX(0) !important;
  }

  /* 窄屏/微宽屏统一为“侧边栏覆盖正文”的行为：正文不再为 sidebar 预留 margin */
  .content {
    margin-left: 0 !important;
  }

  .sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .sidebar-nav,
  .sidebar-nav ul {
    overflow-x: hidden !important;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar,
  .sidebar-nav ul::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  /* 移动端取消"负 margin 撑满整行"的技巧，避免超出视口导致横向滚动条 */
  .sidebar-nav li > a.dpr-sidebar-item-link {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* 极窄屏（<768px）：覆盖 Docsify vue.css 默认的 768px 断点，保持与 768-1023px 一致的行为
   注意：Docsify 在 <768px 时逻辑是反转的（body.close = sidebar 显示），需要强制覆盖 */
@media screen and (max-width: 767px) {
  /* 覆盖 Docsify 给 body 设置的 padding-left */
  body,
  body.close,
  body.ready {
    padding-left: 0 !important;
    margin-left: 0 !important;
  }

  main {
    padding-left: 0 !important;
    margin-left: 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  /* sidebar 默认展开时全屏覆盖 */
  .sidebar {
    left: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    transform: translateX(-100%) !important;
    transition: transform 0.25s ease-out !important;
  }

  /* body.close 时 sidebar 展开（向右覆盖） */
  body.close .sidebar {
    transform: translateX(0) !important;
  }

  /* 内容区始终从左边缘开始，覆盖 Docsify 的反转逻辑 */
  .content,
  section.content,
  body .content,
  body.close .content,
  body.ready .content,
  body.close section.content,
  body.ready section.content {
    margin-left: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
    transform: none !important;
  }
}

/* 侧边栏宽度可调 */
.sidebar {
  width: var(--sidebar-width, 260px) !important;
  min-width: var(--sidebar-min-width, 180px);
  max-width: var(--sidebar-max-width, 480px);
}

/* 侧边栏字体：让中英文在同一套字体栈里更协调 */
.sidebar,
.sidebar .sidebar-nav,
.sidebar .sidebar-nav a,
.sidebar .sidebar-day-toggle-label,
.sidebar .dpr-sidebar-title,
.sidebar .dpr-sidebar-tags,
.sidebar .dpr-sidebar-tag {
  font-family: var(
    --dpr-sidebar-font,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    "Noto Sans SC",
    Arial,
    sans-serif
  );
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 标题稍微收紧字重，避免中文显得“粗一号” */
.sidebar .dpr-sidebar-title {
  font-weight: 500;
}

/* 大屏下：收起侧边栏时按当前实际宽度整块滑出视口，避免拖宽后仍残留一条 */
@media (min-width: 1024px) {
  body.close .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width, 260px))) !important;
  }
}

/* 侧边栏按日期折叠：日期行样式与箭头 */
.sidebar-day-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.sidebar-day-toggle-label {
  font-weight: 500;
}
.sidebar-day-toggle-arrow {
  font-size: 12px;
  margin-left: 6px;
  opacity: 0;        /* 隐藏小三角但保留占位，避免布局抖动 */
  pointer-events: none;
}

/* 日期操作按钮 */
.sidebar-day-toggle-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.sidebar-day-toggle:hover .sidebar-day-toggle-actions,
.sidebar-day-toggle-actions:hover {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-day-menu-trigger {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.65);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.sidebar-day-menu-trigger:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.25);
}

.sidebar-day-menu {
  position: absolute;
  top: 24px;
  right: 0;
  min-width: 112px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 4px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 120ms ease-out,
    transform 120ms ease-out;
}

.sidebar-day-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sidebar-day-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 9px;
  border-radius: 6px;
  text-align: left;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.8);
}

.sidebar-day-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sidebar-day-menu-item-delete {
  color: rgba(207, 19, 34, 0.95);
}

.sidebar-day-menu-item-delete:hover {
  background: rgba(207, 19, 34, 0.08);
}

.sidebar-day-menu-item[disabled],
.sidebar-day-menu-item-locked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-day-menu-item[disabled]:hover,
.sidebar-day-menu-item-locked:hover {
  background: transparent;
}

/* 日期分组展开/收起动效：由 JS 动态设置 max-height，这里负责过渡效果 */
.sidebar-day-content {
  overflow: hidden;
  max-height: none;
  opacity: 1;
  transition: max-height 240ms ease, opacity 160ms ease;
  will-change: max-height, opacity;
}
.sidebar-day-collapsed > .sidebar-day-content {
  opacity: 0;
}

/* 评价为“好”的论文（浅绿色文字，保持白底，仅文字变色） */
.sidebar-nav li.sidebar-paper-good {
  background-color: transparent;
  border-radius: 20px;
}
.sidebar-nav li.sidebar-paper-good > a {
  color: #73d13d; /* 更浅的绿色 */
}

/* 评价为"一般"的论文（浅红色文字，保持白底，仅文字变色） */
.sidebar-nav li.sidebar-paper-bad {
  background-color: transparent;
  border-radius: 20px;
}
.sidebar-nav li.sidebar-paper-bad > a {
  color: #ff7875; /* 浅红色 */
}

/* 侧边栏交互状态：去掉下划线，悬停时仅在当前行右侧显示绿色小条 */
.sidebar-nav li > a {
  text-decoration: none;
}
.sidebar-nav li > a:hover {
  background-color: transparent;
}

/* 当前页面所在行：仅通过淡蓝色椭圆背景高亮，不再使用右侧绿色细边 */
.sidebar-nav li.sidebar-paper-item {
  display: flex;
  align-items: center;
  border-right: none;
  --paper-item-text-end-pad: 0px;
  /* 统一行内边距与外边距，确保圆角背景完整填充整行 */
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 4px;
  padding-bottom: 4px;
  /* 为椭圆背景预留左右内边距，避免文字紧贴边缘 */
  padding-left: 22px;
  padding-right: 20px;
  background-color: transparent; /* 背景统一用伪元素/滑动高亮层，便于控制层级 */
}

/* 悬停和选中时，文字区域收窄，为书签按钮腾出空间 */
.sidebar-nav li.sidebar-paper-item:hover > a,
.sidebar-nav li.sidebar-paper-item.active > a {
  max-width: calc(100% - 26px);
}

/* hover 底色改为伪元素：让"滑动高亮层"可以盖住 hover（层级更深） */
.sidebar-nav li.sidebar-paper-item::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: #f5f5f5; /* hover：浅灰 */
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 120ms ease-out;
}

/* good/bad 的 hover：用更明显的浅绿/浅红（比默认灰稍深一点） */
.sidebar-nav li.sidebar-paper-item.sidebar-paper-good::before {
  opacity: 1;
  background-color: rgba(76, 175, 80, 0.09);
}
.sidebar-nav li.sidebar-paper-item.sidebar-paper-bad::before {
  opacity: 1;
  background-color: rgba(244, 67, 54, 0.08);
}
.sidebar-nav li.sidebar-paper-item.sidebar-paper-blue::before {
  opacity: 1;
  background-color: rgba(64, 169, 255, 0.09);
}
.sidebar-nav li.sidebar-paper-item.sidebar-paper-orange::before {
  opacity: 1;
  background-color: rgba(138, 99, 210, 0.08);
}
.sidebar-nav li.sidebar-paper-item.sidebar-paper-good:hover::before {
  background-color: rgba(76, 175, 80, 0.16);
}
.sidebar-nav li.sidebar-paper-item.sidebar-paper-bad:hover::before {
  background-color: rgba(244, 67, 54, 0.14);
}
.sidebar-nav li.sidebar-paper-item.sidebar-paper-blue:hover::before {
  background-color: rgba(64, 169, 255, 0.15);
}
.sidebar-nav li.sidebar-paper-item.sidebar-paper-orange:hover::before {
  background-color: rgba(138, 99, 210, 0.14);
}

/* 选中态滑动高亮层：一个元素在 sidebar 内平滑移动，覆盖整行 */
.sidebar-nav {
  position: relative;
}
.sidebar-nav .dpr-sidebar-active-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 20px;
  background-color: #f0f0f0; /* 选中：深一点的灰色 */
  pointer-events: none;
  z-index: 0; /* 放在内容之下，避免遮住文字/标签 */
  transform: translate3d(0, 0, 0);
  transition: transform var(--dpr-transition-ms, 320ms) ease-out,
    height var(--dpr-transition-ms, 320ms) ease-out,
    width var(--dpr-transition-ms, 320ms) ease-out;
}

/* 选中态：如果该条目已打勾/打叉，则选中底色改为浅绿/浅红 */
.sidebar-nav .dpr-sidebar-active-indicator.is-good {
  /* 选中态：使用原“未选中”绿色 */
  background-color: rgba(76, 175, 80, 0.13);
}
.sidebar-nav .dpr-sidebar-active-indicator.is-bad {
  /* 选中态：略浅一点 */
  background-color: rgba(244, 67, 54, 0.09);
}
.sidebar-nav .dpr-sidebar-active-indicator.is-blue {
  background-color: rgba(64, 169, 255, 0.12);
}
.sidebar-nav .dpr-sidebar-active-indicator.is-orange {
  background-color: rgba(138, 99, 210, 0.11);
}

.sidebar-nav li.sidebar-paper-item {
  position: relative;
  z-index: 2; /* 高于 indicator/hover 背景 */
}

/* 确保文字/图标始终在 hover 浅灰层之上（避免被 ::before 盖住） */
.sidebar-nav li.sidebar-paper-item > a {
  position: relative;
  z-index: 3;
}
.sidebar-nav li.sidebar-paper-item .sidebar-paper-rating-icons {
  z-index: 3;
}

/* 进一步兜底：标题/标签也强制在“滑动高亮层”之上，避免被遮罩盖住 */
.sidebar-nav li.sidebar-paper-item .dpr-sidebar-title,
.sidebar-nav li.sidebar-paper-item .dpr-sidebar-tags,
.sidebar-nav li.sidebar-paper-item .dpr-sidebar-tag {
  position: relative;
  z-index: 3;
}
.sidebar-nav li.sidebar-paper-item > a {
  text-decoration: none;
  display: block;
  flex: 1 1 auto;          /* 占据剩余空间 */
  min-width: 0;            /* 允许收缩以触发省略号 */
  overflow: hidden;
  text-overflow: ellipsis; /* 文本过长时省略 */
  white-space: nowrap;
  margin-left: 0;
  margin-right: 0;
  padding-right: var(--paper-item-text-end-pad, 0px);
}
/* 悬停：浅灰色圆角背景（作用在整行 li 上） */
.sidebar-nav li.sidebar-paper-item:hover {
  border-right: none;
}
.sidebar-nav li.sidebar-paper-item:hover::before {
  opacity: 1;
}
/* 正在阅读：加粗文字 + 更深的灰色圆角背景（作用在整行 li 上） */
.sidebar-nav li.sidebar-paper-item.active {
  border-right: none;
  background-color: transparent; /* 选中底色由滑动高亮层提供 */
  border-radius: 20px;
}
.sidebar-nav li.sidebar-paper-item.active:hover {
  /* active 项 hover 时，浅灰 hover 仍会出现，但会被深灰滑动层覆盖 */
}
.sidebar-nav li.sidebar-paper-item.active > a {
  font-weight: 600;
}
.sidebar-nav li.sidebar-paper-item.active .dpr-sidebar-title {
  font-weight: 700;
}

/* 覆盖 Docsify 默认样式：鼠标移到侧边栏链接上不出现下划线 */
.sidebar-nav a:hover {
  text-decoration: none;
}

/* 选中链接时字体颜色保持与原始状态一致（包括好/一般的自定义颜色） */
.sidebar-nav a.active,
.sidebar-nav a.router-link-active,
.sidebar-nav li.active > a {
  color: inherit !important;
  border-right: none !important; /* 移除 Docsify 主题默认的右侧彩色竖线 */
}

/* 对“不错 / 一般”评价的条目，选中时仍保持各自的绿色 / 粉色 */
.sidebar-nav li.sidebar-paper-good > a {
  color: #73d13d !important; /* 未选中：更浅的绿色 */
}
.sidebar-nav li.sidebar-paper-good.active > a,
.sidebar-nav li.sidebar-paper-good > a.active,
.sidebar-nav li.sidebar-paper-good > a.router-link-active {
  color: #2e7d32 !important; /* 选中：略深一些，兼顾对比度与柔和 */
}
.sidebar-nav li.sidebar-paper-bad > a,
.sidebar-nav li.sidebar-paper-bad.active > a,
.sidebar-nav li.sidebar-paper-bad > a.active,
.sidebar-nav li.sidebar-paper-bad > a.router-link-active {
  color: #ff7875 !important;
}

.sidebar-nav li.sidebar-paper-blue > a {
  color: #69c0ff !important; /* 未选中：淡蓝 */
}
.sidebar-nav li.sidebar-paper-blue.active > a,
.sidebar-nav li.sidebar-paper-blue > a.active,
.sidebar-nav li.sidebar-paper-blue > a.router-link-active {
  color: #096dd9 !important; /* 选中：深蓝 */
}
.sidebar-nav li.sidebar-paper-orange > a {
  color: #9d7cd8 !important; /* 未选中：淡紫 */
}
.sidebar-nav li.sidebar-paper-orange.active > a,
.sidebar-nav li.sidebar-paper-orange > a.active,
.sidebar-nav li.sidebar-paper-orange > a.router-link-active {
  color: #7c3aed !important; /* 选中：深紫 */
}


/* 全局确保侧边栏链接在 hover 时不出现下划线 */
.sidebar-nav a,
.sidebar-nav a:hover {
  text-decoration: none !important;
}

/* 已阅读/评价论文的整行（含行间距）都使用灰底：
   通过去掉上下 margin、改用 padding，并适当扩展 a 的左右范围。 */
.sidebar-nav li.sidebar-paper-read,
.sidebar-nav li.sidebar-paper-good,
.sidebar-nav li.sidebar-paper-bad,
.sidebar-nav li.sidebar-paper-blue,
.sidebar-nav li.sidebar-paper-orange {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 4px;
  padding-bottom: 4px;
}
.sidebar-nav li.sidebar-paper-read > a,
.sidebar-nav li.sidebar-paper-good > a,
.sidebar-nav li.sidebar-paper-bad > a,
.sidebar-nav li.sidebar-paper-blue > a,
.sidebar-nav li.sidebar-paper-orange > a {
  display: block;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
}

/* 未阅读论文：标题右侧显示淡蓝色小圆点提示
   条件：是具体论文条目（sidebar-paper-item），且没有 read/good/bad 状态）。
   使用 li 的绝对定位伪元素，避免标题过长时小圆点被文本挤出视口。 */
.sidebar-nav li.sidebar-paper-item:not(.sidebar-paper-read):not(.sidebar-paper-good):not(.sidebar-paper-bad):not(.sidebar-paper-blue):not(.sidebar-paper-orange) {
  position: relative;
}
.sidebar-nav li.sidebar-paper-item:not(.sidebar-paper-read):not(.sidebar-paper-good):not(.sidebar-paper-bad):not(.sidebar-paper-blue):not(.sidebar-paper-orange)::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #91d5ff; /* 淡蓝色 */
}

/* 侧边栏内"书签标记"按钮容器：悬停时显示在选项右侧，2x2排列 */
.sidebar-paper-rating-icons {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: repeat(2, 12px);
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-out;
  padding: 3px;
  z-index: 10;
  border-radius: 4px;
}

/* 悬停时显示 */
.sidebar-nav li.sidebar-paper-item:hover .sidebar-paper-rating-icons {
  opacity: 1;
  pointer-events: auto;
}

/* 当前选中项：书签按钮常驻显示 */
.sidebar-nav li.sidebar-paper-item.active .sidebar-paper-rating-icons {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-paper-rating-icon {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background-color: rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}

/* 分享按钮 */
.sidebar-paper-share-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}
.sidebar-paper-share-icon:hover {
  background: rgba(0, 0, 0, 0.06);
}
.sidebar-paper-share-icon:disabled {
  opacity: 0.6;
  cursor: default;
}

/* 左侧按钮容器（分享） */
.sidebar-paper-left-actions {
  position: absolute;
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-out;
  padding: 1px;
  z-index: 10;
}

/* 悬停时显示左侧按钮 */
.sidebar-nav li.sidebar-paper-item:hover .sidebar-paper-left-actions {
  opacity: 1;
  pointer-events: auto;
}

/* 当前选中项：左侧按钮常驻显示 */
.sidebar-nav li.sidebar-paper-item.active .sidebar-paper-left-actions {
  opacity: 1;
  pointer-events: auto;
}

/* 收藏按钮（星星）- 暂时隐藏 */
.sidebar-paper-favorite-icon {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}
.sidebar-paper-favorite-icon:hover {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.7);
}
.sidebar-paper-favorite-icon.active {
  background: rgba(255, 193, 7, 0.2);
  border-color: rgba(255, 193, 7, 0.6);
  color: #f5a623;
}

/* Gist 分享弹窗 */
#dpr-gist-share-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  z-index: 10060;
}
#dpr-gist-share-overlay.show {
  display: flex;
}
.dpr-gist-share-modal {
  width: min(720px, calc(100vw - 24px));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  padding: 14px 14px 12px;
}
.dpr-gist-share-title {
  font-weight: 600;
  margin-bottom: 10px;
}
.dpr-gist-share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dpr-gist-share-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}
.dpr-gist-share-copy {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
  cursor: pointer;
}
.dpr-gist-share-copy:hover {
  background: rgba(0, 0, 0, 0.06);
}
.dpr-gist-share-hint {
  margin-top: 8px;
  color: rgba(0, 0, 0, 0.6);
  font-size: 12px;
  word-break: break-word;
}

/* 绿色书签 */
.sidebar-paper-rating-icon.good {
  border-color: rgba(82, 196, 26, 0.35);
  background-color: rgba(82, 196, 26, 0.15);
}

/* 红色书签 */
.sidebar-paper-rating-icon.bad {
  border-color: rgba(245, 34, 45, 0.35);
  background-color: rgba(245, 34, 45, 0.15);
}

/* Hover 状态：鼠标悬停时的浅色背景 */
.sidebar-paper-rating-icon.good:hover {
  background-color: rgba(82, 196, 26, 0.35);
}

.sidebar-paper-rating-icon.bad:hover {
  background-color: rgba(245, 34, 45, 0.35);
}

/* 激活状态：前景/背景颜色对调 */
.sidebar-paper-rating-icon.good.active {
  background-color: rgba(82, 196, 26, 0.75);
  border-color: rgba(82, 196, 26, 0.85);
}

.sidebar-paper-rating-icon.bad.active {
  background-color: rgba(245, 34, 45, 0.55);
  border-color: rgba(245, 34, 45, 0.65);
}

/* 蓝色书签 */
.sidebar-paper-rating-icon.blue {
  border-color: rgba(24, 144, 255, 0.35);
  background-color: rgba(24, 144, 255, 0.15);
}
.sidebar-paper-rating-icon.blue:hover {
  background-color: rgba(24, 144, 255, 0.35);
}
.sidebar-paper-rating-icon.blue.active {
  background-color: rgba(24, 144, 255, 0.75);
  border-color: rgba(24, 144, 255, 0.85);
}

/* 橙色书签 */
.sidebar-paper-rating-icon.orange {
  border-color: rgba(138, 99, 210, 0.35);
  background-color: rgba(138, 99, 210, 0.15);
}
.sidebar-paper-rating-icon.orange:hover {
  background-color: rgba(138, 99, 210, 0.35);
}
.sidebar-paper-rating-icon.orange.active {
  background-color: rgba(138, 99, 210, 0.75);
  border-color: rgba(138, 99, 210, 0.85);
}

/* 论文详情页标题区域的评价按钮 */
.paper-rating-buttons {
  margin-left: 8px;
  display: inline-flex;
  gap: 4px;
}
.paper-rating-btn {
  border: none;
  border-radius: 4px;
  padding: 2px 10px;
  min-width: 52px;
  height: 26px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.2;
  box-sizing: border-box;
}
.paper-rating-btn.good {
  background-color: #f6ffed; /* 浅绿色 */
  color: #73d13d;            /* 绿色 */
}
.paper-rating-btn.bad {
  background-color: #fff2f0; /* 浅红色 */
  color: #ff7875;            /* 浅红色 */
}
.paper-rating-btn.active {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}


/* 侧边栏拖拽句柄 */
#sidebar-resizer {
  position: fixed;
  top: 0;
  left: calc(var(--sidebar-width, 260px) - 2px);
  width: 4px;
  height: 100vh;
  cursor: col-resize;
  background: transparent;
  z-index: 999;
}
#sidebar-resizer::after {
  content: "";
  position: absolute;
  left: 1px;
  top: 0;
  bottom: 0;
  width: 0;
  background: transparent;
}

@media (max-width: 1023px) {
  #sidebar-resizer {
    display: none;
  }
}

/* 自定义按钮样式 - 紧挨着 sidebar-toggle（左下角） */
.custom-toggle-btn {
  position: fixed;
  bottom: 2px;
  left: 40px;
  width: 40px;
  height: 40px;
  padding: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.custom-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

/* 确保 Docsify 自带的 sidebar 折叠按钮在聊天浮层之上可见（尤其是小屏幕） */
.sidebar-toggle {
  z-index: 1600;
  /* 缩小默认点击区域，去掉大片白底条 */
  width: 40px !important;
  height: 40px;
  padding: 4px;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 20px;
  color: #888; /* 稍微浅一点的灰色 */
  transition: background-color 0.2s ease, transform 0.1s ease;
}

/* 隐藏 Docsify 默认的三条横线 */
.sidebar-toggle-button span {
  display: none;
}

/* 使用 emoji 显示三横图标 */
.sidebar-toggle::before {
  content: '☰';
  line-height: 1;
}

.sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  transform: translateY(-1px);
}

/* 窄屏下（无论侧边栏是否展开），缩小左下角菜单按钮和齿轮按钮尺寸 */
@media (max-width: 1023px) {
  .sidebar-toggle {
    width: 22px !important;
    height: 22px;
    left: 2px;
    bottom: 1px;
    padding: 0;
    font-size: 12px;
  }

  .custom-toggle-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    bottom: 2px;
    left: 24px;
    font-size: 12px;
  }
}

/* 小屏下彻底隐藏左下角最初的两个全局按钮，只保留聊天区里的两个按钮 */
@media (max-width: 1023px) {
  .sidebar-toggle,
  .custom-toggle-btn {
    display: none !important;
  }
}

/* 首页 / 日报页没有聊天区时，恢复底部悬浮入口，避免小屏无导航入口 */
@media (max-width: 1023px) {
  body.dpr-landing-page .sidebar-toggle,
  body.dpr-landing-page .custom-toggle-btn {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    width: 42px !important;
    height: 42px;
    padding: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(12px);
    color: #5f6368;
    font-size: 17px;
    z-index: 1700;
  }

  body.dpr-landing-page .sidebar-toggle {
    left: calc(env(safe-area-inset-left, 0px) + 14px);
  }

  body.dpr-landing-page .custom-toggle-btn {
    left: calc(env(safe-area-inset-left, 0px) + 64px);
  }

  body.dpr-landing-page .sidebar-toggle:hover,
  body.dpr-landing-page .custom-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.98) !important;
  }
}

/* 模态框内按钮样式 */
.arxiv-tool-btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  color: #333;
}
.arxiv-tool-btn:hover {
  background: #f2f2f2;
}

/* Arxiv 搜索全屏浮层 */
#arxiv-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease-out;
}
#arxiv-search-overlay.show {
  opacity: 1;
}
#arxiv-search-panel {
  width: min(980px, 95vw);
  max-height: 85vh;
  zoom: 1.2;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s ease-out;
}

#arxiv-search-panel-body {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 0;
}

#arxiv-search-panel-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#arxiv-search-quick-run-divider {
  width: 1px;
  margin: 0 12px;
  background: #eceff5;
  flex-shrink: 0;
}

#arxiv-search-quick-run-side {
  width: 270px;
  flex: 0 0 270px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#arxiv-search-quick-run-side .chat-quick-run-item,
#arxiv-search-quick-run-side .chat-quick-run-run-btn,
#arxiv-search-quick-run-side .chat-quick-run-row label,
#arxiv-search-quick-run-side .chat-quick-run-row select,
#arxiv-search-quick-run-side .chat-quick-run-title {
  box-sizing: border-box;
}

#arxiv-search-quick-run-side .chat-quick-run-row select,
#arxiv-search-quick-run-side .chat-quick-run-run-btn,
#arxiv-search-quick-run-side .chat-quick-run-item {
  width: 100%;
}

#arxiv-search-quick-run-side .chat-quick-run-item {
  margin-bottom: 0;
}

#arxiv-search-overlay.show #arxiv-search-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  #arxiv-search-panel {
    width: min(95vw, 720px);
  }

  #arxiv-search-panel-body {
    flex-direction: column;
  }

  #arxiv-search-quick-run-divider {
    width: 100%;
    height: 1px;
    margin: 12px 0;
  }

  #arxiv-search-quick-run-side {
    width: 100%;
    flex-basis: auto;
  }

  #arxiv-search-panel {
    zoom: 1;
  }
}

#arxiv-search-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
#arxiv-search-input {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 14px;
  box-sizing: border-box;
}
#arxiv-search-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
}
#arxiv-search-results {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 37.5vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid #eee;
  margin-top: 8px;
  padding-top: 8px;
  padding-right: 8px;
}

/* 美化滚动条样式 - 紫色区域（订阅/新引用） */
#arxiv-search-results::-webkit-scrollbar {
  width: 8px;
}
#arxiv-search-results::-webkit-scrollbar-track {
  background: #f5f0ff;
  border-radius: 4px;
}
#arxiv-search-results::-webkit-scrollbar-thumb {
  background: #e0d4ff;
  border-radius: 4px;
}
#arxiv-search-results::-webkit-scrollbar-thumb:hover {
  background: #c9b8ff;
}

/* 美化滚动条样式 - 绿色区域（关键词） */
#arxiv-keywords-list::-webkit-scrollbar {
  width: 6px;
}
#arxiv-keywords-list::-webkit-scrollbar-track {
  background: #f5f3ef;
  border-radius: 3px;
}
#arxiv-keywords-list::-webkit-scrollbar-thumb {
  background: #c7c1b8;
  border-radius: 3px;
}
#arxiv-keywords-list::-webkit-scrollbar-thumb:hover {
  background: #b1aba2;
}

/* 美化滚动条样式 - 蓝色区域（Zotero） */
#zotero-list::-webkit-scrollbar {
  width: 6px;
}
#zotero-list::-webkit-scrollbar-track {
  background: #e3f2fd;
  border-radius: 3px;
}
#zotero-list::-webkit-scrollbar-thumb {
  background: #90caf9;
  border-radius: 3px;
}
#zotero-list::-webkit-scrollbar-thumb:hover {
  background: #64b5f6;
}

/* 美化滚动条样式 - 跟踪论文列表 */
#arxiv-tracked-list::-webkit-scrollbar {
  width: 6px;
}
#arxiv-tracked-list::-webkit-scrollbar-track {
  background: #f5f0ff;
  border-radius: 3px;
}
#arxiv-tracked-list::-webkit-scrollbar-thumb {
  background: #e0d4ff;
  border-radius: 3px;
}
#arxiv-tracked-list::-webkit-scrollbar-thumb:hover {
  background: #c9b8ff;
}

/* 美化滚动条样式 - 模态框整体 */
#arxiv-search-panel::-webkit-scrollbar {
  width: 10px;
}
#arxiv-search-panel::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 5px;
}
#arxiv-search-panel::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 5px;
}
#arxiv-search-panel::-webkit-scrollbar-thumb:hover {
  background: #9e9e9e;
}

#arxiv-subscriptions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
#arxiv-top-row {
  display: flex;
  gap: 6px;
}
.arxiv-pane {
  padding: 8px;
  border-radius: 6px;
  box-sizing: border-box;
}
#arxiv-keywords-pane {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  /* 后台面板：关键词区域使用冷灰/蓝灰，避免黄暖色与绿/青 */
  background: #f5f3ef;
  display: flex;
  flex-direction: column;
}
#arxiv-zotero-pane {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  background: #e3f2fd;
  display: flex;
  flex-direction: column;
}
#arxiv-search-section {
  margin-top: 8px;
  background: #f5f0ff;
}
.arxiv-result-item {
  padding: 6px 8px;
  margin: 0 0 4px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
}
.arxiv-result-item:hover {
  background-color: #ede4ff;
  border-radius: 4px;
}
.arxiv-result-item.selected {
  background-color: #e0d4ff;
  border-left: 3px solid #6a3fc1;
  padding-left: 5px;
  border-radius: 4px;
}
.arxiv-tracked-item {
  padding: 6px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 4px;
}
.tag-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  white-space: nowrap;
}
.tag-green {
  /* 关键词标签：冷灰/蓝灰（历史 class 名保留） */
  background-color: #f5f3ef;
  color: #3b3a36;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.tag-blue {
  background-color: #e3f2fd;
  color: #1565c0;
}
.tag-pink {
  background-color: #f5f0ff;
  color: #5a2bb8;
}
.arxiv-result-meta {
  flex: 1;
  min-width: 0;
}
.arxiv-result-action-area {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}
.arxiv-result-action-area input {
  width: 120px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 11px;
}
.arxiv-result-action-area button {
  padding: 4px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.arxiv-result-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.arxiv-result-authors,
.arxiv-result-published {
  font-size: 12px;
  color: #666;
}
#arxiv-search-message {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* ========== 统一智能 Query 面板 ========== */
.dpr-smart-pane {
  background: transparent;
  border: none;
  margin-bottom: 8px;
  padding: 0;
}
.dpr-smart-head {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.dpr-disabled-pane {
  background: #f1f1f1;
  border: 1px dashed #d0d0d0;
  opacity: 0.5;
  filter: grayscale(0.35);
  pointer-events: none;
  user-select: none;
}

.dpr-input-card,
.dpr-display-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.dpr-input-card {
  margin-top: 10px;
}

.dpr-inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 0;
}

.dpr-input-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.dpr-side-row {
  margin-top: 0;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  white-space: nowrap;
}

.dpr-side-row input[type='text'] {
  width: 110px;
  flex: 0 0 110px;
}

.dpr-desc-compact {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  max-height: 240px;
  line-height: 1.4;
  overflow-y: auto;
  overflow-x: hidden;
  resize: vertical;
}

.dpr-section-divider {
  margin: 10px 8px 8px;
  border-top: 1px solid #eceff5;
}

.dpr-help-tip {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef3ff;
  border: 1px solid #cdd9f3;
  color: #38558d;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  cursor: help;
  user-select: none;
  flex: 0 0 18px;
}

.dpr-help-pop {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 300px;
  max-width: 380px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d9e4fa;
  background: #fff;
  color: #354669;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 10px 26px rgba(27, 43, 75, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 20;
}

.dpr-help-tip:hover .dpr-help-pop,
.dpr-help-tip:focus .dpr-help-pop,
.dpr-help-tip:focus-within .dpr-help-pop {
  opacity: 1;
}

.dpr-inline-row input,
.dpr-inline-row textarea,
.dpr-input-card textarea {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #ced9ee;
  border-radius: 6px;
  font-size: 12px;
}

.dpr-input-card textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0;
  resize: vertical;
}

.dpr-sq-display {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dpr-entry-card {
  background: #f8fbff;
  border: 1px solid #dbe6fb;
  border-radius: 8px;
  padding: 7px 8px;
}

.dpr-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.dpr-entry-headline {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1 1 auto;
}

.dpr-entry-main {
  min-width: 0;
}

.dpr-entry-title {
  font-size: 12px;
  font-weight: 600;
  color: #28395f;
  word-break: break-word;
}

.dpr-entry-desc {
  font-size: 11px;
  color: #4b5b81;
  line-height: 1.35;
  word-break: break-word;
}

.dpr-entry-desc-inline {
  font-size: 11px;
  color: #4b5b81;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.dpr-entry-meta {
  font-size: 11px;
  color: #6a7698;
  margin-bottom: 2px;
}

.dpr-entry-query-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dpr-entry-query-item {
  border: 1px solid #dbe6fb;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11px;
  color: #3d4a71;
  background: #fff;
  word-break: break-word;
}

.dpr-entry-empty {
  font-size: 11px;
  color: #999;
}

.dpr-entry-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.dpr-entry-edit-btn {
  white-space: nowrap;
}

.dpr-entry-delete-btn {
  white-space: nowrap;
  border-color: #e4c6c6;
  color: #9a3e3e;
  background: #fff7f7;
}

.dpr-mini {
  min-width: 28px;
  padding: 2px 6px;
}

/* 智能 Query 新增/编辑弹层 */
#dpr-sq-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 34, 52, 0.42);
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.16s ease;
}

#dpr-sq-modal-overlay.show {
  opacity: 1;
}

#dpr-sq-modal-panel {
  width: min(1040px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #d9e4fa;
  box-shadow: 0 18px 50px rgba(24, 37, 68, 0.22);
  padding: 12px;
}

.dpr-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.dpr-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: #2f3f67;
}

.dpr-modal-sub {
  font-size: 12px;
  color: #657399;
  background: #f7faff;
  border: 1px solid #e3ebfb;
  border-radius: 6px;
  padding: 7px 8px;
  margin-bottom: 8px;
}

.dpr-modal-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #3d5482;
  margin: 8px 0 6px;
}

.dpr-help-example {
  margin-left: 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: #51638f;
}

.dpr-help-examples {
  margin-top: 4px;
  margin-left: 8px;
}

.dpr-modal-list {
  background: #f9fbff;
  border: 1px solid #e1e9fa;
  border-radius: 6px;
  padding: 7px;
}

.dpr-chat-messages {
  max-height: 42vh;
  overflow: auto;
}

.dpr-chat-round {
  border: 1px solid #e2e9fa;
  border-radius: 6px;
  padding: 7px 8px;
  margin-bottom: 9px;
  background: #fff;
}

.dpr-chat-round:last-child {
  margin-bottom: 0;
}

.dpr-chat-round-head {
  font-size: 12px;
  font-weight: 600;
  color: #364872;
  margin-bottom: 3px;
}

.dpr-chat-round-desc {
  font-size: 11px;
  color: #66728f;
  line-height: 1.45;
  margin-bottom: 6px;
  word-break: break-word;
}

.dpr-chat-input-group {
  border: 1px solid #e1e9fa;
  border-radius: 6px;
  background: #f9fbff;
  padding: 8px;
  margin-bottom: 10px;
  display: block;
}

.dpr-chat-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: flex-end;
}

.dpr-chat-inline-tag {
  flex: 0 0 120px;
  min-width: 120px;
}

.dpr-chat-inline-tag input {
  width: 100%;
}

.dpr-chat-inline-desc {
  flex: 1 1 auto;
  min-width: 0;
}

.dpr-chat-inline-desc textarea {
  height: 56px;
  min-height: 56px;
}

.dpr-chat-send-btn {
  flex: 0 0 auto;
  background: #5dcf85 !important;
  color: #fff !important;
  padding: 6px 10px !important;
  height: 56px;
  min-height: 56px;
  border-radius: 6px;
  white-space: nowrap;
  margin: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 700px) {
  .dpr-chat-row {
    flex-wrap: wrap;
  }
  .dpr-chat-send-btn {
    margin-left: auto;
  }
}

.dpr-chat-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #475a86;
}

.dpr-chat-label-text {
  font-size: 11px;
}

.dpr-chat-label input,
.dpr-chat-label textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccdaef;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.dpr-chat-label textarea {
  min-height: 56px;
  resize: vertical;
}

.dpr-chat-inline-status {
  margin-top: 2px;
  min-height: 18px;
  font-size: 11px;
  line-height: 1.4;
  color: #666;
  transition: color 0.12s ease;
}

.dpr-chat-result-module {
  margin: 0 0 8px;
  border: 1px solid #e2eaf6;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}

.dpr-chat-list {
  margin: 5px 0 8px;
}

.dpr-cloud-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.dpr-cloud-grid-query {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dpr-cloud-grid-keywords {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dpr-chat-result-block {
  width: 100%;
}

.dpr-chat-slot-area {
  border: 1px solid #d9e4f7;
  border-radius: 16px;
  padding: 10px;
  background: #fbfdff;
}

.dpr-chat-slot-scroll {
  max-height: 186px;
  overflow-y: auto;
  overflow-x: hidden;
}

.dpr-chat-slot-area.draft-only {
  width: 33.333%;
  max-width: 420px;
  min-width: 220px;
}

@media (max-width: 1024px) {
  .dpr-chat-slot-area.draft-only {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}

.dpr-chat-slot-area.draft-only .dpr-cloud-grid {
  grid-template-columns: 1fr;
}

.dpr-chat-result-row-gap {
  height: 10px;
}

@media (max-width: 1024px) {
  .dpr-cloud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dpr-cloud-grid-query {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dpr-cloud-grid-keywords {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .dpr-cloud-grid {
    grid-template-columns: 1fr;
  }
  .dpr-cloud-grid-keywords {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dpr-cloud-item {
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid #d4dfef;
  background: #fff;
  border-radius: 14px;
  padding: 6px 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  gap: 5px;
  align-items: flex-start;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.dpr-cloud-item:hover {
  border-color: #a9bddf;
}

.dpr-cloud-item.selected {
  border-color: #57a86a;
  background: #f2fcf4;
  box-shadow: 0 0 0 1px rgba(87, 168, 106, 0.2);
}

.dpr-cloud-item.selected .dpr-cloud-item-title,
.dpr-cloud-item.selected .dpr-cloud-item-desc {
  color: #1f5f2f;
}

.dpr-cloud-item input[type='checkbox']:checked + .dpr-cloud-item-body .dpr-cloud-item-title,
.dpr-cloud-item input[type='checkbox']:checked + .dpr-cloud-item-body .dpr-cloud-item-desc {
  color: #1f5f2f;
}

.dpr-cloud-item input[type='checkbox'] {
  margin-top: 1px;
  accent-color: #2e7d32;
}

.dpr-cloud-item input[type='checkbox']:checked {
  transform: scale(1.05);
}

.dpr-cloud-item-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  line-height: 1.35;
  font-size: 11px;
}

.dpr-cloud-item-title {
  font-size: 12px;
  color: #2f4069;
}

.dpr-cloud-item-desc {
  font-size: 11px;
  color: #6a7694;
  line-height: 1.35;
  word-break: break-word;
}

.dpr-cloud-empty {
  min-height: 84px;
}

.dpr-btn-loading {
  position: relative;
  cursor: not-allowed;
}

.dpr-btn-loading .dpr-mini-spinner {
  display: inline-block;
}

.dpr-mini-spinner {
  display: none;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-right-color: #fff;
  border-radius: 50%;
  margin-left: 6px;
  animation: dpr-mini-spin 0.7s linear infinite;
  vertical-align: -1px;
}

.dpr-btn-loading .dpr-mini-spinner {
  display: inline-block;
}

@keyframes dpr-mini-spin {
  to {
    transform: rotate(360deg);
  }
}

.dpr-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.dpr-combo-list {
  border: 1px solid #e5ebf6;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.dpr-combo-block {
  width: 100%;
}

.dpr-modal-divider,
.dpr-chat-divider {
  border-top: 1px solid #e2e9f5;
  margin: 10px 0;
}

.dpr-pick-card {
  text-align: left;
  width: 100%;
  border: 1px solid #d4dfef;
  background: #fff;
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.dpr-pick-card:hover {
  border-color: #a9bddf;
}

.dpr-pick-card.selected {
  border-color: #57a86a;
  background: #f2fcf4;
  box-shadow: 0 0 0 1px rgba(87, 168, 106, 0.2);
}

.dpr-inline-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dpr-inline-slot-chat {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
}

.dpr-inline-slot-fields {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dpr-inline-draft-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c7d7f1;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.25;
  color: #2f4069;
  background: #fff;
}

.dpr-inline-draft-input:focus {
  outline: none;
  border-color: #7f92b9;
  box-shadow: 0 0 0 1px rgba(127, 146, 185, 0.24);
}

.dpr-inline-slot-add {
  align-self: flex-end;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #9db7e1;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  color: #2d5ea8;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.dpr-inline-slot-add:hover {
  border-color: #2e7d32;
  color: #215d27;
  background: linear-gradient(180deg, #f7fff8 0%, #ecf8ee 100%);
  box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.15);
}

.dpr-inline-slot-add-side {
  align-self: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
}

.dpr-inline-field {
  position: relative;
  border: 1px solid transparent;
  border-radius: 7px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 7px;
  min-height: 20px;
  line-height: 1.28;
  font-size: 11px;
  cursor: pointer;
  color: #2f4069;
  word-break: break-word;
}

.dpr-inline-field.is-empty {
  color: #95a4c2;
}

.dpr-inline-field.is-primary {
  font-size: 12px;
}

.dpr-inline-field.is-primary .dpr-inline-text {
  font-size: 12px;
}

.dpr-inline-field:hover {
  border-color: #b4c6eb;
  background: #f7f9ff;
}

.dpr-inline-field .dpr-inline-pencil {
  position: absolute;
  right: 6px;
  top: 4px;
  font-size: 12px;
  color: #7d8eb1;
  opacity: 0;
  pointer-events: none;
}

.dpr-inline-field:hover .dpr-inline-pencil,
.dpr-inline-field:focus-within .dpr-inline-pencil {
  opacity: 1;
}

.dpr-inline-field .dpr-inline-text {
  display: inline-block;
  width: 100%;
  max-width: 100%;
  font-size: 11px;
}

.dpr-pick-card:not(.dpr-inline-slot) .dpr-inline-field,
.dpr-cloud-item:not(.dpr-inline-slot) .dpr-inline-field,
.dpr-pick-card:not(.dpr-inline-slot) .dpr-inline-field .dpr-inline-text,
.dpr-cloud-item:not(.dpr-inline-slot) .dpr-inline-field .dpr-inline-text {
  font-size: 13px;
}

.dpr-inline-editor {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #7f92b9;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1.35;
  outline: none;
  color: #2f4069;
  background: #fff;
}

.dpr-inline-editor:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.24);
}

.dpr-pick-title {
  font-size: 12px;
  color: #2f4069;
  line-height: 1.45;
  word-break: break-word;
  margin-bottom: 4px;
}

.dpr-pick-desc {
  font-size: 11px;
  color: #66728f;
  line-height: 1.4;
  word-break: break-word;
}

.dpr-modal-choice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
  cursor: pointer;
}

.dpr-modal-choice:last-child {
  margin-bottom: 0;
}

.dpr-modal-choice input[type='checkbox'] {
  margin-top: 2px;
}

.dpr-modal-choice-title {
  font-size: 12px;
  color: #2f4069;
  line-height: 1.4;
}

.dpr-modal-choice-desc {
  font-size: 11px;
  color: #6a7694;
  line-height: 1.4;
}

.dpr-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dpr-modal-add-footer {
  align-items: flex-end;
  flex-wrap: wrap;
  row-gap: 8px;
}

.dpr-modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 220px;
}

.dpr-modal-field-label {
  font-size: 11px;
  color: #475a86;
}

.dpr-modal-field input[type='text'] {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #ccdaef;
  border-radius: 6px;
  font-size: 12px;
}

.dpr-chat-action-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.dpr-chat-ops {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.dpr-chat-ops .arxiv-tool-btn {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.dpr-chat-ops .dpr-chat-inline-status {
  flex: 1;
  margin-top: 0;
  min-width: 0;
  font-size: 11px;
  word-break: break-word;
}

.dpr-chat-action-area > .arxiv-tool-btn {
  width: 100%;
}

.dpr-modal-actions-inline {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.dpr-modal-add-inline {
  justify-content: stretch;
  gap: 8px;
}

.dpr-modal-add-inline input[type='text'] {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #ccdaef;
  border-radius: 6px;
  font-size: 12px;
}

.dpr-edit-base {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0 8px;
}

.dpr-edit-base label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #475a86;
}

.dpr-edit-base label input[type='text'] {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #ccdaef;
  border-radius: 6px;
  font-size: 12px;
}

.dpr-edit-enabled {
  grid-column: 1 / -1;
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
}

.dpr-edit-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 7px;
  align-items: start;
  margin-bottom: 6px;
}

.dpr-edit-row:last-child {
  margin-bottom: 0;
}

.dpr-edit-toggle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 24px;
  font-size: 11px;
  border-radius: 12px;
  border: 1px solid #d0dbef;
  color: #5e6f94;
  background: #fff;
  cursor: pointer;
}

.dpr-edit-toggle.on {
  border-color: #b7d9be;
  color: #2f7040;
  background: #edf8ef;
}

.dpr-edit-toggle.off {
  border-color: #e2c2c2;
  color: #9b4e4e;
  background: #fff4f4;
}

.dpr-edit-text {
  font-size: 12px;
  color: #33486f;
  line-height: 1.45;
  word-break: break-word;
}

.dpr-edit-sub {
  font-size: 11px;
  color: #6e7b99;
  margin-top: 2px;
}

@media (max-width: 980px) {
  .dpr-inline-row {
    flex-direction: column;
    align-items: stretch;
  }
  .dpr-input-layout {
    grid-template-columns: 1fr;
  }
  .dpr-side-row {
    height: auto;
    margin-top: 8px;
  }
  .dpr-entry-card {
    padding: 8px;
  }
  .dpr-entry-top {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 6px;
  }
  .dpr-entry-headline {
    display: block;
  }
  .dpr-entry-desc-inline {
    display: inline;
    margin-left: 6px;
    white-space: normal;
  }
  .dpr-entry-actions {
    display: flex;
    justify-content: flex-end;
  }
  .dpr-edit-base {
    grid-template-columns: 1fr;
  }
  .dpr-edit-row {
    grid-template-columns: 1fr;
  }
}

/* ========== 论文页面新布局样式 ========== */

/* 标题区域 - 双列 */
.paper-title-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.paper-title-row h1 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1.5em;
  line-height: 1.4;
  flex: 1;
  min-width: 280px;
  text-align: left;
}

.paper-title-zh {
  color: #333;
  font-weight: 600;
}

.paper-title-en {
  color: #666;
  font-weight: 400;
  font-size: 1.2em !important;
}

/* 中间区域 - 左右两列 */
.paper-meta-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(248, 249, 250, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.paper-meta-left {
  flex: 1;
  min-width: 200px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding-right: 20px;
}

.paper-meta-right {
  flex: 1;
  min-width: 200px;
}

.paper-meta-left p,
.paper-meta-right p {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #444;
}

/* 论文元信息区域的链接使用正文颜色（覆盖全局红色链接样式） */
.markdown-section .paper-meta-row .paper-meta-left a,
.markdown-section .paper-meta-row .paper-meta-left a:link,
.markdown-section .paper-meta-row .paper-meta-left a:visited,
.markdown-section .paper-meta-row .paper-meta-right a,
.markdown-section .paper-meta-row .paper-meta-right a:link,
.markdown-section .paper-meta-row .paper-meta-right a:visited {
  color: #34495e !important;
  text-decoration: underline;
  font-weight: normal !important;
}

.markdown-section .paper-meta-row .paper-meta-left a:hover,
.markdown-section .paper-meta-row .paper-meta-right a:hover {
  color: #2c3e50 !important;
}

.paper-meta-left p strong,
.paper-meta-right p strong {
  color: #e74c3c;
  font-weight: 600;
}

/* 速览区域 */
.paper-glance-section {
  margin: 20px 0;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.paper-glance-title {
  margin: 0 0 16px 0 !important;
  padding: 0 !important;
  font-size: 1.1em;
  color: #333;
  border-bottom: none !important;
}

/* 四列布局 */
.paper-glance-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.paper-glance-col {
  padding: 12px;
  background: rgba(248, 249, 250, 0.6);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.paper-glance-label,
.markdown-section .paper-glance-label {
  font-size: 13px;
  font-weight: 600;
  color: #e74c3c !important;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(231, 76, 60, 0.2);
}

.paper-glance-content {
  font-size: 13px;
  line-height: 1.6;
  color: #444;
}

.paper-glance-tldr {
  padding: 12px;
  background: rgba(231, 76, 60, 0.05);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  border-left: 3px solid #e74c3c;
}

.paper-glance-tldr strong {
  color: #e74c3c;
}

/* 响应式：小屏幕改为两列或单列 */
@media (max-width: 900px) {
  .paper-title-row {
    flex-direction: column;
    gap: 8px;
  }

  .paper-meta-row {
    flex-direction: column;
    gap: 16px;
  }

  /* 小屏幕下调整顺序：Authors区域(right)先显示，Evidence区域(left)后显示 */
  .paper-meta-left {
    order: 2;
    border-right: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-right: 0;
    padding-top: 12px;
  }

  .paper-meta-right {
    order: 1;
  }

  .paper-glance-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .paper-glance-row {
    grid-template-columns: 1fr;
  }
}

/* 极窄屏（<=767px）：禁用关键布局动画，避免从 768 断点切换时出现明显“滑动/跳动” */
@media (max-width: 767px) {
  :root {
    /* 统一把侧边栏相关的过渡时长压到 0，避免出现“收起/展开/位移”的动画 */
    --dpr-transition-ms: 0ms;
  }

  .sidebar,
  .content,
  #paper-chat-container::before,
  #paper-chat-container::after,
  #paper-chat-container .input-area,
  .chat-footer,
  .sidebar-toggle {
    transition: none !important;
  }
}
