/* ============================================================
   Novara 官网 — 浅色设计系统
   参考:开发规范与设计模式.md §3.1(浅色 #F2F2F2 / hover #E6E6E6 / accent #0066CC)
   ============================================================ */

:root {
  --bg: #F2F2F2;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --hover: #E6E6E6;
  --accent: #0066CC;
  --accent-soft: rgba(0, 102, 204, 0.09);
  --text: #16181D;
  --text-2: #565B66;
  --text-3: #9399A3;
  --border: rgba(22, 24, 29, 0.09);
  --border-strong: rgba(22, 24, 29, 0.16);
  --dark: #1E1E1E;
  --dark-surface: #2A2A2A;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;

  --shadow-sm: 0 2px 8px rgba(22, 24, 29, 0.05);
  --shadow: 0 12px 40px rgba(22, 24, 29, 0.08);
  --shadow-lg: 0 24px 80px rgba(22, 24, 29, 0.12);

  --nav-h: 64px;
  --container: 1120px;

  --font: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Lenis 平滑滚动官方推荐样式(替代 scroll-behavior:smooth,两者不可共存) */
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--accent); }

/* ---------- 背景装饰 ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(to right, #EAEAEA 1px, transparent 1px),
    linear-gradient(to bottom, #EAEAEA 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

.cursor-glow {
  position: fixed;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 102, 204, 0.10) 0%, rgba(120, 140, 255, 0.05) 45%, transparent 68%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}

.cursor-dot {
  position: fixed;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 102, 204, 0.5) 0%, rgba(0, 102, 204, 0.12) 55%, transparent 78%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  will-change: transform;
}

/* 鼠标粒子拖尾 canvas */
.particle-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 var(--border), 0 8px 32px rgba(22, 24, 29, 0.06);
}

.nav-inner {
  width: min(var(--container), 100% - 48px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.nav-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* tubelight 激活胶囊(JS 移动) */
.nav-pill {
  position: absolute;
  top: 5px;
  left: 0;
  height: calc(100% - 10px);
  background: var(--accent-soft);
  border-radius: 999px;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}

.nav-link {
  position: relative;
  z-index: 1;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.25s;
  white-space: nowrap;
}

.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); }

.nav-gh {
  background: var(--dark);
  color: #fff;
  border-radius: 999px;
  padding: 8px 15px;
  margin-left: 2px;
}

