/**
 * Trading Central Widgets 样式文件
 * 用于多语言文章详情页的 Trading Central 组件样式
 * 版本: 1.0.0
 */

/* 确保所有 Trading Central 自定义元素可见 */
tc-sentiment-score,
tc-sentiment-subjectivity,
tc-sentiment-confidence,
tc-sentiment-trend,
tc-sentiment-history,
tc-sentiment-fear-index,
tc-fundamentals-quantamental-score,
tc-fundamentals-target-price,
tc-fundamentals-fair-value,
tc-fundamentals-consensus,
tc-technicals-summary-score,
tc-economics-earnings-calendar,
tc-news-volume,
tc-news-feed {
  display: block !important;
  width: 100% !important;
  min-height: 200px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 确保 tc-card 容器有正确的高度 - 统一所有组件的高度 */
tc-sentiment-score tc-card,
tc-sentiment-subjectivity tc-card,
tc-sentiment-confidence tc-card,
tc-sentiment-trend tc-card,
tc-sentiment-history tc-card,
tc-sentiment-fear-index tc-card,
tc-fundamentals-quantamental-score tc-card,
tc-fundamentals-target-price tc-card,
tc-fundamentals-fair-value tc-card,
tc-fundamentals-consensus tc-card,
tc-technicals-summary-score tc-card,
tc-economics-earnings-calendar tc-card,
tc-news-volume tc-card,
tc-news-feed tc-card,
tc-card.card-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
  position: relative !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 确保 tc-card 内部容器有正确的高度 - 统一高度 */
tc-card .card-content-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 180px !important;
  min-height: 180px !important;
  max-height: 180px !important;
  position: relative !important;
  flex: 1 1 auto !important;
  justify-content: flex-start !important; /* 顶部对齐，确保三个组件对齐 */
  align-items: center !important;
}

/* 针对所有可能的 gauge 容器 */
tc-card .tc-continuous-arc-gauge-container,
tc-card .tc-continuous-arc-gauge-svg-container,
tc-card .tc-gauge-container,
tc-card .tc-chart-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
}

