/* h4·冬瓜电影网：底部 Dock + 纸质青灰底；与其它 h 模板布局刻意区分 */

:root {
  --h4-paper: #f6f3ec;
  --h4-veil: #e8efe9;
  --h4-ink: #1a2f24;
  --h4-muted: #5c6d63;
  --h4-melon: #6c9a72;
  --h4-melon-dk: #3d6b47;
  --h4-rind: #c45c3e;
  --h4-line: rgba(26, 47, 36, 0.12);
  --h4-dock-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--h4-ink);
  background: var(--h4-paper);
}
a { color: var(--h4-melon-dk); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--h4-melon); }
img { max-width: 100%; vertical-align: middle; }

.h4-app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--h4-dock-h) + 20px);
}

/* 顶栏 */
.h4-surface {
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, var(--h4-veil) 0%, var(--h4-paper) 100%);
  border-bottom: 1px solid var(--h4-line);
}
.h4-surface__tag {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--h4-muted);
}
.h4-surface__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.h4-brand {
  font-size: 20px;
  font-weight: 900;
  color: var(--h4-ink) !important;
  text-decoration: none !important;
  letter-spacing: 0.02em;
}
.h4-ghost-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--h4-line);
  background: #fff;
  color: var(--h4-melon-dk);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

/* 搜索层 */
.h4-find { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.h4-find.is-open { pointer-events: auto; }
.h4-find__mask {
  position: absolute;
  inset: 0;
  background: rgba(26, 47, 36, 0.42);
  opacity: 0;
  transition: opacity 0.16s;
}
.h4-find.is-open .h4-find__mask { opacity: 1; }
.h4-find__sheet {
  position: absolute;
  left: 12px; right: 12px; top: 14%;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid var(--h4-line);
  box-shadow: 0 16px 40px rgba(26, 47, 36, 0.18);
  transform: translateY(-12px) scale(0.98);
  opacity: 0;
  transition: transform 0.2s, opacity 0.2s;
}
.h4-find.is-open .h4-find__sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.h4-find__form { display: flex; gap: 10px; margin-bottom: 12px; }
.h4-find__in {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--h4-line);
  font-size: 16px;
}
.h4-find__go {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 900;
  cursor: pointer;
  color: #f6fef7;
  background: linear-gradient(180deg, var(--h4-melon), var(--h4-melon-dk));
}
.h4-find__x {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--h4-line);
  border-radius: 10px;
  background: var(--h4-paper);
  font-weight: 700;
  cursor: pointer;
  color: var(--h4-muted);
}

/* 面包屑 */
.h4-bc {
  margin: 0 14px 10px;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--h4-muted);
}
.h4-bc a { color: var(--h4-melon-dk); }
.h4-bc__sep { margin: 0 8px; opacity: 0.45; }
.h4-bc__here { color: var(--h4-ink); }

/* 底部 Dock */
.h4-dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  min-height: var(--h4-dock-h);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--h4-line);
  backdrop-filter: blur(10px);
}
.h4-dock__it {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0 2px;
  padding: 6px 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  color: var(--h4-muted);
  cursor: pointer;
  text-decoration: none !important;
}
.h4-dock__it.is-on {
  color: var(--h4-melon-dk);
  background: rgba(108, 154, 114, 0.14);
}
.h4-dock__g { font-size: 16px; line-height: 1; opacity: 0.9; }

.h4-ft {
  margin: 24px 14px 8px;
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--h4-line);
  font-size: 12px;
  color: var(--h4-muted);
}
.h4-ft__slogan { margin: 0 0 8px; font-weight: 700; color: var(--h4-ink); }
.h4-ft__legal { margin: 0 0 8px; line-height: 1.58; }
.h4-ft__copy { margin: 0; font-weight: 700; }

