:root {
  --ink: #1d1c1c;
  --paper: #fff48d;
  --coral: #ff8a7a;
  --peach: #ffc4a8;
  --cream: #fff4b0;
  --mint: #7ef0d4;
  --sky: #7ec8ff;
  --violet: #b794ff;
  --white: #ffffff;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --radius: 1.25rem;
  --radius-pill: 999px;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-en: "Syne", sans-serif;

  --cat-zhayan: var(--violet);
  --cat-xiaocheng: var(--sky);
  --cat-haowu: var(--mint);
  --cat-shiqu: var(--coral);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--coral) 0%, var(--peach) 35%, var(--cream) 70%, var(--paper) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.65;
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: min(960px, calc(100% - 2.5rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* ── Header ── */

.site-header {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
}

.site-header a {
  font-weight: 600;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.site-header a:hover {
  opacity: 1;
}

.header-divider {
  width: 1px;
  height: 1rem;
  background: var(--ink);
  opacity: 0.25;
}

.header-brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.header-game {
  margin-left: 0.15rem;
  padding: 0.3rem 0.75rem;
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.header-game:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--ink);
}

/* ── Hero ── */

.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero-inner {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero-portrait {
  position: relative;
  width: min(11rem, 42vw);
  margin-inline: auto;
}

.portrait-stamp {
  position: absolute;
  top: -0.5rem;
  right: -1.25rem;
  z-index: 3;
  padding: 0.35rem 0.65rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  font-size: 0.65rem;
  font-weight: 700;
  transform: rotate(12deg);
  white-space: nowrap;
}

.portrait-back {
  position: absolute;
  inset: 0.4rem;
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 50%;
  transform: rotate(-8deg);
  box-shadow: var(--shadow);
}

.portrait-frame {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--cream);
  transform: rotate(3deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-portrait:hover .portrait-frame {
  transform: rotate(0deg) translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.portrait-frame img,
.portrait-frame .portrait-disc {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.hero-title-en {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-en);
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.45;
}

.hero-slogan {
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: rgba(42, 40, 38, 0.75);
  letter-spacing: 0.12em;
}

.hero-intro {
  margin: 1.25rem auto 0;
  max-width: 28rem;
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(42, 40, 38, 0.82);
}

/* floating doodles */
.doodle {
  position: absolute;
  pointer-events: none;
  opacity: 0.55;
}

.doodle--leaf {
  top: 5rem;
  left: clamp(0.5rem, 6vw, 4rem);
  width: 3rem;
  transform: rotate(-25deg);
}

.doodle--star {
  top: 8rem;
  right: clamp(0.5rem, 6vw, 4rem);
  width: 2.5rem;
  transform: rotate(15deg);
}

.doodle--wave {
  bottom: 2rem;
  left: clamp(1rem, 10vw, 6rem);
  width: 4rem;
  opacity: 0.35;
}

/* ── About strip ── */

.about-strip {
  margin: 2rem 0 3rem;
  padding: 1.5rem 1.75rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

.about-strip::before {
  content: "关于";
  position: absolute;
  top: -0.7rem;
  left: 1.25rem;
  padding: 0.15rem 0.6rem;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.about-strip p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.85;
  color: rgba(42, 40, 38, 0.88);
}

/* ── Game banner ── */

.game-banners {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.games-section-header {
  margin: 3.5rem 0 1.75rem;
  text-align: center;
}

.games-section-title {
  display: inline-block;
  margin: 0;
  padding: 0.55rem 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
}

.game-banner {
  margin: 0;
}

.game-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 1.5rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-banner-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.game-banner-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.55;
}

.game-banner-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.game-banner-desc {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(42, 40, 38, 0.72);
}

.game-banner-cta {
  display: inline-block;
  margin-top: 0.85rem;
  padding: 0.45rem 0.9rem;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
}

.game-banner-thumb {
  flex-shrink: 0;
  height: 9.5rem;
  width: auto;
  max-width: 5.75rem;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  transform: rotate(-4deg);
}

.game-banner-card:hover .game-banner-thumb {
  transform: rotate(-2deg) scale(1.02);
}

/* ── Categories ── */

.categories {
  margin-bottom: 2.5rem;
}

.categories-label {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  text-align: center;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.cat-tab {
  padding: 0.55rem 1rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
}

.cat-tab:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.cat-tab.active {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.cat-tab[data-cat="all"].active { background: var(--cream); }
.cat-tab[data-cat="zhayan"].active { background: var(--cat-zhayan); }
.cat-tab[data-cat="xiaocheng"].active { background: var(--cat-xiaocheng); }
.cat-tab[data-cat="haowu"].active { background: var(--cat-haowu); }
.cat-tab[data-cat="shiqu"].active { background: var(--cat-shiqu); }

.cat-tab-label--short {
  display: none;
}

.cat-desc {
  margin: 1.25rem auto 0;
  max-width: 32rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(42, 40, 38, 0.65);
  min-height: 1.4em;
  transition: opacity 0.25s;
}

/* ── Posts list ── */

.posts-section {
  padding-bottom: 5rem;
}

.posts-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem;
  margin-bottom: 3rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-align: left;
}

.post-card:last-child {
  margin-bottom: 0;
}

.post-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.post-card--zhayan { border-left: 4px solid var(--cat-zhayan); }
.post-card--xiaocheng { border-left: 4px solid var(--cat-xiaocheng); }
.post-card--haowu { border-left: 4px solid var(--cat-haowu); }
.post-card--shiqu { border-left: 4px solid var(--cat-shiqu); }

.post-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.post-cat {
  padding: 0.2rem 0.55rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.post-cat--zhayan { background: var(--cat-zhayan); }
.post-cat--xiaocheng { background: var(--cat-xiaocheng); }
.post-cat--haowu { background: var(--cat-haowu); }
.post-cat--shiqu { background: var(--cat-shiqu); }

.post-date {
  font-size: 0.72rem;
  opacity: 0.5;
}

.post-excerpt {
  margin: 0.65rem 0 0;
  font-size: 0.92rem;
  line-height: 1.8;
  color: rgba(42, 40, 38, 0.72);
  flex: 1;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.post-read {
  display: inline-block;
  margin-top: 1.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.post-card:hover .post-read {
  opacity: 1;
}

.post-tag {
  font-size: 0.68rem;
  opacity: 0.55;
}

.post-tag::before {
  content: "#";
}

.post-draft {
  margin-top: 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.45;
  font-style: italic;
}

.posts-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--font-display);
  opacity: 0.5;
}

.posts-more {
  margin-top: 2rem;
  text-align: center;
}

.posts-more-btn {
  padding: 0.65rem 1.5rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.posts-more-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* ── Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(42, 40, 38, 0.35);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-wrap {
  position: relative;
  width: min(960px, calc(100% - 2.5rem));
  margin-inline: auto;
  flex-shrink: 0;
  transform: translateX(-1.5rem);
}

.modal {
  width: 100%;
  max-height: min(80vh, 600px);
  overflow-y: auto;
  padding: 2rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--ink);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close-anchor {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 0;
  margin: 0;
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  pointer-events: auto;
}

.modal-intro {
  padding-right: 2.75rem;
  margin-bottom: 1.25rem;
}

.modal-cat {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.6rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.modal-date {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  opacity: 0.5;
}

.modal-body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(42, 40, 38, 0.88);
}

.modal-body p {
  margin: 0 0 1rem;
}

.modal-body .post-figure {
  margin: 0 0 1.25rem;
}

.modal-body .post-figure img {
  display: block;
  width: min(350px, 100%);
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(42, 40, 38, 0.08);
  box-sizing: border-box;
}

.modal-body .post-figure img.img-orient-landscape {
  width: min(600px, 100%);
}

.modal-body .post-figure img.img-orient-portrait {
  width: min(350px, 100%);
}

.modal-body .post-video {
  margin: 0 0 1.25rem;
  max-width: min(600px, 100%);
}

.modal-body .post-video-inner {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(42, 40, 38, 0.08);
  background: #1a1a1a;
}

.modal-body .post-video-inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-body .post-video figcaption {
  margin-top: 6px;
  font-size: 0.78rem;
}

.modal-body .post-video figcaption a {
  color: rgba(42, 40, 38, 0.55);
  text-decoration: none;
}

.modal-body .post-video figcaption a:hover {
  text-decoration: underline;
}

.post-video--wx {
  margin: 0 0 1.25rem;
  max-width: min(600px, 100%);
}

.post-video-wx {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(42, 40, 38, 0.12);
  background: linear-gradient(145deg, #2a2826 0%, #1a1918 100%);
}

.post-video-wx-cover {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: rgba(0, 0, 0, 0.25);
}

.post-video-wx-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.post-video-wx-meta {
  padding: 0.85rem 1rem 1rem;
  color: rgba(255, 255, 255, 0.92);
}

.post-video-wx-meta strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

.post-video-wx-meta span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.75;
}

.post-video-wx-tip {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: rgba(42, 40, 38, 0.55);
  line-height: 1.45;
}

.modal-note {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  background: rgba(42, 40, 38, 0.04);
  border: 1.5px dashed rgba(42, 40, 38, 0.25);
  border-radius: 0.75rem;
  font-size: 0.82rem;
  opacity: 0.7;
}

/* ── Footer ── */

.site-footer {
  padding: 2rem 0 3rem;
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.55;
}

.site-footer p {
  margin: 0;
}

/* ── Reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */

@media (min-width: 640px) {
  .hero-inner {
    grid-template-columns: auto 1fr;
    text-align: left;
    gap: 2.5rem;
    align-items: center;
  }

  .hero-portrait {
    margin-inline: 0;
  }

  .hero-text {
    padding-right: 1rem;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 3rem 0 1.25rem;
  }

  .about-strip {
    margin: 1rem 0 2rem;
    padding: 1.25rem 1.25rem;
  }

  .game-banner-thumb {
    height: 7.5rem;
    max-width: 4.5rem;
  }

  .doodle {
    display: none;
  }

  .category-tabs {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.35rem;
  }

  .cat-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.48rem 0.3rem;
    font-size: 0.74rem;
    text-align: center;
  }

  .cat-tab-label--full {
    display: none;
  }

  .cat-tab-label--short {
    display: inline;
  }

  .post-read {
    opacity: 0.72;
  }

  .modal-overlay {
    padding: 0;
    align-items: stretch;
    background: var(--white);
    backdrop-filter: none;
  }

  .modal-wrap {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    margin: 0;
    transform: none;
  }

  .modal {
    max-height: none;
    height: 100%;
    min-height: 100dvh;
    padding:
      max(1.75rem, calc(env(safe-area-inset-top, 0px) + 0.65rem))
      max(1.5rem, env(safe-area-inset-right, 0px))
      max(2rem, env(safe-area-inset-bottom, 0px))
      max(1.5rem, env(safe-area-inset-left, 0px));
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .modal-intro {
    padding-top: 0.65rem;
    padding-right: 3.25rem;
    margin-bottom: 1.5rem;
  }

  .modal-title {
    font-size: 1.25rem;
    line-height: 1.45;
  }

  .modal-date {
    margin-top: 0.65rem;
  }
}
