/* message.css - 留言中心（前台 /liuyanzhongxin）
 * 配套页面：~/Pages/Web/Liuyanzhongxin/Index.cshtml
 * 壳层复用 list.css（.cms-portal 1200 居中 / .cms-portal__grid / .cms-portal-main__bar / .cms-pager / 空态），
 * 本文件只补：红色标题条、左侧「留言须知」、问答卡片（问题 + 浅灰回复区）、留言表单、提示条、响应式。
 * 视觉约定与全站一致：主色红 #d5100d、链接蓝 #0068b7、灰底 #f7f8fa。
 */

/* ============================================================
 * 页面骨架：与列表页同宽（1200 → 1100 → 视口收窄）
 * ============================================================ */
.cms-msg {
  width: 100%;
  background-color: #fff;
}

.cms-msg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 1200px;
  max-width: 100%;
  height: 61px;
  margin: 25px auto 0;
  padding: 0 24px;
  background-color: #d5100d;
  box-sizing: border-box;
}

.cms-msg__head-title {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 22px;
  font-weight: normal;
  line-height: 32px;
  letter-spacing: 1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cms-msg__head-sub {
  margin: 0;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 22px;
}

/* ============================================================
 * 左侧「留言须知」（274px，与列表页左侧子导航同宽）
 * ============================================================ */
.cms-msg-side {
  flex: 0 0 274px;
  width: 274px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cms-msg-side__head {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 61px;
  padding: 0 20px;
  background-color: #d5100d;
  color: #fff;
  font-size: 22px;
  line-height: 32px;
  box-sizing: border-box;
}

.cms-msg-side__body {
  flex: 1 1 auto;
  padding: 20px 24px 24px;
  background-color: #fff3f3;
  box-sizing: border-box;
}

.cms-msg-side__lead {
  margin: 0;
  color: #666;
  font-size: 15px;
  line-height: 26px;
}

.cms-msg-side__list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #666;
  font-size: 14px;
  line-height: 25px;
}

.cms-msg-side__list li {
  margin-bottom: 6px;
}

.cms-msg-side__stat {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(213, 16, 13, 0.15);
  color: #999;
  font-size: 13px;
  line-height: 26px;
}

.cms-msg-side__stat em {
  margin-right: 6px;
  color: #d5100d;
  font-size: 24px;
  font-style: normal;
  font-weight: bold;
}

.cms-msg-side__btn {
  display: block;
  height: 40px;
  margin-top: 16px;
  border-radius: 2px;
  background-color: #d5100d;
  color: #fff;
  font-size: 16px;
  line-height: 40px;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s;
}

.cms-msg-side__btn:hover {
  background-color: #b90e0c;
  color: #fff;
}

/* ============================================================
 * 右侧问答列表：问题卡片 + 浅灰回复区
 * ============================================================ */
.cms-msg-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.cms-msg-item {
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid #eee;
  border-radius: 2px;
  background-color: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cms-msg-item:hover {
  border-color: #e6c9c9;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.cms-msg-item__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cms-msg-item__row--answer {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid #d5100d;
  background-color: #f7f8fa;
}

.cms-msg-item__badge {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 2px;
  background-color: #d5100d;
  color: #fff;
  font-size: 14px;
  line-height: 26px;
  text-align: center;
}

.cms-msg-item__badge--answer {
  background-color: #0068b7;
}

.cms-msg-item__body {
  flex: 1 1 auto;
  min-width: 0;
}

.cms-msg-item__title {
  margin: 0;
  color: #333;
  font-size: 17px;
  font-weight: bold;
  line-height: 26px;
  word-break: break-word;
}

.cms-msg-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  color: #999;
  font-size: 13px;
  line-height: 20px;
}

.cms-msg-item__user {
  color: #666;
}

.cms-msg-item__meta--answer .cms-msg-item__admin {
  color: #0068b7;
  font-weight: bold;
}

.cms-msg-item__content,
.cms-msg-item__reply {
  margin: 8px 0 0;
  color: #555;
  font-size: 15px;
  line-height: 26px;
  white-space: pre-line;
  word-break: break-word;
}

.cms-msg-item__reply {
  color: #333;
}

/* ============================================================
 * 留言表单
 * ============================================================ */
.cms-msg-form {
  width: 1200px;
  max-width: 100%;
  margin: 30px auto 0;
  box-sizing: border-box;
}

.cms-msg-form__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
  padding: 0 16px;
  background-color: #d5100d;
  box-sizing: border-box;
}

.cms-msg-form__title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: normal;
  line-height: 48px;
}

.cms-msg-form__sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 22px;
}

.cms-msg-form__form {
  padding: 24px 28px 28px;
  border: 1px solid #eee;
  border-top: 0;
  background-color: #fff;
  box-sizing: border-box;
}

