/* ============================================================
   base.css — 全局基础样式：设计系统变量 / 背景 / 导航 / Hero / 通用
   （斐波那契教学页面 · 样式封装 part 1）
   注意：因本文件位于 css/ 子目录，图片相对路径需加一级 ../image/
   ============================================================ */

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

:root {
  --bg: #0f1524;
  --bg-2: #141b2e;
  --card: rgba(255,255,255,0.05);
  --card-border: rgba(255,255,255,0.1);
  --text: #e8ecf4;
  --muted: #94a3b8;
  --gold-1: #fbbf24;
  --gold-2: #f59e0b;
  --gold-3: #d97706;
  --teal: #2dd4bf;
  --purple: #a78bfa;
  --pink: #f472b6;
  --shadow: 0 20px 60px rgba(0,0,0,0.4);
  --radius: 18px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---------- SVG Background ---------- */
.bg-fib {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.5;
  background:
    radial-gradient(circle at 20% 30%, rgba(251,191,36,0.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(167,139,250,0.08), transparent 40%);
}
.golden-arc { position: fixed; inset: 0; z-index: -1; opacity: 0.12; pointer-events: none; }

/* ---------- Navbar ---------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(15,21,36,0.7);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 5%;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; letter-spacing: 1px;
}
.logo .mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  border-radius: 50%;
  color: #0f1524; font-weight: 900;
  box-shadow: 0 0 20px rgba(251,191,36,0.5);
}
nav .links { display: flex; gap: 26px; }
nav .links a {
  color: var(--muted); text-decoration: none;
  font-size: 0.92rem; font-weight: 500;
  transition: color 0.3s;
  position: relative;
  padding: 4px 2px;
}
nav .links a:hover { color: var(--gold-1); }
/* 当前所在模块高亮 */
nav .links a.active { color: var(--gold-1); font-weight: 700; }
nav .links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-1), var(--purple));
  transform-origin: left;
  animation: navUnderline 0.3s ease both;
}
@keyframes navUnderline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 手机端导航：链接横向滑动，避免 6 个链接把导航撑破/溢出 */
@media (max-width: 760px) {
  nav { padding: 10px 4%; }
  .logo { font-size: 0.95rem; flex-shrink: 0; }
  .logo .mark { width: 28px; height: 28px; font-size: 0.85rem; }
  nav .links {
    min-width: 0;
    flex-shrink: 1;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav .links::-webkit-scrollbar { display: none; }
  nav .links a { white-space: nowrap; font-size: 0.85rem; padding: 6px 8px; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vh, 20px);
  text-align: center;
  padding: 14px 5%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* 中央大圆形 FIBONACCI 按钮（x/y 同步加长、强制保持正圆） */
.hero-orb {
  /* 基准尺寸 = 用户认可的大小：默认即达到此前 hover(×1.04) 的视觉效果，
     hover 时再放大 4% 作为稍微变大的强化效果 */
  width: min(59vh, 59vw, 720px);
  height: min(59vh, 59vw, 720px);
  max-width: min(59vh, 59vw, 720px);
  max-height: min(59vh, 59vw, 720px);
  aspect-ratio: 1 / 1;          /* 强制定比 1:1，避免被拉伸成椭圆 */
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;              /* 防止 flex 拉伸变形 */
  border-radius: 50%;
  border: none;
        /* 无渐变：亮蓝打底 + 蓝色粗粝纹理图（青色高光 + 轻微暗角统一色调） */
  background-color: #4a6db4;
  background-image:
    linear-gradient(160deg, rgba(64,224,255,0.30), rgba(10,20,40,0.22) 60%, rgba(5,12,28,0.40)),
    url('../image/蓝色粗砺纹理.jpg');
  background-size: cover;
  background-position: center center;
  background-blend-mode: normal;
  color: #0f1524;
  display: grid;
  place-items: center;
  font-weight: 900;
  text-transform: uppercase;
  cursor: none;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.55),
    inset 0 0 46px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  z-index: 2;
}
.hero-orb:hover {
  transform: scale(1.04);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.6),
    inset 0 0 46px rgba(0, 0, 0, 0.18);
}
.orb-text {
  font-size: clamp(1.1rem, 4.5vmin, 3rem);
  letter-spacing: clamp(2px, 0.8vmin, 6px);
  padding-left: clamp(2px, 0.8vmin, 6px); /* 抵消 letterspacing 造成的视觉偏移 */
  color: #ffffff;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.45);
  user-select: none;
}
/* 银河视差背景层 */
.hero-milky {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url('../image/银河图片.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  /* 背景固定 = 滚动视差 */
  background-attachment: fixed;
  will-change: transform;
}
/* 渐变遮罩 */
.hero-milky::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,
      rgba(15,21,36,0.45), rgba(15,21,36,0.15) 40%, rgba(15,21,36,0.5)),
    linear-gradient(to bottom,
      rgba(15,21,36,0.35) 0%,
      rgba(15,21,36,0.45) 50%,
      var(--bg) 100%);
}
.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.grad {
  background: linear-gradient(90deg, var(--gold-1), var(--pink), var(--purple), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.desc {
  max-width: 560px;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}
/* 大按钮下方的小字提示（预留） */
.cta {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  align-items: center;
}
/* 开始探索旁的 explore 小字 */
.cta-meta {
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-1);
  opacity: 0.75;
  margin-left: 6px;
  font-weight: 600;
}
.btn {
  padding: 13px 30px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-3px); }
