/* 立场追踪正文：以 .stance-page 作用域隔离，避免与 style.css / overview.css 冲突。
   类名对齐 app/stance.py 的渲染输出（st- 前缀）。
   配色口径：红=看多、绿=看空（A 股红涨绿跌，与后台 K 线一致），灰=中性/未表态，
   黄底高亮=反转/变化终点徽标。 */

.stance-page {
  --st-primary: #0A5EB0;
  --st-primary-2: #1272CC;
  --st-bg: #F7F8FA;
  --st-card-bg: #FFFFFF;
  --st-text: #1F2937;
  --st-text-sub: #6B7280;
  --st-border: #E5E7EB;
  --st-bull: #D9393B;      /* 看多=红 */
  --st-bull-bg: rgba(217, 57, 59, .09);
  --st-bear: #2F9E44;      /* 看空=绿 */
  --st-bear-bg: rgba(47, 158, 68, .09);
  --st-neutral: #868E96;   /* 中性/未表态=灰 */
  --st-neutral-bg: rgba(134, 142, 150, .12);
  --st-hot: #FFF3BF;       /* 反转/变化终点高亮 */
  color: var(--st-text);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
.stance-page * { box-sizing: border-box; }

/* ---- 折叠通用（对齐 overview.css 的 .fold 交互） ---- */
.stance-page .fold-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.stance-page .arrow { flex-shrink: 0; color: var(--st-primary); margin-left: 10px; transition: transform .15s; }
.stance-page .fold.open > .fold-head .arrow { transform: rotate(90deg); }
.stance-page .fold > .fold-body { display: none; }
.stance-page .fold.open > .fold-body { display: block; }

/* ---- 卡片（主播,标的） ---- */
.stance-page .st-card {
  background: var(--st-card-bg);
  border: 1px solid var(--st-border);
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .05);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}
.stance-page .st-card:hover { box-shadow: 0 4px 16px rgba(10, 94, 176, .12); transform: translateY(-1px); }
.stance-page .st-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--st-bg) 100%);
}
.stance-page .st-avatar { flex: 0 0 auto; display: inline-flex; }
.stance-page .st-avatar img {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--st-border);
  display: block;
}
.stance-page .st-avatar-fallback {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--st-primary) 0%, var(--st-primary-2) 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}
.stance-page .st-author { font-size: 16px; font-weight: 600; color: var(--st-text); }
.stance-page .st-arrow-mark { color: var(--st-text-sub); }
.stance-page .st-asset { font-size: 16px; font-weight: 600; color: var(--st-primary); }
.stance-page .st-type {
  font-size: 12px; color: var(--st-text-sub);
  background: var(--st-bg); border: 1px solid var(--st-border);
  padding: 1px 8px; border-radius: 5px;
}
.stance-page .st-head-count { font-size: 12px; color: var(--st-text-sub); margin-left: auto; }
.stance-page .st-flip-badge {
  font-size: 12px; font-weight: 600; color: var(--st-bull);
  background: var(--st-bull-bg);
  padding: 2px 10px; border-radius: 999px;
}
.stance-page .st-card-body { padding: 4px 16px 12px; }

/* ---- 立场徽标：红=看多、绿=看空、灰=中性/未表态；hot=反转/变化终点 ---- */
.stance-page .st-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.stance-page .st-bull { color: var(--st-bull); background: var(--st-bull-bg); border-color: rgba(217, 57, 59, .25); }
.stance-page .st-bear { color: var(--st-bear); background: var(--st-bear-bg); border-color: rgba(47, 158, 68, .25); }
.stance-page .st-neutral, .stance-page .st-none { color: var(--st-neutral); background: var(--st-neutral-bg); border-color: rgba(134, 142, 150, .25); }
.stance-page .st-badge.hot { background: var(--st-hot); border-color: rgba(217, 57, 59, .45); box-shadow: 0 0 0 2px rgba(255, 243, 191, .6); }

