/* ============================================================
   FanQieAPI — 亮色 · 简约高级
   ============================================================ */

:root {
  /* 基础色：中性近黑 + 淡蓝天空底，参考 Apple 的中性灰体系 */
  --bg: #f2f8fd;
  --ink: #1d1d1f;
  --ink-2: #2e3035;
  --muted: #6b7280;

  /* 线条 / 分隔 */
  --line: rgba(29, 29, 31, 0.07);
  --line-strong: rgba(29, 29, 31, 0.12);

  /* 品牌色（呼应插图蓝） */
  --accent: #2f6bff;
  --accent-deep: #1d4ed8;
  --accent-soft: rgba(47, 107, 255, 0.09);

  /* 番茄红：只用于 LOGO 与需要强调的少量元素 */
  --tomato: #e8442e;
  /* 通知横幅正文用的深一档番茄红：13.5px 的正文若用 #e8442e，
     在 #fdf6f4 底上对比度只有 3.7:1，不满足 WCAG AA 的 4.5:1 */
  --tomato-ink: #d13520;


  /* 顶栏基础高度；有全站通知时 --notice-h 会由 JS 实测写入，
     --header-h 自动把通知条高度算进去，所有内容区的 padding 无需改动 */
  --header-base: 86px;
  --nav-pill-h: 62px;
  --nav-inset: 14px;
  --notice-h: 0px;
  --header-h: calc(var(--header-base) + var(--notice-h));
  --container: 1160px;
  --gutter: 28px;

  /* ---------- 圆角：全站只保留三档 ----------
     胶囊（按钮 / 导航）、卡片 24px、小控件 14px。
     不再使用 6/8/9/10/11/12/16/20 这类中间值，视觉上更统一。 */
  --radius-pill: 999px;
  --radius-card: 24px;
  --radius-sm: 14px;
  --radius: var(--radius-sm);

  /* ---------- 玻璃质感：三层阴影 ----------
     外层投影 + 顶部 1px 内高光 + 底部 1px 内暗边。
     单层阴影做不出这种"浮起来的玻璃板"效果。 */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-card-bg: rgba(255, 255, 255, 0.66);
  --shadow-card: 0 18px 42px rgba(50, 57, 73, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(142, 149, 168, 0.1);
  --shadow-card-hover: 0 26px 60px rgba(50, 57, 73, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(142, 149, 168, 0.12);
  --shadow-pill: 0 14px 34px rgba(52, 58, 74, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(142, 149, 168, 0.1);

  --shadow-sm: 0 8px 22px rgba(55, 61, 77, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-ink: 0 12px 28px -12px rgba(10, 16, 32, 0.55);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC",
    sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* hidden 属性必须始终生效。
   .nav-user / .console-view 这类规则显式写了 display，
   会盖掉浏览器默认的 [hidden] { display: none }，导致元素藏不住。 */
[hidden] {
  display: none !important;
}

/* 登录态确认前先不显示「登录」入口，避免闪一下错误状态。
   visibility 而不是 display，保持导航布局稳定不跳动。 */
html.auth-pending .nav-login {
  visibility: hidden;
}

/* 英文用户首屏：i18n.js 替换完文案前一律不显示，避免闪一屏中文。
   boot.js 里有 3 秒兜底，脚本挂了也不会白屏。 */
html.i18n-pending body {
  visibility: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
  /* 不做全局平滑滚动：文档页有 1 万像素高，Tab 切换焦点时
     平滑滚动会让视口长时间追不上焦点。锚点跳转的平滑由 main.js 单独处理。 */
  scroll-behavior: auto;
  scroll-padding-top: calc(var(--header-h) + 24px);
  /* 始终为滚动条预留位置。否则「内容超过一屏」与「刚好一屏」的页面
     可用宽度差 15px，居中的顶栏会跟着横移 7.5px。
     典型场景：未登录点「控制台」被 302 到登录页，登录页只有一屏，
     滚动条消失，导航整排就跳一下。 */
  scrollbar-gutter: stable;
}


body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 键盘用户跳过导航，直达正文。平时移出视口，聚焦时滑入。 */
.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 24px rgba(29, 29, 31, 0.24);
  transform: translate(-50%, -200%);
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus-visible,
.skip-link:focus {
  transform: translate(-50%, 0);
}

/* skip link 跳到正文后，main 会成为焦点落点；它本身不需要描边 */
main:focus {
  outline: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(47, 107, 255, 0.16);
  color: var(--ink);
}

/* ============================================================
   顶部导航 —— 悬浮玻璃胶囊
   ============================================================ */

.site-header {
  position: fixed;
  top: var(--notice-h);
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-base);
  padding: var(--nav-inset) 0 0;
  background: transparent;
  border-bottom: 0;
  /* 胶囊之外的区域不拦截点击，页面可以正常滚动/选中 */
  pointer-events: none;
}

.header-inner {
  pointer-events: auto;
  /* 窄屏留出 gutter，宽屏封顶 container 居中。
     控制台侧栏用同一套宽度公式，左侧菜单才能和 LOGO 严格对齐 */
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--container);
  height: var(--nav-pill-h);
  margin: 0 auto;
  padding: 0 10px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-pill);
  backdrop-filter: blur(24px) saturate(1.18);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.site-header.is-scrolled .header-inner {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 44px rgba(52, 58, 74, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(142, 149, 168, 0.12);
}

/* Logo */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(10, 16, 32, 0.12), 0 0 0 1px rgba(10, 16, 32, 0.04);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.brand:hover .brand-logo {
  transform: translateY(-1px) rotate(-4deg);
  box-shadow: 0 6px 16px -4px rgba(10, 16, 32, 0.22), 0 0 0 1px rgba(10, 16, 32, 0.05);
}

.brand-name {
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* 导航 */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  /* flex 子项默认 min-width:auto，内容撑不开时会顶出胶囊外。
     允许收缩，配合 .nav-user-email 的省略号，窄屏下先压缩邮箱。 */
  min-width: 0;
}

.nav-link {
  position: relative;
  padding: 9px 15px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(29, 29, 31, 0.05);
}

.nav-link.is-active {
  color: var(--ink);
  font-weight: 600;
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

/* 登录按钮 */
.nav-login {
  margin-left: 10px;
  padding: 9px 20px;
  /* 中英文标签长度不同（登录 / Sign in），若不固定宽度，
     右侧的登录按钮一变宽就会把左边的语言切换顶来顶去。
     统一给一个够用的最小宽度并居中文字，切换时位置不动。 */
  min-width: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(180deg, #2b2c31, #1d1d1f);
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 16px -6px rgba(29, 29, 31, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}

.nav-login:hover {
  color: #fff;
  background: linear-gradient(180deg, #3a3b41, #242428);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px rgba(29, 29, 31, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* 移动端按钮 */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.2s var(--ease);
}

.nav-toggle span {
  display: block;
  width: 17px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.28s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.6px) rotate(-45deg);
}

/* 语言切换：胶囊里再套两枚小胶囊，和整站的玻璃质感保持一致。
   选中态由一块独立滑块（.lang-thumb）承载，切换时在两项之间平滑滑动，
   而不是让两块背景各自淡入淡出——后者看起来像硬跳。
   两枚按钮固定同宽，滑块位置只靠 data-lang 一个属性驱动纯 CSS 位移，
   不经过 JS 量尺寸，因此不会因为整页重排而延迟启动。 */
.lang-switch {
  --lang-w: 37px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.05);
  border: 1px solid rgba(29, 29, 31, 0.05);
}

.lang-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: var(--lang-w);
  height: calc(100% - 6px);
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid rgba(29, 29, 31, 0.04);
  box-shadow: 0 2px 6px rgba(29, 29, 31, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
  pointer-events: none;
  transform: translateX(0);
  /* 单独一层，滑动交给合成线程，主线程换文案时不掉帧 */
  will-change: transform;
  transition: transform 0.34s var(--ease-out);
}

.lang-switch[data-lang="en"] .lang-thumb {
  transform: translateX(calc(var(--lang-w) + 2px));
}

.lang-opt {
  position: relative;
  z-index: 1;
  width: var(--lang-w);
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: center;
  color: var(--muted);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.24s var(--ease);
}

.lang-opt:hover {
  color: var(--ink-2);
}

.lang-opt.is-active {
  color: var(--ink);
}

.lang-opt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* 英文模式：正文与标题的字距收紧一点，避免字母间显得松散 */
html.lang-en .hero-subtitle,
html.lang-en .page-desc,
html.lang-en .feature-desc,
html.lang-en .faq-desc,
html.lang-en .model-desc {
  letter-spacing: 0;
}

/* 英文文案普遍更长，标题行高略放宽 */
html.lang-en .hero-title,
html.lang-en .section-title,
html.lang-en .page-title {
  line-height: 1.14;
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 72px) var(--gutter) 56px;
  overflow: hidden;
}

/* ---------- 背景装饰 ---------- */
/* 云层背景：真实天空底图铺满 hero，顶部叠一层淡蓝统一色调，
   底部再过渡回页面底色，保证与下方区块无缝衔接。 */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-color: #f7fbfe;
  background-image:
    linear-gradient(180deg, rgba(226, 241, 253, 0.55) 0%, rgba(236, 246, 254, 0.38) 40%, rgba(255, 255, 255, 0) 74%),
    url("/assets/img/home-backhero-v1.webp?v=20261112ah");
  background-size: 100% 100%, cover;
  background-position: center, center bottom;
  background-repeat: no-repeat, no-repeat;
}

/* 极淡的斜向冷暖过渡（线性渐变无环状色阶） */
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, rgba(232, 240, 255, 0) 0%, rgba(232, 240, 255, 0.45) 38%, rgba(238, 244, 255, 0.28) 62%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* 底部过渡到下方区块色 */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(242, 248, 253, 0) 58%,
      rgba(242, 248, 253, 0.6) 82%,
      rgba(242, 248, 253, 0.94) 94%,
      #f2f8fd 100%
    );
  pointer-events: none;
}

/* 细噪点：消除渐变色阶，增加高级质感 */
.hero-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  pointer-events: none;
}

/* 极淡网格 */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(29, 29, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 29, 31, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center;
  mask-image: radial-gradient(ellipse 62% 58% at 50% 44%, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 44%, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 74%);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  opacity: 0.5;
}

/* ---------- 布局 ---------- */
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 64px;
}

