/* ============================================================
   汇鑫网 · 专业金融终端设计系统 v2 (2026-10-31 全站改版)
   设计语言：深蓝黑金融终端 + 金融蓝主色 + 金铜点缀 + A股红涨绿跌
   原则：保留全部历史选择器与机制(冻结列/粘性表头/排序指示/多主题)，
        仅重定义视觉，零模板/JS/后端改动
   ============================================================ */

/* ---------------- 主题变量 ---------------- */
/* 深色终端（默认） */
:root,
[data-theme="dark"] {
  --bg-primary: #0a0e17;
  --bg-secondary: #10141f;
  --bg-card: #141926;
  --bg-hover: #1b2233;
  --border-color: #232b3d;
  --border-strong: #303a52;
  --text-primary: #e7ecf5;
  --text-secondary: #97a3ba;
  --text-muted: #5f6b82;
  --accent: #3d7bfd;
  --accent-hover: #5d93ff;
  --accent-dim: rgba(61,123,253,.14);
  --gold: #e8bb4d;
  --gold-dim: rgba(232,187,77,.15);
  --red: #ff4d57;
  --green: #2ec27e;
  --shadow: 0 6px 24px rgba(2,6,16,.5);
  --shadow-sm: 0 2px 10px rgba(2,6,16,.4);
  --nav-bg: #0c1119;
  --nav-border: #1d2637;
  --subnav-bg: #0f1520;
  --nav-fg: #c3cde2;          /* 导航文字：深底上高对比 */
  --nav-fg-strong: #f2f6ff;   /* 导航强调文字（品牌名/hover） */
  --grid-line: rgba(255,255,255,.035);
  --font-num: 'DIN Alternate', 'Bahnschrift', 'Segoe UI', ui-monospace, monospace;
  --bg-main: var(--bg-primary);
}
/* 明亮模式 */
[data-theme="light"] {
  --bg-primary: #eef1f6;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f4fb;
  --border-color: #dde3ec;
  --border-strong: #c4cede;
  --text-primary: #17233c;
  --text-secondary: #4e5d78;
  --text-muted: #93a1b8;
  --accent: #2861e0;
  --accent-hover: #1d51c4;
  --accent-dim: rgba(40,97,224,.10);
  --gold: #c08a17;
  --gold-dim: rgba(192,138,23,.14);
  --red: #e02e37;
  --green: #0e9a56;
  --shadow: 0 4px 16px rgba(23,35,60,.10);
  --shadow-sm: 0 2px 8px rgba(23,35,60,.07);
  --nav-bg: #14213d;
  --nav-border: #1f3057;
  --subnav-bg: #ffffff;
  --nav-fg: #c5cfe8;
  --nav-fg-strong: #ffffff;
  --nav-hover-bg: rgba(255,255,255,.12);  /* 浅色主题：hover用亮色蒙层，不能用页面的浅色--bg-hover */
  --grid-line: rgba(23,35,60,.045);
  --font-num: 'DIN Alternate', 'Bahnschrift', 'Segoe UI', ui-monospace, monospace;
  --bg-main: var(--bg-primary);
}
/* 护眼绿 */
[data-theme="green"] {
  --bg-primary: #0d1a13;
  --bg-secondary: #122119;
  --bg-card: #15271d;
  --bg-hover: #1c3327;
  --border-color: #24402f;
  --border-strong: #31553e;
  --text-primary: #d8ecdd;
  --text-secondary: #8bb39a;
  --text-muted: #5d8270;
  --accent: #3ecf8e;
  --accent-hover: #58dc9f;
  --accent-dim: rgba(62,207,142,.13);
  --gold: #d9b64a;
  --gold-dim: rgba(217,182,74,.14);
  --red: #ff5d55;
  --green: #35c98a;
  --shadow: 0 6px 20px rgba(0,8,3,.45);
  --shadow-sm: 0 2px 8px rgba(0,8,3,.35);
  --nav-bg: #0e1c14;
  --nav-border: #1c3326;
  --subnav-bg: #101f17;
  --nav-fg: #b4d3c1;
  --nav-fg-strong: #edf9f1;
  --grid-line: rgba(255,255,255,.035);
  --font-num: 'DIN Alternate', 'Bahnschrift', 'Segoe UI', ui-monospace, monospace;
  --bg-main: var(--bg-primary);
}
/* 黄昏纸色 */
[data-theme="sepia"] {
  --bg-primary: #211a12;
  --bg-secondary: #2a2218;
  --bg-card: #2f2619;
  --bg-hover: #3a2f20;
  --border-color: #453826;
  --border-strong: #574832;
  --text-primary: #ecdfc8;
  --text-secondary: #b5a184;
  --text-muted: #8a7a5e;
  --accent: #e0a94f;
  --accent-hover: #ecbc68;
  --accent-dim: rgba(224,169,79,.14);
  --gold: #e6c574;
  --gold-dim: rgba(230,197,116,.15);
  --red: #e8654c;
  --green: #88b558;
  --shadow: 0 6px 20px rgba(10,6,0,.45);
  --shadow-sm: 0 2px 8px rgba(10,6,0,.35);
  --nav-bg: #241d13;
  --nav-border: #3a2f20;
  --subnav-bg: #261f15;
  --nav-fg: #d9c9a9;
  --nav-fg-strong: #f7eedb;
  --grid-line: rgba(255,240,210,.04);
  --font-num: 'DIN Alternate', 'Bahnschrift', 'Segoe UI', ui-monospace, monospace;
  --bg-main: var(--bg-primary);
}
/* 米白暖色 */
[data-theme="cream"] {
  --bg-primary: #f3efe6;
  --bg-secondary: #fbf9f3;
  --bg-card: #fffdf8;
  --bg-hover: #efeadf;
  --border-color: #e2dccc;
  --border-strong: #cfc6ae;
  --text-primary: #2c2820;
  --text-secondary: #6b6353;
  --text-muted: #a39a85;
  --accent: #b07722;
  --accent-hover: #99671b;
  --accent-dim: rgba(176,119,34,.10);
  --gold: #a8801f;
  --gold-dim: rgba(168,128,31,.13);
  --red: #c9382f;
  --green: #2f7d4f;
  --shadow: 0 4px 14px rgba(60,50,30,.10);
  --shadow-sm: 0 2px 8px rgba(60,50,30,.06);
  --nav-bg: #3a3222;
  --nav-border: #4c422d;
  --subnav-bg: #fbf9f3;
  --nav-fg: #ddd4be;          /* cream：导航底是深棕，文字必须用浅米色（勿用页面深色正文变量） */
  --nav-fg-strong: #fdfaf1;
  --nav-hover-bg: rgba(255,255,255,.12);
  --grid-line: rgba(60,50,30,.05);
  --font-num: 'DIN Alternate', 'Bahnschrift', 'Segoe UI', ui-monospace, monospace;
  --bg-main: var(--bg-primary);
}

