/* 评论（OI-wiki风格重构，白色风格） */
.comment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid #bbb;
  background: #ffffff;
  color: #000000;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 0;
  margin-top: 0;
  transition: background 0.2s, color 0.2s, border 0.2s;
  opacity: 0;
  outline: none;
  position: absolute;
  left: 100%;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.comment-btn:hover {
  background: #f3f3f3;
  color: #000;
  border-color: #888;
}
article ol > li {
  position: relative;
}
article ol > li:hover .comment-btn {
  opacity: 1;
}
.comment-btn svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
  fill: currentColor;
}
#comment-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  color: #23272f;
  box-shadow: -2px 0 16px rgba(0,0,0,0.12);
  z-index: 9999;
  display: none;
  flex-direction: column;
  border-left: 1.5px solid #eee;
  font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}
#comment-drawer.active {
  display: flex;
}
#comment-drawer .drawer-close {
  align-self: flex-end;
  margin: 12px 16px 0 0;
  font-size: 22px;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}
#comment-drawer .drawer-close:hover {
  color: #222;
}
#comment-drawer .drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 24px 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#comment-box {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 16px 24px 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#comment-box input, #comment-box textarea {
  background: #fff;
  color: #23272f;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 8px;
  font-size: 15px;
  margin-bottom: 4px;
  resize: vertical;
}
#comment-box textarea {
  min-height: 60px;
  max-height: 200px;
}
#comment-box button {
  align-self: flex-end;
  background: #23272f;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 18px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}
#comment-box button:hover {
  background: #444;
}
#comment-list {
  flex: 1;
  padding: 12px 24px 0 24px;
  overflow-y: auto;
}
.comment-item {
  margin-bottom: 18px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}
.comment-nick {
  font-weight: bold;
  color: #23272f;
  margin-right: 8px;
}
.comment-date {
  color: #888;
  font-size: 13px;
  margin-left: 4px;
}
.comment-content {
  margin-top: 4px;
  word-break: break-all;
  /* 不要 white-space: pre-wrap，否则 markdown 换行和代码块会失效 */
  /* markdown 基础样式 */
  font-size: 15px;
}
.comment-content h1,
.comment-content h2,
.comment-content h3,
.comment-content h4,
.comment-content h5,
.comment-content h6 {
  font-weight: bold;
  margin: 1em 0 0.5em 0;
  line-height: 1.3;
}
.comment-content ol,
.comment-content ul {
  margin: 0.5em 0 0.5em 1.5em;
  padding: 0 0 0 1.2em;
}
.comment-content li {
  margin: 0.2em 0;
  line-height: 1.7;
}
.comment-content blockquote {
  border-left: 3px solid #eee;
  color: #888;
  margin: 0.5em 0 0.5em 0;
  padding: 0.5em 1em;
  background: #fafbfc;
  font-style: italic;
}
.comment-content hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 1em 0;
}
.comment-content pre {
  background: #f6f8fa;
  border-radius: 4px;
  padding: 0.7em 1em;
  overflow-x: auto;
  font-size: 14px;
  margin: 0.5em 0;
}
.comment-content code {
  background: #f6f8fa;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 14px;
}
