/* ============================================================
   messages.css —— 留言区专用样式
   依赖 styles.css（基础变量、按钮、页脚）+ skin-sina.css（新浪风覆盖）
   本文件只管留言区自己的版式，不改动任何主站元素。
   ============================================================ */

.msg-wrap {
  max-width: 1000px;
  padding: 0 12px 40px;
}

/* ---------- 页头 ---------- */
.msg-head {
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.msg-head h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #1a1a1a;
  display: inline-block;
  border-left: 4px solid var(--navy);
  padding-left: 10px;
  line-height: 1.25;
}
.msg-lede {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 720px;
}
.msg-lede strong { color: var(--red); font-weight: 700; }

/* ---------- 表单 ---------- */
.msg-form-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px 16px 14px;
  margin-bottom: 26px;
}
.msg-form-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft, #f0f0f0);
  margin-bottom: 14px;
}
.msg-num { flex: none; width: 19px; height: 19px; color: var(--orange); margin-top: 1px; }
.msg-num svg { width: 19px; height: 19px; display: block; }
.msg-form-title h2 { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.msg-form-title p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.msg-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.msg-field { display: block; margin-bottom: 12px; }
.msg-field > span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.msg-field > span em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: 6px;
}
.msg-field input,
.msg-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d8d8d8;
  border-radius: 0;
  background: #fff;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13.5px;
  color: #1a1a1a;
  line-height: 1.7;
  transition: border-color .18s, box-shadow .18s;
}
.msg-field textarea { resize: vertical; min-height: 108px; }
.msg-field input:focus,
.msg-field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(0, 68, 153, .1);
}
.msg-field input::placeholder,
.msg-field textarea::placeholder { color: #aaa; }

.msg-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.msg-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.msg-count.over { color: var(--red); font-weight: 700; }

.msg-alert {
  margin-top: 12px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.7;
  border-left: 3px solid var(--navy);
  background: #f4f7fb;
  color: #1a3f6b;
}
.msg-alert[data-tone="ok"] { border-left-color: #1f8a5b; background: #f2f9f5; color: #12603f; }
.msg-alert[data-tone="err"] { border-left-color: var(--red); background: #fdf3f3; color: #8c1b1b; }

/* 蜜罐：绝对移出视口，真人永远看不到也点不到 */
.msg-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- 留言列表 ---------- */
.msg-list-section { border-top: 1px solid var(--line); padding-top: 16px; }
.msg-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.msg-list-head h2 {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  border-left: 4px solid var(--orange);
  padding-left: 9px;
  line-height: 1.2;
}
.msg-meta { font-size: 12px; color: var(--ink-3); }

.msg-list { display: grid; gap: 0; }
.msg-item {
  padding: 13px 0 12px;
  border-bottom: 1px solid var(--line-soft, #f0f0f0);
}
.msg-item:first-child { border-top: 1px solid var(--line-soft, #f0f0f0); }
.msg-item-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.msg-item-head b { font-size: 13.5px; font-weight: 700; color: var(--navy); }
.msg-item-head time { font-size: 12px; color: var(--ink-3); }
.msg-item-text {
  font-size: 14px;
  line-height: 1.85;
  color: #222;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-loading, .msg-empty {
  padding: 26px 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}
.msg-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.8;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 700px) {
  .msg-wrap { padding: 0 12px 32px; }
  .msg-head { padding: 14px 0 12px; }
  .msg-head h1 { font-size: 22px; }
  .msg-lede { font-size: 13px; }
  .msg-row { grid-template-columns: 1fr; gap: 0; }
  .msg-form-card { padding: 13px 12px 12px; }
  .msg-field textarea { min-height: 96px; font-size: 16px; } /* iOS 上 16px 才不自动放大 */
  .msg-field input { font-size: 16px; }
  .msg-list-head h2 { font-size: 15.5px; }
  .msg-item-text { font-size: 13.5px; }
}
