/* ===== 留言板页面本身：不再单独控制整页 padding，由 global 统一 ===== */
.comment-page {
  width: 100%;
  margin: 0;
  padding: 0 !important;
  box-sizing: border-box;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.comment-hero {
  margin-bottom: 22px;
}

/* ===== Waline 整体做成一张卡片 ===== */
#waline {
  width: 100%;
  box-sizing: border-box;
  background: #ffffff !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  padding: 28px 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 0;

  --waline-theme-color: var(--primary);
  --waline-active-color: var(--primary-dark);
  --waline-bg-color: #ffffff;
  --waline-bg-color-light: #f8fafc;
  --waline-border-color: var(--border-soft);
  --waline-color: var(--text-main);
  --waline-info-color: var(--text-muted);
  --waline-text-color: var(--text-main);
}

#waline .wl-count,
#waline .wl-rss {
  display: none !important;
}

#waline,
#waline .wl-panel,
#waline .wl-editor,
#waline .wl-input,
#waline .wl-sort,
#waline .wl-comments,
#waline .wl-card,
#waline .wl-empty,
#waline .wl-info,
#waline .wl-load-more {
  background-color: transparent !important;
  color: var(--text-main) !important;
}

/* =========================
   输入区
========================= */
#waline .wl-panel {
  order: 1;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#waline .wl-panel::before {
  content: "留下评论";
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 18px;
}

#waline .wl-panel::after {
  display: none !important;
  content: none !important;
}

#waline .wl-header {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: none !important;
  box-shadow: none !important;
}

#waline.editor-expanded .wl-header {
  display: grid;
}

/* 去掉昵称 / 邮箱 / 网址输入框下面的虚线 */
#waline .wl-header,
#waline .wl-meta-head,
#waline .wl-fields,
#waline .wl-panel .wl-header,
#waline .wl-header > *,
#waline .wl-header .wl-item,
#waline .wl-header .wl-field,
#waline .wl-header label,
#waline .wl-header input {
  border-bottom: none !important;
  box-shadow: none !important;
}

#waline .wl-header::before,
#waline .wl-header::after {
  display: none !important;
  content: none !important;
}

/* ===== 评分 ===== */
#waline .rating-box {
  display: flex !important;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
}

#waline .rating-label {
  display: block;
  font-size: 0.96rem;
  font-weight: 700;
  color: #334155;
}

#waline .rating-stars {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

#waline .rating-star {
  appearance: none;
  -webkit-appearance: none;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 1.55rem;
  line-height: 1;
  color: var(--text-muted);
  transition: transform 0.18s ease, color 0.18s ease, text-shadow 0.18s ease;
}

#waline .rating-star:hover {
  transform: scale(1.15);
  color: var(--primary-dark);
}

#waline .rating-star.active {
  color: var(--primary);
  text-shadow: 0 0 6px var(--glow);
}

#waline .rating-text {
  display: block;
  font-size: 0.9rem;
  color: #94a3b8;
}

/* ===== 输入框 ===== */
#waline .wl-input {
  height: 42px;
  border-radius: 12px;
  border: 1px solid #e5e7eb !important;
  background: #fff !important;
  padding: 0 12px;
  box-sizing: border-box;
  color: var(--text-main) !important;
}

#waline .wl-input:focus {
  border-color: var(--primary) !important;
  outline: none;
}

#waline .wl-editor {
  width: 100%;
  min-height: 58px;
  max-height: 58px;
  line-height: 1.75;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #e5e7eb !important;
  background: #f8fafc !important;
  transition: all 0.22s ease;
  overflow: hidden;
  resize: none;
  box-sizing: border-box;
  color: var(--text-main) !important;
}

#waline .wl-editor:focus {
  outline: none;
  border-color: var(--primary) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px var(--glow) !important;
}

#waline.editor-expanded .wl-editor {
  min-height: 150px;
  max-height: 240px;
  overflow: auto;
}