/* ---------------- 基础 ---------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.55;
  background-image:
    radial-gradient(1200px 400px at 80% -10%, var(--accent-dim), transparent 60%);
  background-size: auto;
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 数字统一等宽对齐（金融数据表标配） */
td, .num, .stat-value, .font-num { font-variant-numeric: tabular-nums; }

::selection { background: var(--accent-dim); color: var(--text-primary); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg-secondary); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---------------- 顶部导航（品牌行+工具行） ---------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.navbar::after {  /* 品牌金蓝渐变线 */
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--accent) 55%, transparent 90%);
  opacity: .85;
}
.navbar-top {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 20px;
  height: 54px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; cursor: pointer; }
.brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #8a6412);
  color: #10131a; font-weight: 800; font-size: 15px;
  letter-spacing: -1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16px; font-weight: 700; color: var(--nav-fg-strong, var(--text-primary)); letter-spacing: .5px; }
.brand-sub { font-size: 10px; color: var(--nav-fg, var(--text-muted)); letter-spacing: 1.2px; text-transform: uppercase; opacity: .92; }

.navbar-nav {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.navbar-nav > li { position: relative; list-style: none; }
.navbar-nav a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--nav-fg, var(--text-secondary));
  padding: 8px 13px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.navbar-nav a:hover { color: var(--nav-fg-strong, var(--text-primary)); background: var(--nav-hover-bg, var(--bg-hover)); }
