/* ==========================================================================
   培训会信息采集 · 前台样式
   设计基调：暖米底色 + 白色留白卡片 + 橙色主行动
   ========================================================================== */

:root {
  --brand: #f97316;
  --brand-2: #fb923c;
  --brand-deep: #ea6a0a;
  --ink: #1f2328;
  --ink-2: #4e5969;
  --ink-3: #8a939f;
  --line: #e3e6eb;
  --line-soft: #eef0f3;
  --bg: #f2ece3;
  --card: #ffffff;
  --danger: #f53f3f;
  --ok: #16a34a;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(31, 35, 40, .04), 0 12px 32px rgba(31, 35, 40, .07);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 40px;
}

@media (min-width: 560px) {
  body { background: #e9e2d7; }
  .page {
    min-height: auto;
    margin: 34px auto 44px;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(31, 35, 40, .05), 0 24px 60px rgba(31, 35, 40, .14);
    padding-bottom: 4px;
  }
  .hero { height: 210px; }
}

/* ---------------------------------------------------------------- 顶部 */

.hero {
  position: relative;
  height: 196px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 84% 8%, #f8e4cc 0%, rgba(248, 228, 204, 0) 58%),
    radial-gradient(90% 80% at 8% 92%, #ece0cd 0%, rgba(236, 224, 205, 0) 60%),
    linear-gradient(158deg, #f8f1e7 0%, #efe3d3 100%);
}

.hero::before {
  content: "";
  position: absolute;
  right: -54px;
  top: -66px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 158, 106, .28);
}

.hero::after {
  content: "";
  position: absolute;
  right: 26px;
  top: 96px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .42);
}

.hero-art {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: 206px;
  height: 128px;
  opacity: .95;
}

.hero-chip {
  display: none;
}

/* ---------------------------------------------------------------- 卡片 */

.sheet {
  position: relative;
  margin-top: -34px;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 26px 22px 8px;
  box-shadow: 0 -6px 24px rgba(31, 35, 40, .05);
}

@media (min-width: 560px) {
  .sheet { margin-bottom: 0; padding-bottom: 20px; }
}

.sheet-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.44;
  font-weight: 700;
  letter-spacing: .2px;
  text-align: center;
  color: #17202a;
}

.sheet-sub {
  margin: 10px 0 0;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: .02em;
}

.notice {
  margin: 18px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.55;
}

.sheet-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 22px 0 4px;
}

/* ---------------------------------------------------------------- 表单 */

.field { margin-top: 18px; }

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #2b3440;
  line-height: 1.45;
}

.req {
  color: var(--danger);
  margin-right: 3px;
  font-weight: 700;
}

.opt {
  color: var(--ink-3);
  font-weight: 400;
  font-size: 13px;
  margin-left: 4px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: #b8bfc9;
  pointer-events: none;
  flex: 0 0 auto;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfc;
  color: var(--ink);
  font-size: 16px; /* iOS 下不小于 16px，避免聚焦自动放大 */
  font-family: inherit;
  line-height: 48px;
  transition: border-color .18s, box-shadow .18s, background .18s;
  -webkit-appearance: none;
  appearance: none;
}

.input-wrap input::placeholder {
  color: #aeb6c0;
  font-size: 15px;
}

.input-wrap input:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, .14);
}

.input-wrap input:disabled {
  background: #f5f6f8;
  color: #98a0aa;
}

.field.has-error .input-wrap input {
  border-color: #f8b4b4;
  background: #fffafa;
}

.field.has-error .input-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(245, 63, 63, .12);
}

.err {
  display: none;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.4;
}

.field.has-error .err { display: block; }

textarea.input-area {
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfc;
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  line-height: 1.55;
  resize: vertical;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

textarea.input-area::placeholder { color: #aeb6c0; font-size: 15px; }

textarea.input-area:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, .14);
}

.form-tip {
  margin: 20px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  background: #f7f8fa;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.6;
}

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

.btn-submit {
  display: block;
  width: 100%;
  height: 50px;
  margin-top: 22px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff9d5c 0%, #f97316 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .14em;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(249, 115, 22, .24);
  transition: transform .12s, box-shadow .18s, filter .18s;
  -webkit-tap-highlight-color: transparent;
}

.btn-submit:hover { filter: brightness(1.03); }

.btn-submit:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(249, 115, 22, .2);
}

.btn-submit[disabled] {
  cursor: not-allowed;
  filter: grayscale(.15) brightness(1.02);
  opacity: .72;
  box-shadow: none;
}

.btn-submit .spinner {
  display: none;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
}

.btn-submit.is-loading .spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 成功态 */

.done { padding: 26px 0 12px; text-align: center; }

.done-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop .34s cubic-bezier(.2, .9, .3, 1.3);
}

@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.done-icon svg { width: 30px; height: 30px; color: var(--ok); }

.done-title { margin: 0 0 6px; font-size: 19px; font-weight: 700; }

.done-sub { margin: 0; color: var(--ink-2); font-size: 14px; }

.done-no {
  display: inline-block;
  margin: 16px 0 4px;
  padding: 7px 16px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px dashed #fdba74;
  color: #c2410c;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
}

.done-recap {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8f9fb;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink-2);
}

.done-recap dl { margin: 0; display: grid; grid-template-columns: 68px 1fr; gap: 7px 10px; }
.done-recap dt { color: var(--ink-3); }
.done-recap dd { margin: 0; color: var(--ink); word-break: break-all; }

.btn-ghost {
  display: inline-block;
  margin-top: 20px;
  height: 42px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .18s, color .18s;
}

.btn-ghost:hover { border-color: #c9cfd8; color: var(--ink); }

/* ---------------------------------------------------------------- 页脚 */

.sheet-foot {
  margin-top: 24px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.qr-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}

.qr-entry:hover { border-color: #d6dbe2; background: #fafbfc; color: var(--ink); }
.qr-entry svg { width: 15px; height: 15px; }

.page-foot {
  padding: 6px 22px 10px;
  text-align: center;
  color: #a2aab4;
  font-size: 12px;
  line-height: 1.7;
}

.page-foot .org { color: #8b939e; }

/* ---------------------------------------------------------------- 二维码弹层 */

.qr-modal[hidden] { display: none; }

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 24, 30, .55);
  backdrop-filter: blur(3px);
  animation: fade .18s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.qr-box {
  width: 100%;
  max-width: 320px;
  padding: 24px 22px 20px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  animation: rise .22s cubic-bezier(.2, .8, .3, 1);
}

@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.qr-box h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.qr-box p { margin: 0 0 16px; color: var(--ink-3); font-size: 12.5px; }

.qr-box img {
  width: 208px;
  height: 208px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background: #fff;
}

.qr-url {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-2);
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.qr-close {
  margin-top: 16px;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
}

/* ---------------------------------------------------------------- 关闭状态 */

.closed {
  padding: 34px 8px 40px;
  text-align: center;
}

.closed-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #fff7ed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
}

.closed h2 { margin: 0 0 8px; font-size: 18px; }
.closed p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ---------------------------------------------------------------- 提示条 */

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(12px);
  z-index: 80;
  max-width: calc(100vw - 48px);
  padding: 11px 18px;
  border-radius: 10px;
  background: rgba(31, 35, 40, .92);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
