:root {
  --bg: #f4efe6;
  --bg-strong: #efe2cf;
  --paper: rgba(255, 250, 242, 0.86);
  --paper-strong: #fff8ef;
  --ink: #182126;
  --muted: #536168;
  --line: rgba(24, 33, 38, 0.12);
  --accent: #0f7b6c;
  --accent-2: #c45b2d;
  --accent-3: #f3d29a;
  --shadow: 0 20px 60px rgba(68, 47, 23, 0.12);
  --radius: 24px;
  --radius-sm: 14px;
  --content-width: min(1180px, calc(100vw - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(196, 91, 45, 0.16), transparent 34%),
    radial-gradient(circle at right 20%, rgba(15, 123, 108, 0.18), transparent 28%),
    linear-gradient(180deg, #fbf5ea 0%, #f2eadc 100%);
  color: var(--ink);
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", "Trebuchet MS", sans-serif;
}

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

code {
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.94em;
}

.page-shell {
  padding: 16px 0 48px;
}

.hero,
.section {
  width: var(--content-width);
  margin: 0 auto 20px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(24, 33, 38, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 248, 239, 0.94), rgba(246, 233, 214, 0.9)),
    repeating-linear-gradient(
      -35deg,
      rgba(255, 255, 255, 0.12) 0,
      rgba(255, 255, 255, 0.12) 10px,
      rgba(255, 255, 255, 0.02) 10px,
      rgba(255, 255, 255, 0.02) 20px
    );
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -140px -140px auto;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(15, 123, 108, 0.22), transparent 66%);
  pointer-events: none;
}

.helper-hero::after {
  background: radial-gradient(circle, rgba(105, 204, 240, 0.24), transparent 66%);
}

.conflict-hero::after {
  background: radial-gradient(circle, rgba(196, 91, 45, 0.22), transparent 66%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}

.topbar-links a {
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
  gap: 28px;
  padding: 18px 24px 28px;
}

.hero-copy {
  padding: 18px 6px 6px;
}

.eyebrow,
.section-kicker,
.panel-label,
.meta-chip {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1,
.section h2 {
  margin: 0;
  line-height: 1.03;
  font-family: "Bahnschrift", "Segoe UI Variable", sans-serif;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(2.8rem, 6vw, 5.7rem);
}

.hero-text,
.section-intro,
.class-card p,
.step-card p,
.info-block p,
.trouble-card p,
.faq-answer,
.version-summary,
.plain-list,
.signal-list {
  color: var(--muted);
  line-height: 1.68;
}

.hero-text {
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover,
.tab-button:hover,
.class-card:hover,
.step-card:hover,
.info-block:hover,
.trouble-card:hover,
.faq-item:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--ink);
  color: #f7efe4;
  box-shadow: 0 16px 32px rgba(24, 33, 38, 0.18);
}

.button-secondary {
  border: 1px solid rgba(24, 33, 38, 0.14);
  background: rgba(255, 255, 255, 0.46);
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.panel-card,
.section,
.class-card,
.step-card,
.info-block,
.trouble-card,
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  backdrop-filter: blur(14px);
}

.panel-card {
  padding: 20px;
}

.panel-links {
  display: grid;
  gap: 10px;
}

.panel-links a,
.resource-links a,
.text-link {
  color: var(--accent);
  font-weight: 700;
}

.panel-link-warning,
.text-link-warning {
  color: #c45b2d !important;
}

.signal-list,
.plain-list {
  margin: 0;
  padding-left: 18px;
}

.section {
  padding: 28px 24px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 20px;
  align-items: end;
}

.section h2 {
  font-size: clamp(2rem, 3.3vw, 3.5rem);
}

.section-intro {
  margin: 0;
}

.directory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 18px;
  margin-top: 28px;
  align-items: start;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-button {
  padding: 12px 16px;
  border: 1px solid rgba(24, 33, 38, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.tab-button.is-active {
  color: #fff7eb;
  background: linear-gradient(135deg, var(--ink), #27444d);
  border-color: transparent;
}

.search-field {
  display: grid;
  gap: 8px;
}

.search-field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(24, 33, 38, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  color: var(--ink);
}

.version-summary {
  margin-top: 16px;
}

.card-grid,
.steps-grid,
.setup-layout,
.trouble-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

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

.class-card,
.step-card,
.info-block,
.trouble-card {
  padding: 20px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.class-card {
  display: grid;
  gap: 12px;
  border-left: 5px solid var(--class-color, var(--accent));
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.94), rgba(255, 250, 242, 0.86)),
    linear-gradient(135deg, var(--class-tint, rgba(15, 123, 108, 0.12)), transparent 60%);
  box-shadow: 0 10px 24px rgba(74, 49, 27, 0.05);
}

.class-card h3,
.step-card h3,
.info-block h3,
.trouble-card h3 {
  margin: 0;
  font-size: 1.24rem;
}

.class-card p {
  margin: 0;
}

.spec-copy {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.65;
}

.spec-copy strong {
  color: var(--class-color, var(--accent));
}

.class-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.class-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: var(--class-tint, rgba(15, 123, 108, 0.12));
  box-shadow: inset 0 0 0 1px rgba(24, 33, 38, 0.08);
  overflow: hidden;
}

.class-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--class-tint, rgba(15, 123, 108, 0.1));
  color: color-mix(in srgb, var(--class-color, var(--accent)) 72%, #213038 28%);
  font-size: 0.75rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--class-tint, rgba(24, 33, 38, 0.06));
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed rgba(24, 33, 38, 0.16);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.section-split,
.section-contrast {
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.92), rgba(243, 235, 221, 0.92));
}

.steps-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.conflict-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-index {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(196, 91, 45, 0.12);
  color: var(--accent-2);
  font-weight: 800;
}

.setup-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-block {
  grid-column: 1 / -1;
}

.conflict-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.helper-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.path-list {
  display: grid;
  gap: 12px;
}

.path-list div {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.faq-item {
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.faq-symbol {
  color: var(--accent);
  flex: 0 0 auto;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px;
  transition: max-height 220ms ease, padding 220ms ease;
}

.faq-item.is-open .faq-answer {
  max-height: 420px;
  padding: 0 20px 20px;
}

.faq-answer p {
  margin: 0 0 14px;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

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

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

.trouble-card-strong {
  border-left: 5px solid #c45b2d;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(255, 246, 236, 0.92)),
    linear-gradient(135deg, rgba(196, 91, 45, 0.14), transparent 62%);
}

.helper-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  margin: 0;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(196, 91, 45, 0.14);
  color: #c45b2d;
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .hero-grid,
  .section-heading,
  .directory-toolbar,
  .setup-layout {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps-grid,
  .trouble-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 10px 0 28px;
  }

  .hero,
  .section {
    width: min(100vw - 20px, 100%);
  }

  .topbar,
  .hero-grid,
  .section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.2rem, 14vw, 3.8rem);
  }

  .card-grid,
  .steps-grid,
  .setup-layout,
  .trouble-grid {
    grid-template-columns: 1fr;
  }

  .button,
  .card-actions a {
    width: 100%;
  }

  .hero-actions,
  .card-actions,
  .resource-links {
    display: grid;
  }
}
