/* =========================================================
   灵感画廊 Inspiration Gallery — 全站样式
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1c1917;
  --muted: #857f74;
  --line: rgba(28, 25, 23, .09);
  --accent: #ff5c39;
  --accent2: #8b5cf6;
  --grad: linear-gradient(135deg, #ff5c39, #8b5cf6);
  --grad-soft: linear-gradient(135deg, rgba(255, 92, 57, .12), rgba(139, 92, 246, .12));
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 10px 34px rgba(28, 25, 23, .07);
  --shadow-lg: 0 18px 56px rgba(28, 25, 23, .16);
  --font-display: 'Fraunces', Georgia, 'Songti SC', 'SimSun', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --header-h: 70px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: rgba(255, 92, 57, .22); }
:focus-visible { outline: 3px solid rgba(139, 92, 246, .45); outline-offset: 2px; }

.hidden { display: none !important; }
.container { max-width: 1220px; margin: 0 auto; padding: 0 24px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, color .22s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgba(255, 92, 57, .32); }
.btn-primary:hover { box-shadow: 0 14px 34px rgba(139, 92, 246, .4); transform: translateY(-2px); }
.btn-primary.is-fav { background: var(--ink); box-shadow: none; }
.btn-ghost { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(250, 247, 242, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(28, 25, 23, .05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.logo { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: .5px; display: flex; align-items: center; gap: 9px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 15px;
  box-shadow: 0 6px 16px rgba(255, 92, 57, .35);
}

.nav { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 9px 15px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--ink); opacity: .78; transition: opacity .2s ease, background .2s ease; }
.nav-link:hover { opacity: 1; background: rgba(28, 25, 23, .05); }
.nav-link.active { opacity: 1; background: var(--ink); color: #fff; }
.fav-count {
  display: inline-block; min-width: 20px; padding: 0 5px; margin-left: 5px;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px;
}
.nav-link.active .fav-count { background: #fff; color: var(--ink); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 10px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s ease, opacity .3s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 首页 Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 78px; }
.hero::before {
  content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 92, 57, .2), transparent 62%);
  top: -180px; right: -90px; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .18), transparent 62%);
  bottom: -200px; left: -120px; pointer-events: none;
}
.hero-eyebrow {
  letter-spacing: .32em; text-transform: uppercase; font-size: 12px; font-weight: 700; color: var(--accent);
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(44px, 7.4vw, 84px);
  line-height: 1.06; letter-spacing: -1px; max-width: 900px;
}
.hero-title .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { margin-top: 24px; max-width: 560px; font-size: 17px; color: var(--muted); }
.hero-actions { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { margin-top: 56px; display: flex; gap: 44px; flex-wrap: wrap; }
.hero-stats strong { font-family: var(--font-display); font-size: 30px; font-weight: 700; display: block; }
.hero-stats span { color: var(--muted); font-size: 14px; }

/* ---------- 通用区块 ---------- */
.section { padding: 70px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 32px; letter-spacing: -.5px; }
.section-head p { color: var(--muted); margin-top: 4px; }

.page-hero { padding: 58px 0 34px; }
.page-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5vw, 54px); letter-spacing: -.5px; }
.page-hero p { color: var(--muted); margin-top: 10px; max-width: 620px; }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 34px; }
.chip {
  padding: 9px 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; transition: all .22s ease; color: var(--ink);
}
.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- 瀑布流 ---------- */
.masonry { columns: 4 250px; column-gap: 22px; }
.masonry-2col { columns: 2 320px; }

