/* v185-137 覆盖层：此文件在 style-v11.css 之后加载，专门用来压住历史规则里那些 !important。
   只做三件事：① 桌面端（>860px）布局 ② 卡片视觉去死白/去棱角 ③ 策略页排版节奏统一。 */

/* ①-1 卡片视觉：纯白平涂 + 14px 小圆角 → 极轻渐变 + 16px 圆角 + 柔和投影 */
.signal, .advice, .card, .flow-alert, .no-plan {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdfd 100%) !important;
  border: 1px solid #eaeef4 !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .035), 0 10px 24px -16px rgba(16, 24, 40, .14) !important;
}
.mtf-cell { background: #f6f8fb !important; border: 1px solid #eef1f6 !important; border-radius: 11px !important; }
.lv-cell { border-radius: 12px !important; }

/* ①-2 策略页节奏：标题→内容 10 / 内容块之间 10 / 卡与卡之间 10 */
#view-app[data-ctab="st"] .advice { margin-top: 10px !important; }
#view-app[data-ctab="st"] .advice-head { margin-bottom: 10px !important; }
#view-app[data-ctab="st"] #p-mtf-box #p-lv-row { margin: 10px 0 0 !important; }

@media (max-width: 860px) {
  /* 周期模式标题条与 15 格拼成一张整卡，中间不留灰缝 */
  #view-app[data-ctab="st"] #st-sr .title-row {
    background: #fff !important; border: 1px solid #eaeef4 !important; border-bottom: 0 !important;
    border-radius: 16px 16px 0 0 !important; padding: 12px 14px 10px !important; margin: 0 !important;
  }
  #view-app[data-ctab="st"] #p-mtf-box {
    padding: 0 14px 14px !important; margin-top: 0 !important;
    border-radius: 0 0 16px 16px !important; border-top: 0 !important;
  }
  #view-app[data-ctab="st"] .advice { padding: 12px 14px 14px !important; }
}

