/* BiangMax Gallery — pixiv 风蓝白配色 */
:root {
  --blue: #0096fa;
  --blue-dark: #0075c8;
  --pink: #ff4060;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2328;
  --text-sub: #8b929c;
  --line: #e7eaee;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 40, 80, 0.07);
  --shadow-hover: 0 10px 28px rgba(20, 40, 80, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: rgba(0, 150, 250, 0.25); }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 58px;
}
.logo {
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.logo em { font-style: normal; color: var(--blue); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 360px; margin-left: auto;
  background: #eef1f4; border-radius: 999px;
  padding: 7px 14px; color: var(--text-sub);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.search-box:focus-within {
  background: #fff; border-color: var(--blue);
}
.search-box input {
  border: 0; outline: 0; background: transparent;
  font-size: 13.5px; width: 100%; color: var(--text);
}

.lang-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.lang-btn:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #e3f1ff 0%, #f3f9ff 55%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 44px 0 38px;
  margin-bottom: 22px;
}
.hero h1 { font-size: 27px; font-weight: 800; letter-spacing: 0.01em; }
.hero .sub { margin-top: 6px; color: var(--text-sub); font-size: 14px; }
.hero .sub b { color: var(--blue); font-weight: 700; }

/* ---------- 标签筛选 ---------- */
.tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 12.5px; padding: 5px 14px; border-radius: 999px;
  cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active {
  background: var(--blue); border-color: var(--blue); color: #fff;
}

/* ---------- 瀑布流 ---------- */
.grid { column-gap: 16px; }
@media (min-width: 1100px) { .grid { column-count: 5; } }
@media (min-width: 860px) and (max-width: 1099px) { .grid { column-count: 4; } }
@media (min-width: 580px) and (max-width: 859px) { .grid { column-count: 3; } }
@media (max-width: 579px) { .grid { column-count: 2; } }

.card {
  break-inside: avoid;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  cursor: zoom-in;
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.2s ease;
}
.card.show { opacity: 1; transform: none; }
.card:hover { box-shadow: var(--shadow-hover); }
.card:hover .card-img img { transform: scale(1.04); }

.card-img { position: relative; overflow: hidden; background: #eef1f4; }
.card-img img {
  width: 100%; height: auto; display: block;
  transition: transform 0.45s ease;
}
.like-btn {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.88);
  display: flex; align-items: center; justify-content: center;
  color: #9aa2ad;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  opacity: 0; transition: opacity 0.2s, color 0.15s, transform 0.15s;
}
.card:hover .like-btn, .like-btn.liked { opacity: 1; }
.like-btn:hover { transform: scale(1.12); }
.like-btn.liked { color: var(--pink); }
.like-btn svg { width: 17px; height: 17px; }
.like-btn.liked svg path { fill: var(--pink); }
.like-count {
  position: absolute; left: 10px; top: 14px;
  font-size: 11.5px; color: #fff; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.card:hover .like-count { opacity: 0.95; }

.card-body { padding: 10px 13px 12px; }
.card-title {
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-tags { margin-top: 3px; font-size: 11px; color: var(--text-sub); }
.card-tags span + span::before { content: " · "; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 70px 0 90px; color: var(--text-sub); }
.empty-icon { font-size: 44px; display: block; margin-bottom: 10px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px; margin-top: 30px;
  text-align: center; color: var(--text-sub); font-size: 12.5px;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(13, 20, 32, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: lb-fade 0.2s ease;
}
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox[hidden] { display: none; }

.lb-figure { max-width: min(1100px, 90vw); text-align: center; }
.lb-figure img {
  max-width: 100%; max-height: 78vh;
  border-radius: 10px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  display: block; margin: 0 auto;
}
.lb-caption {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
  color: #e8ecf1; margin-top: 14px; text-align: left;
}
.lb-caption h3 { font-size: 16px; font-weight: 700; }
.lb-tags { margin-top: 4px; }
.lb-tags span {
  display: inline-block; font-size: 11.5px; color: #aab6c4;
  background: rgba(255, 255, 255, 0.09);
  padding: 2px 10px; border-radius: 999px; margin-right: 6px;
}
.lb-count { font-size: 12.5px; color: #8b97a6; white-space: nowrap; }

.lb-btn {
  position: absolute; z-index: 5;
  border: 0; cursor: pointer;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  user-select: none;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.26); }
.lb-close { top: 18px; right: 22px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-btn { width: 38px; height: 38px; font-size: 22px; }
  .lb-caption { flex-direction: column; gap: 4px; }
}

button:focus-visible, input:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