.nav-gh:hover { background: #333; color: #fff; }
.nav-gh.active { color: #fff; }

.lang-btn {
  margin-left: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.lang-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 通用区块 ---------- */
/* 中文:全局字距拉开(标题额外放宽),避免中文字挨太近 */
html[lang="zh"] {
  letter-spacing: 0.03em;
}
html[lang="zh"] h1,
html[lang="zh"] h2,
html[lang="zh"] h3 {
  letter-spacing: 0.05em;
}
.section {
  width: min(var(--container), 100% - 48px);
  margin: 0 auto;
  padding: 130px 0 40px;
}

.section-head { text-align: center; max-width: 720px; margin: 0 auto 80px; }

.section-head h2,
.privacy-text h2,
.cta-card h2 {
  font-size: clamp(30px, 4.6vw, 44px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-sub {
  margin-top: 16px;
  font-size: 17px;
  color: var(--text-2);
}

/* ---------- Hero ---------- */
.hero {
  width: min(1240px, 100% - 48px);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 0.95fr 1.15fr;
  align-items: center;
  gap: 56px;
  padding: calc(var(--nav-h) + 40px) 0 80px;
}

.hero-content { position: relative; z-index: 2; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(0, 102, 204, 0); }
}

.hero-title {
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-title .title-line { display: block; }

.hero-title .accent { color: var(--accent); }

.hero-sub {
  margin-top: 22px;
  font-size: 18px;
  color: var(--text-2);
  max-width: 520px;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-meta {
  margin-top: 26px;
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 650;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 10px 30px rgba(22, 24, 29, 0.22);
}

.btn-primary:hover {
  background: #2A2A2A;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(22, 24, 29, 0.28);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

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

.btn-lg { padding: 16px 32px; font-size: 16px; }

/* ---------- 窗口相框 ---------- */
.window-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: relative;
}

.win-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hover);
}

.win-dot:nth-child(1) { background: #FF5F57; }
.win-dot:nth-child(2) { background: #FEBC2E; }
.win-dot:nth-child(3) { background: #28C840; }

.win-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  white-space: nowrap;
}

.window-frame img {
  width: 100%;
  height: auto;
  /* 固定宽高比占位:懒加载前高度不塌陷,保证 ScrollTrigger 区间计算正确 */
  aspect-ratio: 1400 / 825;
  /* 提升为独立高清合成层,避免 3D 变换(tilt)导致的纹理重采样模糊 */
  transform: translateZ(0);
}

/* 2D 悬浮:除 tilt3d(主题/五语言大卡)外,所有截图卡用纯 2D hover(稳定不抽搐、老系统清晰) */
.window-frame:not(.tilt3d) {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s;
  will-change: transform;
}

.window-frame:not(.tilt3d):hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(22, 24, 29, 0.16);
}

/* 老系统降级规则已移除:大卡(hero/主题/五语言)直接启用 3D */

/* 卡片内鼠标悬浮高光 */
.glow-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 102, 204, 0.07), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 2;
}

[data-glow]:hover .glow-overlay { opacity: 1; }

/* ---------- Hero 截图 ---------- */
.hero-shot-wrap { position: relative; z-index: 1; }

/* Hero 截图:transform 由 3D tilt 交互接管 */
.hero-shot { will-change: transform; }

.hero-shot-wrap::before {
  content: "";
  position: absolute;
  inset: -6% -8%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(0, 102, 204, 0.10), transparent 70%);
  filter: blur(30px);
  z-index: -1;
  pointer-events: none;
}

/* ---------- 功能特性 ---------- */
.features { padding-top: 60px; }

.feature-block {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 72px;
  align-items: center;
  padding: 90px 0;
  min-height: 80vh;
}

.feature-block[data-side="right"] .feature-text { order: 2; }
.feature-block[data-side="right"] .feature-media { order: 1; }

.feature-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.feature-text h3 {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 18px;
}

.feature-text p {
  font-size: 16.5px;
  color: var(--text-2);
  max-width: 460px;
}

.feature-chips {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-chips li {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  transition: border-color 0.25s, color 0.25s;
}

.feature-chips li:hover { border-color: var(--accent); color: var(--accent); }

.feature-media {
  transform-style: preserve-3d;
}

/* ---------- 主题 ---------- */
.theme-inner { text-align: center; }

.theme-demo {
  max-width: 860px;
  margin: 0 auto;
}

.theme-shot {
  transition: background 0.45s, border-color 0.45s;
}

.theme-img-wrap { position: relative; }

.theme-img-wrap img {
  transition: opacity 0.35s ease;
}

.theme-shot.dark-mode {
  background: var(--dark-surface);
  border-color: #3A3A3A;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.theme-toggle {
  margin-top: 28px;
  font-size: 14px;
}

/* ---------- 五语言切换演示 ---------- */
.lang-demo {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.lang-shot {
  transition: background 0.45s, border-color 0.45s;
}

.lang-img-wrap img {
  transition: opacity 0.3s ease;
}

.lang-switch {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.lang-opt {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s;
}

.lang-opt:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.lang-opt.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 102, 204, 0.25);
}

/* ---------- 隐私 ---------- */
.privacy-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 72px;
  align-items: center;
}

.privacy-media { position: relative; }

/* 隐私区:上下结构,单张大图(3D)+ 切换按钮(与主题切换同构) */
.privacy-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 680px;
}

.privacy-shot {
  width: 100%;
}

.privacy-img-wrap img {
  transition: opacity 0.3s ease;
}

.privacy-toggle {
  font-size: 14px;
}

.privacy-list {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.privacy-list li {
  position: relative;
  padding-left: 34px;
  font-size: 15.5px;
  color: var(--text-2);
}

.privacy-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 技术规格 ---------- */
.specs { padding-bottom: 80px; }

.specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.spec-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, border-color 0.3s;
}

.spec-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.spec-key {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.spec-val {
  font-size: 16px;
  font-weight: 650;
}

.specs-req {
  margin-top: 56px;
  background: var(--dark);
  border-radius: var(--r-lg);
  padding: 44px 48px;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 32px;
  align-items: center;
}

.specs-req h3 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.req-list { display: flex; flex-direction: column; gap: 12px; }

.req-list li {
  position: relative;
  padding-left: 26px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
}

.req-list li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: #4DA3FF;
  font-weight: 800;
}

/* ---------- GitHub CTA ---------- */
.cta { padding-bottom: 60px; }

.cta-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F4F8FD 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-align: center;
  padding: 90px 40px;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(0, 102, 204, 0.08), transparent 70%),
    radial-gradient(400px 200px at 85% 100%, rgba(0, 102, 204, 0.05), transparent 70%);
  pointer-events: none;
}