@media (min-width: 861px) {
  /* ② 桌面端：顶部页签导航 */
  #tabbar {
    display: flex !important; position: fixed !important; top: 0; left: 0; right: 0; bottom: auto !important;
    height: 56px; z-index: 1300; padding: 0 24px !important; gap: 2px; align-items: stretch;
    background: #fff !important; border-top: 0 !important; border-bottom: 1px solid #edf0f4 !important;
    box-shadow: 0 1px 10px rgba(16, 24, 40, .05) !important; box-sizing: border-box;
  }
  #tabbar .tb-item {
    flex: 0 0 auto !important; flex-direction: row !important; gap: 7px !important; height: 56px !important;
    padding: 0 18px !important; font-size: 14px !important; font-weight: 600 !important; color: #475467 !important;
    border-radius: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important;
    -webkit-appearance: none; appearance: none; cursor: pointer;
  }
  #tabbar .tb-item svg {
    width: 19px !important; height: 19px !important; fill: none !important;
    stroke: #667085 !important; stroke-width: 1.6 !important; stroke-linecap: round; stroke-linejoin: round;
  }
  #tabbar .tb-item.active { color: #0e9f6e !important; font-weight: 700 !important; box-shadow: inset 0 -2px 0 #0e9f6e !important; }
  #tabbar .tb-item.active svg { stroke: #0e9f6e !important; }
  #tabbar .tb-item:hover { background: #f8fafc !important; }
  #view-app { padding-top: 56px !important; }

  /* ②-1 只显示当前页签 */
  #view-app[data-ctab="ov"] [data-tb]:not([data-tb="ov"]),
  #view-app[data-ctab="st"] [data-tb]:not([data-tb="st"]),
  #view-app[data-ctab="cap"] [data-tb]:not([data-tb="cap"]),
  #view-app[data-ctab="log"] [data-tb]:not([data-tb="log"]),
  #view-app[data-ctab="me"] [data-tb]:not([data-tb="me"]) { display: none !important; }

  /* ②-2 单列居中，不再两栏留空列 */
  #view-app .panel {
    display: flex !important; flex-direction: column !important; gap: 14px !important;
    max-width: 1080px !important; margin: 0 auto !important; padding: 18px 24px 48px !important;
    min-height: 0 !important; height: auto !important; box-sizing: border-box;
  }
  #view-app .col-left, #view-app .col-right { display: contents !important; }
  #view-app .panel > .advice { margin-top: 0 !important; }

  /* ②-3 策略页：周期卡拼整 + 标题条 */
  #view-app[data-ctab="st"] #st-sr .title-row {
    background: #fff !important; border: 1px solid #eaeef4 !important; border-bottom: 0 !important;
    border-radius: 16px 16px 0 0 !important; padding: 14px 18px 10px !important; margin: 0 !important;
  }
  #view-app[data-ctab="st"] #p-mtf-box {
    padding: 0 18px 16px !important; margin-top: 0 !important;
    border-radius: 0 0 16px 16px !important; border-top: 0 !important;
  }
  #view-app[data-ctab="st"] .advice { padding: 14px 18px 16px !important; }

  /* ②-4 我的页组件（原来只在手机断点里有样式，桌面退化成浏览器默认按钮） */
  #tb-me .signal { padding: 14px 18px !important; }
  #tb-me .signal-title { font-size: 15px !important; font-weight: 700 !important; color: #0b1220 !important; margin-bottom: 10px !important; }
  #tb-me .row { padding: 12px 0 !important; font-size: 14px !important; color: #101828 !important; border-top: 1px solid #f0f2f6 !important; }
  #tb-me .row:first-of-type { border-top: 0 !important; }
  #tb-me .val-sm { font-size: 14px !important; font-weight: 600 !important; color: #475467 !important; }
  #tb-me .ms-item {
    background: #fff !important; border: 1px solid #e3e7ee !important; border-radius: 12px !important;
    margin-bottom: 8px !important; overflow: hidden !important;
  }
  #tb-me .ms-row {
    width: 100% !important; display: flex !important; align-items: center !important; gap: 10px !important;
    background: none !important; border: 0 !important; padding: 14px 16px !important;
    font-size: 14px !important; font-weight: 600 !important; color: #101828 !important; text-align: left !important;
    border-radius: 12px !important; -webkit-appearance: none; appearance: none; cursor: pointer;
  }
  #tb-me .ms-row:hover { background: #f8fafc !important; }
  #tb-me .ms-name { flex: 1 1 auto !important; }
  #tb-me .ms-sub { flex: 0 1 auto !important; font-size: 13px !important; font-weight: 400 !important; color: #475467 !important; }
  #tb-me .ms-arrow { flex: none !important; font-size: 13px !important; color: #667085 !important; }
  #tb-me .ms-body { padding: 0 16px 16px !important; border-top: 1px solid #f0f2f6 !important; padding-top: 14px !important; }
  #tb-me .danger-row .ms-name { color: #d92d20 !important; }
}

/* ③ 盘面页重排（v185-137）
   问题A：桌面上「合约持仓多空」五个 row 被 flex:1 1 0 压成一条，文字互相叠压。
   问题B：六宫格是 6 个各自带边框的大空框（桌面 2 列×3 行，每格 77px），像填表，不像盘面。
   改法：六宫格收进一张卡做 3×2 数据网格，格间只用发丝线；持仓行回到正常行高。 */
#view-app[data-ctab="cap"] #p-futures { height: auto !important; }
#view-app[data-ctab="cap"] #p-futures .row {
  flex: 0 0 auto !important; min-height: auto !important; position: static !important;
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  padding: 9px 0 !important; line-height: 1.4 !important; border-bottom: 1px solid #f2f4f7 !important;
}
#view-app[data-ctab="cap"] #p-futures .row > span:first-child { font-size: 13px !important; color: #667085 !important; }
#view-app[data-ctab="cap"] #p-futures .row > span:last-child { font-size: 13.5px !important; font-weight: 600 !important; color: #101828 !important; }

