/* ==========================================================================
   form-01 — 表单页 / 成功页 / 后台 共用样式
   响应式策略：移动优先，桌面断点 768px / 1024px
   ========================================================================== */

:root {
  --brand: #111318;
  --brand-hover: #1f6feb;
  --text: #1d2129;
  --text-2: #4e5969;
  --muted: #86909c;
  --border: #d0d7dc;
  --border-soft: #eceef0;
  --field-bg: #ffffff;
  --danger: #d32f2f;
  --danger-bg: #fff5f5;
  --ok: #0f9960;
  --radius: 6px;
  --card-radius: 14px;
  --shadow-card: 0 12px 44px rgba(16, 24, 40, 0.12);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: #f5f6f7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ------------------------------- 页面骨架 ------------------------------- */

.page { min-height: 100vh; display: flex; flex-direction: column; }
.page--plain { background: #f5f6f7; }

/* ------------------------------- Hero / 底图 ------------------------------ */

.hero {
  position: relative;
  width: 100%;
  aspect-ratio: var(--hero-ratio, 16 / 9);
  overflow: hidden;
  background: #101216;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: var(--bg-desktop);
  background-size: var(--bg-size, cover);
  background-position: var(--bg-pos, center center);
  background-repeat: no-repeat;
  transition: background-image 0.2s ease;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay, transparent);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero__logo {
  max-height: 96px;
  width: auto;
  max-width: 60%;
  object-fit: contain;
  margin-bottom: 14px;
}

.hero__title {
  font-size: clamp(22px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hero__subtitle {
  margin-top: 10px;
  font-size: clamp(13px, 2.4vw, 16px);
  max-width: 640px;
  opacity: 0.92;
}

/* ------------------------------- 表单卡片 ------------------------------- */

.main { flex: 1; padding: 0 16px 48px; }
.main--center { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.card {
  position: relative;
  z-index: 2;
  max-width: var(--form-max-width, 900px);
  margin: calc(var(--overlap, 0px) * -1) auto 0;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 30px 26px;
}

.card--message { margin-top: 0; text-align: center; max-width: 460px; padding: 44px 30px; }

/* ------------------------------- 表单元素 ------------------------------- */

.form__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
}
.form__actions--right { justify-content: flex-end; }
.form__actions--center { justify-content: center; }

.form__status { font-size: 13px; color: var(--muted); }
.form__status.is-error { color: var(--danger); }

.field { padding: 18px 0; border-bottom: 1px solid var(--border-soft); }
.field:last-of-type { border-bottom: none; }

.field__label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}
.field__req { color: var(--danger); margin-left: 3px; font-weight: 700; }

.field__help { margin-top: 6px; font-size: 12px; color: var(--muted); }

.field__error {
  display: none;
  margin-top: 7px;
  font-size: 13px;
  color: var(--danger);
}
.field.is-error .field__error,
.field__error.is-visible { display: block; }

.control {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  appearance: none;
}
.control::placeholder { color: var(--muted); }
.control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(17, 19, 24, 0.08);
}

/* 文本类控件使用下划线风格（沿用原项目观感） */
input.control[type='text'],
input.control[type='email'],
input.control[type='tel'],
input.control[type='number'],
input.control[type='date'],
textarea.control {
  height: 44px;
  padding: 0;
  border: none;
  border-bottom: 1px solid #dadada;
  border-radius: 0;
  background: transparent;
}
input.control[type='text']:focus,
input.control[type='email']:focus,
input.control[type='tel']:focus,
input.control[type='number']:focus,
input.control[type='date']:focus,
textarea.control:focus {
  border-bottom: 2px solid var(--brand);
  box-shadow: none;
}
textarea.control { height: auto; padding: 10px 0; line-height: 1.6; resize: vertical; }

.control--sub {
  height: 40px !important;
  padding: 0 12px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: #f7f8fa !important;
  font-size: 14px !important;
}
.control--sub:focus { border-color: var(--brand) !important; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.control--select { padding-right: 42px; cursor: pointer; }

.field.is-error .control { border-color: var(--danger); background: var(--danger-bg); }
.field.is-error input.control[type='text'],
.field.is-error input.control[type='email'],
.field.is-error input.control[type='tel'],
.field.is-error input.control[type='number'],
.field.is-error textarea.control { border-bottom-color: var(--danger); }

/* 选项组 */
.options--checkbox {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.options--radio { display: flex; flex-direction: column; gap: 12px; }

.option { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 9px; }
.option__input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
  flex: none;
  cursor: pointer;
}
.option__label { flex: 1 1 auto; cursor: pointer; font-size: 15px; color: var(--text-2); }
.option__input:checked + .option__label { color: var(--text); font-weight: 500; }
.option__sub { flex: 1 1 100%; margin-top: 10px; }

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 32px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: #f2f3f5; }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #b02525; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn--primary { background: var(--brand); }

/* ------------------------------- 成功页 ------------------------------- */

.message__icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #e8f6ef;
  color: var(--ok);
  font-size: 32px;
  line-height: 62px;
}
.message__title { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.message__meta { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.message__meta code { background: #f2f3f5; padding: 2px 6px; border-radius: 4px; }

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1024px) {
  .card { max-width: 100%; }
}

@media (max-width: 768px) {
  .hero { aspect-ratio: var(--hero-ratio-mobile, 4 / 3); }
  .hero__bg { background-image: var(--bg-mobile); background-size: var(--bg-size-mobile, cover); }
  .hero__overlay { background: var(--overlay-mobile, transparent); }
  .hero__logo { max-height: 64px; max-width: 70%; }

  .main { padding: 0 12px 32px; }
  .card {
    margin-top: calc(var(--overlap-mobile, 0px) * -1);
    padding: 20px 16px;
    border-radius: 12px;
  }
  .form__actions--right { justify-content: stretch; }
  .form__actions--right .btn { width: 100%; }
  .form__actions { flex-wrap: wrap; }
  .form__status { width: 100%; text-align: center; }

  .options--checkbox { grid-template-columns: 1fr; }

  /* iOS Safari 聚焦字号 < 16px 的输入框时会自动放大页面，移动端统一提到 16px */
  .control { font-size: 16px; }
  .control--sub { font-size: 16px !important; }

  /* 复选框触控目标撑到 44px（Apple HIG / WCAG 2.5.8） */
  .option { align-items: center; min-height: 44px; }
  .option__input { width: 20px; height: 20px; margin-top: 0; }
  .option__label { padding: 11px 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
