/* ========================================
   山顶官网 · 设计系统
   微拟物光影 = 渐变 + 立体阴影 + 微交互
   一切颜色经 CSS 变量 + color-mix 派生
   ======================================== */
:root {
  --primary:   #c8322f;         /* 报名系统同款中国红 */
  --primary-d: #9e2320;
  --ink:       #1a1a1f;
  --muted:     #8a8a94;
  --line:      #ececf0;
  --bg:        #f5f5f7;
  --card:      #ffffff;
  --radius:    20px;
  --radius-lg: 28px;
  --shadow: 0 10px 30px rgba(0,0,0,.12),
            inset 0 1px 0 rgba(255,255,255,.7),
            inset 0 -2px 6px rgba(0,0,0,.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; touch-action: manipulation; }
img { max-width: 100%; }

/* ========================================
   主页 · 视频背景 Hero
   ======================================== */
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero__mask {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 35%, rgba(0,0,0,.55) 100%);
}
/* 声音开关 - 右下角浮动，半透明胶囊 */
.sound-toggle {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  padding: 10px 18px; border-radius: 999px;
  color: #fff; font-size: 14px; font-weight: 600;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(4px);
  transition: all .2s ease;
}
.sound-toggle:hover { background: rgba(0,0,0,.6); transform: scale(1.04); }
.sound-toggle:active { transform: scale(.96); }
.sound-toggle.on {
  background: linear-gradient(135deg, var(--primary),
    color-mix(in srgb, var(--primary) 80%, black));
  border-color: transparent;
}

/* ========================================
   导航栏 - 半透明悬浮
   ======================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 64px);
}
.nav__brand {
  color: #fff; font-size: 22px; font-weight: 800; letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  display: inline-flex; align-items: center; flex: 0 0 auto;
}
/* 山顶 SVG logo - 透明背景，投影保证深色字标在视频上可辨 */
.nav__logo {
  height: 44px; display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.55));
}
/* 内页 logo - 浅色背景，无需投影，作页眉品牌标识 */
.page-logo {
  height: 34px; display: block;
}
.page-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 22px;
}
.page-head a.back { font-size: 24px; color: var(--muted); line-height: 1; }
.page-head h1 { font-size: 22px; font-weight: 800; }
.page-head .sep { width: 1px; height: 24px; background: var(--line); }
.nav__menu { display: flex; gap: 12px; align-items: center; }
.nav__btn {
  padding: 9px 20px; border-radius: 14px;
  color: #fff; font-size: 15px; font-weight: 600;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  transition: all .2s ease;
}
.nav__btn:hover { background: rgba(255,255,255,.26); transform: scale(1.02); }
.nav__btn:active { transform: scale(.97); }
.nav__btn--user { background: rgba(255,255,255,.22); }
/* 乐龄顾问报名 - 主色强调，从导航栏中脱颖 */
.nav__btn--accent {
  background: linear-gradient(135deg, var(--primary),
    color-mix(in srgb, var(--primary) 80%, black));
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(200,50,47,.4),
              inset 0 1px 0 rgba(255,255,255,.3);
}
.nav__btn--accent:hover { background: linear-gradient(135deg,
  color-mix(in srgb, var(--primary) 92%, white), var(--primary)); }

/* ========================================
   Hero 文案 + 报名入口
   ======================================== */
