/* ============================================================
 * ruoyi-plus 官网 —— 设计令牌与装饰样式
 * 与 Tailwind CDN 配合使用：布局交给 Tailwind，装饰与动效在此
 * ========================================================== */

:root {
  color-scheme: dark;

  /* 颜色令牌：RGB 三元组，供 Tailwind 的 rgb(var(--x) / <alpha>) 使用 */
  --c-bg: 8 11 17;
  --c-surface: 17 24 35;
  --c-line: 30 40 54;
  --c-fg: 232 238 247;
  --c-strong: 255 255 255;
  --c-muted: 147 162 184;
  --c-dim: 100 116 139;
  --c-accent: 52 211 153;
  --c-cyan: 34 211 238;
  --c-on-accent: 4 18 12;

  /* 派生色 */
  --accent-soft: rgb(var(--c-accent) / 0.12);
  --accent-line: rgb(var(--c-accent) / 0.35);

  /* 圆角与阴影 */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 20px 40px -24px rgb(0 0 0 / 0.8);
}

/* 浅色主题：只换令牌，组件样式自动跟随 */
[data-theme="light"] {
  color-scheme: light;

  --c-bg: 248 250 252;
  --c-surface: 255 255 255;
  --c-line: 226 232 240;
  --c-fg: 15 23 42;
  --c-strong: 15 23 42;
  --c-muted: 71 85 105;
  --c-dim: 100 116 139;
  --c-accent: 5 150 105;
  --c-cyan: 8 145 178;
  --c-on-accent: 255 255 255;

  --accent-soft: rgb(var(--c-accent) / 0.1);
  --accent-line: rgb(var(--c-accent) / 0.32);
  --shadow-card: 0 1px 0 rgb(15 23 42 / 0.04) inset, 0 18px 40px -28px rgb(15 23 42 / 0.22);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  background: rgb(var(--c-bg));
  color: rgb(var(--c-fg));
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

code,
pre,
.mono {
  font-family: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-ligatures: none;
}

/* ---------- 背景：径向光晕 + 细网格 ---------- */
.bg-glow::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 78% -8%, rgba(52, 211, 153, 0.14), transparent 62%),
    radial-gradient(720px 420px at 12% 4%, rgba(34, 211, 238, 0.10), transparent 60%);
}

.bg-grid::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
}

/* ---------- 通用容器 ---------- */
/* 只设左右内边距：写成 padding 简写会把 Tailwind 的上下内边距类一起覆盖掉 */
.shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ---------- 顶栏 ---------- */
.nav-blur {
  background: rgb(var(--c-bg) / 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.nav-blur.is-scrolled {
  border-bottom-color: rgb(var(--c-line));
  background: rgb(var(--c-bg) / 0.9);
}

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(180deg, rgb(var(--c-strong) / 0.035), rgb(var(--c-strong) / 0.012));
  border: 1px solid rgb(var(--c-line));
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.card-hover {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 26px 50px -28px rgba(52, 211, 153, 0.35);
}

/* ---------- 主按钮 ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  color: rgb(var(--c-on-accent));
  background: linear-gradient(135deg, rgb(var(--c-accent)), rgb(var(--c-cyan)));
  box-shadow: 0 10px 30px -12px rgba(52, 211, 153, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 16px 36px -12px rgba(52, 211, 153, 0.85);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  color: rgb(var(--c-fg));
  border: 1px solid rgb(var(--c-line));
  background: rgb(var(--c-strong) / 0.02);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.btn-ghost:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ---------- Hero 徽标 ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  font-size: 13px;
  color: rgb(var(--c-muted));
  border: 1px solid rgb(var(--c-line));
  background: rgb(var(--c-strong) / 0.03);
}

.pill-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- 文字渐变 ---------- */
.text-grad {
  background: linear-gradient(100deg, #ffffff 6%, #a7f3d0 46%, #67e8f9 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: grad-shift 9s ease-in-out infinite;
}

[data-theme="light"] .text-grad {
  background: linear-gradient(100deg, #0f172a 6%, #047857 48%, #0e7490 94%);
  -webkit-background-clip: text;
  background-clip: text;
}

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

/* ---------- FAQ 折叠：去掉浏览器默认三角，用图标代替 ---------- */
details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* ---------- 主题切换按钮：按当前主题只显示一个图标 ---------- */
/* 默认（深色，含 JS 未执行时）只显示月亮 */
.theme-sun {
  display: none;
}

[data-theme="light"] .theme-sun {
  display: block;
}

[data-theme="light"] .theme-moon {
  display: none;
}

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: rgb(var(--c-muted));
  background: rgb(var(--c-surface) / 0.9);
  border: 1px solid rgb(var(--c-line));
  box-shadow: 0 12px 30px -16px rgb(0 0 0 / 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, border-color 0.2s ease, color 0.2s ease;
}

.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

/* ---------- 终端 ---------- */
.terminal {
  /* 终端固定深色：覆盖局部变量，避免浅色主题下深底深字看不清 */
  --c-strong: 255 255 255;
  --c-muted: 147 162 184;
  --c-dim: 100 116 139;
  --c-accent: 52 211 153;
  --c-cyan: 34 211 238;
  --c-line: 30 40 54;
  background: #060a10;
  border: 1px solid rgb(var(--c-line));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 70px -40px rgb(0 0 0 / 0.95);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid rgb(var(--c-line));
  background: rgb(255 255 255 / 0.022);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.caret::after {
  content: "▍";
  color: var(--accent);
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

/* ---------- 滚动显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* 打印时屏幕外的区块不会触发观察器，必须直接可见 */
@media print {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- 指标条 ---------- */
.stat-num {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* ---------- Tab 切换 ---------- */
.tab-btn {
  color: rgb(var(--c-muted));
  border-color: rgb(var(--c-line));
  background: transparent;
}

.tab-btn[aria-selected="true"] {
  color: rgb(var(--c-on-accent));
  font-weight: 600;
  background: linear-gradient(135deg, rgb(var(--c-accent)), rgb(var(--c-cyan)));
  border-color: transparent;
  box-shadow: 0 8px 24px -14px rgb(var(--c-accent) / 0.8);
}

.tab-btn:hover {
  color: rgb(var(--c-fg));
  border-color: var(--accent-line);
}

.tab-btn[aria-selected="true"]:hover {
  color: rgb(var(--c-on-accent));
}

.tab-panel[hidden] {
  display: none;
}

/* ---------- 移动端菜单 ---------- */
#mobileMenu[hidden] {
  display: none;
}

/* ---------- 可访问性 ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 浅色主题微调 ---------- */
[data-theme="light"] .bg-glow::before {
  background:
    radial-gradient(900px 480px at 78% -8%, rgb(var(--c-accent) / 0.1), transparent 62%),
    radial-gradient(720px 420px at 12% 4%, rgb(var(--c-cyan) / 0.08), transparent 60%);
}

[data-theme="light"] .bg-grid::after {
  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);
}

[data-theme="light"] .terminal-bar {
  background: rgb(255 255 255 / 0.04);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .caret::after {
    animation: none;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
