/* =========================================================
   challenge.wecreate.zone — 明亮活力少年风
   独立设计，与 futuredev 无任何关联。
   ========================================================= */

:root {
  color-scheme: light;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  /* heavy display font for big headings */
  --display: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", Inter, ui-sans-serif, system-ui, sans-serif;

  /* base palette */
  --bg: #f7f8fc;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --fg: #16182b;
  --fg-dim: #565a73;
  --fg-faint: #9aa0b8;
  --line: rgba(22, 24, 43, 0.09);
  --line-strong: rgba(22, 24, 43, 0.16);
  --shadow: 0 10px 30px -12px rgba(22, 24, 43, 0.18);
  --shadow-lg: 0 26px 60px -22px rgba(22, 24, 43, 0.28);

  /* brand + accent colors */
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --green: #10b981;
  --lime: #84cc16;
  --orange: #f97316;
  --amber: #f59e0b;
  --pink: #ec4899;
  --red: #ef4444;
  --purple: #8b5cf6;
  --violet: #6366f1;

  --brand: var(--violet);
  --grad: linear-gradient(100deg, #6366f1, #3b82f6, #06b6d4, #10b981, #f59e0b, #ec4899);
  --grad-warm: linear-gradient(100deg, #f97316, #ec4899, #8b5cf6);

  /* per-level colors */
  --l1: #3b82f6;
  --l2: #06b6d4;
  --l3: #10b981;
  --l4: #84cc16;
  --l5: #f59e0b;
  --l6: #ec4899;
  --l7: #8b5cf6;
  --l8: #6366f1;

  --max-w: 1140px;
  --pad-x: clamp(1.25rem, 5vw, 3.25rem);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(99, 102, 241, 0.10), transparent 60%),
    radial-gradient(50rem 36rem at -10% 8%, rgba(6, 182, 212, 0.10), transparent 55%),
    var(--bg);
  color: var(--fg);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body[data-lang="zh"] .en { display: none; }
body[data-lang="en"] .zh { display: none; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; }
.hero h1, .prog-title, .section-head h2, .lv-head .meta h2 { font-family: var(--display); font-weight: 900; }

.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding-inline: var(--pad-x); }
.nowrap { white-space: nowrap; }
.grad-text {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-pan 8s linear infinite;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 248, 252, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4.4rem;
}

.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand-logo { width: 2.1rem; height: 2.1rem; flex: none; }
.brand-logo rect { transform-box: fill-box; transform-origin: bottom; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name b { font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-name span { font-size: 0.68rem; color: var(--fg-faint); font-weight: 600; }

.nav { display: flex; align-items: center; gap: 0.35rem; }
.nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg-dim);
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--bg-soft); color: var(--fg); }

.controls { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn, .lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 2.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg-dim);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.icon-btn { width: 2.3rem; }
.lang-toggle { padding: 0 0.8rem; }
.icon-btn:hover, .lang-toggle:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 1.1rem; height: 1.1rem; }

.theme-icon { display: none; }
:root[data-theme="light"] .theme-icon-moon { display: block; }
:root[data-theme="dark"]  .theme-icon-sun  { display: block; }

.lang-sep { color: var(--fg-faint); margin: 0 0.1rem; }
body[data-lang="zh"] .lang-opt[data-lang-target="zh"],
body[data-lang="en"] .lang-opt[data-lang-target="en"] { color: var(--brand); }

.nav-toggle { display: none; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 180% auto;
  box-shadow: 0 12px 26px -12px rgba(99, 102, 241, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); background-position: right center; box-shadow: 0 18px 34px -12px rgba(99, 102, 241, 0.8); }
.btn-ghost { color: var(--fg); background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }

/* =========================================================
   HERO
   ========================================================= */
.hero { position: relative; padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); overflow: hidden; }
.hero-inner { position: relative; z-index: 2; max-width: 41rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  margin: 0 0 1.4rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg-dim);
}
.eyebrow .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); animation: pulse 2.2s ease-out infinite; }

.hero h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 850; }
.hero h1 .line { display: block; }
.hero-sub { margin: 1.5rem 0 0; font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: var(--fg-dim); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.2rem; }

/* floating bubbles */
.bubbles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.bubble {
  position: absolute;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  filter: blur(0.5px);
  opacity: 0.85;
  animation: float 9s ease-in-out infinite;
}
.bubble.b1 { width: 7rem; height: 7rem; right: 6%;  top: 12%; background: linear-gradient(135deg, var(--violet), var(--blue)); }
.bubble.b2 { width: 4.5rem; height: 4.5rem; right: 28%; top: 4%; background: linear-gradient(135deg, var(--cyan), var(--green)); animation-delay: -1.5s; }
.bubble.b3 { width: 9rem; height: 9rem; right: 14%; bottom: 6%; background: linear-gradient(135deg, var(--orange), var(--pink)); animation-delay: -3s; }
.bubble.b4 { width: 3.4rem; height: 3.4rem; right: 40%; bottom: 18%; background: linear-gradient(135deg, var(--amber), var(--orange)); animation-delay: -4.5s; }
@media (max-width: 860px) { .bubbles { opacity: 0.5; } .bubble.b2, .bubble.b4 { display: none; } }