/* ===== 隐藏输入区下方那排小图标 ===== */
#waline .wl-toolbar,
#waline .wl-actions,
#waline .wl-actions .wl-action,
#waline .wl-actions button,
#waline .wl-actions i,
#waline .wl-actions svg,
#waline .wl-footer .wl-action,
#waline .wl-footer .wl-preview,
#waline .wl-footer .wl-upload,
#waline .wl-footer .wl-upload-btn,
#waline .wl-footer .wl-gif,
#waline .wl-footer .wl-emoji,
#waline .wl-upload,
#waline .wl-upload-btn,
#waline input[type="file"] {
  display: none !important;
}

#waline .wl-actions {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  gap: 0 !important;
}

#waline .wl-footer {
  display: none !important;
}

#waline.editor-expanded .wl-footer {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== 提交按钮 ===== */
#waline .wl-submit {
  background: var(--primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
  box-shadow: 0 6px 16px var(--glow);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#waline .wl-submit:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px var(--glow);
}

#waline .wl-submit:active {
  transform: translateY(0);
}

#waline .wl-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* 去掉表情 / GIF / 图片相关入口 */
#waline .wl-emoji,
#waline .wl-gif,
#waline .wl-picker,
#waline .wl-emoji-popup,
#waline .wl-gif-popup {
  display: none !important;
}

/* =========================
   评论区
========================= */
#waline .wl-panel + .wl-sort,
#waline .wl-panel + .wl-comments,
#waline .wl-panel + .wl-empty,
#waline .wl-panel + .wl-info {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #edf2f7;
}

#waline .wl-sort {
  order: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  margin: 24px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid #edf2f7;
  background: transparent !important;
  border-radius: 0;
  box-shadow: none;
}

#waline .wl-sort::before {
  content: "最新评论";
  display: block;
  width: 100%;
  margin-bottom: 10px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
}

#waline .wl-sort a,
#waline .wl-sort button,
#waline .wl-sort span {
  white-space: nowrap;
  font-size: 0.98rem;
}

#waline .wl-comments {
  order: 3;
  width: 100%;
  margin: 0;
  padding: 14px 0 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  min-height: 140px;
}

#waline .wl-comments .wl-empty,
#waline .wl-empty {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  text-align: center;
  font-size: 1.05rem;
  padding: 10px 0 0;
  margin: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

#waline .wl-load-more {
  order: 4;
  width: 100%;
  margin: 12px 0 0;
  padding: 0;
  text-align: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#waline .wl-info {
  order: 5;
  width: 100%;
  margin: 14px 0 0;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ===== 让外侧原头像列隐藏，头像并入卡片 ===== */
#waline .wl-card-item.avatar-inside-card {
  display: block;
}

#waline .wl-card-item.avatar-inside-card > .wl-user {
  display: none !important;
}

#waline .wl-card-item.avatar-inside-card .wl-card {
  width: 100%;
}

/* ===== 评论卡片 ===== */
#waline .wl-card {
  position: relative;
  border: 1px solid #edf2f7 !important;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04) !important;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  background: #fff !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#waline .wl-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06) !important;
}

#waline .wl-card:last-child {
  margin-bottom: 0;
}

#waline .wl-card,
#waline .wl-card * {
  outline: none;
}

/* ===== 评论头部重新强制排版 ===== */
#waline .wl-card .wl-head {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  min-height: 40px;
}

/* 第一行：头像 */
#waline .custom-avatar-slot {
  order: 1 !important;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#waline .custom-letter-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(135deg, #f9a8d4, #fbcfe8);
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(244, 114, 182, 0.18);
}

#waline .custom-letter-avatar.is-admin {
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  color: #7c5c00;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.2);
}

/* 第一行：身份标签 */
#waline .custom-role-badge {
  order: 2 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

#waline .custom-role-badge.is-admin {
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  color: #7c5c00;
  border: 1px solid rgba(180, 120, 0, 0.2);
}

#waline .custom-role-badge.is-visitor {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* 第一行：昵称 */
#waline .wl-nick {
  order: 3 !important;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-main) !important;
  text-decoration: none;
}

/* 第一行：时间 */
#waline .wl-time {
  order: 4 !important;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* 第二行：浏览器 / 系统标签独占一整行 */
