/* =========================================================
   adelphiig · 全站自定义样式层（深色科技风）
   仅承载 Tailwind 无法表达的：渐变 / 光晕 / 玻璃态 / 动效
   ========================================================= */

:root {
  --brand: #2e6bff;
  --brand-600: #1a54f0;
  --cyan: #22d3ee;
  --purple: #8b5cf6;
  --green: #10b981;
  /* 背景层（RGB 通道，供 Tailwind ink-* 使用；主题切换只改这些值）*/
  --ink-600: 39 50 79;
  --ink-700: 28 38 64;
  --ink-750: 22 30 51;
  --ink-800: 17 24 41;
  --ink-850: 13 19 34;
  --ink-900: 10 14 26;
  --ink-950: 6 9 18;
  --surface: 255 255 255;   /* 微背景 / 边框基色 */
  --text-body: #e7ecf6;
  --grad-start: #ffffff;     /* 标题渐变起始色 */
  --icon-mono: #ffffff;      /* 单色（白）品牌图标 */
  --bg: rgb(var(--ink-900));
  --bg-850: rgb(var(--ink-850));
  --bg-800: rgb(var(--ink-800));
  --line: rgb(var(--surface) / 0.08);
  --line-strong: rgb(var(--surface) / 0.14);
}

/* ===== 浅色主题：仅改变量（背景/边框自动适配）+ 覆盖硬编码色 ===== */
html.light {
  --ink-600: 199 209 223;
  --ink-700: 214 222 233;
  --ink-750: 241 245 250;
  --ink-800: 255 255 255;
  --ink-850: 240 244 249;
  --ink-900: 248 250 253;
  --ink-950: 233 238 245;
  --surface: 15 23 42;
  --text-body: #1f2937;
  --grad-start: #0f1f3d;
  --icon-mono: #334155;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text-body);
  transition: background-color .3s, color .3s;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 自定义滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-850); }
