/* ============ 公开行情分析（资金与指标分级） ============ */
.chart-page { width: min(100%, var(--maxw)); margin: 0 auto; padding: 12px 16px 36px; overflow: visible; }
.chart-search { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.chart-stock-searchbox { position: relative; flex: 0 1 360px; min-width: 220px; }
.chart-search .search {
  width: 100%; min-width: 0; height: 42px; padding: 0 14px;
  border: 1.5px solid #aab4c1; border-radius: 10px;
  background: var(--surface-raised); color: var(--text);
  box-shadow: 0 2px 8px rgba(31,35,41,.08), inset 0 1px 1px rgba(31,35,41,.04);
  font-size: 15px; font-weight: 600;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.chart-search .search::placeholder { color: #77818d; opacity: 1; font-weight: 500; }
.chart-search .search:hover { border-color: #7d8997; }
.chart-search .search:focus {
  border-color: var(--brand); background: var(--surface-raised);
  box-shadow: 0 0 0 3px var(--focus-ring), 0 3px 10px rgba(31,35,41,.12);
}
.chart-search .btn { flex: 0 0 auto; min-height: 42px; padding-inline: 18px; }
.chart-hot-stocks { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; height: 42px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.chart-hot-stocks__label { flex: 0 0 auto; padding: 0 10px; color: var(--brand); font-size: 12px; font-weight: 800; border-right: 1px solid var(--border); }
.chart-hot-stocks__viewport { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.chart-hot-stocks__track { display: inline-flex; align-items: center; height: 100%; min-width: 100%; width: max-content; white-space: nowrap; will-change: transform; }
.chart-hot-stocks__empty { padding: 0 12px; color: var(--text-weak); font-size: 12px; }
.chart-hot-stock { display: inline-flex; align-items: center; gap: 5px; height: 100%; min-height: 30px; margin: 0 4px; padding: 0 8px; border: 0; border-radius: 6px; color: var(--text); background: transparent; cursor: pointer; }
.chart-hot-stock:hover, .chart-hot-stock:focus-visible { color: var(--brand); background: var(--brand-weak); outline: none; }
.chart-hot-stock strong { font-size: 12px; }
.chart-hot-stock span { color: var(--text-sub); font: 11px ui-monospace,SFMono-Regular,Menlo,monospace; }
html[data-theme='dark'] .chart-search .search {
  border-color: #536170; background: var(--surface-2);
  box-shadow: 0 2px 9px rgba(0,0,0,.25), inset 0 1px 1px rgba(255,255,255,.03);
}
html[data-theme='dark'] .chart-search .search::placeholder { color: #9ba6b2; }
html[data-theme='dark'] .chart-search .search:hover { border-color: #7a8999; }
html[data-theme='dark'] .chart-search .search:focus { border-color: var(--brand); }
.chart-stock-suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 5px); z-index: 31;
  max-height: 360px; overflow: auto; padding: 4px;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(20,30,50,.18);
}
.chart-stock-suggestions[hidden] { display: none; }
.chart-stock-search-option {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 5px; background: var(--surface-raised); color: var(--text); text-align: left;
}
.chart-stock-search-history-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 5px; color: var(--text-sub); font-size: 12px; font-weight: 700;
}
.chart-stock-search-history-clear {
  padding: 2px 4px; border: 0; background: transparent; color: var(--brand);
  font-size: 12px; cursor: pointer;
}
.chart-stock-search-history-clear:hover { text-decoration: underline; }
.chart-stock-search-history-icon {
  flex: 0 0 auto; width: 20px; color: #71819a; font-size: 23px; line-height: 1;
}
.chart-stock-search-option:last-child { border-bottom: 0; }
.chart-stock-search-option:hover,
.chart-stock-search-option:focus-visible,
.chart-stock-search-option.is-active {
  background: var(--brand-weak); outline: none;
  box-shadow: inset 3px 0 0 var(--brand);
}
.chart-stock-search-option.is-active .chart-stock-search-name,
.chart-stock-search-option.is-active .chart-stock-search-code { color: var(--brand); }
.chart-stock-search-name { min-width: 80px; overflow: hidden; color: var(--text); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.chart-stock-search-code { color: var(--text-sub); font: 700 13px ui-monospace,SFMono-Regular,Menlo,monospace; }
.chart-stock-search-sname { margin-left: auto; color: var(--text-sub); font-size: 12px; text-transform: uppercase; }
.chart-stock-search-empty { padding: 10px; color: var(--text-sub); font-size: 13px; }
.chart-gate {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 32px 18px; color: var(--text-sub); text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.chart-gate:empty { display: none; }
.chart-gate b { color: var(--text); font-size: 15px; }
.chart-vip-prompt { display: flex; flex-direction: column; gap: 6px; }
.chart-vip-prompt b { color: var(--text); }
.chart-metric { padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.chart-metric span { display: block; color: var(--text-sub); font-size: 11px; white-space: nowrap; }
.chart-metric b { display: block; margin-top: 2px; font-size: 12px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.chart-card { margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chart-native-card { position: relative; overflow: visible; }
.chart-tabs { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.chart-tabs--scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-tabs .chart-tab {
  flex: 0 0 auto; min-height: 40px; padding: 8px 18px;
  color: var(--text-sub); background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 2px 6px rgba(31,35,41,.08);
  font-size: 14px; font-weight: 700; line-height: 1.2;
  transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.chart-tabs .chart-tab:not(.is-on):hover {
  color: var(--brand); background: var(--brand-weak); border-color: var(--info-border);
  box-shadow: 0 4px 10px rgba(43,108,255,.14); transform: translateY(-1px);
}
.chart-tabs .chart-tab:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.chart-tabs .chart-tab:active { transform: translateY(1px); }
.chart-tabs .chart-tab.is-on {
  color: #fff; background: var(--brand); border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(43,108,255,.28); font-weight: 800;
}
.chart-panel-state { padding: 40px 16px; text-align: center; color: var(--text-sub); }
.chart-panel-state.is-error { color: var(--up); }
.chart-native-card > .chart-panel-state.is-chart-loading { display: flex; align-items: center; justify-content: center; }
.chart-native-card > .chart-panel-state.is-chart-overlay {
  position: absolute; inset: 52px 0 0; z-index: 40;
  display: grid; place-items: center; padding: 0;
  pointer-events: none;
}
.chart-native-card > .chart-panel-state[hidden] { display: none; }
.chart-state-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  max-width: calc(100% - 32px); min-height: 40px; padding: 8px 14px;
  border: 1px solid rgba(43,108,255,.24); border-radius: 999px;
  background: var(--floating-bg); box-shadow: var(--shadow);
  color: var(--text-sub); font-size: 13px; font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.chart-state-badge .spin { flex: 0 0 auto; margin: 0; }
.chart-panel-state.is-error .chart-state-badge { border-color: rgba(245,34,45,.22); color: var(--up); }
.chart-indicator-tools { padding: 7px 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chart-tool-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 2px 0; scrollbar-width: thin; }
.chart-tool-row + .chart-tool-row { margin-top: 5px; }
.chart-tool-label { flex: 0 0 auto; width: 42px; color: var(--text-sub); font-size: 11px; }
.chart-indicator-btn { flex: 0 0 auto; height: 27px; padding: 0 9px; border: 1px solid var(--border); border-radius: 14px; color: var(--text-sub); background: var(--surface); font-size: 11px; }
.chart-indicator-btn.is-on { color: #fff; border-color: var(--brand); background: var(--brand); font-weight: 700; }
.chart-indicator-state { padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--warning-text); background: var(--warning-bg); font-size: 11px; }
.chart-canvas-wrap { width: 100%; padding: 8px 8px 6px; overflow: hidden; background: var(--chart-bg); }
.chart-canvas-wrap { position: relative; }
.chart-canvas-wrap canvas { display: block; max-width: 100%; }
.chart-canvas-wrap canvas[hidden] { display: none; }
#volumeCanvas:not([hidden]), #capitalCanvas:not([hidden]), #indicatorCanvas:not([hidden]) { border-top: 1px solid var(--border); }
.chart-hover { position: absolute; z-index: 3; top: 12px; left: 52px; max-width: calc(100% - 70px); padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--floating-bg); box-shadow: var(--shadow); color: var(--text); font-size: 11px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-crosshair { position: absolute; z-index: 2; top: 8px; bottom: 32px; width: 1px; border-left: 1px dashed var(--text-weak); pointer-events: none; }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 26px; padding: 4px 8px; color: var(--text-sub); font-size: 11px; }
.chart-legend .chart-metric { padding: 0; border: 0; display: flex; gap: 4px; background: transparent; }
.chart-legend .chart-metric span, .chart-legend .chart-metric b { display: inline; margin: 0; font-size: 11px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; background: var(--flat); }
.legend-dot--price { background: var(--brand); }
.legend-dot--avg { background: #d99b00; }
.legend-dot--three { background: #13a8a8; }
.legend-dot--up { background: var(--up); }
.legend-dot--down { background: var(--down); }
.chart-info-body { min-height: 120px; }
.chart-info-body.is-ai-active { min-height: 238px; }
.chart-ai-progress-card {
  box-sizing: border-box; min-height: 206px; margin: 14px; padding: 17px 18px;
  border: 1px solid var(--info-border); border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--info-bg), var(--surface) 70%); box-shadow: inset 0 1px 0 var(--surface-raised);
}
.chart-ai-progress-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.chart-ai-progress-head b { min-width: 0; color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-ai-progress-head time { flex: 0 0 auto; margin-left: auto; color: var(--text-sub); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-ai-progress-orb { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 rgba(43,108,255,.35); animation: chart-ai-pulse 1.6s infinite; }
.chart-ai-progress-card.is-complete .chart-ai-progress-orb { background: #16a36a; animation: none; }
.chart-ai-progress-steps { position: relative; display: grid; gap: 8px; margin: 16px 0 12px; padding: 0; list-style: none; }
.chart-ai-progress-steps::before { content: ''; position: absolute; left: 9px; top: 9px; bottom: 9px; width: 1px; background: var(--info-border); }
.chart-ai-progress-steps li { position: relative; display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 8px; align-items: center; color: var(--text-sub); font-size: 12px; line-height: 1.45; }
.chart-ai-step-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--info-bg); color: var(--brand); font-size: 11px; font-weight: 900; }
.chart-ai-progress-steps li.is-current { color: var(--brand); font-weight: 700; }
.chart-ai-progress-steps li.is-done .chart-ai-step-icon { color: #fff; background: #16a36a; }
.chart-ai-step-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: chart-ai-step-pulse 1.2s ease-in-out infinite; }
.chart-ai-progress-foot { margin: 0; color: var(--text-weak); font-size: 11px; }
.chart-ai-failure-card {
  display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 11px; align-items: center;
  box-sizing: border-box; margin: 14px; padding: 15px 16px; border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--warning-bg), var(--surface) 72%);
}
.chart-ai-failure-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--warning-bg); color: var(--warning-text); font-weight: 900; }
.chart-ai-failure-copy { min-width: 0; }
.chart-ai-failure-copy b { display: block; color: var(--text); font-size: 14px; }
.chart-ai-failure-copy p { margin: 4px 0 3px; color: var(--text-sub); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.chart-ai-failure-copy small { display: block; color: var(--text-weak); font-size: 11px; line-height: 1.5; }
.chart-ai-retry { min-height: 34px; padding: 0 14px; border: 1px solid var(--info-border); border-radius: 8px; background: var(--info-bg); color: var(--brand); font-weight: 700; cursor: pointer; white-space: nowrap; }
.chart-ai-retry:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-weak); }
.chart-ai-retry:disabled { border-color: var(--border); background: var(--surface-2); color: var(--text-weak); cursor: default; }
@media (max-width: 560px) {
  .chart-search { flex-wrap: wrap; }
  .chart-stock-searchbox { flex: 1 1 calc(100% - 78px); min-width: 0; }
  .chart-hot-stocks { flex-basis: 100%; order: 3; }
  .chart-ai-failure-card { grid-template-columns: 28px minmax(0,1fr); }
  .chart-ai-retry { grid-column: 1 / -1; width: 100%; }
}
@keyframes chart-ai-pulse { 0% { box-shadow: 0 0 0 0 rgba(43,108,255,.35); } 70% { box-shadow: 0 0 0 8px rgba(43,108,255,0); } 100% { box-shadow: 0 0 0 0 rgba(43,108,255,0); } }
@keyframes chart-ai-step-pulse { 0%,100% { opacity: .35; transform: scale(.82); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .chart-ai-progress-orb, .chart-ai-step-pulse { animation: none; } }
.chart-theme-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }
.chart-text { padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); line-height: 1.75; }
.chart-news-list { padding: 0 14px; }
.chart-news { padding: 13px 0; border-bottom: 1px solid var(--border); }
.chart-news:last-child { border-bottom: 0; }
.chart-news time { display: block; color: var(--text-sub); font-size: 11px; }
.chart-news a, .chart-news b { display: inline-block; margin-top: 3px; color: var(--text); font-size: 14px; text-decoration: none; }
.chart-news a:hover { color: var(--brand); }
.chart-news p { margin: 5px 0 0; color: var(--text-sub); font-size: 12px; line-height: 1.6; }
.chart-ai-summary, .chart-info-section { padding: 14px; border-bottom: 1px solid var(--border); }
.chart-info-section:last-child { border-bottom: 0; }
.chart-ai-summary h3, .chart-info-section h3 { margin: 0 0 8px; font-size: 13px; }
.chart-ai-summary p { margin: 0; line-height: 1.7; }
.chart-ai-theme-list { display: flex; flex-wrap: wrap; gap: 7px; }
.chart-ai-theme-tag {
  display: inline-flex; align-items: center; min-height: 27px; padding: 3px 9px;
  border: 1px solid #bfd2ff; border-radius: 999px; background: var(--brand-weak);
  color: var(--brand); font-size: 12px; line-height: 1.3;
}
.chart-ai-empty { margin: 0; color: var(--text-weak); line-height: 1.65; }
.chart-info-section ul { margin: 0; padding-left: 19px; }
.chart-info-section li { margin: 6px 0; line-height: 1.6; }
.chart-info-section.is-warning h3, .chart-info-section.is-warning li::marker { color: var(--up); }
.chart-ai-result-list { display: grid; gap: 7px; padding: 0 !important; list-style: none; }
.chart-ai-result-row {
  position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto;
  gap: 8px; align-items: baseline; margin: 0 !important; padding-left: 12px;
}
.chart-ai-result-row::before { content: '•'; position: absolute; left: 0; color: var(--text-sub); }
.chart-info-section.is-warning .chart-ai-result-row::before { color: var(--up); }
.chart-ai-result-message { min-width: 0; overflow-wrap: anywhere; }
.chart-ai-result-date {
  flex: 0 0 auto; padding: 1px 6px; border-radius: 999px;
  color: var(--brand); background: var(--brand-weak); font-size: 11px;
  font-style: normal; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chart-ai-result-date.is-unknown { color: var(--text-weak); background: var(--surface-2); }
.chart-dark-pool-section { background: var(--surface); }
.chart-dark-pool-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.chart-dark-pool-head h3 { margin: 0; }
.chart-dark-pool-head time { margin-left: auto; color: var(--text-sub); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-dark-pool-status { padding: 1px 6px; border-radius: 999px; color: var(--brand); background: var(--brand-weak); font-size: 10px; }
.chart-dark-pool-status.is-cached { color: var(--warning-text); background: var(--warning-bg); }
.chart-dark-pool-status.is-empty { color: var(--text-sub); background: var(--surface-2); }
.chart-dark-pool-status.is-failed { color: var(--danger-text); background: var(--danger-bg); }
.chart-dark-pool-chart { width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.chart-dark-pool-svg { display: block; width: 100%; height: auto; min-height: 178px; }
.chart-dark-pool-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-dark-pool-zero { stroke: var(--text-weak); stroke-width: 1.2; }
.chart-dark-pool-bar rect { transition: opacity .15s; }
.chart-dark-pool-bar:hover rect { opacity: .78; }
.chart-dark-pool-bar.is-inflow rect { fill: var(--up); }
.chart-dark-pool-bar.is-outflow rect { fill: var(--down); }
.chart-dark-pool-value { fill: var(--text); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-dark-pool-date { fill: var(--text-sub); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-dark-pool-interpretation { margin: 10px 0 0; padding: 9px 10px; border-radius: 8px; background: var(--surface-2); line-height: 1.65; }
.chart-dark-pool-interpretation b { color: var(--brand); }
.chart-dark-pool-note { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 7px 0 0; color: var(--text-weak); font-size: 10px; line-height: 1.5; }
.chart-dark-pool-note .is-inflow { color: var(--up); }
.chart-dark-pool-note .is-outflow { color: var(--down); }
@media (max-width: 480px) {
  :root { --page-nav-h: 47px; }
  .chart-dark-pool-svg { min-height: 150px; }
  .chart-dark-pool-value, .chart-dark-pool-date { font-size: 10px; }
}
.chart-disclaimer { margin: 14px 0 0; text-align: center; color: var(--text-weak); font-size: 11px; }
.chart-longhu__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.chart-longhu__head b { margin-right: auto; }
.chart-longhu__head select { height: 30px; max-width: 150px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); }
.chart-longhu__summary { display: flex; flex-wrap: wrap; gap: 12px; padding: 9px 12px; font-size: 12px; }
.chart-longhu__tables { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 12px 12px; }
.chart-longhu table { width: 100%; border-collapse: collapse; font-size: 11px; }
.chart-longhu th, .chart-longhu td { padding: 5px 4px; border-bottom: 1px solid var(--border); text-align: right; }
.chart-longhu th:first-child, .chart-longhu td:first-child { text-align: left; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
