/* ============================================================
   app.css — App 壳与新组件（iOS 风格）
   登录页 / 底部 TabBar / 行情页 / 泡泡弹窗 / 我的与管理
   含响应式（手机 ≤820px）与浅色主题适配
   ============================================================ */

/* ==================== 登录页 ==================== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrap {
  width: 100%;
  max-width: 420px;
  padding: var(--space-5);
  position: relative;
  z-index: 1;
}
.login-card {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--blur-xl)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--blur-xl)) saturate(var(--glass-saturate));
  box-shadow: var(--glass-shadow);
  padding: 36px 32px 24px;
  animation: modalIn 0.5s var(--spring);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.login-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.login-field { margin-bottom: var(--space-4); }
.login-remember {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-secondary); margin: -6px 2px 14px; cursor: pointer;
}
.login-remember input { accent-color: var(--primary); }
.login-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 16px;
  transition: all 0.3s var(--ease-out);
}
.login-field input:focus {
  outline: none;
  border-color: rgba(124, 127, 242, 0.6);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(124, 127, 242, 0.2);
}
[data-theme="light"] .login-field input {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 2px 6px rgba(30, 41, 72, 0.08);
  border-color: var(--border-strong);
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 6px;
}
.login-btn { width: 100%; }
.login-foot {
  margin-top: var(--space-5);
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* ==================== 顶部导航补充（泡泡入口 / 用户头像） ==================== */
.bubble-launch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(16, 185, 129, 0.85));
  color: white;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--spring);
  box-shadow: 0 4px 14px rgba(124, 127, 242, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.bubble-launch:hover { transform: scale(1.12) rotate(-8deg); }

.user-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  cursor: pointer;
  transition: all 0.3s var(--spring);
}
.user-chip:hover { transform: scale(1.08); border-color: var(--primary); }
.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--grad-primary);
  color: white;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-ico { margin-right: 6px; font-size: 13px; }

/* 结构性图标统一为内联 SVG（跟随 currentColor / 字号） */
.tab-ico svg, .bar-ico svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }
.card-icon svg { width: 18px; height: 18px; }
.bubble-launch svg, .theme-toggle svg { width: 17px; height: 17px; }
.admin-launch {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--card-border);
  background: var(--bg-inset, rgba(255,255,255,.05)); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: color .18s ease, border-color .18s ease, transform .18s ease;
}
.admin-launch:hover { color: var(--primary); border-color: var(--primary); transform: scale(1.06); }
.admin-launch svg { width: 16px; height: 16px; }
.btn svg, .subtab svg { width: 15px; height: 15px; vertical-align: -0.2em; }

/* 品牌名移除后，副标题作为主导航文字 */
.brand > .brand-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0;
  letter-spacing: 0.02em;
}

/* ==================== 子分段控件（分析 Tab 内） ==================== */
.subtabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: var(--space-5);
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
}
[data-theme="light"] .subtabs {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 2px 8px rgba(30, 41, 72, 0.08);
}
.subtab {
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.35s var(--spring);
}
.subtab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.subtab.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  color: white;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
[data-theme="light"] .subtab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(30, 41, 72, 0.14);
}
.subtab-content { display: none; }
.subtab-content.active { display: block; animation: tabRise 0.4s var(--ease-out); }

