:root {
  --ink: #24303b;
  --muted: #68747e;
  --line: #d8d8ca;
  --paper: #fffef7;
  --cream: #f7f1dc;
  --yellow: #ffd966;
  --yellow-deep: #e9b93f;
  --green: #55a76a;
  --green-deep: #2f7654;
  --blue: #4c94b8;
  --coral: #ef7662;
  --shadow: 0 10px 30px rgba(48, 54, 44, 0.11);
  --sidebar: 236px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 16px 16px, rgba(79, 104, 79, 0.05) 1.5px, transparent 1.5px) 0 0 / 32px 32px,
    #f8f5e9;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

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

#app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  border-right: 1px solid #d2d1c1;
  background: rgba(255, 254, 247, 0.96);
  box-shadow: 8px 0 32px rgba(48, 54, 44, 0.05);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: block;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  filter: drop-shadow(0 3px 0 rgba(36, 48, 59, 0.16));
}

.brand-mark img {
  width: 100%;
  height: 100%;
}

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

.brand-copy strong {
  display: block;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 29px;
  line-height: 1;
}

.brand-copy small {
  display: block;
  margin-top: 6px;
  color: var(--green-deep);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 14px;
}

.side-nav p {
  margin: 22px 12px 8px;
  color: #8b918e;
  font-size: 11px;
  font-weight: 800;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  margin: 4px 0;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #4b5760;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.nav-item:hover {
  background: #f2f1e7;
}

.nav-item.active {
  border-color: #d6bd67;
  background: var(--yellow);
  color: #28313a;
  box-shadow: 0 3px 0 rgba(118, 89, 25, 0.15);
}

.nav-item b {
  display: grid;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  place-items: center;
  border-radius: 50%;
  background: #e5e5da;
  font-size: 11px;
}

.nav-item.active b {
  background: rgba(255, 255, 255, 0.72);
}

.source-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px;
  padding: 13px;
  border: 1px solid #d9d6c7;
  border-radius: 7px;
  background: #f7f4e8;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #49a962;
  box-shadow: 0 0 0 4px rgba(73, 169, 98, 0.16);
}

.source-mini strong,
.source-mini small {
  display: block;
}

.source-mini strong {
  font-size: 11px;
}

.source-mini small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.shell {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  height: 68px;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(200, 198, 184, 0.85);
  background: rgba(248, 245, 233, 0.9);
  backdrop-filter: blur(14px);
}

.global-search {
  display: flex;
  width: min(620px, 58vw);
  height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #d4d2c4;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.global-search:focus-within {
  border-color: #b99132;
  box-shadow: 0 0 0 3px rgba(255, 217, 102, 0.28);
}

.global-search svg {
  width: 18px;
  color: #7a837e;
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

kbd {
  padding: 2px 7px;
  border: 1px solid #d5d3c7;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #f5f4ee;
  color: #788079;
  font-size: 11px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.season-chip {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #d3c26e;
  border-radius: 999px;
  background: #fff7c7;
  color: #5a4a20;
  font-size: 12px;
}

.season-chip svg {
  width: 15px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #d3d1c5;
  border-radius: 7px;
  background: #fffef9;
}

.icon-button:hover {
  background: var(--yellow);
}

.icon-button svg {
  width: 18px;
}

.menu-button {
  display: none;
}

main {
  min-height: calc(100vh - 68px);
  padding: 28px clamp(18px, 4vw, 52px) 72px;
}

.loading-screen {
  display: grid;
  min-height: 62vh;
  place-content: center;
  text-align: center;
}

.loading-screen strong {
  margin-top: 16px;
}

.loading-screen small {
  margin-top: 7px;
  color: var(--muted);
}

.loading-emblem {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  margin: auto;
  place-items: center;
  animation: bob 1.2s ease-in-out infinite;
}

.loading-emblem img {
  width: 66px;
  height: 66px;
  filter: drop-shadow(0 4px 7px rgba(36, 48, 59, 0.14));
}

.loading-emblem span {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(76, 148, 184, 0.22);
  border-top-color: var(--blue);
  border-right-color: var(--yellow-deep);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 50% { transform: translateY(-7px); } }

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 900;
}

.view-head h1,
.section-head h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-weight: 900;
}

