:root {
  --cream: #fbf4ea;
  --peach: #f3d5b5;
  --gold: #e8c49a;
  --warm: #c9895b;
  --ink: #5a4638;
  --muted: #8a7260;
  --card: rgba(255, 250, 243, 0.88);
  --shadow: 0 12px 36px rgba(140, 90, 50, 0.12);
  --radius: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 10% -10%, #ffe7c8 0%, transparent 60%),
    radial-gradient(700px 420px at 100% 0%, #ffd9c2 0%, transparent 55%),
    linear-gradient(180deg, #fff8ef 0%, #f6e8d6 48%, #f3dcc4 100%);
}

.top {
  text-align: center;
  padding: 28px 20px 8px;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warm);
  opacity: 0.85;
}
.top h1 {
  margin: 0;
  font-size: clamp(1.55rem, 5.2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 16px 16px 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(251,244,234,0.92), rgba(251,244,234,0.72));
}
.chip {
  border: 1px solid rgba(201, 137, 91, 0.28);
  background: rgba(255, 252, 247, 0.8);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: 0.18s ease;
}
.chip.active {
  background: linear-gradient(135deg, #f0c49a, #e8a978);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(201, 137, 91, 0.28);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 12px 16px 28px;
  max-width: 920px;
  margin: 0 auto;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

.card {
  appearance: none;
  border: 0;
  padding: 0;
  text-align: left;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.card:active { transform: scale(0.985); }
.card:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 3px;
}
.thumb {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: cover;
  display: block;
  background:
    linear-gradient(145deg, #ffe8cf, #f5c9a8 45%, #efb48f);
}
.card-body {
  padding: 12px 12px 14px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  color: var(--warm);
  background: rgba(232, 196, 154, 0.28);
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 6px;
}
.card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}
.card p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card[hidden] { display: none !important; }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 8px 16px calc(28px + var(--safe-b));
  opacity: 0.9;
}

.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(58, 40, 28, 0.48);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 18px;
}
.lb-panel {
  width: min(520px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #fffaf3;
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(60, 35, 20, 0.28);
  animation: pop 0.22s ease;
}
@keyframes pop {
  from { transform: translateY(10px) scale(0.98); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.lb-media {
  background: linear-gradient(160deg, #ffe9d2, #f3c7a4);
  aspect-ratio: 3 / 4;
  max-height: 62vh;
}
.lb-media img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.lb-meta { padding: 16px 18px 22px; }
.lb-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--warm);
  background: rgba(232, 196, 154, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
}
.lb-meta h2 {
  margin: 10px 0 6px;
  font-size: 1.2rem;
}
.lb-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.lb-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  z-index: 50;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgba(255,250,243,0.92);
  color: var(--ink);
  font-size: 26px; line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