/* 六宫格：一张卡里的 3×2 数据网格 */
#view-app[data-ctab="cap"] section.grid {
  display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 0 !important;
  background: #fff !important; border: 1px solid #eaeef4 !important; border-radius: 16px !important;
  overflow: hidden !important; box-shadow: 0 1px 2px rgba(16, 24, 40, .035), 0 10px 24px -16px rgba(16, 24, 40, .14) !important;
}
#view-app[data-ctab="cap"] section.grid .box {
  border: 0 !important; border-radius: 0 !important; background: transparent !important;
  border-right: 1px solid #f0f2f6 !important; border-bottom: 1px solid #f0f2f6 !important;
  padding: 16px 18px !important; min-height: 0 !important; height: auto !important;
  display: flex !important; flex-direction: column !important; align-items: flex-start !important;
  justify-content: center !important; text-align: left !important; gap: 6px !important; overflow: visible !important;
}
#view-app[data-ctab="cap"] section.grid .box:nth-child(3n) { border-right: 0 !important; }
#view-app[data-ctab="cap"] section.grid .box:nth-child(n+4) { border-bottom: 0 !important; }
#view-app[data-ctab="cap"] section.grid .box .label { font-size: 12px !important; font-weight: 500 !important; color: #667085 !important; }
#view-app[data-ctab="cap"] section.grid .box .val { font-size: 19px !important; font-weight: 700 !important; letter-spacing: -.2px !important; line-height: 1.25 !important; }
#view-app[data-ctab="cap"] section.grid .box.amt-buy .label,
#view-app[data-ctab="cap"] section.grid .box.wall-buy .label { color: #0e9f6e !important; }
#view-app[data-ctab="cap"] section.grid .box.amt-sell .label,
#view-app[data-ctab="cap"] section.grid .box.wall-sell .label { color: #d92d20 !important; }
#view-app[data-ctab="cap"] section.grid .box .tip { font-size: 12px !important; color: #667085 !important; }
#view-app[data-ctab="cap"] section.grid .box.split { padding: 12px 18px !important; }
#view-app[data-ctab="cap"] section.grid .box.split .cell { display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 860px) {
  /* 手机：2 列 × 3 行，同样收进一张卡 */
  #view-app[data-ctab="cap"] section.grid { grid-template-columns: repeat(2, 1fr) !important; }
  #view-app[data-ctab="cap"] section.grid .box:nth-child(3n) { border-right: 1px solid #f0f2f6 !important; }
  #view-app[data-ctab="cap"] section.grid .box:nth-child(2n) { border-right: 0 !important; }
  #view-app[data-ctab="cap"] section.grid .box:nth-child(n+4) { border-bottom: 1px solid #f0f2f6 !important; }
  #view-app[data-ctab="cap"] section.grid .box:nth-child(n+5) { border-bottom: 0 !important; }
  #view-app[data-ctab="cap"] section.grid .box { padding: 13px 14px !important; }
  #view-app[data-ctab="cap"] section.grid .box .val { font-size: 17px !important; }
}

/* ④ 桌面端策略页组件（这些组件的布局原来只写在手机断点里，桌面就全塌了） */
.src-only { display: none !important; }   /* 仅作首页数据源，任何端都不该露出来 */