.view-head h1 {
  font-size: clamp(29px, 4vw, 42px);
}

.view-head > div > p:last-child {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.hero {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid rgba(36, 48, 59, 0.28);
  border-radius: 8px;
  background: #477c67;
  box-shadow: var(--shadow);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 44, 37, 0.9) 0%, rgba(18, 44, 37, 0.56) 45%, rgba(18, 44, 37, 0.08) 76%);
  content: "";
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 330px;
  max-width: 600px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
  color: white;
}

.hero-kicker {
  align-self: flex-start;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  background: rgba(24, 62, 51, 0.5);
  font-size: 11px;
  font-weight: 800;
}

.hero h1 {
  margin: 15px 0 8px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.05;
}

.hero p {
  max-width: 530px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid #bc8c20;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(48, 32, 0, 0.35);
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.text-button {
  min-height: 36px;
  padding: 0;
  color: var(--green-deep);
}

.primary-button svg,
.secondary-button svg,
.text-button svg {
  width: 17px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 18px 0 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 254, 247, 0.9);
}

.stat-item {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-right: 1px solid var(--line);
}

.stat-item:last-child {
  border-right: 0;
}

.stat-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e7f1df;
  color: var(--green-deep);
}

.stat-icon svg {
  width: 18px;
}

.stat-item b,
.stat-item small {
  display: block;
}

.stat-item b {
  font-size: 21px;
}

.stat-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 26px;
}

.section {
  margin-top: 34px;
}