::-webkit-scrollbar-thumb {
  background: #243049;
  border-radius: 2px;
  border: 2px solid var(--bg-850);
}
::-webkit-scrollbar-thumb:hover { background: #30405f; }

::selection { background: rgba(46, 107, 255, 0.35); color: #fff; }

/* ---------- 背景纹理：网格 + 光晕 ---------- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
}
.bg-grid-fade {
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 35%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 35%, transparent 75%);
}
.bg-dots {
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* 光晕球 —— 放在 relative 容器内做氛围光 */
.glow {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.glow-brand  { background: radial-gradient(circle, rgba(46,107,255,0.75), transparent 70%); }
.glow-cyan   { background: radial-gradient(circle, rgba(34,211,238,0.55), transparent 70%); }
.glow-purple { background: radial-gradient(circle, rgba(139,92,246,0.55), transparent 70%); }

/* ---------- 渐变文字 / 线 ---------- */
.text-gradient {
  background: linear-gradient(100deg, var(--grad-start) 0%, var(--brand) 62%, var(--cyan) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.text-gradient-brand {
  background: linear-gradient(100deg, var(--brand) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.divider-glow {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46,107,255,0.6), rgba(34,211,238,0.4), transparent);
}

/* ---------- 玻璃态卡片 ---------- */
.glass {
  background: rgba(17, 24, 41, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
}
.glass-strong {
  background: rgba(13, 19, 34, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
}

/* 卡片：渐变描边 + 悬浮 */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(22,30,51,0.7), rgba(13,19,34,0.7));
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .35s, box-shadow .35s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(46,107,255,0.45);
  box-shadow: 0 20px 50px -20px rgba(46,107,255,0.35);
}
/* 顶部高光描边 */
.card-sheen::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(46,107,255,0.5), transparent 40%, transparent 60%, rgba(34,211,238,0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.card-sheen:hover::before { opacity: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 600;
  border-radius: 2px;
  padding: .8rem 1.5rem;
  transition: transform .2s, box-shadow .3s, background .3s, border-color .3s;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(100deg, var(--brand), var(--brand-600));
  color: #fff;
  box-shadow: 0 8px 30px -10px rgba(46,107,255,0.7);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -10px rgba(46,107,255,0.85);
}
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: #e7ecf6;
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(46,107,255,0.5);
  transform: translateY(-2px);
}

/* 徽章 / 标签 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 500;
  padding: .35rem .8rem;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.03);
  color: #b9c4da;
}

/* ---------- 平台图标底色块 ---------- */
.icon-tile {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.04);
}

/* ---------- 动效 ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) translateX(0); }
  50%      { transform: translateY(-22px) translateX(8px); }
}
@keyframes pulseGlow {
  0%, 100% { opacity: .45; }
  50%      { opacity: .75; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.animate-float      { animation: float 6s ease-in-out infinite; }
.animate-float-slow { animation: floatSlow 9s ease-in-out infinite; }
.animate-pulse-glow { animation: pulseGlow 5s ease-in-out infinite; }
.animate-spin-slow  { animation: spinSlow 26s linear infinite; }

/* Logo 跑马灯 */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-mask {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

/* ---------- 滚动渐显（仅在 JS 启用时生效，防止无 JS 时内容隐藏）---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
  will-change: opacity, transform;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 导航 ---------- */
.nav-link {
  position: relative;
  color: #b9c4da;
  font-weight: 500;
  transition: color .2s;
}
.nav-link:hover, .nav-link.is-active { color: #fff; }
.nav-link.has-caret::after {
  content: "";
  display: inline-block;
  width: .5rem; height: .5rem;
  margin-left: .35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .6;
  transition: transform .2s;
}
.nav-item:hover .nav-link.has-caret::after { transform: rotate(225deg) translateY(0); }

/* 桌面下拉面板 */
.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s, transform .22s;
  z-index: 60;
}
.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

#site-header.scrolled .header-inner {
  background: rgba(8, 12, 22, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--line);
}

/* 语言切换 */
.lang-btn.active { color: #fff; background: rgba(46,107,255,0.18); }

/* 富文本里的强调 */
.prose-tech a { color: var(--cyan); }
.prose-tech strong { color: #fff; }

/* 锚点偏移（固定头） */
.section-anchor { scroll-margin-top: 96px; }

/* =========================================================
   浅色主题覆盖（Tailwind 工具类 + 自定义类）
   ========================================================= */
/* 文字 */
html.light .text-white { color: #0d1322 !important; }
html.light .text-slate-200 { color: #1f2937 !important; }
html.light .text-slate-300, html.light .text-slate-300\/90 { color: #334155 !important; }
html.light .text-slate-400 { color: #586173 !important; }
html.light .text-slate-500 { color: #8a94a8 !important; }
/* 透明边框 / 背景 → 深色半透 */
html.light .border-white\/10 { border-color: rgb(15 23 42 / 0.12) !important; }
html.light .border-white\/5  { border-color: rgb(15 23 42 / 0.08) !important; }
html.light .bg-white\/5 { background-color: rgb(15 23 42 / 0.04) !important; }
html.light .bg-white\/\[0\.03\] { background-color: rgb(15 23 42 / 0.03) !important; }
html.light .bg-white\/\[0\.02\] { background-color: rgb(15 23 42 / 0.025) !important; }
html.light .hover\:bg-white\/5:hover { background-color: rgb(15 23 42 / 0.05) !important; }
/* 网格纹理 */
html.light .bg-grid {
  background-image:
    linear-gradient(to right, rgb(15 23 42 / 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(15 23 42 / 0.05) 1px, transparent 1px);
}
/* 光晕减弱 */
html.light .glow { opacity: 0.16; }
/* 玻璃 / 卡片 / 徽章 / 图标块 */
html.light .glass { background: rgba(255,255,255,0.72); }
html.light .glass-strong { background: rgba(255,255,255,0.92); box-shadow: 0 12px 45px -18px rgba(15,23,42,0.22); }
html.light .card { background: #ffffff; box-shadow: 0 6px 22px -14px rgba(15,23,42,0.14); }
html.light .card:hover { border-color: rgba(46,107,255,0.45); box-shadow: 0 18px 44px -20px rgba(46,107,255,0.28); }
html.light .chip { background: rgb(15 23 42 / 0.04); color: #475569; }
html.light .icon-tile { background: rgb(15 23 42 / 0.035); }
/* 按钮 / 导航 / 头部 */
html.light .btn-ghost { background: rgb(15 23 42 / 0.04); color: #1f2937; }
html.light .btn-ghost:hover { background: rgb(15 23 42 / 0.08); }
html.light .nav-link { color: #475569; }
html.light .nav-link:hover, html.light .nav-link.is-active { color: #0d1322; }
html.light #site-header.scrolled .header-inner { background: rgba(255,255,255,0.85); }
html.light .lang-btn.active { color: #0d1322; background: rgba(46,107,255,0.12); }
html.light .prose-tech strong { color: #0d1322; }
/* 滚动条 */
html.light ::-webkit-scrollbar-thumb { background: #cbd5e1; }
html.light ::-webkit-scrollbar-thumb:hover { background: #b0bccd; }

/* 主题切换按钮：太阳(深色时)/月亮(浅色时) */
.theme-icon-moon { display: none; }
html.light .theme-icon-sun { display: none; }
html.light .theme-icon-moon { display: inline-block; }