@media (min-width: 861px) {
  #p-mtf { display: grid !important; grid-template-columns: repeat(5, 1fr) !important; gap: 8px !important; }
  .mtf-cell {
    min-height: 72px !important; padding: 10px 8px !important;
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: center !important; gap: 4px !important;
  }
  .mtf-cell .m-label { font-size: 12.5px !important; color: #667085 !important; }
  .mtf-cell .m-tag { font-size: 13.5px !important; }

  .lv-row { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .lv-cell { padding: 14px 18px !important; display: flex !important; align-items: center !important; gap: 12px !important; }
  .lv-cell .lv-l { font-size: 13px !important; color: #667085 !important; }
  .lv-cell .lv-v { font-size: 22px !important; font-weight: 700 !important; }

  .advice-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .advice-cell {
    padding: 16px 18px !important; min-height: 96px !important;
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: center !important; gap: 6px !important;
  }
  .advice-cell .a-label { font-size: 12.5px !important; color: #667085 !important; font-weight: 500 !important; }
  .advice-cell .a-val { font-size: 23px !important; font-weight: 700 !important; line-height: 1.2 !important; }
  .advice-cell .a-tag { font-size: 12.5px !important; color: #667085 !important; }
  .advice-reason { font-size: 13px !important; color: #475467 !important; margin: 0 0 10px !important; }
  .lights { display: flex !important; gap: 14px !important; align-items: center !important; }
}

/* ⑤ 桌面端状态胶囊：原规则 flex:1 1 auto 会让每个胶囊平分整行并被压扁（文字裁切） */
@media (min-width: 861px) {
  .advice-status {
    display: flex !important; flex-wrap: wrap !important; gap: 8px !important;
    margin-top: 12px !important; max-height: none !important; overflow: visible !important;
  }
  .advice-status .st-chip { flex: 0 0 auto !important; max-width: 100% !important; }
  .advice-status .regime-chip { flex: 1 1 100% !important; }
}

/* ⑥ 手机端六宫格同样收成一张卡（用 .panel 前缀提高特异性，压住旧规则） */
@media (max-width: 860px) {
  #view-app[data-ctab="cap"] .panel .grid {
    background: #fff !important; border: 1px solid #eaeef4 !important; border-radius: 16px !important;
    overflow: hidden !important; box-shadow: 0 1px 2px rgba(16, 24, 40, .035), 0 10px 24px -16px rgba(16, 24, 40, .14) !important;
    gap: 0 !important; row-gap: 0 !important; column-gap: 0 !important;
    grid-template-columns: repeat(2, 1fr) !important; grid-template-rows: none !important;
    grid-auto-rows: auto !important; margin: 0 !important;
  }
  #view-app[data-ctab="cap"] .panel .grid .box {
    border: 0 !important; border-right: 1px solid #f0f2f6 !important; border-bottom: 1px solid #f0f2f6 !important;
    border-radius: 0 !important; background: transparent !important;
    padding: 13px 14px !important; min-height: 0 !important; height: auto !important;
    display: flex !important; flex-direction: column !important; align-items: flex-start !important;
    justify-content: center !important; text-align: left !important; gap: 5px !important;
  }
  #view-app[data-ctab="cap"] .panel .grid .box:nth-child(2n) { border-right: 0 !important; }
  #view-app[data-ctab="cap"] .panel .grid .box:nth-child(n+5) { border-bottom: 0 !important; }
  #view-app[data-ctab="cap"] .panel .grid .box .label { font-size: 12px !important; font-weight: 500 !important; color: #667085 !important; }
  #view-app[data-ctab="cap"] .panel .grid .box.amt-buy .label,
  #view-app[data-ctab="cap"] .panel .grid .box.wall-buy .label { color: #0e9f6e !important; }
  #view-app[data-ctab="cap"] .panel .grid .box.amt-sell .label,
  #view-app[data-ctab="cap"] .panel .grid .box.wall-sell .label { color: #d92d20 !important; }
  #view-app[data-ctab="cap"] .panel .grid .box .val { font-size: 17px !important; font-weight: 700 !important; }
  #view-app[data-ctab="cap"] .panel .grid .box.split { padding: 12px 14px !important; }
  #view-app[data-ctab="cap"] .panel .grid .box.split .cell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
  #view-app[data-ctab="cap"] .panel .grid .box .tip { font-size: 11.5px !important; color: #667085 !important; }
}
