/* 在线留言弹层（共享挂件样式，由 includes/message-modal.php 引入）
   三主题共用；手机端整屏主题色深底，PC 端双栏白卡。
   手机表单只有 5 个输入框（占位文字即字段名），圆角 5px，顶部放站点 LOGO，无任何提示标语；
   PC 表单字段相同，表单区上方保留「在线留言」标题提示。
   开合：PC 从左下向右上 .62s 弹出、原路收回；手机以触发图标为原点用 clip-path 像布一样
   弹性展开（.68s），点 X 后从右上角收成一条竖长片再消失，全程不做整块缩放，避免尺寸跳变。 */
/* ==================== 弹层骨架 ==================== */
.msg-layer {
  position: fixed; inset: 0; z-index: 200; padding: 24px;
  display: flex; align-items: center; justify-content: center;
}
.msg-layer[hidden] { display: none; }
body.msg-open { overflow: hidden; }
.msg-mask {
  position: absolute; inset: 0; background: rgba(8, 20, 34, .6);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .62s ease;
}
.msg-layer.is-open .msg-mask { opacity: 1; }
.msg-dialog {
  position: relative; display: grid; grid-template-columns: 322px minmax(0, 1fr);
  width: 880px; max-width: 100%; max-height: calc(100vh - 48px);
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(6, 18, 32, .38);
  opacity: 0; transform: translate(-76px, 76px) scale(.94); transform-origin: 0 100%;
  transition: transform .62s cubic-bezier(.22, .68, .24, 1), opacity .5s ease;
}
.msg-layer.is-open .msg-dialog { opacity: 1; transform: none; }
.msg-x {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #000; color: #fff;
  box-shadow: 0 2px 8px rgba(10, 26, 44, .12);
  transition: background .2s, color .2s, transform .22s;
}
.msg-x:hover { background: #333; color: #fff; transform: rotate(90deg); }
.msg-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.msg-x-txt { display: none; }

/* ==================== 左侧品牌介绍（仅 PC） ==================== */
.msg-visual {
  position: relative; padding: 40px 30px 30px; color: #fff;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(160deg, var(--accent-2, #2e9be0) 0%, var(--accent, #147fcd) 48%, var(--accent-dark, #0a4d86) 100%);
}
.msg-visual::after {
  content: ""; position: absolute; right: -70px; bottom: -80px; width: 230px; height: 230px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.msg-kicker { position: relative; font-size: 11px; letter-spacing: 3px; opacity: .82; }
.msg-headline { position: relative; margin-top: 14px; font-size: 26px; line-height: 1.42; font-weight: 700; letter-spacing: 1px; }
.msg-lead { position: relative; margin-top: 14px; font-size: 13px; line-height: 1.9; color: rgba(255, 255, 255, .84); }
.msg-quick { position: relative; margin-top: 26px; display: grid; gap: 14px; }
.msg-quick li { display: flex; align-items: center; gap: 12px; }
.msg-q-ic {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center;
}
.msg-q-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.msg-q-txt { display: flex; flex-direction: column; min-width: 0; }
.msg-q-txt i { font-style: normal; font-size: 11px; letter-spacing: 1px; opacity: .75; }
.msg-q-txt a, .msg-q-txt > span { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .5px; word-break: break-all; }
.msg-note { position: relative; margin-top: auto; padding-top: 24px; font-size: 11.5px; line-height: 1.8; color: rgba(255, 255, 255, .64); }

/* ==================== 表单（PC 两列，只有输入框） ==================== */
.msg-body { padding: 34px 36px 28px; overflow-y: auto; min-height: 0; }
/* 蜜罐字段由共享弹层统一兜底：不依赖主题各自是否定义了 .hp-field（备用手机主题曾露出白条） */
.msg-form .hp-field { display: none; }

/* PC 表单区标题提示：手机端不显示任何标语 */
.msg-body-head { margin-bottom: 20px; }
.msg-body-head h3 { font-size: 20px; font-weight: 700; color: var(--navy, #0e2b4d); letter-spacing: 1px; }
.msg-body-head p { margin-top: 7px; font-size: 12.5px; color: var(--muted-2, #8b96a5); line-height: 1.7; }
/* 手机弹层顶部 LOGO：仅手机显示 */
.msg-logo { display: none; }

.msg-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.msg-field { display: block; min-width: 0; }
.msg-field.msg-field-area { grid-column: 1 / -1; }
.msg-field input, .msg-field select, .msg-field textarea {
  width: 100%; padding: 11px 13px; font-size: 14px; color: var(--text, #1c2430);
  border: 1px solid var(--line, #e6eaf0); border-radius: 5px; background: #fbfcfd; outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.msg-field textarea { resize: vertical; min-height: 104px; line-height: 1.75; }
.msg-field input:focus, .msg-field select:focus, .msg-field textarea:focus {
  border-color: var(--accent, #147fcd); background: #fff; box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 20, 127, 205), .1);
}
.msg-field input::placeholder, .msg-field textarea::placeholder { color: #8b98a6; }
.msg-field select.is-empty { color: #8b98a6; }

.msg-submit {
  grid-column: 1 / -1; width: 100%; height: 46px; border: 0; border-radius: 5px; cursor: pointer;
  background: var(--accent, #147fcd); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 2px;
  transition: background .2s ease;
}
.msg-submit:hover { background: var(--accent-dark, #0a4d86); }
.msg-submit:disabled { opacity: .7; cursor: default; }

.msg-alert {
  margin-bottom: 16px; padding: 12px 14px; border-radius: 5px; font-size: 13px;
  background: #fdf0ee; border: 1px solid #f3cdc6; color: #a12a17;
}
.msg-alert strong { display: block; font-size: 13.5px; }
.msg-alert ul { margin: 6px 0 0 16px; }
.msg-alert li { list-style: disc; line-height: 1.8; }

.msg-done { padding: 24px 0 8px; text-align: center; }
.msg-body.is-done { display: flex; flex-direction: column; }
.msg-body.is-done .msg-done { margin: auto 0; }
.msg-done-ic {
  width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 50%;
  background: rgba(var(--accent-rgb, 20, 127, 205), .1); color: var(--accent, #147fcd);
  display: flex; align-items: center; justify-content: center;
}
.msg-done-ic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.msg-done h4 { font-size: 19px; color: var(--navy, #0e2b4d); letter-spacing: 1px; }
.msg-done p { margin-top: 8px; font-size: 13.5px; color: var(--muted, #6b7787); }
.msg-again {
  margin-top: 20px; height: 40px; padding: 0 22px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--line, #e6eaf0); background: #fff; font-size: 13.5px; color: #45525f;
  transition: border-color .2s, color .2s;
}
.msg-again:hover { border-color: var(--accent, #147fcd); color: var(--accent, #147fcd); }

/* ==================== 手机端：整屏主题深色底 + 5px 圆角输入框 ==================== */
@media (max-width: 1024px) {
  .msg-layer {
    padding: 0; display: block; overflow-y: auto; -webkit-overflow-scrolling: touch;
    /* 弹层底色与内容区一致，展开过程中不露出白底 */
    background-color: var(--accent-dark, #0a4d86);
    background-image: linear-gradient(rgba(0, 0, 0, .22), rgba(0, 0, 0, .22));
  }
  .msg-mask { display: none; }
  .msg-dialog {
    position: relative; display: flex; flex-direction: column;
    width: 100%; max-width: none; min-height: 100%; height: auto; max-height: none;
    border-radius: 0; box-shadow: none;
    background-color: var(--accent-dark, #0a4d86);
    background-image: linear-gradient(rgba(0, 0, 0, .22), rgba(0, 0, 0, .22));
    overflow: visible;
    /* 全程不做整块 transform：尺寸恒定，避免打开瞬间「先很大、马上变小」。
       以触发图标的位置为起点，用 clip-path 从那一小块像布一样弹性展开。 */
    opacity: 1; transform: none;
    clip-path: inset(var(--msg-in-t, 56%) var(--msg-in-r, 5%) var(--msg-in-b, 36%) var(--msg-in-l, 90%));
    transition: clip-path .68s cubic-bezier(.16, 1.02, .3, 1), opacity .5s ease;
  }
  .msg-layer.is-open .msg-dialog { clip-path: inset(0 0 0 0); opacity: 1; }
  /* 关闭：从右上角开始收回，最后只剩右侧一条竖长片，再淡出 */
  .msg-layer.is-closing .msg-dialog {
    clip-path: inset(0 0 0 92%); opacity: .5;
    transition: clip-path .62s cubic-bezier(.4, 0, .2, 1), opacity .62s ease;
  }
  /* 内容层只做淡入：整块弹层与内容层都不缩放，杜绝「打开先很大、马上变小」 */
  .msg-body { opacity: .55; transition: opacity .5s ease; }
  .msg-layer.is-open .msg-body { opacity: 1; }

  /* 右上角：浅色半透明圆底白叉 + 「关闭」文字；桌面黑底白叉规则不变 */
  .msg-x {
    position: fixed; top: 18px; right: 5%; width: auto; height: 34px; padding: 0 8px 0 2px;
    gap: 7px; border-radius: 999px; background: transparent; color: #fff; box-shadow: none; z-index: 6;
  }
  .msg-x:hover { background: transparent; color: #fff; transform: none; }
  .msg-x svg {
    width: 32px; height: 32px; padding: 8px; box-sizing: border-box;
    background: rgba(255, 255, 255, .26); color: #fff; border-radius: 50%;
  }
  .msg-x-txt { display: inline; font-size: 14px; letter-spacing: 1px; color: #fff; }

  .msg-visual, .msg-body-head { display: none; }
  /* 顶部 LOGO：放在最上面，右上角关闭按钮让位 */
  .msg-logo { display: flex; align-items: center; justify-content: center; width: 90%; min-height: 64px; margin: 0 auto 25px; }
  .msg-logo img { display: block; width: 100%; max-width: 100%; max-height: 58px; height: auto; object-fit: contain; margin: 0 auto; }
  .msg-logo > span { font-size: 24px; font-weight: 700; color: #fff; letter-spacing: 1px; }
  .msg-body { padding: 72px 5% 40px; overflow: visible; background: transparent; }
  .msg-form { display: flex; flex-direction: column; gap: 16px; }

  /* 每个字段只有一个输入框，圆角统一 5px，不再用胶囊 */
  .msg-field {
    display: flex; align-items: center; min-width: 0;
    height: 52px; padding: 0 18px; border-radius: 5px;
    background: rgba(255, 255, 255, .9);
  }
  .msg-field.msg-field-area {
    height: auto; min-height: 112px; align-items: stretch;
    padding: 14px 18px 18px; border-radius: 5px;
  }
  .msg-field input, .msg-field select, .msg-field textarea {
    width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent;
    font-size: 15px; color: var(--text, #1c2430); box-shadow: none;
  }
  .msg-field input:focus, .msg-field select:focus, .msg-field textarea:focus {
    border: 0; background: transparent; box-shadow: none;
  }
  .msg-field input::placeholder, .msg-field textarea::placeholder { color: rgba(0, 0, 0, .42); }
  .msg-field textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
  .msg-field select { -webkit-appearance: none; appearance: none; padding-right: 20px; }
  .msg-field select.is-empty { color: rgba(0, 0, 0, .42); }
  .msg-field-select { position: relative; }
  .msg-field-select::after {
    content: ""; position: absolute; right: 20px; top: 50%;
    width: 8px; height: 8px; pointer-events: none;
    border-right: 2px solid rgba(0, 0, 0, .42); border-bottom: 2px solid rgba(0, 0, 0, .42);
    transform: translateY(-70%) rotate(45deg);
  }

  .msg-submit {
    height: 58px; border-radius: 5px; background: rgba(255, 255, 255, .9);
    color: var(--navy, #0e2b4d); font-size: 16px; letter-spacing: 2px;
  }
  .msg-submit:hover { background: #fff; }
  .msg-alert { background: rgba(255, 255, 255, .9); border: 0; color: #a12a17; }
  .msg-done h4, .msg-done p { color: #fff; }
  .msg-done-ic { background: rgba(255, 255, 255, .2); color: #fff; }
  .msg-again { background: transparent; border-color: rgba(255, 255, 255, .6); color: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  .msg-x, .msg-submit, .msg-mask, .msg-dialog, .msg-body { transition: none; }
}

/* MOBILE-FONT-PLUS-1PX-BEGIN */
/* 手机端字号统一 +1px：按各断点生效值逐项覆盖，em 相对字号随父级自动 +1 */
@media (min-width: 769px) and (max-width: 1024px) {
  .msg-kicker { font-size: 12px; }
  .msg-headline { font-size: 27px; }
  .msg-lead { font-size: 14px; }
  .msg-q-txt i { font-size: 12px; }
  .msg-q-txt a { font-size: 18px; }
  .msg-q-txt > span { font-size: 18px; }
  .msg-note { font-size: 12.5px; }
  .msg-body-head h3 { font-size: 21px; }
  .msg-body-head p { font-size: 13.5px; }
  .msg-field input { font-size: 16px; }
  .msg-field select { font-size: 16px; }
  .msg-field textarea { font-size: 16px; }
  .msg-submit { font-size: 17px; }
  .msg-alert { font-size: 14px; }
  .msg-alert strong { font-size: 14.5px; }
  .msg-done h4 { font-size: 20px; }
  .msg-done p { font-size: 14.5px; }
  .msg-again { font-size: 14.5px; }
  .msg-x-txt { font-size: 15px; }
  .msg-logo > span { font-size: 25px; }
}

@media (max-width: 768px) {
  .msg-kicker { font-size: 12px; }
  .msg-headline { font-size: 27px; }
  .msg-lead { font-size: 14px; }
  .msg-q-txt i { font-size: 12px; }
  .msg-q-txt a { font-size: 18px; }
  .msg-q-txt > span { font-size: 18px; }
  .msg-note { font-size: 12.5px; }
  .msg-body-head h3 { font-size: 21px; }
  .msg-body-head p { font-size: 13.5px; }
  .msg-field input { font-size: 16px; }
  .msg-field select { font-size: 16px; }
  .msg-field textarea { font-size: 16px; }
  .msg-submit { font-size: 17px; }
  .msg-alert { font-size: 14px; }
  .msg-alert strong { font-size: 14.5px; }
  .msg-done h4 { font-size: 20px; }
  .msg-done p { font-size: 14.5px; }
  .msg-again { font-size: 14.5px; }
  .msg-x-txt { font-size: 15px; }
  .msg-logo > span { font-size: 25px; }
}
/* MOBILE-FONT-PLUS-1PX-END */