.cms-msg-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.cms-msg-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cms-msg-form__field--full {
  margin-top: 16px;
}

.cms-msg-form__field--captcha {
  max-width: 460px;
  margin-top: 16px;
}

.cms-msg-form__label {
  color: #333;
  font-size: 15px;
  line-height: 22px;
}

.cms-msg-form__label em {
  color: #d5100d;
  font-style: normal;
}

.cms-msg-form__hint {
  color: #999;
  font-size: 13px;
  font-weight: normal;
}

.cms-msg-form__input,
.cms-msg-form__textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 2px;
  outline: none;
  background-color: #fff;
  color: #333;
  font-size: 15px;
  line-height: 24px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.cms-msg-form__input:focus,
.cms-msg-form__textarea:focus {
  border-color: #d5100d;
}

.cms-msg-form__textarea {
  min-height: 160px;
  resize: vertical;
  font-family: inherit;
}

.cms-msg-form__captcha {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.cms-msg-form__question {
  flex: 0 0 auto;
  min-width: 110px;
  padding: 10px 14px;
  border: 1px dashed #d5100d;
  background-color: #fff3f3;
  color: #d5100d;
  font-size: 17px;
  line-height: 24px;
  letter-spacing: 1px;
  text-align: center;
  box-sizing: border-box;
}

.cms-msg-form__captcha-input {
  flex: 1 1 auto;
}

.cms-msg-form__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
}

.cms-msg-form__submit {
  height: 42px;
  padding: 0 34px;
  border: 0;
  border-radius: 2px;
  background-color: #d5100d;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.cms-msg-form__submit:hover {
  background-color: #b90e0c;
}

.cms-msg-form__tip {
  color: #999;
  font-size: 13px;
  line-height: 22px;
}

/* 蜜罐字段：视觉上移出视口；正常用户不可见也不可聚焦 */
.cms-msg-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ============================================================
 * 提示条（成功 / 校验错误）
 * ============================================================ */
.cms-msg-alert {
  width: 1200px;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 12px 16px;
  border-radius: 2px;
  font-size: 14px;
  line-height: 24px;
  box-sizing: border-box;
}

.cms-msg-alert--ok {
  border: 1px solid #b7eb8f;
  background-color: #f6ffed;
  color: #237804;
}

.cms-msg-alert--error {
  border: 1px solid #ffccc7;
  background-color: #fff1f0;
  color: #cf1322;
}

.cms-msg-alert__list {
  margin: 0;
  padding-left: 18px;
}

/* ============================================================
 * 响应式（与 list.css 的断点/宽度保持一致）
 * ============================================================ */
@media (max-width: 1280px) {
  .cms-msg__head,
  .cms-msg-form,
  .cms-msg-alert {
    width: 1100px;
  }
}

@media (max-width: 1200px) {
  .cms-msg__head,
  .cms-msg-form,
  .cms-msg-alert {
    width: calc(100% - 40px);
  }
}

@media (max-width: 900px) {
  .cms-msg__head {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
  }

  .cms-msg__head-title {
    font-size: 20px;
    line-height: 30px;
  }

  .cms-msg-side {
    flex: 0 0 auto;
    width: 100%;
  }

  .cms-msg-side__head {
    justify-content: flex-start;
    height: 48px;
    padding: 0 16px;
    font-size: 18px;
  }

  .cms-msg-side__body {
    padding: 14px 16px 18px;
  }

  .cms-msg-item__row--answer {
    padding: 10px 12px;
  }

  .cms-msg-form__head {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 16px;
  }

  .cms-msg-form__title {
    line-height: 30px;
  }

  .cms-msg-form__form {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .cms-msg-form__grid {
    grid-template-columns: 1fr;
  }

  .cms-msg-form__captcha {
    flex-wrap: wrap;
  }

  .cms-msg-form__question {
    min-width: 0;
    width: 100%;
  }

  .cms-msg-item {
    padding: 14px;
  }

  .cms-msg-item__row--answer {
    margin-left: -14px;
    margin-right: -14px;
  }
}

/* ---------------- 独立「我要留言」表单页（/liuyanzhongxin/liuyan） ---------------- */
.cms-msg-form-page {
  padding-bottom: 32px;
}

.cms-msg__back {
  margin-left: auto;
  color: #fff;
  font-size: 13px;
  line-height: 22px;
  text-decoration: none;
  opacity: 0.9;
}

.cms-msg__back:hover {
  color: #fff;
  opacity: 1;
  text-decoration: underline;
}

.cms-msg-form--standalone {
  margin-top: 24px;
}

.cms-msg-form__back {
  display: inline-block;
  margin-left: 18px;
  color: #888;
  font-size: 14px;
  line-height: 38px;
  text-decoration: none;
}

.cms-msg-form__back:hover {
  color: #d5100d;
}
