@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --bg: #f5f1e9;
  --paper: #fffaf2;
  --text: #26211b;
  --muted: #7c7165;
  --line: #e2d7c8;
  --accent: #9a5032;
  --accent-soft: #f2dfcf;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 241, 233, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 20px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  padding: 38px 0 34px;
  border-bottom: 1px solid var(--line);
}

.game-image {
  position: relative;
  min-height: 230px;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}

.game-image img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  display: block;
  object-fit: contain;
  padding: 18px;
}

.game-image img[src$="game-icon.png"] {
  background: #eee2d4;
}

.game-image img:not([src]),
.game-image img[src=""] {
  display: none;
}

.game-image img + .image-placeholder {
  display: none;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.image-placeholder strong {
  color: var(--text);
  font-size: 22px;
}

.intro {
  max-width: 620px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
}

h1 {
  font-size: clamp(34px, 6vw, 54px);
}

.intro p:not(.kicker) {
  max-width: 540px;
  margin: 14px 0 24px;
  color: var(--muted);
}

.search-box {
  display: flex;
  max-width: 560px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
}

.search-box button,
.load-more,
.filter-chip {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fffaf2;
  padding: 0 22px;
  font-weight: 600;
}

.guide-section {
  padding: 34px 0 54px;
}

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

.section-title h2 {
  font-size: 28px;
}

#resultCount {
  color: var(--muted);
  font-size: 13px;
}

.filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 18px;
}

.filter-chip {
  flex: 0 0 auto;
  background: transparent;
  color: var(--accent);
  padding: 7px 14px;
}

.filter-chip.active,
.filter-chip:hover {
  background: var(--accent);
  color: #fffaf2;
}

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

.guide-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
}

.guide-item:hover {
  border-color: #c7a38a;
}

.guide-thumb {
  width: 96px;
  height: 72px;
  position: relative;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  overflow: hidden;
  font-size: 20px;
  font-weight: 700;
}

.guide-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  background: #fffaf2;
}

.guide-thumb img[src=""],
.guide-thumb img:not([src]) {
  display: none;
}

.guide-thumb img:not([src]) + span,
.guide-thumb img[src=""] + span {
  display: grid;
}

.guide-thumb span {
  position: relative;
  z-index: 1;
  display: none;
  padding: 4px;
  text-align: center;
}

.guide-info {
  min-width: 0;
}

.guide-tag {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.guide-info h3 {
  font-size: 18px;
}

.guide-excerpt {
  margin: 7px 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.guide-meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 46px 20px;
  border: 1px dashed var(--line);
  background: rgba(255, 250, 242, 0.5);
  text-align: center;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
}

.load-more {
  width: 100%;
  margin-top: 18px;
  padding: 11px 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 22px 0;
  font-size: 13px;
}

.article-reader {
  scroll-margin-top: 84px;
  padding: 34px 0 58px;
}

.article-reader[hidden] {
  display: none;
}

.back-link {
  margin-bottom: 14px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 8px 14px;
  font-weight: 600;
}

.reader-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.article-toc {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 16px;
}

.article-toc strong {
  margin-bottom: 4px;
  font-size: 16px;
}

.article-toc a {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.article-toc a:hover {
  color: var(--accent);
}

.article-body {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 34px;
}

.article-meta {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.article-body h2 {
  padding-right: 42px;
  font-size: 26px;
}

.article-lead {
  color: var(--muted);
}

.article-content {
  margin-top: 22px;
}

.content-block {
  scroll-margin-top: 86px;
  padding-top: 2px;
}

.article-content h4 {
  margin: 22px 0 6px;
  font-size: 17px;
}

.article-content p {
  margin: 0;
  color: #554a40;
}

.article-images {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.article-images figure {
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}

.article-images img {
  display: block;
  width: 100%;
  height: auto;
}

.article-images figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: #fffaf2;
  padding: 9px 16px;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .header-inner {
    height: 58px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 24px;
  }

  .game-image,
  .game-image img {
    min-height: 190px;
  }

  .search-box {
    display: grid;
    grid-template-columns: 1fr auto;
  }

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

  .guide-item {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 13px;
    padding: 14px;
  }

  .guide-thumb {
    width: 76px;
    height: 62px;
    font-size: 18px;
  }

  .guide-info h3 {
    font-size: 16px;
  }

  .guide-meta {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .article-body {
    padding: 28px 20px;
  }

  .article-reader {
    scroll-margin-top: 70px;
    padding-bottom: 42px;
  }

  .reader-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .article-toc {
    position: static;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
    scrollbar-width: none;
  }

  .article-toc::-webkit-scrollbar {
    display: none;
  }

  .article-toc strong {
    flex: 0 0 auto;
    margin: 0 4px 0 0;
  }

  .article-toc a {
    flex: 0 0 auto;
    max-width: 180px;
    border: 1px solid var(--line);
    padding: 6px 10px;
    background: #fffaf2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
