/* ============================================================================
 * TradeVisual · 全站移动端适配（≤768px）
 * 设计参考：TradingView / 同花顺 移动端
 *
 * 设计规范（Design tokens）
 *   字号阶梯：10 / 11 / 12 / 13(正文) / 15(小标题) / 18(强调) / 22(数字强调)
 *   间距阶梯：4 / 6 / 8 / 12 / 16
 *   触控目标：交互元素最小高度 40px
 *   圆角：6（控件）/ 10（卡片）/ 12（容器）
 *   主色：#2563eb 蓝；A 股口径 红涨 #dc2626 / 绿(蓝)跌 #1d4ed8
 *   分段控件（segmented）、可横滑表格、底部安全区
 * ========================================================================== */

@media (max-width: 768px) {
  :root {
    --tv-gap: 12px;
    --tv-radius: 10px;
  }

  html { -webkit-text-size-adjust: 100%; }

  /* 防止整页横向溢出 */
  html, body { max-width: 100%; overflow-x: hidden; }
  /* overflow-x:hidden 会让 body 变成裁剪盒：内容很短的页面（如盯盘助手当日无信号）
   * 会把汉堡下拉菜单在 body 底缘截断。撑满视口高兜底。 */
  body.tv-page { min-height: 100dvh; }

  /* ============================ 顶栏 ============================ */
  .topnav {
    position: sticky;
    top: 0;
    /* 必须高于页面内 fixed/absolute 浮层（如叠加 K 线 panel z-index:10050），
       否则汉堡菜单会被图表顶栏按钮“穿透”盖住 */
    z-index: 20000;
    display: flex;
    align-items: center;
    gap: 8px;
    height: auto;
    min-height: calc(48px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
    background: #ffffff;
    border-bottom: 1px solid #eef0f3;
    flex-wrap: wrap;
  }

  .topnav .brand { font-size: 14px; flex-shrink: 0; gap: 6px; }
  .topnav .brand-logo { width: 24px; height: 24px; }
  .topnav .brand-text { font-size: 14px; }

  /* 汉堡按钮 */
  .topnav .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    order: 3;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .topnav .nav-toggle[aria-expanded="true"] {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
  }

  /* 下拉式导航 */
  .topnav nav {
    display: none;
    position: absolute;
    top: 100%;
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    z-index: 120;
  }
  .topnav nav.open { display: flex; }
  .topnav .nav-link {
    padding: 11px 14px;
    font-size: 15px;
    border-radius: 8px;
    font-weight: 500;
  }
  .topnav .nav-link.active { background: #eff6ff; color: #2563eb; }

  .topnav .spacer { display: none; }
  .topnav .nav-meta { display: none; }

  /* 顶栏的日期选择：与下方 main 卡片同宽铺满 */
  .topnav .date-picker {
    order: 10;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 8px;
  }
  .topnav .date-picker label {
    font-size: 12px;
    flex: 0 0 auto;
  }
  .topnav .date-picker .date-sep {
    flex: 0 0 auto;
  }
  .topnav .date-picker select,
  .topnav .date-picker select,
  .topnav .date-picker input[type="date"] {
    flex: 1 1 0;
    width: 0;              /* 与 flex 配合均分剩余宽度 */
    min-width: 0;
    max-width: none !important;
    min-height: 38px;
    font-size: 14px;
    border-radius: 8px;
    box-sizing: border-box;
  }

  .topnav .nav-user {
    font-size: 11px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    order: 1;
    margin-left: auto;
  }
  .topnav .nav-user-label { display: none; }
  .topnav .nav-logout {
    order: 2;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 8px;
    touch-action: manipulation;
  }

  /* ============================ 通用主内容 ============================ */
  main {
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
    padding: 14px max(12px, env(safe-area-inset-right, 0px)) max(28px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)) !important;
  }

  .section { margin-bottom: 22px; }

  .section-head { margin-bottom: 10px; }
  /* 标题文字禁止在汉字中间断行（修复「告警概览」逐字竖排）；
   * 右侧动作区放不下时整块换到第二行，而不是压缩标题。 */
  .section-title {
    flex-wrap: wrap;
    word-break: keep-all;
    font-size: 15px;
    gap: 6px 8px;
    margin-bottom: 0;
    width: 100%;
  }
  .section-title .num { width: 20px; height: 20px; font-size: 11px; flex-shrink: 0; }
  .section-title-actions {
    margin-left: auto;
    flex-shrink: 0;
  }
  .section-title-hint,
  .section-title .hint {
    display: block;
    width: 100%;
    margin-left: 0;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.5;
  }
  .section-title-hint code,
  .section-title .hint code { font-size: 10px; }

  /* 股票池下拉：贴右对齐，避免撑出屏幕左侧 */
  .pool-filter-btn {
    max-width: min(200px, 52vw);
    min-height: 36px;
  }
  .pool-filter-menu {
    left: auto !important;
    right: 0 !important;
    min-width: 180px;
    max-width: min(260px, calc(100vw - 24px));
    z-index: 90;
  }

  /* 通用分段控件（页面内有 segmented/tabs 的统一可横滑） */
  .seg-scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .seg-scroll::-webkit-scrollbar { display: none; }

  /* ===================================================================
   * 复盘全貌（overview）
   * 目标：信号卡更紧凑、首屏信息密度更高
   * =================================================================== */
  .tv-page-overview .cards-groups {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .tv-page-overview .cards-group { padding: 10px; border-radius: var(--tv-radius); }
  .tv-page-overview .cards-group .group-title { font-size: 11px; margin-bottom: 8px; }

  /* 信号数量卡：紧凑网格，横向标签 + 大数字，对齐规整 */
  .tv-page-overview .cards-group.special .grid,
  .tv-page-overview .cards-group.trend .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .tv-page-overview .cards-group.breakout .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .tv-page-overview .card {
    padding: 7px 8px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 56px;
  }
  .tv-page-overview .card .label {
    font-size: 11px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }
  .tv-page-overview .card .count { font-size: 18px; line-height: 1.15; }
  .tv-page-overview .card .delta { font-size: 10px; margin-top: 0; }

  /* B 区面板 */
  .tv-page-overview .panel-header { padding: 11px 12px; flex-wrap: wrap; row-gap: 6px; }
  .tv-page-overview .panel-header .label { font-size: 14px; }

  /* 信号×行业/题材渗透率：热点标签在移动端整屏折行全部展示，不横向截断、不横滑 */
  .tv-page-overview .panel-header .hotspots {
    flex: 0 0 100%;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.7;
  }
  .tv-page-overview .panel-header .hot-tag { margin-bottom: 4px; }

  /* 渗透率工具条：等级 tab 横滑 + 样本筛选独立成行（不再左侧留白） */
  .tv-page-overview .level-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tv-page-overview .level-tabs::-webkit-scrollbar { display: none; }
  .tv-page-overview .level-tabs button {
    flex: 1 0 auto;
    min-height: 38px;
    padding: 6px 14px;
    white-space: nowrap;
  }

  /* 渗透率分布：单列堆叠，行内列收紧、对齐 */
  .tv-page-overview .dist-rows { grid-template-columns: 1fr; gap: 12px; }
  .tv-page-overview .dist-col { padding: 10px; border-radius: var(--tv-radius); }
  .tv-page-overview .dist-row {
    grid-template-columns: 92px 1fr 58px 26px;
    gap: 6px;
    padding: 6px 4px;
    font-size: 11px;
  }
  .tv-page-overview .dist-row .name { font-size: 12px; }
  .tv-page-overview .dist-row .frac { font-size: 10px; }

  /* C 区极端集合 */
  .tv-page-overview .extreme-summary { grid-template-columns: 1fr; gap: 8px; }
  .tv-page-overview .stat-card { padding: 10px 12px; border-radius: var(--tv-radius); }
  .tv-page-overview .stat-card .stat-value { font-size: 18px; }
  .tv-page-overview .extreme-grid { grid-template-columns: 1fr; gap: 10px; }
  .tv-page-overview .extreme-card { padding: 12px; border-radius: var(--tv-radius); }

  /* 模型预测分布图 */
  .tv-page-overview [id$="Chart"],
  .tv-page-overview .echart-box,
  .tv-page-overview .scatter-box { min-height: 240px; }

  /* 抽屉全屏 */
  .tv-page-overview .drawer { width: 100%; max-width: 100%; }
  .tv-page-overview .drawer-body { padding: 12px; }
  .tv-page-overview .stock-table-wrap,
  .tv-page-overview .drawer-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ===================================================================
   * 趋势分析（deep）
   * 目标：工具栏整齐分段、表格横滑、消除文字竖排
   * =================================================================== */
  .tv-page-deep .dim3-grid,
  .tv-page-deep .dim1-grid,
  .tv-page-deep .dim1-grid.double-board {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  /* 关键：网格项允许收缩到轨道宽（否则被 min-content 撑到 600px+，
   * 内层 .board-list-scroll 的横滑失效，升温/降温榜右列被视口裁切） */
  .tv-page-deep .dim3-grid > *,
  .tv-page-deep .dim1-grid > *,
  .tv-page-deep .card-block { min-width: 0; }
  .tv-page-deep .camp-rings-grid { grid-template-columns: repeat(2, 1fr); }
  .tv-page-deep .env-gauge-body { flex-direction: column; gap: 10px; }
  .tv-page-deep .card-block { border-radius: var(--tv-radius); }

  /* 耦合分析工具条：纵向三段，全部满宽，左对齐，无悬空留白 */
  .tv-page-deep .coupling-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
  }

  /* 看好/看空/对比：满宽三等分分段控件 */
  .tv-page-deep .coupling-tabs { display: flex; width: 100%; }
  .tv-page-deep .tab-btn {
    flex: 1;
    text-align: center;
    padding: 9px 8px;
    font-size: 13px;
    min-height: 40px;
  }

  /* 粒度切换：单行可横滑的分段控件，按钮整体不换行（修复"一级行业"竖排） */
  .tv-page-deep .level-switcher {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tv-page-deep .level-switcher::-webkit-scrollbar { display: none; }
  .tv-page-deep .lvl-btn {
    flex: 1 0 auto;
    justify-content: center;
    white-space: nowrap;
    min-height: 36px;
    padding: 6px 12px;
  }

  /* 样本数筛选：独立成行，label 左、select 右，不再 margin-left:auto 悬空 */
  .tv-page-deep .dim-sample-filter {
    display: flex;
    width: 100%;
    margin-left: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #eef0f3;
    border-radius: 8px;
  }
  .tv-page-deep .dim-sample-label { font-size: 12px; }
  .tv-page-deep .dim-sample-select { min-height: 34px; min-width: 96px; }

  /* 耦合榜表格：横向滚动（保留全部列，像 TradingView 一样左右滑） */
  .tv-page-deep .ladder-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tv-page-deep .ladder-table { min-width: 560px; }
  /* 关键：禁止板块名 / 阵营 / 状态 / 表头竖排成单字，靠横滑查看 */
  .tv-page-deep .ladder-table th,
  .tv-page-deep .ladder-table .col-rank,
  .tv-page-deep .ladder-table .col-name,
  .tv-page-deep .ladder-table .col-camp,
  .tv-page-deep .ladder-table .col-final,
  .tv-page-deep .ladder-table .col-label {
    white-space: nowrap;
  }

  /* 5 日演化工具栏：与耦合工具栏统一为纵向、居中、可横滑（修复左右不对称 + 文字竖排） */
  .tv-page-deep .evo-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 0 4px;
    margin: 6px 0 4px;
  }
  .tv-page-deep .evo-toolbar-label {
    text-align: center;
    font-weight: 600;
    color: #374151;
  }
  .tv-page-deep .evo-level-switcher {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tv-page-deep .evo-level-switcher::-webkit-scrollbar { display: none; }
  .tv-page-deep .evo-lvl-btn {
    flex: 1 0 auto;
    justify-content: center;
    white-space: nowrap;
    min-height: 36px;
  }

  /* 升温/降温榜表头排序行：表头不竖排（随横滑查看） */
  .tv-page-deep .rotation-thead .th-sortable,
  .tv-page-deep .rotation-name,
  .tv-page-deep .rotation-camp { white-space: nowrap; }

  /* 阵营分布摘要行：换行可读 */
  .tv-page-deep .camp-summary {
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 11px;
    line-height: 1.6;
  }

  /* 升温/降温榜：横向滚动，避免 6 列挤压 */
  .tv-page-deep .board-list-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tv-page-deep .rotation-thead,
  .tv-page-deep .rotation-row { min-width: 520px; }

  /* 热度气泡图/弹层 */
  .tv-page-deep .heat-trails-header { flex-direction: column; gap: 8px; align-items: stretch; }
  .tv-page-deep .picker-dropdown { width: min(320px, 88vw); }
  .tv-page-deep [id$="Chart"],
  .tv-page-deep .chart-panel,
  .tv-page-deep .env-gauge-chart { min-height: 220px; }

  /* 帮助弹层移动端不溢出 */
  .tv-page-deep .help-popup { width: 88vw; max-width: 88vw; }

  /* ===================================================================
   * 自选池（watchlist）
   * =================================================================== */
  .tv-page-watchlist { min-height: 100dvh; }

  /* 左侧固定侧栏 → 顶部区块（可折叠，避免常占半屏） */
  .tv-page-watchlist .pool-sidebar {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
  }
  /* 折叠开关条（仅移动端显示） */
  .tv-page-watchlist .pool-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 14px;
    background: #f9fafb;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    font-family: inherit;
    cursor: pointer;
  }
  .tv-page-watchlist .pool-sidebar-toggle .pst-arrow {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
  }
  /* 展开态：内容区限定高度可滚动 */
  .tv-page-watchlist .pool-sidebar-body {
    padding: 12px;
    max-height: 46vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* 折叠态：仅留开关条 */
  .tv-page-watchlist .pool-sidebar.mobile-collapsed .pool-sidebar-body { display: none; }
  .tv-page-watchlist .pool-sidebar.mobile-collapsed { border-bottom: 1px solid #e5e7eb; }

  .tv-page-watchlist main {
    margin-left: 0 !important;
    width: 100% !important;
    overflow-x: hidden;
  }

  /* 筛选条：纵向堆叠。外框 overflow:hidden 作为硬约束，
   * 任何一行（如池子）横向内容都不允许越过卡片边框。 */
  .tv-page-watchlist .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    overflow: hidden;
  }
  /* 每组筛选项：单行左右滑动，整齐不换行。
   * width:100% + min-width:0 约束其宽度等于外框内宽，
   * 使 overflow-x 真正裁剪 + 触发组内横向滚动（否则会被内容撑破外框）。 */
  .tv-page-watchlist .filter-group {
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tv-page-watchlist .filter-group::-webkit-scrollbar { display: none; }
  .tv-page-watchlist .filter-group .filter-label { flex: 0 0 auto; }
  .tv-page-watchlist .filter-btn {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 11px;
    font-size: 12px;
  }
  .tv-page-watchlist .go-pool-btn {
    margin-left: 0;
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  /* 告警概览卡：两列 */
  .tv-page-watchlist .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tv-page-watchlist .summary-card { padding: 10px 12px; }

  /* 告警清单：移动端整体改为「卡片流」——
   * 桌面端 10 列 grid（1360px）在手机上需要长横滑且行首不冻结，体验极差。
   * 每行改为一张卡：标的名 + alertScore 首行，信号 chips 换行铺开，
   * 涨跌/模型分带 ::before 标签，横滑需求彻底消失。 */
  .tv-page-watchlist .alert-table-scroll {
    margin: 0 -4px;
    border-radius: var(--tv-radius);
    max-height: none;
    overflow: visible;
  }
  .tv-page-watchlist .alert-table {
    min-width: 0;
    overflow: visible;
  }

  /* 表头 → 排序 chips 行：仅保留可排序列，其余列头隐藏 */
  .tv-page-watchlist .alert-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    position: static;
    padding: 8px 10px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
  }
  .tv-page-watchlist .alert-head::before {
    content: "排序";
    font-size: 11px;
    color: #9ca3af;
    flex: 0 0 auto;
  }
  .tv-page-watchlist .alert-head > div:nth-child(1),
  .tv-page-watchlist .alert-head > div:nth-child(2),
  .tv-page-watchlist .alert-head > div:nth-child(3),
  .tv-page-watchlist .alert-head > div:nth-child(4),
  .tv-page-watchlist .alert-head > div:nth-child(10) { display: none; }
  .tv-page-watchlist .alert-head .th-sort {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    font-size: 12px;
    color: #4b5563;
    justify-content: center;
    white-space: nowrap;
  }
  .tv-page-watchlist .alert-head .th-sort.sort-active {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
  }
  /* 排序 chips 内的 help-icon 不重复显示（含义看列内标签即可） */
  .tv-page-watchlist .alert-head .th-sort .help-icon { display: none; }

  /* 行 → 卡片：10 个列 div 重排为多行流式布局 */
  .tv-page-watchlist .alert-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 10px 12px;
  }
  /* 第 1 行：标的（名称/行业）占满剩余宽，alertScore 靠右 */
  .tv-page-watchlist .alert-row > .col-identity { order: 1; flex: 1 1 60%; min-width: 0; }
  .tv-page-watchlist .alert-row > .col-score { order: 2; flex: 0 0 auto; margin-left: auto; }
  /* 第 2 行：信号 chips 换行铺开 */
  .tv-page-watchlist .alert-row > .col-signals { order: 3; flex: 1 1 100%; }
  /* 第 3 行：趋势 + 共振 */
  .tv-page-watchlist .alert-row > .col-trend { order: 4; flex: 0 0 auto; }
  .tv-page-watchlist .alert-row > .col-resonance { order: 5; flex: 1 1 auto; min-width: 0; }
  /* 第 4 行：模型分 / 当日 / 3日 / 5日 —— 带 ::before 小标签 */
  .tv-page-watchlist .alert-row > .col-model-score,
  .tv-page-watchlist .alert-row > .col-chg {
    order: 6;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 12px;
  }
  .tv-page-watchlist .alert-row > .col-model-score::before,
  .tv-page-watchlist .alert-row > .col-chg::before {
    font-size: 10px;
    color: #9ca3af;
  }
  .tv-page-watchlist .alert-row > div:nth-child(6)::before { content: "模型分"; }
  .tv-page-watchlist .alert-row > div:nth-child(7)::before { content: "当日"; }
  .tv-page-watchlist .alert-row > div:nth-child(8)::before { content: "3日"; }
  .tv-page-watchlist .alert-row > div:nth-child(9)::before { content: "5日"; }
  /* 第 5 行：60 日简图入口 */
  .tv-page-watchlist .alert-row > .col-kline { order: 7; flex: 0 0 auto; margin-left: auto; }

  /* 徽标字号下限：9px → 10px（P2-1） */
  .tv-page-watchlist .hit-pill .tier-badge,
  .tv-page-watchlist .hit-pill .weight-mark { font-size: 10px; font-weight: 700; }

  .tv-page-watchlist .none-list { grid-template-columns: 1fr; }

  /* ===================================================================
   * 个股 K 线（kline）
   * 目标：首屏直达 K 线；核心筛选置顶；高级筛选折叠；图表更美观
   * =================================================================== */
  .tv-page-kline { min-height: 100dvh; }

  /* 图表铺满首屏，股票池/筛选/列表收进侧边抽屉 */
  .tv-page-kline .app {
    flex-direction: column;
    height: calc(100dvh - 44px);
    min-height: 0;
    overflow: hidden;
  }
  .tv-page-kline .main {
    order: 0;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
  }

  /* 股票池 / 筛选 / 列表 → 侧边抽屉（默认收起，点按钮滑出） */
  .tv-page-kline .sidebar {
    position: fixed;
    top: 44px;
    left: 0;
    bottom: 0;
    width: min(86vw, 330px);
    z-index: 60;
    background: #f7f8fa;
    border-right: 1px solid #e5e7eb;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    /* 整个抽屉作为唯一滚动容器：展开筛选后内容增高也能整体下滑 */
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .tv-page-kline .sidebar.drawer-open { transform: translateX(0); }

  /* 抽屉遮罩 */
  .kline-drawer-backdrop {
    position: fixed; inset: 44px 0 0 0; z-index: 55;
    background: rgba(17, 24, 39, 0.35);
    opacity: 0; visibility: hidden; transition: opacity 0.2s;
  }
  .kline-drawer-backdrop.show { opacity: 1; visibility: visible; }

  /* 打开抽屉的悬浮按钮（贴在图表左下） */
  .kline-drawer-btn {
    position: absolute; left: 8px; bottom: 30px; z-index: 12;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 12px; border-radius: 9px;
    border: 1px solid #e5e7eb; background: rgba(255, 255, 255, 0.94);
    color: #2563eb; font-size: 13px; font-weight: 600; font-family: inherit;
    cursor: pointer; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  }

  /* 顶部信息条：换行、价格醒目 */
  .tv-page-kline .topbar { padding: 8px 12px; }
  .tv-page-kline .topbar-row {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 4px 10px;
    align-items: baseline;
  }
  .tv-page-kline .title-name { font-size: 16px; }
  .tv-page-kline .topbar .price { font-size: 20px; }
  .tv-page-kline .topbar .chg-pct { font-size: 15px; }
  .tv-page-kline .topbar .chg-amt { font-size: 13px; }
  .tv-page-kline .topbar-text { font-size: 11px; flex-basis: auto; }
  .tv-page-kline .topbar-actions { gap: 6px; }
  .tv-page-kline .topbar-index-overlay,
  .tv-page-kline .topbar-add-watch { font-size: 11px; padding: 4px 8px; }
  .tv-page-kline .index-overlay-wrap {
    /* 不可高于 .topnav（20000），否则「叠加 K 线」按钮会盖住汉堡菜单 */
    z-index: 5 !important;
  }
  .tv-page-kline .index-overlay-panel {
    position: fixed; left: 12px; right: 12px;
    width: auto; max-height: min(65vh, 480px);
    /* 低于顶栏导航，高于图表内容 */
    z-index: 9000;
  }

  /* 标注/指标工具条：默认折叠，点击展开（由 mobile-nav.js 注入 toggle） */
  .tv-page-kline .chart-marker-toolbar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 6px;
    padding: 7px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #4b5563;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
  }
  .tv-page-kline .chart-marker-toolbar-toggle .mk-arrow { transition: transform 0.15s; color: #9ca3af; }
  .tv-page-kline .chart-marker-toolbar-toggle.open .mk-arrow { transform: rotate(180deg); }
  .tv-page-kline #chart-marker-toolbar.collapsed { display: none; }
  .tv-page-kline #chart-marker-toolbar {
    gap: 6px 10px;
    padding: 8px 4px;
  }
  .tv-page-kline .indicator-group { margin-left: 0; width: 100%; flex-wrap: wrap; }

  /* 图表填满主区剩余空间 */
  .tv-page-kline #chart { flex: 1 1 auto; min-height: 0; }
  /* 全屏横屏看图按钮：移动端显示 */
  .tv-page-kline .kline-expand-btn { display: inline-flex; }
  /* 全屏关闭钮：移动端放右下角，避免与图内信息条争抢 */
  .tv-page-kline .kline-fs-close {
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
  }

  /* 侧栏内：股票池选择器作为核心筛选置顶、醒目 */
  .tv-page-kline .pool-toolbar { padding: 12px; gap: 8px; }
  .tv-page-kline .pool-label { font-size: 12px; font-weight: 600; color: #374151; }
  .tv-page-kline .pool-select { min-height: 42px; font-size: 14px; border-radius: 8px; }
  .tv-page-kline #stock-filter { min-height: 42px; font-size: 14px; border-radius: 8px; padding: 9px 11px 9px 10px; }

  /* 高级筛选折叠容器 + 触发按钮（由 mobile-nav.js 注入） */
  .tv-page-kline .mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 9px 11px 9px 10px;
    margin: 2px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
  }
  .tv-page-kline .mobile-filter-toggle .mft-arrow { color: #9ca3af; transition: transform 0.15s; }
  .tv-page-kline .mobile-filter-toggle.open { border-color: #bfdbfe; background: #f0f7ff; color: #2563eb; }
  .tv-page-kline .mobile-filter-toggle.open .mft-arrow { transform: rotate(180deg); color: #2563eb; }
  .tv-page-kline .mobile-adv-filters { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
  .tv-page-kline .mobile-adv-filters.collapsed { display: none; }

  /* 信号筛选项：触控友好换行 */
  .tv-page-kline .signal-filter-items { gap: 10px 14px; }
  .tv-page-kline .signal-filter-item { font-size: 13px; padding: 3px 0; }
  .tv-page-kline .signal-filter-item input { width: 16px; height: 16px; }

  /* 行业/题材：单列 */
  .tv-page-kline .sector-filter-grid { grid-template-columns: 1fr; gap: 6px; }
  .tv-page-kline .sector-picker-trigger { min-height: 40px; font-size: 13px; }
  .tv-page-kline .sector-picker-dropdown { width: min(280px, 86vw); }

  /* 股票池工具区不参与压缩，保持自然高度 */
  .tv-page-kline .pool-toolbar { flex: none; }
  /* 股票列表：随抽屉整体滚动（不再单独限高，避免底部留白 + 滚动卡死） */
  .tv-page-kline .stock-list {
    max-height: none;
    overflow: visible;
    flex: none;
    border-top: 1px solid #eef0f3;
  }
  /* 列表项：标签化设计，更整齐、信息密度更高 */
  .tv-page-kline .stock-item { padding: 11px 14px; min-height: 46px; }
  .tv-page-kline .stock-line1 { align-items: center; gap: 8px; }
  .tv-page-kline .stock-name { font-size: 15px; font-weight: 600; }
  .tv-page-kline .stock-metrics { gap: 5px; align-items: center; }
  /* 当日 / 5日 涨跌幅、模型评分 → 彩色标签 */
  .tv-page-kline .sm-cell {
    font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
    background: #f3f4f6; display: inline-flex; align-items: center; line-height: 1.5;
  }
  .tv-page-kline .sm-cell i { font-size: 9px; opacity: .75; margin-right: 2px; }
  .tv-page-kline .sm-cell.up { background: #fef2f2; color: #f23645; }
  .tv-page-kline .sm-cell.up i { color: #f87171; }
  .tv-page-kline .sm-cell.down { background: #ecfdf5; color: #089981; }
  .tv-page-kline .sm-cell.down i { color: #34d399; }
  .tv-page-kline .sm-cell.flat { background: #f3f4f6; color: #6b7280; }
  .tv-page-kline .sm-cell.sm-model { background: #eef2ff; color: #4f46e5; }
  .tv-page-kline .sm-cell.sm-model i { color: #818cf8; }
  /* 行业 + 题材标签 */
  .tv-page-kline .stock-line2 { align-items: center; gap: 6px; margin-top: 5px; }
  .tv-page-kline .stock-ind { font-size: 11px; color: #6b7280; }
  .tv-page-kline .stock-themes { gap: 5px; }
  .tv-page-kline .stock-theme-tag {
    font-size: 11px; color: #4f46e5; background: #eef2ff;
    padding: 2px 8px; border-radius: 6px; line-height: 1.6;
  }
  /* 排序栏：移动端触控更友好 */
  .tv-page-kline .stock-sort-bar { gap: 6px 8px; padding: 6px 0 2px; }
  .tv-page-kline .ssb-btn { padding: 6px 12px; font-size: 12px; }
  .tv-page-kline .ssb-label { font-size: 11px; }

  /* ===================================================================
   * 策略百晓生（agents）& 登录页（login）
   * =================================================================== */
  .tv-page-agents .page,
  .tv-page-login .page { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }

  .tv-page-login .card { padding: 28px 22px; }

  /* ===================================================================
   * 策略与持仓（strategy）
   * 目标：页签可横滑、参数控件触控友好、统计卡两列、图表自适应、表格横滑
   * =================================================================== */
  .tv-page-strategy main { overflow-x: hidden; }

  /* 工具条：页签区与参数区分行堆叠 */
  .tv-page-strategy .strat-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  /* 「筛选与参数」折叠按钮：移动端显示；默认收起参数区，节省顶部空间 */
  .tv-page-strategy .strat-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
  }
  /* 箭头统一为 10×6 三角（与各下拉一致尺寸，仅颜色不同） */
  .tv-page-strategy .strat-filter-toggle .sft-arrow {
    flex: 0 0 auto; width: 10px; height: 6px; font-size: 0; transition: transform 0.15s;
    background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239ca3af' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat center / 10px 6px;
  }
  .tv-page-strategy .strat-filter-toggle.open {
    border-color: #bfdbfe; background: #f0f7ff; color: #2563eb;
  }
  .tv-page-strategy .strat-filter-toggle.open .sft-arrow { transform: rotate(180deg); }
  /* 收起态：隐藏参数区（仅移动端生效，桌面端始终展开） */
  .tv-page-strategy .strat-toolbar.meta-collapsed .strat-meta { display: none; }

  /* 模型选择：移动端用下拉替代横排页签；整行盒子与「筛选与参数」同款，
     边距、文字起始位置、右侧箭头大小完全一致 */
  .tv-page-strategy .model-tabs { display: none; }
  .tv-page-strategy .model-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #ffffff;
  }
  .tv-page-strategy .model-select-lbl {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
  }
  .tv-page-strategy .model-select {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    border: none;
    background-color: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #1d4ed8;
    text-align: right;
    padding: 0 16px 0 0;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%231d4ed8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 10px 6px;
    touch-action: manipulation;
  }

  /* 信号源 / 参数区：自然换行，控件触控高度 */
  .tv-page-strategy .strat-meta { gap: 8px 10px; font-size: 12px; line-height: 1.8; }
  .tv-page-strategy .param-select { min-height: 34px; font-size: 13px; padding: 5px 26px 5px 10px; }
  .tv-page-strategy .live-tabs button { min-height: 34px; padding: 6px 14px; font-size: 13px; }
  .tv-page-strategy .live-desc { flex: 1 1 100%; }

  /* 区间控件整行铺排；日期输入按内容自适应（不再均分撑出大留白） */
  .tv-page-strategy .range-ctl { width: 100%; gap: 4px 6px; flex-wrap: wrap; }
  .tv-page-strategy .range-ctl input[type="date"] {
    flex: 0 1 auto; width: auto; min-width: 0; max-width: 47%;
    min-height: 36px; font-size: 13px; padding: 4px 6px;
  }
  .tv-page-strategy .range-sep { margin: 0 2px; }
  .tv-page-strategy .range-presets {
    width: 100%;
    margin-left: 0;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tv-page-strategy .range-presets::-webkit-scrollbar { display: none; }
  /* 预设按钮按内容自适应，去掉文字旁多余留白 */
  .tv-page-strategy .range-presets button { flex: 0 0 auto; min-height: 32px; padding: 5px 10px; }

  /* 帮助弹层 / 控件提示：限定宽度不溢出屏幕 */
  .tv-page-strategy .help-pop,
  .tv-page-strategy .help-pop.wide { width: min(92vw, 360px); max-width: calc(100vw - 24px); }
  .tv-page-strategy .ctl-tip:hover::after,
  .tv-page-strategy .ctl-tip.wide:hover::after { width: min(80vw, 280px); }

  /* 统计卡：收益分析/收益风险比/收益回撤比三卡横滑一行；前五大回撤整行另起 */
  .tv-page-strategy .stat-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
  .tv-page-strategy .stat-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    /* 与其它模块保持一致的页边距：不再做 -12px 出血 */
    margin: 0;
    padding: 2px 0;
  }
  .tv-page-strategy .stat-row::-webkit-scrollbar { display: none; }
  /* 卡片按内容自适应宽度，紧凑不留大空白；可横滑看全部三张 */
  .tv-page-strategy .stat-row .stat-card {
    flex: 0 0 auto;
    min-width: 0;
    scroll-snap-align: start;
  }
  .tv-page-strategy .stat-card { padding: 10px 12px; border-radius: var(--tv-radius); }
  .tv-page-strategy .stat-card .value { font-size: 19px; }
  /* 标签与数值贴近显示（去掉两端对齐造成的中间大留白） */
  .tv-page-strategy .stat-duo .duo-item { justify-content: flex-start; gap: 10px; }
  .tv-page-strategy .stat-duo .duo-item .value,
  .tv-page-strategy .stat-ratio .ratio-val { font-size: 17px; }
  .tv-page-strategy .stat-dd5 .dd5-table { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tv-page-strategy .stat-dd5 .dd5-table::-webkit-scrollbar { display: none; }
  .tv-page-strategy .stat-dd5 .ddt { min-width: 340px; }

  /* 面板与图表：内边距收紧、高度自适应移动端 */
  .tv-page-strategy .panel { padding: 12px; border-radius: var(--tv-radius); }
  .tv-page-strategy .panel-head { gap: 8px; }
  .tv-page-strategy .panel-title { font-size: 14px; }
  .tv-page-strategy .panel-title small { margin-left: 0; display: block; margin-top: 2px; }
  .tv-page-strategy #navChart { height: 280px; }
  .tv-page-strategy #posChart { height: 104px; }
  /* 净值图速览：表头行内靠右（业绩基准左侧），窄屏换行 */
  .tv-page-strategy .nav-panel-head { flex-wrap: wrap; align-items: flex-start; }
  .tv-page-strategy .nav-panel-head .nav-stat {
    margin-left: auto;
    margin-right: 0;
    max-width: 100%;
    padding: 6px 9px;
  }
  .tv-page-strategy .nav-panel-head .panel-tools { margin-left: auto; }
  .tv-page-strategy .nav-stat .ns-grid { gap: 2px 10px; }
  .tv-page-strategy .nav-stat .ns-hd { font-size: 10.5px; margin-bottom: 3px; }
  .tv-page-strategy .nav-stat .ns-lbl,
  .tv-page-strategy .nav-stat .ns-ex { font-size: 11px; }
  .tv-page-strategy .nav-stat .ns-val { font-size: 12px; }

  /* 净值曲线全屏看图按钮（移动端显示，贴右上角） */
  .tv-page-strategy .nav-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 6px;
    top: 4px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.94);
    color: #2563eb;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
  }
  .tv-page-strategy #cmpScatter { height: 340px; }
  .tv-page-strategy #cmpNav { height: 260px; }
  .tv-page-strategy .subchart-cap { font-size: 11px; line-height: 1.5; }

  /* 持仓工具条：换行 + 触控友好 */
  .tv-page-strategy .hold-toolbar { gap: 8px; width: 100%; }
  .tv-page-strategy .hold-views button { min-height: 34px; padding: 6px 14px; }
  .tv-page-strategy .hold-toolbar label { flex: 0 0 auto; }
  /* 交易日：日历控件（按内容自适应宽度、触控友好） */
  .tv-page-strategy .hold-toolbar input[type="date"] {
    min-height: 36px; font-size: 13px;
    flex: 0 1 auto; width: auto;
    padding: 5px 10px;
  }
  .tv-page-strategy .hold-summary { gap: 6px 14px; }

  /* 持仓表：保留全部列横向滑动；纵向限高内部滚动 + sticky 表头 */
  .tv-page-strategy .hold-table-wrap {
    max-height: calc(100dvh - 150px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--tv-radius);
  }

  /* 交易计划分组头换行 */
  .tv-page-strategy .plan-group-head { flex-wrap: wrap; gap: 4px 8px; }

  /* 多策略对比 · 筛选：标题更窄、选项紧凑触控 */
  .tv-page-strategy .cmp-filters { padding: 10px 12px; gap: 8px; }
  .tv-page-strategy .cmp-fg { gap: 8px; }
  .tv-page-strategy .cmp-fg .fg-title { flex-basis: 46px; font-size: 11px; }
  .tv-page-strategy .cmp-fg .fg-opts { gap: 8px 12px; }
  .tv-page-strategy .cmp-chk { font-size: 12px; padding: 3px 0; }
  .tv-page-strategy .cmp-chk input { width: 16px; height: 16px; }
  .tv-page-strategy .cmp-nav-legend { gap: 6px 12px; }
  .tv-page-strategy .cmp-selbar { width: 100%; justify-content: space-between; }
  /* 多策略对比 · 把筛选维度面板收纳进「筛选与参数」：收起时整块隐藏 */
  .tv-page-strategy .panel.cmp-collapsed { display: none; }

  /* ===================================================================
   * 每日研判（research）
   * 目标：共识榜行不再被右侧裁切、分段控件可横滑、卡片信息完整可读
   * =================================================================== */
  .tv-page-research main { overflow-x: hidden; }

  /* 粒度切换 日/周/月/评估：整行可横滑分段 */
  .tv-page-research .gran-tabs {
    display: flex;
    width: 100%;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tv-page-research .gran-tabs::-webkit-scrollbar { display: none; }
  .tv-page-research .gran-tabs button { flex: 1 0 auto; min-height: 34px; white-space: nowrap; }

  /* 共识榜工具条：买入/持仓 与 层级 两组分段各自整行、可横滑 */
  .tv-page-research .toolbar { gap: 8px; }
  .tv-page-research .toolbar .tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tv-page-research .toolbar .tabs::-webkit-scrollbar { display: none; }
  .tv-page-research .toolbar .tabs button { flex: 1 0 auto; min-height: 34px; white-space: nowrap; }

  /* 核心修复：共识榜每行在窄屏改为两行流式布局——
   * 第 1 行：序号 + 板块名 + 右侧「n/N 策略·样本·趋势」（不再被卡片右边框裁切）；
   * 第 2 行：共识 / 持续 两条形整行铺满。 */
  .tv-page-research .board-head {
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 10px 12px;
  }
  .tv-page-research .board-rank { width: 18px; }
  .tv-page-research .board-name {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tv-page-research .board-meta {
    width: auto;
    order: 2;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 6px;
  }
  .tv-page-research .board-chev { order: 3; }
  .tv-page-research .board-bars {
    order: 4;
    flex: 1 1 100%;
    min-width: 0;
  }
  .tv-page-research .bar-val { width: 42px; }

  /* 展开的成分股行：允许换行、命中标签不溢出 */
  .tv-page-research .board-body { padding: 4px 12px 12px 34px; }
  .tv-page-research .stock-row { flex-wrap: wrap; gap: 6px 8px; }
  .tv-page-research .stock-name { min-width: 0; }
  .tv-page-research .hitby { flex-wrap: wrap; margin-left: 0; }

  /* 推断卡：三段标签与正文在窄屏更紧凑 */
  .tv-page-research .inf-card { padding: 10px; }
  .tv-page-research .inf-line { font-size: 12.5px; }

  /* 轮动 tornado：行名收窄，给柱体更多空间 */
  .tv-page-research .tor-axislabel { margin: 0 44px 6px 78px; }
  .tv-page-research .tor-name { width: 72px; font-size: 12px; }
  .tv-page-research .tor-val { width: 36px; font-size: 12px; }

  /* 资料库卡片单列（已有 720px 规则，这里统一内边距） */
  .tv-page-research .src-board { padding: 12px; }
  .tv-page-research .src-head { flex-wrap: wrap; gap: 4px 8px; }

  /* 帮助弹层不溢出屏幕 */
  .tv-page-research .help-popup { width: 86vw !important; max-width: 86vw !important; left: auto; right: -8px; }

  /* ===================================================================
   * 全站：帮助浮层触屏化（配合 mobile-nav.js 的点按开关）
   * =================================================================== */
  /* 问号热区扩大：视觉尺寸微调 + 透明外扩热区（约 33×33） */
  .help-icon, .help-ico {
    position: relative;
    width: 17px;
    height: 17px;
    font-size: 11px;
  }
  .help-icon::after, .help-ico::after {
    content: "";
    position: absolute;
    inset: -8px;
  }
  /* 浮层移动端统一固定居中：不再被卡片边缘裁切、不挡触发点 */
  .help-icon .help-popup,
  .rule-help .help-pop,
  .conf-chip .conf-pop {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: min(92vw, 380px) !important;
    max-width: 92vw !important;
    max-height: 68vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 30000;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  }
  /* fixed 居中后小箭头没有意义 */
  .help-popup::before { display: none; }

  /* ===================================================================
   * 全站：横滑区可达性（滚动阴影 + 一次性滑动提示条，mobile-nav.js 注入）
   * =================================================================== */
  .swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    margin-bottom: 4px;
    border-radius: 8px;
    background: #f0f7ff;
    border: 1px dashed #bfdbfe;
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
  }
  /* 右缘渐隐阴影：提示「右边还有内容」（Lea Verou scroll-shadow 方案） */
  .scroll-x-hint {
    background:
      linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) left / 36px 100% no-repeat,
      linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)) right / 36px 100% no-repeat,
      radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, 0.16), transparent) left / 12px 100% no-repeat,
      radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, 0.16), transparent) right / 12px 100% no-repeat;
    background-attachment: local, local, scroll, scroll;
    touch-action: pan-x pan-y;
  }

  /* ===================================================================
   * 复盘全貌：抽屉/筛选触控 + 徽标字号下限
   * =================================================================== */
  .tv-page-overview .drawer-close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .tv-page-overview .min-sample-select,
  .tv-page-deep .dim-sample-select { min-height: 36px; }
  /* 耦合榜 tier 上标 8px → 10px 加粗（P2-1） */
  .tv-page-overview .hit-pill sup,
  .tv-page-deep .hit-pill sup { font-size: 10px; font-weight: 700; }
  .tv-page-overview .dist-row .tier { font-size: 10px; }

  /* ===================================================================
   * 每日研判：定调卡个股链接 → 小胶囊按钮（触控 + 美观）
   * =================================================================== */
  .tv-page-research .tone-stk {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    font-size: 12px;
    font-weight: 500;
  }
  .tv-page-research .tone-stk:hover { text-decoration: none; background: #dbeafe; }
  .tv-page-research .tone-node-tops { gap: 6px; }

  /* ===================================================================
   * 行情预判（forecast）
   * =================================================================== */
  .tv-page-forecast main { overflow-x: hidden; }
  /* 战绩表/附录表：包一层横滑容器（app.js wrapTables），保证 7 列全部可达 */
  .tv-page-forecast .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    margin: 0 -2px;
  }
  .tv-page-forecast .table-scroll .rep-table { min-width: 560px; }
  .tv-page-forecast .table-scroll .apx-table { min-width: 620px; }
  .tv-page-forecast .table-scroll table.uni { min-width: 620px; }
  .tv-page-forecast .rep-table th,
  .tv-page-forecast .rep-table td { padding: 7px 5px; font-size: 12px; }
  /* 顶部契约 banner：折叠为一行，点开看全文 */
  .tv-page-forecast .fc-banner.fc-collapsible {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
  .tv-page-forecast .fc-banner.fc-collapsible::before {
    content: "ⓘ ";
    color: #2563eb;
  }
  .tv-page-forecast .fc-banner.fc-collapsible.expanded {
    white-space: normal;
    overflow: visible;
  }
  /* 结算脚注：副句移动端省略（app.js 里包 .settle-sub） */
  .tv-page-forecast .settle-sub { display: none; }
  .tv-page-forecast .ccard-foot { flex-wrap: wrap; }
  .tv-page-forecast .ccard-foot .apx-link {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    margin-left: auto;
    border-radius: 999px;
    background: #f1f5f9;
    color: #2563eb;
  }
  /* 证据链琥珀锚点：扩大点按热区（视觉不变） */
  .tv-page-forecast .hl-anchor {
    padding: 3px 5px;
    margin: -3px -2px;
    border-radius: 6px;
  }
  .tv-page-forecast .headline { padding: 12px 14px 12px; }
  .tv-page-forecast .headline-band { font-size: 17px; }
  .tv-page-forecast .tone-badge { font-size: 17px; padding: 3px 12px; }

  /* ===================================================================
   * 策略与持仓：参数区触控 + 持仓表移动端精简列开关
   * =================================================================== */
  .tv-page-strategy input[type="checkbox"] { width: 18px; height: 18px; }
  .tv-page-strategy .cmp-chk,
  .tv-page-strategy .strat-meta label { padding: 5px 0; }
  .tv-page-strategy .bench-btn,
  .tv-page-strategy .hold-views button { min-height: 36px; }
  /* 「展开全部列」开关（strategy_holdings_app.js 注入；sticky 横滑时不跟着跑） */
  .cols-toggle-m {
    position: sticky;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid #eef1f5;
    background: #f8fafc;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
  }
  .hold-table .col-hide-m { display: none; }
  .hold-table-wrap.show-all-cols .col-hide-m { display: table-cell; }

  /* ===================================================================
   * 个股 K 线：周期切换/顶部按钮触控 + OHLC 浮窗贴顶横条
   * =================================================================== */
  .tv-page-kline .tf-btn { min-height: 34px; padding: 5px 12px; }
  .tv-page-kline .topbar-index-overlay,
  .tv-page-kline .topbar-add-watch,
  .tv-page-kline .topbar-f10,
  .tv-page-kline .topbar-watch { min-height: 32px; display: inline-flex; align-items: center; }
  /* 十字光标 OHLC 卡：改为贴顶部通栏横条（TradingView 手机版样式），不悬浮挡图 */
  .tv-page-kline .kline-ohlc-card {
    left: 6px !important;
    right: 6px !important;
    top: 4px;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1.4;
  }
  .tv-page-kline .kline-ohlc-card .ohlc-date { margin: 0; width: auto; }
  .tv-page-kline .kline-ohlc-card .ohlc-row { gap: 4px; }

  /* ===================================================================
   * 盯盘助手：触控目标（导航已回归全站汉堡菜单）
   * =================================================================== */
  .tv-page-intraday .refresh-btn { min-height: 36px; padding: 6px 12px; }
  .tv-page-intraday .drawer-close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .tv-page-intraday .iw-error-card { margin: 24px 12px; }
}

/* ============================ 桌面端：隐藏移动端专属元素 ============================ */
@media (min-width: 769px) {
  .topnav .nav-toggle { display: none !important; }
  /* 注意：.mobile-filter-toggle（筛选条件折叠）桌面端也要显示，故不在此隐藏 */
  .chart-marker-toolbar-toggle { display: none !important; }
  .swipe-hint { display: none !important; }
}

/* ============================ 帮助浮层点按开关（全端生效） ============================
 * mobile-nav.js 给 .help-icon / .rule-help / .ctl-tip / .conf-chip 点按加 .open：
 * 触屏设备唯一入口；桌面端等价于「点住固定浮层」，与 hover 行为叠加无冲突。 */
.help-icon.open .help-popup,
.conf-chip.open .conf-pop { display: block; }
.rule-help.open .help-pop { opacity: 1; visibility: visible; transform: translateY(0); }

/* ============================ embed=1：Channel 等 iframe 嵌入 ============================ */
html.tv-embed header.topnav,
html.tv-embed .topnav {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
html.tv-embed .app {
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
}
html.tv-embed .sidebar,
html.tv-embed .kline-drawer-btn,
html.tv-embed .kline-drawer-backdrop,
html.tv-embed .topbar,
html.tv-embed .chart-marker-toolbar-toggle,
html.tv-embed .kline-expand-btn {
  display: none !important;
}
html.tv-embed .main {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
}
/* embed：关闭卡片由 Channel 宿主负责，iframe 内不显示 ✕ */
html.tv-embed .kline-fs-close {
  display: none !important;
  pointer-events: none !important;
}
html.tv-embed .embed-add-watch {
  position: absolute;
  right: 10px;
  top: 8px;
  z-index: 12;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
}
