/* ============================================================
   AVNight — 深色沉浸视频风 UI
   设计系统: 黑金主调 + 暗色分层 + 单个强调色(非紫) + 屏幕字体层级
   ============================================================ */
:root {
  /* 色彩系统 */
  --bg: #0a0c10;            /* 页面底 */
  --bg-elev1: #11141a;      /* 面板1 */
  --bg-elev2: #171b24;      /* 面板2 / 卡片 */
  --bg-hover: #1d2330;      /* hover */
  --border: #242b39;
  --border-strong: #323c4e;
  --text: #eceef4;          /* 主文本 */
  --text-dim: #9aa4b8;      /* 次要 */
  --text-faint: #677084;    /* 弱 */
  --accent: #d6a64f;        /* 黑金强调 */
  --accent-hover: #e6bd74;
  --accent-dim: rgba(214, 166, 79, .14);
  --green: #42b983;
  --orange: #e0944f;
  --red: #e05656;

  /* 字体(避免 system 默认为主; Inter 可用则用, 否则退 PingFang) */
  --font-display: "Bebas Neue", "Arial Narrow", Impact, "PingFang SC", sans-serif;
  --font-body: "Inter", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;               /* body ≥16px(可读性) */
  color: var(--text);
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== 顶栏品牌 ===== */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
  background: linear-gradient(180deg, #141821 0%, #0d1016 100%);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  font-family: var(--font-display);
  font-size: 30px; letter-spacing: 2px; color: #fff;
  text-transform: uppercase;
}
.topbar .brand b { color: var(--accent); font-weight: 700; }
.topbar .brand-sub { font-size: 12px; color: var(--text-faint); letter-spacing: .5px; align-self: flex-end; padding-bottom: 4px; }

/* ===== 布局: 左菜单 + 主区 ===== */
.layout { flex: 1; display: flex; min-height: 0; }
.site-menu {
  width: 208px; min-width: 208px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 10px;
  background: var(--bg-elev1);
  border-right: 1px solid var(--border);
}
.site-menu-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-faint); padding: 0 10px 6px;
}
.site-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim);
  cursor: pointer; font-family: var(--font-body); font-size: 14.5px; font-weight: 500;
  text-align: left; transition: background .15s, color .15s;
}
.site-item svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
.site-item:hover { background: var(--bg-hover); color: var(--text); }
.site-item.active { background: var(--accent-dim); color: var(--accent); }
.site-item.active svg { stroke: var(--accent); }

.site-main { flex: 1; display: flex; min-width: 0; min-height: 0; }
.site-panel { flex: 1; display: none; flex-direction: column; min-width: 0; min-height: 0; }
.site-panel.active { display: flex; }

/* ===== 逆向展示站: 文档 / 数据浏览 / 控制台 ===== */
.tabs { display: flex; gap: 2px; padding: 12px 16px 0; border-bottom: 1px solid var(--border); }
.tab-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border: none; border-bottom: 2px solid transparent;
  background: transparent; color: var(--text-dim); cursor: pointer;
  font-family: var(--font-body); font-size: 14px;
  transition: color .15s;
}
.tab-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-body { flex: 1; display: flex; min-height: 0; }
.tab-panel { display: none; flex: 1; }
.tab-panel.active { display: flex; }

.sidebar {
  width: 240px; min-width: 200px; overflow-y: auto;
  border-right: 1px solid var(--border); padding: 8px 0;
  background: var(--bg-elev1);
}
.sidebar .group { padding: 12px 16px 4px; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1px; }
.sidebar .item {
  padding: 7px 16px; cursor: pointer; font-size: 13px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid transparent;
}
.sidebar .item:hover { background: var(--bg-hover); color: var(--text); }
.sidebar .item.active { background: var(--accent-dim); color: var(--accent); border-left-color: var(--accent); }

