/* ============================================================
   Components
   ============================================================ */

/* —— Nav —— */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 15px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-right { display: flex; align-items: center; gap: 20px; }
.countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
}
.countdown b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

/* —— Buttons —— */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 9px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms ease, opacity 180ms ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(20,19,15,0.18); opacity: 0.92; }
.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.button.secondary:hover { border-color: var(--ink); box-shadow: none; }

/* —— Hero（居中编辑式）—— */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 104px var(--gutter) 0;
  text-align: center;
}
.hero-copy { max-width: 880px; margin: 0 auto; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 30px;
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26,127,79,0.45); }
  70% { box-shadow: 0 0 0 7px rgba(26,127,79,0); }
}
.hero h1 { letter-spacing: -0.03em; }
.lead {
  max-width: 640px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.72;
}
.hero-media {
  max-width: 440px;
  margin: 56px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transition: transform 500ms var(--ease), box-shadow 500ms ease;
}
.hero-media:hover { transform: translateY(-5px); box-shadow: 0 34px 74px rgba(20,19,15,0.18); }
.hero-media img { width: 100%; height: auto; display: block; transition: transform 700ms var(--ease); }
.hero-media:hover img { transform: scale(1.03); }

/* —— Hero motion cover（参考 Tresmares 首屏：大字、留白、动态雾面背景）—— */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: none;
  min-height: calc(100vh - 77px);
  margin: 0;
  padding: 0 var(--gutter);
  display: block;
  text-align: left;
  clip-path: inset(0);
}
.hero-motion {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  background: #fff;
  overflow: hidden;
  overflow: clip;
  contain: paint;
}
.mountain-layer {
  position: absolute;
  inset: 0;
  background-image: url("../assets/hero-mountain-mist.png");
  background-repeat: no-repeat;
  background-size: min(1500px, 116vw) auto;
  background-position: 72% 58%;
  will-change: transform, opacity;
}
.mountain-base {
  opacity: 0.74;
  animation: mountainDrift 26s ease-in-out infinite alternate;
}
.mountain-soft {
  opacity: 0.22;
  filter: blur(8px);
  transform: scale(1.08) translate3d(-2%, 2%, 0);
  animation: mountainSoftDrift 34s ease-in-out infinite alternate;
}
.mountain-fog {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.36) 38%, rgba(255,255,255,0.86) 78%, #fff 100%),
    radial-gradient(70vw 38vw at 26% 64%, rgba(255,255,255,0.82), rgba(255,255,255,0) 68%),
    radial-gradient(56vw 32vw at 82% 70%, rgba(255,255,255,0.78), rgba(255,255,255,0) 70%);
  animation: fogBreath 18s ease-in-out infinite alternate;
}
@keyframes mountainDrift {
  from { transform: scale(1.02) translate3d(-1.2%, -0.5%, 0); }
  to { transform: scale(1.045) translate3d(1.2%, 0.8%, 0); }
}
@keyframes mountainSoftDrift {
  from { transform: scale(1.08) translate3d(1.2%, 1.4%, 0); }
  to { transform: scale(1.12) translate3d(-1.2%, 0.2%, 0); }
}
@keyframes fogBreath {
  from { opacity: 0.86; transform: translate3d(0, 0, 0); }
  to { opacity: 0.98; transform: translate3d(0, -1.6%, 0); }
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 38%;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 88%);
}
.hero-copy {
  position: relative;
  max-width: var(--max);
  margin-left: max(0px, calc((100vw - var(--max)) / 2));
  padding-top: min(19vh, 170px);
  min-height: calc(100vh - 77px);
}
.hero .pill {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  margin-bottom: 34px;
}
.hero h1 {
  max-width: 1040px;
  font-size: clamp(56px, 8.9vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.055em;
}
.hero h1 span {
  display: block;
}
.hero h1 span:nth-child(2) {
  transform: translateX(7.5vw);
}
.hero .lead {
  position: absolute;
  right: max(var(--gutter), calc((100vw - var(--max)) / 2));
  bottom: 92px;
  max-width: 360px;
  margin: 0;
  font-size: 20px;
  line-height: 1.55;
}

/* —— Stats band（参考 Tresmares 数据带）—— */
.stats-band { margin-top: 104px; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 40px var(--gutter);
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; }
.stat .n {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 660;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .n span { font-size: 0.5em; font-weight: 700; color: var(--muted-2); margin-left: 2px; }
.stat .l { margin-top: 10px; color: var(--muted); font-size: 14px; }

/* —— Offer cards —— */
.offer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.offer {
  min-height: 210px;
  padding: 30px;
  background: var(--bg);
  transition: background 220ms ease;
}
.offer:hover { background: var(--paper); }
.offer .idx {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  margin-bottom: 22px;
}
.offer h3 { margin-bottom: 10px; }
.offer p, .module p, .skill p { margin: 0; color: var(--muted); font-size: 15px; }

/* —— Modules —— */
.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease), box-shadow 220ms ease, border-color 220ms ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(20,19,15,0.10); border-color: var(--line-strong); }
.module { padding: 28px; }
.num {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  margin-bottom: 18px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
}
.module h3 { margin-bottom: 9px; }
.module ul, .plain-list { padding: 0; margin: 16px 0 0; list-style: none; }
.module li, .plain-list li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 15px;
}
.module li + li, .plain-list li + li { margin-top: 8px; }
.module li::before, .plain-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.66em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.tag {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: var(--ink);
  background: var(--paper-2);
}