.cta-card h2 {
  font-size: clamp(30px, 4.4vw, 42px);
}

.cta-sub {
  margin: 18px auto 36px;
  max-width: 520px;
  color: var(--text-2);
  font-size: 16.5px;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 60px;
}

.footer-inner {
  width: min(var(--container), 100% - 48px);
  margin: 0 auto;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.footer-logo { width: 26px; height: 26px; border-radius: 7px; }

.footer-links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 14px;
  color: var(--text-2);
}

.footer-links a { transition: color 0.25s; }
.footer-links a:hover { color: var(--accent); }

.footer-note {
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- 404 页 ---------- */
.nf-lang {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 10;
}

.notfound {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: 0 24px;
}

.notfound-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.notfound-code {
  font-size: clamp(96px, 20vw, 180px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #0066CC 0%, #7B5CFF 55%, #9ACBFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0;
}

.notfound-desc {
  max-width: 460px;
  color: var(--text-2);
  font-size: 17px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: calc(var(--nav-h) + 48px); text-align: center; }
  .hero-sub { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-shot-wrap { max-width: 640px; margin: 0 auto; }
  .hero-shot { transform: none; }

  .feature-block { grid-template-columns: 1fr; gap: 40px; padding: 64px 0; text-align: center; }
  .feature-block[data-side="right"] .feature-text { order: 1; }
  .feature-block[data-side="right"] .feature-media { order: 2; }
  .feature-text p { margin-inline: auto; }
  .feature-chips { justify-content: center; }

  .privacy-inner { grid-template-columns: 1fr; gap: 56px; text-align: center; }
  .privacy-list { text-align: left; max-width: 460px; margin-inline: auto; }
  .privacy-media { max-width: 560px; margin: 0 auto; }

  .specs-grid { grid-template-columns: repeat(2, 1fr); }
  .specs-req { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-links { gap: 0; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .nav-gh { padding: 8px 10px; margin-left: 0; }
  .nav-gh svg { display: none; }
}

/* 移动端导航:一左一右,按钮紧凑收进屏幕内(不超出) */
@media (max-width: 768px) {
  .nav-inner { justify-content: space-between; width: min(1120px, 100% - 32px); }
  .nav-link[data-nav] { display: none; }
  .nav-pill { display: none; }
  .nav-links {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    gap: 4px;
  }
  .nav-gh { margin-left: 0; padding: 7px 9px; }
  .nav-gh svg { display: block; }  /* 恢复图标(900px 断点隐藏过) */
  .nav-gh span { display: none; }  /* 移动端隐藏文字,只留 GitHub 图标,按钮更小 */
  .lang-btn { margin-left: 0; padding: 7px 10px; font-size: 12px; }
}

@media (max-width: 480px) {
  .nav-links { gap: 0; }
  .nav-link { padding: 7px 8px; font-size: 12px; }
  .lang-btn { margin-left: 2px; padding: 7px 10px; font-size: 12px; }
}

@media (max-width: 640px) {
  .section { padding-top: 96px; }
  .specs-grid { grid-template-columns: 1fr; }
  .nav-links .nav-link span { font-size: 13px; padding: 8px 10px; }
  .nav-link { padding: 8px 10px; }
  .lang-btn { margin-left: 4px; padding: 8px 10px; }
  .nav-name { display: none; }
}

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