/* 首页 hero */
.h4-hero { margin: 14px 14px 18px; }
.h4-hero__card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--h4-line);
  background: #1e2a22;
  min-height: 220px;
}
.h4-hero__bg {
  position: absolute;
  inset: 0;
  opacity: 0.45;
}
.h4-hero__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.h4-hero__body {
  position: relative;
  padding: 20px 16px 18px;
  color: #f4fdf6;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.h4-hero__k {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(255,255,255,0.18);
}
.h4-hero__t {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}
.h4-hero__meta { margin: 0 0 12px; font-size: 13px; opacity: 0.92; font-weight: 600; }
.h4-hero__go {
  display: inline-flex;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 900;
  color: #fff !important;
  background: linear-gradient(180deg, var(--h4-rind), #9a3d26);
  text-decoration: none !important;
  border: 2px solid rgba(255,255,255,0.35);
}

/* 横滑条 */
.h4-strip { margin: 0 0 20px; }
.h4-strip__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 14px 10px;
}
.h4-strip__n { margin: 0; font-size: 16px; font-weight: 900; color: var(--h4-ink); }
.h4-strip__rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 14px 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.h4-strip__rail::-webkit-scrollbar { display: none; }
.h4-strip__item {
  flex: 0 0 auto;
  width: 112px;
  scroll-snap-align: start;
}
.h4-strip__item a { display: block; color: inherit !important; text-decoration: none !important; }
.h4-strip__pic {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--h4-line);
  aspect-ratio: 2/3;
  background: #fff;
}
.h4-strip__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h4-strip__title {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--h4-ink);
  max-height: 2.7em;
  overflow: hidden;
}

/* 瓜田信息流 */
.h4-river-list { margin: 0; padding: 0 14px; list-style: none; }
.h4-river {
  margin-bottom: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--h4-line);
  overflow: hidden;
}
.h4-river__go {
  display: flex;
  gap: 12px;
  padding: 10px;
  color: inherit !important;
  text-decoration: none !important;
}
.h4-river__pic {
  flex: 0 0 72px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--h4-veil);
  aspect-ratio: 120/168;
}
.h4-river__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h4-river__body { flex: 1; min-width: 0; }
.h4-river__t { margin: 2px 0 6px; font-size: 15px; font-weight: 900; line-height: 1.3; }
.h4-river__meta { margin: 0; font-size: 12px; color: var(--h4-muted); font-weight: 600; }

/* 拼图入口 */
.h4-puzzle { margin: 22px 14px; }
.h4-puzzle__h { margin: 0 0 10px; font-size: 15px; font-weight: 900; }
.h4-puzzle__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.h4-puzzle__a {
  flex: 1 1 40%;
  min-width: 120px;
  padding: 12px 10px;
  border-radius: 14px;
  text-align: center;
  font-weight: 900;
  font-size: 13px;
  color: var(--h4-melon-dk) !important;
  background: #fff;
  border: 2px dashed rgba(108, 154, 114, 0.35);
  text-decoration: none !important;
}

/* 栅格 */
.h4-grid {
  margin: 0;
  padding: 8px 10px 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 8px;
}
@media (min-width: 520px) {
  .h4-grid { grid-template-columns: repeat(4, 1fr); }
}
.h4-tile__go {
  display: block;
  color: inherit !important;
  text-decoration: none !important;
}
.h4-tile__pic {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--h4-line);
  aspect-ratio: 280/398;
  background: var(--h4-veil);
}
.h4-tile__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h4-tile__chip {
  position: absolute;
  left: 6px; bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  color: #fff;
  background: rgba(0,0,0,0.55);
}
.h4-tile__t {
  margin: 8px 2px 2px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}
.h4-tile__sub { margin: 0 2px; font-size: 11px; color: var(--h4-muted); font-weight: 600; }

/* 筛选 / 分流 */
.h4-catfilt {
  margin: 0 14px 12px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--h4-line);
}
.h4-catfilt__hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.h4-catfilt__tip { margin: 0; font-size: 13px; font-weight: 700; color: var(--h4-ink); }
.h4-catfilt__reset {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--h4-rind) !important;
}
.h4-catfilt__row { margin-bottom: 10px; }
.h4-catfilt__row:last-child { margin-bottom: 0; }
.h4-catfilt__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.h4-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--h4-muted) !important;
  background: var(--h4-paper);
  border: 1px solid var(--h4-line);
  text-decoration: none !important;
}
.h4-chip.is-on {
  background: var(--h4-melon);
  border-color: var(--h4-melon-dk);
  color: #f6fdf7 !important;
}