/* featured module — 深色对比卡 */
.module--feature {
  grid-column: 1 / -1;
  border-radius: var(--radius);
  background: var(--ink);
  box-shadow: 0 20px 50px rgba(20,19,15,0.18);
  transition: transform 220ms var(--ease), box-shadow 220ms ease;
}
.module--feature:hover { transform: translateY(-3px); box-shadow: 0 26px 60px rgba(20,19,15,0.24); }
.module--feature .feature-inner {
  padding: 36px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 30px;
  align-items: center;
}
.module--feature .num { background: #fff; color: var(--ink); }
.module--feature h3 { font-size: 24px; color: #fff; }
.module--feature p { color: rgba(255,255,255,0.72); }
.module--feature li { color: rgba(255,255,255,0.72); }
.module--feature li::before { background: rgba(255,255,255,0.5); }
.module--feature .tag { color: #fff; background: rgba(255,255,255,0.14); }

/* —— Skills —— */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.skill { padding: 28px; min-height: 200px; }
.skill .ic-tile {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  margin-bottom: 20px;
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}
.skill svg { width: 24px; height: 24px; }
.skill h3 { margin-bottom: 10px; }

/* —— Bonus 大礼包专栏 —— */
.bonus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 60px;
}
.bonus { padding: 26px; }
.bonus-ic {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--ink); color: #fff;
  font-size: 15px;
}
.bonus h3 { margin-bottom: 8px; }
.bonus p { color: var(--muted); font-size: 14.5px; margin: 0; line-height: 1.55; }
.bonus-skills-head { max-width: 720px; margin: 0 auto 30px; text-align: center; }
.bonus-skills-head h3 { font-size: clamp(20px, 2.2vw, 26px); margin-bottom: 10px; }
.bonus-skills-head p { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0; }
.bonus-skills-head p strong { color: var(--ink); font-weight: 600; }

/* —— File tree（深色代码窗口）—— */
.filetree {
  max-width: 820px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.filetree-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.filetree-bar i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.filetree-bar .path {
  margin-left: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, "SF Mono", monospace;
  font-size: 12.5px;
  color: rgba(255,255,255,0.45);
}
.filetree-body { padding: 18px 22px 20px; overflow-x: auto; }
.filetree-row {
  display: flex;
  align-items: baseline;
  padding: 6px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, "SF Mono", monospace;
  font-size: 13.5px;
  line-height: 1.5;
}
.js .filetree-row { opacity: 0; transform: translateY(6px); transition: opacity 460ms var(--ease), transform 460ms var(--ease); }
.filetree.is-in .filetree-row { opacity: 1; transform: none; }
.filetree.is-in .filetree-row:nth-child(1) { transition-delay: 60ms; }
.filetree.is-in .filetree-row:nth-child(2) { transition-delay: 120ms; }
.filetree.is-in .filetree-row:nth-child(3) { transition-delay: 180ms; }
.filetree.is-in .filetree-row:nth-child(4) { transition-delay: 240ms; }
.filetree.is-in .filetree-row:nth-child(5) { transition-delay: 300ms; }
.filetree.is-in .filetree-row:nth-child(6) { transition-delay: 360ms; }
.filetree.is-in .filetree-row:nth-child(7) { transition-delay: 420ms; }
.filetree.is-in .filetree-row:nth-child(8) { transition-delay: 480ms; }
.filetree.is-in .filetree-row:nth-child(9) { transition-delay: 540ms; }
.filetree.is-in .filetree-row:nth-child(10) { transition-delay: 600ms; }
.filetree-row .t { white-space: pre; color: rgba(255,255,255,0.26); }
.filetree-row .d { color: #fff; font-weight: 600; }
.filetree-row .c {
  margin-left: auto;
  padding-left: 28px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(255,255,255,0.42);
  white-space: nowrap;
}
.filetree-row.root .d { color: #fff; }
.filetree-foot {
  margin: 22px auto 0;
  max-width: 820px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.filetree-foot strong { color: var(--ink); font-weight: 600; }

/* —— Split panels —— */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.panel { padding: 34px; }
.panel h2 { font-size: clamp(24px, 2.4vw, 30px); }
.panel > p { color: var(--muted); font-size: 16px; }
.timeline { display: grid; margin-top: 24px; }
.timeline-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 18px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.timeline-row strong { font-size: 14px; }
.timeline-row span { color: var(--muted); font-size: 15px; }

/* —— Dark CTA —— */
.cta-section {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  padding: 120px 0;
}
.cta-section::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(70vw 60vw at 50% -10%, rgba(255,255,255,0.07), transparent 60%);
}
.cta {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}
.cta .eyebrow { color: rgba(255,255,255,0.55); }
.cta .eyebrow::before { background: rgba(255,255,255,0.4); }
.cta h2 { margin-bottom: 14px; font-size: clamp(34px, 5vw, 58px); letter-spacing: -0.03em; }
.cta-grad { color: rgba(255,255,255,0.55); }
.cta > div > p { margin: 0; color: rgba(255,255,255,0.7); font-size: 18px; max-width: 520px; }

/* —— CTA 左侧信息 —— */
.cta-meta { margin-top: 34px; max-width: 480px; }
.cta-meta > div {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.14);
}
.cta-meta .k { font-size: 13px; color: rgba(255,255,255,0.5); letter-spacing: 0.04em; }
.cta-meta .v { font-size: 15px; color: #fff; font-weight: 500; }
.cta-meta .v strong { font-family: var(--font-display); font-size: 20px; font-weight: 680; letter-spacing: -0.01em; }

/* —— QR card（独立展示）—— */
.qr-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.qr { display: grid; place-items: center; }
.qr img { width: 200px; height: auto; border-radius: 6px; display: block; }
.qr-cap { display: block; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* —— QR Popover（右上角，无背景模糊）—— */
.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: transparent; }
.modal-card {
  position: absolute;
  top: 70px; right: 24px;
  width: min(296px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(20,19,15,0.20);
  transform-origin: top right;
  animation: popover 240ms var(--ease);
}
.modal-card::before {
  content: ""; position: absolute; top: -7px; right: 28px;
  width: 12px; height: 12px; background: #fff;
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.pop-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px; padding-right: 24px;
}
.pop-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.pop-price { font-family: var(--font-display); font-size: 19px; font-weight: 660; letter-spacing: -0.02em; }
.pop-price small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.pop-qr {
  padding: 12px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.pop-qr img { width: 100%; max-width: 240px; height: auto; border-radius: 8px; display: block; }
.pop-tip { margin: 14px 2px 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.modal-id {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  margin-top: 14px; padding: 11px 14px;
  border-radius: 12px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-soft); cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.modal-id .cid b { font-weight: 700; font-family: ui-monospace, Menlo, monospace; margin-left: 4px; }
.modal-id .cp {
  flex: none;
  font-size: 12px; font-weight: 600; color: var(--accent);
}
.modal-id:hover { background: var(--paper-2); border-color: var(--line-strong); }
.modal-id.copied { background: #eaf7f0; border-color: #c4e6d3; }
.modal-id.copied .cid, .modal-id.copied .cp { color: var(--green); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: transparent; color: var(--muted-2);
  font-size: 18px; line-height: 1; cursor: pointer;
  transition: color 160ms ease;
}
.modal-close:hover { color: var(--ink); }
@keyframes popover { from { opacity: 0; transform: translateY(-8px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero {
    min-height: auto;
    padding: 72px var(--gutter) 0;
  }
  .hero-copy { margin-left: 0; padding-top: 0; min-height: auto; }
  .hero .lead { position: static; max-width: 560px; margin-top: 34px; }
  .split, .cta { grid-template-columns: 1fr; }
  .offer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bonus-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
  .stat { border-top: 1px solid var(--line); }
  .stat:nth-child(1), .stat:nth-child(2) { border-top: none; }
  .module--feature .feature-inner { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .section { padding: 72px 0; }
  .section.tight { padding: 56px 0; }
  .hero { padding: 56px 18px 0; }
  .hero h1 { font-size: clamp(46px, 14vw, 68px); letter-spacing: -0.045em; line-height: 0.98; }
  .hero h1 span:nth-child(2) { transform: translateX(0); }
  .hero .pill { margin-bottom: 26px; }
  .cta-section { padding: 80px 0; }
  .lead { font-size: 17px; }
  .section-head p { font-size: 17px; }
  .offer-grid, .modules, .skills, .bonus-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 28px 18px; }
  .timeline-row { grid-template-columns: 1fr; gap: 4px; }
  .button { width: 100%; }
  .hero-actions .button { flex: 1 1 100%; }
  .cta { gap: 36px; }
  .qr-card { justify-self: start; }
  .countdown .clock { display: none; }
  .countdown { font-size: 12.5px; }
  .modal-card { top: 62px; right: 14px; }
}