.content { flex: 1; overflow: auto; padding: 18px 22px; }
.placeholder { color: var(--text-faint); padding: 70px 0; text-align: center; font-size: 14px; }
.grid-load { height: 100%; min-height: 240px; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 14px; letter-spacing: 1px; }
.console-panel { display: flex; flex-direction: column; }
.response-box {
  flex: 1; margin: 0 12px 14px; padding: 14px; background: #0c0e13; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-all; color: var(--text-dim);
}
.note { font-size: 12.5px; color: var(--text-faint); margin: 4px 12px 0; }
/* 方法标签: GET绿 / POST橙 */
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; margin-left: 8px; font-weight: 600; letter-spacing: .5px; }
.tag.GET, .tag.replay { background: rgba(66,185,131,.16); color: var(--green); }
.tag.POST { background: rgba(224,148,79,.16); color: var(--orange); }
.tag.live { background: rgba(214,166,79,.16); color: var(--accent); }
.param-row { display: flex; align-items: center; gap: 12px; margin: 8px 12px; }
.param-row label { width: 130px; font-size: 12.5px; color: var(--text-dim); }
.param-row label em { color: var(--orange); font-style: normal; }
.param-row input {
  flex: 1; padding: 8px 12px; background: #0c0e13; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-body); font-size: 13.5px;
}
.param-row input:focus { outline: none; border-color: var(--accent); }
#api-method { font-weight: 700; }
#api-path { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); }
button { font-family: inherit; }
#api-replay-btn, #api-live-btn {
  margin: 12px 0 0 12px; padding: 9px 22px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: filter .15s;
}
#api-replay-btn { background: var(--accent); color: #141006; }
#api-live-btn { background: var(--bg-elev2); border: 1px solid var(--border-strong); color: var(--text); }
#api-replay-btn:hover, #api-live-btn:hover { filter: brightness(1.08); }
#api-live-btn:disabled { background: var(--bg-hover); color: var(--text-faint); cursor: not-allowed; }

