:root {
  --bg: #fff8e7;
  --card: #ffffff;
  --text: #1e1e1e;
  --muted: #6d6d6d;
  --brand: #ffcb2f;
  --brand-dark: #111111;
  --line: #ece3c7;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #fff1a8 0, transparent 30%), var(--bg);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header { padding: 24px; }
.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(10px);
}
.logo { font-size: 22px; font-weight: 900; }
.nav-links { display: flex; gap: 20px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }

.hero {
  max-width: 1180px;
  margin: 48px auto 20px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 34px;
  align-items: center;
}
.hero-text h1 {
  margin: 14px 0;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -2px;
}
.subtitle { max-width: 660px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--brand);
  font-size: 13px;
  font-weight: 800;
}
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid var(--brand-dark);
  font-weight: 800;
  box-shadow: 4px 4px 0 var(--brand-dark);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--brand-dark); }
.primary { background: var(--brand); }
.ghost { background: #fff; }
.hero-card {
  background: #fff;
  border: 3px solid #111;
  border-radius: 36px;
  padding: 28px;
  box-shadow: 10px 10px 0 #111;
  transform: rotate(2deg);
}
.preview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.preview-strip img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
  border: 2px solid var(--line);
  background: #fff8e7;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.materials-section {
  max-width: 1180px;
  margin: 70px auto;
  padding: 0 24px;
}
.section-title h2 { font-size: 38px; margin-bottom: 8px; }
.section-title p { color: var(--muted); }
.toolbar { margin: 28px 0; display: grid; gap: 16px; }
#searchInput {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  border: 2px solid #111;
  font-size: 16px;
  outline: none;
  box-shadow: 4px 4px 0 #111;
}
.categories { display: flex; gap: 10px; flex-wrap: wrap; }
.category-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}
.category-btn.active { background: #111; color: #fff; border-color: #111; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-4px); }
.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #fff3b7;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
}
.thumb img { position: relative; z-index: 1; }
.thumb-watermark {
  position: absolute;
  top: 18px;
  right: -18px;
  width: 90px;
  text-align: center;
  z-index: 2;
  padding: 4px 0;
  display: block;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 0;
  border: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  color: #d81f26;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  transform: rotate(45deg);
  transform-origin: center;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}
.card-body { padding: 16px; }
.card h3 { margin: 8px 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 14px; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tag { font-size: 12px; color: #555; background: #f4f4f4; padding: 5px 9px; border-radius: 999px; }
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.page-btn {
  min-width: 46px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 3px 3px 0 rgba(17, 17, 17, 0.12);
}
.page-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 rgba(17, 17, 17, 0.16);
}
.page-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}
.page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}
.empty { text-align: center; color: var(--muted); padding: 40px; }
.empty-state {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: var(--shadow);
}
.empty-state h1 {
  margin: 0 0 8px;
  color: var(--text);
}
.empty-state p {
  margin: 0 0 18px;
  line-height: 1.8;
}
.hidden { display: none !important; }

.footer { text-align: center; color: var(--muted); padding: 36px 20px; }
.footer-note {
  max-width: 1180px;
  margin: 10px auto 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .site-header { padding: 12px; }
  .nav { border-radius: 18px; }
  .nav-links { gap: 12px; font-size: 14px; flex-wrap: wrap; }
  .hero { margin-top: 28px; gap: 20px; }
  .subtitle { font-size: 16px; }
  .materials-section { margin: 56px auto; }
  .section-title h2 { font-size: 30px; }
  .section-title { margin-bottom: 8px; }
  .toolbar { margin: 20px 0; }
  #searchInput { padding: 14px 16px; }
  .card h3 { font-size: 17px; }
  .grid { grid-template-columns: 1fr; }
  .hero-card { box-shadow: 6px 6px 0 #111; }
  .preview-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