.navbar-nav a.active {
  color: #fff;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #000 20%));
  box-shadow: 0 2px 10px var(--accent-dim);
}
.navbar-nav a.active:hover { color: #fff; }

.caret {
  width: 0; height: 0; display: inline-block;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .75;
  margin-top: 1px;
}

.nav-dropdown { position: relative; }
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(6px);
  min-width: 196px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s, transform .16s, visibility .16s;
  list-style: none;
  z-index: 501;
}
.dd-right { left: auto; right: 0; transform: translateX(0) translateY(6px); }
.nav-dropdown:hover .dd-right { transform: translateX(0) translateY(0); }
.dropdown-menu li { list-style: none; }
.dropdown-menu .dd-title {
  font-size: 11px; color: var(--gold); letter-spacing: 2px;
  padding: 8px 12px 4px; font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3px;
}
.dropdown-menu li > a {
  display: block;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13.5px;
  transition: all .12s;
}
.dropdown-menu li > a:hover { background: var(--accent-dim); color: var(--text-primary); padding-left: 16px; }
.dropdown-menu li > a.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

.navbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-tool { padding: 6px 10px !important; font-size: 15px !important; color: var(--nav-fg, var(--text-secondary)); border-radius: 7px; }
.nav-tool:hover { color: var(--nav-fg-strong, var(--text-primary)) !important; background: var(--nav-hover-bg, var(--bg-hover)); }
.theme-ico { font-size: 15px; line-height: 1; }
.nav-username { color: var(--nav-fg, var(--text-secondary)); font-size: 13px; }

.navbar-user { display: flex; align-items: center; gap: 10px; } /* 兼容旧类 */
.navbar-user .role-badge { display: inline-block; }

.role-badge {
  background: linear-gradient(135deg, var(--gold), #a67c17);
  color: #14171e !important;
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 5px;
  letter-spacing: 1px;
}

/* 二级工具行：面包屑 + 市场惯例说明 */
.subnavbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
  height: 30px;
  background: var(--subnav-bg);
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-secondary);
  box-sizing: border-box;
}
.breadcrumb { display: flex; align-items: center; gap: 7px; }
.bc-home { cursor: pointer; transition: color .12s; color: var(--text-secondary); }
.bc-home:hover { color: var(--accent); }
.bc-sep { opacity: .5; margin: 0 4px; }
.bc-cur { color: var(--text-primary); font-weight: 600; }
.market-note { display: flex; align-items: center; gap: 5px; }
.dot-up, .dot-down { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.dot-up { background: var(--red); }
.dot-down { background: var(--green); }

/* ---------------- 页面骨架 ---------------- */
.container {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  flex: 1;
}

.site-footer {
  text-align: center;
  padding: 14px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border-color);
  letter-spacing: .5px;
}

/* 页面主标题（各板块页 h2） */
h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  padding-left: 12px;
  position: relative;
  margin-bottom: 14px;
}
h2::before {
  content: '';
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card-header {
  padding: 11px 16px 11px 18px;
  font-weight: 600;
  font-size: 14px;
  background: linear-gradient(180deg, var(--bg-secondary), transparent);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}
.card-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent);
}
.card-body { padding: 14px 16px; }

