/* x豆视频 — 米白纸感底 + 豆绿主色，轻量卡片式瀑布流 */
:root {
  /* 底色系：暖白纸感，比纯白更耐看 */
  --bg: #f6f5f1;
  --paper: #ffffff;
  --sunken: #efeee8;
  --line: #e5e2da;
  --line-soft: #eeebe4;

  /* 文字 */
  --txt: #191c17;
  --txt-2: #3d4339;
  --dim: #6d7468;

  /* 主色：豆绿 */
  --accent: #1fa463;
  --accent-ink: #0a6b3f;
  --accent-soft: #e6f6ee;
  --danger: #dd3f52;

  --radius: 16px;
  --gap: 14px;
  --shadow-1: 0 1px 2px rgba(25, 28, 23, .05), 0 1px 1px rgba(25, 28, 23, .03);
  --shadow-2: 0 14px 32px rgba(25, 28, 23, .11);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
          "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background-image:
    radial-gradient(1100px 380px at 50% -14%, #e4f5ec 0%, rgba(228, 245, 236, 0) 62%);
  background-repeat: no-repeat;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }

::selection { background: #bfe8d3; color: #06301d; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: #d7d4cb; border-radius: 99px; border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #c2bfb5; }

/* ---------------------------------------------------------- 18+ 门禁 */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(760px 420px at 50% 0%, #d9f2e4, transparent 68%),
    var(--bg);
}
.gate[hidden] { display: none; }

.gate-card {
  width: min(560px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 38px 32px 32px;
  text-align: center;
  box-shadow: 0 26px 60px rgba(25, 28, 23, .12);
}
.gate-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 32px; font-weight: 800; letter-spacing: -.02em;
}
.gate-lead { color: var(--dim); margin: 10px 0 22px; font-size: 14px; }
.gate-warn {
  color: #6b3a2a; font-size: 13.5px; line-height: 1.75;
  background: #fdf3ec; border: 1px solid #f5ded0;
  border-radius: 14px; padding: 14px 16px; margin: 0 0 24px;
  text-align: left;
}
.gate-warn strong { color: var(--danger); }

/* ---------------------------------------------------------- 按钮 */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #28b972, var(--accent));
  color: #fff; font-weight: 700; font-size: 14.5px;
  border: 0; border-radius: 12px;
  padding: 12px 24px;
  box-shadow: 0 6px 16px rgba(31, 164, 99, .28);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(31, 164, 99, .34);
}
.btn-primary:active { transform: translateY(0); }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 11px clamp(12px, 3vw, 30px);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex; align-items: center; gap: 9px;
  flex: none;
  font-size: 18.5px; font-weight: 800; letter-spacing: -.02em;
  white-space: nowrap;
}
.logo-mark {
  width: 30px; height: 30px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #35c383, #0d8a52);
  box-shadow: 0 3px 10px rgba(31, 164, 99, .34), inset 0 1px 0 rgba(255,255,255,.3);
}
.logo-mark svg { display: block; }
.logo-x { color: var(--accent); }
.logo-name { color: var(--txt); }

/* 后台自定义导航按钮 */
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  display: inline-flex; align-items: center;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--txt-2);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}
.nav-btn:hover {
  border-color: #a9e3c5;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* 排序：iOS 分段控件 */
.sorts {
  margin-left: auto;
  display: flex; gap: 2px;
  background: var(--sunken);
  border-radius: 12px;
  padding: 3px;
  flex: none;
}
.chip {
  background: transparent;
  border: 0; border-radius: 9px;
  padding: 6px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--dim);
  transition: .15s ease;
}
.chip:hover { color: var(--txt); }
.chip.on {
  background: var(--paper);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: var(--shadow-1);
}
.chip.ghost {
  margin-left: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 7px 14px;
  box-shadow: var(--shadow-1);
}
.chip.ghost:hover { border-color: #a9e3c5; color: var(--accent-ink); }

/* ---------------------------------------------------------- 落地页 */
.hero {
  padding: clamp(30px, 5vw, 58px) clamp(12px, 3vw, 30px) 6px;
  max-width: 980px;
}
.hero-h1 {
  margin: 0;
  font-size: clamp(27px, 4.2vw, 46px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.16;
  text-wrap: balance;
}
.hero-h2 {
  margin: 12px 0 0;
  font-size: clamp(15px, 1.6vw, 19.5px);
  font-weight: 600;
  color: var(--txt-2);
  letter-spacing: -.01em;
  line-height: 1.5;
}
.hero-text {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--dim);
  font-size: 14.5px;
  line-height: 1.75;
}
.hero-cta {
  margin-top: 22px;
  padding: 11px 24px;
}
/* 落地页出现时，频道头收紧一点 */
.hero:not([hidden]) + .subhead { padding-top: 22px; }

/* ---------------------------------------------------------- 频道头 */
.subhead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 30px clamp(12px, 3vw, 30px) 20px;
}
.subhead-main { min-width: 0; }
.subhead h2 {
  margin: 0;
  font-size: clamp(23px, 3vw, 33px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.24;
}
.sub-desc {
  color: var(--dim); font-size: 13.5px;
  max-width: 68ch; margin-top: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------- 瀑布流 */
.gallery {
  display: flex; align-items: flex-start; gap: var(--gap);
  padding: 0 clamp(12px, 3vw, 30px) 40px;
}
.col {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: var(--gap);
}

.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  animation: pop .3s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
}
.card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-2);
  transform: translateY(-3px);
}

