/* 版本、告警与反馈 */
#ver-badge {
  position: fixed;
  top: 9px;
  right: 13px;
  z-index: 80;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: color .16s ease, border-color .16s ease;
}
#ver-badge:hover { color: var(--accent); border-color: #aebbc7; }
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  padding: 8px 15px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(24, 38, 56, .16);
  color: #fff;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
#toast.show { opacity: 1; }
#toast.err { background: var(--up); }
#alert-badge {
  width: 100%;
  margin: 4px 0 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
}
#alert-badge.alert-err { color: #fff; border-color: var(--up); background: var(--up); }
#alert-badge.alert-warn { color: var(--warn); border-color: #ead5b7; background: #fffaf2; }

@media (max-width: 1180px) {
  .index-sync-main { grid-template-columns: minmax(205px, auto) 1fr; }
  .index-sync-times { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 14px; }
  .market-index-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overseas-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trends { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .index-refresh-btn { min-height: 44px; }
  .cols2 { grid-template-columns: 1fr; }
  .theme-primary-picker > header,
  .theme-primary-picker > footer { align-items: flex-start; flex-direction: column; }
  .theme-primary-current { padding-top: 0; white-space: normal; }
  button.theme-primary-option { min-height: 58px; }
  .top-stock-search { order: 2; flex-basis: 100%; }
  .themes { grid-template-columns: 1fr; }
  .theme-detail-head { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (max-width: 760px) {
  body { flex-direction: column; }
  #float-nav { display: none; }
  #anomaly-float-btn {
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    left: auto;
    transform: none;
  }
  #side {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 7px 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #side .brand {
    padding: 0 8px 0 0;
    border: 0;
  }
  #side .brand .logo { gap: 7px; }
  #side .brand .dot { width: 24px; height: 24px; border-radius: 6px; }
  #side .brand .dot::before {
    left: 6px;
    top: 6px;
    width: 12px;
    height: 12px;
  }
  #side .brand .sub { display: none; }
  #side .nav {
    display: flex;
    min-width: 0;
    margin-left: auto;
    padding: 0;
    overflow-x: auto;
  }
  #side .item {
    min-height: 44px;
    margin: 0;
    padding: 8px 10px;
    white-space: nowrap;
  }
  #side .item.on { box-shadow: inset 0 -2px var(--accent); }
  #alert-badge {
    width: auto;
    min-height: 36px;
    flex: none;
    margin: 2px 0 2px 4px;
    white-space: nowrap;
  }
  #content { width: 100%; }
  .wrap { margin: 8px auto; padding: 0 8px 20px; }
  .card { padding: 10px; }
  #main > section > .card > h2:first-child,
  #main > section > div > .card > h2:first-child {
    flex-wrap: wrap;
    margin: -10px -10px 8px;
    padding: 9px 10px;
  }
  .section-source {
    max-width: calc(100% - 26px);
    margin-left: 26px;
    white-space: normal;
  }
  .card-head-actions {
    width: calc(100% - 26px);
    margin-left: 26px;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .card-head-actions .section-source {
    max-width: none;
    margin-left: 0;
  }
  .market-index-panel > h2:first-child {
    align-items: flex-start;
  }
  .market-index-panel .index-section-note {
    width: 100%;
    margin-left: 0;
  }
  .market-index-panel .section-source {
    max-width: none;
    margin-left: 0;
  }
  .market-index-panel .index-head-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .market-index-panel .index-head-actions .section-source {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .index-overseas-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .index-overseas-head > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .index-sync-main { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .index-sync-state { grid-column: 1; grid-row: 1; }
  .index-sync-chips { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; }
  .index-sync-times { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; gap: 3px 12px; }
  .index-refresh-btn { min-height: 44px; }
  .index-status-guide summary { min-height: 32px; padding-top: 8px; }
  .market-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-index-item,
  .overseas-index-grid .market-index-item { min-height: 184px; padding: 10px; }
  .index-card-main strong { font-size: 18px; }
  .index-spark { width: 66px; }
  .index-history-head { flex-direction: column; gap: 6px; }
  .index-history-head .section-source { margin-left: 0; }
  .index-history-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-history-meta { flex-direction: column; gap: 2px; }
  .index-history-chart { height: 330px; }
  .topbar::before { width: 100%; }
  .top-stock-search { min-width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trends { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sent-history-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sent-history-chart { height: 320px; }
  .stock-modal-head { grid-template-columns: 1fr; gap: 6px; }
  .stock-quote-strip {
    justify-content: flex-start;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  .stock-watch-add { min-height: 38px; }
  .stock-theme-editor { align-items: stretch; flex-direction: column; }
  .stock-theme-add {
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: 100%;
  }
  .stock-news-list { grid-template-columns: 1fr; }
  .stock-panel-head { flex-direction: column; gap: 4px; }
  .stock-panel-head p,
  .stock-panel-head > div:last-child {
    max-width: none;
    text-align: left;
  }
  .stock-theme-layer { top: 5vh; max-height: 88vh; }
  .stock-theme-layer-body { max-height: calc(88vh - 96px); }
  .theme-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lad2-row { gap: 6px; }
  .lad2-label { width: 50px; }
  .lad2-label .hbadge { min-width: 44px; }
  .lstk2 { min-width: 180px; flex-basis: 100%; }
  .fu-hot-panel { margin-left: 56px; }
  .fu-hot-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .fu-hot-meta { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .fu-hot-layout { grid-template-columns: 1fr; }
  .fu-hot-categories {
    padding: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .fu-hot-cat-head { display: none; }
  .fu-hot-cat-list {
    min-width: max-content;
    flex-direction: row;
  }
  button.fu-hot-cat {
    width: auto;
    min-height: 44px;
    gap: 10px;
    padding-inline: 11px;
  }
  .fu-hot-stock .stock-link-btn { min-height: 44px; }
  .modal-charts { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  #side .brand b { display: none; }
  #side .item { gap: 6px; padding-inline: 8px; font-size: 11px; }
  .nav-icon { width: 15px; height: 15px; }
  #alert-badge { max-width: 78px; overflow: hidden; text-overflow: ellipsis; }
  .index-sync-chips > span { flex: 1 0 calc(33.333% - 5px); }
  .index-sync-chips > span:first-child { flex-basis: 100%; }
  .index-sync-times { display: grid; grid-template-columns: 1fr 1fr; }
  .index-sync-times span:last-child { grid-column: 1 / -1; }
  .index-status-guide > div { display: grid; gap: 7px; }
  .market-index-item,
  .overseas-index-grid .market-index-item { min-height: 220px; }
  .index-card-details { grid-template-columns: 1fr; }
  .index-card-details .is-source { grid-column: auto; }
  .index-card-details b { white-space: normal; }
  .fu-hot-panel { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ── 登录/注册门禁 ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 340px; max-width: 92vw; padding: 28px 26px 24px; }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.auth-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.auth-brand b { font-size: 16px; color: var(--accent); letter-spacing: .3px; }
.auth-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.auth-card input { display: block; width: 100%; margin-bottom: 11px; }
.auth-card button.primary { width: 100%; margin-top: 4px; }
.auth-msg { min-height: 18px; margin-top: 10px; font-size: 12.5px; }
.auth-msg.ok { color: var(--down); } .auth-msg.err { color: var(--up); }
.auth-switch { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--accent); cursor: pointer; }

/* 前一日复盘笔记 */
.journal-card-title { display: inline-flex; align-items: center; gap: 5px; }
.journal-history-open {
  min-height: 30px !important;
  margin-left: auto;
  padding-inline: 11px !important;
  color: var(--ink-2) !important;
  font-size: 11.5px !important;
  font-weight: 650 !important;
}
.journal-history-open:hover { color: var(--accent) !important; }
.prev-review { border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px;
  margin-bottom: 10px; background: var(--surface); }
.prev-review .pr-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.prev-review .pr-head b { color: var(--accent); }
.prev-review .pr-note { max-width: 75ch; font-size: 13px; color: var(--ink);
  white-space: pre-wrap; line-height: 1.7; }
.prev-review .pr-watch { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.prev-review .pr-watch.top { margin: 0 0 9px; padding: 0 0 9px; border-top: none; border-bottom: 1px dashed var(--line); }
.review-watch-head {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.review-live-caption {
  display: inline-flex;
  align-items: center;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 500;
}
.review-live-caption.is-live { color: var(--teal); }
.review-live-caption.is-live::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
}
.review-watch-list { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.review-watch-stock {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.review-watch-stock .stock-link-btn {
  min-height: 26px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}
.review-watch-stock .stock-link-btn:hover {
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.review-watch-pct {
  min-width: 54px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.review-watch-pct.is-loading { color: var(--faint); font-size: 10.5px; font-weight: 500; }
.journal-today-title { margin-top: 18px; font-size: 14px; }
.peer-review-section { padding: 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg); }
.journal-subhead { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.journal-subhead b { font-size: 13px; color: var(--ink2); }
.peer-review { margin-bottom: 8px; background: var(--surface); }
.peer-review:last-child { margin-bottom: 0; }
.peer-review .pr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-readonly { flex: 0 0 auto; padding: 2px 7px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); background: var(--bg); font-size: 10.5px; }
.peer-watchlist { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.peer-empty { padding: 10px 0; text-align: left; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.my-watch-section { margin-top: 12px; padding: 11px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); }
.my-watch-head { margin-bottom: 9px; }
.watch-stock-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-stock-card { position: relative; display: inline-flex; min-width: 0;
  border: 1px solid transparent; border-radius: 5px; background: var(--teal-bg);
  transition: border-color .16s ease, box-shadow .16s ease; }
.watch-stock-card:hover, .watch-stock-card:focus-within {
  border-color: #b6dcdf; box-shadow: 0 2px 7px rgba(24, 45, 66, .07); }
.watch-stock-main { display: inline-flex; min-height: 26px; width: auto; padding: 3px 9px;
  align-items: center; justify-content: center; border: 0; border-radius: 5px;
  background: transparent; text-align: left; text-decoration: none; }
.watch-stock-main:hover { border: 0; background: #d9eef0; }
.watch-stock-main b { overflow: hidden; max-width: 160px; color: var(--teal);
  font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.watch-stock-main span { display: none; }
.watch-remove { position: absolute; z-index: 2; top: -7px; right: -7px; display: grid;
  width: 19px; min-height: 19px; padding: 0; place-items: center;
  border: 1px solid #d4dde5; border-radius: 50%; background: #fff;
  color: #6f7f8e; font-size: 13px; line-height: 1;
  opacity: 0; pointer-events: none; transform: scale(.85);
  transition: opacity .15s ease, transform .15s ease, color .15s ease, border-color .15s ease; }
.watch-stock-card:hover .watch-remove, .watch-stock-card:focus-within .watch-remove {
  opacity: 1; pointer-events: auto; transform: scale(1); }
.watch-remove:hover { border-color: #e4a6a6; background: #fff7f7; color: var(--up); }
.watch-empty { grid-column: 1 / -1; padding: 9px 0; text-align: left; }
.watch-search-row { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; }
.watch-combobox { position: relative; width: min(430px, 100%); }
.watch-combobox input { width: 100%; min-height: 34px; padding-inline: 10px; }
.watch-options { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; left: 0;
  overflow-y: auto; max-height: 286px; padding: 4px; border: 1px solid #bacbd7;
  border-radius: 8px; background: #fff; box-shadow: 0 12px 28px rgba(24, 45, 66, .14); }
.watch-option { display: flex; width: 100%; min-height: 44px; padding: 7px 9px;
  align-items: center; justify-content: space-between; gap: 10px; border: 0;
  border-radius: 5px; background: #fff; color: var(--ink2); text-align: left; }
.watch-option:hover, .watch-option.is-active { border: 0; background: #eef5f6; color: var(--teal); }
.watch-option span { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
.watch-option b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-option small { color: var(--muted); letter-spacing: .04em; }
.watch-option em { flex: 0 0 auto; color: var(--muted); font-size: 10.5px; font-style: normal; }
.watch-option-state { padding: 12px 9px; color: var(--muted); font-size: 12px; }
.watch-add { min-height: 34px !important; }
.watch-search-help { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; }
.journal-my-saved { margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; }
.journal-my-saved .journal-subhead { margin-bottom: 7px; }
.journal-my-saved .pr-note { max-width: 75ch; color: var(--ink); font-size: 13px;
  line-height: 1.7; white-space: pre-wrap; }
.journal-editor { margin-top: 12px; }
.journal-field-label { display: block; margin-bottom: 7px; font-size: 13px;
  font-weight: 650; color: var(--ink2); }
.journal-save-row { display: flex; gap: 7px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
/* 保存状态明示:草稿恢复提示走常规灰,保存失败红字(2026-08-12丢稿事故加固) */
.journal-save-status { font-size: 12px; color: var(--muted); }
.journal-save-status.is-error { color: var(--red); font-weight: 600; }

/* 历史复盘日志：按需加载、按日期筛选，长文本保持舒适行长。 */
.review-history-dialog { min-height: 210px; }
.review-history-head {
  display: flex;
  padding-right: 34px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.review-history-head h3 { margin: 1px 0 2px; color: var(--ink); font-size: 18px; }
.review-history-head p { margin: 0; color: var(--muted); font-size: 11.5px; }
.review-history-kicker {
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
}
.review-history-filter { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.review-history-filter span { color: var(--muted); font-size: 11px; font-weight: 600; }
.review-history-filter select {
  min-width: 190px;
  min-height: 36px;
  border-color: var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12px;
}
.review-history-loading,
.review-history-empty,
.review-history-error {
  margin: 20px 0 0;
  padding: 28px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}
.review-history-error { color: var(--up); }
.review-history-list { margin-top: 15px; }
.review-history-day {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line-2);
}
.review-history-day[hidden] { display: none; }
.review-history-date { display: flex; flex-direction: column; gap: 2px; }
.review-history-date time { color: var(--ink); font-size: 12px; font-weight: 700; }
.review-history-date span { color: var(--faint); font-size: 10.5px; }
.review-history-reviews { display: grid; gap: 8px; }
.review-history-entry {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.review-history-author {
  display: flex;
  min-height: 23px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.review-history-author b { color: var(--accent); font-size: 12px; }
.review-history-author time { color: var(--faint); font-size: 10.5px; }
.history-watch-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 7px; }
.history-watch-chip {
  display: inline-flex;
  min-height: 25px;
  padding: 3px 8px;
  align-items: center;
  gap: 6px;
  border: 1px solid #c9e2e4;
  border-radius: 5px;
  background: var(--teal-bg);
  color: var(--teal);
  font-size: 11px;
  font-weight: 650;
}
button.history-watch-chip:hover {
  border-color: #a9d2d5;
  background: #d4ebed;
  color: #105c61;
}
.history-watch-chip small { color: var(--muted); font-size: 9.5px; font-weight: 500; }
.review-history-note {
  max-width: 75ch;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.72;
  white-space: pre-wrap;
}
.review-history-no-note { margin: 4px 0 0; }

@media (hover: none) {
  .watch-remove { opacity: 1; pointer-events: auto; transform: scale(1); }
}

@media (max-width: 560px) {
  .journal-history-open { min-height: 34px !important; }
  .review-watch-head { align-items: flex-start; flex-direction: column; gap: 1px; }
  .watch-search-row { align-items: stretch; }
  .watch-combobox { width: 100%; }
  .review-history-head { align-items: stretch; flex-direction: column; gap: 12px; }
  .review-history-filter { align-items: stretch; flex-direction: column; gap: 4px; }
  .review-history-filter select { width: 100%; min-height: 42px; }
  .review-history-day { grid-template-columns: 1fr; gap: 7px; }
  .review-history-date { flex-direction: row; justify-content: space-between; }
}

/* ── 涨停原因(扶摇·同花顺) ── */
.lstk2 .lu-reason { margin-top: 3px; font-size: 10.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 264px; }
.modal-lu-reason { margin-top: 7px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.modal-lu-reason b { color: var(--warn); font-weight: 700; margin-right: 6px; }
.modal-lu-reason .src { color: var(--faint); font-size: 10.5px; margin-right: 6px; }

/* ── 龙虎榜模块 ── */
#sec-lhb .tablebox { overflow-y: auto; }
#sec-lhb thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.hot-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12px; }
.hot-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hot-item .hot-rank { display: inline-grid; place-items: center; min-width: 16px; height: 16px;
  border-radius: 4px; background: var(--accent-bg); color: var(--accent);
  font-style: normal; font-size: 10px; font-weight: 700; }
.hot-item i { font-style: normal; font-size: 10px; }

/* ── 板块资金流：分钟归档 + 时间轴回放 ── */
.sector-flow-card { --flow-row-h: 31px; }
.flow-loading {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}
.flow-loading i {
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: flow-spin .8s linear infinite;
}
@keyframes flow-spin { to { transform: rotate(360deg); } }
.flow-toolbar {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.flow-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 6px;
  background: var(--surface-2);
}
.flow-tabs button {
  min-height: 27px;
  padding: 3px 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  box-shadow: none;
}
.flow-tabs button:hover { background: #fff; color: var(--accent); }
.flow-tabs button.on {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(24, 38, 56, .08);
}
.flow-archive-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 10.5px;
}
.flow-live-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}
.flow-live-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #96a3b1;
}
.flow-live-state.live { color: var(--teal); }
.flow-live-state.live i {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 111, 117, .1);
}
.flow-stage {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 180px minmax(300px, 1fr);
  min-height: 366px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}
.flow-side {
  min-width: 0;
  padding: 10px 11px 8px;
  background: #fff;
}
.flow-outflow { border-right: 1px solid var(--line-2); }
.flow-inflow { border-left: 1px solid var(--line-2); }
.flow-side > header {
  display: flex;
  min-height: 36px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 3px 7px;
  border-bottom: 1px solid var(--line-2);
}
.flow-side > header div { display: flex; align-items: baseline; gap: 7px; }
.flow-side > header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.flow-side > header b {
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
}
.flow-side > header small {
  color: var(--faint);
  font-size: 9.5px;
  white-space: nowrap;
}
.flow-rank-list {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.flow-rank-row {
  position: relative;
  display: grid;
  grid-template-columns: 21px minmax(76px, 1fr) 60px 78px;
  height: var(--flow-row-h);
  align-items: center;
  gap: 5px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  font-size: 12.5px;
}
.flow-rank-row:last-child { border-bottom: 0; }
.flow-rank-row > *:not(i) { position: relative; z-index: 1; }
.flow-rank-row > i {
  position: absolute;
  left: 21px;
  bottom: 2px;
  width: var(--flow-size);
  height: 2px;
  border-radius: 2px;
  opacity: .58;
  transition: width .25s ease;
}
.flow-rank-row.outflow > i { background: var(--down); }
.flow-rank-row.inflow > i { background: var(--up); }
.flow-rank-no { color: var(--faint); font-size: 10px; }
.flow-rank-name {
  overflow: hidden;
  color: var(--ink);
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-rank-pct {
  overflow: hidden;
  font-size: 10.5px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-rank-row > b {
  font-size: 12px;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}
.flow-rank-row.outflow > b { color: var(--down); }
.flow-rank-row.inflow > b { color: var(--up); }
.flow-list-empty {
  display: grid;
  min-height: 310px;
  place-items: center;
  color: var(--faint);
  font-size: 11px;
}
.flow-center {
  position: relative;
  min-height: 364px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(24, 38, 56, .055), transparent 32%),
    linear-gradient(180deg, #f9fbfc, #f3f6f8);
}
.flow-stream-svg {
  position: absolute;
  inset: 9px 0;
  width: 100%;
  height: calc(100% - 18px);
}
.flow-path {
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  opacity: .22;
  vector-effect: non-scaling-stroke;
  transition: opacity .2s ease;
}
.flow-path-out { stroke: var(--down); }
.flow-path-in { stroke: var(--up); }
.flow-arrow-out { fill: var(--down); }
.flow-arrow-in { fill: var(--up); }
.flow-path-1, .flow-path-5 { opacity: .15; }
.flow-path-2, .flow-path-4 { opacity: .3; }
.sector-flow-card.is-playing .flow-path {
  stroke-dasharray: 5 7;
  animation: flow-travel .9s linear infinite;
  opacity: .52;
}
.sector-flow-card.is-playing .flow-path-in { animation-direction: reverse; }
@keyframes flow-travel { to { stroke-dashoffset: -24; } }
.flow-market-kpi {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 128px;
  padding: 10px 8px;
  transform: translate(-50%, -50%);
  border: 1px solid #cfd9e2;
  border-radius: 7px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 16px rgba(24, 38, 56, .06);
  text-align: center;
}
.flow-market-kpi small {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
}
.flow-market-kpi strong {
  display: block;
  margin: 2px 0 4px;
  color: var(--accent);
  font-size: 19px;
  font-weight: 790;
  letter-spacing: -.02em;
}
.flow-market-kpi > div {
  display: flex;
  justify-content: center;
  gap: 7px;
  color: var(--faint);
  font-size: 8.5px;
}
.flow-center > p {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  margin: 0;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.45;
  text-align: center;
}
.flow-replay {
  display: grid;
  grid-template-columns: 27px 76px minmax(180px, 1fr) 42px 46px 27px;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}
.flow-replay button {
  min-height: 27px;
  padding-left: 7px;
  padding-right: 7px;
}
.flow-step { font-size: 17px !important; line-height: 1; }
.flow-play { white-space: nowrap; }
.flow-play span { display: inline-block; min-width: 10px; font-size: 9px; }
.flow-replay input[type="range"] {
  width: 100%;
  min-height: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent);
}
.flow-time {
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  text-align: right;
}
.flow-position {
  color: var(--faint);
  font-size: 9.5px;
  text-align: center;
}
.flow-footnote {
  margin: 7px 2px 0;
  color: var(--faint);
  font-size: 9.5px;
}
.flow-empty {
  min-height: 132px;
  margin: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

@media (max-width: 1040px) {
  .flow-stage { grid-template-columns: minmax(260px, 1fr) 130px minmax(260px, 1fr); }
  .flow-rank-row { grid-template-columns: 19px minmax(70px, 1fr) 70px; }
  .flow-rank-pct { display: none; }
  .flow-market-kpi { width: 108px; }
  .flow-market-kpi strong { font-size: 16px; }
}

@media (max-width: 760px) {
  .flow-toolbar { align-items: flex-start; flex-direction: column; gap: 7px; }
  .flow-archive-meta { width: 100%; flex-wrap: wrap; gap: 5px 9px; }
  .flow-stage { grid-template-columns: 1fr 1fr; }
  .flow-center { display: none; }
  .flow-outflow { border-right: 1px solid var(--line-2); }
  .flow-inflow { border-left: 0; }
  .flow-side > header { align-items: flex-start; flex-direction: column; gap: 1px; }
  .flow-replay {
    grid-template-columns: 27px 70px minmax(90px, 1fr) 38px 27px;
  }
  .flow-position { display: none; }
}

@media (max-width: 520px) {
  .flow-stage { grid-template-columns: 1fr; }
  .flow-outflow { border-right: 0; border-bottom: 1px solid var(--line); }
  .flow-side { padding-left: 8px; padding-right: 8px; }
  .flow-rank-row { grid-template-columns: 19px minmax(90px, 1fr) 58px 75px; }
  .flow-rank-pct { display: block; }
  .flow-replay { grid-template-columns: 27px 68px 1fr 38px 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .flow-loading i,
  .sector-flow-card.is-playing .flow-path { animation: none; }
  .flow-rank-row > i { transition: none; }
}

/* ── 外露位次角标与提前箭头(个股弹窗题材库) ── */
.stock-theme-chip .expose-num {
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  margin: 0 1px 0 5px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
}
.stock-theme-chip .stock-theme-front {
  min-height: 0;
  padding: 0 3px;
  border: none;
  background: none;
  color: #8796a7;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.stock-theme-chip .stock-theme-front:hover { color: var(--accent); background: none; }

/* 个股题材面板头右侧:数据源徽章+操作提示竖排右对齐 */
.stock-panel-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
.stock-panel-side p { margin: 0; }

/* ── 下一交易日预案卡录入 ── */
.journal-subhead-actions,
.journal-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.journal-editor-head { margin: 18px 0 8px; }
.journal-editor-head .journal-today-title { margin: 0; }
.preplan-create-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.preplan-create-open svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.preplan-create-dialog { width: min(760px, calc(100vw - 32px)); color: var(--ink2); }
.preplan-create-head { margin-bottom: 16px; }
.preplan-create-head h3 { margin: 2px 0 5px; font-size: 20px; }
.preplan-create-head p { margin: 0; color: var(--muted); font-size: 12px; }
.preplan-create-kicker { color: var(--teal); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; }
.preplan-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preplan-form-field { display: grid; gap: 6px; color: var(--ink2); font-size: 12px; font-weight: 700; }
.preplan-form-field input,
.preplan-form-field textarea { width: 100%; }
.preplan-logic-field { position: relative; margin-top: 12px; }
.preplan-logic-field textarea { min-height: 142px; resize: vertical; line-height: 1.7; }
.preplan-logic-field small { justify-self: end; color: var(--faint); font-weight: 500; }
.preplan-target-field { min-width: 0; margin: 14px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.preplan-target-field legend { padding: 0 5px; color: var(--ink2); font-size: 12px; font-weight: 800; }
.preplan-target-chips { display: grid; min-height: 30px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preplan-target-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 5px 4px 9px; border: 1px solid #c8d7e1; border-radius: 6px; background: #f8fafb; font-size: 11px; }
.preplan-target-chip b { color: var(--ink2); }
.preplan-target-chip i { color: var(--faint); font-style: normal; font-variant-numeric: tabular-nums; }
.preplan-target-chip button { min-height: 20px; padding: 0 4px; border: 0; background: transparent; color: var(--muted); font-size: 15px; }
.preplan-target-chip button:hover { border: 0; background: var(--up-bg); color: var(--up); }
.preplan-target-item { min-width: 0; padding: 9px; border: 1px solid #c8d7e1; border-radius: 7px; background: #fbfcfd; }
.preplan-target-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preplan-target-item-head > span { display: inline-flex; min-width: 0; align-items: baseline; gap: 7px; }
.preplan-target-item-head b { overflow: hidden; color: var(--ink2); text-overflow: ellipsis; white-space: nowrap; }
.preplan-target-item-head small { color: var(--faint); font-variant-numeric: tabular-nums; }
.preplan-target-item-head button { width: 25px; min-height: 25px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 17px; }
.preplan-target-item-head button:hover { border: 0; background: var(--up-bg); color: var(--up); }
.preplan-target-actions { display: inline-flex !important; flex: 0 0 auto; align-items: center !important; gap: 5px !important; }
.preplan-target-item-head .preplan-plan-action { width: auto; min-height: 28px; padding: 4px 9px; border: 1px solid #9bcac6; border-radius: 6px; background: #f2faf9; color: var(--teal); font-size: 10.5px; font-weight: 800; }
.preplan-target-item-head .preplan-plan-action:hover { border: 1px solid #68aaa4; background: #e3f4f2; color: #0f716d; }
.preplan-target-item-head .preplan-plan-action[aria-expanded="true"] { border-color: var(--teal); background: var(--teal); color: #fff; }
.preplan-target-item-head .preplan-plan-action:focus-visible,
.preplan-plan-editor button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.preplan-target-item-head .preplan-target-remove { flex: 0 0 25px; }
.preplan-plan-summary { display: flex; min-width: 0; align-items: baseline; gap: 7px; margin-top: 7px; padding: 6px 8px; border-radius: 6px; background: #f3f6f8; color: var(--faint); font-size: 10.5px; }
.preplan-plan-summary.is-planned { border-left: 3px solid var(--teal); background: #edf8f7; color: var(--ink2); }
.preplan-plan-summary b { flex: 0 0 auto; color: var(--teal); }
.preplan-plan-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preplan-plan-editor { display: grid; grid-template-columns: minmax(0, 1fr) 145px; gap: 8px; margin-top: 8px; padding: 9px; border: 1px solid #9bcac6; border-radius: 7px; background: #fff; }
.preplan-plan-editor label { margin: 0; }
.preplan-plan-editor label span em { color: var(--up); font-style: normal; }
.preplan-plan-editor input { min-height: 36px; }
.preplan-plan-editor-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 6px; }
.preplan-plan-editor-actions button { min-height: 32px; padding: 5px 10px; }
.preplan-plan-editor-actions .danger { color: var(--up); }
.preplan-plan-editor textarea,
.preplan-plan-editor input { font-size: 12px; }
.preplan-target-item label { display: grid; gap: 5px; margin-top: 7px; }
.preplan-target-item label > span { color: var(--muted); font-size: 10.5px; font-weight: 800; }
.preplan-target-item textarea { min-height: 58px; resize: vertical; line-height: 1.55; }
.preplan-target-empty { align-self: center; color: var(--faint); font-size: 11px; }
.preplan-target-search { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; }
.preplan-stock-combobox { position: relative; flex: 1; min-width: 0; }
.preplan-stock-combobox input { width: 100%; }
.preplan-form-actions { display: flex; margin-top: 16px; align-items: center; justify-content: flex-end; gap: 8px; }
.preplan-form-actions [role="status"] { margin-right: auto; color: var(--up); font-size: 11px; }

@media (max-width: 620px) {
  .preplan-form-grid { grid-template-columns: 1fr; }
  .preplan-target-search { flex-direction: column; }
  .preplan-target-search > button { width: 100%; }
  .preplan-target-chips { grid-template-columns: 1fr; }
  .preplan-plan-editor { grid-template-columns: 1fr; }
  .preplan-create-dialog { width: calc(100vw - 20px); }
}