/* ===== 产品站: 子Tab + 内容卡片墙 ===== */
.sub-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 12px; border-bottom: 1px solid var(--border); align-items: center; }
.sub-tabs-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); margin-right: 6px; }
.sub-tab {
  padding: 6px 15px; border: 1px solid var(--border-strong); border-radius: 20px;
  background: transparent; color: var(--text-dim); cursor: pointer;
  font-family: var(--font-body); font-size: 13.5px; transition: all .15s;
}
.sub-tab:hover { color: var(--text); border-color: #45506a; }
.sub-tab.active { background: var(--accent); border-color: var(--accent); color: #141006; font-weight: 600; }

.card-grid {
  flex: 1; overflow-y: auto; padding: 18px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px;
  grid-auto-rows: max-content;   /* 修复: grid 隐式行被 min-content 压成 18px, 强制 max-content */
  align-content: start;
}
.card {
  display: flex; flex-direction: column; background: var(--bg-elev2);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.card-media { flex: none; width: 100%; height: 212px; background: #0c0e13; overflow: hidden; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.card:hover .card-media img { transform: scale(1.04); }
/* 封面占位(文字卡): 无图/加载失败渐变占位 — 非 emoji */
.card-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 20% 0%, #1a2030 0%, #0c0e13 70%);
  color: #333c4e; font-family: var(--font-display); font-size: 34px; letter-spacing: 2px;
}
.card-title { padding: 10px 12px 8px; font-size: 14px; color: var(--text); font-weight: 500; line-height: 1.4;
  height: calc(14px * 1.4 * 2 + 18px) !important; display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical !important; overflow: hidden !important; }
.card-sub { padding: 0 12px 4px; font-size: 12.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-code { padding: 2px 12px 10px; font-size: 12px; color: var(--accent); font-family: var(--font-mono); letter-spacing: .5px; }
.card-sub + .card-code { padding-top: 0; }

/* ===== 文档渲染(marked) ===== */
.doc-body { line-height: 1.75; font-size: 15px; }
.doc-body h1 { font-size: 26px; margin: 20px 0 12px; color: #fff; font-weight: 700; }
.doc-body h2 { font-size: 20px; margin: 18px 0 10px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.doc-body h3 { font-size: 16.5px; margin: 14px 0 8px; color: #dfe3ee; }
.doc-body p, .doc-body li { color: var(--text-dim); }
.doc-body code { background: var(--bg-elev2); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #f0a8a8; font-family: var(--font-mono); }
.doc-body pre { background: var(--bg-elev1); padding: 14px; border-radius: var(--radius); overflow-x: auto; margin: 12px 0; border: 1px solid var(--border); }
.doc-body pre code { background: none; padding: 0; color: var(--text-dim); }
.doc-body table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.doc-body th, .doc-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; font-size: 13.5px; }
.doc-body th { background: var(--bg-elev2); color: var(--text); }
.doc-body a { color: var(--accent); }
.doc-body a:visited { color: #a97ec4; }   /* visited 区分 */
.doc-body blockquote { border-left: 3px solid var(--accent); margin: 12px 0; padding: 6px 14px; color: var(--text-dim); background: var(--bg-elev1); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3344; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4560; }
::-webkit-scrollbar-track { background: transparent; }

/* 文字海报(无封面时的卡片占位) */
.card-media.has-poster {
  background:
    radial-gradient(120% 120% at 15% 0%, #232b3f 0%, #141926 45%, #0c0e13 100%);
}
.card-poster { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 14px 14px 12px; }
.poster-title {
  font-size: 16px; font-weight: 700; color: #fff; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 8px rgba(0,0,0,.65);
}
.poster-code { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: .5px; }

/* ===== AI中配 Tab 专门布局(chinese_dubbing) ===== */
.ai-wrap { padding: 22px 0 30px; grid-column: 1 / -1; width: 100%; max-width: 100%; }
.hero-section { padding: 20px 0 6px; }
.hero-title {
  font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: 1px;
  color: #fff; line-height: 1.2; display: inline-block; white-space: nowrap; vertical-align: baseline;
}
.hero-sub {
  display: inline-block; font-size: 15px; color: var(--accent); letter-spacing: .5px;
  margin-left: 14px; vertical-align: baseline; white-space: nowrap;
}
.hscroll {
  display: flex; gap: 14px; overflow-x: auto; padding: 16px 20px 8px; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
}
.hscroll::-webkit-scrollbar { display: none; height: 0; }
.hmedia-card {
  flex: 0 0 auto; width: 277px; scroll-snap-align: start; cursor: pointer;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  transition: border-color .15s;
}
.hmedia-card:hover { border-color: var(--accent); }
.hmedia-card .hm-img { height: 184px; background: #0c0e13; border-radius: 8px; overflow: hidden; position: relative; }
.hmedia-card .hm-img img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; background: #0c0e13; }
.hmedia-card .hm-fb { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 10px;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.7)); }
.hmedia-card .hm-fb span { font-size: 12px; color: #fff; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hmedia-card .hm-title { padding: 9px 10px; font-size: 13px; color: var(--text); line-height: 1.4;
  height: calc(13px * 1.4 * 2 + 18px) !important; display: -webkit-box !important; -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important; overflow: hidden !important; box-sizing: border-box; }
.hero-gap { height: 14px; }

/* 最新/最热/最推 三Tab */
.dub-tabs { display: flex; gap: 10px; padding: 16px 0 10px; border-bottom: 1px solid var(--border);
  align-items: center; }
.dub-tabs-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); margin-right: 4px; }
.dub-tab { padding: 8px 26px; border: 1px solid var(--border-strong); border-radius: 22px; background: transparent;
  color: var(--text-dim); cursor: pointer; font-size: 14.5px; font-weight: 500; transition: all .15s; font-family: var(--font-body); }
.dub-tab:hover { color: #fff; border-color: var(--accent); }
.dub-tab.active { background: var(--accent); border-color: var(--accent); color: #141006; font-weight: 700; }

/* 合集 item: 左图 + 右文字 + 下方横滑 videos */
.collection-list { display: flex; flex-direction: column; gap: 22px; padding: 14px 0 10px; }
.collection-item { background: var(--bg-elev1); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.ci-head { display: flex; gap: 14px; margin-bottom: 12px; }
.ci-media { flex: none; width: 88px; height: 60px; background: #0c0e13; border-radius: 6px; overflow: hidden; position: relative; }
.ci-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ci-media .ci-fb { position: absolute; inset: 0; background: linear-gradient(160deg,#232b3f,#0c0e13); }
.ci-info { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.ci-type { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .5px; }
.ci-title { font-size: 15px; color: #fff; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-height: calc(15px * 1.4 * 2); }
.ci-videos { display: flex; gap: 12px; overflow-x: auto; padding-top: 6px; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none; }
.ci-videos::-webkit-scrollbar { display: none; height: 0; }
.ci-video { flex: none; width: 277px; scroll-snap-align: start; cursor: pointer;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ci-video:hover { border-color: var(--accent); }
.ci-video .cv-img { height: 184px; background: #0c0e13; border-radius: 8px; overflow: hidden; position: relative; }
.ci-video .cv-img img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; background: #0c0e13; }
.ci-video .cv-img .cv-fb { position: absolute; inset: 0; background: linear-gradient(160deg,#232b3f,#0c0e13); }
.ci-video .cv-title { padding: 9px 9px; font-size: 12.5px; color: var(--text); line-height: 1.4;
  height: calc(12.5px * 1.4 * 2 + 18px) !important; display: -webkit-box !important; -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important; overflow: hidden !important; box-sizing: border-box; }
.ai-more { display: block; margin: 6px auto 20px; padding: 9px 30px; background: var(--bg-elev2);
  border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text-dim); cursor: pointer; font-size: 13.5px; }
.ai-more:hover { color: var(--text); border-color: var(--accent); }
/* 底部状态(add) */
.ai-end {
  min-height: 740px; width: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 15px; letter-spacing: 1px; gap: 8px;
}
.ai-end.done { color: var(--accent); min-height: 56px; }
.ai-end.err { color: var(--red); }
.ai-end.more { min-height: 60px; }

/* 全局去除图片加载中的默认白色边框(强制) */
img { border: 0 !important; outline: 0 !important; box-shadow: none !important; }
.card-media img, .hmedia-card .hm-img img, .ci-media img, .ci-video .cv-img img {
  border: 0 !important; outline: 0 !important; box-shadow: none !important; border-radius: 0; background: #0c0e13; }

/* 视频时长角标: 图片右下角, 距右/下各5px, 白字半透明底内边距小圆角 */
.dur-badge {
  position: absolute; right: 5px; bottom: 5px; z-index: 5;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 3px;
  font-variant-numeric: tabular-nums; letter-spacing: .3px;
}

/* ===== 视频详情页 overlay ===== */
.dub-detail { position: fixed; inset: 0; z-index: 200; background: #0a0c10; display: flex; flex-direction: column; overflow: hidden; }
.dd-back { align-self: flex-start; margin: 12px 16px; padding: 7px 16px; background: var(--bg-elev2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; font-size: 13px; }
.dd-back:hover { border-color: var(--accent); color: #fff; }
.dd-body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 0 16px 28px; min-height: 0;
  width: 100%; max-width: 1400px; margin: 0 auto; overflow-y: auto; }   /* 矮窗口可滚, 卡片不被视口裁 */
/* 播放器 高420(占满宽) */
.dd-player { position: relative; height: 420px; width: 100%; flex: none; background: #000; border-radius: 12px; overflow: hidden; }
.dd-player video, .dd-player img, video, img { border: 0 !important; outline: 0 !important; box-shadow: none !important; }
#dd-video, video { background: #000 !important; }
#dd-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.dd-playbtn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); color: #fff; font-size: 22px; letter-spacing: 1px; cursor: pointer; z-index: 3; transition: background .2s; }
.dd-playbtn:hover { background: rgba(0,0,0,.35); }
.dd-pstat { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #fff;
  font-size: 12.5px; z-index: 4; text-shadow: 0 1px 3px #000; }
/* 列表: 播放器下方, 横向滑动, 隐藏横滑条 */
.dd-side { flex: none; width: 100%; display: flex; flex-direction: row; gap: 10px; overflow-x: auto;
  align-items: flex-start; padding: 4px 4px 10px; margin-bottom: 20px; scrollbar-width: none; -ms-overflow-style: none; }
.dd-side::-webkit-scrollbar { display: none; height: 0; }
/* 右侧 item 190x210 */
/* 底部视频列表: 上图下文卡 (图184 = 275x184; 卡高自适应文字完整显示) */
.dd-item { flex: none; width: 279px; cursor: pointer; border-radius: 10px;
  background: transparent; border: 0; padding: 1px; }
/* hover 黄框落在内层卡(.dd-vcard)上, 四边完整可见 */
.dd-item:hover { border: 0; }
.dd-item.active { border: 0; }
.dd-mediatop { position: relative; width: 100%; height: 184px; background: #0c0e13; overflow: hidden; }
.dd-mediatop img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0 !important; }
.dd-mediatop .dd-mfb { position: absolute; inset: 0; background: linear-gradient(160deg,#232b3f,#0c0e13);
  display: flex; align-items: flex-end; color: #fff; font-size: 11px; padding: 8px; }
.dd-item-title { padding: 8px 9px; font-size: 12.5px; color: var(--text); line-height: 1.4; word-break: break-word;
  height: calc(12.5px * 1.4 * 2 + 16px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 详情页底部复用 dubVideoCard: 卡内 cv 图 277x184 */
.dd-item .dd-vcard { width: 277px; border-radius: 10px; overflow: hidden;
  background: var(--bg-elev2); border: 1px solid var(--border); transition: border-color .15s; }
.dd-item:hover .dd-vcard, .dd-item.active .dd-vcard { border-color: var(--accent); }   /* 单层黄框(去inset shadow避免重叠双线) */
.dd-item .dd-vcard .cv-img { width: 277px; height: 184px; border-radius: 0; }
.dd-item .dd-vcard .cv-title { display: block; padding: 9px 9px; font-size: 12.5px; color: var(--text);
  line-height: 1.4; word-break: break-word;
  height: calc(12.5px * 1.4 * 2 + 18px); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.dd-item-media { position: relative; width: 100%; height: 162px; background: #0c0e13; overflow: hidden; }
.dd-item-media img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0 !important; }
.dd-item-media .dd-fb { position: absolute; inset: 0; background: linear-gradient(160deg,#232b3f,#0c0e13); display: flex;
  align-items: flex-end; color: #fff; font-size: 11px; padding: 8px; }
.dd-item-media .dur-badge { position: absolute; right: 5px; bottom: 5px; z-index: 5; background: rgba(0,0,0,.55);
  color: #fff; font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 3px; }
.dd-item-title { padding: 8px 9px; font-size: 12.5px; color: var(--text); line-height: 1.4; word-break: break-word; }

/* 播放器封面层(未播放时显示被点卡片封面) */
.dd-coverwrap { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: #0a0c10; }
.dd-coverwrap img { width: 100%; height: 100%; object-fit: cover; border: 0 !important; }
.dd-coverwrap .dd-coverfb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 14px; }

/* ===== 详情页双Tab(视频/撸点助手) ===== */
.dd-tabs { display: flex; gap: 10px; padding: 4px 0 0; border-bottom: 1px solid var(--border); }
.dd-tab { padding: 9px 22px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-dim); font-size: 14px; cursor: pointer; }
.dd-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.dd-tabbody { flex: none; width: 100%; display: flex; flex-direction: column; gap: 16px; }
.dd-vtitle { margin: 4px 0 0; font-size: 17px; line-height: 1.45; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dd-btitle { font-size: 15.5px; font-weight: 600; color: var(--text); margin-bottom: 10px;
  border-left: 3px solid var(--accent); padding-left: 9px; }
.dd-hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.dd-hscroll::-webkit-scrollbar { display: none; height: 0; }
/* grid 与横滑卡尺寸统一: 固定 277 宽(与横滑卡一致), 列自适应数量, 左对齐流式 */
.dd-alt-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.dd-alt-grid .grid-card, .dd-alt-grid .ci-video { width: 277px !important; min-width: 0; }
.dd-alt-grid .grid-card .cv-img, .dd-alt-grid .ci-video .cv-img { width: 277px !important; height: 184px; }
.dd-alt-grid .grid-card:hover { border-color: var(--accent); }
.dd-mix-card { position: relative; flex: none; width: 277px; border-radius: 10px; overflow: hidden;
  background: var(--bg-elev2); border: 1px solid var(--border); cursor: pointer; }
.dd-mix-card:hover { border-color: var(--accent); }
.dd-mix-media { position: relative; width: 100%; height: 184px; background: #0c0e13; overflow: hidden; }
.dd-mix-media img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0 !important; }
.dd-mix-total { position: absolute; right: 5px; bottom: 5px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; padding: 3px 6px; border-radius: 3px; }
.dd-mix-title { padding: 9px 9px; font-size: 12.5px; color: var(--text); line-height: 1.4;
  height: calc(12.5px * 1.4 * 2 + 18px) !important; display: -webkit-box !important; -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important; overflow: hidden !important; box-sizing: border-box; }

/* 功能待开发覆盖层 */
.wip-overlay { position: fixed; inset: 0; z-index: 300; background: #0a0c10; display: flex; align-items: center; justify-content: center; }
.wip-box { text-align: center; }
.wip-icon { font-size: 52px; margin-bottom: 14px; }
.wip-text { font-size: 19px; color: var(--text); letter-spacing: 2px; margin-bottom: 26px; }
.wip-back { padding: 9px 34px; background: var(--bg-elev2); border: 1px solid var(--border-strong);
  border-radius: 8px; color: var(--text); cursor: pointer; font-size: 14px; }
.wip-back:hover { border-color: var(--accent); }

/* 统一: 所有卡标题最多2行, 超2行末尾省略号(要求) */
.cv-title, .dd-mix-title, .hm-title, .card-title, .ci-title, .dd-item-title {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
/* 若 -webkit-box 仍不生效, 用 max-height 物理限制 2 行(不再出现第 3 行) */
/* 加载占位(详情页 carousel 推荐加载中) */
.dd-plh { color: var(--text-faint); font-size: 13px; padding: 12px 2px; letter-spacing: .5px; }
/* 演员行: 胶囊线框包裹, 多位演员水平排列(横向排布, 溢出自动换行), 胶囊内头像+名字水平排列 */
.dd-actors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 4px 2px; }
.dd-actor { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px; cursor: default;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-elev2); width: fit-content; }
.dd-actor-av { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; display: none;
  background: #1a1f2a; border: 1px solid var(--border-strong); flex: none; }
.dd-actor-avfb { width: 27px; height: 27px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg,#2a324a,#141824); color: var(--accent); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border-strong); flex: none; }
.dd-actor-name { font-size: 12.5px; color: var(--text); white-space: nowrap; }
/* ===== 演员资料页(App 居中排布) ===== */
.actor-detail { position: fixed; inset: 0; z-index: 210; display: none; flex-direction: column;   /* > dub-detail(200), < wip(300) */
  background: var(--bg); overflow: hidden; }
.actor-body { flex: 1; overflow-y: auto; padding: 6px 16px 40px; }
.ac-head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 2px 16px; }
.ac-avwrap { width: 110px; height: 110px; position: relative; }
.ac-avatar { width: 110px; height: 110px; border-radius: 18px; overflow: hidden; position: relative;
  background: linear-gradient(150deg,#2a324a,#141824); border: 1px solid var(--border-strong); }
.ac-avatar img { width: 100%; height: 100%; object-fit: cover; display: none; }
.ac-avfb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 46px; font-weight: 700; }
.ac-name { font-family: var(--font-disp); font-size: 23px; font-weight: 700; color: #fff; letter-spacing: 1px; margin: 0;
  text-align: center; }
.ac-meta-line { font-size: 13px; color: var(--text-dim); letter-spacing: .5px; text-align: center; }
.ac-genres { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 6px 0 18px; }
.ac-tag { font-size: 12px; color: var(--text); background: var(--bg-elev2); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
/* 🔥本周淫幕亮点 横向滑动 */
.ac-week { margin: 2px 0 20px; }
.ac-week-title { font-size: 15px; font-weight: 700; color: #fff; padding: 4px 2px 10px; letter-spacing: .5px; }
.ac-week-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 6px;
  scrollbar-width: none; -ms-overflow-style: none; }
.ac-week-scroll::-webkit-scrollbar { display: none; height: 0; }
.ac-week-scroll .ci-video { flex: none; width: 277px; }   /* 与视频详情页横滑卡一致(277) */
/* 出演作品 Grid: 与视频详情页交替循环一致(flex wrap + 固定277 + gap16), 避免挤成一叠 */
.ac-grid { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 4px; }
.ac-grid .ci-video { width: 277px; min-width: 0; }
.ac-grid .ci-video .cv-img { width: 277px; height: 184px; }
.ac-end { text-align: center; color: var(--text-faint); font-size: 12.5px; padding: 16px 0 4px; letter-spacing: .5px; }
/* VIP 角标(卡片媒体右上) */
.vip-badge { position: absolute; top: 6px; right: 6px; z-index: 3; font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  color: #0b0e14; background: linear-gradient(135deg,#ffd76a,#f0b03c); border-radius: 4px; padding: 2px 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* Responsive shell: preserve the existing scroll containers and desktop layout. */
.tab-body, .tab-panel, .content { min-width: 0; min-height: 0; }

@media (max-width: 1024px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { height: 100%; height: 100dvh; }
  .topbar {
    flex-shrink: 0; gap: 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px))
      max(12px, env(safe-area-inset-right, 0px)) 10px
      max(12px, env(safe-area-inset-left, 0px));
  }
  .topbar .brand { font-size: 24px; }
  .layout { flex-direction: column; }
  .site-menu {
    order: 2; flex: none; flex-direction: row;
    width: 100%; min-width: 0; gap: 4px;
    padding: 4px max(8px, env(safe-area-inset-right, 0px))
      max(6px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    border-right: 0; border-top: 1px solid var(--border);
  }
  .site-menu-label { display: none; }
  .site-item {
    flex: 1; min-width: 0; min-height: 56px; padding: 6px 2px;
    flex-direction: column; justify-content: center; gap: 4px;
    font-size: 12px; text-align: center;
  }
  .site-item span { overflow-wrap: anywhere; }
  .site-main {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .tabs { flex: none; overflow-x: auto; padding: 0 8px; }
  .tab-btn { flex: none; min-height: 44px; gap: 5px; padding: 10px; white-space: nowrap; }
  .tab-panel { flex-direction: column; }
  .sidebar {
    flex: none; width: 100%; min-width: 0; height: 140px; max-height: 22vh;
    border-right: 0; border-bottom: 1px solid var(--border); padding: 4px 0;
  }
  .sidebar .item { min-height: 44px; padding: 12px; }
  .content { padding: 12px; overflow-wrap: anywhere; }
  .placeholder { padding: 32px 0; }
  .doc-body img { max-width: 100%; height: auto; }
  .doc-body h1 { font-size: 23px; }
  .doc-body table { display: block; max-width: 100%; overflow-x: auto; }
  .doc-body pre { max-width: 100%; }
  .param-row { flex-direction: column; align-items: stretch; gap: 6px; margin: 12px 0; }
  .param-row label { width: auto; }
  .param-row input { flex: none; width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
  .response-box { flex: 1 0 160px; margin: 12px 0 0; }
  #api-replay-btn, #api-live-btn { min-height: 44px; margin-left: 0; }
  .sub-tabs { flex: none; flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px; }
  .sub-tab, .sub-tabs-title { flex: none; white-space: nowrap; }
  .sub-tab, .dub-tab, .dd-tab, .ai-more, .wip-back { min-height: 44px; }
  .card-grid { min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .card { min-width: 0; }
  .card-media { height: auto; aspect-ratio: 3 / 4; }
  .hero-title { font-size: 24px; white-space: normal; }
  .hero-sub { display: block; margin: 6px 0 0; white-space: normal; }
  .ai-wrap { padding: 4px 0 18px; min-width: 0; }
  .hscroll { padding-left: 0; padding-right: 0; }
  .dub-tabs { overflow-x: auto; }
  .dub-tabs-label, .dub-tab { flex: none; white-space: nowrap; }
  .dub-tab { padding: 8px 18px; }
  .collection-item { min-width: 0; padding: 10px; }
  .ai-end { min-height: 180px; }
  .dub-detail, .actor-detail {
    height: 100%; height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-left: env(safe-area-inset-left, 0px);
  }
  .dd-back { flex: none; min-height: 44px; margin: 8px 12px; }
  .dd-body, .actor-body { min-width: 0; min-height: 0; padding: 0 12px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .dd-player { height: auto; aspect-ratio: 16 / 9; border-radius: 8px; }
  .dd-playbtn { font-size: 18px; }
  .dd-alt-grid, .ac-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dd-alt-grid .grid-card, .dd-alt-grid .ci-video, .ac-grid .ci-video { width: 100% !important; min-width: 0; }
  .dd-alt-grid .grid-card .cv-img, .dd-alt-grid .ci-video .cv-img, .ac-grid .ci-video .cv-img {
    width: 100% !important; height: auto; aspect-ratio: 3 / 2;
  }
  .wip-overlay { padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 0px); }
}

@media (max-width: 480px) {
  .topbar .brand-sub { display: none; }
}

@media (max-width: 1024px) and (max-height: 500px) {
  .sidebar { height: 88px; }
  .site-item { flex-direction: row; min-height: 44px; }
  .dd-player {
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}
