:root {
  --bg: #F7F4FF;
  --bg-2: #FFFFFF;
  --tint: #EEF2FF;
  --card: #FFFFFF;
  --title: #1B1340;
  --text: #2F2A4A;
  --muted: #5B5678;
  --soft: #8B86A3;
  --brand: #7C3AED;
  --lilac: #A78BFA;
  --teal: #14B8A6;
  --coral: #F97316;
  --rose: #E11D48;
  --amber: #F59E0B;
  --indigo: #312E81;
  --line: rgba(124, 58, 237, 0.14);
  --shadow: 0 16px 40px rgba(49, 46, 129, 0.10);
  --radius: 22px;
  --max: 1200px;
  --bar: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

h1, h2, h3, h4 {
  color: var(--title);
  line-height: 1.28;
  margin: 0 0 14px;
  font-weight: 700;
}

h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: 20px; }

p { margin: 0 0 14px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 80;
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
}

.page-main {
  padding-top: 96px;
  min-height: 70vh;
}

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.lead {
  font-size: 17px;
  color: var(--muted);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #A78BFA, #14B8A6);
}

/* Brand bar */
.brandbar-wrap {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.brandbar {
  pointer-events: auto;
  width: min(var(--bar), calc(100% - 24px));
  height: 64px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  gap: 8px;
}

.icon-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.bar-side {
  display: flex;
  gap: 6px;
  flex: 1;
}

.bar-side.right { justify-content: flex-end; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid transparent;
}

.pill:hover,
.pill:focus-visible {
  background: var(--tint);
  outline: none;
}

.pill.is-current {
  border-color: var(--brand);
  color: var(--brand);
  background: #F3E8FF;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.logo-fallback {
  font-weight: 800;
  color: var(--indigo);
  letter-spacing: 0.04em;
}

.mobile-top {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.mobile-app {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 50%, #14B8A6 100%);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

/* Overlay / drawer / search */
.veil {
  position: fixed;
  inset: 0;
  background: rgba(27, 19, 64, 0.38);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s;
}

.veil.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 110%);
  width: min(720px, 100%);
  max-height: 78vh;
  background: #fff;
  border-radius: 28px 28px 0 0;
  z-index: 60;
  visibility: hidden;
  pointer-events: none;
  transition: transform .32s ease;
  box-shadow: var(--shadow);
  overflow: auto;
  padding: 18px 18px 28px;
}

.drawer.is-on {
  transform: translate(-50%, 0);
  visibility: visible;
  pointer-events: auto;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--title);
}

.drawer-brand img {
  width: 36px;
  height: 36px;
}

.drawer-group {
  margin: 16px 0;
}

.drawer-group h3 {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--soft);
  margin-bottom: 8px;
}

.drawer-link {
  display: block;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  min-height: 44px;
}

.drawer-link:hover,
.drawer-link:focus-visible {
  background: var(--tint);
  outline: none;
}

.drawer-link strong {
  display: block;
  color: var(--title);
}

.drawer-link span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.search-layer {
  position: fixed;
  z-index: 60;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}

.search-layer.is-on {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

.search-card {
  width: min(720px, calc(100% - 24px));
  margin: 92px auto 0;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 18px;
}

.search-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.search-look {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--soft);
  min-height: 48px;
}

.search-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.search-presets a {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--indigo);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.search-presets a:hover,
.search-presets a:focus-visible {
  background: #E9D5FF;
  outline: none;
}

/* Island nav */
.island {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(420px, calc(100% - 28px));
  height: 52px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 999px;
  z-index: 35;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.island a {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.island a.is-current { color: var(--brand); }

.island a.is-current::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  position: absolute;
  top: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn:focus-visible { outline: 3px solid rgba(124, 58, 237, 0.35); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, #A78BFA 0%, #7C3AED 50%, #14B8A6 100%);
  color: #FFFFFF;
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--title);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.img-slot,
.media img,
.media .img-slot {
  width: 100%;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(167, 139, 250, 0.18), rgba(20, 184, 166, 0.10)),
    var(--tint);
}

.img-slot { min-height: 220px; }

.media img {
  object-fit: cover;
  width: 100%;
}

/* Home */
.dock {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
  padding: 12px 0 40px;
}

.dock-copy h1 { margin-bottom: 16px; }

.tag-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 10px 0 36px;
}