/* ---------------- 统计卡 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.stat-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: .6;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ---------------- 表单 ---------------- */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.form-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-group label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: .5px;
  font-weight: 500;
}
input, select, button {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 7px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, button:hover { border-color: var(--border-strong); }
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.6) sepia(1) saturate(3) hue-rotate(180deg); cursor: pointer; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 7px;
  padding: 7px 16px;
  border: 1px solid transparent;
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 82%, #000 18%));
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-dim);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 14px var(--accent-dim); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--accent); background: var(--bg-hover); }
.btn-danger { background: linear-gradient(180deg, var(--red), color-mix(in srgb, var(--red) 82%, #000 18%)); color: #fff; }
.btn-danger:hover { filter: brightness(1.12); color: #fff; }
.btn-sm { padding: 4px 11px; font-size: 12.5px; border-radius: 6px; }

/* ---------------- 数据表格 ---------------- */
.table-wrapper {
  overflow: auto;
  max-height: 72vh;
  background: var(--bg-card);
  --col1-width: 72px;
  scrollbar-width: thin;
  border-top: 1px solid var(--border-color);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead { position: sticky; top: 84px; z-index: 20; }
th {
  position: sticky;
  top: 84px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
th:hover { color: var(--accent); }
td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
tbody tr { transition: background .1s; }
tbody tr:nth-child(even) { background: var(--grid-line); }
tbody tr:hover { background: var(--bg-hover); }

/* 前两列冻结（代码/名称，横向滚动常显） */
/* 2026-11-01 修复: .table-wrapper 是 overflow:auto 内滚容器, th 的 sticky 基准
   是 wrapper 而非视口, top:84px(为页面级滚动设计的导航偏移)导致表头吸附在
   wrapper 内 84px 处不贴顶、数据行从上方缝隙穿过; 内滚容器内表头必须贴顶 */
.table-wrapper thead th { top: 0; }
.table-wrapper thead { top: 0; }  /* thead 自身的 sticky 同样贴顶(嵌套sticky叠加偏移) */
.table-wrapper td:nth-child(1) {
  position: sticky; left: 0; z-index: 11;
  background: var(--bg-secondary); min-width: var(--col1-width); max-width: var(--col1-width);
  font-family: var(--font-num);
}
.table-wrapper thead th:nth-child(1) { z-index: 13; position: sticky; left: 0; }
.table-wrapper tbody td:nth-child(1) { background: var(--bg-card); }
.table-wrapper tbody tr:nth-child(even) td:nth-child(1) { background: var(--bg-secondary); }
.table-wrapper tbody tr:hover td:nth-child(1) { background: var(--bg-hover); }
.table-wrapper td:nth-child(2) {
  position: sticky; left: var(--col1-width); z-index: 11;
  background: var(--bg-secondary); min-width: 90px;
}
.table-wrapper thead th:nth-child(2) { z-index: 13; position: sticky; left: var(--col1-width); }
.table-wrapper tbody td:nth-child(2) { background: var(--bg-card); }
.table-wrapper tbody tr:nth-child(even) td:nth-child(2) { background: var(--bg-secondary); }
.table-wrapper tbody tr:hover td:nth-child(2) { background: var(--bg-hover); }

th.sort-asc::after { content: ' ↑'; color: var(--accent); font-weight: 700; }

/* ---------------- 长文本列换行(防溢出重叠) 2026-11-12 ----------------
   全局 td{white-space:nowrap} 下, 带max-width的长文本列(信号理由/买点参考/止损参考等)
   内容无法换行只能向右溢出, 与相邻列文字重叠。本类强制换行并顶对齐。 */
.cell-wrap { white-space: normal !important; word-break: break-word; overflow-wrap: anywhere; line-height: 1.5; vertical-align: top; }
th.sort-desc::after { content: ' ↓'; color: var(--accent); font-weight: 700; }
.sticky-head th { position: sticky; }

/* 顶部拖动条（宽表增强，各页自挂 #top-scrollbar） */
#top-scrollbar { overflow-x: auto; }
#top-scrollbar-inner { height: 1px; }

/* ---------------- 分页条 ---------------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  flex-wrap: wrap;
}
.pagination button {
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all .12s;
  font-family: var(--font-num);
}
.pagination button:hover { border-color: var(--accent); color: var(--accent); }
.pagination button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
.pagination .page-info { color: var(--text-muted); font-size: 12.5px; margin-left: 6px; }
.pagination .page-jump { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 12.5px; color: var(--text-muted); }
.pagination .page-jump-input { width: 54px; height: 28px; padding: 0 8px; text-align: center; }
.pagination .page-jump-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.pagination .page-ellipsis { color: var(--text-muted); padding: 0 2px; }
.pagination .btn[disabled] { opacity: .42; cursor: not-allowed; pointer-events: none; }

/* ---------------- 通知条 ---------------- */
.flash {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.flash-success { border-left: 3px solid var(--green); }
.flash-error   { border-left: 3px solid var(--red); }
.flash-warning { border-left: 3px solid var(--gold); }
.flash-info    { border-left: 3px solid var(--accent); }

/* ---------------- 登录页 ---------------- */
.login-container {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 36px 34px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
}
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 4px; letter-spacing: 1px; }
.login-box .subtitle { text-align: center; color: var(--text-muted); font-size: 12.5px; margin-bottom: 24px; letter-spacing: 1px; }
.login-box .form-group { margin-bottom: 16px; }
.login-box .form-group label { font-size: 12.5px; }
.login-box input { height: 42px; font-size: 14px; }
.login-box .btn { width: 100%; height: 42px; font-size: 15px; margin-top: 4px; }
.login-box .links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 12.5px; }

/* ---------------- 状态占位 ---------------- */
.loading, .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 12px;
  font-size: 13px;
  letter-spacing: 1px;
}
.loading::after {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  margin-left: 10px;
  vertical-align: -3px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 支付选项 ---------------- */
.pay-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.pay-option {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all .15s;
  background: var(--bg-card);
}
.pay-option:hover, .pay-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  transform: translateY(-2px);
}

/* ---------------- 图表 ---------------- */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  height: 360px;
}

/* ---------------- 资金流悬浮卡 ---------------- */
/* 2026-11-01 修复: fixed(视口定位)与 main.js _positionTip 的视口坐标算法匹配;
   此前改版误改为 absolute,页面滚动后悬浮卡定位到视口外不可见 */
#fund-flow-tooltip {
  position: fixed;
  z-index: 9999;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 4px 0;
  pointer-events: none;
}
#fund-flow-tooltip .fft-title {
  font-weight: 700;
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--border-color);
  color: var(--gold);
  font-size: 13.5px;
}
#fund-flow-tooltip .fft-row { display: flex; padding: 5px 14px; }
#fund-flow-tooltip .fft-row b { width: 120px; color: var(--text-secondary); font-weight: 400; }
#fund-flow-tooltip .fft-loading { padding: 18px 14px; text-align: center; color: var(--text-muted); }
.stock-link { font-weight: 600; text-decoration: none; }
.stock-link:hover { text-decoration: underline; }