/* =========================================================
   STATS STRIP
   ========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 2rem; font-weight: 850; letter-spacing: -0.03em; }
.stat span { font-size: 0.9rem; color: var(--fg-dim); font-weight: 600; }
.stat:nth-child(1) b { color: var(--blue); }
.stat:nth-child(2) b { color: var(--green); }
.stat:nth-child(3) b { color: var(--orange); }
.stat:nth-child(4) b { color: var(--pink); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.kicker { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin: 0 0 0.7rem; }
.section-head h2 { margin: 0; font-size: clamp(1.9rem, 4.5vw, 2.9rem); font-weight: 850; }
.section-head p { margin: 1rem 0 0; color: var(--fg-dim); font-size: 1.08rem; }

/* large, prominent program titles */
.prog-title { margin: 0; font-size: clamp(2.9rem, 9vw, 5.8rem); font-weight: 900; line-height: 1.04; letter-spacing: -0.035em; }
.prog-tag { margin: 1.1rem 0 0; font-size: clamp(1.3rem, 3.2vw, 1.95rem); font-weight: 850; color: var(--fg); }

/* about pillars */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.pillar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.pillar .emoji { font-size: 1.8rem; }
.pillar h3 { margin: 0.7rem 0 0.4rem; font-size: 1.15rem; font-weight: 800; }
.pillar p { margin: 0; color: var(--fg-dim); font-size: 0.96rem; }
@media (max-width: 820px) { .pillars { grid-template-columns: 1fr; } }

/* rules row */
.rules { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; }
.rule {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.92rem; font-weight: 600; color: var(--fg-dim);
}
.rule b { color: var(--fg); font-weight: 800; }

/* =========================================================
   LEVEL LADDER (cards)
   ========================================================= */
.ladder { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
@media (max-width: 760px) { .ladder { grid-template-columns: 1fr; } }

.level {
  --c: var(--brand);
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.4rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.level::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.level:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 50%, transparent); }

.level-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.level-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; flex: none;
  border-radius: 16px; font-weight: 850; font-size: 1.3rem; color: #fff;
  background: var(--c);
  box-shadow: 0 8px 18px -8px var(--c);
}
.level-form { font-size: 0.78rem; font-weight: 700; color: var(--fg-dim); text-align: right; }
.level-form .grade { display: block; color: var(--fg-faint); font-weight: 600; margin-top: 0.15rem; }

.level h3 { margin: 1rem 0 0.5rem; font-size: 1.2rem; font-weight: 850; }
.level h3 .num { color: var(--c); }
.level p { margin: 0; color: var(--fg-dim); font-size: 0.96rem; }
.level-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag {
  font-size: 0.74rem; font-weight: 700;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}

.level.l1 { --c: var(--l1); } .level.l2 { --c: var(--l2); }
.level.l3 { --c: var(--l3); } .level.l4 { --c: var(--l4); }
.level.l5 { --c: var(--l5); } .level.l6 { --c: var(--l6); }
.level.l7 { --c: var(--l7); } .level.l8 { --c: var(--l8); }

.ladder-cta { display: flex; justify-content: center; margin-top: 2rem; }

/* =========================================================
   HACKATHON
   ========================================================= */
.hack { background:
    radial-gradient(40rem 30rem at 100% 0%, rgba(236, 72, 153, 0.10), transparent 60%),
    radial-gradient(40rem 30rem at 0% 100%, rgba(99, 102, 241, 0.10), transparent 60%);
}
.hack-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.6rem; align-items: start; }
@media (max-width: 880px) { .hack-grid { grid-template-columns: 1fr; } }

.groups { display: grid; gap: 0.8rem; }
.group {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.2rem; box-shadow: var(--shadow);
}
.group .gname { font-weight: 850; }
.group .glevel { font-size: 0.82rem; color: var(--fg-dim); font-weight: 600; }
.group .gdesc { font-size: 0.88rem; color: var(--fg-dim); }
.group .gtime { font-size: 0.82rem; font-weight: 800; color: var(--brand); white-space: nowrap; }
@media (max-width: 520px) { .group { grid-template-columns: 1fr; gap: 0.35rem; } .group .gtime { color: var(--pink); } }

.hack-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.hack-card h3 { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 850; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; counter-reset: step; }
.flow li { position: relative; padding-left: 2.2rem; font-size: 0.95rem; color: var(--fg-dim); }
.flow li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -0.1rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; color: #fff;
  background: var(--grad-warm);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.2rem; }