.tag {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  min-height: 120px;
}

.tag:hover,
.tag:focus-visible { border-color: var(--brand); outline: none; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.dot-p { background: var(--brand); }
.dot-t { background: var(--teal); }
.dot-c { background: var(--coral); }
.dot-r { background: var(--rose); }

.pulse-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: start;
}

.num-list a {
  display: flex;
  gap: 12px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}

.num-list b {
  color: var(--brand);
  font-size: 22px;
}

.mosaic {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
}

.mosaic article:first-child { grid-row: 1 / span 2; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.board-grid article:nth-child(1) { grid-row: span 2; }
.board-grid article:nth-child(4) { grid-column: span 2; }

.folder-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 10px;
  min-height: 56px;
}

.folder-list a:hover,
.folder-list a:focus-visible { border-color: var(--brand); outline: none; }

.score-row {
  display: grid;
  gap: 12px;
}

.score-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}

.big-num {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.c1 { color: var(--brand); }
.c2 { color: var(--teal); }
.c3 { color: var(--coral); }
.c4 { color: var(--rose); }
.c5 { color: var(--amber); }

.axis { position: relative; padding-left: 28px; }
.axis::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}

.node {
  position: relative;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.node::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--tint);
  color: var(--indigo);
}

.chip-teal { background: #CCFBF1; color: #115E59; }
.chip-amber { background: #FEF3C7; color: #92400E; }
.chip-rose { background: #FFE4E6; color: #9F1239; }

.section { padding: 28px 0 12px; }

.page-hero {
  padding-bottom: 10px;
}

.prose p { margin-bottom: 16px; }

.index-block,
.type-grid,
.faq-list,
.step-list,
.job-grid {
  display: grid;
  gap: 12px;
}

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

.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px;
}

.faq-item h2, .faq-item h3 { font-size: 18px; }

.episode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 20px;
}

.episode-bar a {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 600;
}

.episode-bar a:hover,
.episode-bar a:focus-visible { border-color: var(--brand); outline: none; }

.reel-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

/* Footer */
.site-footer {
  background: #1B1340;
  color: #F4F0FF;
  margin-top: 56px;
  padding: 40px 0 96px;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.foot-brand img { width: 40px; height: 40px; }
.foot-brand strong { display: block; font-size: 18px; }
.foot-brand em { font-style: normal; color: #C4B5FD; font-size: 13px; }

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

.foot-grid h3 {
  color: #EDE9FE;
  font-size: 14px;
  margin-bottom: 10px;
}

.foot-grid a {
  display: block;
  color: #DDD6FE;
  min-height: 32px;
  padding: 4px 0;
}

.foot-grid a:hover,
.foot-grid a:focus-visible { color: #fff; outline: none; }

.foot-note {
  margin-top: 22px;
  color: #C4B5FD;
  font-size: 14px;
}

.legal-copy { margin-top: 10px; color: #EDE9FE; }

@media (max-width: 980px) {
  .dock, .pulse-grid, .split, .mosaic, .type-grid, .board-grid, .job-grid, .foot-grid, .tag-rail {
    grid-template-columns: 1fr 1fr;
  }
  .mosaic article:first-child,
  .board-grid article:nth-child(1),
  .board-grid article:nth-child(4) {
    grid-row: auto;
    grid-column: auto;
  }
}

@media (min-width: 821px) {
  .desktop-logo { display: flex; }
}
@media (max-width: 820px) {
  .bar-side { display: none; }
  .desktop-logo { display: none; }
  .mobile-top { display: flex; }
  .mobile-top .brand-logo { position: absolute; left: 50%; transform: translateX(-50%); }
  .brandbar { position: relative; }
  .island { display: flex; }
  .page-main { padding-top: 88px; padding-bottom: 28px; }
  .site-footer { padding-bottom: 120px; }
  .search-layer.is-on {
    inset: 0;
    background: #F7F4FF;
  }
  .search-card {
    margin: 18px auto;
    background: transparent;
    box-shadow: none;
    border: 0;
    width: calc(100% - 8px);
  }
  .dock, .pulse-grid, .split, .mosaic, .type-grid, .board-grid, .job-grid, .foot-grid, .tag-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .score-item { grid-template-columns: 64px 1fr; }
  .big-num { font-size: 34px; }
}