/* Hero 内联 Next 按钮（粉紫色主按钮，触发屏切换） */
.next-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 34px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #0f1524;
  font-weight: 800;
  font-size: 1.02rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(167,139,250,0.4);
  transition: transform 0.25s, box-shadow 0.25s;
}
.next-btn-inline:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 34px rgba(244,114,182,0.5);
}
.next-btn-inline .arr { font-size: 1.3rem; line-height: 1; }
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #0f1524;
  box-shadow: 0 8px 25px rgba(167,139,250,0.4);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }

/* Sequence ticker in hero（置于大按钮下方，间距由 .hero 的 gap 统一控制） */
.seq-strip {
  margin-top: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 14px 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  max-width: 800px;
  width: 100%;
  box-shadow: var(--shadow);
  /* 为 chips 的 GSAP 3D 翻转提供透视景深 */
  perspective: 900px;
}
.seq-chip {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.05rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  /* 入场 3D 动画改由 GSAP 控制（hero.js），移除 CSS 的 popIn 避免覆盖 transform */
}
/* 桌面 / 全屏：数列 chips 收拢为同一行（13 项自适应收缩） */
@media (min-width: 760px) {
  .seq-strip { flex-wrap: nowrap; }
  .seq-chip {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: clamp(30px, 5vw, 46px);
    max-width: 58px;
    font-size: clamp(0.76rem, 1.7vw, 1rem);
  }
}
@keyframes popIn {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
.scroll-hint {
  position: absolute; bottom: 30px;
  color: var(--muted); font-size: 0.8rem;
  letter-spacing: 2px;
  animation: float 2s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }

/* ---------- 通用 section ---------- */
section { padding: 90px 5%; max-width: 1200px; margin: 0 auto; }
.sec-head { text-align: center; margin-bottom: 55px; }
.sec-head .kicker {
  letter-spacing: 4px; font-size: 0.8rem; color: var(--gold-1);
  text-transform: uppercase; margin-bottom: 12px; font-weight: 700;
}
.sec-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.sec-head p { color: var(--muted); margin-top: 12px; max-width: 600px; margin-inline: auto; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- 通用 keyframes + 滚动渐显（多个模块复用） ---------- */
@keyframes fadeSlide { from{opacity:0; transform:translateY(8px)} to{opacity:1} }


.reveal {
  opacity: 0;
  transform: perspective(1300px) rotateY(22deg) rotateX(10deg) translateZ(-90px) scale(0.86);
  transform-origin: 50% 50%;
  transition:
    opacity 1s ease,
    transform 1.4s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: transform, opacity;
}
.reveal.visible {
  opacity: 1;
  transform: perspective(1300px) rotateY(0deg) rotateX(0deg) translateZ(0) scale(1);
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 50px 5%;
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--bg-2);
}
footer .heart { color: var(--pink); }

/* ============================================================
   View 单屏切换（架构升级）+ 过渡层 + Next 按钮
   ============================================================ */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
/* 全屏视图容器 */
.views {
  position: relative;
  width: 100%;
  height: 100dvh;               /* 移动端地址栏适配 */
}
.view {
  position: absolute;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  overflow-y: auto;             /* 单屏内部内容超高时可独立滚动 */
  overflow-x: hidden;
  overflow-x: clip;             /* 新版浏览器：避免 iOS 上 overflow-x:hidden 与纵向滚动冲突 */
  -webkit-overflow-scrolling: touch;
  z-index: 1;
}
.view.active { visibility: visible; opacity: 1; z-index: 2; }

/* 整屏 .view 的细窄滚动条：贴合最右侧、青色统一风格
   （仅当内容超高触发 overflow-y:auto 时才出现，内容不高则无滚动条） */
.view::-webkit-scrollbar { width: 6px; }
.view::-webkit-scrollbar-track { background: transparent; }
.view::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.35);   /* 青色半透明滑块 */
  border-radius: 50px;
}
.view::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 212, 191, 0.6);    /* 悬停变亮仍保持青色，不会变白 */
}
/* Firefox（滚动条宽窄与颜色受浏览器限制，仅在支持时生效） */
.view { scrollbar-width: thin; scrollbar-color: rgba(45,212,191,0.35) transparent; }

