:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --text: #1c1c1a;
  --muted: #6f6f6a;
  --muted-2: #8f8f89;
  --border: #e7e7e2;
  --border-strong: #cfcfc8;
  --card-radius: 14px;
  --button-radius: 10px;
  --button-bg: #1c1c1a;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
}

button {
  font: inherit;
  color: inherit;
}

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 28px;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 64px 0 36px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}

.site-header h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.intro {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.header-stats {
  display: flex;
  gap: 40px;
  margin: 0;
  flex-shrink: 0;
}

.stat dt {
  margin: 0;
  font-size: 12px;
  color: var(--muted-2);
}

.stat dd {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.main {
  padding-top: 32px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--button-radius);
  background: var(--bg);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(28, 28, 26, 0.05);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
  flex-shrink: 0;
}

.search input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  appearance: none;
}

.search input::placeholder {
  color: var(--muted-2);
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
}

.filter-chip {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.filter-chip:hover {
  color: var(--text);
}

.filter-chip.is-active {
  background: var(--text);
  color: #ffffff;
}

.filter-chip:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.result-count {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--bg);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 6px 18px rgba(24, 24, 22, 0.06);
}

.card:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.is-fallback img {
  display: none;
}

.thumb.is-fallback::after {
  content: "缩略图暂不可用";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  font-size: 12px;
  color: #a3a39d;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border: 1px solid rgba(24, 24, 22, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
}

.card-body {
  display: block;
  padding: 12px 14px 14px;
}

.card-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty-state {
  margin-top: 8px;
  padding: 64px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--card-radius);
  text-align: center;
}

.empty-title {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.link-button {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.link-button:hover {
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 72px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.copyright {
  margin: 0;
}

.footer-slot {
  margin: 0;
  color: var(--muted-2);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 22, 0.55);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow: auto;
  border-radius: 16px;
  background: var(--bg);
  box-shadow: 0 24px 60px rgba(20, 20, 18, 0.18);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.modal-close:hover {
  background: #ffffff;
  border-color: var(--border-strong);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-media {
  background: var(--bg-soft);
}

.modal-media img {
  width: 100%;
  max-height: 58vh;
  margin: 0 auto;
  object-fit: contain;
}

.modal-media video {
  width: 100%;
  max-height: 58vh;
  background: #111111;
}

.modal-body {
  padding: 20px 24px 24px;
}

.modal-title {
  margin: 0;
  padding-right: 40px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}

.modal-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}

.modal-meta dt {
  margin: 0;
  font-size: 12px;
  color: var(--muted-2);
}

.modal-meta dd {
  margin: 5px 0 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--button-radius);
  background: var(--button-bg);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

.download-button:hover {
  background: #333330;
}

.download-button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .asset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 40px 0 28px;
  }

  .site-header h1 {
    font-size: 26px;
  }

  .header-stats {
    gap: 36px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search {
    max-width: none;
  }

  .toolbar-controls {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 0 16px;
  }

  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .card-name {
    font-size: 13.5px;
  }

  .card-meta {
    font-size: 12px;
  }

  .badge {
    top: 8px;
    left: 8px;
    padding: 2px 7px;
    font-size: 11px;
  }

  .modal {
    padding: 12px;
  }

  .modal-body {
    padding: 16px 16px 20px;
  }

  .modal-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .modal-media img,
  .modal-media video {
    max-height: 46vh;
  }

  .download-button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
    gap: 6px;
    margin-top: 48px;
    padding: 22px 0 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .download-button,
  .modal-close {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}