:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: #eef3f1;
  color: #19342f;
  --paper: #ffffff;
  --paper-2: #f7faf8;
  --line: #d3ded9;
  --line-strong: #a9bcb4;
  --muted: #60736d;
  --ink: #19342f;
  --green: #0f766e;
  --green-dark: #115e59;
  --amber: #b45309;
  --red: #b42318;
  --blue: #2563eb;
  --shadow: 0 16px 42px #1d3a3217;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 0, #1b91811f, transparent 360px),
    linear-gradient(#f7faf9 0, #eef3f1 430px);
}
a { color: var(--green); }
code { padding: 2px 5px; border-radius: 4px; background: #edf3f0; color: #234b42; overflow-wrap: anywhere; }
kbd { display: inline-flex; min-width: 24px; min-height: 23px; align-items: center; justify-content: center; padding: 1px 7px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: #fff; color: var(--ink); font: 800 12px/1 system-ui, sans-serif; }
h1, h2, p, li { overflow-wrap: anywhere; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px max(18px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: #ffffffeb;
  backdrop-filter: blur(14px);
}
.brand { color: var(--green-dark); font-size: 19px; font-weight: 900; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 6px; }
nav a { padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; color: #536861; font-size: 13px; text-decoration: none; }
nav a:hover, nav a:focus-visible, nav a[aria-current="page"] { border-color: var(--line); background: #edf3f0; color: var(--green-dark); outline: none; }

main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 70px; }
.hero > *, .card, .route-list li { min-width: 0; }
.hero { display: grid; grid-template-columns: 1fr minmax(270px, .44fr); gap: 34px; align-items: end; margin-bottom: 28px; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 13px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
h1 { max-width: 800px; margin: 0; font-size: clamp(40px, 8vw, 78px); line-height: .98; letter-spacing: -.035em; }
.hero-copy { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.status-box { display: flex; gap: 12px; padding: 16px; border: 1px solid #bcd8cf; border-radius: 10px; background: #edf7f4; }
.status-box strong, .status-box small { display: block; }
.status-box small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.dot { width: 11px; height: 11px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px #0f766e1f; }

.quest-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid #bcd8cf;
  border-radius: 10px;
  background: linear-gradient(135deg, #eaf6f2, #fff);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 22px #1d3a320d;
}
.quest-entry:hover, .quest-entry:focus-visible { border-color: var(--green); outline: 2px solid #0f766e24; }
.quest-entry-copy b, .quest-entry-copy small { display: block; }
.quest-entry-copy small { margin-top: 4px; color: var(--muted); }
.quest-entry-action { flex: 0 0 auto; color: var(--green-dark); font-weight: 900; }

.current-grid { display: grid; grid-template-columns: 1.16fr .84fr; gap: 16px; margin: 24px 0; }
.answer-card { border-color: #e6c29d; background: linear-gradient(145deg, #fffaf3, #fff 48%); }
.goal-card { border-color: #bcd8cf; background: linear-gradient(145deg, #f1faf7, #fff 48%); }
.lead-answer { margin: 0 0 14px; padding: 13px 14px; border-left: 3px solid var(--green); background: #edf7f4; color: #234b42 !important; line-height: 1.65; }
.numbered-steps { margin-bottom: 0; }
.goal-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.goal-steps > div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.goal-steps span, .goal-steps b, .goal-steps small { display: block; }
.goal-steps span { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .05em; }
.goal-steps b { margin-top: 5px; }
.goal-steps small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.goal-steps code { padding: 0; background: none; font-size: 10px; }

.rescue { margin: 30px 0 20px; padding: clamp(20px, 4vw, 28px); border: 1px solid #bcd8cf; border-radius: 13px; background: linear-gradient(135deg, #f4fbf8, #fff 52%); box-shadow: var(--shadow); }
.rescue-heading { display: flex; align-items: center; gap: 12px; }
.rescue h2 { margin: 0; font-size: clamp(25px, 4vw, 37px); }
.pulse { padding: 6px 9px; border: 1px solid #b4530942; border-radius: 7px; background: #fff7ed; color: var(--amber); font-size: 12px; font-weight: 900; white-space: nowrap; }
.route-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 24px 0 0; list-style: none; counter-reset: route; }
.route-list li { position: relative; min-height: 92px; padding: 17px 16px 16px 52px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); counter-increment: route; }
.route-list li::before { content: counter(route); position: absolute; top: 17px; left: 16px; display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 900; }
.route-list strong, .route-list span { display: block; }
.route-list span { margin-top: 5px; color: var(--muted); line-height: 1.5; }
.warning, .rule { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid var(--amber); background: #fff7ed; color: #6f451e; line-height: 1.6; }

.search-panel { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #ffffffeb; box-shadow: 0 8px 22px #1d3a320d; }
.search-panel label { display: block; margin-bottom: 9px; font-weight: 900; }
.search-row { display: flex; gap: 9px; }
input, button { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; }
input { width: 100%; padding: 0 13px; background: #fff; color: var(--ink); }
input:focus { border-color: var(--green); outline: 2px solid #0f766e24; }
button { padding: 0 16px; background: #edf3f0; color: #536861; cursor: pointer; }
button:hover, button:focus-visible { border-color: var(--green); background: #e4f3ed; color: var(--green-dark); outline: none; }
#search-status { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { padding: clamp(20px, 3vw, 24px); border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); }
.card-wide { grid-column: 1 / -1; }
.card[hidden] { display: none; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.source, .state { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.source.tfc { background: #e8f3ef; color: #176459; }
.source.pack { background: #fff7ed; color: var(--amber); }
.source.addon { background: #eef5ff; color: #285b99; }
.source.server { background: #fff0ed; color: #a13c2b; }
.source.route, .source.evidence-tag { background: #f0eafb; color: #6944a0; }
.state { border: 1px solid var(--line); color: #60736d; background: #f7faf8; }
.state.can-do { border-color: #bcd8cf; color: var(--green-dark); background: #edf7f4; }
.state.mixed { border-color: #e6c29d; color: var(--amber); background: #fff7ed; }
.card h2 { margin: 17px 0 11px; font-size: 26px; }
.card p, .card li { color: #536861; line-height: 1.68; }
.card ol { padding-left: 21px; }
.card li + li { margin-top: 8px; }
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 17px; }
.layers div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); }
.layers b, .layers span { display: block; }
.layers span { margin-top: 5px; color: #71817c; font-size: 12px; line-height: 1.4; }
.risk { margin: 14px 0; padding: 13px; border: 1px solid #e6c29d; border-radius: 8px; background: #fff7ed; color: #8a4b12; line-height: 1.55; }
.branch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.branch-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); }
.branch-grid b, .branch-grid span { display: block; }
.branch-grid span { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.two-column-copy { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.two-column-copy > div { min-width: 0; }
.two-column-copy h3 { margin: 8px 0 9px; }
.two-column-copy p { margin-top: 8px; }
.progress-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.progress-facts > div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); }
.progress-facts b, .progress-facts span { display: block; }
.progress-facts span { margin-top: 6px; color: var(--muted); line-height: 1.55; }
.craft-chain { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 7px; margin-top: 16px; }
.craft-chain > div { position: relative; min-width: 0; padding: 14px 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); text-align: center; }
.craft-chain > div span { position: absolute; top: 6px; left: 7px; color: #71817c; font-size: 10px; }
.craft-chain b, .craft-chain small { display: block; }
.craft-chain small { margin-top: 6px; color: #71817c; line-height: 1.4; }
.craft-chain i { align-self: center; color: var(--green); font-style: normal; }
.server-list { margin: 10px 0 16px; }
.server-list div { display: grid; grid-template-columns: 88px 1fr; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.server-list dt { color: #96a395; }
.server-list dd { margin: 0; }
.legend { padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend .source { flex: 0 0 auto; }
.empty { padding: 28px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); background: var(--paper); text-align: center; }

.item-index { grid-column: 1 / -1; }
.item-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.item-strip-wide { border-top-color: #bcd8cf; }
.item-chip {
  display: grid;
  flex: 1 1 150px;
  min-width: 0;
  max-width: 225px;
  min-height: 64px;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}
.item-chip img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  padding: 4px;
  border: 1px solid #d5e0db;
  border-radius: 8px;
  background: linear-gradient(145deg, #f5faf7, #e8f0ec);
  image-rendering: pixelated;
}
.item-chip figcaption { min-width: 0; }
.item-chip b,
.item-chip code { display: block; }
.item-chip b { color: var(--ink); font-size: 13px; line-height: 1.35; }
.item-chip code { margin-top: 3px; padding: 0; background: none; color: #71817c; font-size: 9px; line-height: 1.25; word-break: break-all; }
.texture-note {
  display: inline-flex;
  margin-top: 4px;
  padding: 1px 5px;
  border: 1px solid #e6c29d;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--amber);
  font-size: 9px;
  font-weight: 800;
}
.item-strip-error {
  width: 100%;
  padding: 10px;
  border: 1px solid #e6c29d;
  border-radius: 8px;
  background: #fff7ed;
  color: var(--amber);
}

footer { display: flex; justify-content: space-between; gap: 20px; width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 40px; border-top: 1px solid var(--line); color: #71817c; font-size: 13px; }
footer p { margin: 0; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .current-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .route-list { grid-template-columns: 1fr; }
  .two-column-copy, .progress-facts { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { position: static; align-items: flex-start; flex-direction: column; }
  main, footer { width: calc(100% - 24px); }
  main { padding-top: 36px; }
  h1 { font-size: clamp(35px, 11.5vw, 48px); line-height: 1.05; }
  .hero-copy { font-size: 15px; }
  .rescue-heading { align-items: flex-start; flex-direction: column; }
  .search-row { flex-direction: column; }
  .craft-chain { grid-template-columns: 1fr; }
  .craft-chain i { justify-self: center; transform: rotate(90deg); }
  .goal-steps, .branch-grid { grid-template-columns: 1fr; }
  .layers { grid-template-columns: 1fr; }
  .item-chip { flex-basis: 135px; }
  .quest-entry { align-items: flex-start; flex-direction: column; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