/* ==================== 行情页 ==================== */
.quotes-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-2) 0 var(--space-5);
}
.quotes-greeting {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.quotes-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.quotes-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* 指数卡片 */
.quote-indices { margin-bottom: var(--space-4); }
.idx-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.idx-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
  transition: transform 0.3s var(--spring), border-color 0.3s;
}
.idx-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.idx-card.up { border-left: 3px solid var(--up); }
.idx-card.down { border-left: 3px solid var(--down); }
.idx-card.flat { border-left: 3px solid var(--text-dim); }
.idx-name { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.idx-price {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.idx-meta {
  display: flex;
  gap: 8px;
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: 600;
}
.idx-price.up, .idx-meta.up { color: var(--up); }
.idx-price.down, .idx-meta.down { color: var(--down); }
.idx-price.flat, .idx-meta.flat { color: var(--text-secondary); }

/* 涨跌家数 */
.quote-activity {
  padding: 16px var(--space-5);
  margin-bottom: var(--space-4);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
}
.act-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.act-title { font-size: 13px; font-weight: 700; color: var(--text); }
.act-sub { font-size: 12px; color: var(--text-secondary); }
.act-sub b { font-weight: 700; }
.t-up { color: var(--up-strong); }
.t-down { color: var(--down-strong); }
.act-bar {
  display: flex;
  height: 16px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border);
}
.act-seg { transition: width 0.6s var(--ease-out); }
.act-seg.up { background: linear-gradient(90deg, #EF4444, #F87171); }
.act-seg.flat { background: rgba(120, 130, 155, 0.45); }
.act-seg.down { background: linear-gradient(90deg, #10B981, #34D399); }
.act-scale {
  display: flex;
  justify-content: space-between;
  font-family: "SF Mono", monospace;
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* 板块网格（2 列，参考行情 App） */
.quote-boards {
  padding: 16px var(--space-5);
  margin-bottom: var(--space-4);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--glass-saturate));
}
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.board-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.board-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--cell-bg);
  border: 1px solid var(--border);
  cursor: default;
  transition: transform 0.25s var(--spring), border-color 0.25s;
  min-width: 0;
}
.board-cell:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.board-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.board-rank {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.board-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-right { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.board-pct {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.board-pct.up { color: var(--up); }
.board-pct.down { color: var(--down); }
.board-pct.flat { color: var(--text-secondary); }
.board-leader {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  margin-top: 1px;
}
.board-cell.up { border-left: 3px solid var(--up); }
.board-cell.down { border-left: 3px solid var(--down); }
.board-cell.flat { border-left: 3px solid var(--text-dim); }

/* ==================== 移动端底部 TabBar ==================== */
.bottom-tabbar { display: none; }

/* ==================== 泡泡图弹窗 ==================== */
.bubble-backdrop { z-index: 1100; }
/* 响应式大弹窗：小屏跟随视口，大屏铺到 96vw × 92vh（上限 1760×1080） */
.bubble-modal {
  width: min(96vw, 1760px);
  max-width: min(96vw, 1760px);
  height: min(92vh, 1080px);
  max-height: min(92vh, 1080px);
}
.bubble-modal-header {
  background:
    radial-gradient(600px 120px at 20% 0%, rgba(239, 68, 68, 0.18), transparent 70%),
    radial-gradient(600px 120px at 80% 0%, rgba(16, 185, 129, 0.14), transparent 70%),
    linear-gradient(135deg, rgba(124, 127, 242, 0.14), rgba(34, 211, 238, 0.06));
}
.bubble-modal-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.bubble-date { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; }
.bubble-title-text { color: var(--text); }
.bubble-time {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
}
.bubble-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px var(--space-5) var(--space-4);
  min-height: 0;
  overflow: hidden;
}
.bubble-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.bubble-subtabs { margin-bottom: 0; }
.bubble-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-secondary);
}
.bubble-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.bubble-legend .dot.red {
  background: radial-gradient(circle at 32% 28%, #FCA5A5, #DC2626);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}
.bubble-legend .dot.green {
  background: radial-gradient(circle at 32% 28%, #6EE7B7, #059669);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.bubble-canvas {
  --bub-f: 1;   /* 泡泡文字缩放系数（JS 按画布大小写入） */
  position: relative;
  flex: 1;
  min-height: 380px;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(239, 68, 68, 0.10), transparent 70%),
    radial-gradient(60% 45% at 50% 100%, rgba(16, 185, 129, 0.10), transparent 70%),
    rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .bubble-canvas {
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(239, 68, 68, 0.08), transparent 70%),
    radial-gradient(60% 45% at 50% 100%, rgba(16, 185, 129, 0.08), transparent 70%),
    rgba(255, 255, 255, 0.5);
}

.bubble-half { position: absolute; left: 0; right: 0; }
.bubble-half-in { top: 0; height: calc(50% - 12px); }
.bubble-half-out { bottom: 0; height: calc(50% - 12px); }

.bubble-divider {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    transparent 0%, var(--sep-a, rgba(255, 255, 255, 0.16)) 15%,
    var(--sep-b, rgba(255, 255, 255, 0.3)) 50%,
    var(--sep-a, rgba(255, 255, 255, 0.16)) 85%, transparent 100%);
}
[data-theme="light"] .bubble-divider {
  --sep-a: rgba(30, 41, 72, 0.14);
  --sep-b: rgba(30, 41, 72, 0.26);
}
.bubble-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg-soft);
  padding: 3px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.bubble-half-tag {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(var(--blur-xs)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--blur-xs)) saturate(var(--glass-saturate));
}
.bubble-half-tag.in { top: 10px; left: 12px; color: #F87171; }
.bubble-half-tag.out { bottom: 10px; right: 12px; color: #34D399; }

/* 泡泡本体：3D 球体质感（左上高光 / 半透明 / 辉光） */
.bub {
  position: absolute;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* 纯白 (#fff) 压在鲜亮底色上会眩光，降一点亮度 + 靠深色描影保对比 */
  color: rgba(255, 255, 255, 0.92);
  cursor: default;
  line-height: 1.15;
  user-select: none;
  overflow: hidden;
  /* 浮动走 translate（合成器加速，不触发重排版）；入场缩放走 transform，两者互不覆盖 */
  will-change: translate, transform;
}
.bub::before {
  /* 左上镜面高光（压暗些，避免和文字抢眼） */
  content: "";
  position: absolute;
  top: 6%;
  left: 12%;
  width: 34%;
  height: 21%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.38), transparent 70%);
  filter: blur(1px);
  pointer-events: none;
}
.bub-in {
  background: radial-gradient(circle at 32% 28%,
    rgba(254, 202, 202, 0.96) 0%,
    rgba(239, 68, 68, 0.88) 42%,
    rgba(185, 28, 28, 0.62) 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 6px 20px rgba(239, 68, 68, 0.35),
    inset 0 -8px 16px rgba(120, 10, 10, 0.3),
    inset 0 2px 6px rgba(255, 255, 255, 0.25);
}
.bub-out {
  background: radial-gradient(circle at 32% 28%,
    rgba(167, 243, 208, 0.96) 0%,
    rgba(16, 185, 129, 0.88) 42%,
    rgba(5, 120, 87, 0.62) 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 6px 20px rgba(16, 185, 129, 0.32),
    inset 0 -8px 16px rgba(4, 90, 66, 0.3),
    inset 0 2px 6px rgba(255, 255, 255, 0.25);
}
.bub-name {
  font-weight: 600;
  padding: 0 3px;
  max-width: 94%;
  line-height: 1.12;
  /* 小泡泡装不下单行 4 字名 → 允许两行（2×2），不再截断 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  word-break: break-all;
  font-size: 12px;   /* 实际字号由 JS 按泡泡半径内联写入 */
  /* 深色贴身描影替代提亮文字：对比靠底影，不靠字的亮度 */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 3px rgba(0, 0, 0, 0.25);
}
.bub-amt {
  font-family: "SF Mono", "Consolas", monospace;
  font-weight: 600;
  margin-top: 1px;
  font-size: 13px;
  white-space: nowrap;          /* 金额永不折行（"+15.3/亿"分家很难读） */
  letter-spacing: -0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 3px rgba(0, 0, 0, 0.25);
}

/* 弹窗打开时暂停背景光斑漂移（模糊大层持续重绘会掉帧） */
body.bubble-live .bg-orbs .orb { animation-play-state: paused; }

@keyframes bubblePop {
  0%   { opacity: 0; }
  0.01% { transform: scale(0.2); }
  70%  { transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
/* 浮动用独立 translate 属性（GPU 合成，不逐帧重排版——margin-top 会卡） */
@keyframes bubbleFloat {
  from { translate: 0 0; }
  to   { translate: 0 -9px; }
}
@media (prefers-reduced-motion: reduce) {
  .bub { animation: none !important; }
}

.bubble-none {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-dim);
  font-size: 12px;
}
.bubble-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--text-secondary);
  font-size: 14px;
}
.bubble-empty .warn-icon { font-size: 22px; }
.bubble-warn-chip {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--accent-warn);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  z-index: 5;
}
.bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-dim);
}
.bubble-footer .flow-source { font-style: italic; }

