/* ============================================================
 * stockfin.css —— 个股页「财务面」样式
 * 只被 stock.html 引用。复用 stock.html :root 里的深色变量。
 * 结构：tab 栏 / 头部 / 六项体检 / 100元拆解 / 风险排查 / 趋势 / 主营
 * ============================================================ */

.st-tabs {
  display: flex; gap: 8px; margin: 6px 0 16px; flex-wrap: wrap;
}
.st-tab {
  appearance: none; cursor: pointer;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; line-height: 1.2;
  font-family: inherit; transition: all .16s ease;
}
.st-tab:hover { color: var(--text); border-color: var(--gold); }
.st-tab.on {
  background: rgba(212, 175, 55, .12); color: var(--gold);
  border-color: var(--gold); font-weight: 600;
}

/* ---------- 头部 ---------- */
.fin-head {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 14px;
  display: flex; gap: 18px; justify-content: space-between;
  align-items: flex-start; flex-wrap: wrap;
}
.fin-head .nm { font-size: 19px; font-weight: 600; color: var(--text); }
.fin-head .nm .cd { font-size: 12.5px; color: var(--muted2); margin-left: 8px; font-weight: 400; }
.fin-head .bd {
  display: inline-block; font-size: 11.5px; color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, .35); border-radius: 5px;
  padding: 2px 7px; margin-left: 8px; vertical-align: middle;
}
.fin-head .meta { font-size: 12.5px; color: var(--muted); margin-top: 7px; line-height: 1.7; }
.fin-head .meta b { color: var(--text); font-weight: 500; }
.fin-score { text-align: right; min-width: 128px; }
.fin-score .big {
  font-size: 34px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fin-score .lab { font-size: 12px; color: var(--muted); margin-top: 5px; }
.fin-score .na { font-size: 15px; color: var(--muted2); }
.fin-weak { font-size: 12px; color: var(--warn); margin-top: 6px; }

/* ---------- 六项 ---------- */
.fin-dims {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.fin-dim {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.fin-dim .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fin-dim .dn { font-size: 13.5px; color: var(--text); font-weight: 500; }
.fin-dim .sc {
  font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
  line-height: 1;
}
.fin-dim .sc.na { font-size: 12px; color: var(--muted2); font-weight: 400; }
.fin-dim .track {
  height: 5px; background: rgba(255, 255, 255, .07); border-radius: 3px;
  margin: 9px 0 8px; overflow: hidden;
}
.fin-dim .fill { height: 100%; border-radius: 3px; }
.fin-dim .tx { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.fin-dim .kv {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px;
  font-size: 11.5px; color: var(--muted2);
}
.fin-dim .kv i { font-style: normal; }
.fin-dim .kv b { color: var(--text); font-weight: 500; margin-left: 4px; }

/* ---------- 通用区块 ---------- */
.fin-block {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 14px;
}
.fin-block > h3 {
  font-size: 14px; color: var(--text); margin: 0 0 4px; font-weight: 600;
}
.fin-block > h3 em {
  font-style: normal; font-size: 12px; color: var(--muted2);
  font-weight: 400; margin-left: 8px;
}
.fin-block > .desc { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.6; }

/* ---------- 100 元拆解 ---------- */
.wf-row { display: grid; grid-template-columns: 148px 1fr 56px; align-items: center; gap: 10px; margin-bottom: 7px; }
.wf-row .wf-n { font-size: 12.5px; color: var(--muted); text-align: right; }
.wf-bar { position: relative; height: 20px; background: rgba(255, 255, 255, .045); border-radius: 4px; }
.wf-bar i {
  position: absolute; top: 0; height: 100%; border-radius: 3px; display: block;
}
.wf-bar i.total { background: linear-gradient(90deg, rgba(212, 175, 55, .55), rgba(212, 175, 55, .8)); }
.wf-bar i.minus { background: rgba(246, 70, 93, .55); }
.wf-bar i.plus { background: rgba(46, 189, 133, .55); }
.wf-bar i.result { background: linear-gradient(90deg, rgba(56, 189, 248, .5), rgba(56, 189, 248, .85)); }
.wf-row .wf-v { font-size: 12.5px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.wf-row.total .wf-n { color: var(--gold); }
.wf-row.result .wf-n, .wf-row.result .wf-v { color: var(--cyan); }
.wf-note { font-size: 12px; color: var(--muted2); margin-top: 10px; line-height: 1.6; }
.wf-footer { font-size: 12.5px; color: var(--muted); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); line-height: 1.7; }
.wf-footer b { color: var(--text); }

/* ---------- 风险 ---------- */
.risk-tally { display: flex; gap: 14px; font-size: 12.5px; margin-bottom: 12px; flex-wrap: wrap; }
.risk-tally span { color: var(--muted); }
.risk-tally b { font-weight: 600; margin-left: 4px; }
.risk-list { display: flex; flex-direction: column; gap: 8px; }
.risk-item {
  display: grid; grid-template-columns: 46px 1fr; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  background: rgba(255, 255, 255, .028); border-left: 2px solid var(--border);
}
.risk-item .lv { font-size: 11.5px; font-weight: 600; padding-top: 1px; }
.risk-item .bd { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.risk-item .bd b { color: var(--text); font-weight: 500; display: block; margin-bottom: 2px; font-size: 13px; }
.risk-item.ok { border-left-color: #2ebd85; }
.risk-item.ok .lv { color: #2ebd85; }
.risk-item.warn { border-left-color: #f59e0b; background: rgba(245, 158, 11, .05); }
.risk-item.warn .lv { color: #f59e0b; }
.risk-item.bad { border-left-color: #f6465d; background: rgba(246, 70, 93, .06); }
.risk-item.bad .lv { color: #f6465d; }

/* ---------- 趋势 ---------- */
.trend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.trend-card { background: rgba(255, 255, 255, .022); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.trend-card h4 { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; font-weight: 400; }
.trend-card .unit { float: right; color: var(--muted2); font-size: 11px; }
.trend-card svg { display: block; width: 100%; height: 74px; }
.trend-card .ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted2); margin-top: 5px; font-variant-numeric: tabular-nums; }

/* ---------- 主营 ---------- */
.biz-wrap { overflow-x: auto; }
.biz-tb { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 520px; }
.biz-tb th {
  text-align: right; color: var(--muted2); font-weight: 400; font-size: 11.5px;
  padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.biz-tb th:first-child { text-align: left; }
.biz-tb td { padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, .04); text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.biz-tb td:first-child { text-align: left; color: var(--text); }
.biz-tb td.sh { color: var(--muted); }
.biz-tb .mini { height: 4px; background: rgba(255, 255, 255, .07); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.biz-tb .mini i { display: block; height: 100%; background: rgba(212, 175, 55, .65); }

/* ---------- 底部 ---------- */
.fin-dis {
  font-size: 11.5px; color: var(--muted2); line-height: 1.8;
  padding: 14px 2px 0; border-top: 1px solid var(--border); margin-top: 4px;
}
.fin-dis b { color: var(--muted); font-weight: 500; }
.fin-empty { padding: 44px 10px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; }
.fin-empty b { color: var(--gold); }

@media (max-width: 720px) {
  .wf-row { grid-template-columns: 104px 1fr 46px; gap: 7px; }
  .wf-row .wf-n { font-size: 11.5px; }
  .fin-score { text-align: left; }
  .fin-head { padding: 14px 16px; }
}
/* 换一只：财务面内直达技术面搜索框 */
.fin-switch {
  appearance: none; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--gold);
  border: 1px solid rgba(212, 175, 55, .45); border-radius: 7px;
  padding: 5px 13px; font-size: 12.5px; line-height: 1.3;
  transition: all .16s ease;
}
.fin-switch:hover {
  background: rgba(212, 175, 55, .12);
  border-color: var(--gold);
  color: var(--gold2);
}
/* 近期事件：涨跌停 / 龙虎榜时间线 */
.ev-list { display: flex; flex-direction: column; gap: 6px; }
.ev-item {
  display: grid; grid-template-columns: 52px 56px 1fr; gap: 10px;
  align-items: baseline; padding: 7px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .025); border-left: 2px solid var(--border);
  font-size: 12.5px;
}
.ev-item .ev-d { color: var(--muted2); font-variant-numeric: tabular-nums; font-size: 12px; }
.ev-item .ev-t { font-weight: 600; font-size: 12px; }
.ev-item .ev-x { color: var(--muted); line-height: 1.55; }
.ev-item.ev-zt { border-left-color: #f6465d; }
.ev-item.ev-zt .ev-t { color: #f6465d; }
.ev-item.ev-dt { border-left-color: #2ebd85; }
.ev-item.ev-dt .ev-t { color: #2ebd85; }
.ev-item.ev-lhb { border-left-color: var(--gold); }
.ev-item.ev-lhb .ev-t { color: var(--gold); }
@media (max-width: 720px) {
  .ev-item { grid-template-columns: 46px 50px 1fr; gap: 7px; font-size: 12px; }
}
/* 六项区块：左雷达 + 右卡片 */
.dims-wrap {
  display: grid; grid-template-columns: 268px 1fr; gap: 12px;
  align-items: stretch; margin-bottom: 14px;
}
.dims-wrap .fin-dims { margin-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.radar-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 12px 10px; text-align: center;
  display: flex; flex-direction: column; justify-content: center;
}
.radar-svg { display: block; width: 100%; height: auto; }
.radar-cap { font-size: 11.5px; color: var(--muted2); margin-top: 2px; }
@media (max-width: 900px) {
  .dims-wrap { grid-template-columns: 1fr; }
  .radar-card { max-width: 320px; margin: 0 auto; }
}