/* 全屏扩散过渡覆盖层（由 view.js 用 GSAP 控制） */
.page-transition {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  width: 8px; height: 8px;
  visibility: hidden;
  opacity: 0;
    background: radial-gradient(circle at 35% 32%,
        #302a44 0%,
        #232b45 40%,
        #182136 68%,
        var(--bg) 100%);
    box-shadow: 0 0 50px rgba(11,17,30,0.9);
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity, width, height, margin;
}

/* 统一 Next 按钮（固定于每屏右下角，供主跳转） */
.next-btn {
  position: fixed;
  right: 30px; bottom: 30px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 50px;
  border: 1px solid rgba(167,139,250,0.45);
  background: rgba(15,21,36,0.6);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  letter-spacing: 1px;
  transition: border-color 0.3s, color 0.3s, transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 0 18px rgba(167,139,250,0.15);
}
.next-btn:hover {
  border-color: var(--pink);
  color: var(--purple);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(244,114,182,0.3);
}
.next-btn .arr { font-size: 1.2rem; line-height: 1; }
@media (max-width: 640px) {
  .next-btn { right: 16px; bottom: 16px; padding: 11px 18px; font-size: 0.85rem; }
  /* 手机端收窄页面左右留白，给内容更多宽度，降低横向溢出 */
  section { padding: 60px 3.5%; }
}

/* ============================================================
   自定义光标：紫色圆形代替默认箭头
   ============================================================ */
html.cursor-custom,
html.cursor-custom body {
  cursor: none;
}
html.cursor-custom a,
html.cursor-custom button,
html.cursor-custom [role="button"],
html.cursor-custom input[type=range],
html.cursor-custom input[type="checkbox"],
html.cursor-custom label,
html.cursor-custom select,
html.cursor-custom .nature-card,
html.cursor-custom .quiz-opt,
html.cursor-custom .fact,
html.cursor-custom .mat-head,
html.cursor-custom .yh-cell,
html.cursor-custom .tray-piece,
html.cursor-custom .piece-shape,
html.cursor-custom .next-btn,
html.cursor-custom .next-btn-inline,
html.cursor-custom .fs-nav,
html.cursor-custom .fs-close,
html.cursor-custom .fo-nav,
html.cursor-custom .fo-close {
  cursor: none;
}

/* 跟随鼠标的粉色圆点（无光晕，黑色描边） */
.cursor-dot {
  position: fixed;
  z-index: 100000;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--pink), var(--purple));
  border: 2px solid #000;
  box-shadow: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, opacity 0.2s;
  will-change: left, top;
}
/* 交互态：放大 */
.cursor-dot.is-hover {
  width: 34px;
  height: 34px;
  box-shadow: none;
}
/* 大圆形按钮特化：悬停时小球大幅放大，内部显示 explore */
.cursor-dot::after {
  content: 'explore';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}
.cursor-dot.is-explore {
  width: 64px;
  height: 64px;
  background: radial-gradient(circle at 35% 30%, var(--pink), var(--purple));
  box-shadow: none;
}
.cursor-dot.is-explore::after { opacity: 1; }
/* 触屏 / 禁用动画偏好时隐藏自定义光标 */
@media (pointer: coarse) {
  .cursor-dot { display: none; }
  html.cursor-custom, html.cursor-custom body,
  html.cursor-custom a, html.cursor-custom button,
  html.cursor-custom [role="button"],
  html.cursor-custom input[type=range] { cursor: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-dot { display: none; }
  html.cursor-custom, html.cursor-custom body { cursor: auto; }
}
