:root {
  color-scheme: light;
  --canvas: #faf2f2;
  --panel: #fff9f7;
  --line: #ead5da;
  --ink: #3e2b33;
  --muted: #715963;
  --accent: #944259;
  --accent-strong: #793047;
  --font: Geist, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font: 16px/1.6 var(--font);
  background: var(--canvas);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 5px; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }

.shell { width: min(1240px, calc(100% - 104px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: var(--panel); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; }
.header-inner { min-height: 69px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { width: 30px; height: 30px; flex: none; background: url("/favicon.svg") center / contain no-repeat; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a, .footer-inner a { font-size: 14px; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"], .footer-inner a:hover { color: var(--accent-strong); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { min-height: 62px; }

.gallery { padding-block: 41px 63px; scroll-margin-top: 14px; }
.gallery-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.gallery-heading h1 { font-size: clamp(25px, 2.55vw, 36px); letter-spacing: -0.03em; line-height: 1.3; }
.project-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.gallery-empty, .project-card { position: relative; overflow: hidden; border: 1px solid #e0bdc8; border-radius: 13px; background: #efc9d4; }
.gallery-empty { height: clamp(310px, 41vw, 516px); box-shadow: 0 9px 26px #62314b13; }
.gallery-empty::after { content: ""; position: absolute; inset: 0; background: linear-gradient(20deg, #29101ff0 1%, #3c142969 26%, transparent 57%); pointer-events: none; }
.gallery-landscape { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }
.empty-state { position: absolute; z-index: 1; left: clamp(19px, 4.6vw, 53px); bottom: clamp(22px, 4.2vw, 49px); color: #fff9fa; }
.empty-state h2 { font-size: clamp(19px, 2.25vw, 28px); font-weight: 730; }
.empty-state p { margin-top: 4px; font-size: clamp(12px, 1.2vw, 15px); color: #ffeff2; }
.is-hidden { display: none; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.project-grid:empty { display: none; }
.project-card { min-width: 0; aspect-ratio: 16 / 10; }
.project-card:hover, .project-card:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-strong); outline-offset: 3px; }
.project-card:hover:not(:focus-within) { outline: none; }
.project-card__link { display: block; width: 100%; height: 100%; }
.project-card__link:focus-visible { outline: 0; }
.project-card__media { position: absolute; inset: 0; overflow: hidden; }
.project-card__media img, .project-card__placeholder { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 220ms ease; }
.project-card__placeholder { background: url("/game-landscape.webp") center / cover no-repeat; }
.project-card__link:hover .project-card__media img { transform: scale(1.04); }
.project-card__body { position: absolute; inset: auto 0 0; display: flex; align-items: end; justify-content: space-between; gap: 15px; padding: 41px 17px 15px; background: linear-gradient(transparent, #261520eb); color: #fffbfc; }
.project-card__title { font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.project-card__arrow { flex: none; color: #ffe5ed; line-height: 1.45; }

.button { min-height: 43px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 17px; font-size: 14px; font-weight: 700; border: 1px solid transparent; border-radius: 7px; transition: background 160ms ease; }
.button--primary { background: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-strong); }
.detail-page { padding-block: 36px 61px; }
.detail-back { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; color: var(--accent-strong); }
.detail-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.detail-heading { margin-block: 24px 19px; }
.detail-heading h1 { font-size: clamp(27px, 3.1vw, 40px); letter-spacing: -0.035em; line-height: 1.26; overflow-wrap: anywhere; }
.detail-summary { color: var(--muted); overflow-wrap: anywhere; margin-top: 11px; font-size: 16px; max-width: 48em; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 13px 0 0; list-style: none; }
.detail-tags li { color: var(--accent-strong); background: #f7e6ec; border: 1px solid var(--line); padding: 1px 8px; font-size: 12px; border-radius: 4px; overflow-wrap: anywhere; }
.detail-cover { max-height: 435px; width: 100%; object-fit: cover; border-radius: 9px; margin-block: 20px; }
.detail-actions { margin-block: 20px 27px; }
.detail-preview h2 { font-size: 22px; margin-bottom: 10px; }
.detail-frame { display: block; width: 100%; height: min(72vh, 820px); min-height: 340px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.guide-steps { display: grid; gap: 1px; padding: 1px; background: var(--line); border-radius: 9px; overflow: hidden; margin-block: 24px; }
.guide-steps div { background: var(--panel); padding: 16px 20px; }
.guide-steps dt { font-weight: 700; display: flex; align-items: center; gap: 11px; }
.guide-step-mark { width: 7px; height: 7px; rotate: 45deg; background: var(--accent); flex: none; margin-inline: 2px; }
.guide-steps dd { color: var(--muted); margin: 4px 0 0 22px; font-size: 15px; }

@media (max-width: 1000px) {
  .shell { width: calc(100% - 62px); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 610px) {
  .shell { width: calc(100% - 34px); }
  .header-inner { min-height: 58px; }
  .brand { gap: 7px; font-size: 14px; }
  .brand-mark { width: 25px; height: 25px; }
  .site-nav { gap: 14px; }
  .site-nav a, .footer-inner a { font-size: 12px; }
  .gallery { padding-block: 26px 40px; }
  .gallery-heading { margin-bottom: 14px; }
  .gallery-empty { height: clamp(285px, 79vw, 385px); }
  .gallery-landscape { object-position: 58% center; }
  .gallery-empty::after { background: linear-gradient(0deg, #29101fe8, #3c142963 25%, transparent 56%); }
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .detail-page { padding-block: 24px 43px; }
  .detail-heading { margin-block: 17px; }
  .detail-summary { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