/* 修复 tc-arc-gauge 组件的布局 - 覆盖 mobile 类的横向布局和内联样式 */
tc-arc-gauge .tc-arc-gauge-container,
tc-arc-gauge .tc-arc-gauge-container.mobile,
tc-arc-gauge div.tc-arc-gauge-container,
tc-arc-gauge div.tc-arc-gauge-container.mobile {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important; /* 改为顶部对齐，确保三个组件对齐 */
  align-items: center !important; /* 水平居中 */
  width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* 使用 JavaScript 无法覆盖内联样式时，使用更高优先级的选择器 */
tc-arc-gauge[_ngcontent] .tc-arc-gauge-container[_ngcontent],
tc-arc-gauge[_ngcontent] .tc-arc-gauge-container.mobile[_ngcontent] {
  justify-content: flex-start !important; /* 改为顶部对齐，确保三个组件对齐 */
  align-items: center !important; /* 水平居中 */
  flex-direction: column !important;
}

/* 确保 tc-arc-title-container 不占用过多空间 - 移到下方，垂直排列子元素 */
tc-arc-gauge .tc-arc-title-container {
  width: 100% !important;
  flex-shrink: 0 !important;
  padding: 8px 0 !important;
  text-align: center !important;
  order: 2 !important;  /* 移到下方 */
  display: flex !important; /* 使用 flex 布局 */
  flex-direction: column !important; /* 垂直排列 */
  align-items: center !important; /* 居中对齐 */
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* 确保三个组件的 tc-arc-gauge-container 顶部对齐 */
.widget-wrapper tc-sentiment-subjectivity tc-arc-gauge .tc-arc-gauge-container,
.widget-wrapper tc-sentiment-confidence tc-arc-gauge .tc-arc-gauge-container {
  justify-content: flex-start !important; /* 改为顶部对齐，而不是居中 */
  align-items: center !important;
}

/* 确保情绪评分组件也顶部对齐 */
.widget-wrapper tc-sentiment-score tc-card .card-content-container {
  justify-content: flex-start !important; /* 改为顶部对齐 */
  align-items: center !important;
}

/* 确保文字说明（标题）可见 - 在上方 */
tc-arc-gauge .tc-arc-gauge-title {
  display: block !important; /* 改为 block，独占一行 */
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  height: auto !important;
  width: auto !important;
  font-weight: normal !important;
  order: 1 !important; /* 在上方 */
  margin-bottom: 4px !important; /* 与数值之间的间距 */
}

/* 确保分数 span 可见 - 在下方，字体缩小 */
tc-arc-gauge .tc-arc-gauge-title-score {
  display: block !important; /* 改为 block，独占一行 */
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
  font-size: 12px !important; /* 缩小数值字体 */
  line-height: 1.5 !important;
  height: auto !important;
  width: auto !important;
  min-height: auto !important;
  min-width: auto !important;
  font-weight: normal !important;
  order: 2 !important; /* 在下方 */
}

/* 确保 tc-arc-svg-container 占据剩余空间 - 缩小尺寸以匹配 market.html，并居中 */
tc-arc-gauge .tc-arc-svg-container {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 100px !important;
  max-height: 120px !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  order: 1 !important;  /* 移到上方 */
  margin: 0 auto !important; /* 水平居中 */
}

/* 确保 SVG 有正确的尺寸 - 缩小尺寸以匹配 market.html */
tc-arc-gauge .tc-arc-svg-container svg,
tc-arc-gauge .tc-arc-gauge-component {
  width: 100% !important;
  min-width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 120px !important;
  min-height: 100px !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

/* 确保 tc-arc-icon 图标居中显示 - 缩小图标以匹配 market.html 的比例 */
tc-arc-gauge .tc-arc-icon {
  transform-origin: center center !important;
  /* 使用 SVG 坐标单位（无单位）使图标居中并保持 scale(0.4) */
  /* SVG viewBox 是 "0 0 79.5 39.5" */
  /* 调整后：translate(23.11, 27.65) scale(0.4) translate(-39.75, -59.75) */
  /* 注意：CSS transform 语法使用逗号分隔参数，但 SVG 内部元素可能不支持 CSS transform */
  /* 如果 CSS 不生效，说明 SVG 元素上已有 transform 属性，需要通过 JS 设置 SVG transform 属性 */
  transform: translate(23.11, 27.65) scale(0.4) translate(-39.75, -59.75) !important;
}

/* SVG 容器尺寸 - 缩小以匹配 market.html */
tc-arc-gauge .tc-arc-svg-container {
  min-width: 200px !important;
  min-height: 100px !important;
  max-height: 120px !important;
}

/* 确保 tc-arc-container 有足够的空间 */
tc-arc-gauge .tc-arc-container {
  width: 100% !important;
  height: 100% !important;
}

/* 确保 SVG 容器内的内容居中 */
tc-arc-gauge .tc-arc-svg-container {
  position: relative !important;
}

/* 确保 SVG 元素本身居中 */
tc-arc-gauge svg.tc-arc-gauge-component {
  display: block !important;
  margin: 0 auto !important;
}

/* 确保所有 SVG 和文字层正确叠加 */
tc-card .tc-continuous-arc-gauge-svg-container svg,
tc-card .tc-continuous-arc-gauge-svg-container .tc-text-overlay,
tc-card svg,
tc-card .tc-text-overlay {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* 主观性：将分数文字移到圆弧下方 */
tc-sentiment-subjectivity .tc-continuous-arc-gauge-svg-container .tc-text-overlay,
tc-sentiment-subjectivity .tc-text-overlay {
  position: absolute !important;
  top: auto !important;
  bottom: 10% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: auto !important;
  height: auto !important;
  text-align: center !important;
}

tc-sentiment-subjectivity .tc-text-layout,
tc-sentiment-subjectivity .tc-score-text {
  text-align: center !important;
}

/* 调整主观性 SVG 中 foreignObject 的位置 */
tc-sentiment-subjectivity svg foreignObject {
  y: 60% !important;
}

/* 确保 subjectivity 和 confidence 组件的内容可见 - 统一高度 */
tc-sentiment-subjectivity tc-card,
tc-sentiment-confidence tc-card {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 确保 card-controls-container 和 tc-flex-filler 有正确的高度 */
tc-card .card-controls-container {
  display: flex !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  position: relative !important;
  flex-shrink: 0 !important;
}

tc-card .tc-flex-filler {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

/* 统一所有组件的 card-content-container 高度 */
tc-sentiment-score tc-card .card-content-container,
tc-sentiment-subjectivity tc-card .card-content-container,
tc-sentiment-confidence tc-card .card-content-container {
  height: 180px !important;
  min-height: 180px !important;
  max-height: 180px !important;
  flex: 0 0 180px !important; /* 防止 flex 布局影响高度 */
}

/* 确保情绪评分、主观性和信息可信度的 tc-card 高度一致 */
.widget-wrapper tc-sentiment-score tc-card,
.widget-wrapper tc-sentiment-subjectivity tc-card,
.widget-wrapper tc-sentiment-confidence tc-card {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
  flex: 0 0 200px !important; /* 防止 flex 布局影响高度 */
}

/* 确保三个组件的整体高度一致 */
.widget-wrapper tc-sentiment-score,
.widget-wrapper tc-sentiment-subjectivity,
.widget-wrapper tc-sentiment-confidence {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
}

/* 覆盖全文的 flex-shrink:0 影响 */
tc-card,
tc-card * {
  flex-shrink: 1 !important;
}

tc-card.card-container {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
}

/* 确保 widget 内部的 SVG 有正确尺寸 */
tc-sentiment-score svg,
tc-sentiment-subjectivity svg,
tc-sentiment-confidence svg,
tc-sentiment-trend svg,
tc-sentiment-history svg,
tc-sentiment-fear-index svg,
tc-fundamentals-quantamental-score svg,
tc-fundamentals-target-price svg,
tc-fundamentals-fair-value svg,
tc-fundamentals-consensus svg,
tc-technicals-summary-score svg,
tc-economics-earnings-calendar svg,
tc-news-volume svg,
tc-news-feed svg,
tc-sentiment-score canvas,
tc-sentiment-subjectivity canvas,
tc-sentiment-confidence canvas,
tc-sentiment-trend canvas,
tc-sentiment-history canvas,
tc-sentiment-fear-index canvas,
tc-fundamentals-quantamental-score canvas,
tc-fundamentals-target-price canvas,
tc-fundamentals-fair-value canvas,
tc-fundamentals-consensus canvas,
tc-technicals-summary-score canvas,
tc-economics-earnings-calendar canvas,
tc-news-volume canvas,
tc-news-feed canvas {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-width: 100px !important;
  min-height: 100px !important;
  max-width: 100% !important;
  position: relative !important;
}

/* 确保 widget 内部容器有正确的定位上下文 */
tc-sentiment-score > *,
tc-sentiment-subjectivity > *,
tc-sentiment-confidence > *,
tc-sentiment-trend > *,
tc-sentiment-history > *,
tc-sentiment-fear-index > *,
tc-fundamentals-quantamental-score > *,
tc-fundamentals-target-price > *,
tc-fundamentals-fair-value > *,
tc-fundamentals-consensus > *,
tc-technicals-summary-score > *,
tc-economics-earnings-calendar > *,
tc-news-volume > *,
tc-news-feed > * {
  position: relative !important;
  width: 100% !important;
}

.widget-wrapper {
  display: block !important;
  width: 100% !important;
  min-height: 200px !important;
}

/* Trading Central Widget Grid 布局 - 类似 market.html */
.trading-central-widgets .widget-list {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
  margin-bottom: 0 !important;
  align-items: start !important;  /* 顶部对齐，确保所有组件在同一水平线 */
}

/* 响应式：小屏幕时自动换行 */
@media (max-width: 1200px) {
  .trading-central-widgets .widget-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .trading-central-widgets .widget-list {
    grid-template-columns: 1fr !important;
  }
  /* 情绪评分使用 tc-continuous-arc-gauge（非 tc-arc-gauge），
     弧线是 D3 填充路径（innerRadius=36, outerRadius=40），无法靠 stroke-width 修改粗细。
     通过约束 SVG 容器高度，使弧线等比缩小，达到与主观性一致的视觉效果。
     缩小到 55px 后：scale = min(180/79.5, 55/39.5) ≈ 1.39，弧宽 ≈ 4*1.39 ≈ 5.6px，与主观性 ≈ 6px 接近 */
  .widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score .tc-continuous-arc-gauge-svg-container {
    max-height: 55px !important;
    min-height: 45px !important;
    max-width: 180px !important;
    margin: 0 auto !important;
  }
  /* 整体容器下移由 JS constrainSentimentArc() 控制，CSS 不单独设置 margin-top */
  .widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score .tc-continuous-arc-gauge-container {
    justify-content: flex-start !important;
    align-items: center !important;
  }
}

.trading-central-widgets .widget-item {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 20px !important;
  padding-top: 20px !important;
  background: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  min-height: 280px !important;
  align-self: start !important;  /* 确保每个 item 从顶部开始对齐 */
  vertical-align: top !important;
}

/* 确保情绪评分组件没有额外的上边距 */
.trading-central-widgets .widget-item:first-child {
  margin-top: 0 !important;
  padding-top: 20px !important;
}

/* 确保所有 widget-item 内的第一个元素（标题）顶部对齐 */
.trading-central-widgets .widget-item > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 确保情绪评分组件本身没有额外的 margin 或 padding */
.trading-central-widgets .widget-item tc-sentiment-score {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* 确保情绪评分组件内的 tc-card 也没有额外的上边距 */
.trading-central-widgets .widget-item tc-sentiment-score tc-card {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 确保所有 widget-item 的顶部完全对齐 */
.trading-central-widgets .widget-list > .widget-item {
  margin-top: 0 !important;
  padding-top: 20px !important;
}

.trading-central-widgets .widget-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-top: 0 !important;
  margin-bottom: 15px !important;
  padding-top: 0 !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid #eee;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.5 !important;
}

.trading-central-widgets .widget-wrapper {
  min-height: 200px !important;
  height: 200px !important; /* 统一高度 */
  max-height: 200px !important; /* 统一最大高度 */
  width: 100% !important;
  display: flex !important; /* 使用 flex 布局以便居中 */
  align-items: center !important; /* 垂直居中 */
  justify-content: center !important; /* 水平居中 */
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 确保 tc-arc-gauge 在 widget-wrapper 中居中 */
.widget-wrapper tc-sentiment-subjectivity,
.widget-wrapper tc-sentiment-confidence {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

/* 确保 tc-card 在 widget-wrapper 中居中 */
.widget-wrapper tc-sentiment-subjectivity tc-card,
.widget-wrapper tc-sentiment-confidence tc-card {
  margin: 0 auto !important; /* 水平居中 */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Tooltip 图标和提示框样式 */
.trading-central-widgets .widget-card-title {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  z-index: 10 !important; /* 确保提示气泡浮于下方 widget-wrapper 之上，避免被图表区域挡住 */
}

.trading-central-widgets .widget-tooltip-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  margin-left: 8px !important;
  cursor: pointer !important;
  position: relative !important;
  flex-shrink: 0 !important;
  border: 1.5px solid #999 !important;
  border-radius: 50% !important;
  background: transparent !important;
}

.trading-central-widgets .widget-tooltip-icon .icon-exclaim {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  font-style: normal !important;
  color: #666 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.trading-central-widgets .widget-tooltip-icon:hover {
  border-color: #777 !important;
  background: #f5f5f5 !important;
}

.trading-central-widgets .widget-tooltip-icon:hover .icon-exclaim {
  color: #444 !important;
}

/* Tooltip 提示框 */
.trading-central-widgets .widget-tooltip-icon::before {
  content: attr(data-tooltip) !important;
  position: absolute !important;
  bottom: 100% !important;
  right: 0 !important;
  margin-bottom: 8px !important;
  padding: 8px 12px !important;
  background-color: #333 !important;
  color: #fff !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  border-radius: 4px !important;
  white-space: normal !important;
  width: 240px !important;
  max-width: 240px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.2s ease, visibility 0.2s ease !important;
  z-index: 1000 !important;
  pointer-events: none !important;
  text-align: left !important;
  word-wrap: break-word !important;
}

.trading-central-widgets .widget-tooltip-icon::after {
  content: '' !important;
  position: absolute !important;
  bottom: 100% !important;
  right: 12px !important;
  margin-bottom: 2px !important;
  border: 5px solid transparent !important;
  border-top-color: #333 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.2s ease, visibility 0.2s ease !important;
  z-index: 1001 !important;
  pointer-events: none !important;
}

.trading-central-widgets .widget-tooltip-icon:hover::before,
.trading-central-widgets .widget-tooltip-icon:hover::after {
  opacity: 1 !important;
  visibility: visible !important;
}

/* RTL（如阿拉伯语）：提示气泡改为从图标向左对齐、向右展开，避免向左超出被 .trading-central-widgets 或相邻卡片挡住 */
[dir="rtl"] .trading-central-widgets .widget-tooltip-icon::before {
  right: auto !important;
  left: 0 !important;
  text-align: right !important;
}
[dir="rtl"] .trading-central-widgets .widget-tooltip-icon::after {
  right: auto !important;
  left: 12px !important;
}

/* RTL（如阿拉伯语）：مصداقية المعلومات、الذاتية 的 SVG/仪表盘居右，避免圆弧左侧被裁切导致削平 */
/* 解除 .html-inner 的 overflow:hidden，避免裁切圆弧（forex-detail.css 中 .html-inner { overflow: hidden }） */
[dir="rtl"] .html-inner:has(.trading-central-widgets) {
  overflow: visible !important;
}
[dir="rtl"] .trading-central-widgets .widget-item,
[dir="rtl"] .trading-central-widgets .widget-wrapper,
[dir="rtl"] .trading-central-widgets tc-card,
[dir="rtl"] .trading-central-widgets .card-content-container {
  overflow: visible !important;
}
[dir="rtl"] .trading-central-widgets {
  overflow: visible !important;
}
/* tc-arc-gauge：SVG 容器仅占右侧 86%，留出左侧空间，整段圆弧完整显示 */
[dir="rtl"] .widget-wrapper tc-sentiment-subjectivity tc-arc-gauge .tc-arc-gauge-container,
[dir="rtl"] .widget-wrapper tc-sentiment-confidence tc-arc-gauge .tc-arc-gauge-container {
  align-items: flex-start !important;
  overflow: visible !important;
}
[dir="rtl"] .tc-arc-gauge .tc-arc-svg-container {
  margin-inline-start: 0 !important;
  margin-inline-end: auto !important;
  width: 86% !important;
  max-width: 86% !important;
  min-width: 0 !important;
  overflow: visible !important;
}
/* tc-continuous-arc-gauge：仅占右侧 86%，左侧留空，圆弧不被裁切 */
[dir="rtl"] tc-sentiment-subjectivity .tc-continuous-arc-gauge-svg-container,
[dir="rtl"] tc-sentiment-confidence .tc-continuous-arc-gauge-svg-container {
  left: 14% !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  overflow: visible !important;
}
[dir="rtl"] tc-sentiment-subjectivity .tc-continuous-arc-gauge-container,
[dir="rtl"] tc-sentiment-confidence .tc-continuous-arc-gauge-container {
  overflow: visible !important;
}

/* 仅西班牙语：组件标题（如 Credibilidad de la información）过长易换行导致高度不一致，缩小字体以尽量单行或统一标题区高度 */
body.lang-es .trading-central-widgets .widget-card-title,
body.lang-es .trading-central-widgets .widget-card-title > span:first-child {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* 仅俄语：组件标题（如 Достоверность информации、Субъективность）过长易换行导致高度不一致，缩小字体 */
body.lang-ru .trading-central-widgets .widget-card-title,
body.lang-ru .trading-central-widgets .widget-card-title > span:first-child {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* 仅蒙古语：组件标题（如 Мэдээллийн найдвартай байдал、Субъектив итгэл）过长易换行导致高度不一致，缩小字体 */
body.lang-mn .trading-central-widgets .widget-card-title,
body.lang-mn .trading-central-widgets .widget-card-title > span:first-child {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* 仅阿拉伯语：组件标题（如 مصداقية المعلومات、درجة المشاعر）过长易换行导致高度不一致，缩小字体 */
body.lang-ar .trading-central-widgets .widget-card-title,
body.lang-ar .trading-central-widgets .widget-card-title > span:first-child {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* 仅印地语：组件标题（如 जानकारी की विश्वसनीयता、सेटिमेंट तर्कसंगतता）过长易换行导致高度不一致，缩小字体 */
body.lang-hi .trading-central-widgets .widget-card-title,
body.lang-hi .trading-central-widgets .widget-card-title > span:first-child {
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* ============================================
   恐惧指数 (Fear Index) 独立样式
   高度与情绪评分、主观性保持一致
   颜色与其它情绪组件一致，无特殊 hover 动效
   ============================================ */

/* 恐惧指数容器 - 高度与颜色与其他组件一致 */
.trading-central-widgets .widget-item[data-widget-type="fear_index"] {
  min-height: 280px !important;  /* 与默认高度一致 */
  background: #fff !important;  /* 与其他组件一致 */
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;  /* 与其他组件一致 */
}

/* 恐惧指数标题 - 与其他组件一致 */
.trading-central-widgets .widget-item[data-widget-type="fear_index"] .widget-card-title {
  color: #333 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-bottom: 1px solid #eee !important;
}

/* 恐惧指数 wrapper 高度 - 与其他组件一致 */
.widget-wrapper[data-widget-type="fear_index"] {
  min-height: 200px !important;
  height: 200px !important;
  max-height: 200px !important;
}

/* 恐惧指数组件本身 - 高度一致 */
.widget-wrapper[data-widget-type="fear_index"] tc-sentiment-fear-index {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
}

/* 恐惧指数卡片容器 - 高度一致 */
.widget-wrapper[data-widget-type="fear_index"] tc-sentiment-fear-index tc-card {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
  flex: 0 0 200px !important;
}

/* 恐惧指数内容区域 - 高度一致 */
.widget-wrapper[data-widget-type="fear_index"] tc-sentiment-fear-index tc-card .card-content-container {
  height: 180px !important;
  min-height: 180px !important;
  max-height: 180px !important;
  flex: 0 0 180px !important;
}

/* 恐惧指数内小图标 SVG 不参与全局 100% 宽高，固定为约 18px 图标尺寸 */
.widget-wrapper[data-widget-type="fear_index"] .tc-sentiment-fear-index-item-value-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.widget-wrapper[data-widget-type="fear_index"] .tc-sentiment-fear-index-item-value-icon svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: block !important;
  flex-shrink: 0 !important;
}

/* ============================================
   市场情绪信号 (Sentiment Signal) 独立样式
   高度与情绪评分、理性程度等一致，可在此单独改样式
   ============================================ */

.trading-central-widgets .widget-item[data-widget-type="sentiment_trend"] {
  min-height: 280px !important;
  background: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.trading-central-widgets .widget-item[data-widget-type="sentiment_trend"] .widget-card-title {
  color: #333 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border-bottom: 1px solid #eee !important;
}

.widget-wrapper[data-widget-type="sentiment_trend"] {
  min-height: 200px !important;
  height: 200px !important;
  max-height: 200px !important;
}

.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
}

.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend tc-card {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
  flex: 0 0 200px !important;
}

.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend tc-card .card-content-container {
  height: 180px !important;
  min-height: 180px !important;
  max-height: 180px !important;
  flex: 0 0 180px !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

/* 市场情绪信号内容纵向排列：箭头在上、文字在下 - 针对实际DOM结构 */
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend .tc-signal-container {
  display: flex !important;
  flex-direction: column-reverse !important;  /* column-reverse 让后面的图标显示在上方 */
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
}

/* 市场情绪信号整体向上移动 */
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend tc-signal {
  margin-top: 50px !important;
}

/* 情绪评分弧线（PC + 移动端均生效）：
   tc-sentiment-score 内部用的是 tc-continuous-arc-gauge，不是 tc-arc-gauge。
   弧线是 D3 填充路径，视觉粗细由容器高度决定（高度越大弧线越粗）。
   设 max-height: 60px → scale ≈ 1.52 → 弧宽 ≈ 6.1px，与主观性 (~6.3px) 接近。
   用 margin-top 把弧线整体下移，使弧线底部与主观性弧线底部对齐（主观性弧区约 120px 高）。 */
.widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score .tc-continuous-arc-gauge-container {
  justify-content: flex-start !important;
  align-items: center !important;
}
.widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score .tc-continuous-arc-gauge-svg-container {
  max-height: 60px !important;
  min-height: 48px !important;
}

/* 情绪评分整体位移：由 trading-central-widgets.js 的 constrainSentimentArc() 通过 JS 控制
   （CSS padding-top 在固定高度 flex 容器中效果不稳定，改用 JS margin-top 更可靠） */

/* 情绪评分：数值字体大小 */
.widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score .tc-score-text,
.widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score .tc-score-text span {
  font-size: 20px !important;
  line-height: 1.2 !important;
  font-weight: 500 !important;
}

/* 情绪评分：调整 foreignObject 位置让数值更靠上 */
.widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score svg.tc-text-overlay foreignObject {
  y: 55 !important;
  height: 50% !important;
}

/* 情绪评分容器：调整布局，给底部文字留更多空间 */
.widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score tc-arc-gauge .tc-arc-gauge-container {
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 0 !important;
}

/* 情绪评分的 tc-arc-title-container 推到底部 */
.widget-wrapper[data-widget-type="sentiment"] tc-sentiment-score tc-arc-gauge .tc-arc-title-container {
  margin-top: auto !important;
  padding: 8px 0 !important;
  flex-shrink: 0 !important;
}

/* 主观性保持默认尺寸（120px） */
.widget-wrapper[data-widget-type="subjectivity"] tc-sentiment-subjectivity tc-arc-gauge .tc-arc-svg-container {
  max-height: 120px !important;
  min-height: 100px !important;
}

/* 文字容器居中 */
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend .tc-signal-details-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}

/* 市场情绪信号主文字（如"中性"）字体大小与情绪评分一致 */
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend .tc-signal-text {
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-weight: normal !important;
}

/* 市场情绪信号副文字（如"下次更新"）保持较小尺寸 */
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend .tc-signal-label-details {
  font-size: 12px !important;
  line-height: 1.4 !important;
}

/* 图标容器 */
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend .tc-icon-container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 强制覆盖 TC 组件内部所有可能的横向布局容器 */
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend tc-card .card-content-container > *,
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend [class*="sentiment"],
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend [class*="tc-sentiment"],
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend [class*="item-container"],
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend [class*="content-container"] {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 覆盖可能的 row 布局 */
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend [class*="row"],
.widget-wrapper[data-widget-type="sentiment_trend"] tc-sentiment-trend .tc-flex-row {
  flex-direction: column !important;
}

/* 情绪组件右侧箭头图标尺寸 */
.trading-central-widgets .tc-icon-container,
.trading-central-widgets .tc-icon-container svg {
  width: 70px !important;
  height: 70px !important;
  min-width: 70px !important;
  min-height: 70px !important;
  max-width: 70px !important;
  max-height: 70px !important;
}

/* 信息可信度保持原有样式（明确保留默认高度） */
.widget-item[data-widget-type="confidence"] {
  min-height: 280px !important;  /* 默认高度 */
}

.widget-wrapper[data-widget-type="confidence"] {
  min-height: 200px !important;
  height: 200px !important;
  max-height: 200px !important;
}

.widget-wrapper[data-widget-type="confidence"] tc-sentiment-confidence {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
}

.widget-wrapper[data-widget-type="confidence"] tc-sentiment-confidence tc-card {
  height: 200px !important;
  min-height: 200px !important;
  max-height: 200px !important;
}

/* RTL 语言下恐惧指数的特殊处理 */
[dir="rtl"] .trading-central-widgets .widget-item[data-widget-type="fear_index"] .widget-card-title {
  text-align: right !important;
}

