/* 素质 · 轻中式手作素材展示站 —— 访客端样式 */
:root {
  --paper: #f7f3ed;
  --paper-2: #fdfbf7;
  --ink: #332f2b;
  --ink-soft: #5c564f;
  --muted: #8b8680;
  --accent: #a67c52;
  --accent-soft: #e8ddcf;
  --line: rgba(51, 47, 43, .12);
  --line-strong: rgba(51, 47, 43, .22);
  --shadow: 0 12px 34px rgba(58, 46, 34, .10);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { width: min(1440px, calc(100% - 64px)); margin: 0 auto; }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-size: 19px; letter-spacing: .14em; }
.brand small {
  display: block; font-family: var(--sans); font-size: 10px;
  letter-spacing: .32em; color: var(--muted); margin-top: 3px;
}
.topbar-right { font-size: 12px; letter-spacing: .16em; color: var(--muted); }

.hero { padding: 88px 0 62px; text-align: center; position: relative; }
.hero::after {
  content: ""; display: block; width: 46px; height: 1px;
  background: var(--accent); margin: 34px auto 0;
}
.hero-label {
  font-size: 11px; letter-spacing: .42em; color: var(--accent);
  text-transform: uppercase; margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 5.2vw, 66px); line-height: 1.25;
  letter-spacing: .1em; margin: 0 0 18px;
}
.hero .subtitle { font-family: var(--serif); font-size: 17px; color: var(--ink-soft); letter-spacing: .12em; }
.hero .intro {
  max-width: 620px; margin: 26px auto 0; font-size: 14px;
  color: var(--muted); line-height: 2; letter-spacing: .04em;
}

/* ---------- 工具栏 ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 243, 237, .94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 16px 0 14px;
}
.toolbar-row { display: flex; align-items: center; gap: 20px; }
.search {
  flex: 0 0 230px; position: relative;
  border-bottom: 1px solid var(--line-strong);
}
.search input {
  width: 100%; border: 0; outline: 0; background: transparent;
  padding: 7px 22px 7px 2px; font-size: 13px; letter-spacing: .04em;
}
.search input::placeholder { color: var(--muted); }
.search .clear {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--muted); font-size: 16px; padding: 0 2px;
  display: none;
}
.search.has-value .clear { display: block; }

.tagbar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tagbar::-webkit-scrollbar { display: none; }
.tag {
  flex: 0 0 auto; border: 1px solid var(--line-strong); background: transparent;
  border-radius: 999px; padding: 6px 15px; font-size: 12.5px;
  letter-spacing: .06em; color: var(--ink-soft); white-space: nowrap;
  transition: all .2s ease;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag.active { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.tag .n { font-size: 10px; opacity: .55; margin-left: 5px; }
.count { flex: 0 0 auto; font-size: 12px; color: var(--muted); letter-spacing: .08em; }

/* ---------- 图片墙 ---------- */
.gallery { padding: 34px 0 70px; }
.grid { columns: 4; column-gap: 18px; }
@media (max-width: 1180px) { .grid { columns: 3; } }
@media (max-width: 780px)  { .grid { columns: 2; column-gap: 12px; } .wrap { width: calc(100% - 32px); } }
@media (max-width: 460px)  { .grid { columns: 1; } }

.card {
  break-inside: avoid; margin: 0 0 18px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  cursor: zoom-in;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.card img { width: 100%; height: auto; background: #eee9e1; }
.card .meta { padding: 11px 13px 13px; }
.card .name {
  font-family: var(--serif); font-size: 13.5px; line-height: 1.5;
  letter-spacing: .03em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card .tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.card .tags span { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; }
.card .tags span + span::before { content: "· "; color: var(--accent); }

.empty { text-align: center; padding: 90px 0; color: var(--muted); font-family: var(--serif); font-size: 16px; }
.loading { text-align: center; padding: 80px 0; color: var(--muted); font-size: 13px; letter-spacing: .2em; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line); padding: 30px 0 42px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 12px; color: var(--muted); letter-spacing: .06em;
}
.footer .admin-link {
  border-bottom: 1px solid transparent; padding-bottom: 2px; transition: all .2s;
}
.footer .admin-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(28, 25, 22, .94); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox figure { margin: 0; max-width: min(92vw, 1200px); max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.lightbox img {
  max-width: 100%; max-height: 76vh; object-fit: contain;
  border-radius: 2px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.lightbox figcaption {
  color: #ded5c8; font-family: var(--serif); font-size: 14px;
  letter-spacing: .06em; text-align: center; margin-top: 18px; padding: 0 60px;
}
.lightbox figcaption .lb-tags { display: block; font-family: var(--sans); font-size: 11px; color: #a89d8c; margin-top: 6px; letter-spacing: .1em; }
.lb-btn {
  position: absolute; border: 0; background: rgba(255,255,255,.08); color: #f3ece1;
  width: 44px; height: 44px; border-radius: 50%; font-size: 20px;
  display: grid; place-items: center; transition: background .2s;
}
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-close { top: 24px; right: 28px; font-size: 24px; }
.lb-prev { left: 28px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 28px; top: 50%; transform: translateY(-50%); }
.lb-index { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: #a89d8c; font-size: 11px; letter-spacing: .24em; }
@media (max-width: 620px) {
  .lb-prev { left: 10px; } .lb-next { right: 10px; }
  .lightbox figcaption { padding: 0 16px; font-size: 12px; }
}
