/*!
 * comments.css —— 详情页「留言板」样式（v1 · 2026-10-04）
 * ---------------------------------------------------------------------------
 * 覆盖页面：/products/:id 、/demands/:id 、/quotes/:id
 * 注入位置：追加在详情页最后一个 section 之后
 *   - 商品  main.product-detail-page      → .product-detail-section  之后
 *   - 需求  main.request-detail-page      → .request-detail-section  之后
 *   - 报价  <main>（.quote-detail-hero 所在的那层）→ .quote-detail-section 之后
 *
 * 宽度口径：内层一律套 .wrap（max-width:1280 + padding:0 20px + margin:auto），
 *          与相邻的 .product-detail-section 等区块左右边界对齐 —— 不自己另设宽度。
 * 背景：section 用 background:inherit 跟随宿主页面底色；卡片本身是白底带边框，
 *      因此在 #fffdf9（商品/需求）与 #f8f5f0（报价）两种底色上都成立。
 *
 * 移除方式：删掉 index.html 里的 comments.css / comments.js 两行引用即可。
 */

/* ------------------------------------------------------------------ 区块外壳 */
.cmt-section {
  background: inherit;
  padding: 0 0 56px;
  box-sizing: border-box;
}
.cmt-section *,
.cmt-section *::before,
.cmt-section *::after { box-sizing: border-box; }

/* ------------------------------------------------------------------ 卡片 */
.cmt-board {
  background: #ffffff;
  border: 1px solid #ede1d4;
  border-radius: 14px;
  padding: 22px 24px 20px;
  box-shadow: 0 1px 2px rgba(60, 42, 28, 0.04);
  color: #26211d;
}

.cmt-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 6px;
}
.cmt-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #26211d;
}
.cmt-count {
  font-size: 13px;
  color: #8b7f74;
}
.cmt-sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #8b7f74;
}

/* 提交结果提示 */
.cmt-msg {
  display: none;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
}
.cmt-msg.err { display: block; color: #c93628; }
.cmt-msg.ok { display: block; color: #2f7d4f; }

/* ------------------------------------------------------------------ 留言列表 */
.cmt-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cmt-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid #f2e9de;
}
.cmt-item:first-child {
  border-top: 0;
  padding-top: 4px;
}
.cmt-av {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7e6dc, #efd2c2);
  color: #a4452f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  user-select: none;
  overflow: hidden;
}
.cmt-av.guest {
  background: #f1ece6;
  color: #8b7f74;
}
.cmt-bd {
  flex: 1 1 auto;
  min-width: 0;
}
.cmt-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 5px;
}
.cmt-nick {
  font-size: 14px;
  font-weight: 600;
  color: #3a3028;
}
.cmt-time {
  font-size: 12px;
  color: #a99c8f;
}
.cmt-del {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #bcada0;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.4;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.cmt-del:hover {
  color: #c93628;
  background: #fbf1ee;
}
.cmt-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.72;
  color: #332a23;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cmt-empty {
  padding: 20px 0 4px;
  text-align: center;
  font-size: 14px;
  color: #a99c8f;
}

/* ------------------------------------------------------------------ 发表表单 */
.cmt-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed #eadfd3;
}
.cmt-field {
  margin: 0 0 12px;
}
.cmt-label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  color: #6b5f55;
}
.cmt-label .opt {
  color: #a99c8f;
  font-weight: 400;
}
.cmt-input,
.cmt-area {
  width: 100%;
  border: 1px solid #e6d9cb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #26211d;
  background: #fffdfa;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cmt-input { max-width: 280px; }
.cmt-area {
  min-height: 92px;
  resize: vertical;
  display: block;
}
.cmt-input::placeholder,
.cmt-area::placeholder { color: #b8ab9d; }
.cmt-input:focus,
.cmt-area:focus {
  border-color: #e0a894;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(201, 54, 40, 0.08);
}
.cmt-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cmt-hint {
  flex: 1 1 auto;
  min-width: 140px;
  font-size: 12px;
  line-height: 1.5;
  color: #a99c8f;
}
.cmt-submit {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: #c93628;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.cmt-submit:hover { background: #b12e21; }
.cmt-submit:disabled { opacity: 0.55; cursor: default; }

/* 蜜罐字段：正常用户看不见，只挡机器人 */
.cmt-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ------------------------------------------------------------------ 窄屏 */
@media (max-width: 720px) {
  .cmt-section { padding-bottom: 72px; }
  .cmt-board {
    padding: 18px 16px 16px;
    border-radius: 12px;
  }
  .cmt-head h2 { font-size: 17px; }
  .cmt-input { max-width: none; }
  .cmt-submit { width: 100%; padding: 12px 22px; }
  .cmt-hint { flex-basis: 100%; }
}
