:root {
  --bg: #f8f8f7;
  --surface: #ffffff;
  --surface-strong: #f0f0ee;
  --ink: #1c1c1a;
  --muted: #73736f;
  --line: #e7e6e2;
  --accent: #e60023;
  --accent-soft: #ffe8ec;
  --shadow: 0 14px 34px rgba(20, 20, 20, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1500px;
  height: 72px;
  margin: 0 auto;
  padding: 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--accent);
  border-radius: 9px;
  box-shadow: 0 5px 14px rgba(230, 0, 35, 0.28);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand-name {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 760;
  letter-spacing: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 600px;
  height: 44px;
  margin-left: auto;
  padding: 0 8px 0 14px;
  color: var(--muted);
  background: var(--surface-strong);
  border: 1px solid transparent;
  border-radius: 999px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.search-box:focus-within {
  color: var(--ink);
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.08);
}

.search-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

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

.search-box input::placeholder {
  color: #9b9b96;
}

.clear-search,
.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.clear-search {
  width: 28px;
  height: 28px;
}

.clear-search:hover,
.icon-button:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.06);
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.clear-search svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button:focus-visible,
.clear-search:focus-visible,
.tag-chip:focus-visible,
.pin-media:focus-visible,
.primary-button:focus-visible {
  outline: 3px solid rgba(230, 0, 35, 0.35);
  outline-offset: 2px;
}

.tag-bar {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tag-bar::-webkit-scrollbar {
  display: none;
}

.tag-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.tag-chip:hover {
  color: var(--ink);
  border-color: #c9c8c3;
}

.tag-chip.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.page-main {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px 32px;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding-top: 12px;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.pin-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  break-inside: avoid;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.pin-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.pin-media {
  position: relative;
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 0;
  overflow: hidden;
  background: #ececea;
  border: 0;
  cursor: zoom-in;
}

.pin-media img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 120px;
  background: #ececea;
  transition: filter 0.18s ease;
}

.pin-card:hover .pin-media img {
  filter: brightness(0.96);
}

.pin-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #111;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.pin-zoom svg {
  width: 18px;
  height: 18px;
}

.pin-card:hover .pin-zoom,
.pin-media:focus-visible .pin-zoom {
  opacity: 1;
  transform: translateY(0);
}

.pin-body {
  padding: 10px 12px 12px;
}

.pin-title {
  margin: 0 0 7px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-tag {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 8px;
  overflow: hidden;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-media.media-fallback {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  background: var(--surface-strong);
  cursor: default;
}

.pin-media.media-fallback::before {
  content: "图片加载失败";
  font-size: 0.82rem;
}

.skeleton-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  break-inside: avoid;
}

.skeleton-media {
  width: 100%;
  background:
    linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.55) 50%, transparent 75%),
    var(--surface-strong);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-body {
  padding: 10px 12px 13px;
}

.skeleton-line {
  height: 11px;
  margin-bottom: 8px;
  background: var(--surface-strong);
  border-radius: 999px;
}

.skeleton-line.short {
  width: 46%;
  margin-bottom: 0;
}

@keyframes shimmer {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -40% 0;
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  color: #a3a29e;
}

.empty-state h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.empty-state p {
  margin: 0;
  font-size: 0.88rem;
}

.sentinel {
  height: 1px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px 20px 34px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: 1fr;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: rgba(15, 15, 15, 0.97);
  border: 0;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 42px 84px;
}

.lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.lightbox-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 52px 28px 32px;
  overflow-y: auto;
  background: #161616;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-kicker {
  margin: 0;
  color: #9a9a96;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
}

.lightbox-panel h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 720;
  line-height: 1.25;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-list span {
  padding: 5px 9px;
  color: #d6d6d2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 0.76rem;
}

.lightbox-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.lightbox-meta div {
  display: grid;
  gap: 3px;
}

.lightbox-meta dt {
  color: #8f8f8a;
  font-size: 0.72rem;
}

.lightbox-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #f1f1ee;
  font-size: 0.86rem;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  min-height: 42px;
  padding: 10px 17px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.primary-button:hover {
  background: #c8001e;
  transform: translateY(-1px);
}

.primary-button svg {
  width: 18px;
  height: 18px;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 40px;
  height: 40px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-50%);
}

.lightbox-nav:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav svg {
  width: 20px;
  height: 20px;
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 10px 15px;
  color: #fff;
  background: rgba(20, 20, 20, 0.9);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

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

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

@media (min-width: 900px) {
  .masonry {
    column-count: 4;
  }
}

@media (min-width: 1200px) {
  .masonry {
    column-count: 5;
  }
}

@media (min-width: 1500px) {
  .masonry {
    column-count: 6;
  }
}

@media (hover: none) {
  .pin-zoom {
    opacity: 0.8;
    transform: translateY(0);
  }
}

@media (max-width: 800px) {
  .brand-name {
    display: none;
  }

  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .lightbox-stage {
    padding: 70px 18px 14px;
  }

  .lightbox-panel {
    gap: 12px;
    max-height: 46dvh;
    padding: 18px 20px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 0;
  }

  .lightbox-panel h2 {
    font-size: 1.15rem;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }

  .lightbox-nav {
    top: auto;
    bottom: calc(46dvh - 22px);
    transform: none;
  }

  .lightbox-prev {
    left: 12px;
  }

  .lightbox-next {
    right: 12px;
  }
}

@media (max-width: 430px) {
  .header-inner {
    gap: 10px;
    height: 64px;
    padding: 0 14px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .search-box {
    height: 42px;
  }

  .tag-bar {
    padding: 0 14px 10px;
  }

  .page-main {
    padding: 0 14px 28px;
  }

  .site-footer {
    flex-direction: column;
    padding: 22px 14px 28px;
  }
}
