/* 确保文章内容区域允许文本选择 */
#articleContent {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* 确保评论图标在移动端可点击 */
#comment-icon {
  -webkit-touch-callout: default;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.detail-content-title {
  color: rgba(0, 0, 0, 0.85);
  font-size: 26px;
  line-height: 31px;
  vertical-align: bottom;
  margin-bottom: 12px;
}

.detail-content-title-other-wrap {
  font-size: 14px;
  display: flex;
  align-items: center;
  color: var(--pai-color-999-gray);
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--pai-hr-color-1);
}

.detail-content-title-other-img {
  height: 22px;
  width: 22px;
  border-radius: 50%;
}
.detail-content-title-other-name {
  color: #62749f;
  margin-left: 8px;
  margin-right: 16px;
}
.detail-content-title-other-time {
  margin-right: 16px;
}

.detail-content-title-other-look {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 28px;
  padding: 0 11px;
  height: 20px;
  border-radius: 20px;
  font-size: 12px;
  color: #3973ff;
  border: 1px solid #3973ff;
  cursor: pointer;
}

.com-opt-link,
.com-opt-text {
  display: inline-block;
  vertical-align: middle;
  color: var(--pai-color-999-gray);
}

[class*="com-i-"],
[class^="com-i-"] {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  background-size: 100% auto;
}

.com-opt-link:hover .com-i-edit,
.com-opt-link:hover .com-i-delete {
  fill: var(--pai-brand-2-hover);
}

.com-opt-link .com-i-edit,
.com-opt-link .com-i-delete {
  fill: var(--pai-color-999-gray);
}

.detail-content-title-edit [class*="com-i-"],
.detail-content-title-edit [class^="com-i-"] {
  position: relative;
}

.detail-content-title-edit {
  position: absolute;
  right: 0;
  top: 0;
  line-height: 20px;
}

/* home 适配 */
@media screen and (max-width: 768px) {
  .layout-side,
  .article-suspended-panel {
    display: none !important;
  }
  .layout-main {
    padding: 0 !important;
  }
  .article-suspended-panel-md {
    visibility: visible;
  }
  .foot {
    margin-bottom: 72px;
  }
}

/* 视频容器样式 */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 宽高比 */
  height: 0;
  overflow: hidden;
  margin: 1.5em 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* 移动端视频容器优化 */
@media screen and (max-width: 768px) {
  .video-container {
    margin: 1em 0;
    border-radius: 4px;
  }

  .video-container iframe {
    border-radius: 4px;
  }
}

/* 文章详情页目录样式优化 - 解决双滚动条问题 */
.article-detail {
  position: relative;
  z-index: 1; /* 确保页面滚动条可见 */
}

.article-detail .toc-container {
  background-color: transparent; /* 背景透明，让下层滚动条可见 */
  padding: 0;
  position: fixed;
  top: 90px; /* 初始值，会被JS动态调整 */
  right: 0;
  width: 300px;
  z-index: 5;
  /* 不设置max-height和overflow，让内层.widget处理滚动 */
}

.article-detail .toc-container .widget {
  background-color: var(--pai-color-fff-normal); /* 背景色设置在内部容器 */
  padding: 20px;
  padding-right: 8px; /* 给内容留一点右侧空间 */
  box-sizing: border-box;
  max-height: calc(100vh - 120px); /* 设置最大高度，会被JS动态调整 */
  overflow-y: auto; /* 滚动在widget层 */
}

/* 移除arCatalog-body的滚动，让它和arCatalog-line作为一个整体 */
.article-detail .toc-container .arCatalog-body {
  overflow-y: visible !important; /* 覆盖global.css和JS设置的overflow */
  max-height: none !important; /* 移除高度限制 */
  height: auto !important; /* 让高度自适应内容 */
}

/* 引用评论侧边栏样式 */
.quote-content {
  margin-bottom: 3rem;
}
.quote-comment-sidebar {
  position: sticky;
  top: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 16px;
  max-height: 80vh;
  margin-top: 20px;
  overflow-y: auto;
}

.quote-comment-sidebar .widget {
  padding: 0;
  margin-bottom: 0;
}

.quote-comment-sidebar .com-nav-bar-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.quote-comment-form .comment-list-wrap {
  padding: 0;
}

.quote-text {
  background: #f8f9fa;
  color: var(--pai-color-999-gray);
  border-left: 4px solid var(--pai-brand-2-hover);
  padding: 12px;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.quote-comment-form #quoteCommentInput {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-size: 14px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.quote-comment-form #quoteCommentInput:focus {
  outline: none;
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.quote-comment-form .c-btn {
  font-size: 14px;
}

.quote-comment-form .c-btn:disabled {
  background-color: var(--pai-brand-4-disable);
  cursor: not-allowed;
}

.quote-comment-form .c-btn:disabled:hover {
  background-color: var(--pai-color-5-gray);
}

/* 引用评论弹窗样式 (移动端) */
#quoteCommentModal .widget {
  border-radius: 8px;
  background: white;
  margin: 15vh 10vw;
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px;
  width: 100vw;
}

#quoteCommentModal .modal-content {
  border-radius: 8px;
  background: white;
  margin: 15vh 10vw;
  max-height: 70vh;
  overflow-y: auto;
  padding: 0px;
}

#quoteCommentModal .modal-header {
  border-bottom: 1px solid #eee;
  padding: 15px 20px;
}

#quoteCommentModal .modal-title {
  font-size: 16px;
  font-weight: 600;
}

