/* ==========================================
   全局样式
   ========================================== */
body {
  margin: 0;
  background: #f5f7fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
}

/* ==========================================
   头部样式
   ========================================== */
.header-box {
  background: white;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* 通用标题样式 */
.header-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-size: 1.5rem;
  min-width: 0;
  flex: 1;
}

@media (max-width: 576px) {
  .header-title-tooltip {
    cursor: pointer;
  }
}

.header-subtitle {
  margin-left: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6f7f95;
}

.browse-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.browse-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.browse-result-summary {
  margin: 18px 0 20px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #e7edf5;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(27, 39, 51, 0.04);
  scroll-margin-top: 150px;
}

.browse-result-summary-title {
  font-size: 16px;
  font-weight: 600;
  color: #24415f;
}

.browse-result-segments {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.browse-active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.browse-active-filters-divider {
  width: 1px;
  height: 20px;
  background: #d6deea;
  margin: 0 2px;
}

.browse-result-segment {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
  color: #1677ff;
  cursor: pointer;
}

.browse-result-segment:hover {
  color: #0f5fd1;
  text-decoration: underline;
}

.browse-result-separator {
  color: #9aa8b8;
}

.chat-mobile-title-row {
  min-width: 0;
}

.chat-mobile-header-title {
  min-width: 0;
  margin-right: 8px;
}

.chat-mobile-title-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-mobile-title-actions {
  margin-left: 8px;
}

.mode-badge.ant-tag {
  margin-right: 0;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  cursor: help;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mode-badge-read.ant-tag {
  background: #eef5ff;
  border-color: #d7e4f6;
  color: #5b7390;
}

.mode-badge-read.ant-tag:hover {
  background: #e6f0ff;
  border-color: #c7d8f1;
  color: #476582;
}

/* ==========================================
   布局样式
   ========================================== */
.layout {
  display: flex;
  gap: 30px;
}

.content {
  flex: 1;
  margin-top: 10px;
}

.content h1,
.content h2,
.content h3{
  scroll-margin-top: 180px;
}

.asset-section button{
  scroll-margin-top: 160px;
}

/* ==========================================
   侧边栏样式
   ========================================== */
.sidebar {
  box-sizing: border-box;
  width: 260px;
  background: white;
  padding: 20px;
  border-radius: 10px;
  max-height: 80vh;
  overflow-y: auto;
  position: sticky;
  top: 120px;
}

.toc-item {
  cursor: pointer;
  margin: 6px 0;
  font-size: 14px;
  color: #555;
}

.toc-item.active {
  color: #1677ff;
  font-weight: 600;
}

.level-1 {
  font-weight: 600;
}

.level-2 {
  padding-left: 16px;
}

.level-3 {
  padding-left: 32px;
}

.chat-page .content .toc-anchor,
.chat-page .content h1,
.chat-page .content h2,
.chat-page .content h3 {
  scroll-margin-top: var(--chat-scroll-offset, 180px);
}

.chat-page .sidebar {
  top: var(--chat-scroll-offset, 120px);
}

/* ==========================================
   消息块样式
   ========================================== */
.message-block {
  margin-bottom: 20px;
  padding: 25px;
  background: white;
  border-radius: 10px;
  border: 1px solid #eee;
}

.user-message-block {
  margin-bottom: 24px;
  padding: 25px;
  background: #f0f0f0;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.title-block {
  margin-bottom: 24px;
  padding: 25px;
  background: #fafafa;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

.math-block {
  margin: 20px 0;
}

.asset-section {
  margin-bottom: 24px;
  background: white;
  border-radius: 10px;
  border: 1px solid #eee;
  overflow: hidden;
}

.asset-section-header {
  width: 100%;
  border: none;
  background: #fff;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  text-align: left;
}

.asset-section-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #1677ff;
}

.asset-section-help {
  width: 24px;
  height: 24px;
  border: 1px solid #c8d7f0;
  border-radius: 999px;
  background: #fff;
  color: #5b6f90;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.asset-section-help:hover {
  border-color: #1677ff;
  color: #1677ff;
}

.asset-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 13px;
  transition: transform 0.2s ease;
}

.asset-section-toggle .anticon {
  transition: transform 0.2s ease;
}

.asset-section-toggle.expanded .anticon {
  transform: rotate(90deg);
}

.asset-section-body {
  padding: 0 24px 24px;
}

.asset-floating-collapse {
  position: fixed;
  left: 16px;
  bottom: 18px;
  z-index: 1100;
  border: none;
  border-radius: 999px;
  background: #1677ff;
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 119, 255, 0.28);
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.asset-floating-collapse-table {
  bottom: 72px;
}

.asset-floating-collapse-icon {
  transform: rotate(90deg);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.asset-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 10px;
  background: #fafcff;
  border: 1px solid #e8eef6;
}

.asset-image .ant-image-img,
.asset-image img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.asset-meta {
  font-size: 12px;
  color: #6b7280;
}

.asset-caption {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  word-break: break-word;
}

.asset-direction-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.asset-direction-intro {
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
}

.asset-direction-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e5ecf6;
  background: #fafcff;
}

