/* 复盘吧共享皮肤：只覆盖展示，不重排业务面板，不修改联动或数据。 */
html.fupanba-ui {
  --fp-page: #f5f7fa;
  --fp-surface: #ffffff;
  --fp-soft: #f8f9fc;
  --fp-text: #1b2333;
  --fp-secondary: #596476;
  --fp-muted: #697586;
  --fp-line: #dce2ea;
  --fp-accent: #2547b6;
  --fp-accent-soft: #eef2ff;
  --fp-up: #c43140;
  --fp-down: #117c50;
  --fp-hover: #f2f5fb;
  --fp-scrollbar: #bdc7d5;
  --fp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
html.fupanba-ui[data-fp-theme="dark"] {
  --fp-page: #0b1120;
  --fp-surface: #111827;
  --fp-soft: #172133;
  --fp-text: #e5eaf2;
  --fp-secondary: #abb5c7;
  --fp-muted: #96a3b8;
  --fp-line: #303b4d;
  --fp-accent: #93b4ff;
  --fp-accent-soft: #233357;
  --fp-up: #ff8893;
  --fp-down: #57d5a3;
  --fp-hover: #1b273b;
  --fp-scrollbar: #506078;
}
/* 兼容原叶页的变量名。保留涨跌语义，不通过反色滤镜处理图表。 */
html.fupanba-ui[data-fp-theme],
html.fupanba-ui[data-fp-theme] body.fp-ui-leaf {
  --bg-body: var(--fp-page);
  --bg-app: var(--fp-page);
  --bg-surface: var(--fp-surface);
  --bg-elevated: var(--fp-soft);
  --bg-table-head: var(--fp-soft);
  --bg-highlight-soft: var(--fp-accent-soft);
  --bg-main: var(--fp-page);
  --bg-primary: var(--fp-page);
  --primary-bg: var(--fp-page);
  --p-bg-main: var(--fp-page);
  --bg-panel: var(--fp-surface);
  --bg-input: var(--fp-surface);
  --bg-toolbar: var(--fp-soft);
  --bg-panel-header: var(--fp-soft);
  --bg-panel-header-green: var(--fp-soft);
  --bg-panel-header-kpl: var(--fp-soft);
  --bg-panel-header-ths: var(--fp-soft);
  --bg-row-selected: var(--fp-accent-soft);
  --bg-body-texture: none;
  --bg-secondary: var(--fp-surface);
  --bg-header: var(--fp-soft);
  --bg-sidebar: var(--fp-surface);
  --card-bg: var(--fp-surface);
  --p-glass-bg: var(--fp-surface);
  --bg-tertiary: var(--fp-soft);
  --bg-hover: var(--fp-hover);
  --bg-row-alt: var(--fp-soft);
  --bg-row-hover: var(--fp-hover);
  --bg-row-active: var(--fp-accent-soft);
  --card-hover: var(--fp-hover);
  --card-active: var(--fp-accent-soft);
  --table-header-bg: var(--fp-soft);
  --table-row-alt: var(--fp-soft);
  --table-row-hover: var(--fp-hover);
  --text-primary: var(--fp-text);
  --text-title: var(--fp-text);
  --p-text-primary: var(--fp-text);
  --text-secondary: var(--fp-secondary);
  --text-tertiary: var(--fp-muted);
  --text-on-accent: var(--fp-surface);
  --text-muted: var(--fp-muted);
  --text-th: var(--fp-secondary);
  --text-link: var(--fp-accent);
  --text-link-hover: var(--fp-accent);
  --p-text-muted: var(--fp-muted);
  --border-color: var(--fp-line);
  --border-hover: var(--fp-accent);
  --border-light: var(--fp-line);
  --border-subtle: var(--fp-line);
  --border-default: var(--fp-line);
  --border-strong: var(--fp-scrollbar);
  --border-accent: var(--fp-accent);
  --p-border: var(--fp-line);
  --accent-color: var(--fp-accent);
  --accent: var(--fp-accent);
  --accent-data: var(--fp-accent);
  --accent-link: var(--fp-accent-soft);
  --accent-soft: var(--fp-accent-soft);
  --accent-blue: var(--fp-accent);
  --accent-secondary: var(--fp-accent);
  --p-accent: var(--fp-accent);
  --color-up: var(--fp-up);
  --p-up: var(--fp-up);
  --positive: var(--fp-up);
  --color-down: var(--fp-down);
  --p-down: var(--fp-down);
  --negative: var(--fp-down);
  --p-flat: var(--fp-muted);
  --scrollbar-thumb: var(--fp-scrollbar);
  --shadow-color: transparent;
  --shadow-panel: none;
  --shadow-active: none;
  --btn-bg: var(--fp-soft);
  --btn-bg-hover: var(--fp-hover);
  --btn-text: var(--fp-text);
  /* 全球市场看板使用另一组简短变量名。 */
  --bg: var(--fp-page);
  --bg-2: var(--fp-soft);
  --panel: var(--fp-surface);
  --panel-2: var(--fp-soft);
  --text: var(--fp-text);
  --soft: var(--fp-secondary);
  --faint: var(--fp-muted);
  --line: var(--fp-line);
  --line-2: var(--fp-line);
  --up: var(--fp-up);
  --down: var(--fp-down);
  --flat: var(--fp-muted);
}
html.fupanba-ui body:not(.fupanba-shell) {
  background: #f5f7fa !important;
  background: var(--fp-page) !important;
  color: #1b2333 !important;
  color: var(--fp-text) !important;
  font-family: var(--fp-font) !important;
  font-size: 14px !important;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html.fupanba-ui body:not(.fupanba-shell) button,
html.fupanba-ui body:not(.fupanba-shell) input,
html.fupanba-ui body:not(.fupanba-shell) select,
html.fupanba-ui body:not(.fupanba-shell) textarea {
  font-family: var(--fp-font) !important;
  font-size: 14px !important;
  color: var(--fp-text);
  background-color: var(--fp-surface);
  border-color: var(--fp-line);
}
html.fupanba-ui body:not(.fupanba-shell) button,
html.fupanba-ui body:not(.fupanba-shell) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.fupanba-ui body:not(.fupanba-shell) select {
  min-height: 30px;
}
html.fupanba-ui body:not(.fupanba-shell) button {
  background-image: none !important;
  background-color: var(--fp-soft) !important;
  color: var(--fp-text) !important;
  border: 1px solid var(--fp-line);
  border-radius: 5px;
  box-shadow: none !important;
  text-shadow: none !important;
}
html.fupanba-ui body:not(.fupanba-shell) button:hover { background-color: var(--fp-hover) !important; }
html.fupanba-ui body:not(.fupanba-shell) button:disabled { opacity: .55; cursor: default; }
html.fupanba-ui body:not(.fupanba-shell) a { color: var(--fp-accent); }
html.fupanba-ui body:not(.fupanba-shell) a:hover { text-decoration: underline; }
html.fupanba-ui body:not(.fupanba-shell) a:focus,
html.fupanba-ui body:not(.fupanba-shell) button:focus,
html.fupanba-ui body:not(.fupanba-shell) input:focus,
html.fupanba-ui body:not(.fupanba-shell) select:focus {
  outline: 2px solid var(--fp-accent);
  outline-offset: 2px;
}
/* 明确的结构容器只换表面色；宽高、定位、拖动手柄、图表保持原样。 */
html.fupanba-ui .fp-ui-leaf .fp-ui-surface,
html.fupanba-ui .fp-ui-leaf .card,
html.fupanba-ui .fp-ui-leaf .panel,
html.fupanba-ui .fp-ui-leaf .left-panel,
html.fupanba-ui .fp-ui-leaf .right-panel,
html.fupanba-ui .fp-ui-leaf .sidebar,
html.fupanba-ui .fp-ui-leaf .news-item,
html.fupanba-ui .fp-ui-leaf .news-card,
html.fupanba-ui .fp-ui-leaf .stock-item,
html.fupanba-ui .fp-ui-leaf .analysis-section,
html.fupanba-ui .fp-ui-leaf .factor-item,
html.fupanba-ui .fp-ui-leaf .index-card,
html.fupanba-ui .fp-ui-leaf #left-container,
html.fupanba-ui .fp-ui-leaf #right-container {
  background: var(--fp-surface) !important;
  border-color: var(--fp-line) !important;
  color: var(--fp-text);
  box-shadow: none !important;
  text-shadow: none !important;
}
html.fupanba-ui .fp-ui-leaf .header,
html.fupanba-ui .fp-ui-leaf .toolbar,
html.fupanba-ui .fp-ui-leaf .topbar,
html.fupanba-ui .fp-ui-leaf .card-header,
html.fupanba-ui .fp-ui-leaf .panel-header,
html.fupanba-ui .fp-ui-leaf .section-header,
html.fupanba-ui .fp-ui-leaf .matrix-group-header,
html.fupanba-ui .fp-ui-leaf .summary-strip,
html.fupanba-ui .fp-ui-leaf .clock,
html.fupanba-ui .fp-ui-leaf .acell,
html.fupanba-ui .fp-ui-leaf .topbar-time,
html.fupanba-ui .fp-ui-leaf #header-overlay {
  background: var(--fp-soft) !important;
  border-color: var(--fp-line) !important;
  color: var(--fp-text) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html.fupanba-ui .fp-ui-leaf h1,
html.fupanba-ui .fp-ui-leaf h2 { font-size: 20px; color: var(--fp-text) !important; text-shadow: none !important; }
html.fupanba-ui .fp-ui-leaf h3,
html.fupanba-ui .fp-ui-leaf .card-title,
html.fupanba-ui .fp-ui-leaf .panel-title,
html.fupanba-ui .fp-ui-leaf .section-title { font-size: 16px; color: var(--fp-text) !important; text-shadow: none !important; }
html.fupanba-ui .fp-ui-leaf .subtitle,
html.fupanba-ui .fp-ui-leaf .last-update,
html.fupanba-ui .fp-ui-leaf .update-time,
html.fupanba-ui .fp-ui-leaf .loading,
html.fupanba-ui .fp-ui-leaf .empty,
html.fupanba-ui .fp-ui-leaf .muted,
html.fupanba-ui .fp-ui-leaf .toolbar-info,
html.fupanba-ui .fp-ui-leaf .heat-group-title,
html.fupanba-ui .fp-ui-leaf .ss-label { color: var(--fp-muted) !important; font-size: 12px; }
html.fupanba-ui .fp-ui-leaf .news-title,
html.fupanba-ui .fp-ui-leaf .news-content,
html.fupanba-ui .fp-ui-leaf .stock-name,
html.fupanba-ui .fp-ui-leaf .hc-name,
html.fupanba-ui .fp-ui-leaf .tb-stats b { color: var(--fp-text); }
html.fupanba-ui .fp-ui-leaf .news-title,
html.fupanba-ui .fp-ui-leaf .stock-name { font-size: 14px; }
html.fupanba-ui .fp-ui-leaf .fp-ui-muted-inline { color: var(--fp-secondary) !important; }
html.fupanba-ui .fp-ui-leaf .nav-item.active,
html.fupanba-ui .fp-ui-leaf .tab.active,
html.fupanba-ui .fp-ui-leaf .tab-btn.active,
html.fupanba-ui .fp-ui-leaf button.active,
html.fupanba-ui .fp-ui-leaf .selected {
  color: var(--fp-accent) !important;
  background-color: var(--fp-accent-soft) !important;
  border-color: var(--fp-accent) !important;
}
/* 表格不强行更改列宽、table-layout、排序标记、用户调整过的尺寸。 */
html.fupanba-ui .fp-ui-leaf .fp-ui-table { font-family: var(--fp-font); font-size: 14px !important; color: var(--fp-text); }
html.fupanba-ui .fp-ui-leaf .fp-ui-table th,
html.fupanba-ui .fp-ui-leaf .fp-ui-table td {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  border-color: var(--fp-line) !important;
  font-size: 14px !important;
  line-height: 20px !important;
  font-variant-numeric: tabular-nums;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.fupanba-ui .fp-ui-leaf .fp-ui-table th {
  background: var(--fp-soft) !important;
  color: var(--fp-secondary) !important;
  font-weight: 600;
  border-radius: 0 !important;
}
html.fupanba-ui .fp-ui-leaf .fp-ui-table td:not(.up):not(.down):not(.positive):not(.negative):not(.color-up):not(.color-down):not(.red):not(.green):not([style*="color"]) { color: var(--fp-text); }
html.fupanba-ui .fp-ui-leaf .fp-ui-table tbody tr { background: var(--fp-surface) !important; }
html.fupanba-ui .fp-ui-leaf .fp-ui-table tbody tr:nth-child(even) { background: var(--fp-soft) !important; }
html.fupanba-ui .fp-ui-leaf .fp-ui-table tbody tr:hover,
html.fupanba-ui .fp-ui-leaf .fp-ui-table tbody tr:hover td { background: var(--fp-hover) !important; }
html.fupanba-ui .fp-ui-leaf .fp-ui-table tr.selected,
html.fupanba-ui .fp-ui-leaf .fp-ui-table tr.selected td { background: var(--fp-accent-soft) !important; }
html.fupanba-ui .fp-ui-leaf .fp-ui-scroll {
  overflow: auto !important;
  max-height: 72vh;
  max-height: var(--fp-table-max-height, 72vh);
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
html.fupanba-ui .fp-ui-leaf .fp-ui-scroll .fp-ui-table thead th {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
}
html.fupanba-ui .fp-ui-leaf .fp-ui-fluid { max-width: none !important; }
html.fupanba-ui .fp-ui-leaf .up,
html.fupanba-ui .fp-ui-leaf .positive,
html.fupanba-ui .fp-ui-leaf .color-up,
html.fupanba-ui .fp-ui-leaf .stock-up,
html.fupanba-ui .fp-ui-leaf .rise { color: var(--fp-up) !important; }
html.fupanba-ui .fp-ui-leaf .down,
html.fupanba-ui .fp-ui-leaf .negative,
html.fupanba-ui .fp-ui-leaf .color-down,
html.fupanba-ui .fp-ui-leaf .stock-down,
html.fupanba-ui .fp-ui-leaf .fall { color: var(--fp-down) !important; }
/* 老式二级导航保留原 ID、链接和拖拽节点，仅换布局与选中颜色。 */
html.fupanba-ui body.fp-ui-wrapper #autore {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  margin: 0 !important;
  background: var(--fp-surface) !important;
  border-bottom: 1px solid var(--fp-line) !important;
  height: 38px !important;
  padding: 3px 8px !important;
  display: flex;
  align-items: center;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  line-height: 1.4 !important;
}
html.fupanba-ui body.fp-ui-wrapper #autore .nav-item { display: inline-flex; flex: 0 0 auto; border: 0; margin: 0 2px; padding: 0; }
html.fupanba-ui body.fp-ui-wrapper #autore a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 4px;
  color: var(--fp-secondary) !important;
  font-size: 14px !important;
  text-decoration: none;
}
html.fupanba-ui body.fp-ui-wrapper #autore a span,
html.fupanba-ui body.fp-ui-wrapper #autore a font { color: inherit !important; font-size: inherit !important; }
html.fupanba-ui body.fp-ui-wrapper #autore a:hover { background: var(--fp-hover); text-decoration: none; }
html.fupanba-ui body.fp-ui-wrapper #autore .fp-ui-nav-active a,
html.fupanba-ui body.fp-ui-wrapper #autore a.fp-ui-nav-active { background: var(--fp-accent-soft); color: var(--fp-accent) !important; }
html.fupanba-ui body.fp-ui-wrapper #sl {
  position: relative !important;
  top: 0 !important;
  left: auto !important;
  display: block !important;
  width: 100% !important;
  height: calc(100vh - 38px) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: var(--fp-page) !important;
}
/* HTTPS 页中的普通 HTTP iframe 不自动降级，仅提供显式独立窗口入口。 */
html.fupanba-ui body.fp-ui-leaf .fp-ui-http-compat {
  position: fixed !important;
  top: 44px !important;
  right: 12px !important;
  left: auto !important;
  z-index: 10001;
  display: inline-block;
  width: auto !important;
  min-height: 30px;
  margin: 0 !important;
  padding: 5px 10px !important;
  border: 1px solid var(--fp-line);
  border-radius: 5px;
  background: var(--fp-surface) !important;
  color: var(--fp-accent) !important;
  font-family: var(--fp-font);
  font-size: 12px !important;
  line-height: 18px;
  text-decoration: none !important;
  box-shadow: none;
}
html.fupanba-ui body.fp-ui-leaf .fp-ui-http-compat:hover { background: var(--fp-hover) !important; }
html.fupanba-ui body:not(.fupanba-shell) ::-webkit-scrollbar { width: 8px; height: 8px; }
html.fupanba-ui body:not(.fupanba-shell) ::-webkit-scrollbar-track { background: var(--fp-soft); }
html.fupanba-ui body:not(.fupanba-shell) ::-webkit-scrollbar-thumb { background: var(--fp-scrollbar); border-radius: 4px; }
@media (max-width: 700px) {
  html.fupanba-ui body.fp-ui-wrapper #autore a { padding: 0 8px; }
  html.fupanba-ui .fp-ui-leaf .fp-ui-table th,
  html.fupanba-ui .fp-ui-leaf .fp-ui-table td { font-size: 13px !important; }
}