#quoteCommentModal .quote-text {
  background: #f8f9fa;
  color: var(--pai-color-999-gray);
  border-left: 4px solid var(--pai-brand-2-hover);
  padding: 12px;
  margin-top: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 4px;
  max-height: 150px;
  overflow-y: auto;
}

#quoteCommentModal .quote-comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-size: 14px;
  margin-bottom: 10px;
}

#quoteCommentModal .quote-comment-form textarea:focus {
  outline: none;
  border-color: var(--pai-brand-2-hover);
  box-shadow: 0 0 0 2px var(--pai-brand-3-click);
}

#quoteCommentModal .quote-comment-form .c-btn {
  width: 100%;
  font-size: 14px;
}

#quoteCommentModal .quote-comment-form .c-btn:disabled {
  background-color: var(--pai-brand-4-disable);
  cursor: not-allowed;
}

#quoteCommentModal .quote-comment-form .c-btn:disabled:hover {
  background-color: var(--pai-color-5-gray);
}

/* 评论图标样式 */
#comment-icon {
  position: absolute;
  cursor: pointer;
  z-index: 1000;
  background: var(--pai-brand-8-light);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

#comment-icon:hover {
  background: var(--pai-brand-2-hover);
  transform: scale(1.1);
}

/* 评论 Markdown 渲染样式 */
.comment-content-markdown.markdown-rendered {
  word-wrap: break-word;
  word-break: break-word;
  line-height: 0.5;
}

.comment-content-markdown.markdown-rendered p {
  margin: 0.2em 0;
  line-height: 1.5;
}

.comment-content-markdown.markdown-rendered p:first-child {
  margin-top: 0;
}

.comment-content-markdown.markdown-rendered p:last-child {
  margin-bottom: 0;
}

.comment-content-markdown.markdown-rendered p + p {
  margin-top: 0.3em;
}

.comment-content-markdown.markdown-rendered code {
  background-color: #f5f5f5;
  color: #e83e8c;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.comment-content-markdown.markdown-rendered pre {
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 6px 10px;
  overflow-x: auto;
  margin: 0.4em 0;
  font-size: 0.9em;
}

.comment-content-markdown.markdown-rendered pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.85em;
}

.comment-content-markdown.markdown-rendered strong {
  font-weight: 600;
}

.comment-content-markdown.markdown-rendered em {
  font-style: italic;
}

.comment-content-markdown.markdown-rendered del {
  text-decoration: line-through;
  opacity: 0.7;
}

.comment-content-markdown.markdown-rendered a {
  color: var(--pai-brand-2-hover);
  text-decoration: none;
  transition: color 0.2s;
}

.comment-content-markdown.markdown-rendered a:hover {
  color: var(--pai-brand-3-click);
  text-decoration: underline;
}

.comment-content-markdown.markdown-rendered img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0.4em 0;
  display: block;
}

.comment-content-markdown.markdown-rendered ul,
.comment-content-markdown.markdown-rendered ol {
  margin: 0.2em 0;
  padding-left: 1.5em;
  display: block;
}

.comment-content-markdown.markdown-rendered ul {
  list-style-type: disc !important;
  list-style-position: outside !important;
}

.comment-content-markdown.markdown-rendered ol {
  list-style-type: decimal !important;
  list-style-position: outside !important;
}

.comment-content-markdown.markdown-rendered li {
  margin: 0 0;
  display: list-item !important;
  list-style: inherit !important;
  line-height: 1.5;
  padding: 0.1em 0;
}

.comment-content-markdown.markdown-rendered p + ul,
.comment-content-markdown.markdown-rendered p + ol {
  margin-top: 0;
}

.comment-content-markdown.markdown-rendered ul + p,
.comment-content-markdown.markdown-rendered ol + p {
  margin-top: 0.2em;
}

.comment-content-markdown.markdown-rendered blockquote {
  border-left: 3px solid #dfe2e5;
  color: #6a737d;
  padding: 0.2em 0.8em;
  margin: 0.3em 0;
  font-size: 0.95em;
}

.comment-content-markdown.markdown-rendered h1,
.comment-content-markdown.markdown-rendered h2,
.comment-content-markdown.markdown-rendered h3,
.comment-content-markdown.markdown-rendered h4,
.comment-content-markdown.markdown-rendered h5,
.comment-content-markdown.markdown-rendered h6 {
  margin: 0.5em 0 0.2em;
  font-weight: 600;
  line-height: 1.3;
}

.comment-content-markdown.markdown-rendered h1:first-child,
.comment-content-markdown.markdown-rendered h2:first-child,
.comment-content-markdown.markdown-rendered h3:first-child {
  margin-top: 0;
}

.comment-content-markdown.markdown-rendered h1 { font-size: 1.4em; }
.comment-content-markdown.markdown-rendered h2 { font-size: 1.2em; }
.comment-content-markdown.markdown-rendered h3 { font-size: 1.05em; }

.comment-content-markdown.markdown-rendered hr {
  border: none;
  border-top: 1px solid #e1e4e8;
  margin: 0.6em 0;
}

.comment-content-markdown.markdown-rendered table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.4em 0;
  font-size: 0.9em;
}

.comment-content-markdown.markdown-rendered table th,
.comment-content-markdown.markdown-rendered table td {
  border: 1px solid #dfe2e5;
  padding: 6px 13px;
}

.comment-content-markdown.markdown-rendered table th {
  background-color: #f6f8fa;
  font-weight: 600;
}

.comment-content-markdown.markdown-rendered table tr:nth-child(even) {
  background-color: #f6f8fa;
}
