/* ==========================================================================
   gbook.php 留言提交表单 —— 美化样式(仅样式层，不涉及功能代码)
   - 标签(名称)与填写框保持同一行，行间距紧凑
   - 无卡片/无框架，避免 iframe 内出现多余的上下滚动条
   - 纯 CSS 自适应 iframe 宽度(桌面/平板/手机)
   ========================================================================== */

html, body { margin: 0; padding: 0; }
.gbooklist,
.gbooklist *,
.gbooklist *::before,
.gbooklist *::after { box-sizing: border-box; }

.gbooklist {
  --brand: #e87708;
  --brand-dark: #cc6705;
  --border: #d9dfe8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Helvetica Neue", Arial, sans-serif;
  color: #4a5160;
  font-size: 14px;
  line-height: 1.5;
  max-width: 820px;   /* 仅限制超宽屏，无任何视觉框架 */
  margin: 0 auto;
}

/* ---------- 基础表格：名称左列 + 填写控件右列，保持同行 ---------- */
.msg_table {
  width: 100%;
  border-collapse: collapse;
}
.msg_table th {
  text-align: right;
  font-weight: 600;
  color: #33404f;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;   /* 桌面端标签不折行 */
  vertical-align: middle;
  padding: 8px 14px 8px 0;
}
.msg_table td {
  text-align: left;
  vertical-align: middle;
  padding: 8px 0;
}
/* 多行文本的行：让标签贴近顶部而不是居中 */
.msg_table th:has(+ td textarea) { vertical-align: top; padding-top: 12px; }

/* 必填红星(内联在填写框右侧，不换行、不占新行) */
.gbooklist .red_zi {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #ff4757;
  margin-left: 3px;
  vertical-align: middle;
}

/* ---------- 文本 / 数字输入框 ---------- */
.gbookform input[type="text"],
.gbookform input[type="number"] {
  display: inline-block;
  width: calc(100% - 28px);
  max-width: 420px;
  min-width: 140px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #2f3640;
  font-size: 14px;
  outline: none;
  vertical-align: middle;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gbookform input[type="text"]::placeholder,
.gbookform input[type="number"]::placeholder { color: #a9b2c0; }

/* ---------- 多行文本(尽量少占高度) ---------- */
.gbookform textarea {
  display: inline-block;
  width: calc(100% - 28px);
  max-width: 420px;   /* 与文本输入框同宽，保证各行控件右缘对齐 */
  min-height: 88px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #2f3640;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  vertical-align: top;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ---------- 下拉选择(自定义字段 class 6) ---------- */
.gbookform .select {
  position: relative;
  display: inline-block;
  min-width: 200px;
  max-width: 100%;
  vertical-align: middle;
}
.gbookform .select::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 2px solid #98a2b3;
  border-bottom: 2px solid #98a2b3;
  transform: rotate(45deg);
  pointer-events: none;
}
.gbookform .select select {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #2f3640;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 聚焦高亮 */
.gbookform input[type="text"]:focus,
.gbookform input[type="number"]:focus,
.gbookform textarea:focus,
.gbookform .select select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232, 119, 8, 0.14);
}

/* ---------- 单选 / 复选(自定义字段 class 4 / 5) ---------- */
.gbookform .radio,
.gbookform .checkbox {
  position: relative;
  display: inline-block;
  margin: 0 14px 0 0;
  padding: 0;
  height: 20px;
  line-height: 20px;
  cursor: pointer;
}
.gbookform .radio > input,
.gbookform .checkbox > input {
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.gbookform .radio > label,
.gbookform .checkbox > label {
  display: inline-block;
  margin: 0;
  padding: 0 0 0 28px;
  line-height: 20px;
  color: #3a4150;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.gbookform .radio > label::before,
.gbookform .checkbox > label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 1.5px solid #c9d1dd;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.gbookform .radio > label::before  { border-radius: 50%; }
.gbookform .checkbox > label::before { border-radius: 4px; }

/* 单选选中：白色圆点 */
.gbookform .radio > label::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 0.18s ease;
}
/* 复选选中：白色对勾 */
.gbookform .checkbox > label::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.18s ease;
}
.gbookform .radio input:checked + label::before,
.gbookform .checkbox input:checked + label::before {
  border-color: var(--brand);
  background: var(--brand);
}
.gbookform .radio input:checked + label::after { transform: scale(1); }
.gbookform .checkbox input:checked + label::after { transform: rotate(-45deg) scale(1); }

/* ---------- 验证码 ---------- */
.gbookform .form-inline { display: inline-block; vertical-align: middle; }
.gbookform input#imgcode {
  display: inline-block;
  width: 150px;
  height: 36px;
  padding: 0 12px;
}
.gbookform .imgcode img {
  display: block;
  height: 36px;
  width: auto;
  border-radius: 6px;
  border: 1px solid #e3e8f0;
  background: #f7f8fa;
  cursor: pointer;
}

/* ---------- 提交按钮 ---------- */
.msg_table tr:last-child td { padding-top: 12px; }
.gbooklist .red_btn {
  width: 180px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffa544 0%, var(--brand) 55%, var(--brand-dark) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 6px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(232, 119, 8, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.gbooklist .red_btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 16px rgba(232, 119, 8, 0.35);
  transform: translateY(-1px);
}
.gbooklist .red_btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(232, 119, 8, 0.2);
}

/* ---------- 校验提示(Validform)：错误时显示在控件下方新行 ---------- */
.gbookform .Validform_checktip {
  display: block;
  width: 100%;
  font-size: 12px;
  color: #97a0af;
  margin: 2px 0 0;
}
.gbookform .Validform_right { color: #22a35c; background-image: none; padding-left: 0; }
.gbookform .Validform_wrong { color: #ff4757; background-image: none; padding-left: 0; }
.gbookform .Validform_error { background-color: #fff4f2; }

/* ==========================================================================
   手机端适配(窄 iframe / 窄屏)
   ========================================================================== */
@media (max-width: 600px) {
  .gbooklist { max-width: none; margin: 0; }
  .msg_table th { font-size: 14px; padding: 8px 10px 8px 0; }
  .msg_table td { padding: 8px 0; }

  .gbookform input[type="text"],
  .gbookform input[type="number"] { height: 40px; font-size: 15px; min-width: 110px; }
  .gbookform textarea { min-height: 90px; font-size: 15px; }
  .gbookform .select select { height: 40px; font-size: 15px; }
  .gbookform .radio > label,
  .gbookform .checkbox > label { font-size: 15px; }

  .gbooklist .red_btn { width: 100%; height: 46px; font-size: 16px; }
}
