/* ==========================================================================
   耒欧 LEIOU · 基础层 base.css
   说明：设计令牌 + 基础重置 + 通用排版 + 通用按钮 + 表单控件 + 通用弹窗/提示
        前/后台共用（theme 变量只在此处定义，改色只改这里）
   配色：蓝白渐变体系（清透蓝 + 白），浅色底、克制动效
   ========================================================================== */

/* ---------- 1. 设计令牌（视觉规范） ---------- */
:root {
  /* 主色：深海军蓝（页脚 / 深色渐变带 / 深色文字） */
  --navy-900: #0B2340;
  --navy-800: #123B6E;
  --navy-700: #174C8C;
  --navy-600: #1E5AA8;
  /* 点缀：清透蓝（按钮 / 强调 / 渐变落点） */
  --accent-700: #1F5FC0;
  --accent-600: #2563C4;
  --accent-500: #3C7DE0;
  --accent-400: #6BA3EC;
  --accent-300: #A8C9F4;
  --accent-200: #C9DEF9;
  --accent-100: #E6F0FE;
  /* 辅助：蓝白底 */
  --surface-0: #FFFFFF;
  --surface-1: #F5F9FF;
  --surface-2: #EAF2FE;
  /* 描边与文字 */
  --line: #E2ECF9;
  --line-strong: #CBDBEF;
  --text-900: #16263A;
  --text-700: #3C4E66;
  --text-500: #6B7F96;
  --text-400: #93A5BA;
  --danger: #C0503F;
  --ok: #2E7D64;
  /* 渐变（蓝白主视觉） */
  --grad-blue: linear-gradient(135deg, #3C7DE0 0%, #2563C4 100%);
  --grad-panel: linear-gradient(150deg, #123B6E 0%, #1E5AA8 52%, #2F76CE 100%);
  --grad-soft: linear-gradient(180deg, #F8FBFF 0%, #EBF3FE 100%);
  --grad-navy: linear-gradient(180deg, #0B2340 0%, #123B6E 100%);
  /* 字体：标题走宋体，正文走系统无衬线 */
  --font-serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* 动效与阴影：柔和、不花哨 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-sm: 0 6px 18px -12px rgba(16, 47, 86, .28);
  --shadow-md: 0 18px 40px -26px rgba(16, 47, 86, .38);
  --shadow-lg: 0 34px 70px -34px rgba(16, 47, 86, .45);
  --header-h: 76px;
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-900);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 3px; }
::selection { background: var(--accent-200); color: var(--navy-900); }
[hidden] { display: none !important; }

/* 柔和滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-1); }
::-webkit-scrollbar-thumb { background: #C6D8EE; border-radius: 10px; border: 2px solid var(--surface-1); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-400); }

/* 无障碍：尊重系统减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 3. 布局容器与区块 ---------- */
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 768px) { .wrap { padding-inline: 32px; } }

.section { padding-block: clamp(64px, 8vw, 116px); position: relative; }
/* 浅蓝白渐变底 */
.section--soft { background: var(--grad-soft); }
/* 深蓝渐变带（品牌优势等强调区块） */
.section--blue { background: var(--grad-panel); color: #fff; }
.section--blue .h2, .section--blue .sec-head__title { color: #fff; }
.section--blue .sec-head__sub { color: rgba(255, 255, 255, .74); }
.section--blue .eyebrow { color: var(--accent-200); }

/* 章节标题组 */
.sec-head { max-width: 720px; }
.sec-head--center { margin-inline: auto; text-align: center; }
.sec-head__title { margin: 18px 0 0; }
.sec-head__sub { margin: 16px 0 0; color: var(--text-500); line-height: 2; }
.sec-head--center .eyebrow { justify-content: center; }

/* ---------- 4. 排版 ---------- */
.serif { font-family: var(--font-serif); }
.h1 {
  font-family: var(--font-serif); font-weight: 500; margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.1rem); line-height: 1.2; letter-spacing: .04em;
  color: var(--navy-900);
}
.h2 {
  font-family: var(--font-serif); font-weight: 500; margin: 0; color: var(--navy-900);
  font-size: clamp(1.7rem, 3.2vw, 2.6rem); line-height: 1.32; letter-spacing: .03em;
}
.h3 {
  font-family: var(--font-serif); font-weight: 500; margin: 0;
  font-size: 1.15rem; line-height: 1.5; letter-spacing: .04em;
}
.lead { font-size: clamp(.95rem, 1.1vw, 1.03rem); line-height: 2.05; color: var(--text-500); }
.text-accent { color: var(--accent-600); }
.text-navy { color: var(--navy-900); }

/* 小标签：蓝线 + 字距拉开的英文/小字 */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 11.5px; font-weight: 500; letter-spacing: .34em; text-transform: uppercase;
  color: var(--accent-600);
}
.eyebrow::before { content: ""; width: 30px; height: 1px; background: currentColor; opacity: .85; }

/* 细分割线 */
.divider-line { width: 56px; height: 1px; background: var(--accent-500); border: 0; margin: 28px 0; }
.divider-line--center { margin-inline: auto; }

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 32px; border-radius: 4px; border: 1px solid transparent;
  font-size: 13.5px; letter-spacing: .14em; background: none; white-space: nowrap;
  transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease),
              box-shadow .45s var(--ease), transform .45s var(--ease);
}
.btn i { font-size: .82em; transition: transform .45s var(--ease); }
.btn:hover i { transform: translateX(4px); }
/* 主按钮：蓝白渐变 */
.btn--primary {
  background-image: var(--grad-blue); color: #fff; border-color: transparent;
  box-shadow: 0 12px 26px -16px rgba(37, 99, 196, .8);
}
.btn--primary:hover {
  background-image: linear-gradient(135deg, #2F6FD2 0%, #1F5FC0 100%);
  box-shadow: 0 16px 32px -16px rgba(31, 95, 192, .9); transform: translateY(-1px);
}
/* 次级按钮：淡蓝描边（浅色底适用） */
.btn--ghost { border-color: var(--line-strong); color: var(--navy-800); background: rgba(255, 255, 255, .6); }
.btn--ghost:hover { border-color: var(--accent-400); background: var(--accent-100); color: var(--accent-700); }
/* 深色描边按钮 */
.btn--outline { border-color: var(--navy-800); color: var(--navy-800); }
.btn--outline:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.btn--sm { height: 40px; padding: 0 20px; font-size: 12.5px; letter-spacing: .1em; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* 文字链接（带下划线动效） */
.link-underline { position: relative; padding-bottom: 3px; }
.link-underline::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.link-underline:hover::after { transform: scaleX(1); }

/* ---------- 6. 表单控件（前台线索表单 / 后台表单共用） ---------- */
.field { display: block; margin-bottom: 18px; }
.field__label { display: block; font-size: 12.5px; letter-spacing: .1em; color: var(--navy-800); margin-bottom: 9px; }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__input, .field__textarea, .field__select {
  width: 100%; padding: 13px 15px; font-family: inherit; font-size: 14.5px;
  color: var(--text-900); background: #fff; border: 1px solid var(--line-strong);
  border-radius: 4px; transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.field__textarea { min-height: 118px; resize: vertical; line-height: 1.8; }
.field__input::placeholder, .field__textarea::placeholder { color: var(--text-400); }
.field__input:focus, .field__textarea:focus, .field__select:focus {
  outline: none; border-color: var(--accent-500); box-shadow: 0 0 0 3px rgba(60, 125, 224, .14);
}
.field__error { display: none; margin-top: 6px; font-size: 12.5px; color: var(--danger); }
.field.is-error .field__error { display: block; }
.field.is-error .field__input, .field.is-error .field__textarea { border-color: var(--danger); }
.form-note { font-size: 12.5px; line-height: 1.9; color: var(--text-400); }

/* 输入框内的操作按钮（如密码显隐） */
.field__wrap { position: relative; }
.field__wrap .field__input { padding-right: 46px; }
.field__eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--text-400); transition: color .3s var(--ease);
}
.field__eye:hover { color: var(--navy-800); }

/* 开关（后台上下架 / 启用） */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 42px; height: 22px; border-radius: 22px; background: #C6D8EE;
  transition: background-color .35s var(--ease); position: relative; flex: none;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .35s var(--ease);
  box-shadow: 0 1px 4px rgba(16, 47, 86, .25);
}
.switch input:checked + .switch__track { background: var(--accent-600); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch__text { font-size: 13px; color: var(--text-700); }

/* 数据加载中（前台卡片区 / 后台表格通用） */
.is-loading { opacity: .5; pointer-events: none; }

/* ---------- 7. 通用弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(11, 35, 64, .5); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.overlay.is-open { opacity: 1; visibility: visible; }
.overlay__panel {
  position: relative; width: 100%; background: var(--surface-0); border-radius: 6px;
  box-shadow: var(--shadow-lg); transform: translateY(16px) scale(.985);
  transition: transform .45s var(--ease); max-height: calc(100vh - 40px); overflow: auto;
}
.overlay.is-open .overlay__panel { transform: translateY(0) scale(1); }
.overlay__close {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .92); color: var(--navy-800);
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.overlay__close:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; transform: rotate(90deg); }
body.is-locked { overflow: hidden; }

/* ---------- 8. 轻提示 Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; z-index: 200; transform: translate(-50%, 24px);
  display: flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 4px;
  background: var(--navy-900); color: #fff; font-size: 13.5px; letter-spacing: .05em;
  border: 1px solid rgba(107, 163, 236, .45); box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transition: all .45s var(--ease);
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast i { color: var(--accent-300); }

/* ---------- 9. 入场动效（IntersectionObserver 一次性触发） ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal[data-delay="4"] { transition-delay: .4s; }