#waline .wl-meta {
  order: 20 !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-top: 8px !important;
}

/* ===== 浏览器 / 系统标签 ===== */
#waline .wl-badge,
#waline .wl-browser,
#waline .wl-os {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  box-shadow: none !important;
  font-size: 0.78rem;
  font-weight: 600;
}

#waline .wl-badge *,
#waline .wl-browser *,
#waline .wl-os * {
  color: inherit !important;
}

#waline .wl-meta .wl-badge,
#waline .wl-meta .wl-browser,
#waline .wl-meta .wl-os {
  margin-right: 0;
}

/* ===== 评论内容 ===== */
#waline .wl-content {
  line-height: 1.9;
  font-size: 0.96rem;
  color: #334155;
  word-break: break-word;
  margin-top: 10px;
}

#waline .wl-content p:first-child {
  margin-top: 0;
}

#waline .wl-content img,
#waline .wl-comment img {
  display: block;
  border-radius: 14px;
  max-width: min(100%, 420px);
  height: auto;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* ===== 回复层级优化 ===== */
#waline .wl-replies,
#waline .reply-thread-enhanced {
  margin-top: 14px;
  margin-left: 24px;
  padding-left: 16px;
  border-left: 2px solid #f1f5f9;
}

#waline .wl-reply {
  position: relative;
  margin-top: 12px;
}

#waline .wl-reply::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 22px;
  width: 12px;
  height: 2px;
  background: #e5e7eb;
  border-radius: 999px;
}

/* ===== 操作按钮 ===== */
#waline .wl-action {
  color: #94a3b8;
  transition: color 0.18s ease, transform 0.18s ease;
}

#waline .wl-action:hover {
  color: var(--primary-dark);
}

#waline .wl-like {
  position: relative;
  transition: transform 0.18s ease, color 0.18s ease;
  transform-origin: center;
}

#waline .wl-like:hover {
  transform: scale(1.15);
  color: var(--primary);
}

#waline .wl-like.active {
  color: var(--primary);
}

@keyframes like-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1.12);
  }
}

#waline .wl-like.like-burst {
  animation: like-pop 0.35s ease;
}

#waline .wl-like.like-burst::after {
  content: "❤";
  position: absolute;
  top: -10px;
  right: -8px;
  font-size: 0.8rem;
  color: var(--primary);
  opacity: 0;
  animation: heart-float 0.38s ease;
}

@keyframes heart-float {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(-14px) scale(1);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .comment-page {
    padding: 0 !important;
  }

  #waline {
    padding: 20px 16px 18px;
    border-radius: 20px;
  }

  #waline .wl-sort::before,
  #waline .wl-panel::before {
    font-size: 1.7rem;
  }

  #waline .wl-header {
    grid-template-columns: 1fr;
  }

  #waline .rating-box {
    align-items: flex-start;
    gap: 10px;
  }

  #waline .rating-star {
    font-size: 1.4rem;
  }

  #waline .wl-footer {
    align-items: stretch !important;
  }

  #waline .wl-submit {
    width: 100%;
  }

  #waline .wl-replies,
  #waline .reply-thread-enhanced {
    margin-left: 12px;
    padding-left: 12px;
  }

  #waline .custom-avatar-slot {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  #waline .custom-letter-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 0.92rem;
  }

  #waline .wl-head {
    padding-right: 88px;
  }

  #waline .wl-head > .wl-actions,
  #waline .wl-head > .wl-action,
  #waline .wl-head > .wl-like,
  #waline .wl-head > .wl-reply {
    right: 0;
    margin: 0 !important;
  }
  #waline .wl-content img,
  #waline .wl-comment img {
    max-width: 100%;
  }
}

#waline .custom-action-slot {
  order: 10 !important;
  margin-left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 14px !important;
  flex: 0 0 auto !important;
}

#waline .custom-action-slot .wl-like,
#waline .custom-action-slot .wl-reply,
#waline .custom-action-slot .wl-action,
#waline .custom-action-slot .wl-likecount {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  float: none !important;
  position: static !important;
  margin: 0 !important;
}