/* ---------------- 金融术语悬浮 ---------------- */
.fin-term {
  border-bottom: 1px dotted var(--accent);
  cursor: help;
}
.fin-term:hover { color: var(--accent); }
.fin-term[data-term]:hover::after { content: attr(data-term); }
#fin-term-tip {
  position: fixed;
  z-index: 9998;
  max-width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.7;
  pointer-events: none;
}
#fin-term-tip .ftt-title { font-weight: 700; color: var(--accent); margin-bottom: 2px; }
#fin-term-tip .ftt-en { color: var(--text-muted); font-size: 11px; letter-spacing: .5px; margin-bottom: 6px; }

/* ---------------- 通用徽章 ---------------- */
.tag, .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  line-height: 1.7;
}
.sm-distort { color: var(--gold); font-size: 12px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .navbar-nav { gap: 0; }
  .navbar-nav > li > a { padding: 8px 9px; font-size: 13px; }
  .brand-sub { display: none; }
}
@media (max-width: 768px) {
  .navbar-top { padding: 0 12px; height: auto; flex-wrap: wrap; }
  .navbar-nav { display: none; }
  .subnavbar { padding: 0 12px; }
  .market-note { display: none; }
  .container { padding: 12px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  thead, th, .table-wrapper thead th { top: 0; }
}

/* ===================================================================
   v2.1 补遗（2026-10-31）：改版重写时从旧版漏掉的功能类
   来源：git HEAD 旧版 style.css + 模板/main.js 实际引用核对
   =================================================================== */
/* 红涨绿跌核心配色（所有主题的 --red/--green/--gold 变量均已定义） */
.num-red   { color: var(--red); }
.num-green { color: var(--green); }
.num-gold  { color: var(--gold); }

/* AI分析动态结果表：冻结首列（ai_analysis.html 动态渲染） */
.result-table td:nth-child(1)             { position: sticky; left: 0; z-index: 11; background: var(--bg-secondary); }
.result-table thead th:nth-child(1)       { z-index: 13; }
.result-table tbody td:nth-child(1)       { background: var(--bg-card); }
.result-table tbody tr:hover td:nth-child(1) { background: var(--bg-hover); }

/* 下拉触发器（导航分组菜单/主题切换器均使用） */
.dropdown-toggle { cursor: pointer; }

/* 支付方式卡片（payment.html） */
.pay-card .icon { font-size: 22px; line-height: 1.2; }
.pay-card .name { font-weight: 600; }
.pay-card .desc { color: var(--text-muted); font-size: 12px; }

/* 悬浮资金流窗内部表格/K线/汇总（main.js 动态生成） */
#fund-flow-tooltip .fft-table    { width: 100%; border-collapse: collapse; margin-top: 4px; }
#fund-flow-tooltip .fft-table th { text-align: right; padding: 2px 6px; color: var(--text-muted); font-weight: 400; }
#fund-flow-tooltip .fft-table td { text-align: right; padding: 2px 6px; }
#fund-flow-tooltip .fft-summary  { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-color); line-height: 1.8; }
#fund-flow-tooltip .fft-kline    { display: block; margin: 4px 0 6px; border-radius: 4px; }
