/* ==========================================================
   教公台 · Jiao Workbench 发布页样式
   主题：Apple Human Interface Guidelines · 纯白极简
   结构：CSS 变量 → 基础重置 → 通用工具 → 背景层 →
         进度条/光晕 → 导航 → Hero → 功能区 → 预览窗 →
         下载 → 页脚 → 响应式
   ========================================================== */

/* ---------- Inter 字体（极简、专业、Swiss 风格） ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- 主题变量 ---------- */
:root {
  /* 浅色（默认）Apple HIG 纯白 */
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --primary: #0071e3;            /* Apple 系统蓝 */
  --primary-strong: #0058b0;
  --primary-soft: rgba(0, 113, 227, 0.08);
  --text: #1d1d1f;               /* Apple 近黑 */
  --text-muted: #6e6e73;
  --text-faint: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.14);
  --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.08);
  --bar-track: rgba(0, 113, 227, 0.12);
  --glow: rgba(0, 113, 227, 0.18);
  --particle: 0, 113, 227;       /* 粒子基色 RGB */
}

/* 深色模式 Apple HIG 纯黑 */
[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #1d1d1f;
  --surface: rgba(30, 30, 32, 0.6);
  --surface-solid: #1d1d1f;
  --primary: #2997ff;
  --primary-strong: #5bb6ff;
  --primary-soft: rgba(41, 151, 255, 0.12);
  --text: #f5f5f7;
  --text-muted: #a1a1a6;
  --text-faint: #6e6e73;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 10px 28px -14px rgba(0, 0, 0, 0.5);
  --bar-track: rgba(41, 151, 255, 0.14);
  --glow: rgba(41, 151, 255, 0.22);
  --particle: 41, 151, 255;
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;     /* 锚点平滑滚动 */
}

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 渐变底：极淡的蓝白光晕，几乎纯白 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(
      1100px 650px at 85% -8%,
      var(--primary-soft),
      transparent 55%
    ),
    radial-gradient(800px 500px at -8% 25%, var(--bg-2), transparent 60%),
    var(--bg);
  transition: opacity 0.4s ease;
}

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

img,
svg {
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- 通用工具 ---------- */
.reveal {
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

/* 仅在 JS 可用时隐藏元素、等待滚动入场；
   JS 失效时内容保持可见，避免整页空白 */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
}

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

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  box-shadow: 0 0 6px var(--glow);
  transition: width 0.1s linear;
}

/* ---------- 粒子背景画布 ---------- */
#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

/* ---------- 鼠标跟随光晕 ---------- */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 380px;
  margin: -190px 0 0 -190px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  opacity: 0;
  transform: translate(0, 0);
  transition: opacity 0.5s ease;
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

/* 明暗切换按钮 */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  transition: transform 0.2s ease, color 0.2s ease, background 0.3s ease;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-2);
}

.theme-icon {
  display: none;
}

/* 依据主题显示太阳/月亮图标 */
[data-theme="dark"] .theme-icon-moon { display: block; }
[data-theme="light"] .theme-icon-sun { display: block; }

/* ---------- 返回主页按钮 + 面包屑 ---------- */
.nav-back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-back:hover {
  color: var(--text);
  background: var(--bg-2);
}

.nav-back:active {
  transform: scale(0.92);
}

.nav-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-faint);
  white-space: nowrap;
}

.nav-crumb {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-crumb:hover {
  color: var(--primary);
}

.nav-crumb-sep {
  color: var(--text-faint);
  opacity: 0.6;
}

.nav-crumb-current {
  color: var(--text);
  font-weight: 500;
}

/* ---------- 主内容宽度 ---------- */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 0 80px;
}

.hero-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin-top: 16px;
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero-desc {
  margin-top: 24px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.65;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-meta {
  margin-top: 32px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.meta-chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 980px;          /* Apple 胶囊形 */
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, opacity 0.2s ease;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 14px -4px rgba(0, 113, 227, 0.5);
}

.btn-primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(0, 113, 227, 0.6);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* 下载按钮高亮提示脉冲（底部按钮点击后触发） */
.download-pulse {
  animation: download-pulse 0.9s ease-in-out 3;
}

@keyframes download-pulse {
  0%, 100% { box-shadow: 0 4px 14px -4px rgba(0, 113, 227, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(0, 113, 227, 0.25), 0 0 28px rgba(0, 113, 227, 0.5); }
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  background: var(--bg-2);
}

.btn-ghost:active {
  transform: translateY(0) scale(0.98);
}

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

/* 向下滚动提示 */
.scroll-hint {
  margin-top: 64px;
  color: var(--text-faint);
  animation: float 2.4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ---------- 功能区 ---------- */
.section {
  padding: 96px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 56px;
}

.section-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* 功能卡片网格 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 32px 28px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  background: var(--surface-solid);
}

.feature-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--primary);
  background: var(--primary-soft);
}

.feature-card h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ---------- 界面预览窗 ---------- */
.window {
  max-width: 880px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-strong);
}

.window-dots span:nth-child(1) { background: #ff5f57; }
.window-dots span:nth-child(2) { background: #febc2e; }
.window-dots span:nth-child(3) { background: #28c840; }

.window-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.window-spacer { flex: 1; }

.window-body {
  display: flex;
  height: 340px;
  position: relative;
}

/* 左侧窄导航 */
.mock-sidebar {
  width: 64px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}

.mock-side-item {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.mock-side-item.active {
  background: var(--primary);
  border-color: transparent;
}

/* 主内容区 */
.mock-main {
  flex: 1;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.mock-titlebar {
  height: 14px;
  width: 42%;
  border-radius: 7px;
  background: var(--bg-2);
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.mock-app {
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}

/* 底部播放栏（毛玻璃覆盖层） */
.mock-player {
  position: absolute;
  left: 64px;
  right: 0;
  bottom: 0;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-top: 1px solid var(--border);
}

.mock-cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.mock-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mock-lines i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-2);
}

.mock-lines i:nth-child(1) { width: 58%; }
.mock-lines i:nth-child(2) { width: 36%; }

.mock-btns {
  display: flex;
  gap: 12px;
}

.mock-btns i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-2);
}

/* ---------- 下载 ---------- */
.download-card {
  text-align: center;
  padding: 72px 40px;
  border-radius: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.download-desc {
  margin: 16px 0 32px;
  color: var(--text-muted);
  font-size: 16px;
}

.download-desc strong {
  color: var(--text);
  font-weight: 600;
}

.download-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 28px 56px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-domain a {
  color: var(--primary);
  transition: opacity 0.2s ease;
}

.footer-domain a:hover {
  opacity: 0.7;
}

.footer-note {
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .nav-inner {
    padding: 0 18px;
    gap: 14px;
  }

  .nav-links {
    gap: 16px;
    font-size: 14px;
  }

  /* 窄屏隐藏面包屑文字，仅保留返回箭头 */
  .nav-breadcrumb {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    padding: 110px 0 60px;
  }

  .window-body {
    height: 260px;
  }

  .mock-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mock-player { left: 0; }

  .br-desktop { display: none; }

  .btn {
    padding: 12px 22px;
    font-size: 15px;
  }
}

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