.card {
  break-inside: avoid; margin-bottom: 22px; position: relative;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .3s ease, box-shadow .3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.card-media { position: relative; overflow: hidden; background: #eee; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-media img { transform: scale(1.05); }

.card-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, .42), transparent 45%);
  opacity: 0; transition: opacity .3s ease;
}
.card:hover .card-overlay { opacity: 1; }
.card-cat {
  align-self: flex-start; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255, 255, 255, .85); color: var(--ink); backdrop-filter: blur(6px);
}
.card-read { align-self: flex-end; color: #fff; font-size: 13px; font-weight: 600; }

.card-info { padding: 14px 16px 16px; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.2px; }
.card-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.card-tags span { font-size: 12px; color: var(--accent2); background: rgba(139, 92, 246, .08); padding: 2px 9px; border-radius: 999px; }
.badge-local { font-size: 11px; font-weight: 700; color: #fff; background: var(--grad); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }

.fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .88); color: var(--ink); font-size: 18px;
  backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
  transition: all .22s ease;
}
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.is-fav { background: var(--grad); color: #fff; }

.card.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.card.reveal.in { opacity: 1; transform: none; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .emoji { font-size: 52px; }
.empty-state h3 { font-family: var(--font-display); font-size: 26px; margin: 16px 0 8px; }
.empty-state p { color: var(--muted); margin-bottom: 22px; }

/* ---------- 分类页 ---------- */
.browse-layout { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; padding-bottom: 80px; }
.side-panel { position: sticky; top: calc(var(--header-h) + 24px); }
.side-panel .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.side-panel h4 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-list button {
  text-align: left; padding: 9px 12px; border-radius: 10px; font-weight: 500; font-size: 15px;
  display: flex; justify-content: space-between; align-items: center; transition: background .2s ease;
}
.cat-list button:hover { background: rgba(28, 25, 23, .05); }
.cat-list button.active { background: var(--ink); color: #fff; }
.cat-list .num { font-size: 12px; opacity: .6; }

.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; margin-top: 14px; }
.search-box input { border: none; background: none; outline: none; flex: 1; font-size: 14px; }

.sort-select { margin-top: 14px; width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; }

/* ---------- 详情页 ---------- */
.detail-wrap { padding: 30px 0 90px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--muted); margin-bottom: 26px; transition: color .2s ease; }
.back-link:hover { color: var(--ink); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.detail-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: #eee; cursor: zoom-in; }
.detail-media img { width: 100%; height: auto; }

.cat-pill { display: inline-block; padding: 6px 15px; border-radius: 999px; background: var(--grad-soft); color: var(--accent); font-weight: 700; font-size: 13px; margin-bottom: 18px; }
.detail-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.5px; line-height: 1.15; }
.detail-author { color: var(--muted); margin-top: 10px; font-size: 15px; }
.detail-desc { margin-top: 22px; font-size: 16px; color: #3f3a35; }
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.tag-list span { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.detail-actions { margin-top: 30px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.detail-actions .date { color: var(--muted); font-size: 14px; }

.related { margin-top: 80px; }

/* ---------- 表单 ---------- */
.form-card { max-width: 720px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 36px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: 14px; }
.form-field label .req { color: var(--accent); }
.form-field input, .form-field select, .form-field textarea {
  padding: 12px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  font-size: 15px; transition: border-color .2s ease, box-shadow .2s ease;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(139, 92, 246, .12); background: #fff;
}
.form-hint { font-size: 13px; color: var(--muted); }
.tip-box { margin-top: 30px; background: var(--grad-soft); border-radius: 14px; padding: 16px 20px; font-size: 14px; color: #4b443c; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--ink); color: #bdb6ab; margin-top: 90px; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; padding: 56px 24px 40px; flex-wrap: wrap; }
.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { max-width: 320px; font-size: 14px; }
.footer-col h4 { color: #fff; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.footer-col a { display: block; padding: 5px 0; font-size: 14px; transition: color .2s ease; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 20px 24px; text-align: center; font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 13px 24px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 200; opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 150; background: rgba(15, 12, 10, .92);
  display: flex; align-items: center; justify-content: center; padding: 40px; cursor: zoom-out;
  opacity: 0; transition: opacity .28s ease;
}
.lightbox.show { opacity: 1; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 30px 90px rgba(0, 0, 0, .5); }
.lightbox-close { position: absolute; top: 22px; right: 26px; color: #fff; font-size: 34px; line-height: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .masonry { columns: 3; }
  .detail-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 55;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 16px 20px 22px;
    background: rgba(250, 247, 242, .98); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: all .28s ease;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-link { padding: 13px 16px; }
  .browse-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
}
@media (max-width: 640px) {
  .masonry { columns: 2; column-gap: 14px; }
  .card { margin-bottom: 14px; }
  .hero { padding: 66px 0 54px; }
  .hero-stats { gap: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px 20px; }
  .footer-inner { flex-direction: column; }
}
@media (max-width: 420px) {
  .masonry { columns: 1; }
}