/* 窄屏：工具栏纵排，图例不再被截断 */
@media (max-width: 640px) {
  .bubble-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .bubble-modal-body { padding: 12px var(--space-4) var(--space-3); }
}

/* ==================== 我的 / 管理 ==================== */
.col-md-12 { /* 桌面 span-6，≤1024 展开为整行 */ }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-4);
}
.p-lbl {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.p-val { font-size: 15px; font-weight: 600; color: var(--text); }
.p-dim { color: var(--text-dim); font-weight: 400; font-size: 12px; }

.role-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
  vertical-align: middle;
}
.role-tag.admin { background: var(--grad-gold); color: #1F1300; }
.role-tag.user { background: var(--info-soft); color: var(--info); }

.pref-rows { display: flex; flex-direction: column; }
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.pref-row:last-child { border-bottom: none; }

.user-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.user-row:last-of-type { border-bottom: none; }
.user-name { font-size: 14px; font-weight: 700; color: var(--text); }
.user-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.user-main { margin-bottom: 10px; }
.user-ops {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.perm-box { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--cell-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.perm-check:hover { border-color: var(--primary); }
.perm-check input { accent-color: var(--primary); margin: 0; }
.op-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.role-sel {
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--cell-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.en-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
  vertical-align: middle;
}
.en-tag.on { background: var(--success-soft); color: var(--success); }
.en-tag.off { background: var(--danger-soft); color: var(--danger); }
.user-new { padding-top: var(--space-4); border-top: 1px dashed var(--border-strong); }
.user-new-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.btn.danger { background: var(--grad-danger); }
.log-ua {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-dim);
  font-size: 11px;
}
.log-table td { font-size: 12px; }

/* ==================== 响应式（手机 ≤820px：底部 TabBar + 单列） ==================== */
@media (max-width: 1024px) {
  .col-md-12 { grid-column: span 12 !important; }
}

@media (max-width: 820px) {
  .bottom-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(160deg, rgba(20, 24, 44, 0.82), rgba(12, 16, 32, 0.88));
    backdrop-filter: blur(var(--blur-xl)) saturate(var(--glass-saturate));
    -webkit-backdrop-filter: blur(var(--blur-xl)) saturate(var(--glass-saturate));
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
    justify-content: space-around;
  }
  [data-theme="light"] .bottom-tabbar {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), rgba(244, 246, 252, 0.94));
    box-shadow: 0 -12px 40px rgba(30, 41, 72, 0.14);
  }
  .bar-item {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s var(--spring);
    -webkit-tap-highlight-color: transparent;
  }
  .bar-item .bar-ico { font-size: 22px; line-height: 1; transition: transform 0.35s var(--spring); }
  .bar-item .bar-lbl { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
  .bar-item.active { color: var(--text); }
  .bar-item.active .bar-ico { transform: translateY(-3px) scale(1.18); }
  .bar-item.active .bar-lbl { color: var(--primary-light); }

  #top-tabs { display: none; }
  body:not(.admin-body) { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .app { padding: 0 var(--space-3); }
  .top-nav { top: 6px; padding: 0 var(--space-2); }
  .brand-sub, .freshness { display: none; }
  .clock { padding: 6px 12px; }
  .clock-time { font-size: 13px; }
  .help-panel { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); right: 16px; }
  .help-btn { width: 44px; height: 44px; }

  /* 指数卡横向滑动 */
  .idx-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .idx-card { min-width: 138px; scroll-snap-align: start; }

  /* 弹窗 → 底部抽屉 */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 26px 26px 0 0;
    animation: sheetIn 0.45s var(--spring);
  }
  @keyframes sheetIn {
    from { opacity: 0.4; transform: translateY(60%); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .bubble-modal { height: 94vh; }
  .bubble-canvas { min-height: 320px; }
  .quotes-head { padding-top: var(--space-1); }
  .quotes-actions { width: 100%; }
  .quotes-actions .btn { flex: 1; }
  .board-grid { gap: 8px; }
  .board-name { font-size: 13px; }
}

/* ==================== 浅色主题修复（新组件 + 存量组件） ==================== */
:root {
  --cell-bg: rgba(255, 255, 255, 0.04);
}
[data-theme="light"] {
  --cell-bg: rgba(255, 255, 255, 0.72);
}

/* 存量组件浅色下文字/底色修正 */
[data-theme="light"] .clock { background: rgba(15, 23, 42, 0.04); }
[data-theme="light"] .dist-cell {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .dist-bar-track { background: rgba(30, 41, 72, 0.1); }
[data-theme="light"] .pool-table thead th,
[data-theme="light"] .sector-table thead th { background: rgba(30, 41, 72, 0.04); }
[data-theme="light"] .pool-table tbody tr:hover,
[data-theme="light"] .sector-table tbody tr:hover { background: rgba(124, 127, 242, 0.07); }
[data-theme="light"] .ladder-stock { background: rgba(255, 255, 255, 0.6); }
[data-theme="light"] .ladder-stock.stage-1 { color: #047857; }
[data-theme="light"] .ladder-stock.stage-2 { color: #065F46; }
[data-theme="light"] .ladder-stock.stage-3 { color: #1D4ED8; }
[data-theme="light"] .ladder-stock.stage-4 { color: #92400E; }
[data-theme="light"] .ladder-stock[class*="stage-"] .code { color: rgba(30, 41, 72, 0.65); }
[data-theme="light"] .pullback-banner { color: #065F46; }
[data-theme="light"] .pullback-banner .count { color: #047857; }
[data-theme="light"] .market-pulse { background: linear-gradient(135deg, rgba(124, 127, 242, 0.1), rgba(34, 211, 238, 0.06)); }
[data-theme="light"] .sentiment-strip { background: linear-gradient(135deg, rgba(124, 127, 242, 0.12), rgba(34, 211, 238, 0.07)); }
[data-theme="light"] .pullback-banner { background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.03)); }
[data-theme="light"] .breaking-card { background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(124, 127, 242, 0.05)); }

/* ==================== 趋势监控池指标筛选条（2026-09-15） ==================== */
.tf-select {
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.tf-select:focus { outline: none; border-color: rgba(124, 127, 242, 0.6); }
[data-theme="light"] .tf-select {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--border-strong);
}

/* 不支持 backdrop-filter 的降级（续 base.css）：本文件内定义的玻璃组件在此补齐。
   放文件末尾以保证在同特异性竞争中胜出（nav-shell 需两段选择器提权）。 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .subtabs,
  .login-card,
  .bottom-tabbar { background: var(--bg-soft); }
  .top-nav .nav-shell { background: var(--bg-soft); }
}

/* ==================== 定时扫描卡片（2026-09-17，进程内调度器） ==================== */
.sched-row { align-items: center; flex-wrap: wrap; gap: 10px; }
.sched-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex: none;
  height: 34px;               /* 与 .btn 同高，行内对齐 */
}
.sched-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sched-slider {
  width: 42px; height: 22px; border-radius: 11px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  position: relative;
  transition: background .25s, border-color .25s;
  flex: none;
}
.sched-slider::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-secondary);
  transition: transform .25s, background .25s;
}
.sched-switch input:checked + .sched-slider {
  background: linear-gradient(90deg, #22D3EE, #7C7FF2);
  border-color: transparent;
}
.sched-switch input:checked + .sched-slider::after {
  transform: translateX(19px);
  background: #fff;
}
.sched-switch input:focus-visible + .sched-slider { border-color: var(--accent); }
.sched-time {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color-scheme: dark;         /* 时间选择器图标随暗色主题 */
  flex: none;
}
.sched-time:focus { outline: none; border-color: rgba(124, 127, 242, 0.6); }
.sched-status {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 6px 8px;
  font-size: 12px; line-height: 1.6;
}
.sched-pill {
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.sched-pill.ok { color: #34D399; border-color: rgba(52, 211, 153, 0.35); }
.sched-pill.bad { color: #F87171; border-color: rgba(248, 113, 113, 0.35); }
.sched-pill.run { color: var(--accent-light); border-color: rgba(34, 211, 238, 0.4); }
[data-theme="light"] .sched-slider { background: rgba(15, 23, 42, 0.12); }
[data-theme="light"] .sched-time { background: rgba(255, 255, 255, 0.8); color-scheme: light; }
[data-theme="light"] .sched-pill { background: rgba(15, 23, 42, 0.05); }
[data-theme="light"] .sched-pill.ok { color: #059669; }
[data-theme="light"] .sched-pill.bad { color: #DC2626; }
@media (max-width: 640px) {
  .sched-row .input-group { min-width: 100%; }   /* 说明文字整行，控件换行排开 */
  .sched-time { flex: 1 1 110px; }
}
