/* ============================================================
   HormLab Portal · 全站共用样式（header/footer/通用组件/动效基线）
   依赖 tokens.css；各页面私有样式放页面内 <style> 或独立 css
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-cn);
  color: var(--text-dark);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ============ 导航 ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  transition: background 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), backdrop-filter 0.35s;
}
.nav.scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo img { height: 34px; width: auto; }
.nav-logo .logo-text {
  font-family: var(--font-en); font-weight: 800; font-size: 20px;
  color: #fff; letter-spacing: 0.5px; transition: color 0.35s;
}
.nav.scrolled .nav-logo .logo-text { color: var(--text-dark); }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.85);
  transition: color 0.25s; position: relative; padding: 6px 0;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; background: var(--gradient-gold);
  border-radius: 2px; transition: width 0.3s var(--ease-out);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav.scrolled .nav-links a { color: var(--text-mid); }
.nav.scrolled .nav-links a:hover, .nav.scrolled .nav-links a.active { color: var(--primary-blue); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.btn-ai-entry {
  padding: 9px 18px; border-radius: var(--r-pill);
  background: var(--gradient-gold);
  color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-glow-gold);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
  display: flex; align-items: center; gap: 6px;
}
.btn-ai-entry:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(212,162,78,0.45); }
.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-burger span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s; }
.nav.scrolled .nav-burger span { background: var(--text-dark); }

/* 移动端抽屉 */
.mobile-menu {
  position: fixed; inset: 0; z-index: 999; background: rgba(6,9,26,0.98);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a { color: #fff; font-size: 22px; font-weight: 600; }
.mobile-menu a.active { color: var(--gold-light); }

/* ============ 页脚 ============ */
.footer {
  background: var(--space-deeper);
  color: var(--text-white-muted);
  padding: 64px 0 32px;
  position: relative;
}
.footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,162,78,0.5), transparent);
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand img { height: 44px; margin-bottom: 18px; }
.footer-brand p { font-size: 14px; line-height: 1.8; max-width: 320px; }
.footer-cert {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  padding: 8px 14px; border-radius: var(--r-sm);
  background: rgba(212,162,78,0.1); border: 1px solid rgba(212,162,78,0.3);
  color: var(--gold-light); font-size: 13px; font-weight: 600;
}
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 18px; font-weight: 600; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { font-size: 14px; transition: color 0.25s; }
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom {
  padding-top: 28px; display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; font-size: 13px;
}
.footer-bottom a:hover { color: var(--gold-light); }

/* ============ 通用 section ============ */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-card); }
.section-header { text-align: center; max-width: 720px; margin: 0 auto 64px; }
.section-eyebrow {
  display: inline-block; padding: 6px 16px; border-radius: var(--r-pill);
  background: rgba(91,108,255,0.08); border: 1px solid rgba(91,108,255,0.2);
  color: var(--primary-blue); font-size: 13px; font-weight: 600;
  letter-spacing: 1px; margin-bottom: 18px;
}
.section-h2 { font-size: 40px; font-weight: 800; line-height: 1.25; letter-spacing: -1px; }
.section-h2 .accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-h2 .accent-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-lead { font-size: 17px; color: var(--text-light); margin-top: 16px; }

