:root {
  --bg: #f6f7fc;
  --bg-soft: #eceefa;
  --card: #ffffff;
  --fg: #171a2f;
  --muted: #636784;
  --border: rgba(30, 26, 80, .10);
  --accent: #7c6cf5;
  --accent-2: #f472b6;
  --accent-soft: rgba(124, 108, 245, .12);
  --shadow: 0 10px 34px rgba(38, 30, 100, .10);
}
[data-theme="dark"] {
  --bg: #0b0d1a;
  --bg-soft: #12152b;
  --card: #161a33;
  --fg: #f2f3ff;
  --muted: #9ca3c9;
  --border: rgba(255, 255, 255, .10);
  --accent: #8b7cff;
  --accent-2: #ff90b6;
  --accent-soft: rgba(139, 124, 255, .16);
  --shadow: 0 12px 38px rgba(0, 0, 0, .42);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, select, input { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 5vw, 64px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand-mark::after {
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: #ffd166; top: 4px; right: 4px;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-picker select {
  background: var(--card); color: var(--fg); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 9px; font-size: 13px; cursor: pointer;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--fg); display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; transition: .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun, [data-theme="light"] .icon-moon { display: none; }

.hero {
  position: relative; overflow: hidden; padding: clamp(56px, 11vw, 120px) 20px clamp(56px, 9vw, 96px);
  text-align: center; background: radial-gradient(ellipse at 50% -20%, var(--accent-soft), transparent 62%);
}
.hero-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .42; pointer-events: none; }
.orb-a { width: 320px; height: 320px; background: var(--accent); top: -100px; left: 8%; }
.orb-b { width: 280px; height: 280px; background: var(--accent-2); bottom: -120px; right: 10%; }
.hero-inner { position: relative; max-width: 820px; margin: 0 auto; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(30px, 6vw, 58px); line-height: 1.12; letter-spacing: -.035em; }
.hero-sub { margin: 18px auto 28px; color: var(--muted); font-size: clamp(15px, 2.3vw, 19px); max-width: 620px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.primary-btn, .ghost-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; padding: 11px 20px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: .2s;
}
.primary-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.primary-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ghost-btn { background: var(--card); color: var(--fg); border-color: var(--border); }
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }

.gallery-section { max-width: 1500px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 48px) 80px; }
.toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.search-wrap {
  flex: 1 1 340px; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 0 14px;
}
.search-wrap svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-wrap input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--fg); padding: 12px 0; font-size: 14px; }
.result-meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.result-meta span:first-child { color: var(--accent); font-weight: 700; }

.orientation-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; margin-bottom: 16px; }
.orient-btn { border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 7px 16px; font-size: 13px; cursor: pointer; transition: .2s; }
.orient-btn:hover { color: var(--accent); }
.orient-btn.active { background: var(--accent); color: #fff; }

.filter-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.filter-label {
  flex: 0 0 auto; padding-top: 8px; font-size: 13px; font-weight: 600;
  color: var(--muted); min-width: 42px;
}
.filter-row .chips { flex: 1 1 auto; margin-bottom: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.chip {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; transition: .2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gallery.is-vertical { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
.card {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); cursor: pointer;
  content-visibility: auto; contain-intrinsic-size: auto 150px;
  animation: cardIn .4s both;
}
.card.v { aspect-ratio: 9 / 16; contain-intrinsic-size: auto 300px; }
.card.v .card-info strong { font-size: 12px; }
.card.v .card-info span { font-size: 9px; }
.lightbox.portrait .lightbox-image-wrap img { max-height: calc(100vh - 190px); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card .lqip {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(10px); transform: scale(1.12); transition: opacity .4s;
}
.card img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .4s, transform .5s;
}
.card img.loaded { opacity: 1; }
.card:hover img.loaded { transform: scale(1.05); }
.card-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(4,4,20,.15), transparent 40%, rgba(4,4,20,.78));
}
.card-info { position: absolute; left: 13px; right: 13px; bottom: 11px; color: #fff; pointer-events: none; }
.card-info strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-info span { font-size: 10px; opacity: .72; }
.card-heart {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(10,10,26,.5); color: #fff; font-size: 17px; line-height: 1;
  cursor: pointer; opacity: 0; transition: .2s; backdrop-filter: blur(6px);
}
.card:hover .card-heart, .card-heart.active { opacity: 1; }
.card-heart.active { color: #ff90b6; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.loader { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px; color: var(--muted); font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { height: 1px; }
.load-more-wrap { text-align: center; padding: 12px 0 0; }

.site-footer {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 28px 20px 40px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border);
}
.dot { opacity: .5; }

.lightbox { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(3,4,14,.88); backdrop-filter: blur(12px); }
.lightbox-body { position: relative; z-index: 2; max-width: 1400px; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.lightbox-image-wrap { display: flex; align-items: center; justify-content: center; min-height: 0; }
.lightbox-image-wrap img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 10px; display: block; }
.lb-close, .lb-nav {
  position: absolute; z-index: 3; background: rgba(20,20,40,.55); color: #fff; border-color: rgba(255,255,255,.18);
  font-size: 26px; line-height: 1;
}
.lb-close { top: 18px; right: 20px; font-size: 22px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; }
.lb-prev { left: 20px; } .lb-next { right: 20px; }
.lightbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: rgba(18,18,36,.72); color: #fff; padding: 12px 16px; border-radius: 12px;
  backdrop-filter: blur(10px);
}
.lb-info { display: flex; flex-direction: column; min-width: 0; }
.lb-info strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-info span { font-size: 11px; opacity: .65; }
.lb-actions { display: flex; gap: 8px; align-items: center; }
.lightbar .ghost-btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }

body.is-locked { overflow: hidden; }
@media (max-width: 640px) {
  .site-header { padding: 10px 14px; }
  .brand-name { font-size: 15px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
  .lb-nav { width: 38px; height: 38px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lightbox { padding: 8px; }
  .lightbox-image-wrap img { max-height: 62vh; }
}
