:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --surface: #fffdf7;
  --surface-2: #f1f7f4;
  --ink: #1f2933;
  --muted: #64706a;
  --line: #ded8c9;
  --brand: #1f8a70;
  --brand-2: #d45a3c;
  --accent: #f2b84b;
  --sky: #8ecae6;
  --shadow: 0 20px 60px rgba(42, 51, 45, .14);
  --radius: 8px;
}

:root.dark {
  color-scheme: dark;
  --bg: #161b22;
  --surface: #202832;
  --surface-2: #172a2d;
  --ink: #edf2ee;
  --muted: #aab7b0;
  --line: #33404b;
  --brand: #4bb894;
  --brand-2: #ee7b5c;
  --accent: #e6b95c;
  --sky: #315972;
  --shadow: 0 20px 60px rgba(0, 0, 0, .32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(142, 202, 230, .34), transparent 360px),
    radial-gradient(circle at top left, rgba(242, 184, 75, .18), transparent 320px),
    var(--bg);
  color: var(--ink);
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 30%);
  background: color-mix(in srgb, var(--surface), transparent 10%);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 3px solid #2d6a4f;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 42%, #2d6a4f 42% 58%, transparent 58%),
    linear-gradient(#88c057 0 44%, #5f9f43 44% 58%, #82583a 58%);
  box-shadow: inset 0 -4px rgba(0, 0, 0, .12);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.nav a,
.theme-toggle,
.filter,
.tool-grid button,
.search-shell button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

.nav a {
  padding: 9px 14px;
  color: var(--muted);
}

.nav a:hover,
.filter.active,
.filter:hover,
.tool-grid button:hover,
.search-shell button:hover {
  border-color: color-mix(in srgb, var(--brand), white 12%);
  color: var(--ink);
  background: color-mix(in srgb, var(--brand), transparent 86%);
}

.theme-toggle {
  position: relative;
  width: 48px;
  height: 30px;
  padding: 3px;
  cursor: pointer;
}

.theme-toggle span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform .2s ease;
}

:root.dark .theme-toggle span {
  transform: translateX(17px);
}

.workspace {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 22px;
  width: min(1440px, calc(100% - 32px));
  margin: 24px auto;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 3%);
  box-shadow: var(--shadow);
  min-width: 0;
}

.server-card {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.server-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.server-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: #2ec27e;
  box-shadow: 0 0 0 6px rgba(46, 194, 126, .15);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  transition: background .2s ease, color .2s ease;
}

.side-link:hover,
.side-link.active {
  background: color-mix(in srgb, var(--brand), transparent 86%);
  color: var(--ink);
}

.side-icon {
  width: 24px;
  height: 24px;
  border: 2px solid color-mix(in srgb, var(--ink), transparent 35%);
  border-radius: 6px;
  background: var(--surface);
}

.monster-icon { background: linear-gradient(#f48c6b 0 58%, #8d503a 58%); }
.equip-icon { background: linear-gradient(135deg, #d6e6ff 0 40%, #4c72a0 40%); }
.quest-icon { background: linear-gradient(#ffe69b 0 45%, #b58735 45%); }
.map-icon { background: linear-gradient(135deg, #8ecae6 0 50%, #6ab17a 50%); }
.tool-icon { background: linear-gradient(90deg, #c4b5fd 0 50%, #f59e0b 50%); }

.sidebar-note {
  padding: 14px;
  border-top: 1px solid var(--line);
}

.sidebar-note p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.content {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.hero,
.panel,
.stats article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 2%);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: 26px;
  min-height: 420px;
  padding: clamp(24px, 5vw, 54px);
  overflow: hidden;
  min-width: 0;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.06;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.search-shell {
  max-width: 720px;
  margin-top: 28px;
}

.search-shell label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-shell div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.search-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 12px 16px;
  background: transparent;
  color: var(--ink);
}

.search-shell button {
  padding: 0 20px;
  cursor: pointer;
}

.hero-image {
  display: grid;
  place-items: center;
  min-height: 330px;
  margin: 0;
  overflow: hidden;
  border: 3px solid color-mix(in srgb, var(--ink), transparent 78%);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
}

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

.stats article {
  padding: 18px;
}

.stats strong {
  display: block;
  margin-bottom: 6px;
  font-size: 28px;
}

.stats span {
  color: var(--muted);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-head.compact {
  margin-bottom: 16px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter {
  padding: 9px 14px;
  cursor: pointer;
}

.database-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.result-card:hover,
.result-card.selected {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand), white 10%);
  box-shadow: 0 12px 30px rgba(31, 138, 112, .12);
}

.thumb {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px solid color-mix(in srgb, var(--ink), transparent 75%);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.thumb img {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.result-card h3 {
  margin: 1px 0 6px;
  font-size: 17px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.meta span,
.detail-badge,
.version-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-2);
}

.result-card p,
.detail-card p,
.timeline p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.detail-card {
  position: sticky;
  top: 96px;
  min-height: 280px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.detail-card ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 22px;
}

.text-link {
  color: var(--brand);
  font-weight: 700;
}

.guide-list {
  display: grid;
  gap: 10px;
}

.guide-list a {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 4px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.guide-list span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent), transparent 52%);
  font-weight: 800;
}

.guide-list small {
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-grid button {
  min-height: 54px;
  border-radius: var(--radius);
  cursor: pointer;
}

.tool-output {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  line-height: 1.7;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.timeline article {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.timeline span {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--brand-2);
  font-weight: 800;
}

footer {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 13px;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink), transparent 90%);
}

@media (max-width: 1120px) {
  .workspace,
  .hero,
  .database-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .detail-card {
    position: static;
  }

  .sidebar {
    grid-template-columns: repeat(5, 128px);
    max-width: 100%;
    overflow-x: auto;
  }

  .server-card,
  .sidebar-note {
    display: none;
  }

  .hero-image,
  .hero-image img {
    min-height: 280px;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 220px;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .workspace {
    width: min(100% - 20px, 1440px);
    margin-top: 12px;
  }

  .sidebar {
    margin-inline: -2px;
  }

  .hero {
    padding: 22px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.22;
    word-break: break-all;
  }

  .search-shell div {
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }

  .search-shell button {
    min-height: 44px;
  }

  .stats,
  .result-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
    align-items: start;
  }

  .filters {
    justify-content: start;
  }
}
