/* ==========================================================================
   麟语智能官网 · 自定义样式
   与 Tailwind CSS (CDN 版) 配合使用：布局交给 Tailwind 工具类，
   这里只承载「组件级样式 / 动画 / 表单态 / 无障碍」等少量必要内容。
   ========================================================================== */

/* ---------- 设计变量（品牌色） ---------- */
:root {
  --primary: #4a6cf7;   /* 科技蓝 */
  --accent:  #ff6b8a;   /* 暖粉 */
  --night:   #0b0d17;   /* 深色背景 */
  --mist:    #e8e8f0;   /* 主文字 */
  color-scheme: dark;   /* 让浏览器原生控件（select/checkbox）按深色渲染 */
}

/* ---------- 基础 ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* 锚点定位时为固定导航预留空间 */
}
body {
  background-color: var(--night);
  color: var(--mist);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: rgba(74, 108, 247, 0.45); color: #fff; }

/* 深色滚动条（WebKit 浏览器） */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0b0d17; }
::-webkit-scrollbar-thumb { background: rgba(74, 108, 247, 0.35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(74, 108, 247, 0.6); }

/* ---------- 通用组件：按钮（渐变 + 44px 最小点击区域） ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.75rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    filter 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}
.btn:active { transform: translateY(0) scale(0.98); }

/* 主按钮：品牌渐变（科技蓝 → 暖粉） */
.btn-primary {
  color: #fff;
  background-image: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 10px 26px -10px rgba(74, 108, 247, 0.65);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 16px 34px -10px rgba(255, 107, 138, 0.5);
}
/* 幽灵按钮：描边式 */
.btn-ghost {
  color: var(--mist);
  border: 1px solid rgba(232, 232, 240, 0.25);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(232, 232, 240, 0.5);
}
/* 小号按钮（导航等紧凑场景） */
.btn-sm { min-height: 40px; padding: 0 1.25rem; font-size: 0.875rem; }
/* 通栏按钮（移动端菜单内） */
.btn-block { width: 100%; }

/* ---------- 通用组件：文字渐变 / 卡片 / 毛玻璃 ---------- */
.text-gradient {
  background-image: linear-gradient(92deg, #a5b4fc 0%, #ff8fa8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card-hover {
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
  border-color: rgba(74, 108, 247, 0.4);
}
.glass {
  background: rgba(17, 20, 39, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
}

/* 章节标题公共样式 */
.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.35em;
}
.section-title {
  margin-top: 0.75rem;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

/* ---------- 顶部导航（固定，滚动后切换毛玻璃） ---------- */
#site-header {
  transition: background 0.35s ease, box-shadow 0.35s ease,
    border-color 0.35s ease, -webkit-backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
#site-header.is-scrolled {
  background: rgba(11, 13, 23, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: rgba(232, 232, 240, 0.07);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* 导航链接（桌面 + 移动共用基础态） */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;                    /* 移动端可用最小点击区域 */
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(232, 232, 240, 0.72);
  transition: color 0.25s ease, background 0.25s ease;
}
#nav-menu .nav-link:hover,
#mobile-menu .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

/* 当前页高亮：蓝→粉同色系渐变底 */
.nav-link.is-active {
  color: #fff;
  background-image: linear-gradient(90deg, rgba(74, 108, 247, 0.28), rgba(255, 107, 138, 0.28));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
#mobile-menu .nav-link { width: 100%; border-radius: 14px; }

/* ---------- Hero 视觉（Writer 式深色渐变 + 星云光斑） ---------- */
.hero-bg {
  background:
    radial-gradient(ellipse 85% 60% at 72% -12%, rgba(74, 108, 247, 0.38), transparent 62%),
    radial-gradient(ellipse 55% 45% at 8% 18%,  rgba(255, 107, 138, 0.15), transparent 62%),
    linear-gradient(180deg, #0b0d17 0%, #10142a 42%, #170f26 78%, #0b0d17 100%);
}
/* 内页页头（较矮） */
.page-hero-bg {
  background:
    radial-gradient(ellipse 70% 80% at 80% -30%, rgba(74, 108, 247, 0.35), transparent 60%),
    radial-gradient(ellipse 45% 55% at 12% 110%, rgba(255, 107, 138, 0.16), transparent 60%),
    linear-gradient(180deg, #0e1122 0%, #0b0d17 100%);
}
/* 模糊光斑 */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
}
.orb-a { animation: orbFloat 13s ease-in-out infinite; }
.orb-b { animation: orbFloat 17s ease-in-out infinite reverse; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(42px, -30px) scale(1.12); }
}
/* 细网格装饰线 */
.grid-lines {
  background-image:
    linear-gradient(rgba(232, 232, 240, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 232, 240, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
}

/* ---------- 滚动浮现动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms); /* 可用 style="--reveal-delay:.15s" 编排节奏 */
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- 漂浮气泡 / 滚动提示 / 心跳（Hero 装饰） ---------- */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.float-slow   { animation: floatY 6s ease-in-out infinite; }
.float-slower { animation: floatY 8.5s ease-in-out infinite 1s; }

@keyframes cueBounce {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.85; }
  50%      { transform: translate(-50%, 9px); opacity: 0.35; }
}
.scroll-cue { animation: cueBounce 2.2s ease-in-out infinite; }

@keyframes heartbeat {
  0%, 40%, 80%, 100% { transform: scale(1); }
  20%, 60%           { transform: scale(1.14); }
}
.heartbeat { animation: heartbeat 2.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }

/* ---------- 信任墙 ---------- */
.partner-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 88px;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(232, 232, 240, 0.5);
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.partner-tile:hover {
  color: var(--mist);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(74, 108, 247, 0.35);
}

/* ---------- Tab / 筛选圆片（产品系列切换 & 新闻分类共用） ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 1.4rem;
  border-radius: 9999px;
  border: 1px solid rgba(232, 232, 240, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(232, 232, 240, 0.72);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.28s ease;
}
.chip:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.chip.is-active {
  color: #fff;
  border-color: transparent;
  background-image: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 8px 22px -8px rgba(74, 108, 247, 0.6);
}

/* ---------- 表单（联系我们 / 预约体验） ---------- */
.field {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--mist);
  font-size: 0.95rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.field::placeholder { color: rgba(232, 232, 240, 0.35); }
.field:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.22);
}
.field.is-invalid {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.18);
}
textarea.field { min-height: 132px; resize: vertical; }

.form-error { display: none; color: #ff8fa8; font-size: 0.8rem; margin-top: 0.4rem; }
.form-error.show { display: block; }

/* 隐私协议复选框 */
.consent {
  min-height: 44px;               /* 保证移动端点击区域 */
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
.consent input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ---------- 新闻详情展开（grid-rows 平滑过渡） ---------- */
.detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s ease;
}
.detail > div { overflow: hidden; }
.detail.is-open { grid-template-rows: 1fr; }

/* 「阅读全文」按钮箭头旋转 */
.detail-toggle svg { transition: transform 0.4s ease; }
.detail-toggle.is-open svg { transform: rotate(180deg); }

/* ---------- 返回顶部 ---------- */
#back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
#back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------- 功能卡片图标底 ---------- */
.feature-card {
  padding: 1.75rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 20, 39, 0.6);
}

/* ==========================================================
   无障碍：用户偏好减少动效时，停用所有动画与过渡
   （JS 中也会同步遵循该偏好，不渲染粒子）
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
