/* ==========================================================================
 * 视觉增强层（polish.css）
 *
 * 原则：只做增强，绝不重排既有布局。所有颜色都取 dashboard.css 的主题变量，
 * 因此浅色／深色主题会自动跟随，不需要在这里再写一套 :root[data-theme]。
 * ========================================================================== */

/* --------------------------------------------------------------------------
 * 1. 今日洞察
 * -------------------------------------------------------------------------- */
.insight-board {
  margin: 0 0 26px;
}

.insight-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.insight-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.insight-head h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}

.insight-head p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 0;
}

.insight-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.insight-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px 16px 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

/* 左侧强调条：颜色随洞察类型变化 */
.insight-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent, #1d4ed8);
}

.insight-item:hover {
  transform: translateY(-1px);
}

.insight-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  background: var(--surface-muted);
  color: var(--muted);
}

.insight-copy {
  min-width: 0;
}

.insight-copy h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 2px 0 3px;
  line-height: 1.45;
}

.insight-copy p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* 收益向（盈利＝红，亏损＝绿，沿用中文市场习惯） */
.insight-item.tone-gain::before { background: var(--profit, #dc2626); }
.insight-item.tone-gain .insight-icon { background: color-mix(in srgb, var(--profit, #dc2626) 12%, transparent); color: var(--profit, #dc2626); }

.insight-item.tone-risk::before { background: var(--loss, #15945f); }
.insight-item.tone-risk .insight-icon { background: color-mix(in srgb, var(--loss, #15945f) 12%, transparent); color: var(--loss, #15945f); }

.insight-item.tone-warn::before { background: var(--warm, #e77555); }
.insight-item.tone-warn .insight-icon { background: color-mix(in srgb, var(--warm, #e77555) 14%, transparent); color: var(--warm, #e77555); }

.insight-item.tone-plan::before { background: var(--brand, #4468e8); }
.insight-item.tone-plan .insight-icon { background: color-mix(in srgb, var(--brand, #4468e8) 12%, transparent); color: var(--brand, #4468e8); }

.insight-item.tone-info::before { background: var(--soft, #8a8a8a); }

.insight-empty {
  padding: 16px 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-muted);
}

/* 窄屏（手机）单列 */
@media (max-width: 760px) {
  .insight-list { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
 * 2. 全局细节增强
 * -------------------------------------------------------------------------- */

/* 数字统一等宽，行情刷新时不会因为位数变化而左右抖动 */
body {
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 键盘可见焦点（鼠标点击不出现，避免视觉噪音） */
:focus-visible {
  outline: 2px solid var(--brand, #4468e8);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 滚动条：贴合主题，比系统默认更细 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line, #e5e5e5) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line, #e5e5e5);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-clip: padding-box; background-color: var(--soft, #8a8a8a); }
::-webkit-scrollbar-corner { background: transparent; }

/* 可点元素的按压反馈 */
button:not(:disabled):active { transform: translateY(0.5px); }
button:disabled { cursor: not-allowed; }

/* 链接类导航的过渡统一 */
a, button { transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease; }

/* 图片/图标不被拉伸 */
img, svg { max-width: 100%; }

/* 尊重系统的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