.section:first-child {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.section-head h2 {
  font-size: 24px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.module-tile {
  min-height: 122px;
  padding: 18px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.module-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.module-tile .module-icon {
  display: grid;
  width: 35px;
  height: 35px;
  margin-bottom: 15px;
  place-items: center;
  border-radius: 50%;
  background: var(--tile-color, #e7f1df);
}

.module-icon svg {
  width: 17px;
}

.module-tile strong,
.module-tile small {
  display: block;
}

.module-tile strong {
  font-size: 13px;
}

.module-tile small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

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

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

.pokedex-grid .spirit-card {
  padding: 10px;
}

.spirit-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.spirit-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.spirit-card .favorite-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: #6f7977;
}

.spirit-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.favorite-button svg {
  width: 16px;
}

.favorite-button.saved {
  color: #c88b1b;
}

.favorite-button.saved svg {
  fill: currentColor;
}

.spirit-image {
  position: relative;
  display: grid;
  aspect-ratio: 1.18;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.8), rgba(235,241,217,0.8)),
    #edf3df;
}

.spirit-image::after {
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 72px;
  height: 72px;
  border: 14px solid rgba(72, 120, 89, 0.08);
  border-radius: 50%;
  content: "";
}

.spirit-image img {
  position: relative;
  z-index: 1;
  width: 92%;
  height: 92%;
  object-fit: contain;
  object-position: center bottom;
  transition: transform 180ms ease;
}

.spirit-card:hover .spirit-image img {
  transform: scale(1.08);
}

.spirit-id {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  color: #758078;
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.card-season {
  position: absolute;
  bottom: 7px;
  left: 7px;
  z-index: 2;
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #b68c22;
  border-radius: 999px;
  background: #fff0a9;
  color: #654d13;
  font-size: 9px;
  font-weight: 900;
}

.spirit-card h3 {
  overflow: hidden;
  margin: 11px 0 7px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spirit-meta {
  display: flex;
  align-items: center;
  gap: 5px;
}

.type-pill {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--type-color, #e8e5d5);
  color: #29333a;
  font-size: 9px;
  font-weight: 800;
}

.total {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.feed-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.feed-item {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid #e7e5d9;
}

.feed-item:last-child {
  border-bottom: 0;
}

.feed-item:hover {
  background: #f8f5e9;
}

.feed-item strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item small {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.source-panel {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef4e6;
}

.source-panel h3 {
  margin: 0 0 12px;
  font-size: 12px;
}

.source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 10px;
}

.source-row span:nth-child(2) {
  flex: 1;
}

.source-status {
  color: var(--green-deep);
  font-weight: 800;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(112px, 0.55fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.field {
  position: relative;
}

.field > svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  transform: translateY(-50%);
  color: #7b8581;
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  border: 1px solid #d6d4c7;
  border-radius: 5px;
  outline: 0;
  background: #fbfaf4;
  font-size: 12px;
}

.field input {
  padding: 0 12px 0 38px;
}

.field select {
  padding: 0 10px;
}

.field input:focus,
.field select:focus {
  border-color: #bc983b;
  box-shadow: 0 0 0 3px rgba(255, 217, 102, 0.25);
}

.result-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 24px;
}

.pagination button {
  min-width: 42px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 800;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.wiki-search-box {
  display: flex;
  gap: 9px;
  max-width: 720px;
}

.wiki-search-box .field {
  flex: 1;
}

.wiki-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 20px;
}

.egg-source-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid #aac4a9;
  border-radius: 7px;
  background: #eaf3e4;
}

.egg-source-bar > div,
.egg-source-bar a {
  display: flex;
  align-items: center;
}

.egg-source-bar > div {
  min-width: 0;
  gap: 10px;
}

.egg-source-bar > div > svg {
  flex: 0 0 auto;
  color: var(--green-deep);
}

.egg-source-bar span,
.egg-source-bar strong,
.egg-source-bar small {
  display: block;
}

.egg-source-bar span {
  min-width: 0;
}

.egg-source-bar strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.egg-source-bar small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.egg-source-bar a {
  flex: 0 0 auto;
  gap: 5px;
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 800;
}

.egg-finder {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.egg-search-form {
  display: flex;
  max-width: 760px;
  gap: 10px;
}

.egg-search-form .field {
  flex: 1;
}

.egg-pair-result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e0d4;
}

.egg-pair-empty {
  display: grid;
  min-height: 170px;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.egg-pair-empty svg {
  margin: 0 auto 10px;
}

.egg-pair-empty strong,
.egg-pair-empty span {
  display: block;
}

.egg-pair-empty strong {
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px;
}

.egg-pair-empty span {
  max-width: 520px;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.7;
}

.egg-selected {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: 18px;
  border: 1px solid #a9c6a8;
  border-radius: 7px;
  background: #edf5e7;
}

.egg-selected h3 {
  margin: 8px 0 4px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 27px;
}

.egg-selected p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.success-chip,
.warning-chip {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}

.success-chip {
  background: #cce8c8;
  color: #276844;
}

.warning-chip {
  background: #f4d6c9;
  color: #8b3d2e;
}

.egg-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.egg-group-list span {
  padding: 4px 8px;
  border: 1px solid #9fbba1;
  border-radius: 999px;
  background: white;
  color: var(--green-deep);
  font-size: 9px;
  font-weight: 800;
}

.egg-result-head {
  margin-top: 22px;
}

.result-count {
  padding: 5px 9px;
  border-radius: 999px;
  background: #efeee4;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.egg-group-select {
  width: min(230px, 42vw);
}

.egg-group-banner {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 18px 22px;
  border: 1px solid #a5c1a7;
  border-radius: 7px;
  background: #e8f2e3;
}

.egg-group-banner.unavailable {
  border-color: #d5b4a6;
  background: #f6e8e0;
}

.egg-group-banner span,
.egg-group-banner small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.egg-group-banner h3 {
  margin: 5px 0 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 27px;
}

.egg-group-banner > strong {
  font-size: 32px;
  text-align: right;
}

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

.egg-pet-card {
  display: grid;
  min-width: 0;
  min-height: 150px;
  grid-template-rows: minmax(0, 104px) auto;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.egg-pet-card:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.egg-pet-card:disabled {
  cursor: default;
}

.egg-pet-art {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  border-radius: 5px;
  background: #eef3e4;
}

.egg-pet-art img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.egg-pet-card strong,
.egg-pet-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.egg-pet-card strong {
  font-size: 11px;
}

.egg-pet-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.egg-pet-card.compact {
  min-height: 130px;
  grid-template-rows: minmax(0, 92px) auto;
}

.egg-more-note,
.guide-source-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 9px;
}

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

.egg-guide-card {
  position: relative;
  min-height: 190px;
  padding: 20px 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.guide-index {
  color: #b9b7a9;
  font-family: Consolas, monospace;
  font-size: 20px;
  font-weight: 900;
}

.egg-guide-card h3 {
  margin: 10px 0 12px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px;
}

.egg-guide-card ul {
  margin: 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.article-card {
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.article-card .article-icon {
  display: grid;
  width: 31px;
  height: 31px;
  margin-bottom: 13px;
  place-items: center;
  border-radius: 50%;
  background: #e4f0df;
  color: var(--green-deep);
}

.article-icon svg {
  width: 15px;
}

.article-card h3 {
  margin: 0;
  font-size: 14px;
}

.article-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card small {
  color: #858c88;
  font-size: 9px;
}

.tool-tabs {
  display: flex;
  width: fit-content;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #efeee4;
}

.tool-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.tool-tabs button.active {
  background: var(--paper);
  box-shadow: 0 2px 7px rgba(40, 50, 45, 0.09);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 20px;
}

.tool-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.tool-panel h2 {
  margin: 0 0 5px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
}

.tool-panel > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

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

.form-control label {
  display: block;
  margin-bottom: 6px;
  color: #5b666c;
  font-size: 10px;
  font-weight: 800;
}

.form-control input,
.form-control select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid #d5d3c5;
  border-radius: 5px;
  outline: 0;
  background: #fbfaf4;
}

.calculator-result {
  display: grid;
  min-height: 100%;
  align-content: center;
  padding: 26px;
  border: 1px solid #a9c7ae;
  border-radius: 7px;
  background: #e8f2e3;
  text-align: center;
}

.calculator-result small {
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 800;
}

.calculator-result strong {
  margin: 8px 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 46px;
}

.calculator-result p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.type-chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.type-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  font-size: 11px;
  font-weight: 800;
}

.type-button.active {
  border-color: #b79031;
  background: var(--yellow);
}

.map-shell {
  position: relative;
  min-height: 600px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255,255,255,0.15), rgba(255,255,255,0.15)),
    url("https://patchwiki.biligame.com/images/rocom/7/7f/1bcu36ca0025t2a6bvy0yqno6igzqwp.png") center / cover;
  box-shadow: var(--shadow);
}

.map-shell::after {
  position: absolute;
  inset: 0;
  background: rgba(238, 239, 208, 0.42);
  content: "";
}

.map-overlay {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 600px;
}

.map-panel {
  margin: 22px;
  padding: 19px;
  border: 1px solid rgba(47, 73, 58, 0.35);
  border-radius: 7px;
  background: rgba(255, 254, 247, 0.93);
  backdrop-filter: blur(8px);
}

.map-panel h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 25px;
}

.map-panel p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.map-links {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.map-links a {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid #dedccf;
  border-radius: 5px;
  background: white;
  font-size: 11px;
  font-weight: 700;
}

.map-links svg {
  width: 15px;
  color: var(--green-deep);
}

.empty-state,
.error-state {
  display: grid;
  min-height: 300px;
  place-content: center;
  padding: 30px;
  border: 1px dashed #c8c6b9;
  border-radius: 7px;
  background: rgba(255, 254, 247, 0.66);
  text-align: center;
}

.empty-state svg,
.error-state svg {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  color: #89918d;
}

.empty-state h2,
.error-state h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
}

.empty-state p,
.error-state p {
  max-width: 440px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  visibility: hidden;
  background: rgba(24, 34, 36, 0.38);
  opacity: 0;
  transition: 180ms ease;
}

.drawer-backdrop.open {
  visibility: visible;
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 80;
  width: min(640px, 100vw);
  overflow-y: auto;
  border-left: 1px solid #c9c8bb;
  background: #faf8ed;
  box-shadow: -18px 0 50px rgba(28, 39, 37, 0.18);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-close {
  position: sticky;
  top: 14px;
  z-index: 4;
  display: grid;
  width: 40px;
  height: 40px;
  margin: 14px 14px 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 254, 247, 0.92);
}

.drawer-close svg {
  width: 19px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 8px 28px 28px;
}

.detail-art {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #d3d6bd;
  border-radius: 7px;
  background: #eaf2de;
}

.detail-art img {
  width: 84%;
  height: 84%;
  object-fit: contain;
}

.detail-copy {
  align-self: center;
}

.detail-copy small {
  color: var(--green-deep);
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
}

.detail-copy h2 {
  margin: 5px 0 9px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 36px;
}

.detail-copy p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.detail-content {
  padding: 0 28px 36px;
}

.detail-block {
  margin-top: 24px;
}

.detail-block h3 {
  margin: 0 0 12px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px;
}

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

.stat-cell {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}

.stat-cell small,
.stat-cell b {
  display: block;
}

.stat-cell small {
  color: var(--muted);
  font-size: 9px;
}

.stat-cell b {
  margin-top: 4px;
  font-size: 17px;
}

.evolution-block h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.evolution-block h3 small {
  color: var(--muted);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 600;
}

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

.evolution-route {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.72fr) minmax(150px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(85, 167, 106, 0.06), transparent 42%, rgba(255, 217, 102, 0.1)),
    var(--paper);
}

.evolution-spirit-node {
  display: grid;
  min-width: 0;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

button.evolution-spirit-node {
  width: 100%;
  border: 1px solid #d7c56f;
  background: #fff9d9;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button.evolution-spirit-node:hover {
  border-color: var(--yellow-deep);
  box-shadow: 0 6px 16px rgba(72, 66, 38, 0.11);
  transform: translateY(-1px);
}

button.evolution-spirit-node:focus-visible {
  outline: 3px solid rgba(76, 148, 184, 0.28);
  outline-offset: 2px;
}

.evolution-node-art {
  display: grid;
  width: 72px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d9ddca;
  border-radius: 6px;
  background: #edf3e4;
  color: var(--muted);
}

.evolution-node-art img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.evolution-node-copy {
  min-width: 0;
}

.evolution-node-copy small,
.evolution-node-copy strong {
  display: block;
}

.evolution-node-copy small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.evolution-node-copy strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.evolution-method {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 8px;
  color: var(--green-deep);
  text-align: center;
}

.evolution-method span {
  grid-column: 1;
  color: var(--muted);
  font-size: 9px;
}

.evolution-method strong {
  grid-column: 1;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.evolution-method svg {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.evolution-final {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  border: 1px solid #b9d4bf;
  border-radius: 7px;
  background: #edf6e9;
  color: var(--green-deep);
}

.evolution-final.unknown {
  border-color: var(--line);
  background: var(--paper);
  color: var(--muted);
}

.evolution-final strong,
.evolution-final span {
  display: block;
}

.evolution-final strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.evolution-final span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.skill-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  font-size: 10px;
}

.skill-table th,
.skill-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e7e5da;
  text-align: left;
}

.skill-table th {
  background: #efeee4;
  color: #616a6c;
}

.skill-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.skill-name img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  visibility: hidden;
  max-width: min(380px, calc(100vw - 44px));
  padding: 12px 16px;
  border: 1px solid #35443e;
  border-radius: 6px;
  background: #273732;
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.bottom-nav {
  display: none;
}

@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

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

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

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

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

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

@media (max-width: 820px) {
  :root {
    --sidebar: 228px;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .shell {
    margin-left: 0;
  }

  .menu-button {
    display: grid;
  }

  .season-chip {
    display: none;
  }

  .global-search {
    width: auto;
    flex: 1;
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item:nth-child(2) {
    border-right: 0;
  }

  .stat-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .filter-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }

  .map-overlay {
    grid-template-columns: 1fr;
  }

  .map-panel {
    max-width: 390px;
  }
}

@media (max-width: 620px) {
  .topbar {
    height: 60px;
    padding: 0 12px;
  }

  main {
    padding: 18px 12px 86px;
  }

  .top-actions {
    gap: 6px;
  }

  .global-search kbd {
    display: none;
  }

  .hero,
  .hero-content {
    min-height: 390px;
  }

  .hero::after {
    background: linear-gradient(0deg, rgba(18, 44, 37, 0.93) 0%, rgba(18, 44, 37, 0.56) 64%, rgba(18, 44, 37, 0.12) 100%);
  }

  .hero-content {
    justify-content: flex-end;
    padding: 24px 20px 28px;
  }

  .hero h1 {
    font-size: 39px;
  }

  .stat-item {
    min-height: 70px;
    padding: 11px 12px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
  }

  .module-grid {
    gap: 8px;
  }

  .module-tile {
    min-height: 112px;
    padding: 14px 12px;
  }

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

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

  .spirit-card {
    padding: 9px;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
    padding: 9px;
  }

  .filter-bar .field:first-child {
    grid-column: 1 / -1;
  }

  .wiki-results {
    grid-template-columns: 1fr;
  }

  .egg-search-form {
    flex-direction: column;
  }

  .egg-source-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .egg-selected {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 13px;
    padding: 12px;
  }

  .egg-selected h3 {
    font-size: 22px;
  }

  .egg-pet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .egg-guide-grid {
    grid-template-columns: 1fr;
  }

  .egg-guide-card {
    min-height: 0;
  }

  .egg-group-select {
    width: 100%;
  }

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

  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .map-shell,
  .map-overlay {
    min-height: 680px;
  }

  .map-panel {
    margin: 12px;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    padding: 0 18px 22px;
  }

  .detail-art {
    max-width: 260px;
    margin: auto;
  }

  .detail-copy {
    text-align: center;
  }

  .detail-content {
    padding: 0 18px 80px;
  }

  .evolution-block h3 {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .evolution-route {
    grid-template-columns: 1fr;
  }

  .evolution-method {
    width: min(200px, 100%);
    margin: 0 auto;
    grid-template-columns: 1fr;
  }

  .evolution-method span,
  .evolution-method strong,
  .evolution-method svg {
    grid-column: 1;
  }

  .evolution-method svg {
    grid-row: auto;
    margin: 2px auto 0;
    transform: rotate(90deg);
  }

  .skill-table th:nth-child(4),
  .skill-table td:nth-child(4),
  .skill-table th:nth-child(5),
  .skill-table td:nth-child(5) {
    display: none;
  }

  .bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid #d0cfc2;
    background: rgba(255, 254, 247, 0.96);
    backdrop-filter: blur(14px);
  }

  .bottom-nav button {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    background: transparent;
    color: #67716e;
    font-size: 9px;
    font-weight: 800;
  }

  .bottom-nav button.active {
    color: #806314;
    background: #fff4bf;
  }

  .bottom-nav svg {
    width: 19px;
    height: 19px;
  }

  .toast {
    right: 12px;
    bottom: 72px;
  }
}
