/* ============ 基础与变量 ============ */
:root {
  --bg: #0a0a0e;
  --bg-2: #101016;
  --surface: #16161e;
  --surface-2: #1c1c26;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ececf2;
  --muted: #9b9baa;
  --accent: #ff5e6c;
  --accent-2: #ffb45e;
  --teal: #3ecfae;
  --grad: linear-gradient(120deg, #ff5e6c 0%, #ff9a5e 55%, #ffd36e 100%);
  --radius: 16px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Playfair Display", "Noto Sans SC", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(255, 94, 108, 0.35); }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a36; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a48; }

/* ============ 顶栏 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 14, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo-mark { font-size: 22px; }

.nav { display: flex; gap: 8px; margin-left: 8px; }

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 999px;
  transition: color 0.25s, background 0.25s;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); background: var(--surface-2); }

.fav-filter-btn {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 17px;
  color: var(--muted);
  transition: all 0.25s;
  position: relative;
}

.fav-filter-btn:hover { color: var(--accent); border-color: rgba(255, 94, 108, 0.5); }
.fav-filter-btn.on { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 94, 108, 0.12); }

/* ============ Hero ============ */
.hero {
  position: relative;
  text-align: center;
  padding: 96px 24px 72px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 480px;
  background:
    radial-gradient(600px 300px at 30% 40%, rgba(255, 94, 108, 0.16), transparent 60%),
    radial-gradient(600px 300px at 70% 30%, rgba(255, 158, 94, 0.14), transparent 60%),
    radial-gradient(700px 340px at 50% 70%, rgba(62, 207, 174, 0.10), transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.5em;
  color: var(--muted);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  margin-top: 20px;
  font-size: 17px;
  color: var(--muted);
  font-weight: 300;
}

/* 搜索框 */
.search-box {
  margin: 36px auto 0;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
  border-color: rgba(255, 94, 108, 0.55);
  box-shadow: 0 0 0 5px rgba(255, 94, 108, 0.12), var(--shadow);
}

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

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

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

/* 统计 */
.hero-stats {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 48px;
}

.stat { display: flex; flex-direction: column; gap: 2px; }

.stat-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label { font-size: 13px; color: var(--muted); letter-spacing: 0.1em; }

/* ============ 区块通用 ============ */
.featured-section, .gallery-section { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}

.section-title { font-size: 24px; font-weight: 700; letter-spacing: 0.02em; }

.section-note {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ============ 精选横滑区 ============ */
.featured-section { padding-bottom: 28px; }

.featured-strip {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 4px 16px;
  scroll-snap-type: x mandatory;
}

.featured-strip::-webkit-scrollbar { height: 6px; }

.f-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.f-card:hover { transform: translateY(-6px); border-color: rgba(255, 94, 108, 0.4); box-shadow: var(--shadow); }

.f-media { position: relative; overflow: hidden; background: linear-gradient(135deg, #1d1d28, #252533); }

.f-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.5s; }
.f-media img.loaded { opacity: 1; }

.f-info { padding: 12px 14px 14px; }

.f-info h4 { font-size: 15px; font-weight: 500; }

.f-info span { font-size: 12px; color: var(--muted); }

/* ============ 滤镜条 ============ */
.gallery-section { padding-bottom: 90px; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 28px;
}

.filter-pill {
  padding: 8px 18px;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all 0.25s;
}

.filter-pill:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); transform: translateY(-1px); }

.filter-pill.active {
  color: #1a0d10;
  font-weight: 500;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(255, 110, 90, 0.35);
}

/* ============ 瀑布流 ============ */
.masonry {
  column-count: 3;
  column-gap: 20px;
}

.card {
  break-inside: avoid;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.5s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card.in { opacity: 1; transform: translateY(0); }

.card:hover {
  transform: translateY(-6px);
  transition: transform 0.25s ease, opacity 0.6s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-color: rgba(255, 94, 108, 0.4);
  box-shadow: var(--shadow);
}

.card-media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1d1d28, #252533);
}

.card-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.6s, transform 0.5s; }
.card-media img.loaded { opacity: 1; }
.card:hover .card-media img { transform: scale(1.05); }

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #ffe0a3;
}

/* 悬浮操作层 */
.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover .card-overlay,
.f-card:hover .card-overlay { opacity: 1; }

.ov-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 10, 14, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  backdrop-filter: blur(6px);
  transition: all 0.25s;
}

