/* 欢喜纪 · 黑金主题（2026-11-14）
   金色 #CEAA6E 与深底 #1C1A18 取自设计师原图「欢喜纪-logo-深底金字.png」实测值，
   由 app/scripts/prepare_logo.py 同步生成同色 logo 素材，改配色请同时改这两处。 */
:root {
  color-scheme: dark;
  --bg: #0d0c0b;
  --surface: #1c1a18;
  --surface-input: #12110f;
  --ink: #f2ece0;
  --muted: #a9a094;
  --line: #37312a;
  --accent: #ceaa6e;
  --accent-bright: #e8ca94;
  --accent-soft: #241e15;
  --danger: #e08a7a;
  --ok: #9fd08a;
  --shadow: rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1100px 460px at 18% -8%, rgba(206, 170, 110, .055), transparent 70%), var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

::selection { background: var(--accent); color: #141210; }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3a3228; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); text-decoration: underline; }

.site-header {
  border-bottom: 1px solid rgba(206, 170, 110, .16);
  background: rgba(15, 14, 13, .92);
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo { display: block; height: 46px; width: auto; max-width: 230px; }
.brand:hover { text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.hero-logo {
  display: block; width: 150px; height: auto; max-width: 45vw;
  margin: 0 0 24px;
}

.nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav a, .link-btn { font-size: 14px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.link-btn:hover { color: var(--accent-bright); }

.container { max-width: 1080px; margin: 0 auto; padding: 48px 24px 72px; min-height: 60vh; }

.hero { padding: 32px 0 56px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-size: 13px; letter-spacing: 2px; margin: 0 0 16px; }
h1 { font-size: 34px; line-height: 1.4; font-weight: 600; margin: 0 0 20px; letter-spacing: 1px; }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 16px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 16px; max-width: 640px; margin: 0 0 32px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent-bright); background: var(--accent-soft); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #17140f;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(206, 170, 110, .16);
}
.btn.primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: #17140f; }
.btn.small { padding: 6px 14px; font-size: 13px; }

.section { padding: 48px 0 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}
.card p { color: var(--muted); margin: 0; font-size: 14px; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.tile { aspect-ratio: 3 / 4; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--line); }

/* 首页客样：小红书式瀑布流（分类标签 + 错落多列 + 灯箱） */
.feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feed-head h2 { margin: 0; }
.feed-head .meta { margin: 6px 0 0; }
.feed-count { color: #8b8377; font-size: 12px; letter-spacing: .04em; padding-bottom: 3px; }

.feed-tabs {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 16px 0 18px; padding: 2px 2px 4px;
  -webkit-overflow-scrolling: touch;
}
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(28, 26, 24, .55);
  color: var(--muted); font-size: 13px; font-family: inherit; white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.feed-tab:hover { color: var(--ink); border-color: rgba(206, 170, 110, .45); }
.feed-tab.active { background: var(--accent); border-color: var(--accent); color: #17140f; font-weight: 600; }
.feed-tab-n { font-size: 11px; opacity: .62; }
.feed-tab.active .feed-tab-n { opacity: .72; }

.feed { display: flex; align-items: flex-start; gap: 16px; }
.feed-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.feed-card {
  display: block; width: 100%; padding: 0; margin: 0; border: 0;
  background: none; text-align: left; font-family: inherit; color: inherit; cursor: zoom-in;
}
.feed-thumb {
  position: relative; display: block; overflow: hidden;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  transition: border-color .25s ease, box-shadow .25s ease;
}
.feed-thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s cubic-bezier(.2, .7, .3, 1);
}
.feed-card:hover .feed-thumb { border-color: rgba(206, 170, 110, .5); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
.feed-card:hover .feed-thumb img { transform: scale(1.045); }
.feed-card:focus-visible { outline: none; }
.feed-card:focus-visible .feed-thumb { box-shadow: 0 0 0 2px var(--accent); }

/* 组内张数角标：贴在封面右下角，告诉访客点进去有多少张 */
.feed-badge {
  position: absolute; right: 8px; bottom: 8px; z-index: 1;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(8, 8, 7, .56); color: #f6efe4;
  font-size: 11px; line-height: 1.6; letter-spacing: .02em;
  backdrop-filter: blur(3px); pointer-events: none;
}

.feed-body { display: block; padding: 9px 2px 0; }
.feed-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; line-height: 1.45; color: var(--ink); font-weight: 500;
}
.feed-author { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.feed-avatar {
  width: 18px; height: 18px; border-radius: 50%; object-fit: contain; flex: 0 0 auto;
  background: var(--accent-soft); border: 1px solid rgba(206, 170, 110, .3); padding: 2px;
}
.feed-name { font-size: 12px; color: var(--muted); }
.feed-cat {
  margin-left: auto; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: #8b8377; font-size: 11px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 52%;
}

/* 手机双列时收紧间距、隐藏分类角标，贴近小红书的竖屏观感 */
.feed[data-cols="2"] { gap: 10px; }
.feed[data-cols="2"] .feed-col { gap: 10px; }
.feed[data-cols="2"] .feed-thumb { border-radius: 10px; }
.feed[data-cols="2"] .feed-title { font-size: 13px; }
.feed[data-cols="2"] .feed-badge { right: 6px; bottom: 6px; padding: 1px 7px; font-size: 10px; }
.feed[data-cols="2"] .feed-cat { display: none; }

.lightbox {
  position: fixed; inset: 0; z-index: 50; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px; background: rgba(8, 8, 7, .97);
}
.lightbox img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 4px; }
.lightbox-bar {
  width: 100%; max-width: 1080px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; color: var(--ink); font-size: 13px;
}
.lightbox-bar[hidden] { display: none; }
.lightbox button {
  background: rgba(206, 170, 110, .12); border: 1px solid rgba(206, 170, 110, .32);
  color: var(--accent-bright); border-radius: 6px; padding: 7px 14px; cursor: pointer;
  font-size: 13px; font-family: inherit;
}
.lightbox button:hover { background: rgba(206, 170, 110, .28); color: #fff; }

.form-card { max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-input);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
input::placeholder, textarea::placeholder { color: #7c756b; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(206, 170, 110, .12);
}
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
textarea { min-height: 72px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.msg { font-size: 13px; min-height: 20px; margin: 12px 0 0; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }

.list { display: grid; gap: 14px; }
.list-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.meta { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(206, 170, 110, .28); font-size: 12px; }

.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.photo { position: relative; }
.photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; background: var(--surface); }
.photo label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.photo input[type=checkbox] { width: auto; }

.empty { color: var(--muted); padding: 32px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.note { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; padding: 16px 20px; font-size: 13px; color: #c9bfae; margin: 20px 0; }
.code-box { font-family: ui-monospace, Consolas, monospace; background: var(--surface-input); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; word-break: break-all; font-size: 13px; color: var(--accent-bright); }

.admin-block { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
}

/* 页脚备案号：与页脚同色，不抢标语视觉；hover / 键盘聚焦时才转金色 */
.site-footer #footer-note a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color .18s ease;
}
.site-footer #footer-note a:hover {
  color: var(--accent);
  text-decoration: none;
}
.site-footer #footer-note a:focus-visible {
  color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 920px) {
  .feed { gap: 12px; }
  .feed-col { gap: 12px; }
}

@media (max-width: 720px) {
  .container { padding: 28px 16px 48px; }
  h1 { font-size: 26px; }
  .grid, .two-col, .form-grid { grid-template-columns: 1fr; }
  .gallery, .photos { grid-template-columns: repeat(2, 1fr); }
  .lightbox img { max-height: 70vh; }
  .lightbox button { padding: 9px 12px; }
  .header-inner { padding: 14px 16px; }
  .nav { gap: 12px; }
  .brand-logo { height: 38px; }
  .hero-logo { width: 120px; margin-bottom: 18px; }
}

@media (max-width: 560px) {
  .feed-head .meta { font-size: 12px; }
  .feed-tabs { margin: 12px 0 14px; }
  .feed-tab { padding: 6px 12px; font-size: 12px; }
}

/* 375 及以下（iPhone SE / mini）：页脚两段并排会差约 15px 而换行，
   左右内边距收到 16px 正好放回一行；再窄（≤360）仍按 flex-wrap 正常换行。 */
@media (max-width: 400px) {
  .site-footer { padding: 24px 16px; }
}
