:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --ink: #20201d;
  --muted: #706b63;
  --line: #e7ded1;
  --tomato: #d63f2f;
  --leaf: #2f7d57;
  --soy: #1e1b18;
  --gold: #c8862f;
  --shadow: 0 14px 36px rgba(37, 29, 22, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.86), rgba(247, 244, 238, 0.96)),
    var(--bg);
  color: var(--ink);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
}

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

img {
  display: block;
  width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px max(24px, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid rgba(231, 222, 209, 0.8);
  background: rgba(255, 253, 248, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.65rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.brand-mark img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 7px 16px rgba(90, 45, 31, 0.14);
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  min-width: 56px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.top-nav a:hover {
  background: #f0e7dc;
  color: var(--ink);
}

.header-search {
  display: none;
}

main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 54px 0 26px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--tomato);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 760px;
  margin: 0;
  font-size: 3rem;
  line-height: 1.08;
}

.intro-copy > p:last-child {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.intro-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  min-width: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.intro-panel span {
  display: grid;
  min-height: 82px;
  place-items: center;
  background: var(--surface);
  font-weight: 800;
}

.toolbar {
  position: sticky;
  top: 75px;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 20px;
  background: linear-gradient(180deg, rgba(247, 244, 238, 0.98), rgba(247, 244, 238, 0.9));
}

.filter-group {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-group::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
}

.chip:hover,
.chip.active {
  border-color: var(--tomato);
  background: var(--tomato);
  color: white;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 270px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.search-box span {
  color: var(--leaf);
  font-size: 0.88rem;
  font-weight: 800;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.masonry {
  column-count: 4;
  column-gap: 18px;
  padding: 8px 0 44px;
}

.note-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  break-inside: avoid;
  overflow: hidden;
  border: 1px solid rgba(231, 222, 209, 0.9);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(37, 29, 22, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.note-card:hover {
  transform: translateY(-3px);
  border-color: rgba(214, 63, 47, 0.38);
  box-shadow: var(--shadow);
}

.note-card a:focus-visible,
.related-card:focus-visible,
.back-link:focus-visible {
  outline: 3px solid rgba(214, 63, 47, 0.45);
  outline-offset: 4px;
}

.note-card.hidden {
  display: none;
}

.note-card img {
  min-height: 190px;
  object-fit: cover;
}

.note-card.tall img {
  aspect-ratio: 3 / 4;
}

.note-card.wide img {
  aspect-ratio: 4 / 3;
}

.note-body {
  padding: 13px 14px 15px;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.note-card h2 {
  margin: 9px 0 8px;
  font-size: 1.02rem;
  line-height: 1.45;
}

.note-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.68;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1eadf;
  color: var(--soy);
  font-size: 0.76rem;
  font-weight: 700;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--tomato);
  font-weight: 800;
}

.post-shell {
  width: min(1040px, calc(100% - 32px));
  padding-top: 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 20px;
  color: var(--tomato);
  font-size: 0.92rem;
  font-weight: 800;
}

.post-detail {
  padding-bottom: 38px;
}

.post-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 32px;
  align-items: end;
}

.post-copy h1 {
  margin: 0;
  font-size: 2.8rem;
  line-height: 1.12;
}

.post-copy > p:last-child {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-hero img {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.score-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 30px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.score-board div {
  min-width: 0;
  padding: 17px;
  background: var(--surface);
}

.score-board dt {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.score-board dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 850;
}

.post-section {
  width: min(720px, 100%);
}

.post-section h2,
.post-facts h2,
.section-heading h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.3;
}

.post-section p,
.post-facts p {
  margin: 0 0 16px;
  color: #403b35;
  font-size: 1rem;
  line-height: 1.9;
}

.post-content {
  color: #403b35;
  font-size: 1rem;
  line-height: 1.9;
}

.post-content p,
.post-content blockquote,
.post-content figure,
.post-content .wp-block-gallery {
  margin: 0 0 18px;
}

.post-content a {
  color: var(--tomato);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-content blockquote {
  padding: 15px 17px;
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 253, 248, 0.78);
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content figure img,
.post-content > img {
  width: 100%;
  max-height: 780px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(37, 29, 22, 0.08);
}

.post-content .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.post-content .wp-block-gallery figure {
  margin: 0;
}

.post-content .wp-block-gallery img {
  height: 100%;
  min-height: 220px;
}

.post-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 30px;
}

.post-facts > div {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.related-section {
  padding: 18px 0 42px;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 18px;
}

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

.related-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(37, 29, 22, 0.08);
}

.related-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.related-card span {
  display: block;
  padding: 12px 13px 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.related-card h3 {
  margin: 8px 13px 14px;
  font-size: 1rem;
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .masonry {
    column-count: 3;
  }

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

  .intro-panel {
    width: min(100%, 440px);
  }

  .post-hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px 12px;
  }

  .brand {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .brand-mark {
    gap: 8px;
    font-size: 1.32rem;
  }

  .brand-mark img {
    width: 30px;
    height: 30px;
  }

  .brand p,
  .top-nav {
    display: none;
  }

  .header-search {
    display: flex;
    flex: none;
    width: 100%;
    min-height: 40px;
    border-color: rgba(231, 222, 209, 0.88);
    box-shadow: 0 8px 18px rgba(37, 29, 22, 0.06);
  }

  .toolbar .search-box {
    display: none;
  }

  main,
  .site-footer {
    width: min(100% - 24px, 1280px);
  }

  .intro {
    padding-top: 34px;
  }

  .intro h1 {
    font-size: 2.1rem;
  }

  .intro-panel {
    min-width: 0;
  }

  .intro-panel span {
    min-height: 68px;
    font-size: 0.88rem;
  }

  .toolbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 10px 0 12px;
    background: transparent;
  }

  .filter-group {
    margin-right: -12px;
    padding-bottom: 0;
  }

  .masonry {
    column-count: 2;
    column-gap: 12px;
  }

  .note-card {
    margin-bottom: 12px;
  }

  .note-body {
    padding: 11px;
  }

  .note-card h2 {
    font-size: 0.95rem;
  }

  .note-card p {
    display: none;
  }

  .site-footer {
    flex-direction: column;
  }

  .post-shell {
    width: min(100% - 24px, 1040px);
    padding-top: 20px;
  }

  .post-copy h1 {
    font-size: 2rem;
  }

  .post-hero {
    gap: 20px;
  }

  .post-facts,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .score-board div {
    padding: 14px;
  }

  .score-board dd {
    font-size: 1rem;
  }
}

@media (max-width: 340px) {
  .masonry {
    column-count: 1;
  }
}