.h4-sort {
  display: flex;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.h4-sort::-webkit-scrollbar { display: none; }
.h4-sort li a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--h4-muted) !important;
  background: #fff;
  border: 1px solid var(--h4-line);
  text-decoration: none !important;
}
.h4-sort li.is-on a {
  background: var(--h4-ink);
  border-color: var(--h4-ink);
  color: #f4fdf6 !important;
}

.h4-msg {
  margin: 0 14px 12px;
  padding: 12px;
  font-size: 12px;
  color: var(--h4-muted);
  line-height: 1.55;
  background: rgba(108, 154, 114, 0.09);
  border-radius: 12px;
  border: 1px dashed rgba(108, 154, 114, 0.28);
}
.h4-msg strong { color: var(--h4-ink); }

.h4-sort-t {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 0;
  list-style: none;
}
.h4-sort-t li a {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--h4-line);
  color: var(--h4-melon-dk) !important;
  text-decoration: none !important;
}
.h4-sort-t li.is-on a { background: var(--h4-veil); border-color: var(--h4-melon); }

/* 分页 */
.h4-page { margin: 16px 14px; padding: 12px; background: #fff; border-radius: 14px; border: 1px solid var(--h4-line); }
.h4-page__ul { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 8px; padding: 0; list-style: none; }
.h4-page__ul a {
  display: block;
  padding: 6px 11px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  background: var(--h4-paper);
  border: 1px solid var(--h4-line);
  color: var(--h4-ink) !important;
  text-decoration: none !important;
}
.h4-page__ul li.is-on a { background: var(--h4-melon); color: #fff !important; border-color: var(--h4-melon-dk); }
.h4-page__stat { margin: 0; text-align: center; font-size: 12px; color: var(--h4-muted); font-weight: 600; }

/* 详情 · 叠层海报 */
.h4-du { margin: 14px 14px 16px; position: relative; }
.h4-du__stage {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #1a241d;
  min-height: 180px;
}
.h4-du__bg {
  position: absolute;
  inset: 0;
  opacity: 0.35;
}
.h4-du__bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h4-du__panel {
  position: relative;
  padding: 18px 16px 20px;
  color: #f3fff5;
}
.h4-du__panel::after { content: ""; display: table; clear: both; }
.h4-du__poster-float {
  float: right;
  width: 108px;
  margin: 0 0 10px 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.h4-du__poster-float img { width: 100%; height: auto; display: block; vertical-align: middle; }
.h4-du__h { margin: 0 0 8px; font-size: 21px; font-weight: 900; line-height: 1.2; text-shadow: 0 1px 2px rgba(0,0,0,0.45); }
.h4-du__meta { margin: 0 0 14px; font-size: 13px; font-weight: 600; opacity: 0.92; }
.h4-du__cta { display: flex; flex-wrap: wrap; gap: 10px; clear: both; }
.h4-du__btn {
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 900;
  color: #fff !important;
  background: linear-gradient(180deg, var(--h4-rind), #8b3822);
  text-decoration: none !important;
  border: 2px solid rgba(255,255,255,0.25);
}
.h4-du__btn--ghost {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
}

/* 档案表 */
.h4-dossier {
  margin: 0 14px 14px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--h4-line);
}
.h4-dossier__h { margin: 0 0 12px; font-size: 14px; font-weight: 900; color: var(--h4-melon-dk); }
.h4-dossier__grid {
  display: grid;
  gap: 0;
  font-size: 12px;
}
.h4-dossier__row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--h4-line);
}
.h4-dossier__row:last-child { border-bottom: none; }
.h4-dossier__k { margin: 0; font-weight: 800; color: var(--h4-muted); }
.h4-dossier__v { margin: 0; font-weight: 600; color: var(--h4-ink); word-break: break-word; }
.h4-dossier__v a { font-weight: 800; }

/* 冬瓜碎碎念 */
.h4-melon {
  margin: 0 14px 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(165deg, #fff 0%, #eef6f0 100%);
  border: 2px solid rgba(108, 154, 114, 0.28);
}
.h4-melon__h { margin: 0 0 10px; font-size: 15px; font-weight: 900; color: var(--h4-melon-dk); }
.h4-melon__p { margin: 0 0 10px; font-size: 13px; line-height: 1.72; color: var(--h4-ink); }
.h4-melon__fine {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--h4-line);
  font-size: 11px;
  line-height: 1.58;
  color: var(--h4-muted);
  font-weight: 600;
}

.h4-rich {
  margin: 0 14px 18px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--h4-line);
}
.h4-rich__h { margin: 0 0 10px; font-size: 14px; font-weight: 900; }
.h4-rich__body { font-size: 14px; line-height: 1.75; color: #33483d; }

/* 播放 */
.h4-player { margin: 12px 14px; }
.h4-player__shell {
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid rgba(108, 154, 114, 0.45);
  background: #0f1411;
  min-height: 200px;
}
.h4-playing { margin: 10px 16px 0; }
.h4-playing__t { margin: 0 0 6px; font-size: 18px; font-weight: 900; }
.h4-playing__s { margin: 0; font-size: 13px; color: var(--h4-muted); font-weight: 600; }

/* 选集 */
.h4-plist { margin: 14px; padding: 14px; background: #fff; border-radius: 16px; border: 1px solid var(--h4-line); }
.h4-plist__hd { margin-bottom: 10px; }
.h4-plist__t { margin: 0 0 8px; font-size: 14px; font-weight: 900; }
.h4-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.h4-tab {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--h4-line);
  background: var(--h4-paper);
  font-weight: 800;
  font-size: 12px;
  color: var(--h4-muted);
  cursor: pointer;
}
.h4-tab.is-active { background: var(--h4-ink); color: #f4fdf6; border-color: var(--h4-ink); }
.h4-tab-panel { display: none; margin: 0; padding: 0; list-style: none; }
.h4-tab-panel.is-active { display: flex; flex-wrap: wrap; gap: 6px; }
.h4-ep li a {
  display: block;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  background: var(--h4-paper);
  border: 1px solid var(--h4-line);
  color: var(--h4-ink) !important;
  text-decoration: none !important;
}
.h4-ep li.is-active a { background: var(--h4-melon); border-color: var(--h4-melon-dk); color: #fff !important; }

.h4-band {
  margin: 18px 0 0;
  padding: 14px 0 8px;
  border-top: 1px solid var(--h4-line);
}
.h4-band__h { margin: 0 14px 10px; font-size: 15px; font-weight: 900; }

.h4-down { margin: 12px 14px; padding: 14px; background: #fff; border-radius: 14px; border: 1px solid var(--h4-line); }
.h4-down__h { margin: 0 0 8px; font-size: 14px; font-weight: 900; }
.h4-down__ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.h4-down__ul a {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--h4-paper);
  border: 1px solid var(--h4-line);
  font-weight: 800;
  font-size: 12px;
}

/* 搜索页 */
.h4-ss { margin: 16px 14px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--h4-line); }
.h4-ss__h { margin: 0 0 6px; font-size: 20px; font-weight: 900; }
.h4-ss__hint { margin: 0; font-size: 12px; color: var(--h4-muted); font-weight: 600; line-height: 1.55; }

/* 404 */
.h4-err { margin: 20px 14px; }
.h4-err__box {
  padding: 22px 16px;
  text-align: center;
  border-radius: 18px;
  background: #fff;
  border: 2px dashed rgba(196, 92, 62, 0.35);
}
.h4-err__code { margin: 0; font-size: 48px; font-weight: 900; color: var(--h4-rind); line-height: 1; }
.h4-err__h { margin: 10px 0; font-size: 18px; font-weight: 900; }
.h4-err__txt { margin: 0 0 14px; font-size: 13px; color: var(--h4-muted); line-height: 1.6; }
.h4-err__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.h4-err__btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
}
.h4-err__btn--pri {
  color: #fff !important;
  background: linear-gradient(180deg, var(--h4-melon), var(--h4-melon-dk));
  text-decoration: none !important;
}
.h4-err__btn--sec {
  color: var(--h4-ink) !important;
  background: var(--h4-paper);
  border: 1px solid var(--h4-line);
  text-decoration: none !important;
}
.h4-err__hint { margin: 14px 0 0; font-size: 11px; color: var(--h4-muted); }

/* MacPlayer 适配 */
.MacPlayer.embed-responsive { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; }
.MacPlayer.embed-responsive iframe, .MacPlayer.embed-responsive .player { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }
