/* 仅供屏幕阅读器使用的隐藏文字（不影响视觉呈现） */
.dg-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;
}

/* CSS Variables & Reset：token 实测自目标站（2026-10-01，见 docs/STYLE_CLONE_SOP.md 附录） */
:root {
  /* 主强调红：角标/hover 标题/轮播点/排名第一（目标站 #E50914） */
  --accent: #e50914;
  --accent-light: rgba(229, 9, 20, 0.14);
  --accent-hover: #ff2a14;
  --accent-active: #c20710;
  /* 目标站同色系的元件专用色，套版面时按元件对应，不要合并成 --accent */
  --accent-nav: #ff3300;
  --accent-login: #fe3355;
  --accent-tab: #ff3d5e;
  --grad-play: linear-gradient(to right, #ff711f, #e50914);
  --shadow-play: 0 10px 12px -4px rgba(229, 9, 20, 0.25);
  /* 更新集数徽章：目标站与主色同为 #E50914 */
  --accent-red: #e50914;
  --accent-red-light: rgba(229, 9, 20, 0.16);
  --accent-red-hover: #ff2a14;
  --accent-red-active: #c20710;
  --text: #e1e3e5;
  --text-muted: rgba(225, 227, 229, 0.6);
  --text-light: rgba(255, 255, 255, 0.87);
  /* 目标站页面底比面板浅：页面 #1A1C1F、侧栏/面板 #16161A */
  --bg: #1a1c1f;
  --bg-white: #16161a;
  --bg-light: #16161a;
  --bg-elev: #25252b;
  --bg-tag: #32323c;
  --bg-search: rgba(255, 255, 255, 0.08);
  --bg-modal: #16161a;
  --border: #25252b;
  --border-mid: #32323c;
  --radius: 8px;
  --radius-lg: 8px;
  /* 目标站几乎不用阴影，仅 tab 一层极淡描边阴影 */
  --shadow: 0 0 5px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 20px 15px -10px rgba(0, 0, 0, 0.2), 0 50px 35px -40px rgba(0, 0, 0, 0.4), 0 50px 35px -40px rgba(243, 2, 2, 0.2);
  --score-green: #6dd47e;
  /* 容器最大宽度：比照 Bootstrap 断点阶梯 (sm/md/lg/xl/xxl) */
  --max-w: 540px;
}

@media (min-width: 768px) {
  /* 768px 断点容器宽度调高，让 iPad 直向（768~834px 常见宽度）不会留白过多 */
  :root { --max-w: 760px; }
}
@media (min-width: 992px) {
  :root { --max-w: 960px; }
}
@media (min-width: 1200px) {
  :root { --max-w: 1140px; }
}
@media (min-width: 1400px) {
  :root { --max-w: 1320px; }
}
@media (min-width: 1600px) {
  /* 宽屏卡片网格加侧栏，容器需再放宽避免卡片过窄 */
  :root { --max-w: 1520px; }
}
@media (min-width: 1920px) {
  :root { --max-w: 1760px; }
}

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

.mac-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: middle;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system-font, system-ui, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  /* 挡首页头图 100vw 破格带出的水平滚动；放 body 而非 .dg-page-shell，避免 sticky header 失效 */
  overflow-x: hidden;
}

/* 只留入口、暂无功能的链接（如忘记密码）：不显示手型与 hover 效果 */
a[aria-disabled="true"] {
  cursor: default;
  pointer-events: none;
}

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

ul {
  list-style: none;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: url(../img/load.gif) no-repeat center/cover, var(--bg-elev);
}

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

.dg-page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* 让出固定的顶栏与左侧导览（见 HEADER 区） */
  padding: var(--topbar-h) 0 0 var(--sidebar-w);
}

/* 排除 sr-only（否则会盖掉它的 1px 宽、撑出水平滚动条）；:where 让权重维持一个 class，不压过侧栏/顶栏自己的宽度 */
.dg-page-shell > :where(:not(.dg-sr-only)) {
  width: 100%;
  min-width: 0;
}

/* ===== HEADER：左侧固定导览 + 顶栏（比照目标站 sidebar 版型） ===== */
:root {
  --sidebar-w: 200px;
  --topbar-h: 64px;
}

.dg-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--bg);
}

.dg-topbar {
  display: flex;
  align-items: center;
  height: 100%;
  padding-right: 40px;
}

/* logo 区与侧栏同底色、同宽，视觉上是侧栏的顶端 */
.dg-topbar-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: var(--sidebar-w);
  height: 100%;
  padding: 0 20px 0 30px;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
}

.dg-brand-block.dg-logo {
  display: block;
  width: 100%;
  height: 32px;
  overflow: hidden;
}

.dg-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  z-index: 90;
  width: var(--sidebar-w);
  padding: 0 15px 20px;
  overflow-y: auto;
  background: var(--bg-white);
  /* 边线用内阴影：overflow 会裁掉 border 那一栏，active 项目要能盖过边线接到内容区 */
  box-shadow: inset -1px 0 var(--border);
  scrollbar-width: none;
}

.dg-sidebar::-webkit-scrollbar {
  display: none;
}

.dg-side-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 50px;
  padding: 0 16px 0 26px;
  color: var(--text);
  font-size: 16px;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.dg-side-link span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 首页与功能连结 40px、分类 50px（目标站实测） */
.dg-side-link--icon {
  height: 40px;
  padding-left: 16px;
}

.dg-side-link .mac-icon {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  fill: currentColor;
}

/* 现役项换实心图示并套橘→红渐层（渐层定义在 public/icons.html 的 #dg-grad-nav；实心 symbol 已拿掉 path 自带的 fill 才能继承） */
.dg-side-link.dg-active .mac-icon {
  fill: url(#dg-grad-nav);
}

.dg-side-link:hover {
  color: var(--accent-nav);
}

/* 现役项向右延伸盖住侧栏边线，与内容区底色接成一片；上下各一个反向圆角，让侧栏边线弯进去（目标站「凹角」页签） */
.dg-side-link.dg-active {
  margin-right: -15px;
  color: var(--accent-nav);
  font-weight: 700;
  background: linear-gradient(to right, var(--bg-white), var(--bg) 90%);
}

.dg-side-link.dg-active::before,
.dg-side-link.dg-active::after {
  content: '';
  position: absolute;
  right: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.dg-side-link.dg-active::before {
  top: -20px;
  background: radial-gradient(circle at 0 0, var(--bg-white) 19px, var(--border) 19px, var(--border) 20px, var(--bg) 20.5px);
}

.dg-side-link.dg-active::after {
  bottom: -20px;
  background: radial-gradient(circle at 0 100%, var(--bg-white) 19px, var(--border) 19px, var(--border) 20px, var(--bg) 20.5px);
}

.dg-side-hr {
  height: 1px;
  margin: 10px 0;
  background: var(--border);
}

/* 页面切换读取条：header.js 控制 width/opacity，宽度变化需要 transition，
   opacity 淡出用较短时间避免完成后停留过久 */
.dg-page-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-active), var(--accent) 35%, var(--accent-hover) 65%, #ffd8a8);
  z-index: 200;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.2s ease;
}

.dg-page-progress.dg-is-active {
  opacity: 1;
}

.dg-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  flex-shrink: 0;
}

.dg-header-actions .dg-ha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 15px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.dg-header-actions .dg-ha-btn .mac-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dg-header-actions .dg-ha-btn:hover {
  color: var(--accent-nav);
  background: var(--bg-elev);
}

/* 登录按钮：红色实心胶囊（目标站 88x36、圆角 42px） */
.dg-header-actions .dg-ha-btn--pill {
  height: 36px;
  padding: 0 16px;
  border-radius: 42px;
  background: var(--accent-login);
  color: #fff;
}

.dg-header-actions .dg-ha-btn--pill:hover {
  background: var(--accent-hover);
  color: #fff;
}

@media (min-width: 768px) and (max-width: 1024px) {
  :root {
    --sidebar-w: 100px;
  }

  .dg-topbar {
    padding-right: 25px;
  }

  .dg-topbar-brand {
    padding: 0 12px;
  }

  .dg-sidebar {
    padding: 0 0 20px;
  }

  /* 平板侧栏窄，图示叠在文字上方置中 */
  .dg-side-link,
  .dg-side-link--icon {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    height: auto;
    padding: 12px 6px;
    border-radius: 0;
    font-size: 14px;
  }

  .dg-side-link.dg-active {
    margin: 0 0 0 16px;
  }

  .dg-side-hr {
    margin: 5px 15px;
  }

  .dg-header-actions .dg-ha-btn--text span {
    display: none;
  }

  .dg-header-actions .dg-ha-btn--text {
    width: 40px;
    padding: 0;
  }
}

/* 手机：侧栏改为顶部横向滚动导览列，logo 与大搜寻框置中排在下方 */
@media (max-width: 767px) {
  :root {
    --sidebar-w: 0px;
    --topbar-h: 0px;
  }

  .dg-sidebar {
    top: 0;
    right: 0;
    bottom: auto;
    z-index: 101;
    width: auto;
    height: 54px;
    padding: 5px 96px 5px 5px;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--bg);
    box-shadow: none;
  }

  .dg-side-list {
    display: flex;
  }

  .dg-side-hr,
  .dg-side-link .mac-icon {
    display: none;
  }

  .dg-side-link,
  .dg-side-link--icon {
    position: relative;
    height: 44px;
    padding: 0 10px;
    border-radius: 0;
    font-size: 16px;
  }

  .dg-side-link.dg-active {
    margin: 0;
    color: rgba(255, 255, 255, 0.87);
    background: none;
  }

  .dg-side-link.dg-active::before {
    display: none;
  }

  .dg-side-link.dg-active::after {
    top: auto;
    right: auto;
    left: 32.5%;
    bottom: 3px;
    width: 35%;
    height: 4px;
    border-radius: 5px;
    background: linear-gradient(90deg, #ff9800, #ff2a14);
  }

  /* 不建立堆叠情境，右上角 fixed 的 header actions 才能叠在侧栏导览列之上 */
  .dg-site-header {
    position: relative;
    z-index: auto;
    height: auto;
    padding: 74px 15px 20px;
  }

  .dg-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 0;
  }

  .dg-topbar-brand {
    justify-content: center;
    width: auto;
    height: 32px;
    padding: 0;
    background: none;
    border-right: 0;
  }

  .dg-brand-block.dg-logo {
    width: 150px;
  }

  /* 渐层底色遮住底下仍可横向滚动的导览文字 */
  .dg-header-actions {
    position: fixed;
    top: 5px;
    right: 0;
    z-index: 102;
    gap: 4px;
    height: 44px;
    padding: 0 5px 0 20px;
    background: linear-gradient(to right, transparent, var(--bg) 20px);
  }

  .dg-header-actions .dg-ha-btn {
    width: 40px;
    padding: 0;
  }

  .dg-header-actions .dg-ha-btn span {
    display: none;
  }

  .dg-header-actions .dg-ha-btn--pill {
    width: 36px;
    border-radius: 50%;
  }
}

/* ── 搜寻框：圆形玻璃感药丸搜寻栏 ── */
.dg-search-box {
  position: relative;
  flex: 0 1 580px;
  margin-left: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg-search);
  backdrop-filter: blur(6px);
  transition: background 0.15s;
}

.dg-search-box:focus-within {
  background: rgba(255, 255, 255, 0.16);
}

.dg-search-box input {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  padding: 0 46px 0 15px;
  outline: none;
  font-size: 14px;
  color: var(--text);
}

.dg-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.dg-search-submit-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  transition: color 0.15s;
}

.dg-search-submit-btn:hover {
  color: var(--accent);
}

.dg-search-submit-btn:active {
  color: var(--accent-active);
  transform: scale(0.95);
}

/* ===== 搜索下拉面板：历史搜索（localStorage）+ 热门搜索 ===== */
.dg-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: 260px;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 12px 14px;
  z-index: 20;
}
.dg-search-panel[hidden] { display: none; }

.dg-sp-block + .dg-sp-block { margin-top: 12px; }

.dg-sp-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.dg-sp-clear {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.dg-sp-clear:hover { color: var(--accent); }

/* 序列式列表：一行一条，左侧序号（见 skill 强制18.2，不做横排胶囊/标签云） */
.dg-sp-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dg-sp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius);
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.dg-sp-item:hover { background: var(--bg-elev); }
.dg-sp-num {
  min-width: 14px;
  font-size: 11px;
  color: var(--text-muted);
}

/* 热门搜索前三名比照排行榜 .dg-rank-badge--1/2/3 红/橙/黄配色；
   历史搜索是使用者自己的搜寻纪录（按时间新到旧排序，非热度排名），不套用此配色 */
[data-hot-list] li:nth-child(1) .dg-sp-num { color: #df0a25; }
[data-hot-list] li:nth-child(2) .dg-sp-num { color: #df642b; }
[data-hot-list] li:nth-child(3) .dg-sp-num { color: #fcc400; }
.dg-sp-word {
  font-size: 13px;
  color: var(--text-light);
  transition: color 0.15s;
}
.dg-sp-item:hover .dg-sp-word { color: var(--accent); }

@media (min-width: 768px) and (max-width: 1024px) {
  .dg-search-box {
    margin-left: 25px;
  }
}

@media (max-width: 767px) {
  .dg-search-box {
    flex: none;
    width: 100%;
    height: 50px;
    margin-left: 0;
  }

  .dg-search-box input {
    height: 50px;
  }
}

/* ===== 首页内容区 ===== */
/* 内容区左右留白比照目标站：桌机 40px／平板 25px／手机 15px */
.dg-home-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 30px 40px 20px;
}

/* ===== 分类区块日排行（index.md 强制2.3）：桌面态快捷导览，移动端隐藏 ===== */
.sh-dayrank {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 10px 0 20px;
  padding: 0 0 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.sh-dayrank::-webkit-scrollbar {
  display: none;
}

.sh-dayrank li {
  flex-shrink: 0;
  white-space: nowrap;
}

.sh-dayrank a {
  font-size: 12px;
  color: var(--text-muted);
}

.sh-dayrank a:hover {
  color: var(--accent);
}

@media (max-width: 767px) {
  .sh-dayrank {
    display: none;
  }
}

/* ===== 选集列表（widget/playlist，详情/播放页共用）：标题右侧为来源页签，页签与下方面板相接 ===== */
.dg-playlist .dg-module-hd {
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 0;
}

.dg-playlist .dg-module-title {
  align-self: center;
  margin-right: auto;
  font-size: 24px;
}

.dg-playlist-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--bg-elev);
  border-radius: var(--radius);
  background: none;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
}

.dg-playlist-sort:hover,
.dg-playlist-sort[aria-pressed="true"] {
  color: var(--accent);
}

.dg-playlist-sources {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dg-playlist-sources::-webkit-scrollbar {
  display: none;
}

.dg-playlist-sources > li {
  flex-shrink: 0;
}

.dg-source-tab {
  position: relative;
  flex-shrink: 0;
  height: 45px;
  padding: 0 15px;
  border: none;
  border-radius: 6px 6px 0 0;
  background: none;
  color: var(--text-light);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.dg-source-tab:hover {
  color: var(--text);
}

.dg-source-tab.dg-active {
  background: var(--bg-white);
  color: var(--accent-tab);
  font-weight: 700;
}

.dg-source-count {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--grad-play);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 15px;
}

.dg-playlist-empty {
  margin-top: 17px;
  padding: 24px 0;
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.dg-playlist-panel {
  display: none;
  padding: 20px;
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  background: var(--bg-white);
}

.dg-playlist-panel.dg-active {
  display: block;
}

/* 超过 380px 在框内滚动（需求方决定比照目标站，不用展开按钮） */
.dg-playlist-episodes-wrap {
  max-height: 380px;
  padding-right: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #666 transparent;
  scrollbar-width: thin;
}

.dg-playlist-episodes-wrap::-webkit-scrollbar {
  width: 5px;
}

.dg-playlist-episodes-wrap::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #666;
}

.dg-playlist-episodes {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

/* li 只做列表语义，让集数按钮撑满格子 */
.dg-playlist-episodes > li {
  display: grid;
  min-width: 0;
}

/* 长集名换行，不用省略号吞掉（强制8.2） */
.dg-episode {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--bg-elev);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
  transition: color 0.15s, border-color 0.15s;
}

.dg-episode:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.dg-episode.dg-active {
  border-color: transparent;
  background: var(--grad-play);
  color: #fff;
  font-weight: 700;
}

.dg-playlist-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin-top: 15px;
  padding: 8px 0;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
}

.dg-playlist-more:hover {
  color: var(--accent);
}

.dg-playlist-more[hidden] {
  display: none;
}

.dg-playlist-more[aria-expanded="true"] .mac-icon {
  transform: rotate(180deg);
}

.dg-playlist-episodes--long {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .dg-playlist-episodes {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .dg-playlist-episodes--long {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 手机：来源页签换到标题下一行、可横向滑动（强制8.3） */
@media (max-width: 767px) {
  .dg-playlist .dg-module-hd {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .dg-playlist .dg-module-title {
    font-size: 20px;
  }

  .dg-playlist-sources {
    order: 3;
    width: 100%;
  }

  .dg-source-tab {
    height: 40px;
    font-size: 13px;
  }

  .dg-playlist-panel {
    padding: 15px;
    border-radius: 0 var(--radius) var(--radius) var(--radius);
  }

  .dg-playlist-episodes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dg-playlist-episodes--long {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dg-episode {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 12px;
  }
}

/* ===== 热点资讯 ===== */
.dg-news-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
}

.dg-news-card {
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-white);
  box-shadow: var(--shadow);
  border-top: 2px solid var(--accent);
  transition: transform 0.2s;
}

.dg-news-card:hover {
  transform: translateY(-6px);
}

.dg-news-card a {
  display: block;
}

.dg-news-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  margin: 0;
  background: var(--bg-light) url('../img/load.gif') no-repeat center center;
  background-size: cover;
}

.dg-news-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dg-news-title-wrap {
  box-sizing: border-box;
  padding: 8px 10px 10px;
  /* max-height 用 border-box 计算（含 padding），精确等于 padding(8+10=18px) + 内容2行高度(12px*1.5*2=36px)，
     不依赖 -webkit-line-clamp 单独计算行数，避免不同浏览器对多行截断支援度不一致时内容溢出 */
  max-height: 54px;
  overflow: hidden;
}

.dg-news-card h3 {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: break-word;
}

/* ===== 影片卡片通用 ===== */

.dg-vod-card {
  position: relative;
  z-index: 1;
  flex: 0 0 calc((100% - 50px) / 6);
  min-width: 0;
}

.dg-vod-card a {
  display: block;
}

/* hover 详情由 widget/vod_card_popout 浮层呈现（skill 强制15）；卡片本身只做目标站的红色底光＋标题变色 */
@media (hover: hover) and (pointer: fine) {
  .dg-vod-card:hover {
    z-index: 50;
  }

  .dg-vod-card:hover .dg-vod-thumb {
    box-shadow: var(--shadow-card-hover);
  }

  .dg-vod-card:hover .dg-vod-name {
    color: var(--accent);
  }
}

/* 直版封面 5:7（目标站 178x250）；首页「正在热映」用 .dg-vod-grid--wide 改横版 */
.dg-vod-thumb {
  position: relative;
  aspect-ratio: 5/7;
  overflow: hidden;
  margin: 0;
  border-radius: var(--radius);
  background: var(--bg-elev) url('../img/load.gif') no-repeat center center;
  background-size: cover;
  transition: box-shadow 0.15s;
}

.dg-vod-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 集数/完结状态：封面底部置中白字＋淡渐层（目标站直版卡写法） */
.dg-vod-remarks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 50px 5px 10px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4));
}

.dg-vod-name {
  margin: 12px 0 0;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

/* ===== 影片卡片 hover 详情浮层（skill 强制15，样板 tp17/tp13）===== */
/* 边缘翻转 pop-left/pop-right 由 vod_card.js 在 mouseenter 时判定 */
.hover-popout {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 60;
  /* 至少比卡片大一圈：直版大卡时固定 300px 会比卡片还小 */
  width: max(300px, calc(100% + 40px));
  min-height: calc(100% + 30px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%) scale(0.6667);
  transform-origin: center center;
}

.hover-popout.pop-left {
  left: 0;
  transform: translate(0, -50%) scale(0.6667);
  transform-origin: left center;
}

.hover-popout.pop-right {
  left: auto;
  right: 0;
  transform: translate(0, -50%) scale(0.6667);
  transform-origin: right center;
}

@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .dg-vod-card:hover .hover-popout {
    display: flex;
    flex-direction: column;
    visibility: visible;
    pointer-events: auto;
    animation: popoutIn 0.25s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.15s;
  }

  .dg-vod-card:hover .hover-popout.pop-left {
    animation-name: popoutInLeft;
  }

  .dg-vod-card:hover .hover-popout.pop-right {
    animation-name: popoutInRight;
  }
}

@keyframes popoutIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6667); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes popoutInLeft {
  from { opacity: 0; transform: translate(0, -50%) scale(0.6667); }
  to { opacity: 1; transform: translate(0, -50%) scale(1); }
}

@keyframes popoutInRight {
  from { opacity: 0; transform: translate(0, -50%) scale(0.6667); }
  to { opacity: 1; transform: translate(0, -50%) scale(1); }
}

.popout-inner {
  position: relative;
  flex: 1;
  padding-bottom: 14px;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-white);
}

.hover-popout .popout-cover {
  position: relative;
  display: block;
  flex-grow: 1;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-elev);
}

.popout-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popout-cover-shadow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 70px;
  background: linear-gradient(rgba(0, 0, 0, 0), var(--bg-white));
}

.popout-title-wrap {
  position: relative;
  margin-top: -30px;
  padding: 0 14px;
}

.popout-title {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.popout-mix {
  padding: 10px 14px 0;
}

.popout-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
}

.popout-tag {
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius);
  font-size: 11px;
  line-height: 20px;
  white-space: nowrap;
}

.popout-tag--year {
  flex-shrink: 0;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.popout-tag--main {
  color: var(--accent);
  background: var(--accent-light);
}

.popout-tag--grey {
  color: var(--text-light);
  background: var(--bg-elev);
}

.popout-tag--plain {
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
}

.popout-label {
  color: var(--text-muted);
}

.popout-actor {
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.popout-desc {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.popout-score {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px 0;
  color: var(--text);
  font-size: 12px;
}

.popout-score .mac-icon,
.popout-score .score-num {
  color: #ffb200;
}

.popout-score .score-num {
  font-weight: 700;
}

/* ===== 影片文字列表（补充标题清单，桌机限定） ===== */

.dg-vlt-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
}

/* ===== 首页（比照目标站：轮播 → 正在热映 → 分类区块 → 排行榜） ===== */

/* 头图轮播：widget/home_hero（首页与分类频道页共用），home_hero.js 选取 data-hero-* */
.dg-hero {
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-white);
}

.dg-hero-track {
  display: flex;
  transition: transform 0.5s ease;
}

.dg-hero-slide {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 1160 / 403;
}

.dg-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

/* 桌机：右侧直版封面＋片名/集数/简介（目标站 sm-swiper 区，距右 100px、宽 220px） */
.dg-hero-info {
  position: absolute;
  top: 11%;
  right: 100px;
  width: 220px;
  padding: 0 17px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.dg-hero-poster {
  display: block;
  width: 126px;
  height: 168px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 5px;
  background: #373737;
}

.dg-hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dg-hero-title {
  margin: 14px 0 6px;
  overflow: hidden;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dg-hero-title a {
  color: #fff;
}

.dg-hero-remarks,
.dg-hero-blurb {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.dg-hero-remarks {
  margin-bottom: 4px;
}

.dg-hero-blurb {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 左右箭头夹在直版封面两侧（目标站白色 20px 圆钮） */
.dg-hero-arrow {
  position: absolute;
  top: 44.5%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #16161a;
  font-size: 12px;
  cursor: pointer;
}

.dg-hero-arrow--prev {
  right: 310px;
}

.dg-hero-arrow--next {
  right: 90px;
}

.dg-hero-dots {
  position: absolute;
  right: 100px;
  bottom: 8%;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 14px;
  width: 220px;
}

.dg-hero-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #000;
  opacity: 0.2;
  cursor: pointer;
  transition: width 0.25s, background 0.25s, opacity 0.25s;
}

.dg-hero-dot.dg-active {
  width: 16px;
  background: var(--accent);
  opacity: 1;
}

/* 区块（module）：中文标题 + 英文浮水印、右侧 tab 或「更多」 */
.dg-module {
  margin-bottom: 40px;
}

.dg-module-hd {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 34px;
  margin-bottom: 25px;
}

.dg-module-title {
  position: relative;
  flex-shrink: 0;
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.dg-module-title a {
  position: relative;
  z-index: 1;
  color: inherit;
}

/* 英文浮水印：叠在中文标题后方，透明→主色的竖向渐层字 */
.dg-module-title-en {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  opacity: 0.3;
  background: linear-gradient(to top, rgba(0, 0, 0, 0), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  pointer-events: none;
}

.dg-module-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  margin-left: auto;
  padding: 0 15px;
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text);
  font-size: 14px;
  transition: color 0.3s ease;
}

.dg-module-more:hover {
  color: var(--accent);
}

.dg-module-tabs-wrap {
  position: relative;
  min-width: 0;
  margin-left: auto;
}

/* 手机版才显示的「推荐 ▾」下拉钮 */
.dg-module-tabs-toggle {
  display: none;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 12px 0 15px;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.dg-module-tabs-toggle .mac-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.dg-module-tabs-wrap.dg-is-open .dg-module-tabs-toggle .mac-icon {
  transform: rotate(180deg);
}

.dg-module-tabs {
  display: flex;
  gap: 0;
  min-width: 0;
  padding: 3px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--bg-white);
  scrollbar-width: none;
}

.dg-module-tabs::-webkit-scrollbar {
  display: none;
}

.dg-module-tab {
  flex-shrink: 0;
  height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 34px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.dg-module-tab:hover {
  color: var(--accent-tab);
}

.dg-module-tab.dg-active {
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--accent-tab);
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* 影片卡网格：桌机/平板 6 栏、手机 3 栏（§12.1） */
.dg-vod-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 23px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-vod-grid[hidden] {
  display: none;
}

/* 横版卡（正在热映）：封面 4:3（需求方指定，目标站为 16:9.3）、集数改右上角红色胶囊 */
.dg-vod-grid--wide .dg-vod-thumb {
  aspect-ratio: 4 / 3;
}

.dg-vod-grid--wide .dg-vod-remarks {
  left: auto;
  right: 5px;
  top: 5px;
  bottom: auto;
  max-width: calc(100% - 10px);
  padding: 2px 8px;
  border-radius: 8px 7px 8px 8px;
  background: var(--accent);
}

/* 分类频道页大标题：「XX首页｜XX库」，现役项下方红色短条，整列底部 1px 分隔线（目标站实测） */
.dg-channel-hd {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 0 25px;
  padding: 0 0 20px;
}

.dg-channel-hd::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border);
}

.dg-channel-tab {
  position: relative;
  margin: 0;
  color: #a0a0a0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  transition: color 0.3s ease;
}

a.dg-channel-tab:hover,
.dg-channel-tab.dg-active {
  color: var(--text);
}

.dg-channel-tab.dg-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -20px;
  height: 4px;
  border-radius: 18px 18px 0 0;
  background: var(--accent);
}

.dg-channel-sep {
  width: 1px;
  height: 24px;
  margin: 0 16px;
  background: var(--border-mid);
}

/* 排行榜名次角标（卡片左上角，1/2/3 名红/橙/黄） */
.dg-vod-rank {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 40px;
  height: 50px;
  padding-left: 7px;
  border-top-left-radius: var(--radius);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 30px;
  font-style: italic;
  font-weight: 700;
  line-height: 48px;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 0 100%);
}

.dg-vod-rank--1 { background: var(--accent); }
.dg-vod-rank--2 { background: #ff7733; }
.dg-vod-rank--3 { background: #ffa82e; }

@media (max-width: 767px) {
  .dg-channel-hd {
    justify-content: center;
    margin: 0 -15px 15px;
    padding: 20px 0;
  }

  .dg-channel-tab {
    font-size: 18px;
  }

  .dg-channel-sep {
    height: 16px;
  }

  .dg-vod-rank {
    width: 32px;
    height: 40px;
    padding-left: 5px;
    font-size: 24px;
    line-height: 38px;
  }
}

/* 排行榜：每张榜卡沿用 widget/vodlist_rank，这里改成目标站「名次＋片名/备注＋箭头」样式 */
.dg-rank-paper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 23px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-rank-paper {
  min-width: 0;
  padding-bottom: 6px;
  border-radius: var(--radius);
  background: var(--bg-white);
}

.dg-rank-paper-title {
  position: relative;
  margin: 0;
  padding: 20px 15px 25px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.dg-rank-paper-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 12px;
  height: 4px;
  margin-left: -6px;
  border-radius: 2px;
  background: var(--text);
}

.dg-rank-paper-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-rank-paper .dg-vlt-rank-item {
  margin: 0 10px;
}

.dg-rank-paper .dg-vlt-rank-link {
  gap: 0;
  padding: 10px 0;
  border-radius: 0;
}

.dg-rank-paper .dg-vlt-rank-link:hover {
  background: none;
}

.dg-rank-paper .dg-vlt-rank-link::after {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin: 0 8px 0 6px;
  border-top: 1.5px solid var(--text);
  border-right: 1.5px solid var(--text);
  transform: rotate(45deg);
}

/* 名次：大号数字，1/2/3 名红/橙/黄、其余灰（目标站实测） */
.dg-rank-paper .dg-rank-badge {
  width: 50px;
  height: auto;
  background: none;
  border-radius: 0;
  color: #bcbcbc;
  font-size: 24px;
  font-style: italic;
  line-height: 1;
}

.dg-rank-paper .dg-rank-badge--1 { color: #e50914; }
.dg-rank-paper .dg-rank-badge--2 { color: #ff7733; }
.dg-rank-paper .dg-rank-badge--3 { color: #ffa82e; }

.dg-rank-paper .dg-vlt-rank-body {
  gap: 0;
}

.dg-rank-paper .dg-vlt-name {
  font-size: 14px;
  line-height: 1.6;
}

.dg-rank-paper .dg-vlt-rank-score,
.dg-rank-paper .dg-vlt-rank-tags,
.dg-rank-paper .dg-vlt-rank-hot {
  display: none;
}

.dg-rank-paper .dg-vlt-remarks {
  display: block;
  overflow: hidden;
  color: #9e9e9e;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 1299px) {
  /* 头图变矮放不下直版封面，改成目标站平板/手机的左下角文字叠层 */
  .dg-hero-info {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding: 50px 20px 34px;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
  }

  .dg-hero-poster {
    display: none;
  }

  .dg-hero-title {
    margin-top: 0;
  }

  .dg-hero-blurb {
    max-width: 480px;
  }

  .dg-hero-arrow {
    display: none;
  }

  .dg-hero-dots {
    right: 20px;
    bottom: 14px;
    width: auto;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .dg-module-title {
    font-size: 24px;
  }

  /* 平板卡片间距与手机版相同（需求方指定，不比照目标站的 18px 15px） */
  .dg-vod-grid {
    gap: 15px 10px;
  }

  /* 正在热映维持 6 栏（§12.1），卡片窄，角标与片名缩小：角标比照目标站平板 10px */
  .dg-vod-grid--wide .dg-vod-remarks {
    top: 4px;
    right: 4px;
    max-width: calc(100% - 8px);
    padding: 3px 7px 2px;
    font-size: 10px;
    line-height: 1.6;
  }

  .dg-vod-grid--wide .dg-vod-name {
    margin-top: 8px;
    font-size: 13px;
  }
}

@media (max-width: 767px) {
  .dg-hero-slide {
    aspect-ratio: 345 / 180;
  }

  .dg-hero-info {
    padding: 40px 10px 12px;
  }

  .dg-hero-title {
    font-size: 24px;
  }

  /* 目标站手机版头图不显示分页点，留着会压到简介文字 */
  .dg-hero-dots {
    display: none;
  }

  .dg-module {
    margin-bottom: 30px;
  }

  .dg-module-hd {
    gap: 12px;
    margin-bottom: 15px;
  }

  .dg-module-title {
    font-size: 20px;
  }

  /* 英文浮水印移到标题左上方（目标站手机版） */
  .dg-module-title-en {
    top: -14px;
    transform: none;
    font-size: 28px;
  }

  .dg-module-tabs-toggle {
    display: inline-flex;
  }

  .dg-module-tabs {
    display: none;
  }

  .dg-module-tabs-wrap.dg-is-open .dg-module-tabs {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-width: 120px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  .dg-module-tabs-wrap.dg-is-open .dg-module-tab {
    text-align: left;
  }

  .dg-vod-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px 10px;
  }

  .dg-vod-remarks {
    font-size: 10px;
  }

  /* 正在热映、排行榜改成单排横向滚动（目标站手机版），右侧露出下一张提示可滑 */
  .dg-vod-grid--wide,
  .dg-rank-paper-grid {
    display: flex;
    gap: 10px;
    margin-right: -15px;
    padding-right: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .dg-vod-grid--wide::-webkit-scrollbar,
  .dg-rank-paper-grid::-webkit-scrollbar {
    display: none;
  }

  .dg-vod-grid--wide > .dg-vod-card {
    flex: 0 0 150px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-elev);
    scroll-snap-align: start;
  }

  .dg-vod-grid--wide .dg-vod-thumb {
    border-radius: 0;
  }

  .dg-vod-grid--wide .dg-vod-name {
    margin: 0;
    padding: 8px 10px;
  }

  .dg-rank-paper-grid {
    gap: 15px;
  }

  .dg-rank-paper {
    flex: 0 0 255px;
    scroll-snap-align: start;
  }
}

/* ===== 资讯页共用（art/type + art/detail）：分类导览、两栏版面、侧栏区块 ===== */
/* 分类导览：横幅（深色渐层＋左下红色光晕），左侧标题，下方玻璃质感子分类胶囊；不放背景图，避免和下方轮播重复 */
.dg-art-tabs {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 150px;
  overflow: hidden;
  margin: 0 0 28px;
  padding: 22px 26px 18px;
  border-radius: 16px;
  background: var(--bg-white);
  isolation: isolate;
}

/* 左下角红色光晕 */
.dg-art-tabs::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 0 100%, rgba(229, 9, 20, 0.35), rgba(229, 9, 20, 0) 50%),
    linear-gradient(180deg, #1f1f25, var(--bg-white));
}

.dg-art-tabs-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.dg-art-tabs-kicker {
  color: var(--accent-tab);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

/* 在子分类时，小字是可点回的一级分类 */
.dg-art-tabs-kicker--link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: opacity 0.2s;
}

.dg-art-tabs-kicker--link:hover {
  opacity: 0.8;
}

.dg-art-tabs-title {
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.dg-art-tabs-list {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dg-art-tabs-list::-webkit-scrollbar {
  display: none;
}

.dg-art-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.dg-art-tab:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.dg-art-tab.dg-active {
  border-color: transparent;
  background: var(--grad-play);
  box-shadow: 0 6px 16px -6px rgba(229, 9, 20, 0.8);
  color: #fff;
  font-weight: 700;
}

@media (max-width: 767px) {
  .dg-art-tabs {
    gap: 12px;
    min-height: 120px;
    margin-bottom: 20px;
    padding: 16px 16px 14px;
    border-radius: 12px;
  }

  .dg-art-tabs-title {
    font-size: 22px;
  }

  .dg-art-tab {
    padding: 6px 13px;
    font-size: 13px;
  }
}

.dg-art-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 30px;
}

.dg-art-content {
  min-width: 0;
}

.dg-art-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.dg-art-side-block {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-white);
}

.dg-art-side-title {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

/* 首页排行榜卡在 ≤1299px 是横向滚动列里的固定宽卡片，放进侧栏时取消 */
.dg-art-side .dg-rank-paper {
  flex: none;
}

/* 侧栏 <1200px 改接在内容下方 */
@media (max-width: 1199px) {
  .dg-art-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dg-art-sb-read-list {
  margin: 0;
  padding: 6px 0;
}

.dg-art-sb-read-item {
  border-bottom: 1px solid var(--border);
}

.dg-art-sb-read-item:last-child {
  border-bottom: none;
}

.dg-art-sb-read-item a {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  align-items: flex-start;
  transition: background 0.15s;
}

.dg-art-sb-read-item a:hover {
  background: var(--bg-elev);
}

.dg-art-sb-read-thumb {
  width: 72px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0;
}

.dg-art-sb-read-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.dg-art-sb-read-item:hover .dg-art-sb-read-thumb img {
  transform: scale(1.05);
}

.dg-art-sb-read-info {
  flex: 1;
  min-width: 0;
}

.dg-art-sb-read-title {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 4px;
}

.dg-art-sb-read-item:hover .dg-art-sb-read-title {
  color: var(--accent);
}

.dg-art-sb-read-cat {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ===== 排行文字清单（大号编号 + 双行资讯，用于侧栏 + 总榜单） ===== */
.dg-vlt-rank-item {
  border-top: none;
  border-bottom: 1px solid var(--border);
}

.dg-vlt-rank-item:last-child {
  border-bottom: none;
}

.dg-vlt-rank-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 12px;
  overflow: hidden;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.dg-vlt-rank-link:hover {
  background: var(--accent-light);
}

/* 排名编号徽章：全站排行榜元件共用（排行榜页 Top1-3 + 侧栏/文字条列 1-N 名），
   1/2/3 名各自实测目标站红/橙/黄，其余名次为中性灰底色 */
.dg-rank-badge {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  background: var(--bg-elev);
  border-radius: var(--radius) var(--radius) var(--radius) 0;
}

.dg-rank-badge--1 { background: #df0a25; }
.dg-rank-badge--2 { background: #df642b; }
.dg-rank-badge--3 { background: #fcc400; }

.dg-vlt-rank-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dg-vlt-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dg-vlt-rank-link .dg-vlt-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text);
}

.dg-vlt-rank-link:hover .dg-vlt-name {
  color: var(--accent);
}

.dg-vlt-rank-score {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--score-green);
}

/* 标签胶囊列（地区/语言/年份，深色方块小标签） */
/* 备注只在首页排行榜（.dg-rank-paper）显示，其余排行清单维持地区/语言/年份标签 */
.dg-vlt-remarks {
  display: none;
}

.dg-vlt-rank-tags {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.dg-vlt-rank-tag {
  flex-shrink: 0;
  background: var(--bg-elev);
  color: var(--text-light);
  font-size: 11px;
  line-height: 1.8;
  padding: 0 7px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 88px;
}

.dg-vlt-rank-hot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.dg-vlt-rank-hot .mac-icon {
  width: 13px;
  height: 13px;
  color: var(--accent-red);
}

/* ===== 专题卡（widget/topic_card，首页与专题列表页共用）：16:9 封面，片名与简介叠在底部渐层上 ===== */
.dg-topic-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 23px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-topic-card {
  min-width: 0;
}

.dg-topic-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: box-shadow 0.3s;
}

.dg-topic-link:hover {
  box-shadow: var(--shadow-card-hover);
}

.dg-topic-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.dg-topic-link:hover .dg-topic-img {
  transform: scale(1.05);
}

.dg-topic-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 60%);
  pointer-events: none;
}

.dg-topic-count {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
}

.dg-topic-content {
  position: absolute;
  right: 12px;
  bottom: 10px;
  left: 12px;
  z-index: 2;
  color: #fff;
}

.dg-topic-name {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.dg-topic-link:hover .dg-topic-name {
  color: var(--accent-tab);
}

.dg-topic-blurb {
  margin: 2px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 1024px) {
  .dg-topic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px 10px;
  }
}

/* 手机 2 栏（§12.1 专题卡例外） */
@media (max-width: 767px) {
  .dg-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dg-topic-blurb {
    display: none;
  }
}

/* ===== 友情链接（首页底部，目标站：顶部 2px 分隔线、标题压在线上） ===== */
.dg-friend-links {
  position: relative;
  margin-top: 20px;
  padding: 25px 0 15px;
  border-top: 2px solid var(--border);
}

.dg-friend-links-title {
  position: absolute;
  left: 0;
  top: -13px;
  margin: 0;
  padding-right: 15px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
}

.dg-friend-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-friend-links-list a {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
}

.dg-friend-links-list a:hover {
  text-decoration: underline;
}

/* ===== Footer ===== */
.dg-site-footer {
  margin-top: auto;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
}

.dg-site-footer p,
.dg-site-footer address {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 2;
  font-style: normal;
}

.dg-footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.dg-footer-links a {
  font-size: 12px;
  color: var(--text-muted);
}

.dg-footer-links a:hover {
  color: var(--accent);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* ===== Hover 渐暗效果 ===== */
.dg-news-card,
.dg-vod-card {
  cursor: pointer;
}

.dg-news-card .dg-news-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s;
  pointer-events: none;
}

.dg-news-card:hover .dg-news-thumb::after {
  background: rgba(0, 0, 0, 0.25);
}

@keyframes catMenuIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 通用分页（widget/pagination 全站共用） ===== */
.dg-pagination {
  padding: 15px 0;
}

.dg-pagination-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-page-btn,
.dg-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
}

.dg-page-btn {
  padding: 0 18px;
}

.dg-page-btn:hover,
.dg-page-num:hover {
  color: var(--accent-tab);
}

.dg-page-num.dg-active {
  background: var(--accent-tab);
  color: #fff;
  font-weight: 700;
}

/* ===== RWD ===== */

/* ── 平板 768px ~ 1024px ── */
@media (max-width: 1024px) {
  /* 平板可用宽度较窄，箭头改叠加悬浮在卡片列上（不佔版面宽度），
     卡片列才能拉满整个 wrap 宽度 */

  .dg-home-content {
    padding: 30px 25px 20px;
  }

  .dg-vod-card {
    flex: 0 0 calc((100% - 20px) / 3);
  }

  .dg-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── 手机 < 768px ── */
@media (max-width: 767px) {
  .dg-home-content {
    padding: 0 15px 20px;
  }

  .dg-vod-card {
    flex: 0 0 calc((100% - 12px) / 3);
  }
}

/* ── 小手机 < 480px ── */
@media (max-width: 479px) {
  .dg-vod-card {
    flex: 0 0 calc((100% - 10px) / 3);
  }

  .dg-vod-name {
    margin-top: 8px;
    font-size: 12px;
  }
}

/* ===== 共用评论元件 ===== */
.dg-comment-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 14px;
}
.dg-cmt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dg-cmt-title { font-size: 14px; font-weight: 600; color: var(--text); }
.dg-cmt-count { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.dg-cmt-count em { color: var(--accent); font-style: normal; font-weight: 600; }

.dg-cmt-ajax-wrap { min-height: 60px; }
/* 覆写全站共用 home.css 里 .mac_comment 的写死白底/浅蓝边框（class 为 JS 挂钩须保留） */
.dg-comment-section .mac_comment {
  background: transparent;
  border-color: var(--border);
}
.dg-cmt-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
}
.dg-cmt-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* 评论列表 */
.dg-cmt-list { margin: 0 0 12px; padding: 0; }
.dg-cmt-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.dg-cmt-item:last-child { border-bottom: none; }
.dg-cmt-item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.dg-cmt-item-user { font-size: 13px; font-weight: 600; color: var(--text); }
.dg-cmt-item-time { font-size: 11px; color: var(--text-muted); }
.dg-cmt-item-content { font-size: 13px; color: var(--text-light); line-height: 1.7; }
.dg-cmt-item-reply-list {
  display: block;
  /* 缩排：让回复视觉上从属于上方留言，不跟留言本身等宽对齐 */
  margin: 0 0 0 16px;
  padding: 0;
  box-sizing: border-box;
}

.dg-cmt-item-reply {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  background: var(--bg-light);
  border-left: 3px solid var(--accent);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  border-radius: 0 4px 4px 0;
}
.dg-cmt-reply-label { font-weight: 600; color: var(--accent); }
.dg-cmt-item-actions { display: flex; gap: 12px; margin-top: 6px; }
.dg-cmt-action-link {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.dg-cmt-action-link:hover { color: var(--accent); }
.dg-cmt-action-link.disabled { opacity: 0.5; pointer-events: none; }

.dg-cmt-paging {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 0 0;
  list-style: none;
}
.dg-cmt-page-btn {
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.dg-cmt-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.dg-cmt-page-btn.dg-is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dg-cmt-page-btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* 输入表单 */
.dg-cmt-textarea {
  display: block;
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--border-mid);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  resize: none;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--bg-light);
  transition: border-color 0.15s, background 0.15s;
}
.dg-cmt-textarea:focus { border-color: var(--accent); background: var(--bg-elev); }
.dg-cmt-textarea:focus + .dg-cmt-form-bar {
  border-color: var(--accent);
  border-top-color: var(--border);
}
.dg-cmt-form-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-light);
  border: 1px solid var(--border-mid);
  border-top: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  padding: 10px 14px;
  transition: border-color 0.15s;
}
.dg-cmt-chars { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.dg-cmt-chars em { font-style: normal; color: var(--accent); font-weight: 600; }
.dg-cmt-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dg-cmt-verify-input {
  width: 88px;
  height: 34px;
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  padding: 0 8px;
  font-size: 13px;
  color: #000;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.dg-cmt-verify-input:focus { border-color: var(--accent); }
.dg-cmt-captcha {
  height: 34px;
  width: auto;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-mid);
  display: block;
}
.dg-cmt-submit {
  height: 34px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.dg-cmt-submit:hover { background: var(--accent-active); }

@media (max-width: 767px) {
  .dg-comment-section {
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    border-bottom: 8px solid var(--bg-light);
    padding: 14px;
  }
  .dg-cmt-form-bar { flex-wrap: wrap; }
  .dg-cmt-chars { order: 2; }
  .dg-cmt-actions { order: 1; width: 100%; justify-content: flex-end; }
  .dg-cmt-verify-input { width: 80px; }
}

/* ── Login Modal ── */
.dg-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.dg-modal-overlay.dg-is-open { display: flex; }

.dg-modal-box {
  background: var(--bg-modal);
  border-radius: 14px;
  padding: 36px 32px 28px;
  width: 90%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.dg-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}
.dg-modal-close:hover { color: var(--text); }

.dg-modal-title {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
}

.dg-modal-field { margin-bottom: 20px; }

.dg-modal-label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.dg-modal-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border-mid);
  padding: 8px 0;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  outline: none;
  transition: border-color 0.2s;
}
.dg-modal-input:focus { border-bottom-color: var(--accent); }
.dg-modal-input::placeholder { color: var(--text-muted); }
.dg-modal-verify { display: flex; align-items: center; gap: 10px; }
.dg-modal-verify .dg-modal-input { flex: 1; min-width: 0; }
.dg-modal-captcha { flex-shrink: 0; width: 100px; height: 36px; border-radius: 4px; cursor: pointer; object-fit: contain; }

.dg-modal-submit {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}
.dg-modal-submit:hover { background: var(--accent-active); }

.dg-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.dg-modal-link { color: var(--text-muted); }
.dg-modal-link--accent { color: var(--accent); font-weight: 500; }
.dg-modal-link--accent:hover { text-decoration: underline; }

/* ── 系统弹窗（MAC.Pop，home.js 动态注入，样式写死为白底）覆写为深色风格 ── */
/* 播放器 iframe 自带 z-index:99998，弹窗要盖过它 */
.mac_pop_bg,
.mac_pop_msg_bg {
  z-index: 100000 !important;
  background: rgba(0, 0, 0, 0.55);
}

.mac_pop,
.mac_pop_msg {
  z-index: 100001 !important;
  background-color: var(--bg-modal);
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.mac_pop .pop_top {
  border-bottom-color: var(--border);
}

.mac_pop .pop_top h2 {
  color: var(--text);
  font-family: inherit;
}

.mac_pop span.pop_close {
  background: none;
  text-indent: 0;
  font-size: 20px;
  line-height: 23px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.15s;
}
.mac_pop span.pop_close:hover { color: var(--accent); }

.mac_pop .pop-foot {
  border-top-color: var(--border);
}

.mac_pop .pop-ok {
  background-color: var(--accent);
}
.mac_pop .pop-cancel {
  background-color: transparent;
  border-color: var(--border-mid);
  color: var(--text);
}

.mac_pop .pop-msg,
.mac_pop_msg .pop-msg {
  color: var(--text);
}

.mac_pop {
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  right: auto !important;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 32px) !important;
  height: auto !important;
  display: flex;
  flex-direction: column;
}

.mac_pop .pop_content {
  flex: 1 1 auto;
  overflow-y: auto;
}

.mac_pop_msg {
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  right: auto !important;
  transform: translate(-50%, -50%);
  width: auto !important;
  height: auto !important;
  min-width: 120px;
  max-width: min(80vw, 360px);
  padding: 18px 24px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ── MacCMS 内建 history dropdown（文字列表）隐藏，改用自订带图 modal ── */
.mac_history_box { display: none !important; }

/* ── 历史记录 Modal ── */
.dg-hm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dg-hm-overlay.dg-is-open { display: flex; }

.dg-hm-box {
  background: var(--bg-modal);
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.dg-hm-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dg-hm-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.dg-hm-clear {
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.dg-hm-clear:hover { color: var(--accent); }
.dg-hm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--bg);
  border: 1px solid var(--border-mid);
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.dg-hm-close:hover { background: var(--border); color: var(--text); }

.dg-hm-body {
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}
.dg-hm-body::-webkit-scrollbar { width: 4px; }
.dg-hm-body::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

.dg-hm-card {
  /* 6 per row */
  flex: 0 0 calc((100% - 50px) / 6);
  min-width: 0;
  display: block;
  text-decoration: none;
  color: var(--text);
  align-self: flex-start;
}
.dg-hm-thumb {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg);
  /* 让 img absolute 定位有基准，防止图片撑开 grid row */
  contain: strict;
}
.dg-hm-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.dg-hm-card:hover .dg-hm-thumb img { transform: scale(1.04); }
.dg-hm-card:hover .dg-hm-name { color: var(--accent); }

.dg-hm-name {
  font-size: 11px;
  margin-top: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-light);
  transition: color 0.15s;
}
.dg-hm-empty {
  width: 100%;
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 767px) {
  .dg-hm-box { border-radius: 16px; max-height: 85vh; align-self: center; }
  .dg-hm-overlay { padding: 0 12px; align-items: flex-end; }
  /* 3 per row */
  .dg-hm-card { flex: 0 0 calc((100% - 20px) / 3); }
}

/* ===== 详情页基础信息（widget/detail_hero，详情/下载页共用）=====
   桌机：标题 + tag 在上、资讯面板在下，海报压在右上角；手机：模糊海报底 + 置中海报 + 卡片 */
.dg-vd-hero {
  position: relative;
  margin-bottom: 40px;
}

.dg-vd-backdrop {
  display: none;
}

.dg-vd-poster {
  position: absolute;
  top: 0;
  right: 25px;
  z-index: 2;
  width: 220px;
  aspect-ratio: 5 / 7;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-card-hover);
}

.dg-vd-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dg-vd-head {
  position: relative;
  margin: 0 0 20px 25px;
  padding-right: 270px;
}

/* 标题左侧红条 + 往下延伸的虚线 */
.dg-vd-head::before,
.dg-vd-head::after {
  content: "";
  position: absolute;
  left: -25px;
}

.dg-vd-head::before {
  top: 0;
  width: 5px;
  height: 40px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.dg-vd-head::after {
  top: 40px;
  bottom: -20px;
  border-left: 1px dashed var(--text-muted);
}

.dg-vd-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 30px;
  font-weight: 700;
  line-height: 40px;
}

.dg-vd-title-sub {
  margin-left: 10px;
  color: var(--text-muted);
  font-size: 0.6em;
  font-weight: 400;
}

.dg-vd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dg-vd-tag {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--bg-elev);
  border-radius: var(--radius);
  background: var(--bg-tag);
  color: var(--text);
  font-size: 14px;
  line-height: 28px;
  white-space: nowrap;
}

.dg-vd-tag a,
.dg-vd-names a,
.dg-vd-crumbs a {
  color: var(--text);
}

.dg-vd-tag a:hover,
.dg-vd-names a:hover,
.dg-vd-crumbs a:hover {
  color: var(--accent-tab);
}

.dg-vd-tag a + a::before,
.dg-vd-names a + a::before {
  content: "/";
  margin: 0 6px;
  color: var(--text-muted);
}

.dg-vd-card {
  position: relative;
  padding: 20px 270px 0 25px;
  border-radius: 0 18px 18px 18px;
  background: var(--bg-white);
}

.dg-vd-intro {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--bg-elev);
}

.dg-vd-meta {
  margin: 0;
}

.dg-vd-meta-row {
  display: flex;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 22px;
}

/* dt 偏灰、dd 正文色（decisions 详情页 dt/dd） */
.dg-vd-meta-row dt {
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 700;
}

.dg-vd-meta-row dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
}

.dg-vd-names--clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.dg-vd-crumbs span {
  margin: 0 6px;
  color: var(--text-muted);
}

.dg-vd-status--serial {
  color: var(--accent-tab);
  font-weight: 700;
}

.dg-vd-meta-row--rate dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.dg-vd-score {
  color: var(--score-green);
  font-weight: 700;
}

.dg-rate-label {
  color: var(--text-muted);
  font-size: 13px;
}

.dg-rate-stars {
  display: inline-flex;
  gap: 2px;
}

.dg-rs {
  padding: 0 1px;
  border: none;
  background: none;
  color: var(--bg-tag);
  font-size: 18px;
  line-height: 22px;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}

.dg-rs:hover {
  transform: scale(1.15);
}

.dg-rs.dg-rs-on {
  color: #ffb400;
}

/* 按钮列横跨整张面板，用负外距抵销面板左右内距 */
.dg-vd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px -270px 0 -25px;
  padding: 20px 25px 25px;
  border-top: 1px solid var(--bg-elev);
}

.dg-vd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 30px;
  border: none;
  border-radius: 50px;
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s;
}

.dg-vd-btn--play {
  background: var(--grad-play);
  box-shadow: var(--shadow-play);
  font-weight: 700;
}

.dg-vd-btn--play:hover {
  opacity: 0.9;
}

.dg-vd-btn--sub {
  background: var(--bg-elev);
  color: var(--text);
}

.dg-vd-btn--sub:hover {
  color: var(--accent-tab);
}

@media (min-width: 768px) and (max-width: 1024px) {
  .dg-vd-poster {
    right: 15px;
    width: 140px;
  }

  .dg-vd-head {
    padding-right: 170px;
  }

  .dg-vd-title {
    font-size: 24px;
    line-height: 34px;
  }

  .dg-vd-card {
    padding-right: 170px;
  }

  .dg-vd-actions {
    margin-right: -170px;
  }
}

@media (max-width: 767px) {
  .dg-vd-backdrop {
    display: block;
    position: absolute;
    top: -40px;
    left: 50%;
    z-index: 0;
    width: 100vw;
    height: 420px;
    overflow: hidden;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .dg-vd-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    filter: blur(20px);
    transform: scale(1.2);
  }

  .dg-vd-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(26, 28, 31, 0), var(--bg) 85%);
  }

  .dg-vd-poster {
    position: relative;
    top: auto;
    right: auto;
    width: 170px;
    margin: 0 auto -58px;
  }

  .dg-vd-body {
    position: relative;
    z-index: 1;
    padding: 78px 20px 20px;
    border-radius: 18px 18px var(--radius) var(--radius);
    background: var(--bg-elev);
  }

  .dg-vd-head {
    margin: 0;
    padding: 0;
    text-align: center;
  }

  .dg-vd-head::before,
  .dg-vd-head::after {
    display: none;
  }

  .dg-vd-title {
    font-size: 24px;
    line-height: 34px;
  }

  .dg-vd-tags {
    justify-content: center;
  }

  .dg-vd-tag {
    border-color: var(--bg-tag);
  }

  .dg-vd-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 0;
    background: none;
  }

  .dg-vd-actions {
    order: -1;
    justify-content: center;
    margin: 20px 0;
    padding: 0;
    border: none;
  }

  .dg-vd-btn {
    padding: 0 22px;
  }

  .dg-vd-btn--sub {
    background: var(--bg-tag);
  }

  .dg-vd-intro {
    border-bottom-color: var(--bg-tag);
  }
}

/* ===== 剧情介绍展开/收合（widget/desc_expand）：两段之间留间距（强制7.3），超过 3 行才显示「展开全部」 ===== */
.dg-desc-body {
  position: relative;
  max-height: calc(14px * 1.6 * 3 + 10px);
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.dg-desc-body * {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important;
  font-size: inherit !important;
  font-family: inherit !important;
}

.dg-desc-body p {
  margin: 0 0 10px;
}

.dg-desc-body p:last-child {
  margin-bottom: 0;
}

.dg-desc-body.dg-desc-expanded {
  max-height: none;
}

.dg-desc-body.dg-desc-collapsed.dg-desc-has-more::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 30px;
  background: linear-gradient(rgba(22, 22, 26, 0), var(--bg-white));
  pointer-events: none;
}

.dg-desc-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-tab);
  font-size: 13px;
  cursor: pointer;
}

@media (max-width: 767px) {
  .dg-desc-body.dg-desc-collapsed.dg-desc-has-more::after {
    background: linear-gradient(rgba(37, 37, 43, 0), var(--bg-elev));
  }
}

/* ===== 漂浮功能按钮 (Floating Action Buttons) ===== */
.dg-fab-group {
  position: fixed;
  bottom: 30px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  width: auto;
}
.dg-fab-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 85, 102, 0.4), 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  cursor: pointer;
  border: none;
}
.dg-fab-btn:hover {
  background: var(--accent-active);
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 28px rgba(255, 85, 102, 0.5), 0 2px 10px rgba(0,0,0,0.16);
}
.dg-fab-btn--top { opacity: 0; pointer-events: none; }
.dg-fab-btn--top.dg-is-visible { opacity: 1; pointer-events: auto; }
.dg-fab-qr-popup {
  position: fixed;
  bottom: 160px;
  right: 24px;
  z-index: 400;
  display: none;
  width: auto;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: center;
}
.dg-fab-qr-popup.dg-is-open { display: block; }
.dg-fab-qr-popup p { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.dg-fab-qr-popup img { width: 130px; height: 130px; border-radius: 4px; background: #fff; display: block; }

@media (max-width: 767px) {
  .dg-fab-group { bottom: 76px; right: 14px; }
  .dg-fab-qr-popup { bottom: 146px; right: 14px; }
}
@media (max-width: 1024px) {
  .dg-fab-btn--qr { display: none; }
}

/* ===== 通用 Toast 提示（全站共用：分享复制链接、评分成功等短暂提示）===== */
.dg-rate-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 24px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
}
.dg-rate-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 当前位置 / 面包屑（共用 widget/breadcrumb，详情页 + 播放页共用） ===== */
.dg-vd-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.dg-vd-breadcrumb .mac-icon {
  font-size: 11px;
  color: var(--text-muted);
}
.dg-vd-breadcrumb a {
  color: var(--text-light);
}
.dg-vd-breadcrumb a:hover {
  color: var(--accent);
}
.dg-vd-bc-current {
  color: var(--text-muted);
}
.dg-vd-bc-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.dg-vd-bc-list li {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 479px) {
  .dg-vd-breadcrumb { margin-bottom: 14px; gap: 7px; }
  .dg-vd-bc-list, .dg-vd-bc-list li { gap: 7px; }
}
@media (min-width: 480px) and (max-width: 767px) {
  .dg-vd-breadcrumb { margin-bottom: 16px; gap: 7px; }
  .dg-vd-bc-list, .dg-vd-bc-list li { gap: 7px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .dg-vd-breadcrumb { margin-bottom: 20px; gap: 7px; }
  .dg-vd-bc-list, .dg-vd-bc-list li { gap: 7px; }
}

/* ===== 简单面包屑（专题列表/专题详情/留言板/排行榜等纯文字层级页面共用，见 decisions.md 全局-面包屑） ===== */
.dg-simple-breadcrumb {
  margin-bottom: 16px;
}
.dg-simple-breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.dg-simple-breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dg-simple-breadcrumb li:not(:last-child)::after {
  content: '›';
}
.dg-simple-breadcrumb a {
  color: var(--text-light);
}
.dg-simple-breadcrumb a:hover {
  color: var(--accent);
}
.dg-simple-breadcrumb li[aria-current="page"] {
  color: var(--text-muted);
}
@media (min-width: 1025px) {
  .dg-vd-breadcrumb { margin-bottom: 24px; gap: 7px; }
  .dg-vd-bc-list, .dg-vd-bc-list li { gap: 7px; }
}
@media (max-width: 767px) {
  .dg-vd-breadcrumb { font-size: 12px; }
}