.hero-content {
  min-width: 0;
  max-width: 640px;
}

/* ---------- 标题 ---------- */
.hero-title {
  margin: 0 0 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}

/* 品牌名：视觉主体 */
.hero-title-brand {
  display: block;
  font-size: clamp(2.9rem, 6vw, 5.2rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.048em;
  background: linear-gradient(168deg, #16203a 0%, #0a1020 58%, #1e2c4a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 副行：服务定位 */
.hero-title-accent {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.32rem, 2.55vw, 2.3rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.022em;
  background: linear-gradient(96deg, #16307a 0%, #2f6bff 42%, #5f9bff 72%, #2f6bff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: accentShift 12s ease-in-out infinite;
}

@keyframes accentShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* ---------- 副标题 ---------- */
.hero-subtitle {
  margin: 0 0 40px;
  max-width: 620px;
  font-size: clamp(1rem, 1.05vw, 1.0625rem);
  line-height: 1.95;
  letter-spacing: 0.01em;
  /* 比全局 --muted 略深：hero 背景是浅蓝云层，按 WCAG AA 实测需再压一点 */
  color: #646a75;
  text-wrap: pretty;
}

/* ---------- 按钮 ---------- */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  /* 主按钮带墨色圆形箭头徽标，比次按钮宽一圈，
     两者高度必须一致，这里显式对齐 */
  align-items: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 52px;
  /* 上内边距比下多 1px：CJK 字形在行盒里天然偏高约 1.25px，
     这点偏移能把文字压回视觉中线（实测偏差 1.25px → 0.25px，
     且比 0.5px 更稳定——0.5px 会因元素落在半像素网格上偶发 1px 跳变） */
  padding: 1px 30px 0;
  font-size: 15px;
  font-weight: 600;
  /* 行高必须显式给：继承 body 的 1.6 会让行盒比字形高，
     CJK 文字在按钮里看着偏上/偏下，1.2 时墨迹才真正居中 */
  line-height: 1.2;
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.24s var(--ease), box-shadow 0.28s var(--ease),
    background 0.28s var(--ease), border-color 0.28s var(--ease), color 0.2s var(--ease);
}

.btn-arrow {
  width: 17px;
  height: 17px;
  transition: transform 0.28s var(--ease);
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* ---------- 主按钮：白色玻璃胶囊 ----------
   全站统一。浅色玻璃底 + 上下 1px 内高光 + 外侧柔和投影，
   箭头做成一枚墨色圆形徽标，是整站最显眼的"可点"信号。
   边框不能是纯白：落在白色卡片上时得靠这圈淡墨线把轮廓咬住。 */
.btn-primary {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(29, 29, 31, 0.08);
  box-shadow: 0 10px 26px rgba(55, 61, 77, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(126, 132, 148, 0.14);
  backdrop-filter: blur(14px) saturate(1.06);
  -webkit-backdrop-filter: blur(14px) saturate(1.06);
}

/* 玻璃版不需要深色按钮的光泽扫过与顶部径向高光 */
.btn-primary::before,
.btn-primary::after {
  display: none;
}

.btn-primary:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(29, 29, 31, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(55, 61, 77, 0.17),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(126, 132, 148, 0.16);
}

/* 主按钮里的箭头 → 墨色圆形徽标 */
.btn-primary .btn-arrow {
  width: 26px;
  height: 26px;
  padding: 6px;
  border-radius: 50%;
  background: #1d1d1f;
  color: #fff;
  flex-shrink: 0;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(2px);
}

/* ---------- 深色实心：功能性主操作 ----------
   btn-sm / btn-xs 都是表格行内、弹窗、表单里的操作按钮，
   尺寸小、周围全是白卡片，玻璃效果既看不清也失去层级，
   这里保持墨色实心。 */
.btn-primary.btn-sm,
.btn-primary.btn-xs,
.btn-primary.auth-submit {
  color: #fff;
  background: linear-gradient(180deg, #2b2c31 0%, #1d1d1f 100%);
  border-color: transparent;
  box-shadow: 0 8px 18px -10px rgba(29, 29, 31, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.btn-primary.btn-sm:hover,
.btn-primary.btn-xs:hover,
.btn-primary.auth-submit:hover {
  color: #fff;
  background: linear-gradient(180deg, #3a3b41 0%, #242428 100%);
  box-shadow: 0 14px 26px -12px rgba(29, 29, 31, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* 小按钮里的箭头恢复成裸箭头 */
.btn-primary.btn-sm .btn-arrow,
.btn-primary.btn-xs .btn-arrow {
  width: 15px;
  height: 15px;
  padding: 0;
  background: transparent;
  color: inherit;
  border-radius: 0;
}

/* ---------- 次按钮：更淡一档的玻璃 ---------- */
.btn-ghost {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(29, 29, 31, 0.09);
  box-shadow: 0 6px 18px rgba(55, 61, 77, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px) saturate(1.04);
  -webkit-backdrop-filter: blur(14px) saturate(1.04);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(29, 29, 31, 0.14);
  box-shadow: 0 14px 30px rgba(55, 61, 77, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.btn-ghost .btn-arrow {
  color: var(--muted);
}

/* 深色卡片（钱包余额卡）上的玻璃按钮：白色半透明底 + 白描边才看得清 */
.wallet-card .btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wallet-card .btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn:active {
  transform: translateY(0) scale(0.99);
}

.btn:focus-visible,
.nav-link:focus-visible,
.brand:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- 入场动效 ---------- */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes visualIn {
  from {
    opacity: 0;
    transform: scale(0.965) translate3d(0, 26px, 0);
  }
  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

.hero-title {
  animation: riseIn 1s var(--ease-out) 0.06s both;
}

.hero-subtitle {
  animation: riseIn 1s var(--ease-out) 0.18s both;
}

.hero-actions {
  animation: riseIn 1s var(--ease-out) 0.3s both;
}

.hero-visual {
  animation: visualIn 1.15s var(--ease-out) 0.22s both;
}

.brand {
  animation: riseIn 0.8s var(--ease-out) both;
}

.nav-link,
.nav-toggle {
  animation: riseIn 0.8s var(--ease-out) both;
}

.nav-link:nth-child(1) { animation-delay: 0.1s; }
.nav-link:nth-child(2) { animation-delay: 0.16s; }
.nav-link:nth-child(3) { animation-delay: 0.22s; }
.nav-link:nth-child(4) { animation-delay: 0.28s; }
.nav-link:nth-child(5) { animation-delay: 0.34s; }

/* ---------- 滚动进场（供后续区块使用） ----------
   仅在 JS 可用时隐藏，避免脚本被禁用时内容整块不可见 */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 右侧插图 ---------- */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* 浅蓝衬底：衬托插图中的白色面板（半径收敛在盒子内，避免硬边） */
.hero-visual-panel {
  position: absolute;
  inset: 4% 0%;
  border-radius: 28px;
  background:
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(226, 238, 255, 0.9) 0%, rgba(231, 241, 255, 0.6) 34%, rgba(238, 245, 255, 0.26) 62%, rgba(244, 249, 255, 0.08) 84%, rgba(248, 251, 255, 0) 100%);
  z-index: -1;
  pointer-events: none;
}

.hero-visual-float {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: visualFloat 9s ease-in-out infinite;
  will-change: transform;
}

.hero-visual-img {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: auto;
  will-change: transform;
}

@keyframes visualFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -12px, 0);
  }
}

/* ============================================================
   优势介绍
   ============================================================ */

.features {
  position: relative;
  padding: 56px var(--gutter) 128px;
  background: linear-gradient(180deg, #f2f8fd 0%, #f5fafe 38%, #eef6fd 100%);
}

.features-inner {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
}

/* ---------- 区块标题 ---------- */
.section-title {
  margin: 0 0 56px;
  text-align: center;
  font-size: clamp(1.7rem, 2.9vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.032em;
  color: var(--ink);
}

/* ---------- 卡片网格 ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 0 30px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out);
  will-change: transform;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-card-hover);
}

/* 悬停时顶部浮起一道极淡的蓝光 */
.feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 70% at 50% -10%, rgba(47, 107, 255, 0.1), transparent 62%);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
  pointer-events: none;
}

.feature-card:hover::after {
  opacity: 1;
}

/* ---------- 图片区 ---------- */
.feature-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.feature-img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s var(--ease-out);
  will-change: transform;
}

.feature-card:hover .feature-img {
  transform: scale(1.045);
}

/* 卡片错落进场（延迟由 JS 按顺序注入，避免影响 hover 手感） */

/* ---------- 文字区 ---------- */
.feature-body {
  padding: 26px 28px 0;
}

.feature-title {
  margin: 0 0 12px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.feature-desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--muted);
}

/* ============================================================
   快速接入
   ============================================================ */

.quickstart {
  margin-top: 28px;
  padding: 44px 40px 48px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
}

.quickstart-title {
  margin: 0 0 26px;
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.022em;
  color: var(--ink);
}

/* ---------- Tab 按钮 ---------- */
.qs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.qs-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  color: var(--muted);
  background: rgba(29, 29, 31, 0.035);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.24s var(--ease-out), background 0.24s var(--ease-out),
    border-color 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out),
    transform 0.24s var(--ease-out);
}

.qs-tab:hover {
  color: var(--ink-2);
  background: rgba(29, 29, 31, 0.06);
  border-color: transparent;
}

.qs-tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, #2b2c31 0%, #1d1d1f 100%);
  border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(29, 29, 31, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.qs-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 代码面板 ---------- */
/* 三个面板叠在同一网格单元内，容器高度恒等于最高面板，
   切换时下方内容不会上下跳动 */
.qs-panels {
  display: grid;
}

.qs-panel {
  grid-area: 1 / 1;
  min-width: 0;
  visibility: hidden;
}

.qs-panel.is-active {
  visibility: visible;
  animation: panelIn 0.45s var(--ease-out) both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.qs-code {
  margin: 0;
  padding: 24px 26px;
  overflow-x: auto;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.8125rem;
  line-height: 1.85;
  color: #c8d3e4;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

.qs-code code {
  font: inherit;
  white-space: pre;
}

.tok-c {
  color: #7c8fa6;
  font-style: italic;
}

.tok-s {
  color: #8fd3a8;
}

/* 代码块滚动条 */
.qs-code::-webkit-scrollbar {
  height: 8px;
}

.qs-code::-webkit-scrollbar-track {
  background: transparent;
}

.qs-code::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.qs-code::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* ============================================================
   常见问题
   ============================================================ */

.faq-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 28px;
}

.faq-card {
  position: relative;
  padding: 30px 40px 32px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out);
  will-change: transform;
}

/* 左侧竖线：悬停时点亮，呼应品牌色 */
.faq-card::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 32px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), #7aa8ff);
  opacity: 0;
  transform: scaleY(0.4);
  transform-origin: top;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.faq-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-card-hover);
}

.faq-card:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.faq-title {
  margin: 0 0 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.faq-desc {
  margin: 0;
  max-width: 900px;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--muted);
  text-wrap: pretty;
}

.faq-link {
  color: var(--accent-deep);
  font-weight: 600;
  border-bottom: 1px solid rgba(29, 78, 216, 0.28);
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
  word-break: break-all;
}

.faq-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   模型广场
   ============================================================ */

/* ---------- 页头 ---------- */
/* 云层背景与首页 hero 同一张图。这里区块矮得多（约 320–400px），
   cover 会裁掉上下，只留中间云带，正好避开头尾的纯白。
   最后一层线性渐变负责收尾到 #f2f8fd，和下方 .models 的起点完全一致。 */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + 84px) var(--gutter) 56px;
  overflow: hidden;
  background-color: #f2f8fd;
  background-image:
    radial-gradient(ellipse 70% 90% at 50% -30%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 72%),
    linear-gradient(
      180deg,
      rgba(234, 245, 253, 0.62) 0%,
      rgba(241, 249, 254, 0.4) 42%,
      rgba(242, 248, 253, 0.88) 84%,
      #f2f8fd 100%
    ),
    url("/assets/img/home-backhero-v1.webp?v=20261112ah");
  background-size: auto, auto, cover;
  background-position: center, center, center bottom;
  background-repeat: no-repeat;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.page-hero-inner {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
}

.page-title {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.038em;
  color: var(--ink);
  text-wrap: balance;
}

.page-desc {
  margin: 0 auto;
  max-width: 620px;
  font-size: clamp(0.97rem, 1.05vw, 1.0625rem);
  line-height: 1.9;
  color: var(--muted);
  text-wrap: pretty;
}

/* 404：撑满可视高度并垂直居中，避免下方大片空白 */
.page-hero-404 {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  padding-top: var(--header-h);
  padding-bottom: 72px;
}

.page-hero-404 .page-hero-inner {
  width: 100%;
}

.page-hero-404 .hero-actions {
  justify-content: center;
  margin-top: 30px;
}

/* ---------- 列表区 ---------- */
.models {
  padding: 36px var(--gutter) 128px;
  background: linear-gradient(180deg, #f2f8fd 0%, #f5fafe 38%, #eef6fd 100%);
}

.models-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.price-note {
  margin: 0 0 18px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- 模型卡片 ---------- */
.model-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.model-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out),
    border-color 0.45s var(--ease-out);
  will-change: transform;
}

.model-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-card-hover);
}

.model-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 32px 34px 30px;
}

.model-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.model-logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 9px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.model-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.model-id {
  min-width: 0;
  flex: 1 1 auto;
}

.model-name {
  margin: 0 0 3px;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.018em;
  color: var(--ink);
}

.model-vendor {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* 模型名称 + 复制按钮 */
.model-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.model-name-row .model-name {
  margin: 0;
}

.model-copy {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  /* 行高从 1.4 收到 1.2，纵向 padding 补 1px，整体高度不变；
     上多下少 1px，把文字从偏高 1.5px 拉回中线（图标跟着挪 0.5px，看不出来）。
     min-height 兜到 24px，满足 WCAG 2.2 的最小目标尺寸。 */
  min-height: 24px;
  padding: 5px 7px 3px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.model-copy svg {
  width: 12px;
  height: 12px;
}

/* 默认显示复制图标，成功后换成对勾。320px 下文字被隐藏，
   这是唯一的状态反馈，所以图标切换不能省。 */
.model-copy-check {
  display: none;
}

.model-copy.is-copied .model-copy-check {
  display: block;
}

.model-copy.is-copied > svg:not(.model-copy-check) {
  display: none;
}

.model-copy:hover {
  color: var(--accent-deep);
  background: rgba(47, 107, 255, 0.06);
  border-color: rgba(47, 107, 255, 0.32);
}

.model-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.model-copy.is-copied {
  color: #0f7b4f;
  background: rgba(15, 123, 79, 0.07);
  border-color: rgba(15, 123, 79, 0.3);
}

.model-desc {
  margin: 0 0 18px;
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- 右侧价格区 ---------- */
.model-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 28px;
  background: #fafcff;
  border-left: 1px solid var(--line);
}

.model-context {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line-strong);
}

.context-label {
  font-size: 0.8125rem;
  color: var(--muted);
}

.context-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.model-price {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 0;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.price-row dt {
  font-size: 0.875rem;
  color: var(--muted);
}

.price-row dd {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.model-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  /* 桌面端在 column 容器里被 stretch 满宽，内边距不生效；
     980 以下改成按内容宽度收缩，需要它撑出可读的按钮宽度 */
  padding: 0 22px;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(180deg, #2b2c31 0%, #1d1d1f 100%);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 18px -10px rgba(29, 29, 31, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out);
}

.model-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -12px rgba(29, 29, 31, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.model-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- 底部行动区 ---------- */
.models-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 36px 40px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.models-cta-text {
  min-width: 0;
  flex: 1 1 320px;
}

.models-cta-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.models-cta-desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--muted);
}

.models-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   文档
   ============================================================ */

.docs-hero {
  padding-bottom: 44px;
}

.docs {
  padding: 40px var(--gutter) 120px;
  /* 起点与 .docs-hero 的收尾色一致，避免两段之间出现色阶断层 */
  background: linear-gradient(180deg, #f2f8fd 0%, #f6f9fd 38%, #f1f5fb 100%);
}

.docs-inner {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  max-width: var(--container);
  margin: 0 auto;
}

/* ---------- 左侧目录 ---------- */
.docs-aside {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  min-width: 0;
}

.docs-toc {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

.docs-toc-group {
  margin: 18px 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  text-transform: uppercase;
}

.docs-toc-group:first-child {
  margin-top: 0;
}

.docs-toc-link {
  position: relative;
  padding: 6px 0 6px 2px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
  transition: color 0.2s var(--ease-out);
}

.docs-toc-link::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 50%;
  width: 2px;
  height: 0;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: height 0.24s var(--ease-out);
}

.docs-toc-link:hover {
  color: var(--ink-2);
}

.docs-toc-link.is-active {
  color: var(--accent-deep);
  font-weight: 600;
}

.docs-toc-link.is-active::before {
  height: 16px;
}

.docs-toc-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.docs-toc-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.docs-toc-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.24s var(--ease-out);
}

.docs-toc-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* ---------- 正文容器 ---------- */
.docs-body {
  min-width: 0;
  padding: 8px 44px 44px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.docs-section {
  padding-top: 32px;
}

.docs-h2 {
  margin: 0 0 14px;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.022em;
  color: var(--ink);
}

.docs-h3 {
  margin: 26px 0 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.docs-p {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: #3d4b5f;
  text-wrap: pretty;
}

.docs-note {
  margin: -6px 0 18px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.docs-list {
  margin: 0 0 16px;
  padding-left: 20px;
}

.docs-list li {
  margin-bottom: 6px;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: #3d4b5f;
}

.docs-link {
  color: var(--accent-deep);
  font-weight: 600;
  border-bottom: 1px solid rgba(29, 78, 216, 0.28);
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.docs-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- 行内代码 ---------- */
.docs-code-inline {
  padding: 1px 6px;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.85em;
  color: var(--accent-deep);
  background: #f2f6fd;
  border: 1px solid rgba(47, 107, 255, 0.12);
  border-radius: 6px;
  word-break: break-word;
}

/* ---------- 表格 ---------- */
.docs-table-wrap {
  margin: 0 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.docs-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.docs-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  background: #f8fafd;
  border-bottom: 1px solid var(--line);
}

.docs-table td {
  padding: 12px 16px;
  line-height: 1.7;
  color: #3d4b5f;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.docs-table tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- 代码块 ---------- */
.code-block {
  margin: 0 0 20px;
  overflow: hidden;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  background: #161b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-lang {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #7c8fa6;
  text-transform: uppercase;
}

/* 无 JS 时复制按钮无效，直接不显示 */
.code-copy {
  display: none;
  align-items: center;
  justify-content: center;
  /* 行高 1.2 + padding 4.5px，与原来 3px + normal 行高同高 */
  padding: 4.5px 10px;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.2;
  color: #a9b8cc;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out);
}

.code-copy:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.code-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.code-copy.is-copied {
  color: #8fd3a8;
  border-color: rgba(143, 211, 168, 0.42);
}

.js .code-copy {
  display: inline-flex;
}

.code {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.8125rem;
  line-height: 1.8;
  color: #c8d3e4;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

.code code {
  font: inherit;
  white-space: pre;
}

/* SSE / JSON 这类超长单行内容：自动换行，避免横向滚动 */
.code-wrap code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code::-webkit-scrollbar,
.docs-table-wrap::-webkit-scrollbar {
  height: 8px;
}

/* 窄屏时这两类容器可横向滚动，JS 会按需加 tabindex，键盘聚焦时给个可见描边 */
.docs-table-wrap:focus-visible,
.code:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 还能往右滚时，右边缘压一道内阴影，提示"后面还有内容" */
.docs-table-wrap.is-scrollable {
  box-shadow: inset -18px 0 16px -16px rgba(10, 16, 32, 0.28);
}

.code.is-scrollable {
  box-shadow: inset -18px 0 16px -16px rgba(0, 0, 0, 0.55);
}

.code::-webkit-scrollbar-track,
.docs-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.code::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.docs-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(10, 16, 32, 0.16);
  border-radius: 4px;
}

/* ---------- 提示块 ---------- */
.docs-callout {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 18px;
  background: #f5f8fd;
  border: 1px solid rgba(47, 107, 255, 0.14);
  border-radius: var(--radius-sm);
}

.docs-callout-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--accent);
}

.docs-callout-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.docs-callout-warn {
  background: #fffaf0;
  border-color: rgba(180, 116, 26, 0.22);
}

.docs-callout-warn .docs-callout-icon {
  color: #b4741a;
}

/* ---------- 底部 ---------- */
.docs-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding: 28px 32px;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.docs-footer-text {
  min-width: 0;
  flex: 1 1 260px;
}

.docs-footer-title {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--ink);
}

.docs-footer-desc {
  margin: 0;
  font-size: 0.90625rem;
  line-height: 1.8;
  color: var(--muted);
}

.docs-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================================================
   响应式
   ============================================================ */

/* 大屏优化 */
@media (min-width: 1600px) {
  :root {
    --container: 1240px;
  }

  .hero-content {
    max-width: 700px;
  }

  .hero-visual-img {
    max-width: 560px;
  }
}

@media (max-width: 1080px) {
  .hero-inner {
    gap: 40px;
  }

  .hero-visual-img {
    max-width: 420px;
  }

  .feature-grid {
    gap: 18px;
  }

  .feature-body {
    padding: 22px 22px 0;
  }

  /* 模型广场：右侧价格区收窄 */
  .model-card {
    grid-template-columns: minmax(0, 1fr) 262px;
  }

  .model-main {
    padding: 28px 28px 26px;
  }

  .model-side {
    padding: 26px 24px;
  }

  /* 文档：目录收窄 */
  .docs-inner {
    grid-template-columns: 184px minmax(0, 1fr);
    gap: 36px;
  }

  .docs-body {
    padding: 6px 32px 36px;
  }
}

@media (max-width: 980px) {
  .features {
    padding-bottom: 96px;
  }

  .section-title {
    margin-bottom: 40px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 540px;
    margin: 0 auto;
  }

  .quickstart {
    padding: 36px 28px 40px;
    margin-top: 24px;
  }

  .qs-code {
    padding: 20px 18px;
    font-size: 0.78125rem;
  }

  .faq-card {
    padding: 24px 28px 26px;
  }

  .faq-card::before {
    top: 24px;
    bottom: 26px;
  }

  /* 模型广场：价格区移到卡片下方 */
  .model-card {
    grid-template-columns: 1fr;
  }

  .model-side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 16px 28px;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .model-context {
    flex: 0 1 150px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-bottom: 0;
    border-bottom: none;
  }

  /* 价格区优先拿空间：三行价格并排需要约 300px，
     context 固定在 150px 以内，剩下的都给它 */
  .model-price {
    flex: 1 1 320px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 18px;
  }

  .price-row {
    flex: 0 0 auto;
    gap: 8px;
  }

  /* 980 以下价格区横排。CTA 独占一行靠右：和价格同行时会把价格挤成两行，
     满宽又太笨重，所以换行但收到内容宽度。手机端（560 以下）再恢复满宽。 */
  .model-cta {
    flex: 1 1 100%;
    max-width: fit-content;
    margin-top: 2px;
    margin-left: auto;
  }

  .models-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  /* 文档：目录改为可折叠卡片 */
  .docs-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .docs-aside {
    position: static;
  }

  /* 无 JS 时目录始终展开，避免内容不可达；折叠按钮也没有意义，一并隐藏 */
  .js .docs-toc-toggle {
    display: flex;
  }

  .docs-toc {
    margin-top: 10px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
  }

  .js .docs-toc {
    display: none;
  }

  .js .docs-toc.is-open {
    display: flex;
  }

  .docs-toc-link {
    padding: 7px 0;
  }

  .docs-toc-link::before {
    display: none;
  }

  .docs-body {
    padding: 4px 28px 32px;
  }
}

@media (max-width: 960px) {
  :root {
    --gutter: 24px;
  }

  /* 云层底图是 3:1 宽幅，手机上按宽度铺满只会剩顶部一条。
     这里放大到 2.8 倍宽并贴左上，让云纹理保留在首屏上半部，
     下半部交给底部渐隐过渡到页面底色。 */
  .hero-bg {
    background-size: 100% 100%, 280% auto;
    background-position: center, left top;
  }

  .hero {
    min-height: auto;
    padding: calc(var(--header-h) + 56px) var(--gutter) 88px;
    align-items: flex-start;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-visual {
    order: 2;
  }

  .hero-visual-img {
    max-width: 380px;
  }

  .hero-visual-panel {
    inset: -6% 2%;
  }

  .hero-subtitle {
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  /* 菜单展开时锁住背景滚动 */
  html.nav-open {
    overflow: hidden;
  }

  .nav {
    position: absolute;
    top: calc(var(--nav-inset) + var(--nav-pill-h) + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    /* 横屏手机（如 375px 高）装不下整列菜单，底部会被裁掉且无法滚动。
       限制高度并允许内部滚动，保证「登录 / 退出」始终可达。
       54px = 顶栏上下留白（--nav-inset 14×2）+ 与胶囊的间距 10 + 底部余量。 */
    max-height: calc(100vh - var(--notice-h) - var(--nav-pill-h) - 54px);
    max-height: calc(100dvh - var(--notice-h) - var(--nav-pill-h) - 54px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-card);
    /* 展开的菜单必须完全不透明：半透明叠在正文上会透出下面的字，
       移动端看非常脏。这里直接给实色，阴影负责浮起感。 */
    background: #ffffff;
    box-shadow: 0 24px 48px -20px rgba(29, 29, 31, 0.28), 0 2px 8px rgba(29, 29, 31, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 1);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.24s var(--ease), transform 0.24s var(--ease), visibility 0.24s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-link {
    padding: 12px 14px;
    font-size: 15px;
  }

  .nav-link.is-active::after {
    display: none;
  }

  .nav-link.is-active {
    background: var(--accent-soft);
    color: var(--accent-deep);
  }

  .nav-login {
    margin: 8px 0 0;
    padding: 12px 18px;
    text-align: center;
    justify-content: center;
  }

  /* 移动端菜单里语言切换单独一行，居中显示 */
  .lang-switch {
    align-self: center;
    margin: 10px 0 2px;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 20px;
  }

  /* ---------- Hero ---------- */
  .hero {
    padding: calc(var(--header-h) + 40px) var(--gutter) 72px;
  }

  .hero-title {
    font-size: clamp(1.9rem, 8.2vw, 2.4rem);
  }

  .hero-subtitle {
    margin-bottom: 32px;
    font-size: 0.96rem;
    line-height: 1.85;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    height: 50px;
  }

  .hero-visual-img {
    max-width: 86%;
  }

  /* ---------- 快速接入 ---------- */
  .quickstart {
    padding: 30px 20px 32px;
  }

  .qs-tabs {
    gap: 8px;
  }

  .qs-tab {
    height: 36px;
    padding: 0 14px;
    font-size: 0.8125rem;
  }

  .qs-code {
    padding: 18px 16px;
    font-size: 0.75rem;
    line-height: 1.8;
  }

  /* ---------- 常见问题 ---------- */
  .faq-list {
    gap: 12px;
    margin-top: 12px;
  }

  .faq-card {
    padding: 22px 20px 24px;
    border-radius: var(--radius-card);
  }

  .faq-card::before {
    top: 22px;
    bottom: 24px;
  }

  .faq-title {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .faq-desc {
    font-size: 0.90625rem;
    line-height: 1.85;
  }

  /* ---------- 模型广场 ---------- */
  .page-hero {
    padding: calc(var(--header-h) + 52px) var(--gutter) 56px;
    /* 窄屏下 cover 会把云图放大到只剩中间那条纯白（图中心本来就没云）。
       改成按高度铺满、靠左取景，与首页 hero 手机端的处理一致，
       左侧的云团就能落进标题区。 */
    background-size: auto, auto, auto 100%;
    background-position: center, center, left center;
  }

  .models {
    padding: 36px var(--gutter) 88px;
  }

  /* 手机端拇指目标优先，CTA 恢复满宽 */
  .model-cta {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }

  .model-main {
    padding: 22px 20px 20px;
  }

  .model-head {
    gap: 12px;
    margin-bottom: 14px;
  }

  .model-logo {
    width: 46px;
    height: 46px;
    padding: 8px;
    border-radius: var(--radius-sm);
  }

  /* 窄屏下名字放大会挤成两行，收到 1rem 后 360px 起即可单行 */
  .model-name {
    font-size: 1rem;
  }

  .model-desc {
    font-size: 0.90625rem;
    line-height: 1.8;
    margin-bottom: 16px;
  }

  .model-side {
    padding: 20px;
  }

  .model-price {
    flex-basis: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .price-row {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .price-row dd {
    font-size: 1rem;
  }

  .models-cta {
    padding: 26px 22px;
  }

  .models-cta-actions {
    width: 100%;
  }

  /* ---------- 文档 ---------- */
  .docs {
    padding: 28px var(--gutter) 88px;
  }

  .docs-body {
    padding: 0 20px 26px;
    border-radius: var(--radius-card);
  }

  .docs-section {
    padding-top: 26px;
  }

  .docs-h2 {
    font-size: 1.1875rem;
  }

  .docs-p,
  .docs-list li {
    font-size: 0.90625rem;
    line-height: 1.85;
  }

  .code {
    padding: 16px 14px;
    font-size: 0.75rem;
    line-height: 1.75;
  }

  .docs-table {
    min-width: 420px;
    font-size: 0.84375rem;
  }

  .docs-table th,
  .docs-table td {
    padding: 10px 13px;
  }

  .docs-callout {
    padding: 12px 14px;
  }

  .docs-footer {
    padding: 22px 20px;
  }

  .docs-footer-actions {
    width: 100%;
  }
}

/* 430px 以下：模型名 + 复制按钮挤不下一行（DeepSeek-V4.1-Flash-1017 差 5px）。
   复制按钮收成纯图标，并允许模型名在连字符处折行 —— 这样按钮始终跟在名字右侧，
   三张卡片的头部高度一致；模型名的连字符本身就是天然断点，可读性不受影响。
   aria-label 完整；26×26 不低于 WCAG 2.2 的 24×24 最小目标尺寸。 */
@media (max-width: 430px) {
  .model-name-row {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .model-name {
    overflow-wrap: break-word;
  }

  .model-copy {
    justify-content: center;
    min-width: 26px;
    min-height: 26px;
    padding: 0;
    margin-top: 1px;
  }

  .model-copy-text {
    display: none;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   登录页
   ============================================================ */

.auth-page {
  background: #f2f8fd;
}

.auth-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: calc(var(--header-h) + 56px) var(--gutter) 72px;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background-color: #f2f8fd;
  background-image:
    radial-gradient(ellipse 78% 60% at 22% 4%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.4) 52%, rgba(255, 255, 255, 0) 78%),
    radial-gradient(ellipse 96% 58% at 50% 104%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.35) 56%, rgba(255, 255, 255, 0) 84%),
    linear-gradient(
      180deg,
      rgba(231, 243, 253, 0.55) 0%,
      rgba(238, 248, 254, 0.32) 46%,
      rgba(242, 248, 253, 0.9) 88%,
      #f2f8fd 100%
    ),
    /* 与首页 hero 同一张云层图。登录页是整屏高（≈900px），图只有 724px 高，
       cover 会按高度放大到 2700px 宽再裁掉左右，只剩中间一条云。
       这里改成宽度铺满（100% auto），云带完整落在顶部，下方交给渐变收尾。 */
    url("/assets/img/home-backhero-v1.webp?v=20261112ah");
  background-size: auto, auto, auto, 100% auto;
  background-position: center, center, center, center top;
  background-repeat: no-repeat;
  pointer-events: none;
}

.auth-bg .hero-grid {
  opacity: 0.7;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 424px;
  padding: 40px 36px 32px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card-hover);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-head {
  margin-bottom: 28px;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.field-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.field-input::placeholder {
  /* 占位符按 WCAG 1.4.3 属于文本，需 4.5:1。
     原先的 #9aa8bb 只有 2.42:1；#767f8f 也只有 3.96:1；
     现用 #6b7280：在半透明输入框底(#fafcfe)上实测 4.70:1。 */
  color: #6b7280;
}

.field-input:focus {
  background: #fff;
  border-color: rgba(47, 107, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.1);
}

.field-password {
  position: relative;
}

.field-password .field-input {
  padding-right: 48px;
}

.field-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #6b7280;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.field-toggle svg {
  width: 18px;
  height: 18px;
}

.field-toggle:hover {
  color: var(--ink);
  background: rgba(29, 29, 31, 0.06);
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid rgba(180, 35, 24, 0.14);
  border-radius: var(--radius-sm);
}

.auth-submit {
  width: 100%;
  height: 48px;
  margin-top: 2px;
}

.auth-submit[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.auth-foot {
  margin: 24px 0 0;
  padding-top: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.auth-foot a {
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
}

.auth-foot a:hover {
  text-decoration: underline;
}

/* ============================================================
   控制台
   ============================================================ */

.console-page {
  background: #f2f8fd;
}

/* 顶栏已改为悬浮玻璃胶囊，控制台页不再单独铺白底 */
.console-page .site-header {
  background: transparent;
  border-bottom: 0;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  /* 同上：让邮箱成为可压缩项，而不是把整排顶出去 */
  min-width: 0;
}

.nav-user-email {
  max-width: 160px;
  /* min-width:0 才能真的收缩到 max-width 以下 */
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  font-size: 13.5px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-out {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 行高 1.2 + padding 7.5px，与原来 6px + normal 行高同高（33px） */
  padding: 7.5px 14px;
  /* 同 .nav-login：退出 / Logout 宽度不同会顶动左侧控件 */
  min-width: 82px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.2;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-user-out:hover {
  color: var(--ink);
  background: rgba(29, 29, 31, 0.05);
}

/* 与 .nav-link / .brand 保持同一套焦点样式，键盘用户看不出差异 */
.nav-user-out:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.console-main {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 32px;
  /* 与首页 / 模型 / 文档等页面区块使用完全相同的宽度公式，
     左右边缘严格对齐；左右不留内边距，否则内容会比其它页面窄一圈。 */
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--container);
  margin: 0 auto;
  padding: calc(var(--header-h) + 32px) 0 72px;
  align-items: start;
}

/* ---------- 左侧菜单 ---------- */

.console-side {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.console-account {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.console-account-name {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-account-email {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.console-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.console-nav-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.console-nav-link:hover {
  color: var(--ink);
  background: rgba(29, 29, 31, 0.05);
}

.console-nav-link.is-active {
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-weight: 620;
}

.console-side-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.console-side-foot strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- 内容区 ---------- */

.console-body {
  min-width: 0;
  /* 短视图（如数据面板之外的列表）也撑住高度，避免滚动条反复出现 */
  min-height: calc(100vh - var(--header-h) - 104px);
}

/* 切换视图时表格先空后满，高度会跳一下，这里给个下限 */
.console-page .table-wrap {
  min-height: 96px;
}

.console-loading {
  padding: 80px 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.console-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.console-view[hidden] {
  display: none;
}

/* ---------- 模型列表（控制台 · 只读表格） ----------
   表头一次性写全 6 列，行内只放取值，所以列宽由表头和最长内容决定。
   类名统一加 cm- 前缀，避免和「模型用量」那套 .model-row 撞名。 */
/* 选择器带上 .console-page 提高权重：.data-table 的规则在后面定义，
   同级单类会被它覆盖，导致 min-width / white-space 生效不到本表。 */
.console-page .cm-table {
  min-width: 0;
  /* 固定列宽：auto 布局下把「图标」列压成 18px，图标会被裁掉；
     固定布局能保证 6 列宽度可控，窄屏也不会挤坏。 */
  table-layout: fixed;
}

/* 列宽用 colgroup 定义：表头的「模型名称」跨了图标列，
   若继续按 th 序号写宽度，跨列单元格会把图标列撑开。 */
.console-page .cm-table .cm-col-icon { width: 46px; }
.console-page .cm-table .cm-col-price { width: 16%; }
.console-page .cm-table .cm-col-context { width: 104px; }

/* 图标列与模型名称列都左对齐：图标贴着单元格左内边距，
   名称紧随其后（同为左内边距起），两列在同一条竖线上。 */
.console-page .cm-table th:nth-child(1),
.console-page .cm-table td:nth-child(1),
.console-page .cm-table td:nth-child(2) {
  text-align: left;
}

/* 价格与上下文是这页的主要信息，加粗后扫视更快 */
.console-page .cm-table td:nth-child(3),
.console-page .cm-table td:nth-child(4),
.console-page .cm-table td:nth-child(5),
.console-page .cm-table td:nth-child(6) {
  font-weight: 650;
  color: var(--ink);
}

.cm-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.cm-name-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

/* 表格里复制按钮只留图标，避免按钮文字把模型名挤得偏离表头；
   读屏仍可通过 aria-label 拿到「复制模型名称 …」。 */
.cm-table .model-copy {
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 5px;
}

.cm-table .model-copy-text {
  display: none;
}

.cm-name {
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* 窄屏下 6 列硬压到 320px 会把模型名拆成三四行，反而更难读。
   保持最小列宽、由 .table-wrap 横向滚动（与全站其它宽表做法一致），
   底部已有渐隐提示可左右滑动。 */
@media (max-width: 560px) {
  .console-page .cm-table {
    min-width: 560px;
    font-size: 12.5px;
  }

  .console-page .cm-table th,
  .console-page .cm-table td {
    padding: 11px 8px;
    /* .data-table td 默认 nowrap，窄屏下会让长模型名压到图标列上 */
    white-space: normal;
  }

  .console-page .cm-table td {
    overflow-wrap: anywhere;
  }

  .console-page .cm-table .cm-col-icon { width: 34px; }
  .console-page .cm-table .cm-col-context { width: 78px; }

  .cm-icon {
    width: 20px;
    height: 20px;
  }

  .cm-name {
    font-size: 12.5px;
  }
}

.view-head {
  margin-bottom: 2px;
}

.view-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.view-title {
  margin: 0 0 6px;
  font-size: 1.42rem;
  font-weight: 750;
  letter-spacing: -0.028em;
  color: var(--ink);
}

.view-desc {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 统计卡 ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.stat-label {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.stat-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.stat-link {
  color: var(--accent-deep);
  text-decoration: none;
}

.stat-link:hover {
  text-decoration: underline;
}

.stat-card-accent {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(238, 246, 255, 0.9) 100%);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-card);
}

/* ---------- 面板 ---------- */

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  padding: 20px 22px 22px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
  color: var(--ink);
}

.panel-note {
  font-size: 12.5px;
  color: var(--muted);
}

.panel-link {
  font-size: 13px;
  font-weight: 550;
  color: var(--accent-deep);
  text-decoration: none;
}

.panel-link:hover {
  text-decoration: underline;
}

/* ---------- 柱状图 ---------- */

.chart {
  display: block;
  padding-top: 8px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 168px;
}

.chart-bar {
  position: relative;
  flex: 1 1 0;
  min-width: 4px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.chart-bar-fill {
  width: 100%;
  min-height: 3px;
  background: linear-gradient(180deg, rgba(47, 107, 255, 0.85) 0%, rgba(47, 107, 255, 0.35) 100%);
  border-radius: 5px 5px 3px 3px;
  transition: filter 0.2s var(--ease);
}

.chart-bar:hover .chart-bar-fill {
  filter: brightness(1.12);
}

.chart-bar-empty .chart-bar-fill {
  background: rgba(10, 16, 32, 0.07);
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11.5px;
  /* 原来是 #93a1b5，11.5px 小字在白底上只有 2.6:1，看不清 */
  color: #5a6b82;
}

/* ---------- 模型用量 ---------- */

.model-usage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.model-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.model-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.model-row-name {
  color: var(--ink-2);
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-row-meta {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.model-row-bar {
  height: 7px;
  background: rgba(10, 16, 32, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.model-row-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2f6bff, #6f9bff);
  border-radius: inherit;
}

/* ---------- 表格 ---------- */

.table-wrap {
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  /* 表格比容器宽时右侧渐隐，提示可以横向滑动 */
  -webkit-overflow-scrolling: touch;
}

/* 表格比容器宽时，右边缘压一道内阴影，提示还能横向滑动 */
.table-wrap.is-scrollable {
  box-shadow: inset -18px 0 16px -16px rgba(10, 16, 32, 0.24), var(--shadow-card);
}

/* 只在表格确实比容器窄的断点下加渐隐，避免宽屏误伤内容 */
@media (max-width: 600px) {
  .table-wrap {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  }
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  background: #fbfcff;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 13px 16px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fbfcff;
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table .right {
  text-align: right;
}

.data-table .mono {
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--muted);
}

/* 充值记录列宽（列少，避免被拉得过散） */
#txnTable th:nth-child(1) { width: 26%; }
#txnTable th:nth-child(2) { width: 16%; }
#txnTable th:nth-child(3) { width: 20%; }

.empty-hint {
  margin: 0;
  padding: 28px 0;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- 状态徽标 ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 550;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-ok {
  color: #0d7a4f;
  background: rgba(16, 185, 129, 0.1);
}

.badge-off {
  /* #6b7280 在 --line 灰底上只有 4.21:1，12px 小字不达 AA，加深一档 */
  color: #5b6270;
  background: rgba(10, 16, 32, 0.06);
}

.badge-warn {
  color: #92400e;
  background: #fffbeb;
}

.badge-err {
  color: #b42318;
  background: rgba(239, 68, 68, 0.1);
}

/* ---------- 行内按钮 ---------- */

.btn-sm {
  height: 40px;
  /* 这里不能跟 .btn 一样补 0.5px：13.5px 字号正好落在半像素上，
     补了反而把字形推到下一格（实测偏差 0.38px → 1.38px） */
  padding: 0 18px;
  font-size: 13.5px;
  border-radius: var(--radius-pill);
}

.btn-xs {
  height: 32px;
  padding: 0.5px 14px 0;
  font-size: 12.5px;
  border-radius: var(--radius-pill);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 行高 1.2 + 上下合计 12px（与原来 6px 对称 + normal 行高同高）；
     上比下少 0.5px 抵消 CJK 字形偏高，管理端表格里偏差从 1.1px 降到 0.1px */
  padding: 5.5px 8px 6.5px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.2;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.link-btn:hover {
  color: var(--ink);
  background: rgba(29, 29, 31, 0.06);
}

.link-btn-danger:hover {
  color: #b42318;
  background: rgba(239, 68, 68, 0.08);
}

/* ---------- 筛选栏 ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* 下拉筛选：标签与当前取值合成一枚胶囊，比裸 select 更整齐；
   搜索框（input）不套这层外壳，避免和输入框样式打架。 */
.filter:has(> select) {
  gap: 6px;
  height: 38px;
  padding: 0 4px 0 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.filter:has(> select):hover {
  background: #fff;
  border-color: var(--line-strong);
}

.filter:has(> select):focus-within {
  background: #fff;
  border-color: rgba(47, 107, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.filter:has(> select) > span {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.filter select {
  height: 30px;
  /* 原生 select 会按最长选项撑宽，模型名很长时整条筛选栏被拉散；
     这里限制最大宽度并省略，完整取值仍可从下拉里看到。 */
  max-width: 168px;
  padding: 0 26px 0 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' stroke='%236b7280' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 0;
  border-radius: var(--radius-pill);
  appearance: none;
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.filter select:hover {
  color: var(--accent);
  background-color: rgba(47, 107, 255, 0.06);
}

/* 展开后的选项列表：去掉系统默认的灰底，行高更宽松 */
.filter select option {
  padding: 6px 10px;
  color: var(--ink);
  background: #fff;
}

.filter select:focus {
  outline: none;
}

/* ---------- 自定义下拉 ----------
   原生 select 展开后的选项列表由系统绘制、无法定制，
   这里换成「按钮 + 自绘弹层」，原生 select 只保留取值。 */

.filter select.fq-native {
  display: none;
}

.fq-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.fq-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  height: 30px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.fq-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fq-select-btn svg {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  color: var(--muted);
  transition: transform 0.22s var(--ease-out), color 0.2s var(--ease);
}

.fq-select-btn:hover {
  color: var(--accent);
  background: rgba(47, 107, 255, 0.06);
}

.fq-select-btn:hover svg {
  color: var(--accent);
}

.fq-select-btn[aria-expanded="true"] {
  color: var(--accent);
  background: rgba(47, 107, 255, 0.09);
}

.fq-select-btn[aria-expanded="true"] svg {
  color: var(--accent);
  transform: rotate(180deg);
}

.fq-select-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 展开的选项弹层 */
.fq-select-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  left: -8px;
  /* 按钮本身可能很窄（如"全部"），弹层至少 150px 才不至于把选项挤成竖排 */
  min-width: max(100%, 150px);
  max-width: 300px;
  max-height: 286px;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 244, 0.9);
  border-radius: 16px;
  box-shadow: 0 24px 56px -18px rgba(15, 23, 42, 0.3),
    0 2px 8px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: fqMenuIn 0.16s var(--ease-out) both;
}

@keyframes fqMenuIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
}

/* 下方空间不足时向上展开 */
.fq-select-menu.is-up {
  top: auto;
  bottom: calc(100% + 10px);
  animation-name: fqMenuUpIn;
}

@keyframes fqMenuUpIn {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.98);
  }
}

.fq-select-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
  white-space: nowrap;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.fq-select-opt:hover,
.fq-select-opt.is-active {
  color: var(--accent-deep);
  background: rgba(47, 107, 255, 0.08);
}

.fq-select-opt.is-selected {
  font-weight: 650;
  color: var(--accent-deep);
}

/* 选中项右侧的对勾 */
.fq-select-opt.is-selected::after {
  content: "";
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M2.6 7.4 5.6 10.4 11.4 4.2' stroke='%23000' stroke-width='1.9' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M2.6 7.4 5.6 10.4 11.4 4.2' stroke='%23000' stroke-width='1.9' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fq-select-menu::-webkit-scrollbar {
  width: 8px;
}

.fq-select-menu::-webkit-scrollbar-track {
  background: transparent;
}

.fq-select-menu::-webkit-scrollbar-thumb {
  background: rgba(10, 16, 32, 0.16);
  border-radius: 4px;
}

/* 老浏览器不支持 :has() 时，外壳样式不生效，
   这里把边框还给 select，避免变成"没有框的纯文字"。 */
@supports not selector(:has(*)) {
  .filter select {
    padding: 0 30px 0 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line-strong);
  }
}

/* ---------- 分页 ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pager-info {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pager-btns {
  display: flex;
  gap: 8px;
}

/* ---------- 钱包 ---------- */

.wallet-top {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
}

.wallet-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  background: linear-gradient(160deg, #2b2c31 0%, #202125 62%, #17171a 100%);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 44px -24px rgba(10, 16, 32, 0.6);
}

.wallet-label {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
}

.wallet-value {
  font-size: 2.1rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.wallet-hint {
  margin: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
}

.wallet-card .btn-ghost {
  align-self: flex-start;
  margin-top: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.wallet-card .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.17);
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
}

.password-form .btn {
  align-self: flex-start;
}

.form-msg {
  margin: 0;
  font-size: 13px;
}

.form-msg.is-error {
  color: #b42318;
}

.form-msg.is-ok {
  color: #0d7a4f;
}

/* ---------- 弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 13, 24, 0.42);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 26px 26px 22px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 30px 70px -30px rgba(8, 13, 24, 0.5);
  animation: modalIn 0.24s var(--ease-out) both;
}

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

.modal-title {
  margin: 0 0 18px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.modal-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.modal-warn {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  color: #b54708;
  background: #fffaeb;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: var(--radius-sm);
}

.key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #17171a;
  border-radius: var(--radius-sm);
}

.key-box code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #cfe0ff;
  word-break: break-all;
}

.key-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 行高 1.2 + 上下合计 16px，与原来 6px + normal 行高同高（31px）；
     上少下多 1.5px，把文字从偏下 1.25px 拉回中线 */
  padding: 6.5px 12px 9.5px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.2;
  color: #dbe7ff;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.key-copy:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 密钥只在创建时显示一次，复制失败必须一眼可见，
   否则用户会以为已经保存，关掉弹窗后密钥就永久丢了。 */
.key-copy.is-copied,
.code-copy.is-copied,
.endpoint-copy.is-copied,
.model-copy.is-copied {
  color: #0f7b4f;
}

.key-copy.is-failed,
.code-copy.is-failed,
.endpoint-copy.is-failed,
.model-copy.is-failed {
  color: #ffe1dd;
  background: rgba(232, 68, 46, 0.85);
}

.key-copy:focus-visible,
.code-copy:focus-visible,
.model-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 请求地址 ---------- */

/* API 密钥页顶部：一键复制 base_url，省去用户去文档里找 */
.endpoint-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: var(--radius-sm);
}

.endpoint-label {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.endpoint-value {
  /* flex-basis 给小值：窄屏时地址与「复制」能挤在同一行，靠收缩换行 */
  flex: 1 1 120px;
  min-width: 0;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}

.endpoint-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 行高 1.2 + 上下合计 10px（与原来 4px + normal 行高同高）；
     上多下少 1px，窄屏两行布局里偏差从 1px 降到 0 */
  padding: 5.5px 10px 4.5px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.endpoint-copy:hover {
  color: var(--accent-deep);
  border-color: rgba(47, 107, 255, 0.34);
  background: rgba(47, 107, 255, 0.05);
}

.endpoint-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.endpoint-copy.is-copied {
  color: #0f7b4f;
  border-color: rgba(15, 123, 79, 0.3);
  background: rgba(15, 123, 79, 0.07);
}

/* 窄屏：地址会折行，改成「标题 + 复制」一行、地址独占一行，读起来更整 */
@media (max-width: 560px) {
  .endpoint-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    align-items: center;
  }

  .endpoint-label {
    grid-column: 1;
    grid-row: 1;
  }

  .endpoint-copy {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .endpoint-value {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ---------- 控制台响应式 ---------- */

@media (max-width: 1080px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid,
  .wallet-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .console-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding-top: calc(var(--header-h) + 20px);
  }

  .console-side {
    position: static;
    gap: 12px;
  }

  .console-account,
  .console-side-foot {
    display: none;
  }

  .console-nav {
    flex-direction: row;
    gap: 4px;
    padding: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    /* 右侧渐隐，提示还能横向滚动 */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
  }

  .console-nav::-webkit-scrollbar {
    display: none;
  }

  .console-nav-link {
    flex: 0 0 auto;
    padding: 9px 13px;
    font-size: 13.5px;
  }

  .console-nav-link svg {
    width: 16px;
    height: 16px;
  }

  .nav-user {
    margin-left: 0;
    padding: 8px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-user-email {
    max-width: 100%;
  }

  /* 菜单里其它按钮都是整宽，这里不能缩成 82px 的小胶囊 */
  .nav-user-out {
    align-self: stretch;
    min-width: 0;
    padding: 12px 18px;
  }

  .view-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 30px 22px 26px;
    border-radius: var(--radius-card);
  }

  .stat-grid {
    /* 手机上 2×2 比 4 张通栏卡更容易一眼扫完；卡片本身是紧凑型，
       两列在 320px 下也放得下。 */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 14px 14px 16px;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-sub {
    font-size: 11.5px;
  }

  .panel {
    padding: 18px 16px 20px;
  }

  .chart {
    height: 140px;
    gap: 4px;
  }

  .filter-bar {
    gap: 10px;
  }

  .filter {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .filter select {
    flex: 1 1 auto;
    max-width: 60%;
  }

  /* 自定义下拉：按钮右对齐，弹层贴右边缘展开，避免顶出屏幕 */
  .fq-select {
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
  }

  .fq-select-btn {
    max-width: 100%;
  }

  .fq-select-menu {
    left: auto;
    right: -8px;
    min-width: 200px;
    max-width: min(300px, 76vw);
  }
}

/* 表格内重命名输入框 */
.rename-input {
  width: 100%;
  min-width: 120px;
  height: 30px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(47, 107, 255, 0.55);
  border-radius: var(--radius-sm);
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

/* 弹窗打开时锁定背景滚动 */
body.modal-open {
  overflow: hidden;
}

/* ============================================================
   启动遮罩 / 登录态校验
   页面在确认身份前不渲染内容，避免「先显示再跳转」的闪烁
   ============================================================ */

.console-page.is-booting .console-main {
  visibility: hidden;
}

.console-page.is-booting::after {
  content: "正在加载…";
  position: fixed;
  inset: calc(var(--header-h) + 40px) 0 auto;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.auth-page.auth-checking .auth-form,
.auth-page.auth-checking .auth-foot {
  visibility: hidden;
}

/* 加载失败提示 */
.load-error {
  margin: 0;
  padding: 12px 16px;
  font-size: 13.5px;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid rgba(180, 35, 24, 0.14);
  border-radius: var(--radius-sm);
}

.load-error[hidden] {
  display: none;
}

/* ============================================================
   全站通知横幅
   ============================================================ */

.site-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
}

.site-notice[hidden] {
  display: none;
}

/* 全站通知：正文统一番茄红，类型只体现在前面的小圆点 */
.site-notice-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 44px;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.55;
  text-align: center;
  color: var(--tomato-ink);
  background: #fdf6f4;
  border-bottom: 1px solid rgba(232, 68, 46, 0.16);
}

.site-notice-item::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.site-notice-item.is-warning::before {
  background: #b45309;
  opacity: 1;
}

.site-notice-item.is-success::before {
  background: #0d7a4f;
  opacity: 1;
}

.site-notice-text {
  max-width: var(--container);
}

.site-notice-close {
  position: absolute;
  top: 50%;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  opacity: 0.55;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity 0.18s var(--ease), background 0.18s var(--ease);
}

.site-notice-close:hover {
  opacity: 1;
  background: rgba(29, 29, 31, 0.08);
}

/* ============================================================
   管理后台
   ============================================================ */

.console-nav-admin {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.console-nav-admin[hidden] {
  display: none;
}

.console-nav-label {
  padding: 4px 12px 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.filter-grow {
  flex: 1 1 240px;
}

/* 后台筛选栏里的搜索框独占一行，避免和下拉挤在一起 */
.filter-bar .filter-grow {
  flex: 1 1 100%;
}

.filter input[type="search"] {
  flex: 1 1 auto;
  width: 100%;
  height: 34px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fbfcff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.filter input[type="search"]:focus {
  outline: none;
  border-color: rgba(47, 107, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.data-table-wide {
  min-width: 840px;
  font-size: 12.5px;
}

/* 全站明细列多，收紧内边距；用户列过长时省略，完整信息放 title */
.data-table-wide th,
.data-table-wide td {
  padding-left: 9px;
  padding-right: 9px;
}

.data-table-wide td:nth-child(2) {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-modal-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.admin-modal-hint strong {
  color: var(--ink);
  font-weight: 600;
}

.notice-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notice-textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  resize: vertical;
}

.notice-textarea:focus {
  outline: none;
  border-color: rgba(47, 107, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.notice-form-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.notice-form-foot .form-msg {
  flex: 1 1 auto;
}

.notice-content-cell {
  max-width: 460px;
  white-space: normal;
  line-height: 1.6;
}

.view-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* 窄屏：控制台菜单变成单行横向滚动。
   放在文件末尾，才能覆盖上面 .console-nav-admin 的纵向布局。 */
@media (max-width: 860px) {
  .console-nav {
    align-items: center;
  }

  .console-nav-admin {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 6px;
    padding: 0 0 0 10px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .console-nav-admin[hidden] {
    display: none;
  }

  .console-nav-label {
    display: none;
  }
}

/* 筛选栏的小标题不要竖排折行 */
.filter > span {
  white-space: nowrap;
}

/* ============================================================
   管理后台：表格对齐 / 强调色
   ============================================================ */

/* 表头与内容一律居中（含 .num / .right 列） */
.data-table-center th,
.data-table-center td,
.data-table-center .num,
.data-table-center .right {
  text-align: center;
}


/* 居中表格里重命名输入框仍按左对齐输入，打字更自然 */
.data-table-center .rename-input {
  text-align: left;
}

/* 新增用户弹窗里的两列输入 */
.admin-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .admin-modal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 视图标题右侧的操作按钮组 */
.view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 表格里的文字按钮禁用态 */
.link-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