/* 深色 section 变体 */
.section-dark { background: var(--space-dark); color: #fff; position: relative; overflow: hidden; }
.section-dark .section-eyebrow {
  background: rgba(0,229,199,0.08); border-color: rgba(0,229,199,0.3); color: var(--cyan-glow);
}
.section-dark .section-lead { color: var(--text-white-soft); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px; border-radius: var(--r-pill);
  font-size: 16px; font-weight: 600;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s;
}
.btn-primary {
  background: var(--gradient-brand); color: #fff; box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(91,108,255,0.4); }
.btn-gold {
  background: var(--gradient-gold); color: #fff; box-shadow: var(--shadow-glow-gold);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(212,162,78,0.45); }
.btn-ghost {
  background: rgba(255,255,255,0.08); color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: var(--primary-blue);
  border: 1.5px solid var(--primary-blue);
}
.btn-outline:hover { background: rgba(91,108,255,0.06); transform: translateY(-2px); }

/* ============ 滚动进场动画基线（JS 加 .in-view 触发） ============ */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
/* 无 JS / 爬虫兜底 */
.no-js .reveal, .no-reveal .reveal { opacity: 1; transform: none; transition: none; }

/* 尊重用户减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ 面包屑 ============ */
.page-hero {
  background: var(--space-dark);
  background-image: var(--gradient-glow);
  padding: calc(var(--nav-h) + 72px) 0 72px;
  color: #fff; text-align: center; position: relative; overflow: hidden;
}
.page-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -1px; margin-bottom: 14px; }
.page-hero p { font-size: 17px; color: var(--text-white-soft); max-width: 640px; margin: 0 auto; }

/* ============ AI 悬浮助手 ============ */
.ai-fab {
  position: fixed; right: 28px; bottom: 28px; z-index: 1200;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--gradient-gold);
  box-shadow: 0 8px 32px rgba(212,162,78,0.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.3s var(--ease-out);
  border: none;
}
.ai-fab:hover { transform: scale(1.08) translateY(-2px); }
.ai-fab svg { width: 30px; height: 30px; }
.ai-fab .ai-fab-tip {
  position: absolute; right: 76px; top: 50%; transform: translateY(-50%);
  background: var(--space-card); color: #fff; font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-pill); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
  border: 1px solid rgba(255,255,255,0.1);
}
.ai-fab:hover .ai-fab-tip { opacity: 1; }

.ai-panel {
  position: fixed; right: 28px; bottom: 108px; z-index: 1200;
  width: min(420px, calc(100vw - 40px)); height: min(600px, calc(100vh - 160px));
  background: var(--space-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(24px) scale(0.96); pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
  overflow: hidden;
}
.ai-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.ai-panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.ai-panel-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient-gold);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.ai-panel-title { color: #fff; font-weight: 700; font-size: 16px; }
.ai-panel-sub { color: var(--text-white-muted); font-size: 12px; }
.ai-panel-close {
  margin-left: auto; color: var(--text-white-muted); font-size: 22px;
  width: 32px; height: 32px; border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.ai-panel-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ai-panel-msgs {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.ai-msg { max-width: 82%; font-size: 14px; line-height: 1.7; border-radius: var(--r-lg); padding: 12px 16px; white-space: pre-wrap; word-break: break-word; }
.ai-msg.bot {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9);
  border-bottom-left-radius: 4px; align-self: flex-start;
}
.ai-msg.user {
  background: var(--gradient-brand); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end;
}
.ai-msg.typing { display: flex; gap: 5px; align-items: center; padding: 14px 18px; }
.ai-msg.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-white-muted);
  animation: aiTyping 1.2s infinite;
}
.ai-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiTyping { 0%,60%,100% { opacity: 0.3; transform: translateY(0);} 30% { opacity: 1; transform: translateY(-4px);} }
.ai-panel-chips { display: flex; gap: 8px; padding: 0 20px 12px; flex-wrap: wrap; }
.ai-chip {
  padding: 7px 14px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8); font-size: 13px;
  transition: all 0.2s;
}
.ai-chip:hover { background: rgba(212,162,78,0.15); border-color: rgba(212,162,78,0.4); color: var(--gold-light); }
.ai-panel-input {
  display: flex; gap: 10px; padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ai-panel-input input {
  flex: 1; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: var(--r-pill);
  padding: 12px 18px; color: #fff; font-size: 14px; outline: none;
  font-family: inherit; transition: border-color 0.25s;
}
.ai-panel-input input:focus { border-color: rgba(212,162,78,0.5); }
.ai-panel-input input::placeholder { color: var(--text-white-muted); }
.ai-panel-send {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gradient-gold); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.ai-panel-send:hover { transform: scale(1.06); }
.ai-panel-send svg { width: 20px; height: 20px; }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .nav { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .section { padding: 64px 0; }
  .section-h2 { font-size: 30px; }
  .page-hero h1 { font-size: 32px; }
  .ai-fab { right: 18px; bottom: 18px; width: 56px; height: 56px; }
  .ai-panel { right: 12px; bottom: 88px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .section-h2 { font-size: 26px; }
}
