/**
 * 碎语插件样式
 * 自适应主题 CSS 变量，未定义时使用优雅回退
 *
 * @copyright Copyright © 2026 MelMist https://github.com/MelMist/Mist
 */

/*  */
.post {
  border-bottom: none;
}

/* ========== 发布表单 ========== */
.shuo-post-form {
  background: var(--bg-card, #f8f5f0);
  border: 1px solid var(--border-color, #000);
  border-radius: var(--radius, 4px);
  padding: 1rem;
  margin-bottom: 2rem;
}
.shuo-post-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-color, #000);
  border-radius: var(--radius, 4px);
  font-family: sans-serif;
  font-size: 0.92rem;
  color: var(--text, #333);
  background: var(--bg, #fff);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.shuo-post-form textarea:focus {
  border-color: var(--accent, #8b7355);
}
.shuo-post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}
.shuo-post-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.shuo-image-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color, #000);
  border-radius: var(--radius, 4px);
  background: var(--bg, #fff);
  color: var(--text, #333);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}
.shuo-image-btn:hover {
  background: var(--accent, #8b7355);
  color: #fff;
}
.shuo-image-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.shuo-upload-status {
  font-size: 0.78rem;
  color: var(--text-light, #999);
}
.shuo-upload-status.loading { color: var(--accent, #8b7355); }
.shuo-upload-status.success { color: #2e7d32; }
.shuo-upload-status.error { color: #c62828; }
.shuo-submit-btn {
  padding: 0.35em 1.2em;
  border: 1px solid var(--border-color, #000);
  border-radius: var(--radius, 4px);
  background: var(--accent, #8b7355);
  color: #fff;
  font-family: sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.shuo-submit-btn:hover {
  background: #6b5740;
}

/* ========== 碎语列表 ========== */
.shuo-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.shuo-entry {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-color, #000);
}
.shuo-entry-time {
  font-family: sans-serif;
  font-size: 0.9rem;
  color: var(--text-light, #999);
  display: block;
  margin-bottom: 0.35rem;
}
.shuo-entry-text {
  font-family: sans-serif;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text, #333);
  word-break: break-word;
}
.shuo-entry-text p { margin: 0; }
.shuo-entry-text a { color: var(--link, var(--accent, #8b7355)); }
.shuo-entry-text img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius, 4px);
  margin-top: 0.5rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.shuo-entry-text img:hover { opacity: 0.85; }

/* ========== 灯箱 ========== */
.shuo-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
}
.shuo-lightbox.active { display: flex; }
.shuo-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.shuo-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
  transition: opacity 0.2s;
}
.shuo-lightbox-close:hover { opacity: 0.7; }

/* ========== 空状态 ========== */
.shuo-empty {
  text-align: center;
  color: var(--text-light, #999);
  padding: 2rem 0;
  font-size: 0.92rem;
}

/* ========== 分页 ========== */
.shuo-pager {
  text-align: center;
  margin-top: 1.5rem;
}
.shuo-pager .page-navigator {
  display: inline-flex;
  gap: 0.5rem;
}

/* ========== 碎语操作栏 ========== */
.shuo-entry-action {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.4;
}
.shuo-entry-action a,
.shuo-entry-action button {
  font-size: inherit;
  font-family: sans-serif;
  line-height: inherit;
}
.shuo-entry-action a {
  color: var(--text-light, #999);
  text-decoration: none;
  transition: color 0.2s;
}
.shuo-entry-action a:hover {
  color: var(--accent, #8b7355);
}
.shuo-entry-action button {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-light, #999);
  cursor: pointer;
  transition: color 0.2s;
}
.shuo-entry-action button:hover {
  color: var(--accent, #8b7355);
}

/* ========== 点赞按钮 ========== */
.shuo-like-btn {
  display: inline-block;
  transition: color 0.2s;
}
.shuo-like-btn:hover,
.shuo-like-btn.shuo-liked {
  color: var(--accent, #8b7355);
}
.shuo-like-btn .shuo-like-num {
  font-family: sans-serif;
  font-size: 0.8em;
}
.shuo-like-btn.shuo-liking {
  pointer-events: none;
  opacity: 0.6;
}

/* ========== 回复折叠按钮 ========== */
.shuo-reply-toggle {
  display: inline-block;
  transition: color 0.2s;
}
.shuo-reply-toggle:hover,
.shuo-reply-toggle.shuo-expanded {
  color: var(--accent, #8b7355);
}

/* ========== 回复列表 ========== */
.shuo-reply-list {
  display: none;
  list-style: none;
  margin: 0.6rem 0 0 1.2rem;
  padding: 0;
  border-left: 2px solid #e0d5c7;
  padding-left: 0.8rem;
}
.shuo-reply-list.shuo-visible { display: block; }

.shuo-reply-item {
  margin: 0;
  padding: 0.5rem 0;
  border-bottom: 1px dashed #e8e0d5;
}
.shuo-reply-item:last-child { border-bottom: none; }
.shuo-reply-item.comment-by-author .shuo-reply-author {
  color: var(--accent, #8b7355);
  font-weight: 600;
}

.shuo-reply-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
}
.shuo-reply-author {
  font-family: sans-serif;
  color: var(--text-color, var(--text, #333));
  font-weight: 500;
}
.shuo-reply-badge {
  display: inline-block;
  background: var(--accent, #8b7355);
  color: #fff;
  font-family: sans-serif;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.4;
}
.shuo-reply-time {
  font-family: sans-serif;
  color: var(--text-light, #999);
}

.shuo-reply-content {
  font-family: sans-serif;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-color, var(--text, #333));
  word-break: break-word;
}
.shuo-reply-content p { margin: 0; }

.shuo-reply-action {
  margin-top: 0.2rem;
  font-size: 0.78rem;
}
.shuo-reply-action a {
  font-family: sans-serif;
  color: var(--text-light, #999);
  text-decoration: none;
  transition: color 0.2s;
}
.shuo-reply-action a:hover {
  color: var(--accent, #8b7355);
}

/* ========== 嵌套子回复 ========== */
.shuo-reply-children {
  list-style: none;
  margin: 0.3rem 0 0 1rem;
  padding: 0;
  border-left: 2px solid #e8e0d5;
  padding-left: 0.7rem;
}

/* ========== 回复表单 ========== */
.shuo-respond-wrap {
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  background: var(--bg-card, #f8f5f0);
  border: 1px solid var(--border-color, #000);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.06);
}
.shuo-respond-wrap.shuo-respond-hidden {
  display: none;
}
.shuo-respond-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.shuo-respond-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent, #8b7355);
}
.shuo-cancel-reply-wrap { font-size: 0.82rem; }
.shuo-cancel-reply-wrap a {
  color: var(--text-light, #999);
  cursor: pointer;
  transition: color 0.2s;
}
.shuo-cancel-reply-wrap a:hover { color: #c62828; }

.shuo-reply-inputs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.shuo-reply-inputs input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border-color, #000);
  background: var(--bg, #fff);
  font-family: sans-serif;
  font-size: 0.85rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.shuo-reply-inputs input:focus {
  border-color: var(--accent, #8b7355);
  outline: none;
}

.shuo-reply-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-color, #000);
  background: var(--bg, #fff);
  font-family: sans-serif;
  font-size: 0.88rem;
  line-height: 1.7;
  resize: vertical;
  min-height: 4rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.shuo-reply-form textarea:focus {
  border-color: var(--accent, #8b7355);
  outline: none;
}
.shuo-reply-bottom { margin-top: 0.6rem; }
