.md-viewer {
  line-height: 1.67;
  color: #121212;
  word-break: break-word;
  width: 100%;
  max-width: 100%;
}

/* 标题：纯黑、去边框、紧凑 */
.md-viewer h1,
.md-viewer h2,
.md-viewer h3,
.md-viewer h4,
.md-viewer h5,
.md-viewer h6 {
  color: #121212;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}
.md-viewer h1 {
  font-size: 1.6em;
  margin-top: 1em;
  padding-bottom: 0;
  border-bottom: none;
}
.md-viewer h2 {
  font-size: 1.4em;
  margin-top: 1.4em;
  padding-bottom: 0;
  border-bottom: none;
}
.md-viewer h3 {
  font-size: 1.2em;
  margin-top: 1.2em;
}
.md-viewer h4 {
  font-size: 1.1em;
}
.md-viewer h5,
.md-viewer h6 {
  font-size: 0.9em;
  color: #8590a6;
}

/* 段落与列表：保持极简 */
.md-viewer p {
  margin: 0 0 1.2em 0;
}
.md-viewer ul,
.md-viewer ol {
  margin: 0 0 1.2em 0;
  padding-left: 1.8em;
}
.md-viewer ul li {
  list-style-type: disc;
  display: list-item;
  margin-bottom: 0.5em;
}
.md-viewer ol li {
  list-style-type: decimal;
  display: list-item;
  margin-bottom: 0.5em;
}
.md-viewer li > ul,
.md-viewer li > ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}
.md-viewer li > p {
  margin-bottom: 0.5em;
}
.md-viewer li > p:last-child {
  margin-bottom: 0;
}
.md-viewer li::marker {
  color: #8590a6;
} /* 圆点变为知乎标志性浅灰 */

/* 引用块：去背景，仅保留左侧细灰线 */
.md-viewer blockquote {
  margin: 1.2em 0;
  padding: 0 1em;
  color: #8590a6;
  background-color: transparent;
  border-left: 3px solid #d3d3d3;
  border-radius: 0;
}
.md-viewer blockquote p:last-child {
  margin-bottom: 0;
}

/* 代码：统一的浅灰底，去除大红大绿 */
.md-viewer :not(pre) > code {
  padding: 0.2em 0.4em;
  margin: 0 0.2em;
  font-size: 0.9em;
  background-color: #f6f6f6;
  border-radius: 4px;
  color: #121212;
}
.md-viewer pre {
  margin: 1.2em 0;
  padding: 1em 1.2em;
  border-radius: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  line-height: 1.6;
  border: none;
  font-size: 14px !important;
  background-color: #f6f6f6;
}
.md-viewer pre code {
  padding: 0;
  margin: 0;
  background: transparent;
  color: #121212;
  font-size: 14px !important;
}
.md-viewer pre::-webkit-scrollbar {
  height: 6px;
}
.md-viewer pre::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

/* =========================================================
   表格样式：极度轻量化，去外框，仅保留横线
   ========================================================= */
.md-viewer .table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.2em 0;
  border: none;
  border-radius: 0;
}

.md-viewer .table-wrapper table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  border-collapse: collapse;
  background-color: transparent;
}

.md-viewer > table {
  display: block;
  width: max-content;
  min-width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.2em 0;
  border-collapse: collapse;
  border: none;
  border-radius: 0;
  background-color: transparent;
}

/* 单元格：只保留极细底边框，去竖线 */
.md-viewer th,
.md-viewer td {
  padding: 12px 16px;
  white-space: nowrap;
  text-align: left;
  border-right: none;
  border-bottom: 1px solid #ebebeb;
}

/* 表头样式优化 */
.md-viewer th {
  font-weight: 600;
  color: #121212;
  background-color: #f6f6f6;
  border-bottom: 2px solid #ebebeb;
}

/* 移除最后一行的底边框 */
.md-viewer tbody tr:last-child td {
  border-bottom: none;
}

/* 鼠标悬停整行微高亮 */
.md-viewer tbody tr:hover {
  background-color: #fafafa;
}

/* 其他元素 */
.md-viewer a {
  color: #056de8;
  text-decoration: none;
}
.md-viewer a:hover {
  text-decoration: underline;
}
.md-viewer strong {
  font-weight: 600;
  color: #121212;
}

/* 图片：全扁平，无阴影，小圆角 */
.md-viewer img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em auto;
  border-radius: 4px;
  box-shadow: none;
}
.md-viewer hr {
  height: 1px;
  border: none;
  background-color: #ebebeb;
  margin: 2em 0;
}

/* =========================================================
   响应式 (移动端字号放大)
   ========================================================= */
@media (max-width: 768px) {
  .md-viewer {
    font-size: 17px;
    line-height: 1.75;
  }
  .md-viewer h1 {
    font-size: 1.5em;
  }
  .md-viewer h2 {
    font-size: 1.3em;
  }
  .md-viewer h3 {
    font-size: 1.15em;
  }

  .md-viewer p {
    margin-bottom: 1.4em;
  }
  .md-viewer pre,
  .md-viewer pre code {
    font-size: 13.5px !important;
  }
  .md-viewer blockquote {
    margin: 1.2em 0;
    padding: 0 0.8em;
  }
}