.ov-btn:hover { transform: scale(1.12); }
.ov-btn.on { color: var(--accent); border-color: var(--accent); }
.ov-fav.on { animation: pop 0.35s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.card-info { padding: 14px 16px 16px; }

.card-title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-category {
  font-size: 12px;
  color: var(--teal);
  border: 1px solid rgba(62, 207, 174, 0.35);
  padding: 2px 10px;
  border-radius: 999px;
}

.card-likes { font-size: 12px; color: var(--muted); }

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }

.btn-reset {
  margin-top: 18px;
  padding: 10px 26px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: all 0.25s;
}

.btn-reset:hover { border-color: var(--accent); color: var(--accent); }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }

.modal[hidden] { display: none; }

body.modal-open { overflow: hidden; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 5, 10, 0.74); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.modal-dialog {
  position: relative;
  width: min(920px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  animation: modalIn 0.35s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(10, 10, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: blur(6px);
  transition: all 0.25s;
}

.modal-close:hover { transform: rotate(90deg); color: var(--accent); }

.modal-image-wrap { background: linear-gradient(135deg, #1d1d28, #252533); min-height: 220px; }

.modal-image-wrap img { width: 100%; height: 100%; min-height: 100%; object-fit: cover; }

.modal-body { padding: 30px 30px 32px; display: flex; flex-direction: column; }

.modal-meta { display: flex; align-items: center; gap: 12px; }

.tag {
  font-size: 12px;
  color: var(--teal);
  border: 1px solid rgba(62, 207, 174, 0.35);
  padding: 3px 12px;
  border-radius: 999px;
}

.modal-author { font-size: 13px; color: var(--muted); }

.modal-title { font-size: 26px; font-weight: 700; margin: 14px 0 12px; letter-spacing: 0.01em; }

.modal-desc { font-size: 15px; color: var(--muted); font-weight: 300; line-height: 1.8; }

.modal-tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }

.modal-actions { margin-top: auto; padding-top: 26px; display: flex; gap: 12px; }

.btn {
  flex: 1;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 15px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  transition: all 0.25s;
}

.btn:hover { transform: translateY(-2px); }

.btn-like { border-color: rgba(255, 94, 108, 0.4); color: #ffb3ba; }
.btn-like:hover { background: rgba(255, 94, 108, 0.12); border-color: var(--accent); color: var(--accent); }
.btn-like.on { background: rgba(255, 94, 108, 0.16); border-color: var(--accent); color: var(--accent); }

.btn-fav { border-color: rgba(255, 180, 94, 0.4); color: #ffd9a8; }
.btn-fav:hover { background: rgba(255, 180, 94, 0.12); border-color: var(--accent-2); color: var(--accent-2); }
.btn-fav.on { background: rgba(255, 180, 94, 0.16); border-color: var(--accent-2); color: var(--accent-2); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  z-index: 200;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 24px;
  text-align: center;
}

.site-footer p { color: var(--muted); font-size: 13px; }

/* ============ 关于页 ============ */
.about-hero {
  position: relative;
  text-align: center;
  padding: 96px 24px 64px;
  overflow: hidden;
}

.about-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 460px;
  background:
    radial-gradient(600px 300px at 30% 40%, rgba(255, 94, 108, 0.14), transparent 60%),
    radial-gradient(600px 300px at 70% 30%, rgba(62, 207, 174, 0.12), transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}

.about-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px 90px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.about-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 94, 108, 0.4);
  box-shadow: var(--shadow);
}

.about-icon { font-size: 34px; margin-bottom: 14px; }

.about-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }

.about-card p { font-size: 14px; color: var(--muted); font-weight: 300; line-height: 1.85; }

.about-note {
  margin-top: 32px;
  padding: 28px 30px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.about-note p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.about-note .btn-reset { display: inline-block; text-decoration: none; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .masonry { column-count: 2; }
  .modal-dialog { grid-template-columns: 1fr; max-width: 620px; }
  .modal-image-wrap img { max-height: 360px; object-fit: cover; }
}

@media (max-width: 640px) {
  .masonry { column-count: 1; }
  .hero { padding: 64px 18px 52px; }
  .hero-sub br.mb-hide { display: none; }
  .hero-stats { gap: 32px; }
  .header-inner { padding: 12px 16px; gap: 12px; }
  .nav { margin-left: 0; }
  .nav-link { padding: 6px 10px; font-size: 14px; }
  .modal { padding: 12px; }
  .modal-body { padding: 22px 20px 24px; }
  .modal-actions { flex-direction: column; }
  .featured-section, .gallery-section { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .card { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
