/* ==========================================================================
   抖音热点宝 · 视频详情页样式（T03）
   挂载于浮层 .dou-detail-body 内；全部 .dv-* 前缀，复用站点主题变量。
   ========================================================================== */

/* ---- 通用区块 ---- */
.dv-sec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.dv-sec-h {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.dv-hint { font-size: 11px; font-weight: 500; color: var(--text-3); }
.dv-hint b { color: var(--text-2); }
.dv-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 13px; }
.dv-note {
  font-size: 12px; color: var(--text-3); line-height: 1.7;
  padding: 2px 4px 4px; margin-bottom: 12px;
}
.dv-pub { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* 原始数据折叠（全量透传） */
.dv-raw { margin-top: 10px; }
.dv-raw > summary {
  cursor: pointer; font-size: 12px; color: var(--primary);
  user-select: none; list-style: none;
}
.dv-raw > summary::-webkit-details-marker { display: none; }
.dv-raw > summary::before { content: '▸ '; }
.dv-raw[open] > summary::before { content: '▾ '; }
.dv-raw pre {
  max-height: 260px; overflow: auto; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  font-size: 11px; line-height: 1.5; margin-top: 8px;
  color: var(--text-2); white-space: pre-wrap; word-break: break-all;
}

/* ---- 指标卡（数据趋势） ---- */
.dv-metrics {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px;
}
.dv-metric {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.dv-metric-v {
  font-size: 22px; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.dv-metric-l { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* ---- 折线图 ---- */
.dv-mtab { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.dv-chartwrap { position: relative; width: 100%; }
.dv-chart { width: 100%; height: auto; display: block; overflow: visible; }
.dv-chart .dv-grid { stroke: var(--border); stroke-width: 1; }
.dv-chart .dv-gridx { stroke-dasharray: 3 4; opacity: .55; }
.dv-chart .dv-ylbl,
.dv-chart .dv-xlbl { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.dv-chart .dv-hline { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 4; }
.dv-chart .dv-hdot { stroke: var(--surface); stroke-width: 1.5; }
.dv-chart .dv-hit { cursor: crosshair; }
.dv-tip {
  position: absolute; transform: translate(-50%, -130%);
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 5px 9px; font-size: 12px; line-height: 1.35;
  pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 1px; z-index: 3;
}
.dv-tip b { color: var(--text); font-variant-numeric: tabular-nums; }
.dv-tip span { color: var(--text-3); font-size: 11px; }
.dv-tip[hidden] { display: none; }   /* 作者 display:flex 会覆盖 UA 的 [hidden]，此处显式纠正 */

/* ---- 词云 ---- */
.dv-wc { width: 100%; height: auto; display: block; }
.dv-wc-t { font-weight: 700; cursor: default; }

/* ---- 评论列表 ---- */
.dv-comments { display: flex; flex-direction: column; }
.dv-comment {
  display: flex; gap: 10px; padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.dv-comment:last-child { border-bottom: 0; }
.dv-cav {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  flex: 0 0 36px; background: var(--bg-soft);
}
.dv-cbody { flex: 1; min-width: 0; }
.dv-cmeta { display: flex; gap: 8px; align-items: baseline; }
.dv-cnick { font-size: 13px; color: var(--text-2); font-weight: 600; }
.dv-ctime { font-size: 11px; color: var(--text-3); }
.dv-ctext {
  font-size: 14px; color: var(--text); line-height: 1.55;
  margin-top: 3px; word-break: break-word;
}
.dv-clike {
  font-size: 12px; color: var(--text-3); white-space: nowrap;
  display: flex; align-items: center; gap: 3px; padding-top: 4px;
}
.dv-clike .hb { color: var(--primary); font-size: 11px; }
.dv-more-wrap { margin-top: 12px; text-align: center; }
.dv-more {
  border: 1px solid var(--border-strong); background: var(--surface-hover);
  color: var(--text-2); border-radius: 999px; padding: 9px 22px;
  font-size: 13px; cursor: pointer; min-height: 40px;
}
.dv-more:hover { color: var(--text); border-color: var(--primary); }
.dv-more:disabled { opacity: .6; cursor: default; }

/* ---- 画像：组合图（柱状 + 折线，双 Y 轴） ---- */
.dv-combo { width: 100%; }
.dv-combo-legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 8px; font-size: 11.5px; color: var(--text-3);
}
.dv-lg-item { display: inline-flex; align-items: center; gap: 6px; }
.dv-lg-bar { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dv-lg-line { width: 16px; height: 3px; border-radius: 2px; display: inline-block; background: #f5c400; }
.dv-combo-plot { position: relative; width: 100%; }
.dv-combo-svg { width: 100%; height: auto; display: block; margin: 0 auto; overflow: visible; }
.dv-combo-svg .dv-combo-grid { stroke: var(--border); stroke-width: 1; }
.dv-combo-svg .dv-combo-base { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.dv-combo-svg .dv-combo-ax {
  fill: var(--text-3); font-size: 10.5px; font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.dv-combo-svg .dv-combo-axr { fill: var(--text-3); }
.dv-combo-svg .dv-combo-axtitle { fill: var(--text-3); font-size: 10px; font-weight: 700; }
.dv-combo-svg .dv-combo-bar { transition: opacity .15s; }
.dv-combo-svg .dv-combo-bar:hover { opacity: .85; }
.dv-combo-svg .dv-combo-line { stroke: #f5c400; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dv-combo-svg .dv-combo-dot { fill: #f5c400; stroke: var(--surface-solid); stroke-width: 1.5; }
.dv-combo-svg .dv-combo-guide { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.dv-combo-svg .dv-combo-focus { fill: var(--surface-solid); stroke: #f5c400; stroke-width: 2; }
.dv-combo-tip {
  position: absolute; transform: translate(-50%, -130%); pointer-events: none; z-index: 3;
  display: flex; flex-direction: column; gap: 1px; white-space: nowrap;
  padding: 5px 9px; border-radius: 8px; font-size: 12px; line-height: 1.35;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md);
}
.dv-combo-tip b { color: var(--text); }
.dv-combo-tip span { color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.dv-combo-tip[hidden] { display: none; }

/* ---- 画像：地域明细表（省份 / 占比 / TGI） ---- */
.dv-tbl-wrap { width: 100%; }
.dv-tbl-scroll { width: 100%; overflow-x: auto; }
.dv-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.dv-table thead th {
  text-align: right; font-weight: 700; color: var(--text-3); font-size: 11.5px;
  padding: 6px 8px; border-bottom: 1px solid var(--border-strong);
  white-space: nowrap; user-select: none;
}
.dv-table thead th.dv-th-name { text-align: left; }
.dv-table thead th.dv-th-val,
.dv-table thead th.dv-th-tgi { cursor: pointer; }
.dv-table thead th.dv-th-val:hover,
.dv-table thead th.dv-th-tgi:hover { color: var(--primary); }
.dv-table tbody tr { border-bottom: 1px solid var(--border); }
.dv-table tr.dv-brow { display: table-row; gap: 0; padding: 0; }   /* 覆盖旧 .dv-brow 的 grid 规则 */
.dv-table tbody tr:nth-child(even) { background: var(--bg-soft); }
.dv-table td { padding: 5px 8px; color: var(--text-2); }
.dv-td-name {
  text-align: left; color: var(--text); font-weight: 600;
  max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dv-td-val { text-align: right; color: var(--text); font-weight: 700; }
.dv-td-tgi { text-align: right; color: var(--text-3); }
.dv-td-tgi.up { color: #00c48c; }
.dv-td-tgi.down { color: #ff7a45; }
.dv-tbl-more {
  margin-top: 10px; min-height: 38px; padding: 7px 16px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--text-2); font-family: inherit; font-size: 12.5px; font-weight: 700;
}
.dv-tbl-more:hover { border-color: var(--primary); color: var(--primary); }

/* ---- 画像：地域「地图 + 表格」 ---- */
.dv-region {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
.dv-region-map, .dv-region-tbl { min-width: 0; }
.dv-map-wrap { position: relative; width: 100%; }
.dv-map { width: 100%; height: auto; display: block; }
.dv-map-prov { stroke: var(--bg); stroke-width: .6; transition: stroke .15s; cursor: default; }
.dv-map-prov.on { stroke: #fff; stroke-width: 1.2; }
.dv-map-jdx { fill: none; stroke: var(--text-2); stroke-width: 1.2; }
.dv-map-tip {
  position: absolute; transform: translate(-50%, -125%); pointer-events: none; z-index: 4;
  white-space: nowrap; padding: 4px 8px; border-radius: 7px; font-size: 11.5px;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md); color: var(--text); font-variant-numeric: tabular-nums;
}
.dv-map-tip[hidden] { display: none; }
.dv-map-legend { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--text-3); }
.dv-map-lg-bar { flex: 1 1 auto; height: 8px; border-radius: 4px; }
.dv-map-note { margin-top: 6px; font-size: 10.5px; color: var(--text-3); opacity: .8; line-height: 1.5; }
.dv-map-loading, .dv-map-fallback {
  padding: 40px 12px; text-align: center; font-size: 12px; color: var(--text-3);
  border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--bg-soft);
}
@media (max-width: 640px) {
  .dv-region { grid-template-columns: 1fr; gap: 12px; }
}

/* ---- 旧横向条形（保留兼容，供其它复用） ---- */
.dv-bars { display: flex; flex-direction: column; }
.dv-brow {
  display: grid; grid-template-columns: 92px 1fr 56px 48px;
  align-items: center; gap: 8px; padding: 5px 0;
}
.dv-bname {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--text-2);
}
.dv-btrack {
  height: 8px; background: var(--bg-soft); border-radius: 6px; overflow: hidden;
}
.dv-bfill {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), #ff7a9c);
}
.dv-bval {
  text-align: right; font-size: 12px; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dv-btgi {
  text-align: right; font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.dv-btgi.up { color: #00c48c; }
.dv-btgi.down { color: #ff7a45; }
.dv-brow-rest .dv-bname { color: var(--text-3); }

/* ---- 移动端适配 ---- */
@media (max-width: 560px) {
  /* 浮层头：标题单行省略，tab 换行，避免标题被挤压成竖排 */
  .dou-detail-head { flex-wrap: wrap; row-gap: 8px; }
  .dou-detail-ttl { flex: 1 1 auto; min-width: 0; }
  .dou-detail-ttl > span:nth-child(2) {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .dou-detail-ttl > span:last-child { display: none; }   /* 移动端隐藏 #id 徽标 */
  .dou-detail-tabs { flex: 1 1 100%; margin-left: 0; order: 3; }
  .dou-detail-close { order: 2; }

  .dv-sec { padding: 12px; border-radius: 12px; }
  .dv-metrics { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
  .dv-metric { padding: 10px; }
  .dv-metric-v { font-size: 18px; }
  .dv-table { font-size: 12px; }
  .dv-table thead th, .dv-table td { padding: 5px 6px; }
  .dv-td-name { max-width: 40%; }
  .dv-combo-legend { gap: 12px; }
  .dv-ctext { font-size: 13px; }
  .dv-cav { width: 30px; height: 30px; flex-basis: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .dv-bfill { transition: none; }
}