/* ---- 时间线行（一期一行） ---- */
.stance-page .st-row { border-top: 1px dashed var(--st-border); }
.stance-page .st-row:first-child { border-top: none; }
.stance-page .st-row-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 10px 0;
}
.stance-page .st-date { font-size: 14px; font-weight: 600; color: var(--st-text); }
.stance-page .st-version { font-size: 12px; color: var(--st-text-sub); background: var(--st-bg); padding: 1px 8px; border-radius: 5px; }
.stance-page .st-no-detail { font-size: 12px; color: var(--st-neutral); margin-left: auto; }
/* 行头动作区：行内翻转标记 + 「总结 ↗」链接，统一右对齐 */
.stance-page .st-row-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-left: auto;
  flex: 0 0 auto;
}
/* 行内翻转标记：反转红 / 变化灰，title 悬停可见完整区间 */
.stance-page .st-row-flip {
  font-size: 12px;
  font-weight: 500;
  color: var(--st-text-sub);
  white-space: nowrap;
  cursor: help;
}
.stance-page .st-row-flip.st-flip-rev { color: var(--st-bull); font-weight: 600; }
.stance-page .st-row-body { padding: 0 0 12px 12px; border-left: 3px solid var(--st-border); margin-left: 4px; }
.stance-page .kv { padding: 3px 0; font-size: 14px; overflow: hidden; }
.stance-page .kv-label { font-weight: 600; color: var(--st-text-sub); margin-right: 6px; }
.stance-page .st-dim { margin-bottom: 8px; }
.stance-page .st-dim:last-child { margin-bottom: 0; }

/* ---- 投资机会条目（每期该标的的全部条目，懒加载后渲染） ---- */
.stance-page .st-item {
  border: 1px solid var(--st-border);
  border-radius: 8px;
  background: var(--st-card-bg);
  padding: 10px 12px;
  margin: 8px 0;
}
.stance-page .st-item:first-child { margin-top: 0; }
.stance-page .st-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--st-primary);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--st-border);
}
.stance-page .st-inline-sub { font-size: 13px; color: var(--st-text-sub); }
.stance-page .st-load-error { padding: 10px 12px; color: var(--st-neutral); font-size: 13px; }
.stance-page .st-change {
  font-size: 13px;
  color: var(--st-bull);
  background: var(--st-hot);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 6px;
}

/* ---- 原文引用折叠（对齐 overview.css 的 quote 系列，st- 作用域） ---- */
.stance-page .st-quote-wrap { display: contents; }
.stance-page .st-quote-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  float: right;
  margin-left: 8px;
  font-size: 12px;
  color: var(--st-primary);
  cursor: pointer;
  user-select: none;
}
.stance-page .st-quote-list { clear: right; margin-top: 8px; margin-bottom: 0; text-align: left; }
.stance-page .st-quote-item { display: block; margin-bottom: 10px; }
.stance-page .st-quote-item:last-child { margin-bottom: 0; }
.stance-page .st-quote-time { display: block; font-size: 13px; color: var(--st-neutral); margin-bottom: 2px; }
.stance-page .st-subtitle-link {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--st-primary);
  text-decoration: none;
}
.stance-page .st-subtitle-link:hover { text-decoration: underline; }
.stance-page .st-quote-text {
  display: block;
  font-size: 14px;
  color: var(--st-text-sub);
  background: var(--st-bg);
  padding: 8px 12px;
  border-radius: 6px;
}

/* ---- 「总结 ↗」文字链接：品牌蓝、无边框无背景、hover 下划线（对齐「字幕 ↗」观感） ---- */
.stance-page a.st-src-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  line-height: 1;
  color: var(--st-primary);
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}
.stance-page a.st-src-link::after { content: "↗"; font-size: 11px; opacity: .8; }
.stance-page a.st-src-link:hover { text-decoration: underline; }

/* ---- 筛选区（页面级，不在 .stance-page 作用域内） ---- */
.stance-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #FFFFFF;
  border: 1px solid var(--st-border, #E5E7EB);
  border-radius: 10px;
}
.stance-filters .st-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #1F2937; }
.stance-filters select {
  font: inherit;
  font-size: 14px;
  padding: 4px 10px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: #F7F8FA;
  color: #1F2937;
  max-width: 220px;
}
.stance-filters select:focus { outline: 2px solid rgba(10, 94, 176, .35); outline-offset: 1px; }
.stance-filters .st-filter-count { font-size: 13px; color: #6B7280; margin-left: auto; }

/* ---- 对比态（标的选具体值且主播为全部）：头像与主播名放大，主播身份是对比的识别锚点 ---- */
.stance-page.st-compare .st-avatar img, .stance-page.st-compare .st-avatar-fallback { width: 52px; height: 52px; font-size: 24px; }
.stance-page.st-compare .st-author { font-size: 18px; font-weight: 700; }
.stance-page.st-compare .st-asset { font-size: 14px; color: var(--st-text-sub); font-weight: 500; }

/* ---- 空态 ---- */
.st-empty {
  text-align: center;
  color: #6B7280;
  font-size: 14px;
  padding: 36px 0;
  background: #FFFFFF;
  border: 1px dashed #E5E7EB;
  border-radius: 12px;
}