.asset-direction-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.asset-direction-card-desc {
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #6b7280;
}

.asset-direction-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ==========================================
   浏览页样式
   ========================================== */
.browse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
}

.browse-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.view-toggle-btn {
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  background: white;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s;
}

.view-toggle-btn:hover {
  border-color: #1677ff;
  color: #1677ff;
}

.view-toggle-btn.active {
  background: #1677ff;
  color: white;
  border-color: #1677ff;
}

/* ==========================================
   瀑布流/网格布局
   ========================================== */
.paper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.paper-grid.masonry {
  display: block;
  column-count: 3;
  column-gap: 20px;
}

.paper-grid.masonry .paper-card {
  break-inside: avoid;
  margin-bottom: 20px;
}

.paper-grid.list {
  grid-template-columns: 1fr;
}

.masonry-container {
  display: flex;
  gap: 20px;
}

.masonry-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================
   论文卡片样式
   ========================================== */
.paper-card {
  background: white;
  border-radius: 10px;
  border: 1px solid #eee;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.paper-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.paper-title-link {
  display: block;
  width: 100%;
  appearance: none;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.paper-title-link:focus,
.paper-title-link:focus-visible,
.paper-title-link:active {
  outline: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

.paper-title {
  font-size: 16px;
  font-weight: 600;
  color: #1677ff;
  margin-bottom: 10px;
  word-break: break-word;
  flex-grow: 0;
}

.paper-title-link:hover .paper-title {
  color: #0f5fd1;
  text-decoration: underline;
}

.paper-time {
  font-size: 12px;
  color: #999;
}

.paper-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.paper-citation-count {
  margin-left: auto;
  font-size: 12px;
  color: #667085;
  white-space: nowrap;
  cursor: help;
}

.paper-summary {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  word-break: break-word;
  flex-grow: 1;
}

/* 隐藏摘要卡片中的第一个 h1 标题（通常是 "# 摘要"） */
.paper-summary h1:first-of-type {
  display: none;
}

.paper-footer {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.paper-download-link {
  color: #1677ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
}

.paper-download-link:hover {
  color: #0f5fd1;
}

.paper-tag-row,
.tag-block-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.paper-tag-row {
  justify-content: flex-start;
  flex: 1;
  min-width: 0;
}

.tag-block {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: white;
  border-radius: 10px;
  border: 1px solid #eee;
}

.translation-status-card {
  margin-bottom: 24px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-radius: 18px;
  border: 1px solid #dbe7f5;
  box-shadow: 0 10px 26px rgba(28, 52, 84, 0.05);
}

.translation-status-progress {
  border-color: #cfe0f8;
}

.translation-status-body-done {
  border-color: #d8e8d2;
  background: linear-gradient(135deg, #f7fcf4 0%, #ffffff 100%);
}

.translation-status-done {
  border-color: #cfe6dc;
  background: linear-gradient(135deg, #f3fbf7 0%, #ffffff 100%);
}

.translation-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.translation-status-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #1f3247;
}

.translation-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #e9f2ff;
  color: #1f5ea8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.translation-status-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.translation-status-body-done .translation-status-badge {
  background: #e9f6e3;
  color: #45762d;
}

.translation-status-done .translation-status-badge {
  background: #e1f5ea;
  color: #23704b;
}

.translation-status-topline {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.translation-status-main-value {
  color: #1f3247;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.translation-status-main-units {
  margin-left: 6px;
  color: #6a7688;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.translation-status-percent {
  color: #3f7ded;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.translation-status-progressbar-track {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef5;
  height: 8px;
  min-width: 120px;
}

.translation-status-progressbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
}

.translation-status-progressbar-fill-overall {
  background: linear-gradient(90deg, #63a2f0 0%, #2e62da 100%);
}

.translation-status-progressbar-fill-body {
  background: linear-gradient(90deg, #7ddf9f 0%, #27be5d 100%);
}

.translation-status-progressbar-fill-appendix {
  background: linear-gradient(90deg, #d5dde8 0%, #c4cfdd 100%);
}

.translation-status-mini-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f5f8fc;
  border: 1px solid #dce6f3;
  color: #5f6c80;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.translation-status-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #e9f0fb;
}

.translation-status-meta-item {
  min-width: 0;
}

.translation-status-meta-key {
  margin-bottom: 4px;
  color: #6a7688;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.translation-status-meta-value {
  color: #1f3247;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
}

.translation-status-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #dbe7f7;
}

.translation-status-desc {
  flex: 1 1 360px;
  min-width: 240px;
  color: #66758a;
  font-size: 12.5px;
  line-height: 1.65;
}

.translation-status-desc-inline-note {
  margin-left: 10px;
  color: #7d8ca0;
  font-size: 12px;
  white-space: normal;
}

.translation-status-inline-link {
  appearance: none;
  margin-left: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.translation-status-inline-link:hover {
  color: #1d4ed8;
}

.translation-status-inline-panel {
  margin-top: 8px;
  color: #6b7d93;
  font-size: 12px;
  line-height: 1.6;
  padding-top: 8px;
  border-top: 1px dashed #e2eaf5;
}

.translation-status-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.translation-status-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #f6f8fc;
  color: #5f6c80;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.translation-status-action-pill.confirmed {
  background: #eaf8ee;
  color: #15803d;
  border-color: #caebd4;
}

.translation-status-action-pill.pending {
  background: #fff5df;
  color: #9a6700;
  border-color: #f0deaf;
}

.translation-status-action-pill.toggle {
  appearance: none;
  cursor: pointer;
  background: #eef5ff;
  color: #2563eb;
  border-color: #cfe0ff;
}

.translation-status-action-pill.toggle:hover {
  background: #e5f0ff;
}

.translation-status-glossary-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e9f0fb;
}

.translation-status-glossary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.translation-status-glossary-heading {
  flex: 1 1 280px;
  min-width: 220px;
}

.translation-status-glossary-title {
  color: #1f3247;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.translation-status-glossary-caption {
  margin-top: 4px;
  color: #6b7d93;
  font-size: 12px;
  line-height: 1.6;
}

.translation-status-glossary-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.translation-status-glossary-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.translation-status-note {
  margin-top: 8px;
  color: #6b7d93;
  font-size: 12px;
  line-height: 1.6;
}

.translation-status-section {
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.translation-status-section-inline-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.translation-status-section-toggle {
  appearance: none;
  border: 1px solid #d4e1ef;
  border-radius: 999px;
  background: #fff;
  color: #4f6784;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s ease;
}

.translation-status-section-toggle:hover {
  border-color: #1677ff;
  color: #1677ff;
  background: #eef5ff;
}

.translation-status-section-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e6f3ff;
  color: #1f5ea8;
  font-size: 12px;
  font-weight: 700;
}

.translation-status-section-badge.pending {
  background: #fff3d9;
  color: #996500;
}

.translation-status-section-badge.confirmed {
  background: #e8f7ea;
  color: #2f7a46;
}

.translation-status-section-subtitle,
.translation-status-section-footer,
.translation-status-section-summary {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #6b7d93;
}

.translation-status-glossary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.translation-status-glossary-row {
  padding: 7px 10px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #dde8f4;
}

.glossary-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.7;
}

.glossary-term-inline {
  font-size: 13px;
  font-weight: 700;
  color: #1f3247;
  word-break: break-word;
}

.glossary-candidates {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.glossary-candidate {
  appearance: none;
  padding: 0;
  border: none;
  background: transparent;
  color: #5e6f85;
  font-size: 13px;
  line-height: 1.7;
  cursor: pointer;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.glossary-candidate:hover:not(:disabled) {
  color: #1677ff;
}

.glossary-candidate.selected {
  color: #1677ff;
  font-weight: 700;
}

.glossary-candidate:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.glossary-separator {
  color: #9aa8b8;
}

.tag-block-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tag-block-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-block-title {
  font-size: 16px;
  font-weight: 600;
  color: #1677ff;
}

.tag-block-edit {
  width: 32px;
  height: 32px;
  border: 1px solid #d8e2f0;
  border-radius: 999px;
  background: #f8fbff;
  color: #5d6b82;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-block-edit:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.tag-block-edit:hover {
  border-color: #1677ff;
  color: #1677ff;
  background: #eef5ff;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.tag-chip-action {
  appearance: none;
  cursor: pointer;
  gap: 6px;
}

.tag-chip-action:hover {
  filter: brightness(0.98);
}

.tag-chip-action-text {
  max-width: 100%;
}

.tag-chip-icon {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
}

.tag-chip-remove {
  font-size: 12px;
  line-height: 1;
  opacity: 0.78;
}

.tag-chip-compact {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 12px;
}

.tag-chip-learning {
  background: #eef4ff;
  border-color: #d7e5ff;
  color: #245fb2;
}

.tag-chip-modality {
  background: #edf8f7;
  border-color: #d4ece9;
  color: #146c63;
}

.tag-chip-task {
  background: #eef7ef;
  border-color: #d8eadb;
  color: #2d6a39;
}

.tag-chip-system {
  background: #f2f4f8;
  border-color: #dde3ec;
  color: #4d5f7a;
}

.tag-chip-application {
  background: #fff4ea;
  border-color: #f3dfca;
  color: #9a5a16;
}

.tag-chip-property {
  background: #f8f1ef;
  border-color: #ebdcd7;
  color: #8a4b45;
}

.tag-chip-ccf-a {
  background: #fff7db;
  border-color: #efd98e;
  color: #8a6113;
}

.tag-chip-ccf-b {
  background: #eaf2ff;
  border-color: #c8dafc;
  color: #215ea8;
}

.tag-chip-ccf-c {
  background: #f8ede4;
  border-color: #e7c7aa;
  color: #8e5520;
}

.tag-chip-ccf-none {
  background: #f3f4f6;
  border-color: #d9dde3;
  color: #667085;
}

.tag-chip-venue {
  background: #eaf4ff;
  border-color: #cbdffd;
  color: #1d5fa8;
}

.tag-chip-year {
  background: #eefaf2;
  border-color: #cfead7;
  color: #287348;
}

.tag-chip-keyword {
  background: #eaf1ff;
  border-color: #cbd8ff;
  color: #315ea8;
}

.tag-empty-text {
  font-size: 13px;
  color: #8a8a8a;
}

.tag-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #edf0f4;
}

.tag-picker-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-picker-tab {
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4b5563;
  padding: 10px 6px;
  font-size: 15px;
  cursor: pointer;
}

.tag-picker-tab.active {
  color: #1677ff;
  border-bottom-color: #1677ff;
  font-weight: 600;
}

.tag-picker-search {
  width: 260px;
  flex-shrink: 0;
}

.tag-picker-selected {
  padding: 18px 0 16px;
  border-bottom: 1px solid #edf0f4;
}

.tag-picker-section-title,
.tag-picker-group-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.tag-picker-selected-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 34px;
}

.tag-picker-selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-picker-selected-pill:hover {
  border-color: #b8cce8;
  background: #f1f6fd;
}

.tag-picker-selected-pill-text {
  font-size: 14px;
  line-height: 1.4;
}

.tag-picker-selected-pill-remove {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #e7edf5;
  color: #64748b;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tag-picker-groups {
  max-height: 55vh;
  overflow-y: auto;
}

.tag-picker-group {
  padding: 18px 0;
  border-bottom: 1px solid #edf0f4;
}

.tag-picker-chip-list {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #d8dee8;
  background: #f8fafc;
  color: #4b5563;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.tag-picker-chip:hover {
  border-color: #8db5f0;
  background: #f3f8ff;
}

.tag-picker-chip.selected {
  border-color: #1677ff;
  background: #eaf3ff;
  color: #1454a3;
}

.tag-picker-chip-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(22, 119, 255, 0.1);
  color: #5d6b82;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   空状态样式
   ========================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 20px;
}

/* ==========================================
   响应式设计
   ========================================== */
@media (max-width: 1200px) {
  .paper-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .paper-grid.masonry {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .paper-grid,
  .paper-grid.masonry {
    grid-template-columns: 1fr;
    column-count: 1;
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }

  .translation-status-card {
    padding: 14px 16px;
    border-radius: 16px;
  }

  .translation-status-topline {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .translation-status-progressbar-track {
    grid-column: 1 / -1;
  }

  .translation-status-mini-tag {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }

  .translation-status-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .translation-status-bottom {
    align-items: flex-start;
  }
}

/* ==========================================
   手机端适配 (576px 以下)
   ========================================== */
@media (max-width: 576px) {
  /* 容器调整 */
  .container {
    padding: 6px;
  }

  /* 头部盒调整 */
  .header-box {
    padding: 6px 10px;
  }

  /* 浏览页头部调整 */
  .browse-header {
    gap: 6px;
    margin-top: 2px;
    margin-bottom: 0;
  }

  .browse-header span {
    font-size: 13px;
    white-space: nowrap;
  }

  /* 浏览页控件调整 */
  .browse-controls {
    width: 100%;
    justify-content: flex-end;
  }

  /* 内容区域调整 */
  .content h1,
  .content h2,
  .content h3 {
    scroll-margin-top: 120px;
  }

  .asset-section button{
    scroll-margin-top: 110px;
  }

  /* 消息块调整 */
  .message-block,
  .user-message-block {
    padding: 12px;
    margin-bottom: 12px;
  }

  .title-block {
    padding: 12px;
    margin-bottom: 12px;
    font-size: 17px;
  }

  .tag-block {
    margin-bottom: 12px;
    padding: 12px;
  }

  .translation-status-card {
    margin-bottom: 12px;
    padding: 12px 13px;
    border-radius: 16px;
  }

  .translation-status-header {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }

  .translation-status-title {
    font-size: 14px;
  }

  .translation-status-badge {
    min-height: 24px;
    padding: 3px 10px;
    font-size: 12px;
  }

  .translation-status-topline {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .translation-status-main-value {
    font-size: 26px;
  }

  .translation-status-main-units,
  .translation-status-percent,
  .translation-status-mini-tag,
  .translation-status-meta-value,
  .translation-status-action-pill {
    font-size: 12px;
  }

  .translation-status-progressbar-track {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .translation-status-mini-tag {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }

  .translation-status-meta {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .translation-status-meta-key {
    margin-bottom: 2px;
  }

  .translation-status-bottom {
    margin-top: 10px;
    padding-top: 10px;
    gap: 10px;
  }

  .translation-status-desc {
    min-width: 0;
    font-size: 12px;
    line-height: 1.6;
  }

  .translation-status-desc-inline-note {
    display: inline;
    margin-left: 6px;
    font-size: 11px;
  }

  .translation-status-inline-link {
    margin-left: 6px;
    font-size: 11px;
  }

  .translation-status-inline-panel {
    margin-top: 6px;
    padding-top: 6px;
    font-size: 11px;
  }

  .translation-status-actions {
    width: 100%;
    gap: 6px;
  }

  .translation-status-glossary-panel {
    margin-top: 10px;
    padding-top: 10px;
  }

  .translation-status-glossary-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .translation-status-glossary-heading {
    flex: none;
    min-width: 0;
  }

  .translation-status-glossary-title {
    font-size: 13px;
  }

  .translation-status-glossary-caption {
    font-size: 11px;
    line-height: 1.55;
  }

  .translation-status-glossary-toolbar {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .translation-status-glossary-footer {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .translation-status-section-toggle {
    padding: 2px 8px;
    font-size: 11px;
  }

  .translation-status-section-subtitle,
  .translation-status-section-footer,
  .translation-status-section-summary {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.5;
  }

  .translation-status-glossary-list {
    gap: 6px;
    margin-top: 6px;
  }

  .translation-status-glossary-row {
    padding: 6px 8px;
  }

  .glossary-line {
    gap: 3px;
    line-height: 1.45;
  }

  .glossary-term-inline,
  .glossary-candidate {
    font-size: 12px;
  }

  .tag-block-header {
    margin-bottom: 8px;
  }

  .tag-block-actions {
    gap: 6px;
  }

  .tag-chip {
    min-height: 24px;
    padding: 2px 8px;
    font-size: 12px;
  }

  .tag-picker-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tag-picker-search {
    width: 100%;
  }

  .asset-section {
    margin-bottom: 16px;
  }

  .asset-section-header {
    padding: 14px 16px;
    align-items: flex-start;
  }

  .asset-section-body {
    padding: 0 16px 16px;
  }

  .asset-card {
    padding: 12px;
  }

  .asset-floating-collapse {
    left: 12px;
    bottom: 16px;
    padding: 9px 12px;
    font-size: 12px;
  }

  .asset-floating-collapse-table {
    bottom: 66px;
  }

  /* 布局调整 */
  .layout {
    gap: 0;
    margin-top: 10px;
  }

  /* 目录抽屉中的目录项 */
  .ant-drawer .toc-item {
    padding: 12px 0;
    font-size: 14px;
    line-height: 1.5;
  }

  .ant-drawer .toc-item.level-1 {
    font-weight: 600;
    color: #333;
  }

  .ant-drawer .toc-item.level-2 {
    padding-left: 16px;
    color: #555;
  }

  .ant-drawer .toc-item.level-3 {
    padding-left: 32px;
    color: #666;
    font-size: 13px;
  }

  .ant-drawer .toc-item.active {
    color: #1677ff;
    background: #f0f7ff;
    padding-left: 24px;
    padding-right: 24px;
  }

  .ant-drawer-body {
    padding: 0 24px;
  }

  /* 浮动按钮 */
  .ant-btn-circle {
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.4);
  }

  /* 移动端标题调整 */
  .header-title {
    font-size: 1.2rem;
    max-width: calc(100% - 20px); /* 为标签留出空间 */
    white-space: normal;
  }

  .header-subtitle {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    font-size: 0.85rem;
  }

  .browse-title-row {
    gap: 6px;
    margin-bottom: 2px;
  }

  .browse-title-actions {
    justify-content: flex-end;
    margin-left: auto;
  }

  .browse-result-summary {
    margin: 10px 0 14px;
    padding: 12px 14px;
  }

  .browse-result-summary-title {
    font-size: 15px;
  }

  .browse-result-segments {
    gap: 8px;
  }

  /* 移动端阅读模式标签调整 */
  .header-box .mode-badge.ant-tag {
    font-size: 12px;
    padding: 2px 8px;
    line-height: 1.2;
  }

  .chat-mobile-header-title {
    max-width: 100%;
    white-space: nowrap;
  }

  /* 修复:内容区域允许收缩 */
  .content {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* 修复:消息块文字换行 */
  .message-block,
  .user-message-block {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    min-width: 0;
  }

  /* 修复:KaTeX 数学公式容器 - 防止溢出 */
  .katex-display {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden !important;
    margin: 10px 0;
    padding: 5px 0;
    display: block;
    max-height: none !important;
  }

  /* 确保 KaTeX 内部元素不产生纵向滚动 */
  .katex-display > span {
    overflow-y: hidden !important;
    max-height: none !important;
  }

  /* 修复:行内公式允许换行 */
  .katex {
    white-space: normal;
    max-width: 100%;
    overflow-x: auto;
  }

  /* 修复:代码块和预格式化文本横向滚动 */
  .message-block pre,
  .user-message-block pre,
  .message-block code,
  .user-message-block code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }

  /* 修复:表格横向滚动 */
  .message-block table,
  .user-message-block table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}