.chip { font-size: 0.8rem; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--bg-soft); color: var(--fg-dim); }

.bip { margin-top: 1.4rem; padding: 1.1rem 1.3rem; border-radius: var(--radius-sm); border: 1px dashed var(--line-strong); background: color-mix(in srgb, var(--pink) 6%, var(--surface)); }
.bip b { color: var(--pink); }
.bip p { margin: 0.4rem 0 0; font-size: 0.92rem; color: var(--fg-dim); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.8rem; }
.site-footer .f-brand { font-weight: 800; }
.site-footer .f-note { font-size: 0.85rem; color: var(--fg-faint); }

/* =========================================================
   LEVELS DETAIL PAGE
   ========================================================= */
.page-hero { padding: clamp(2.5rem, 6vw, 4rem) 0 0; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--fg-dim); font-size: 0.92rem; }
.back-link:hover { color: var(--brand); }

.lv-toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.8rem 0 0; }
.lv-toc a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.85rem; font-weight: 700; color: var(--fg-dim);
}
.lv-toc a .d { width: 0.7rem; height: 0.7rem; border-radius: 4px; }
.lv-toc a:hover { color: var(--fg); border-color: var(--line-strong); }

.lv { --c: var(--brand); scroll-margin-top: 5.5rem; padding: clamp(2.2rem, 5vw, 3.2rem) 0; border-top: 1px solid var(--line); }
.lv:first-of-type { border-top: none; }
.lv-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.lv-head .level-badge { width: 3.4rem; height: 3.4rem; }
.lv-head .meta h2 { margin: 0; font-size: clamp(1.4rem, 3.5vw, 2rem); }
.lv-head .meta h2 .num { color: var(--c); }
.lv-head .meta .sub { font-size: 0.9rem; color: var(--fg-dim); font-weight: 600; margin-top: 0.2rem; }

.lv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.lv.no-op .lv-cols { grid-template-columns: 1fr; }
@media (max-width: 760px) { .lv-cols { grid-template-columns: 1fr; } }
.lv-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); }
.lv-block .bh { display: flex; align-items: center; gap: 0.5rem; font-weight: 850; font-size: 1.02rem; margin-bottom: 0.8rem; }
.lv-block .bh .pin { font-size: 0.72rem; font-weight: 800; padding: 0.18rem 0.55rem; border-radius: 999px; color: #fff; background: var(--c); }
.lv-block.op .bh .pin { background: var(--orange); }
.lv-block ul { margin: 0; padding-left: 1.1rem; }
.lv-block li { margin: 0.4rem 0; color: var(--fg-dim); font-size: 0.95rem; }
.lv-block li b { color: var(--fg); }

.lv.l1 { --c: var(--l1); } .lv.l2 { --c: var(--l2); }
.lv.l3 { --c: var(--l3); } .lv.l4 { --c: var(--l4); }
.lv.l5 { --c: var(--l5); } .lv.l6 { --c: var(--l6); }
.lv.l7 { --c: var(--l7); } .lv.l8 { --c: var(--l8); }

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes grad-pan { to { background-position: 200% center; } }
@keyframes pulse { to { box-shadow: 0 0 0 0.55rem rgba(16, 185, 129, 0); } }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}
@keyframes rise { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }
.brand-logo rect { animation: rise 0.7s cubic-bezier(.2,.8,.2,1) backwards; }
.brand-logo rect:nth-child(1){animation-delay:.05s} .brand-logo rect:nth-child(2){animation-delay:.15s}
.brand-logo rect:nth-child(3){animation-delay:.25s} .brand-logo rect:nth-child(4){animation-delay:.35s}

/* =========================================================
   DARK VARIANT
   ========================================================= */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1020;
  --bg-soft: #181a2e;
  --surface: #171930;
  --fg: #f3f4fb;
  --fg-dim: #aab0d0;
  --fg-faint: #6b7099;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 70px -26px rgba(0, 0, 0, 0.7);
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(50rem 36rem at -10% 8%, rgba(6, 182, 212, 0.16), transparent 55%),
    var(--bg);
}
:root[data-theme="dark"] .site-header { background: rgba(14, 16, 32, 0.82); }
:root[data-theme="dark"] .btn-primary { box-shadow: 0 14px 30px -14px rgba(99, 102, 241, 0.9); }

/* =========================================================
   MOBILE NAV
   ========================================================= */
@media (max-width: 760px) {
  .nav {
    position: absolute; top: 4.4rem; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.2rem;
    padding: 0.8rem var(--pad-x) 1.2rem;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 0.7rem 0.9rem; }
  .nav-toggle { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble, .grad-text, .eyebrow .dot, .brand-logo rect, .btn-primary { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