.hero__body {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 0 24px;
}
.hero__title {
  color: #fff; font-size: clamp(34px, 6vw, 68px); font-weight: 900;
  letter-spacing: 3px; text-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.hero__sub {
  color: rgba(255,255,255,.9); margin-top: 18px;
  font-size: clamp(15px, 2vw, 20px); letter-spacing: 1px;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.cta {
  margin-top: 40px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 42px; border-radius: var(--radius);
  color: #fff; font-size: 18px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(135deg, var(--primary),
    color-mix(in srgb, var(--primary) 82%, black),
    color-mix(in srgb, var(--primary) 68%, black));
  box-shadow: 0 12px 34px rgba(200,50,47,.45),
              inset 0 1px 0 rgba(255,255,255,.4),
              inset 0 -3px 8px rgba(0,0,0,.2);
  transition: all .2s ease;
}
.cta:hover { transform: translateY(-2px) scale(1.02); }
.cta:active { transform: scale(.97); }
.cta__arrow { font-size: 20px; }

/* ========================================
   通用卡片 / 表单元件
   ======================================== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field label .req { color: var(--primary); margin-right: 3px; }
.field input, .field select {
  width: 100%; padding: 13px 15px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fafafb; outline: none; transition: all .2s ease;
}
.field input:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
  background: #fff;
}
.btn {
  width: 100%; padding: 14px; border-radius: 14px;
  font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary),
    color-mix(in srgb, var(--primary) 80%, black));
  box-shadow: 0 8px 20px rgba(200,50,47,.35),
              inset 0 1px 0 rgba(255,255,255,.35);
  transition: all .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn--ghost {
  background: #fff; color: var(--primary);
  border: 1.5px solid var(--primary); box-shadow: none;
}
.btn--sm { width: auto; padding: 11px 18px; font-size: 14px; }
.msg { font-size: 13px; margin-top: 6px; min-height: 18px; }
.msg--err { color: var(--primary); }
.msg--ok  { color: #12864a; }

/* ========================================
   Modal - 登录/注册弹窗
   ======================================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  width: 100%; max-width: 400px;
  animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; } }
.modal__title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.modal__x {
  position: absolute; top: 14px; right: 16px;
  font-size: 22px; color: var(--muted); background: none;
}
.tabs { display: flex; gap: 8px; margin: 16px 0 20px; }
.tab {
  flex: 1; padding: 10px; border-radius: 12px; font-weight: 700;
  background: #f0f0f3; color: var(--muted); transition: all .2s ease;
}
.tab.active { background: var(--primary); color: #fff; }
.sms-row { display: flex; gap: 10px; }
.sms-row input { flex: 1; }

/* ========================================
   乐龄顾问报名 · 二维码弹窗（紧凑一屏）
   ======================================== */
.qr-modal { max-width: 300px; padding: 22px 22px 20px; }
.qr-modal__title { font-size: 16px; font-weight: 800; line-height: 1.4; padding: 0 14px; }
.qr-modal__hint { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.qr-modal__canvas {
  width: 180px; height: 180px; margin: 0 auto; padding: 10px;
  background: #fff; border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex; align-items: center; justify-content: center;
}
.qr-modal__canvas svg { width: 100%; height: 100%; display: block; }
.qr-modal__url { color: var(--muted); font-size: 11px; margin: 10px 0 14px; word-break: break-all; }

/* ========================================
   H5 适配 - 小屏触控与安全区
   ======================================== */
@media (max-width: 640px) {
  .hero { min-height: 100svh; height: 100dvh; }
  .nav {
    align-items: center;
    gap: 8px;
    padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  }
  .nav__logo { height: 34px; }
  .nav__menu { flex: 1; min-width: 0; justify-content: flex-end; gap: 6px; }
  .nav__btn {
    padding: 8px 7px;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
  }
  .nav__btn--user {
    width: 66px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero__body { padding: 0 18px; }
  .hero__title { font-size: clamp(32px, 9vw, 40px); letter-spacing: 1px; }
  .cta { margin-top: 28px; padding: 15px 30px; font-size: 16px; }
  .sound-toggle {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    padding: 9px 14px;
    font-size: 13px;
  }

  .page-head { gap: 10px; margin-bottom: 18px; }
  .page-head h1 { font-size: 20px; }
  .page-logo { height: 30px; }
  .card { border-radius: 18px; padding: 18px; }
  .field input, .field select, textarea { font-size: 16px; }

  .modal-mask {
    align-items: flex-start;
    overflow-y: auto;
    padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  }
  .modal { margin: auto 0; }
  .modal__title { font-size: 20px; }
  .sms-row { gap: 8px; }
  .sms-row .btn--sm { flex: 0 0 auto; padding: 11px 12px; }
  .qr-modal { max-width: 300px; padding: 20px; }
  .qr-modal__canvas { width: min(180px, 58vw); height: min(180px, 58vw); }
}

@media (max-width: 360px) {
  .nav { gap: 6px; padding-inline: 10px; }
  .nav__logo { height: 30px; }
  .nav__menu { gap: 4px; }
  .nav__btn { padding: 7px 6px; font-size: 11px; }
  .nav__btn--user { width: 50px; }
}
