:root {
  --bg: #080808;
  --card: #111111;
  --card-2: #191919;
  --border: #2b2b2b;
  --text: #f5f5f5;
  --muted: #949494;
  --accent: #ff9d24;
  --up: #f85149;      /* 红涨 */
  --down: #3fb950;    /* 绿跌 */
  --good: #3fb950;
  --warn: #d29922;
  --risk: #f0883e;
  --bad: #f85149;
  --radius: 12px;
  --motion-fast: 160ms;
  --motion-normal: 260ms;
  --motion-slow: 460ms;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* 全站统一滚动条风格（深色主题） */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #2d333b;
  border-radius: 999px;
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: #2d333b transparent; }
.hidden { display: none !important; }
.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;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.6;
}
.app { max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; }

/* 顶部 */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 4px 22px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent);
  color: #080808; font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.brand h1 { font-size: 20px; font-weight: 700; }
.subtitle { font-size: 12px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-link { text-decoration: none; }
.user-menu { position: relative; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  min-width: 140px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.user-dropdown a {
  color: var(--text); text-decoration: none; font-size: 13.5px;
  padding: 8px 12px; border-radius: 8px;
}
.user-dropdown a:hover { background: var(--card-2); color: var(--accent); }
.status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  background: var(--card); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 999px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.dot.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.bad { background: var(--bad); }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head h2 { font-size: 16px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* 新闻与日历统一折叠：同一按钮驱动，两栏同步展开 */
.preview-wrap {
  position: relative;
  max-height: 220px;
  overflow: hidden;
  transition: max-height .48s cubic-bezier(.22, .61, .36, 1);
  will-change: max-height;
}
.market-feed-card.feed-expanded .preview-wrap {
  max-height: var(--feed-expanded-height, 1600px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.preview-wrap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70px;
  background: linear-gradient(to bottom, rgba(17, 17, 17, 0), var(--card) 85%);
  pointer-events: none;
  opacity: 1;
  transition: opacity .22s ease;
}
.market-feed-card.feed-expanded .preview-wrap::after { opacity: 0; }
.market-feed-controls {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; border-top: 1px solid var(--border); background: #0e0e0e;
}
.market-feed-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 168px; padding: 7px 18px; border: 1px solid transparent; border-radius: 999px;
  color: var(--accent); background: transparent; cursor: pointer; font: inherit; font-size: 12.5px;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .16s ease;
}
.market-feed-toggle:hover { background: rgba(255, 157, 36, .08); border-color: rgba(255, 157, 36, .35); }
.market-feed-toggle:active { transform: scale(.97); }
.market-feed-toggle-icon { display: inline-block; font-size: 18px; line-height: 1; transition: transform .38s cubic-bezier(.22, .61, .36, 1); }
.market-feed-card.feed-expanded .market-feed-toggle-icon { transform: rotate(180deg); }
.market-feed-card.feed-expanded #newsContent .search-row {
  position: sticky; top: 0; z-index: 3; padding-bottom: 8px; background: var(--card);
}

/* 标签页 */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 8px 22px; border-radius: 999px; cursor: pointer; font-size: 14px;
}
.tab.active { background: #1a150f; color: var(--accent); font-weight: 700; border-color: var(--accent); }

/* 搜索 */
.search-row { display: flex; gap: 10px; }
.search-row input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 12px 14px; font-size: 15px; outline: none;
}
.search-row input { transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease; }
.search-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 157, 36, .10); }
.search-row.small input { padding: 9px 12px; font-size: 13px; }
select {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; outline: none;
}
select { transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-fast) ease; }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 157, 36, .10); }
select option { background: var(--card-2); color: var(--text); }
.btn-primary {
  background: var(--accent); color: #080808; border: none; border-radius: 8px;
  padding: 0 26px; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  background: var(--card-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip { transition: color var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease, transform var(--motion-fast) ease; }
.chip:active { transform: scale(.96); }
.hint { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* 加载 */
.loading { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 分析结果 */
.result-head { display: flex; gap: 24px; margin-top: 20px; align-items: flex-start; }
.gauge-wrap { position: relative; width: 132px; flex-shrink: 0; }
.gauge { width: 132px; height: 132px; transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--border); stroke-width: 10; }
.gauge-fg {
  fill: none; stroke: var(--good); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}
.gauge-text {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.gauge-score { font-size: 34px; font-weight: 800; }
.gauge-label { font-size: 12px; color: var(--muted); }
.result-meta { flex: 1; }
.title-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-line h2 { font-size: 24px; }
.badge {
  padding: 3px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.badge-source { background: var(--card-2); color: var(--muted); border: 1px solid var(--border); }
.muted { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.summary { margin-top: 10px; font-size: 14.5px; color: var(--text); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.col { background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.col h3 { font-size: 13.5px; margin-bottom: 10px; }
.col-strength { color: var(--good); }
.col-risk { color: var(--bad); }
.col-catalyst { color: var(--accent); }
.col ul { list-style: none; }
.col li { font-size: 13px; color: var(--muted); padding: 5px 0; border-bottom: 1px dashed var(--border); }
.col li:last-child { border-bottom: none; }
.valuation {
  margin-top: 16px; background: rgba(255, 157, 36, 0.07);
  border: 1px solid rgba(255, 157, 36, 0.24); border-radius: 10px;
  padding: 12px 14px; font-size: 13.5px; color: var(--text);
}
.valuation::before { content: "估值判断 · "; color: var(--accent); font-weight: 600; }
.snap-title { margin: 22px 0 10px; font-size: 15px; }
.disclaimer { color: var(--muted); font-size: 12px; margin-top: 14px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.data-table td { white-space: nowrap; }
.data-table tbody tr:hover { background: rgba(255, 157, 36, 0.04); }

/* 新闻 */
.news-list { list-style: none; margin-top: 6px; }
.news-list li { padding: 11px 0; border-bottom: 1px solid var(--border); }
.news-list li:last-child { border-bottom: none; }
.news-title { font-size: 13.5px; color: var(--text); text-decoration: none; display: block; }
.news-title:hover { color: var(--accent); }
.news-summary { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.src-tag { background: var(--card-2); border: 1px solid var(--border); padding: 1px 8px; border-radius: 999px; }
.empty { color: var(--muted); font-size: 13px; padding: 14px 0; text-align: center; }

/* 24h 要闻 */
.summary-list { list-style: none; margin-top: 8px; }
.summary-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.summary-list li:last-child { border-bottom: none; }
.rank {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent);
  margin-top: 2px;
}
.summary-body { flex: 1; }
.summary-title { font-size: 14px; }
.badge-good { background: rgba(248, 81, 73, 0.15); color: var(--up); border-color: rgba(248, 81, 73, 0.4); }
.badge-bad { background: rgba(63, 185, 80, 0.15); color: var(--down); border-color: rgba(63, 185, 80, 0.4); }
.badge-neutral { background: var(--card-2); color: var(--muted); border-color: var(--border); }

/* 日历 */
.cal-list { list-style: none; margin-top: 6px; }
.cal-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cal-list li:last-child { border-bottom: none; }
.cal-time { flex-shrink: 0; width: 96px; font-size: 12.5px; color: var(--muted); }
.cal-body { flex: 1; }
.cal-title { font-size: 13.5px; }
.cal-extra { font-size: 12px; color: var(--muted); margin-top: 2px; }
.imp { flex-shrink: 0; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; }
.imp-3 { background: rgba(248, 81, 73, 0.15); color: var(--bad); }
.imp-2 { background: rgba(210, 153, 34, 0.15); color: var(--warn); }
.imp-1 { background: var(--card-2); color: var(--muted); }

/* 新闻与财经日历共享外框 */
.grid-2 {
  display: grid; grid-template-columns: minmax(0, 1fr) 2px minmax(0, 1fr);
  gap: 0; align-items: stretch;
}
.market-feed-card { padding: 0; overflow: hidden; }
.market-feed-panel { min-width: 0; width: 100%; padding: 20px; align-self: start; }
.market-feed-divider {
  width: 2px; margin: 14px 0; align-self: stretch; justify-self: center;
  background: #3a424e; border-radius: 999px;
}

/* 评分颜色 */
.rating-strong { color: var(--good); }
.rating-good { color: #7ee787; }
.rating-neutral { color: var(--warn); }
.rating-caution { color: var(--risk); }
.rating-bad { color: var(--bad); }
.up { color: var(--up); }
.down { color: var(--down); }
.row-red { background: rgba(248, 81, 73, 0.10) !important; }
.row-red td { border-bottom-color: rgba(248, 81, 73, 0.25); }
.news-red {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: rgba(248, 81, 73, 0.15); color: var(--up); font-size: 12px;
}
.wl-symbol {
  color: var(--accent); text-decoration: none; font-weight: 700; cursor: pointer;
}
.wl-symbol:hover { text-decoration: underline; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 8px; }

@media (max-width: 860px) {
  .result-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .market-feed-divider {
    width: auto; height: 2px; margin: 0 20px; align-self: auto; justify-self: stretch;
  }
  .result-head { flex-direction: column; align-items: center; text-align: center; }
}

body.layout-mobile .market-feed-card { grid-template-columns: 1fr; }
body.layout-mobile .market-feed-divider {
  width: auto; height: 2px; margin: 0 20px; align-self: auto; justify-self: stretch;
}

/* ===== PC / 移动端布局（按 UA 切换，JS 控制 body class） ===== */
body.layout-pc .app { max-width: 1680px; }
body.layout-pc main {
  display: grid;
  --analysis-sidebar-width: 420px;
  grid-template-columns: minmax(0, 1fr) var(--analysis-sidebar-width);
  gap: 18px;
  align-items: start;
  transition: grid-template-columns 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
}
body.layout-pc .main-card { grid-column: 1; grid-row: 1; min-width: 0; }
body.layout-pc .side-shell {
  grid-column: 2;
  grid-row: 1 / span 3;
  position: sticky;
  top: 16px;
  min-width: 0;
  max-height: calc(100vh - 32px);
}
body.layout-pc .side-column {
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* 右侧栏细滚动条 */
body.layout-pc .side-column::-webkit-scrollbar { width: 6px; }
body.layout-pc .side-column::-webkit-scrollbar-thumb { border-width: 1px; }
body.layout-pc .side-column { scrollbar-width: thin; }
body.layout-pc .grid-2 { grid-column: 1; grid-row: 2; }
body.layout-pc .reports-card { grid-column: 1; grid-row: 3; }
body.layout-pc.sidebar-collapsed main { --analysis-sidebar-width: 36px; }
/* K 线图统一高度（内联样式已移除，避免被覆盖） */
#tvContainer { height: 756px; }

/* ===== 项目原生 K 线（无第三方图表依赖）===== */
.native-chart-title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.native-chart-help { margin: -2px 0 10px; }
.native-chart {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); overflow: hidden;
}
.native-chart-toolbar {
  min-height: 46px; display: flex; align-items: center; gap: 12px;
  padding: 7px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.native-chart-periods { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.native-period {
  border: 1px solid transparent; border-radius: 7px; color: var(--muted);
  background: transparent; padding: 5px 9px; cursor: pointer; font: inherit; font-size: 12px;
}
.native-period:hover { color: var(--text); border-color: var(--border); }
.native-period.active { color: #080808; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.native-chart-indicators { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.native-chart-indicators label {
  display: flex; align-items: center; gap: 4px; color: var(--muted);
  cursor: pointer; font-size: 11.5px; white-space: nowrap;
}
.native-chart-indicators label:nth-child(1) { color: #d29922; }
.native-chart-indicators label:nth-child(2) { color: #58a6ff; }
.native-chart-indicators label:nth-child(3) { color: #bc8cff; }
.native-chart-indicators input { accent-color: currentColor; }
.native-chart-settings { position: relative; }
.native-chart-settings-button { padding: 5px 9px; font-size: 11.5px; white-space: nowrap; }
.native-chart-settings-panel {
  position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; width: 230px;
  padding: 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--card); box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.native-chart-settings-panel[hidden] { display: none; }
.native-chart-settings-panel > label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 34px; color: var(--text); font-size: 12px;
}
.native-chart-settings-panel input[type="color"] {
  width: 54px; height: 27px; padding: 2px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); cursor: pointer;
}
.native-chart-settings-panel select {
  min-width: 112px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); background: var(--bg); font: inherit; font-size: 12px;
}
.native-chart-settings-presets {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px;
  padding-top: 9px; border-top: 1px solid var(--border);
}
.native-chart-settings-presets button {
  padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); background: var(--bg); cursor: pointer; font: inherit; font-size: 11px;
}
.native-chart-settings-presets button:hover { color: var(--text); border-color: var(--accent); }
.native-chart-settings-presets button:last-child { grid-column: 1 / -1; }
.native-chart-reset { padding: 5px 9px; font-size: 11.5px; }
.native-chart-history { padding: 5px 9px; font-size: 11.5px; }
.native-chart-history:disabled { opacity: .55; cursor: default; transform: none; }
.native-live-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px;
  color: var(--muted); font-size: 11.5px;
}
.native-live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.native-live-badge.live { color: var(--good); border-color: rgba(63, 185, 80, .4); }
.native-live-badge.live::before { background: var(--good); box-shadow: 0 0 7px var(--good); }
.native-live-badge.warn { color: var(--warn); border-color: rgba(210, 153, 34, .4); }
.native-live-badge.warn::before { background: var(--warn); }
.native-chart-meta {
  min-height: 28px; padding: 5px 12px 2px; color: var(--muted); font-size: 11.5px;
}
.native-chart-ohlc {
  min-height: 27px; padding: 2px 12px 5px; color: var(--text);
  font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow-x: auto;
}
.native-chart-stage {
  height: 600px; position: relative; outline: none; touch-action: none;
  cursor: crosshair; user-select: none;
}
.native-chart-stage.dragging { cursor: grabbing; }
.native-chart-stage.pinching { cursor: zoom-in; }
.native-chart-stage.cursor-mode { cursor: crosshair; }
.native-chart-stage.price-axis-hover { cursor: ns-resize; }
.native-chart-stage.cursor-mode::after,
.native-chart-stage.pinching::after {
  position: absolute; z-index: 3; top: 8px; right: 82px;
  padding: 4px 8px; border: 1px solid rgba(255, 157, 36, .5); border-radius: 999px;
  color: #c9d1d9; background: rgba(22, 27, 34, .88); font-size: 10.5px;
  pointer-events: none;
}
.native-chart-stage.cursor-mode::after { content: "光标模式"; }
.native-chart-stage.pinching::after { content: "双指缩放"; }
.native-chart-stage canvas { display: block; width: 100%; height: 100%; transition: opacity .15s; }
.native-chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 13px; pointer-events: none; padding: 24px; text-align: center;
}

@media (max-width: 700px) {
  .native-chart-toolbar { align-items: flex-start; }
  .native-chart-indicators { order: 3; width: 100%; margin-left: 0; }
  .native-chart-settings-panel { right: auto; left: 0; }
  .native-chart-reset { margin-left: auto; }
  .native-chart-stage { height: 440px; }
}

/* 移动端触摸优化 */
body.layout-mobile .search-row input { min-height: 42px; }
body.layout-mobile .btn-primary { min-height: 42px; }
body.layout-mobile .topbar-right { flex-wrap: wrap; justify-content: flex-end; }

/* 宽屏兜底：即使 JS 未运行，≥1280px 也走 PC 布局（手动指定手机版除外） */
@media (min-width: 1280px) {
  body:not(.layout-mobile) .app { max-width: 1680px; }
  body:not(.layout-mobile) main {
    display: grid;
    --analysis-sidebar-width: 420px;
    grid-template-columns: minmax(0, 1fr) var(--analysis-sidebar-width);
    gap: 18px;
    align-items: start;
    transition: grid-template-columns 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  body:not(.layout-mobile) .main-card { grid-column: 1; grid-row: 1; min-width: 0; }
  body:not(.layout-mobile) .side-shell {
    grid-column: 2;
    grid-row: 1 / span 3;
    position: sticky;
    top: 16px;
    min-width: 0;
    max-height: calc(100vh - 32px);
  }
  body:not(.layout-mobile) .side-column {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  body:not(.layout-mobile) .side-column::-webkit-scrollbar { width: 6px; }
  body:not(.layout-mobile) .side-column::-webkit-scrollbar-thumb { border-width: 1px; }
  body:not(.layout-mobile) .side-column { scrollbar-width: thin; }
  body:not(.layout-mobile) .grid-2 { grid-column: 1; grid-row: 2; }
  body:not(.layout-mobile) .reports-card { grid-column: 1; grid-row: 3; }
  body:not(.layout-mobile).sidebar-collapsed main { --analysis-sidebar-width: 36px; }
}

/* ===== 分析页右侧栏折叠 ===== */
.side-shell { min-width: 0; }
.side-collapse-toggle { display: none; }
body.layout-pc .side-collapse-toggle,
body:not(.layout-mobile) .side-collapse-toggle {
  position: absolute; z-index: 12; top: 18px; left: -14px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 29px; height: 54px; padding: 0;
  color: var(--muted); background: var(--card-2);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35); cursor: pointer;
  transition: left .38s cubic-bezier(.22, .61, .36, 1), color .2s ease,
    border-color .2s ease, background .2s ease, transform .18s ease;
}
.side-collapse-toggle:hover {
  color: var(--accent); border-color: var(--accent); background: #1d1811;
}
.side-collapse-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.side-collapse-toggle:active { transform: scale(.94); }
.side-collapse-icon {
  display: block; font-family: "Segoe UI", sans-serif; font-size: 26px; line-height: 1;
  transition: transform .38s cubic-bezier(.22, .61, .36, 1);
}
.side-column {
  opacity: 1; transform: translateX(0); visibility: visible;
  transition: opacity .24s ease .08s, transform .38s cubic-bezier(.22, .61, .36, 1), visibility 0s;
}
body:not(.layout-mobile).sidebar-collapsed .side-column {
  opacity: 0; transform: translateX(28px); visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .38s cubic-bezier(.22, .61, .36, 1), visibility 0s .38s;
}
body.layout-pc.sidebar-collapsed .side-collapse-toggle,
body:not(.layout-mobile).sidebar-collapsed .side-collapse-toggle { left: 3px; }
body:not(.layout-mobile).sidebar-collapsed .side-collapse-icon { transform: rotate(180deg); }
body.layout-mobile .side-collapse-toggle { display: none; }

@media (prefers-reduced-motion: reduce) {
  body.layout-pc main,
  body:not(.layout-mobile) main,
  .side-column,
  .side-collapse-toggle,
  .side-collapse-icon { transition-duration: .01ms !important; transition-delay: 0s !important; }
}

@keyframes priceFlash {
  0% { box-shadow: inset 0 0 0 2px rgba(255, 157, 36, 0.72); }
  100% { box-shadow: inset 0 0 0 0 rgba(255, 157, 36, 0); }
}
.price-flash {
  animation: priceFlash 0.9s ease-out;
  border-radius: 4px;
}
@keyframes valueUpdated {
  0% { background: rgba(255, 157, 36, .30); color: #fff2df; }
  100% { background: transparent; }
}
.value-updated {
  animation: valueUpdated .9s cubic-bezier(.22,.61,.36,1);
  border-radius: 5px;
}

/* ==================== 动效增强 ==================== */
.card {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  animation: cardIn 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.card:hover {
  border-color: rgba(255, 157, 36, 0.38);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-primary:disabled, .btn-ghost:disabled, button:disabled { cursor: not-allowed; }
.btn-primary.is-loading, .btn-ghost.is-loading { cursor: wait; opacity: .78; }
.btn-primary.is-loading::after, .btn-ghost.is-loading::after {
  content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 7px;
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: spin .7s linear infinite;
}
.btn-primary, .btn-ghost {
  transition: transform 0.15s ease, box-shadow 0.2s ease,
    border-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(255, 157, 36, 0.22); }
.btn-ghost:hover { transform: translateY(-1px); }
.btn-primary:active, .btn-ghost:active { transform: translateY(0) scale(0.97); }
.tab {
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    transform 0.18s ease, box-shadow 0.2s ease;
}
.tab:hover { transform: translateY(-1px); color: var(--text); border-color: rgba(255, 157, 36, 0.48); }
.tab.active:hover { transform: translateY(-1px); color: var(--accent); box-shadow: 0 6px 14px rgba(255, 157, 36, 0.18); }
.user-dropdown {
  animation: dropdownIn 0.18s ease;
  transform-origin: top right;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
}
#result { animation: fadeInUp 0.45s cubic-bezier(0.22, 0.61, 0.36, 1); }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
}
.news-list li, .summary-list li, .cal-list li {
  transition: background var(--motion-fast) ease, transform var(--motion-fast) ease;
  border-radius: 8px;
}
.news-list li:hover, .summary-list li:hover, .cal-list li:hover {
  background: rgba(255, 157, 36, 0.05); transform: translateX(2px);
}
.news-list li, .summary-list li, .cal-list li { animation: rowIn 0.35s ease both; }
@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
}

/* 骨架屏（加载占位） */
.skeleton-row {
  height: 16px;
  border-radius: 6px;
  margin: 12px 0;
  background: linear-gradient(90deg, var(--card-2) 25%, #292929 50%, var(--card-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton-row.short { width: 55%; }
.skeleton-row.tiny { width: 30%; height: 12px; }
.news-list li.skeleton-row, .cal-list li.skeleton-row { padding: 4px 0; border-bottom: none; }
@keyframes shimmer {
  to { background-position: -200% 0; }
}

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

/* ==================== 盘口监控 ==================== */
.ob-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ob-score { font-size: 26px; font-weight: 800; }
.ob-score.warn { color: var(--warn); }
.ob-level { font-size: 13px; color: var(--muted); }
.ob-bar { flex: 1; min-width: 140px; height: 8px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.ob-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.ob-bar-fill.up { background: var(--up); }
.ob-bar-fill.warn { background: var(--warn); }
.ob-bar-fill.down { background: var(--down); }
.ob-section { margin-top: 12px; }
.ob-section b { font-size: 13px; color: var(--muted); font-weight: 600; }
.ob-direction { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.ob-direction.badge-good { border-color: rgba(248, 81, 73, .4); }
.ob-direction.badge-bad { border-color: rgba(63, 185, 80, .4); }
.ob-llm {
  margin-top: 12px;
  background: rgba(255, 157, 36, 0.06);
  border: 1px solid rgba(255, 157, 36, 0.20);
  border-radius: 10px;
  padding: 12px 14px;
}
.ob-llm-summary { font-size: 14px; margin-top: 6px; }
.ob-quality { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(210, 153, 34, 0.1); }
.wall-buy { color: var(--accent); }
.wall-sell { color: var(--up); }
.event-cancel { color: var(--up); }
.event-place { color: var(--accent); }
.event-bullish { color: var(--up); }
.event-bearish { color: var(--down); }
.ob-event, .ob-wall { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ==================== 首页三工作区 v43 ==================== */
.workspace-nav {
  position: sticky; top: 0; z-index: 25;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px; margin: 0 0 18px; padding: 6px;
  border: 1px solid var(--border); border-radius: 14px;
  background: rgba(8, 8, 8, .92); box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px);
}
.workspace-tab {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px;
  color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-weight: 600;
  transition: color .22s ease, background .22s ease, border-color .22s ease, transform .18s ease;
}
.workspace-tab:hover { color: var(--text); background: rgba(255, 157, 36, .07); }
.workspace-tab:active { transform: scale(.985); }
.workspace-tab.active {
  color: var(--text); border-color: rgba(255, 157, 36, .58);
  background: #1a150f;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.workspace-tab-icon { color: var(--accent); font-size: 13px; }
body.layout-pc main.workspace-main,
body:not(.layout-mobile) main.workspace-main { display: block; }
.workspace-view { display: none; min-width: 0; }
.workspace-view.active { display: block; animation: workspaceIn .3s cubic-bezier(.22, .61, .36, 1); }
@keyframes workspaceIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.workspace-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin: 4px 2px 18px;
}
.workspace-heading h2 { margin-top: 2px; font-size: 25px; letter-spacing: -.02em; }
.workspace-heading p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: .18em; }
.live-connection {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 7px 12px; border: 1px solid rgba(63, 185, 80, .35); border-radius: 999px;
  color: var(--good); background: rgba(63, 185, 80, .07); font-size: 12px;
}
.live-connection-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--good);
  box-shadow: 0 0 9px var(--good); animation: liveDot 1.8s ease-in-out infinite;
}
.live-connection.offline { color: var(--warn); border-color: rgba(210, 153, 34, .36); background: rgba(210, 153, 34, .07); }
.live-connection.offline .live-connection-dot { background: var(--warn); box-shadow: none; animation: none; }
@keyframes liveDot { 50% { opacity: .45; box-shadow: 0 0 3px var(--good); } }
.market-pulse-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
.pulse-card {
  min-width: 0; padding: 15px 17px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card);
  transition: border-color var(--motion-normal) ease, transform var(--motion-normal) var(--ease-out), box-shadow var(--motion-normal) ease;
}
.pulse-card:hover { border-color: rgba(255, 157, 36, .28); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.pulse-card span, .pulse-card small { display: block; color: var(--muted); font-size: 11.5px; }
.pulse-card strong { display: block; margin: 2px 0 1px; font-size: 24px; font-variant-numeric: tabular-nums; }
.pulse-card.pulse-up strong { color: var(--up); }
.pulse-card.pulse-down strong { color: var(--down); }
.realtime-card { padding: 0; overflow: hidden; }
.realtime-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.realtime-market-tabs, .market-list-tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.realtime-market-tabs button, .market-list-tabs button {
  padding: 7px 13px; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); background: transparent; cursor: pointer; font: inherit; font-size: 12.5px;
  transition: color var(--motion-fast) ease, background var(--motion-fast) ease, border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}
.realtime-market-tabs button:active, .market-list-tabs button:active:not(:disabled) { transform: scale(.96); }
.realtime-market-tabs button:hover, .market-list-tabs button:hover:not(:disabled) { color: var(--text); background: var(--card-2); }
.realtime-market-tabs button.active, .market-list-tabs button.active {
  color: var(--accent); border-color: rgba(255, 157, 36, .55); background: #1a150f; font-weight: 700;
}
.market-list-tabs { padding: 9px 16px; border-bottom: 1px solid var(--border); }
.market-list-tabs button:disabled { opacity: .48; cursor: default; }
.market-list-tabs small { margin-left: 4px; color: var(--muted); font-size: 9.5px; }
.realtime-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.sort-status { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.watchlist-add-row {
  display: grid; grid-template-columns: 110px minmax(180px, 360px) auto; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.watchlist-add-row input {
  min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); background: var(--bg); outline: none; font: inherit; font-size: 13px;
}
.watchlist-add-row input { transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease; }
.watchlist-add-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 157, 36, .10); }
.watchlist-add-row .btn-primary { min-height: 38px; padding: 0 18px; font-size: 13px; }
.realtime-empty { padding: 40px 20px; color: var(--muted); text-align: center; }
.realtime-empty .btn-ghost { margin-left: 8px; text-decoration: none; }
.realtime-table-wrap { max-height: min(62vh, 720px); overflow: auto; }
.realtime-table { min-width: 1240px; }
.realtime-table thead { position: sticky; top: 0; z-index: 4; background: var(--card); }
.realtime-table th { padding-top: 9px; padding-bottom: 9px; white-space: nowrap; }
.realtime-table td { height: 54px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.realtime-table tbody tr { transition: background .18s ease, opacity .18s ease, transform .18s ease; }
.realtime-table tbody tr:hover { background: rgba(255, 157, 36, .055); box-shadow: inset 2px 0 0 rgba(255, 157, 36, .45); }
.sort-header {
  display: inline-flex; align-items: center; gap: 5px; padding: 0;
  border: 0; color: inherit; background: transparent; cursor: pointer; font: inherit; font-weight: 600;
}
.sort-header { transition: color var(--motion-fast) ease, transform var(--motion-fast) ease; }
.sort-header:active { transform: scale(.96); }
.sort-header span { color: #66707d; font-size: 11px; }
.sort-header.active { color: var(--accent); }
.sort-header.active span { color: var(--accent); }
.drag-column { width: 34px; }
.ranking-number {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 7px; color: var(--muted); font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.realtime-table tbody tr:nth-child(-n+3) .ranking-number { color: var(--accent); border-color: rgba(255, 157, 36, .42); }
.ranking-add:disabled { opacity: .45; cursor: default; }
.drag-handle {
  display: inline-grid; place-items: center; width: 26px; height: 30px;
  border: 0; border-radius: 6px; color: #66707d; background: transparent;
  cursor: grab; touch-action: none; user-select: none; font-size: 18px;
}
.drag-handle:hover { color: var(--accent); background: rgba(255, 157, 36, .10); }
.drag-handle:active { cursor: grabbing; }
.drag-handle[disabled] { opacity: .25; cursor: not-allowed; }
.realtime-table tr.dragging { opacity: .48; background: rgba(255, 157, 36, .12); }
.realtime-table tr.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
.asset-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.asset-type-chip {
  display: inline-flex; padding: 2px 8px; border: 1px solid var(--border);
  border-radius: 999px; color: var(--muted); background: var(--card-2); font-size: 10.5px;
}
.numeric-muted { color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-actions .btn-ghost { padding: 5px 9px; font-size: 11px; }
#viewAnalysis .main-card, #viewAnalysis .reports-card { width: 100%; }
#viewAnalysis .reports-card { margin-top: 0; }
.news-summary-card { margin-bottom: 18px; }

@media (max-width: 900px) {
  .workspace-nav { position: static; grid-template-columns: 1fr; }
  .workspace-tab { justify-content: flex-start; min-height: 42px; }
  .market-pulse-grid { grid-template-columns: 1fr 1fr; }
  .realtime-toolbar { align-items: flex-start; flex-direction: column; }
  .realtime-toolbar-actions { width: 100%; justify-content: space-between; }
  .watchlist-add-row { grid-template-columns: 92px minmax(0, 1fr) auto; }
}
@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 10px 4px 16px;
  }
  .brand { min-width: 0; }
  .brand h1 { white-space: nowrap; font-size: 18px; }
  .brand .subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-right { justify-content: flex-start; gap: 8px; }
  .topbar-right .btn-ghost { padding-inline: 10px; }
  .topbar-right .status { margin-left: auto; padding-inline: 10px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
  .market-pulse-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .pulse-card { padding: 12px; }
  .pulse-card strong { font-size: 20px; }
  .watchlist-add-row { grid-template-columns: 86px minmax(0, 1fr); }
  .watchlist-add-row .btn-primary { grid-column: 1 / -1; min-height: 40px; }
  .sort-status { display: none; }
}