/* 上游把对象清理掉的情况：降级成纯占位，不显示播放标记 */
.card.is-dead .play-mark { display: none !important; }
.card.is-dead .badge { opacity: .45; }

.media {
  position: relative; width: 100%;
  aspect-ratio: 3 / 4;
  background: #eceae4;
  overflow: hidden;
}
.media .ph {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, #eeebe4 30%, #f6f4ef 50%, #eeebe4 70%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.media img, .media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .28s ease;
}
.media img.ready, .media video.ready { opacity: 1; }
.card.is-video:hover video { opacity: 1; }
.card.is-video:hover img { opacity: 0; }

/* 视频中的播放凸标 */
.play-mark {
  position: absolute; z-index: 2;
  top: 50%; left: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .9);
  color: #16281d;
  box-shadow: 0 6px 20px rgba(10, 20, 14, .26);
  opacity: 0;
  transform: scale(.86);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.card.is-video:hover .play-mark {
  opacity: 1;
  transform: scale(1);
}
.card.is-video:hover.is-playing .play-mark { opacity: 0; }

.badges {
  position: absolute; z-index: 3; inset: auto 9px 9px 9px;
  display: flex; align-items: center; gap: 6px;
  pointer-events: none;
}
.badge {
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 5px 7px; border-radius: 7px;
  background: rgba(12, 16, 13, .66);
  color: #fff;
  backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.badge.nsfw { background: var(--danger); }
.badge.hd {
  background: rgba(31, 164, 99, .92);
  letter-spacing: .04em;
}
.badges .sp { flex: 1; }

.overlay {
  position: absolute; z-index: 2; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: 3px; padding: 14px 13px 13px;
  background: linear-gradient(to top,
      rgba(10, 14, 11, .88) 0%,
      rgba(10, 14, 11, .34) 40%,
      rgba(10, 14, 11, 0) 72%);
  opacity: 0;
  transition: opacity .17s ease;
}
.card:hover .overlay { opacity: 1; }
.ov-title {
  color: #fff;
  font-size: 12.8px; font-weight: 600; line-height: 1.42;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.ov-sub {
  color: #b8f0d3;
  font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------------------------------------------------- 状态 */
.sentinel { height: 1px; }
.status {
  padding: 2px 30px 64px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  min-height: 42px;
}
.status .spin {
  display: inline-block;
  width: 13px; height: 13px;
  margin-right: 8px;
  border: 2px solid #d5e9dc;
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin .68s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status.err { color: var(--danger); }
.status .pill {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  box-shadow: var(--shadow-1);
}

/* ---------------------------------------------------------- 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: stretch;
  background: rgba(16, 19, 17, .95);
  backdrop-filter: blur(10px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.lightbox[hidden] { display: none; }

.lb-stage {
  flex: 1 1 auto;
  display: grid; place-items: center;
  padding: 30px; min-width: 0;
}
.lb-stage video, .lb-stage img {
  max-width: 100%; max-height: calc(100vh - 60px);
  border-radius: 14px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}

.lb-info {
  flex: 0 0 352px;
  padding: 30px 26px;
  overflow-y: auto;
  background: #fbfaf7;
  border-left: 1px solid #2a2f2b;
  color: var(--txt);
}
.lb-kicker {
  font: 11px/1 var(--mono);
  letter-spacing: .1em;
  color: var(--accent-ink);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.lb-title { font-size: 17px; font-weight: 700; line-height: 1.45; }
.lb-meta { color: var(--dim); font-size: 12.8px; margin-top: 9px; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.lb-tags span {
  font-size: 12px; color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 11px;
}
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.lb-actions .chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 15px;
  font-size: 13px;
  box-shadow: var(--shadow-1);
}
.lb-actions .chip:hover { border-color: #a9e3c5; color: var(--accent-ink); }
.lb-close {
  position: absolute; top: 18px; right: 20px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: 14px;
  transition: .14s ease;
}
.lb-close:hover { background: rgba(255, 255, 255, .24); }

/* ---------------------------------------------------------- 公告条 / 页脚 */
.notice {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  padding: 10px 18px;
  border-bottom: 1px solid #cdeadd;
}
.notice a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.notice .x {
  margin-left: 4px;
  opacity: .5;
  cursor: pointer;
  background: none; border: 0; color: inherit;
  font-size: 15px; line-height: 1;
  padding: 2px 5px;
}
.notice .x:hover { opacity: 1; }

.footer {
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.8;
  padding: 0 20px 46px;
}

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .nav { order: 4; flex-basis: 100%; }
  .sorts { margin-left: auto; }
  .subhead { padding-top: 20px; }
  .lightbox { flex-direction: column; }
  .lb-info {
    flex: 0 0 auto; max-height: 44vh;
    border-left: 0; border-top: 1px solid #2a2f2b;
  }
  .lb-stage { padding: 14px; }
  .lb-close { top: 12px; right: 12px; }
}
