:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0f;
  --bg2: #1a1a1a;
  --bg3: #242424;
  --border: #333;
  --text: #e8e6e3;
  --muted: #787776;
  --text-secondary: #c8c8c8;
  --text-dim: #999;
  --accent: #52419f;
  --accent2: #6b5bb5;
  --link-hover: #c4b5fd;
  --green: #10cc55;
  --red: #ff2323;
  --hover-bg: #2a2a2a;
  --sticky-bg: #1a1a1a;
  --shadow: rgba(0, 0, 0, 0.4);
  --row-hover: rgba(82, 65, 159, 0.12);
  --row-highlight: #2a2218;
  --surface-overlay: rgba(255, 255, 255, 0.05);
  --panel-head-bg: rgba(0, 0, 0, 0.18);
  --panel-head-border: rgba(255, 255, 255, 0.05);
  --on-accent: #fff;
  --env-code-a: #ffffff;
  --switch-bg: #3a3a3a;
  --switch-knob: #888;
  --table-head-bg: #3d3d3d;
  --table-head-hover: #4a4a4a;
  --table-head-text: #c8c8c8;
  --table-row-bg: #141414;
  --table-row-alt: #1f1915;
  --table-row-border: #2a2520;
  --header-h: 56px;
  --header-main-h: 56px;
  --announcement-h: 0px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --bg2: #ffffff;
  --bg3: #eef1f5;
  --border: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --text-secondary: #374151;
  --text-dim: #6b7280;
  --accent: #52419f;
  --accent2: #6b5bb5;
  --link-hover: #4338ca;
  --green: #059669;
  --red: #dc2626;
  --hover-bg: #e5e7eb;
  --sticky-bg: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
  --row-hover: rgba(82, 65, 159, 0.08);
  --row-highlight: rgba(82, 65, 159, 0.1);
  --surface-overlay: rgba(0, 0, 0, 0.04);
  --panel-head-bg: rgba(0, 0, 0, 0.04);
  --panel-head-border: rgba(0, 0, 0, 0.08);
  --on-accent: #fff;
  --env-code-a: #111827;
  --switch-bg: #d1d5db;
  --switch-knob: #ffffff;
  --table-head-bg: #e5e7eb;
  --table-head-hover: #d1d5db;
  --table-head-text: #374151;
  --table-row-bg: #ffffff;
  --table-row-alt: #f9fafb;
  --table-row-border: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  width: 100%;
  height: 100%;
}

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  background: #0f0f0f;
  background: var(--bg);
  color: #e8e6e3;
  color: var(--text);
}

.header {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
  flex-direction: column;
  -ms-flex-align: stretch;
  align-items: stretch;
  width: 100%;
  gap: 0;
  padding: 0;
  height: auto;
  min-height: var(--header-main-h, 56px);
  background: #1a1a1a;
  background: var(--bg2);
  border-bottom: 1px solid #333;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-width: 0;
}

.header-main {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: justify;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  height: var(--header-main-h, 56px);
  min-width: 0;
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.header-controls label { font-size: 13px; color: var(--muted); }

.site-announcement {
  width: 100%;
  height: 32px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 196, 80, 0.35);
  background: linear-gradient(90deg, #3a2a12 0%, #4a3518 50%, #3a2a12 100%);
  color: #ffe8a8;
  overflow: hidden;
  position: relative;
  z-index: 101;
}
.site-announcement.hidden { display: none !important; }
.site-announcement-viewport {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.site-announcement.is-static .site-announcement-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-announcement-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
  animation: none;
}
.site-announcement.is-scroll .site-announcement-track {
  animation-name: site-announcement-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.site-announcement-text {
  display: inline-block;
  padding: 0 64px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 32px;
  color: inherit;
}
.site-announcement.is-static .site-announcement-text {
  padding: 0 16px;
}
.site-announcement.is-static .site-announcement-text.is-dup {
  display: none;
}
@keyframes site-announcement-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .site-announcement.is-scroll .site-announcement-track { animation: none; }
}

[data-theme="light"] .site-announcement {
  background: linear-gradient(90deg, #fff4d6 0%, #ffe9b0 50%, #fff4d6 100%);
  color: #7a4b00;
  border-top-color: rgba(180, 120, 20, 0.35);
}

.user-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 32px;
  font-size: 13px;
}

.user-menu-toggle {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  margin: 0;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  height: 32px;
  line-height: 1;
  white-space: nowrap;
}

.user-menu-toggle:hover,
.user-menu-toggle[aria-expanded="true"] {
  color: var(--link-hover);
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 10px 0 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 120;
}

/* 填补按钮与菜单之间空隙，避免悬停移入时闪断 */
.user-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.user-menu-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.user-bar-name { font-weight: 600; color: var(--text); }
.user-bar-status { color: var(--muted); font-size: 12px; }

.device-session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.device-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
}

.device-session-meta {
  min-width: 0;
  flex: 1;
}

.device-session-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.device-session-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.device-session-current {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--accent2);
}

.device-kick-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 12px;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  box-sizing: border-box;
  text-decoration: none;
}

.user-menu-item:hover {
  background: var(--hover-bg);
}

.btn-link {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.btn-link:hover { text-decoration: underline; }

.user-menu .btn-link,
.user-menu .user-menu-item {
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.user-menu .btn-link:hover,
.user-menu .user-menu-item:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.qq-group-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 196px;
  width: 268px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 14px;
  box-shadow: none;
  z-index: 130;
}

.qq-group-popover.hidden { display: none; }

.qq-group-popover-inner,
.qq-group-panel .modal-body {
  text-align: center;
}

.qq-group-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #242038 0%, var(--bg2) 38%, var(--bg2) 100%);
  border: 1px solid #3d3560;
  box-shadow: 0 12px 32px var(--shadow);
}

.qq-group-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.qq-group-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #b7a8ef;
  background: rgba(82, 65, 159, 0.28);
  border: 1px solid rgba(107, 91, 181, 0.45);
}

.qq-group-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: 0.02em;
}

.qq-group-no-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.qq-group-no-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.qq-group-no-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 220px;
  border: 1px solid #4a4170;
  background: rgba(82, 65, 159, 0.16);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.qq-group-no-btn:hover {
  border-color: var(--accent2);
  background: rgba(82, 65, 159, 0.28);
  transform: translateY(-1px);
}

.qq-group-no-btn:active {
  transform: translateY(0);
}

.qq-group-no-btn.is-copied {
  border-color: #5d9b6c;
  background: rgba(61, 140, 84, 0.18);
}

.qq-group-no-value {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #c4b6f5;
  font-variant-numeric: tabular-nums;
}

.qq-group-no-action {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #efeaff;
  background: rgba(107, 91, 181, 0.35);
  border: 1px solid rgba(183, 168, 239, 0.35);
  border-radius: 6px;
  padding: 2px 7px;
}

.qq-group-no-btn.is-copied .qq-group-no-action {
  background: rgba(61, 140, 84, 0.4);
  border-color: rgba(120, 190, 140, 0.45);
}

.qq-group-qr-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.qq-group-qr-frame {
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(145deg, #8b7cd6 0%, #5a4aad 55%, #3d7ec9 100%);
  box-shadow: 0 8px 20px rgba(82, 65, 159, 0.35);
}

.qq-group-qr {
  display: block;
  width: 168px;
  height: 168px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}

.qq-group-popover .qq-group-qr {
  width: 152px;
  height: 152px;
}

.qq-group-tip {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.qq-group-panel.auth-modal-panel {
  max-width: 360px;
}

.qq-group-panel .modal-header {
  justify-content: center;
  position: relative;
  border-bottom: 1px solid #34304a;
  background: #1f1c2c;
}

.qq-group-panel .modal-header h2 {
  text-align: center;
}

.qq-group-panel .modal-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.qq-group-panel .modal-body {
  padding: 16px 18px 20px;
}

.qq-group-panel .qq-group-card {
  box-shadow: none;
}

[data-theme="light"] .qq-group-card {
  background: linear-gradient(180deg, #f3f0fb 0%, var(--bg2) 42%, var(--bg2) 100%);
  border-color: #d5ceea;
}

[data-theme="light"] .qq-group-badge {
  color: var(--accent);
  background: rgba(82, 65, 159, 0.1);
  border-color: rgba(82, 65, 159, 0.22);
}

[data-theme="light"] .qq-group-no-btn {
  border-color: #cfc6e8;
  background: rgba(82, 65, 159, 0.06);
}

[data-theme="light"] .qq-group-no-btn:hover {
  background: rgba(82, 65, 159, 0.12);
}

[data-theme="light"] .qq-group-no-value {
  color: var(--accent);
}

[data-theme="light"] .qq-group-no-action {
  color: #fff;
  background: var(--accent2);
  border-color: transparent;
}

[data-theme="light"] .qq-group-panel .modal-header {
  background: #f7f5fc;
  border-bottom-color: #e4dff2;
}

.admin-contact-qr-preview {
  margin: 8px 0 4px;
  min-height: 40px;
}

.admin-contact-qr-img {
  max-width: 220px;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.tab.hidden { display: none; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.auth-gate.hidden { display: none; }

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.cst-page {
  max-width: 720px;
  margin: 12px auto 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}

.cst-promo-inner { max-width: 640px; }

.cst-title {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
}

.cst-subtitle {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.cst-platform {
  margin: 0 0 16px;
  color: #e8b84a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.cst-features {
  margin: 0 0 16px;
  padding-left: 1.15em;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.cst-features li { margin: 0 0 6px; }

.cst-tips {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(82, 65, 159, 0.12);
  border: 1px solid rgba(82, 65, 159, 0.28);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.cst-tips p { margin: 0 0 6px; }
.cst-tips p:last-child { margin-bottom: 0; }

.cst-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cst-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 140px;
}

.cst-download-btn.hidden { display: none; }

.cst-download-hint {
  font-size: 12px;
  color: var(--muted);
}

.cst-version {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-disclaimer {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}

.auth-form label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.auth-form label input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.auth-submit { width: 100%; margin-top: 8px; }

.auth-switch {
  text-align: center;
  margin-top: 16px;
}

.auth-captcha-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-captcha-label {
  flex: 1;
  margin-bottom: 0 !important;
}

.auth-captcha-img-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  background: #f3f4f6;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
}

.auth-captcha-img-wrap:hover { opacity: 0.9; }

.auth-captcha-img {
  display: block;
  width: 120px;
  height: 40px;
  overflow: hidden;
  background: #e8eaed;
}

.auth-captcha-img img,
.auth-captcha-img svg {
  display: block;
  width: 120px;
  height: 40px;
}

.cell-masked {
  color: var(--muted);
  letter-spacing: 1px;
  user-select: none;
}

.auth-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
  white-space: pre-line;
}

.auth-error.hidden { display: none; }

.auth-success {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
  white-space: pre-line;
}

.auth-success.hidden { display: none; }

.global-toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%) translateY(-120%);
  z-index: 10000;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 10px;
  background: #166534;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  white-space: pre-line;
  text-align: center;
}

.global-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.global-toast.is-warning {
  background: #be123c;
  box-shadow: 0 10px 30px rgba(190, 18, 60, 0.35);
}

.pz-warning-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(92vw, 360px);
  pointer-events: none;
}

.pz-warning-toast-item {
  pointer-events: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #fecdd3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  color: #111;
  font-size: 13px;
  line-height: 1.4;
  animation: pzWarnIn 0.2s ease;
}

.pz-warning-toast-item strong {
  display: block;
  color: #be123c;
  margin-bottom: 2px;
}

.pz-warning-toast-item button {
  margin-top: 6px;
  border: 0;
  background: #be123c;
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

@keyframes pzWarnIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.auth-field {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
}

.auth-modal-panel { max-width: 420px; }
.modal-body { padding: 16px 20px 20px; }

.admin-modal-panel {
  max-width: 920px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.admin-page-body {
  min-height: 100vh;
  background: var(--bg);
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-page-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.admin-page-user {
  font-size: 13px;
  color: var(--muted);
}

.admin-page-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-page-main {
  width: 100%;
  max-width: min(1680px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 20px 48px;
}

.admin-page-body-inner {
  padding: 20px 0 0;
  overflow: visible;
}

.admin-table-wrap-page {
  max-height: none;
}

.admin-gate {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-gate.hidden { display: none; }

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  border: none;
  background: none;
  color: var(--muted);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.admin-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1;
}

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-panel h3 {
  font-size: 14px;
  margin: 16px 0 8px;
  color: var(--text);
}

.admin-panel h3:first-child { margin-top: 0; }

.admin-panel h4 {
  font-size: 13px;
  margin: 12px 0 6px;
  color: var(--text);
  font-weight: 600;
}

.admin-ziwei-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  margin-bottom: 10px;
}

.admin-ziwei-block {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.admin-ziwei-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-ziwei-group-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.admin-mode-editor {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-mode-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  border-radius: 3px;
  color: #c4b5fd;
  border: 1px solid rgba(196, 181, 253, 0.45);
}

.admin-mode-filter-cell {
  min-width: 180px;
  max-width: 360px;
}

.admin-mode-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.admin-mode-filter-chip {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.admin-mode-filter-stack {
  font-size: 11px;
  color: var(--muted);
  margin-left: 2px;
}

.admin-mode-filter-empty {
  font-size: 12px;
  color: var(--muted);
}

.admin-modes-toolbar {
  align-items: center;
}

.admin-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.admin-check-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.admin-gen-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.admin-gen-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.admin-gen-result {
  font-size: 13px;
  margin-bottom: 12px;
  word-break: break-all;
}

.admin-card-export {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg3);
}

.admin-card-export.hidden { display: none; }

.admin-card-export-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.admin-card-export-text {
  width: 100%;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  resize: vertical;
}

.admin-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  font-size: 13px;
  color: var(--text);
}

.admin-card-stats-plans {
  color: var(--muted);
  font-size: 12px;
}

.admin-card-batch {
  margin-top: 4px;
}

.admin-card-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.card-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.card-status-unused {
  background: color-mix(in srgb, #4caf78 22%, transparent);
  color: #7dcea0;
}

.card-status-used {
  background: color-mix(in srgb, #5b8def 22%, transparent);
  color: #8bb4ff;
}

.card-status-void {
  background: color-mix(in srgb, #f07178 18%, transparent);
  color: #f07178;
}

.admin-table-wrap { max-height: 420px; overflow: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.admin-table th { color: var(--muted); font-weight: 500; }

.admin-sync-timing {
  font-size: 12px;
  line-height: 1.45;
  min-width: 220px;
  max-width: 360px;
}
.admin-sync-timing details {
  margin-top: 4px;
}
.admin-sync-timing summary {
  cursor: pointer;
  color: var(--muted);
}
.admin-sync-timing ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.admin-sync-msg {
  max-width: 280px;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-msg {
  margin-left: 12px;
  font-size: 13px;
  color: var(--muted);
}

.admin-user-toolbar {
  margin-bottom: 12px;
}

.admin-user-toolbar .input {
  min-width: 220px;
}

.admin-user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-user-actions input[type="date"] {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.green-track-price-readonly {
  display: inline-block;
  min-width: 48px;
  text-align: right;
  color: var(--text);
}

.theme-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-picker-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.theme-select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.theme-select:hover,
.theme-select:focus {
  border-color: var(--accent2);
  outline: none;
}

/* 交易日历 */
.date-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-picker-label {
  display: inline-flex;
  align-items: center;
  height: 32px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.date-picker-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.date-picker-day-nav {
  width: 28px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.date-picker-day-nav:hover:not(:disabled) {
  border-color: var(--accent2);
  background: var(--hover-bg);
}

.date-picker-day-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.date-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  min-width: 118px;
  justify-content: space-between;
}

.date-picker-trigger:hover,
.date-picker-trigger[aria-expanded="true"] {
  border-color: var(--accent2);
  background: var(--hover-bg);
}

.date-picker-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.date-picker-caret {
  color: var(--muted);
  font-size: 11px;
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 216px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 8px;
  z-index: 200;
}

.date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 6px;
}

.date-picker-jump {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.date-picker-jump select {
  height: 24px;
  max-width: 88px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 0 2px;
  cursor: pointer;
}

.date-picker-nav {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.date-picker-nav:hover {
  border-color: var(--accent2);
  background: var(--hover-bg);
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.date-picker-weekdays {
  margin-bottom: 4px;
}

.date-picker-weekdays span {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 2px 0;
  line-height: 1.2;
}

.date-picker-day,
.date-picker-day-empty {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 4px;
  padding: 0;
}

.date-picker-day-empty {
  pointer-events: none;
}

.date-picker-day {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: default;
}

.date-picker-day.is-available {
  color: var(--text);
  cursor: pointer;
  background: rgba(82, 65, 159, 0.18);
}

.date-picker-day.is-available:hover {
  background: rgba(82, 65, 159, 0.35);
}

.date-picker-day.is-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.date-picker-day.is-selected:hover {
  background: var(--accent2);
}

.date-picker-day.is-pending {
  outline: 1px dashed var(--accent2);
  outline-offset: -2px;
}

.date-picker-day.is-other-month {
  opacity: 0.35;
}

.date-picker-hint {
  display: none;
}

select, .input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.btn:hover { background: var(--accent2); }
.btn-secondary { background: var(--bg3); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--hover-bg); }

.tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.tabs::-webkit-scrollbar {
  height: 4px;
}

.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab.active { background: var(--accent); color: var(--on-accent); }
.tab:hover:not(.active) { background: var(--bg3); color: var(--text); }

.tab-live-label {
  position: relative;
  display: inline-block;
  line-height: 1.2;
}

.live-tab-update-badge {
  position: absolute;
  left: auto;
  right: -8px;
  top: -7px;
  transform: none;
  z-index: 2;
  padding: 0 3px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.tab.active .live-tab-update-badge {
  background: #fff;
  color: #dc2626;
}

.live-tab-update-badge.hidden {
  display: none !important;
}

.tab-dropdown {
  position: relative;
  flex-shrink: 0;
}

.tab-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tab-dropdown-caret {
  font-size: 11px;
  opacity: 0.85;
  line-height: 1;
}

.tab-dropdown-menu {
  position: fixed;
  z-index: 300;
  min-width: 148px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.tab-dropdown-menu.is-open {
  display: flex;
}

.tab-dropdown-menu.hidden {
  display: none !important;
}

.tab-dropdown-item {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.tab-dropdown-item:hover,
.tab-dropdown-item.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.membership-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 24px 16px;
}

.membership-gate-card {
  width: min(420px, 100%);
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg2));
  text-align: center;
}

.membership-gate-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.membership-gate-text {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.membership-gate-redeem {
  min-width: 140px;
  min-height: 42px;
}

html.no-membership th.sortable {
  cursor: not-allowed;
  opacity: 0.72;
}

.app-error {
  margin: 12px 20px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 35, 35, 0.12);
  border: 1px solid rgba(255, 35, 35, 0.35);
  color: var(--red);
  font-size: 13px;
}
.app-error.hidden { display: none; }
.hidden { display: none !important; }

.env-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #ff6600;
  margin: 0 0 12px;
}

[data-theme="light"] .env-panel-title {
  color: #c2410c;
}

/* 大环境：与官方配色一致 */
.env-code-a { color: var(--env-code-a); }
.env-code-b { color: var(--red); }
.env-code-c { color: var(--green); }
.env-state-main-fall { color: var(--green); }
.env-state-main-rise { color: var(--red); }
.env-state-rotation { color: var(--muted); }
.env-score-up { color: var(--red); }
.env-score-down { color: var(--green); }
.env-strength { color: var(--text); }
.env-arrow {
  margin-left: 2px;
  font-size: 12px;
  line-height: 1;
}

main {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 16px 20px;
  box-sizing: border-box;
}

#mainApp,
.panel.active {
  width: 100%;
  max-width: 100%;
}

#panel-selection .selection-layout {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: stretch;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  gap: 16px;
  height: calc(100vh - 88px);
  height: calc(100vh - var(--header-h) - 32px);
  min-height: 420px;
}

#panel-selection .content {
  -ms-flex: 1 1 0px;
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
  flex-direction: column;
  min-height: 0;
}

#panel-selection .toolbar {
  -ms-flex-negative: 0;
  flex-shrink: 0;
  width: 100%;
}

#panel-selection .table-wrap {
  -ms-flex: 1 1 0px;
  flex: 1 1 0%;
  width: 100%;
  min-height: 0;
  max-height: none;
}

#panel-selection .scroll-status {
  flex-shrink: 0;
}

#panel-selection .selection-main-row {
  --intraday-list-pct: var(--xc-selection-split, 60);
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  gap: 0;
  width: 100%;
}

#panel-selection .selection-list-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc(var(--intraday-list-pct) * 1%);
  width: calc(var(--intraday-list-pct) * 1%);
  max-width: none;
  min-width: 240px;
  min-height: 0;
}

#panel-selection .selection-list-col .table-wrap {
  flex: 1 1 0%;
  min-height: 0;
}

#panel-intraday .intraday-page-layout {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  gap: 0;
  height: calc(100vh - 88px);
  height: calc(100vh - var(--header-h) - 32px);
  min-height: 420px;
}

#panel-intraday .intraday-jingsuan-sidebar {
  flex: 0 0 calc(var(--xc-ij-side, 260) * 1px);
  width: calc(var(--xc-ij-side, 260) * 1px);
  min-width: 200px;
  max-width: 520px;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2, #1a1a1a);
}

#panel-intraday .ij-breadth {
  flex-shrink: 0;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
}

#panel-intraday .ij-breadth-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.2;
}

#panel-intraday .ij-breadth-name {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--text);
}

#panel-intraday .ij-breadth-up,
#panel-intraday .ij-breadth-down {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#panel-intraday .ij-breadth-up { color: var(--red); }
#panel-intraday .ij-breadth-down { color: var(--green); margin-left: auto; }

#panel-intraday .ij-breadth-up b,
#panel-intraday .ij-breadth-down b {
  font-weight: 700;
}

#panel-intraday .ij-breadth-meter {
  display: flex;
  height: 4px;
  margin-top: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(127, 127, 127, 0.18);
}

#panel-intraday .ij-breadth-meter #ijBreadthUpBar {
  background: var(--red);
  width: 0;
}

#panel-intraday .ij-breadth-meter #ijBreadthDownBar {
  background: var(--green);
  width: 0;
}

#panel-intraday .ij-indices {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

#panel-intraday .ij-index {
  display: flex;
  align-items: baseline;
  gap: 2px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

#panel-intraday .ij-index-name {
  color: var(--muted);
  flex-shrink: 0;
}

#panel-intraday .ij-index-px,
#panel-intraday .ij-index-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

#panel-intraday .ij-index-px {
  color: var(--text);
}

#panel-intraday .ij-index-pct.flat {
  color: var(--muted);
  font-weight: 500;
}

#panel-intraday .intraday-jingsuan-head {
  flex-shrink: 0;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(82, 65, 159, 0.14) 0%, transparent 100%);
}

#panel-intraday .intraday-jingsuan-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

#panel-intraday .intraday-jingsuan-list {
  flex: 0 0 calc(var(--xc-ij-list-pct, 55) * 1%);
  min-height: 80px;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#panel-intraday .ij-vsplit {
  flex: 0 0 6px;
  height: 6px;
  margin: 0;
  border-radius: 3px;
  background: transparent;
  cursor: row-resize;
  position: relative;
  touch-action: none;
  user-select: none;
}

#panel-intraday .ij-vsplit::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 2px;
  height: 2px;
  border-radius: 2px;
  background: rgba(127, 127, 127, 0.45);
}

#panel-intraday .ij-vsplit:hover::before,
#panel-intraday .intraday-jingsuan-sidebar.is-v-resizing .ij-vsplit::before {
  background: rgba(236, 128, 141, 0.85);
}

#panel-intraday .intraday-jingsuan-sidebar.is-v-resizing {
  cursor: row-resize;
  user-select: none;
}

#panel-intraday .ij-live {
  flex: 1 1 0%;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  border-top: 0;
  overflow: hidden;
}

#panel-intraday .intraday-jingsuan-sidebar.ij-hide-list .intraday-jingsuan-list,
#panel-intraday .intraday-jingsuan-sidebar.ij-hide-live .ij-live,
#panel-intraday .intraday-jingsuan-sidebar.ij-hide-list .ij-vsplit,
#panel-intraday .intraday-jingsuan-sidebar.ij-hide-live .ij-vsplit {
  display: none;
}

#panel-intraday .intraday-jingsuan-sidebar.ij-hide-list:not(.ij-hide-live) .ij-live,
#panel-intraday .intraday-jingsuan-sidebar.ij-hide-live:not(.ij-hide-list) .intraday-jingsuan-list {
  flex: 1 1 0%;
  min-height: 0;
}

#panel-intraday .ij-live-head {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(82, 65, 159, 0.1) 0%, transparent 100%);
}

#panel-intraday .ij-live-feed {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#panel-intraday .ij-live-item {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.12);
  font-size: 12px;
  line-height: 1.4;
}

#panel-intraday .ij-live-item:last-child {
  border-bottom: 0;
}

#panel-intraday .ij-live-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#panel-intraday .ij-live-text {
  color: var(--text);
  word-break: break-word;
}

#panel-intraday .ij-live-empty {
  margin: 6px 2px;
  font-size: 12px;
  color: var(--muted);
}

#panel-intraday .ij-cols,
#panel-intraday .ij-stock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.2em 3.2em 3.2em;
  gap: 4px;
  align-items: center;
}

#panel-intraday .ij-id {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

#panel-intraday .ij-cols {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 2px 6px 6px;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg2, #1a1a1a);
}

#panel-intraday .ij-group {
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  overflow: hidden;
}

#panel-intraday .ij-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: var(--panel-head-bg);
  border-bottom: 1px solid var(--panel-head-border);
}

#panel-intraday .ij-group-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  flex-shrink: 0;
}

#panel-intraday .ij-group-head h3 {
  margin: 0;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#panel-intraday .ij-stock {
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 5px 6px;
  cursor: pointer;
}

#panel-intraday .ij-stock:hover,
#panel-intraday .ij-stock.is-chart-active {
  background: rgba(82, 65, 159, 0.12);
}

#panel-intraday .ij-stock.is-chart-active {
  outline: 1px solid rgba(236, 128, 141, 0.55);
}

#panel-intraday .ij-code {
  flex: 0 0 auto;
}

#panel-intraday .ij-code,
#panel-intraday .ij-val {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#panel-intraday .ij-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

#panel-intraday .ij-val {
  text-align: right;
  font-weight: 600;
}

#panel-intraday .ij-val.flat {
  color: var(--muted);
  font-weight: 500;
}

#panel-intraday .ij-empty {
  margin: 8px 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

#panel-intraday .content {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
  flex-direction: column;
  flex: 1 1 0%;
  width: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
}

#panel-intraday .toolbar {
  -ms-flex-negative: 0;
  flex-shrink: 0;
  width: 100%;
}

#panel-intraday .intraday-main-row {
  --intraday-list-pct: var(--xc-intraday-split, 60); /* 默认 左列表:右图表 = 3:2 */
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  gap: 0;
  width: 100%;
  padding: 0 8px 0 0;
}

#panel-intraday .intraday-list-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc(var(--intraday-list-pct) * 1%);
  width: calc(var(--intraday-list-pct) * 1%);
  max-width: none;
  min-width: 240px;
  min-height: 0;
}

#panel-intraday .intraday-list-col .pz-warning-panel {
  margin: 0 0 6px;
  max-height: min(120px, 16vh);
}

#panel-intraday .intraday-list-col .pz-warning-table-wrap.table-wrap,
#panel-intraday .intraday-list-col .pz-warning-table-wrap {
  max-height: min(72px, 10vh);
}

#panel-intraday .intraday-list-col .table-wrap {
  -ms-flex: 1 1 0px;
  flex: 1 1 0%;
  width: 100%;
  min-height: 0;
  max-height: none;
}

#panel-intraday .table-wrap {
  -ms-flex: 1 1 0px;
  flex: 1 1 0%;
  width: 100%;
  min-height: 0;
  max-height: none;
}

#panel-intraday .scroll-status {
  flex-shrink: 0;
}

.intraday-split-handle {
  flex: 0 0 6px;
  width: 6px;
  margin: 0 2px;
  border-radius: 3px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  align-self: stretch;
  touch-action: none;
  user-select: none;
}

.intraday-split-handle::before {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 2px;
  width: 2px;
  border-radius: 1px;
  background: rgba(148, 163, 184, 0.35);
}

.intraday-split-handle:hover::before,
.intraday-main-row.is-resizing .intraday-split-handle::before,
.selection-main-row.is-resizing .intraday-split-handle::before,
.intraday-page-layout.is-resizing .intraday-split-handle::before {
  background: rgba(236, 128, 141, 0.85);
}

.intraday-main-row.is-resizing,
.selection-main-row.is-resizing,
.intraday-page-layout.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.intraday-main-row.is-resizing iframe,
.intraday-main-row.is-resizing canvas,
.selection-main-row.is-resizing iframe,
.selection-main-row.is-resizing canvas,
.intraday-page-layout.is-resizing iframe,
.intraday-page-layout.is-resizing canvas {
  pointer-events: none;
}

.intraday-chart-dock {
  flex: 1 1 0%;
  width: auto;
  max-width: none;
  min-width: 280px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 10px;
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  background: var(--bg2, #1a1a1a);
  overflow: hidden;
}

.intraday-chart-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  min-height: 22px;
}

.intraday-chart-head strong {
  font-size: 13px;
}

.intraday-chart-meta,
.intraday-chart-status {
  font-size: 11px;
  color: var(--muted, #888);
}

.pz-chart-view-toggle {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid var(--border, #444);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.pz-chart-view-toggle[hidden] {
  display: none !important;
}

.pz-chart-view-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted, #999);
  font-size: 12px;
  line-height: 1;
  padding: 5px 10px;
  cursor: pointer;
}

.pz-chart-view-btn + .pz-chart-view-btn {
  border-left: 1px solid var(--border, #444);
}

.pz-chart-view-btn:hover {
  color: var(--text, #e8e6e3);
  background: rgba(255, 255, 255, 0.04);
}

.pz-chart-view-btn.is-active {
  color: var(--text, #e8e6e3);
  background: rgba(236, 128, 141, 0.22);
}

.pz-chart-expand-btn {
  appearance: none;
  border: 1px solid var(--border, #444);
  background: transparent;
  color: var(--muted, #999);
  font-size: 12px;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.pz-chart-expand-btn:hover {
  color: var(--text, #e8e6e3);
  background: rgba(255, 255, 255, 0.04);
}

.intraday-chart-block {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.intraday-chart-block.is-fs,
.intraday-chart-block.is-kline {
  flex: 1 1 0%;
  min-height: 0;
}

/* 底部排名 dock 占高时：只显示选中的一张图 */
.intraday-chart-dock.is-solo {
  gap: 4px;
}

.intraday-chart-dock.is-solo .intraday-chart-block:not(.is-active) {
  display: none;
}

.intraday-chart-dock.is-solo .intraday-chart-block.is-active {
  flex: 1 1 0%;
  min-height: 0;
}

.intraday-chart-dock.is-solo .pz-fs-chart,
.intraday-chart-dock.is-solo .pz-kline-chart {
  min-height: 160px;
}

.intraday-chart-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text, #e8e6e3);
}

.pz-fs-chart,
.pz-kline-chart {
  position: relative;
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  /* 禁止 echarts canvas 画出容器，叠到隔壁图上 */
  overflow: hidden;
}

.pz-fs-chart.is-empty,
.pz-kline-chart.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border, #333);
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.06);
}

.pz-fs-chart.is-empty::before,
.pz-kline-chart.is-empty::before {
  content: attr(data-empty-hint);
  display: block;
  max-width: 12em;
  padding: 0 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted, #787776);
  pointer-events: none;
  user-select: none;
}

.pz-fs-chart.is-empty > *,
.pz-kline-chart.is-empty > * {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 单图模式才给较高下限；双图跟 flex 分高，避免笔记本叠图 */
.intraday-chart-dock.is-solo .pz-fs-chart {
  min-height: 180px;
}

@media (max-height: 820px) {
  .intraday-chart-dock:not(.is-solo) .pz-fs-chart,
  .intraday-chart-dock:not(.is-solo) .pz-kline-chart {
    min-height: 0;
  }
}

#intradayTable tbody tr.stock-row.is-chart-active,
#stockTable tbody tr.stock-row.is-chart-active {
  outline: 1px solid rgba(236, 128, 141, 0.55);
  background: rgba(236, 128, 141, 0.12);
}

@media (max-width: 900px) {
  #panel-intraday .intraday-page-layout {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  #panel-intraday .intraday-jingsuan-sidebar {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 280px;
  }
  #intradayJingsuanSplit {
    display: none;
  }
  #panel-intraday .intraday-main-row,
  #panel-selection .selection-main-row {
    flex-direction: column;
  }
  #panel-intraday .intraday-list-col,
  #panel-selection .selection-list-col {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }
  .intraday-split-handle {
    display: none;
  }
  .intraday-chart-dock {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: min(280px, 36vh);
  }
  #panel-intraday .intraday-list-col .pz-warning-panel {
    max-height: min(140px, 18vh);
  }
}

/* 环境/方向/模式：内嵌到底部 dock，不跳独立页 */
.rank-dock-split {
  flex: 0 0 8px;
  height: 8px;
  margin: 2px 0 0;
  cursor: row-resize;
  touch-action: none;
  position: relative;
  user-select: none;
  border-radius: 4px;
  background: transparent;
}

.rank-dock-split[hidden] {
  display: none !important;
}

.rank-dock-split::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: rgba(167, 139, 250, 0.45);
}

.rank-dock-split:hover::before,
.content.is-rank-resizing .rank-dock-split::before,
#panel-selection .content.is-rank-resizing .rank-dock-split::before {
  background: rgba(196, 181, 253, 0.9);
}

.content.is-rank-resizing,
#panel-selection .content.is-rank-resizing {
  cursor: row-resize;
  user-select: none;
}

.content.is-rank-resizing iframe,
.content.is-rank-resizing canvas,
#panel-selection .content.is-rank-resizing iframe,
#panel-selection .content.is-rank-resizing canvas {
  pointer-events: none;
}

.rank-dock {
  --rank-dock-h: min(40vh, 380px);
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: var(--rank-dock-h);
  min-height: 140px;
  max-height: min(70vh, 640px);
  margin-top: 0;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 8px;
  background: var(--bg2, #1a1a1a);
  overflow: hidden;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.25);
}

.rank-dock.hidden {
  display: none;
}

.rank-dock-close {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 5;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(196, 181, 253, 0.4);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: #e9d5ff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.rank-dock-close:hover {
  background: rgba(167, 139, 250, 0.35);
  border-color: #c4b5fd;
  color: #fff;
}

.rank-dock-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rank-dock-body .toolbar {
  display: none;
}

.rank-dock-body .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.rank-dock-body .scroll-status,
#envScrollStatus,
#directionScrollStatus,
#modeScrollStatus {
  display: none !important;
}

.rank-dock-body .dataset-block {
  width: min(480px, 78vw);
  min-width: 300px;
  max-width: 520px;
  flex: 0 0 auto;
}

.tab.is-dock-on,
.m-tabbar-item.is-dock-on {
  color: #c4b5fd;
  box-shadow: inset 0 -2px 0 #a78bfa;
}


.snapshot-select {
  width: auto;
  min-width: 88px;
  padding: 4px 8px;
}

.snapshot-latest {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #78716c;
  white-space: nowrap;
  vertical-align: middle;
}

.snapshot-latest.is-follow {
  color: #c2410c;
}

/* 竞价页左侧与右侧等高，不受通用 .sidebar max-height 限制 */
#panel-selection .sidebar.selection-sidebar {
  -ms-flex: 0 0 280px;
  flex: 0 0 280px;
  width: 280px;
  padding: 0;
  max-height: none;
  height: 100%;
  overflow: hidden;
  -ms-flex-item-align: stretch;
  align-self: stretch;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
  flex-direction: column;
  min-height: 0;
}

#panel-selection .selection-sidebar-head {
  flex-shrink: 0;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(82, 65, 159, 0.14) 0%, transparent 100%);
}

#panel-selection .selection-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

#panel-selection .selection-sidebar-hint {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

#panel-selection .selection-sidebar-desc {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

#panel-selection .selection-highlights {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#panel-selection .selection-highlights::-webkit-scrollbar {
  width: 6px;
}

#panel-selection .selection-highlights::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

#panel-selection .highlight-group {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  overflow: hidden;
}

#panel-selection .highlight-group:last-child {
  margin-bottom: 0;
}

#panel-selection .highlight-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--panel-head-bg);
  border-bottom: 1px solid var(--panel-head-border);
}

#panel-selection .highlight-group-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  flex-shrink: 0;
}

#panel-selection .highlight-group-head h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  line-height: 1.3;
}

#panel-selection .highlight-group-body {
  padding: 4px 6px 6px;
}

#panel-selection .highlight-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 40px 5.6em;
  align-items: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 6px;
  border-radius: 6px;
  font-size: 12px;
  transition: background 0.15s ease;
}

#panel-selection .highlight-item:hover {
  background: rgba(82, 65, 159, 0.12);
}

#panel-selection .highlight-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface-overlay);
}

#panel-selection .highlight-rank-1 {
  color: #b45309;
  background: rgba(245, 158, 11, 0.18);
}

#panel-selection .highlight-rank-2 {
  color: var(--text-secondary);
  background: var(--surface-overlay);
}

#panel-selection .highlight-rank-3 {
  color: #c2410c;
  background: rgba(234, 88, 12, 0.14);
}

#panel-selection .highlight-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

#panel-selection .highlight-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

#panel-selection .highlight-count-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

#panel-selection .highlight-count {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-variant-numeric: tabular-nums;
}

#panel-selection .highlight-boost {
  justify-self: stretch;
  text-align: right;
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#panel-selection .highlight-boost.env-score-up {
  background: rgba(255, 35, 35, 0.12);
}

#panel-selection .highlight-boost.env-score-down {
  background: rgba(16, 204, 85, 0.12);
}

#panel-selection .highlight-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 8px;
  text-align: center;
}

.panel { display: none; }
.panel.active { display: block; }

.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.filter-group { margin-bottom: 16px; }
.filter-group h3 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.mode-list.scroll { max-height: 260px; overflow-y: auto; }

.mode-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
}
.mode-item:hover { background: var(--bg3); }
.mode-item input { accent-color: var(--accent); }
.mode-item .count { margin-left: auto; color: var(--muted); font-size: 12px; }

.radio { display: block; font-size: 13px; margin: 6px 0; cursor: pointer; }
.radio input { margin-right: 6px; accent-color: var(--accent); }

.content { -ms-flex: 1 1 0px; flex: 1 1 0%; min-width: 0; width: 100%; }

.toolbar {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 10px;
  -ms-flex-align: center;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  background: #1a1a1a;
  background: var(--bg2);
  border: 1px solid #333;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.toolbar label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.dataset-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.dataset-chips::-webkit-scrollbar { display: none; }

.dataset-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.dataset-chip:hover {
  color: var(--text);
}

.dataset-chip.is-active {
  color: var(--on-accent);
  background: var(--accent);
  font-weight: 600;
}

.dataset-block {
  flex: 0 0 auto;
  width: min(520px, 85vw);
  min-width: 320px;
  max-width: 560px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dataset-block.is-focused {
  border-color: rgba(167, 139, 250, 0.65);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.35);
}

.block-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 0 10px;
  border-radius: 8px;
  background: rgba(82, 65, 159, 0.16);
  border: 1px solid rgba(82, 65, 159, 0.35);
}

.block-filter-bar.hidden { display: none; }

.block-filter-label {
  font-size: 12px;
  color: var(--muted);
}

.block-filter-chip {
  font-size: 13px;
  color: var(--text);
}

.block-filter-code {
  margin-left: 6px;
  font-size: 11px;
  color: var(--accent2);
}

.block-filter-clear {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.block-filter-clear:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

.tag-filter-bar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 12px;
  margin: 0 0 10px;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.08);
}

.tag-filter-bar.hidden { display: none; }

.tag-filter-title {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  line-height: 24px;
}

.tag-filter-body {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  min-width: 0;
}

.tag-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 0;
}

.tag-filter-group-label {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.tag-filter-stack {
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.tag-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.18);
}

.tag-filter-clear-all {
  margin-left: auto;
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tag-filter-clear-all:hover {
  background: rgba(251, 191, 36, 0.3);
  border-color: #fbbf24;
  color: #fff;
}

[data-theme="light"] .tag-filter-bar {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: none;
}

[data-theme="light"] .tag-filter-title {
  color: #b45309;
}

[data-theme="light"] .tag-filter-chip {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .tag-filter-clear-all {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(180, 83, 9, 0.4);
}

[data-theme="light"] .tag-filter-clear-all:hover {
  color: #78350f;
  background: rgba(245, 158, 11, 0.24);
  border-color: #b45309;
}

.block-count-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  margin-left: 4px;
  padding: 1px 6px;
  border: 1px solid rgba(82, 65, 159, 0.45);
  border-radius: 999px;
  background: rgba(82, 65, 159, 0.18);
  color: var(--accent2);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  vertical-align: baseline;
  line-height: 1.4;
}

.block-count-btn:hover {
  background: rgba(82, 65, 159, 0.32);
  border-color: var(--accent2);
  color: #fff;
}

.block-count-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--accent2);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  vertical-align: baseline;
  line-height: 1.4;
  user-select: none;
}

.block-count-check:hover {
  color: #fff;
}

.block-count-check.is-checked {
  color: #fff;
}

.block-count-input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent2);
  cursor: pointer;
  flex-shrink: 0;
}

.block-count-num {
  line-height: 1.2;
}

.dataset-block-label {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  white-space: nowrap;
  flex-shrink: 0;
}

.dataset-block-table {
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}

.dataset-block table {
  width: 100%;
}

#envTablesContainer,
#directionTablesContainer,
#modeTablesContainer {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  min-width: min-content;
  width: max-content;
  padding-bottom: 4px;
}

#envTableWrap,
#directionTableWrap,
#modeTableWrap {
  overflow-x: auto;
  overflow-y: auto;
  cursor: grab;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

#envTableWrap.is-dragging,
#directionTableWrap.is-dragging,
#modeTableWrap.is-dragging {
  cursor: grabbing;
  user-select: none;
}

#envTableWrap::-webkit-scrollbar,
#directionTableWrap::-webkit-scrollbar,
#modeTableWrap::-webkit-scrollbar {
  height: 8px;
}

#envTablesContainer:not(:has(.dataset-block)),
#directionTablesContainer:not(:has(.dataset-block)),
#modeTablesContainer:not(:has(.dataset-block)) {
  display: block;
  min-width: 0;
  width: 100%;
}

.empty-hint {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-stocks {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.toolbar-stocks.is-collapsed {
  gap: 8px;
}

.toolbar-stocks-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.toolbar-stocks.is-collapsed .toolbar-stocks-body {
  gap: 8px;
}

/* 收起仅隐藏搜索/设置行，保留上方价位透视与特色因子，以及同行已筛选条 */
.toolbar-stocks.is-collapsed .toolbar-meta-row .toolbar-row-content {
  display: none;
}

.toolbar-stocks.is-collapsed .toolbar-meta-row {
  justify-content: flex-start;
  width: 100%;
  margin-left: 0;
}

.toolbar-row-content {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 10px;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

.toolbar-search-input {
  width: 140px;
  min-width: 120px;
  max-width: 180px;
  flex: 0 1 140px;
}

.toolbar-active-filters {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.toolbar-active-filters:empty,
.toolbar-active-filters:not(:has(.toolbar-inline-filter:not(.hidden))) {
  display: none;
}

/* 板块/已筛选并入搜索同一行，不再单独占两行 */
.toolbar-inline-filter.block-filter-bar,
.toolbar-inline-filter.tag-filter-bar {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 4px 8px;
  gap: 6px 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: center;
  max-width: 100%;
}

.toolbar-inline-filter .block-filter-clear,
.toolbar-inline-filter .tag-filter-clear-all {
  margin-left: 4px;
}

.toolbar-inline-filter .tag-filter-body {
  flex-wrap: nowrap;
}

.toolbar-inline-filter .tag-filter-title {
  line-height: 1.2;
}

.toolbar-dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbar-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.toolbar-dropdown .board-filters {
  flex-wrap: wrap;
  gap: 8px 10px;
  width: 100%;
}

.toolbar-dropdown .board-toggle-divider {
  margin-left: 0;
  padding-left: 0;
  border-left: none;
  width: 100%;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.toolbar-extra,
.toolbar-filter-extra {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.toolbar-filter-extra > #priceViewHost,
.toolbar-filter-extra > #specialFactorHost,
.toolbar-filter-extra > #intradayPriceViewHost,
.toolbar-filter-extra > #intradaySpecialFactorHost {
  flex: 1 1 calc(50% - 4px);
  min-width: min(100%, 360px);
  max-width: 100%;
  box-sizing: border-box;
}

.toolbar-filter-extra .price-view-filter {
  height: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 窄屏并排放不下时标签可换行，避免撑出屏幕；特色因子保持固定行数 */
.toolbar-filter-extra .price-view-filter-line {
  flex-wrap: wrap;
}

.toolbar-filter-extra .price-view-filter:not(.special-factor-filter) .price-view-filter-groups {
  flex-wrap: wrap;
  overflow-x: visible;
  row-gap: 6px;
}

.toolbar-filter-extra .price-view-filter:not(.special-factor-filter) .price-view-filter-group {
  flex-shrink: 1;
  flex-wrap: wrap;
  max-width: 100%;
}

.toolbar-filter-extra .price-view-filter-tags {
  flex-wrap: wrap;
  flex-shrink: 1;
  max-width: 100%;
}

.toolbar-filter-extra .special-factor-filter .price-view-filter-line {
  flex-wrap: nowrap;
}

.toolbar-filter-extra .special-factor-filter .price-view-filter-groups {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.toolbar-filter-extra .special-factor-filter .price-view-filter-group {
  flex-shrink: 0;
  max-width: none;
}

.toolbar-filter-extra .special-factor-filter .price-view-filter-tags {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* 筛选项关闭时整块不占位，另一侧自动拉满 */
#priceViewHost:has(.price-view-filter.hidden),
#specialFactorHost:has(.price-view-filter.hidden),
#intradayPriceViewHost:has(.price-view-filter.hidden),
#intradaySpecialFactorHost:has(.price-view-filter.hidden) {
  display: none;
}

@media (max-width: 1100px) {
  .toolbar-filter-extra > #priceViewHost,
  .toolbar-filter-extra > #specialFactorHost,
  .toolbar-filter-extra > #intradayPriceViewHost,
  .toolbar-filter-extra > #intradaySpecialFactorHost {
    flex: 1 1 100%;
  }
}

.toolbar-row-toggle {
  flex-shrink: 0;
  margin-left: auto;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
  white-space: nowrap;
  line-height: 1.4;
}

.toolbar-row-toggle:hover {
  color: var(--text);
}

.toolbar-row,
.toolbar-meta-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.toolbar-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.toolbar-menu-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.toolbar-menu-btn:hover,
.toolbar-menu-btn.is-open {
  border-color: rgba(167, 139, 250, 0.55);
  color: #ede9fe;
  background: rgba(167, 139, 250, 0.16);
}

.toolbar-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  max-width: min(92vw, 520px);
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbar-dropdown.toolbar-dropdown-wide {
  min-width: min(92vw, 640px);
  max-height: min(60vh, 420px);
  overflow: auto;
}

.toolbar-dropdown.hidden,
.toolbar-dropdown[hidden] {
  display: none !important;
}

.toolbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.toolbar-dropdown-item input {
  accent-color: var(--accent);
}

.toolbar-dropdown .col-toggles {
  width: 100%;
}

.board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.board-filters-label {
  font-size: 12px;
  color: var(--muted);
}

.board-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.board-toggle input { accent-color: var(--accent); }

.board-toggle-divider {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.col-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.col-toggles-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 4px;
}

.col-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.col-toggle input { accent-color: var(--accent); }

.col-hidden { display: none; }

/* 价位透视 / 特色因子筛选 */
.price-view-filter {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  padding: 6px 10px;
  overflow: hidden;
}

/* 桌面：价位透视 / 特色因子回到工具栏主区域，列头弹层仍可作补充入口 */

.th-with-filter {
  white-space: nowrap;
}

.th-with-filter .th-label {
  margin-right: 2px;
}

/* 有筛选按钮的列：排序标记在前，筛选图标在后 */
th.sortable.th-with-filter::after {
  content: none;
}

.th-with-filter .th-sort-mark {
  display: inline-block;
  margin: 0 2px 0 1px;
  font-size: 11px;
  line-height: 1;
  opacity: 0.35;
  vertical-align: middle;
}

.th-with-filter .th-sort-mark::before {
  content: "⇅";
}

th.sortable.th-with-filter.sort-asc .th-sort-mark,
th.sortable.th-with-filter.sort-desc .th-sort-mark {
  opacity: 1;
  color: var(--accent2);
}

th.sortable.th-with-filter.sort-asc .th-sort-mark::before { content: "↑"; }
th.sortable.th-with-filter.sort-desc .th-sort-mark::before { content: "↓"; }

.th-filter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-left: 4px;
  vertical-align: middle;
  border: 1px solid rgba(167, 139, 250, 0.55);
  border-radius: 4px;
  background: rgba(167, 139, 250, 0.16);
  color: #c4b5fd;
  cursor: pointer;
  opacity: 1;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.th-filter-trigger:hover,
.th-filter-trigger.is-open {
  color: #ede9fe;
  background: rgba(167, 139, 250, 0.32);
  border-color: #a78bfa;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.35);
}

.th-filter-trigger.is-active {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.22);
  border-color: #fbbf24;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}

.th-filter-trigger.hidden {
  display: none;
}

[data-theme="light"] .th-filter-trigger {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.45);
}

[data-theme="light"] .th-filter-trigger:hover,
[data-theme="light"] .th-filter-trigger.is-open {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.18);
  border-color: #7c3aed;
  box-shadow: none;
}

[data-theme="light"] .th-filter-trigger.is-active {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
}

.col-filter-popover {
  position: fixed;
  z-index: 1200;
  min-width: 320px;
  max-width: min(440px, calc(100vw - 16px));
  padding: 10px 12px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2, #1e1e1e);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.col-filter-popover.hidden {
  display: none;
}

.col-filter-popover-wide {
  max-width: min(560px, calc(100vw - 16px));
}

.col-filter-popover .price-view-filter-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.col-filter-popover .price-view-filter-title {
  font-size: 13px;
}

.col-filter-section {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.col-filter-section .price-view-filter-label {
  min-width: 3.5em;
  width: auto;
  padding-top: 4px;
  flex-shrink: 0;
}

.col-filter-section .price-view-filter-tags {
  flex: 1;
  flex-wrap: wrap;
  gap: 6px;
}

[data-theme="light"] .col-filter-popover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.special-factor-filter .price-view-filter-head-row,
.price-view-filter .price-view-filter-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.filter-current-hint {
  flex: 1;
  min-width: 80px;
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-current-hint.is-empty {
  font-weight: 400;
  color: var(--muted);
}

.price-view-filter .price-view-filter-line + .price-view-filter-line,
.special-factor-filter .price-view-filter-line + .price-view-filter-line {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.special-factor-filter .price-view-filter-line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.special-factor-filter .price-view-filter-line .price-view-filter-groups {
  flex: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.special-factor-filter .price-view-filter-group {
  flex-shrink: 0;
}

/* 第三行：趋势+其他并排，窄屏横向滚动不拆成第4行 */
.special-factor-filter .price-view-filter-line:last-child .price-view-filter-groups {
  flex-wrap: nowrap;
}

.price-view-filter-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.price-view-filter-title {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.price-view-filter-groups {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.price-view-filter-groups::-webkit-scrollbar {
  height: 4px;
}

.price-view-filter-groups::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.price-view-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.price-view-filter-sep {
  flex-shrink: 0;
  width: 1px;
  height: 18px;
  background: var(--border);
}

.price-view-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.price-view-stack-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
}

.price-view-stack-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.price-view-switch {
  position: relative;
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: var(--switch-bg);
  transition: background 0.2s;
}

.price-view-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--switch-knob);
  transition: transform 0.2s, background 0.2s;
}

.price-view-stack-toggle input:checked + .price-view-switch {
  background: rgba(168, 85, 247, 0.35);
}

.price-view-stack-toggle input:checked + .price-view-switch::after {
  transform: translateX(14px);
  background: #a855f7;
}

.price-view-reset {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.price-view-reset:hover { color: var(--text); }

.price-view-filter-label {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.price-view-filter-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.price-view-filter-btn {
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  padding: 2px 7px;
  font-size: 11px;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s, opacity 0.12s;
}

.price-view-filter-btn:hover { opacity: 0.9; }

.price-view-filter-btn.is-active {
  font-weight: 700;
  box-shadow: 0 0 0 2px #ffffff;
}

.price-view-cell {
  white-space: normal;
  max-width: 220px;
}

.price-view-tag {
  display: inline-block;
  margin-right: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.price-view-tag:last-child { margin-right: 0; }

.special-factor-cell {
  white-space: normal;
  max-width: 240px;
}

.special-factor-tag {
  display: inline-block;
  margin-right: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.special-factor-tag:last-child { margin-right: 0; }

.stats { margin-left: auto; font-size: 13px; color: var(--muted); }

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #333;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #1a1a1a;
  background: var(--bg2);
  max-height: calc(100vh - 180px);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }

thead { position: sticky; top: 0; background: var(--bg3); z-index: 1; }

th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }

th { color: var(--muted); font-weight: 500; font-size: 12px; }

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover { color: var(--text); background: rgba(82, 65, 159, 0.15); }
th.sortable.sort-active { color: var(--accent2); }
th.sortable::after {
  content: " ⇅";
  opacity: 0.35;
  font-size: 11px;
}
th.sortable.sort-asc::after { content: " ↑"; opacity: 1; color: var(--accent2); }
th.sortable.sort-desc::after { content: " ↓"; opacity: 1; color: var(--accent2); }

tbody tr:hover { background: rgba(82, 65, 159, 0.12); }

.pos { color: var(--red); }
.neg { color: var(--green); }

/* 竞价页股票列表（参考官方样式） */
#stockTable {
  font-size: 13px;
}

#stockTable thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  font-weight: 500;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}

#stockTable thead th.sortable:hover {
  background: var(--table-head-hover);
  color: var(--text);
}

#stockTable thead th.th-metric-xcjw {
  background: #3d2060;
  color: #e9d5ff;
}

#stockTable thead th.th-metric-jssb {
  background: #4a2020;
  color: #fecaca;
}

#stockTable thead th.th-metric-cjs {
  background: #1a3050;
  color: #bfdbfe;
}

#stockTable thead th.th-metric-direction {
  background: var(--table-head-bg);
}

#stockTable tbody tr {
  background: var(--table-row-bg);
}

#stockTable tbody tr:nth-child(even) {
  background: var(--table-row-alt);
}

#stockTable tbody td {
  padding: 5px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--table-row-border);
  line-height: 1.35;
}

#stockTable .cell-idx {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  width: 42px;
}

#stockTable .cell-code {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text);
}

#stockTable .cell-name {
  color: var(--text);
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#stockTable .pct-badge {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

#stockTable .pct-badge.pos { color: var(--red); }
#stockTable .pct-badge.neg { color: var(--green); }
#stockTable .pct-badge.flat { color: var(--muted); }

#stockTable .price-signed,
#intradayTable .price-signed {
  font-variant-numeric: tabular-nums;
}
#stockTable .price-signed.pos,
#intradayTable .price-signed.pos { color: var(--red); }
#stockTable .price-signed.neg,
#intradayTable .price-signed.neg { color: var(--green); }
#stockTable .price-signed.flat,
#intradayTable .price-signed.flat { color: var(--text); }

#stockTable .cell-price {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
}

html:not(.has-live-quote) #stockTable [data-col="live_price"],
html:not(.has-live-quote) #intradayTable [data-col="live_price"] {
  display: none !important;
}

#stockTable .cell-live-price,
#intradayTable .cell-live-price {
  white-space: nowrap;
  min-width: 4.5em;
}

#stockTable .cell-live-price .live-pct,
#intradayTable .cell-live-price .live-pct {
  font-size: 11px;
  margin-left: 2px;
  opacity: 0.9;
}

.pz-warning-panel {
  margin: 4px 12px 6px;
  padding: 4px 10px 6px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(236, 128, 141, 0.08), transparent 70%);
  flex-shrink: 0;
  max-height: min(180px, 24vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pz-warning-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  min-height: 28px;
}
.pz-warning-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.pz-warning-title {
  font-size: 13px;
  margin-right: 0;
  line-height: 1.2;
}
.pz-warning-meta,
.pz-warning-status {
  font-size: 11px;
  color: var(--muted, #6b7280);
  line-height: 1.2;
}
.pz-warning-status {
  margin: 0;
  flex-shrink: 0;
}
.pz-warning-status:empty,
.pz-warning-status.is-quiet {
  display: none;
}
.pz-warning-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pz-warning-actions .btn-secondary {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.3;
}
.pz-warning-body {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.pz-warning-body.is-collapsed {
  display: none;
}
.pz-warning-table-wrap {
  max-height: min(130px, 18vh);
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
/* 盘中页 .table-wrap 会 flex:1 / max-height:none，预警表必须单独压住 */
#panel-intraday .pz-warning-table-wrap.table-wrap,
#panel-intraday .pz-warning-table-wrap {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  max-height: min(130px, 18vh);
  min-height: 0;
  overflow: auto;
}
.pz-warning-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.pz-warning-table th,
.pz-warning-table td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--border, #eee);
  text-align: left;
  white-space: nowrap;
}
.pz-warning-table th {
  position: sticky;
  top: 0;
  background: var(--bg, #fff);
  z-index: 1;
  font-weight: 600;
  color: var(--muted, #6b7280);
}
.pz-warning-table tr.is-clickable {
  cursor: pointer;
}
.pz-warning-table tr.is-clickable:hover {
  background: rgba(236, 128, 141, 0.12);
}
.pz-warning-table .pos { color: var(--red, #ef4444); }
.pz-warning-table .neg { color: var(--green, #16a34a); }
@media (max-width: 900px) {
  .pz-warning-panel {
    margin: 4px 8px 6px;
    max-height: min(200px, 28vh);
  }
  #panel-intraday .pz-warning-table-wrap.table-wrap,
  #panel-intraday .pz-warning-table-wrap {
    max-height: min(120px, 18vh);
  }
}

#stockTable .cell-metric {
  font-variant-numeric: tabular-nums;
  text-align: left;
}

#stockTable .metric-zero {
  color: var(--muted);
  font-size: 13px;
}

#stockTable .metric-xcjw {
  color: #c084fc;
  font-size: 13px;
}

#stockTable .metric-jsjl {
  color: #ff6633;
  font-size: 13px;
}

#stockTable .metric-jssb {
  color: #f87171;
  font-size: 13px;
}

#intradayTable .metric-cjs {
  color: #60a5fa;
  font-size: 13px;
}

#intradayTable {
  font-size: 13px;
}

#intradayTable thead th {
  background: var(--table-head-bg);
  color: var(--table-head-text);
  font-weight: 500;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}

#intradayTable thead th.sortable:hover {
  background: var(--table-head-hover);
  color: var(--text);
}

#intradayTable thead th.th-metric-xcpzqb {
  background: #4a2020;
  color: #fecaca;
}

#intradayTable thead th.th-metric-xcpzdx {
  background: #143528;
  color: #86efac;
}

#intradayTable thead th.th-metric-xczpqb {
  background: #1a3050;
  color: #bfdbfe;
}

#intradayTable thead th.th-metric-direction {
  background: var(--table-head-bg);
}

#intradayTable tbody tr { background: var(--table-row-bg); }
#intradayTable tbody tr:nth-child(even) { background: var(--table-row-alt); }
#intradayTable tbody td {
  padding: 5px 10px;
  vertical-align: middle;
  border-bottom: 1px solid var(--table-row-border);
  line-height: 1.35;
}
#intradayTable .cell-idx {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  width: 42px;
}
#intradayTable .cell-code { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text); }
#intradayTable .cell-name {
  color: var(--text);
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#intradayTable .pct-badge { font-variant-numeric: tabular-nums; font-size: 12px; }
#intradayTable .pct-badge.pos { color: var(--red); }
#intradayTable .pct-badge.neg { color: var(--green); }
#intradayTable .pct-badge.flat { color: var(--muted); }
#intradayTable .cell-price { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
#intradayTable .cell-metric { font-variant-numeric: tabular-nums; }
#intradayTable .metric-zero { color: var(--muted); font-size: 13px; }
#intradayTable .metric-xcpzqb { color: #f87171; font-size: 13px; }
#intradayTable .metric-xcpzdx { color: #4ade80; font-size: 13px; }
#intradayTable .metric-xczpqb { color: #60a5fa; font-size: 13px; }
#intradayTable .market-cap,
#intradayTable .industry-cell,
#intradayTable .direction-cell,
#intradayTable .price-view-cell,
#intradayTable .special-factor-cell {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.green-track-table .metric-xcjw { color: #c084fc; }
.green-track-table .metric-jssb { color: #f87171; }
.green-track-table .metric-cjs { color: #60a5fa; }

.green-track-table thead th.th-metric-xcjw {
  background: #3d2060;
  color: #e9d5ff;
}

.green-track-table thead th.th-metric-jssb {
  background: #4a2020;
  color: #fecaca;
}

.green-track-table thead th.th-metric-cjs {
  background: #1a3050;
  color: #bfdbfe;
}

#stockTable .market-cap {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-secondary);
}

#stockTable .cap-main { color: var(--text-secondary); }
#stockTable .cap-tag { margin-left: 4px; font-size: 11px; color: var(--text-dim); }

#stockTable .industry-cell {
  max-width: 100px;
  color: var(--text-dim);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#stockTable .direction-cell {
  max-width: 360px;
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#stockTable [data-col="xc_exclusive_direction"].direction-cell {
  max-width: 280px;
}

.exclusive-direction-table {
  min-width: 1280px;
}

#stockTable .price-view-cell,
#stockTable .special-factor-cell {
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

#stockTable .price-view-tag,
#stockTable .special-factor-tag {
  margin-right: 6px;
}

#stockTable .price-view-tag:last-child,
#stockTable .special-factor-tag:last-child {
  margin-right: 0;
}

#stockTable .stock-row:hover {
  background: var(--row-highlight) !important;
}

.table-msg,
.table-msg td {
  text-align: center !important;
  color: var(--muted) !important;
}

.table-msg-action {
  margin-top: 10px;
}

.table-msg-error,
.table-msg-error td {
  color: var(--red) !important;
}

.page-msg {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.page-msg-error {
  color: var(--red);
}

.scroll-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}

#stockScrollStatus,
#intradayScrollStatus {
  display: none !important;
  margin: 0;
  min-height: 0;
}

.direction-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.industry-cell { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.market-cap { white-space: nowrap; }

.stock-row { cursor: pointer; }

.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}
.modal-panel {
  position: relative;
  width: min(960px, 96vw);
  max-height: 90vh;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.kline-panel {
  width: min(1480px, 98vw);
  height: min(900px, 92vh);
  max-height: 92vh;
}

.kline-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.kline-stock-list {
  width: 228px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg2, rgba(0, 0, 0, 0.18));
}

.kline-stock-list[hidden] {
  display: none;
}

.kline-stock-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kline-stock-list-count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kline-stock-list-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.kline-stock-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.kline-stock-item:hover {
  background: var(--row-hover);
}

.kline-stock-item.is-active {
  background: rgba(82, 65, 159, 0.28);
}

.kline-stock-item-idx {
  flex-shrink: 0;
  width: 28px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.kline-stock-item-meta {
  min-width: 0;
  flex: 1;
}

.kline-stock-item-name {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kline-stock-item-code {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.kline-stock-list-empty {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--muted);
}

.kline-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}


.modal.kline-fullscreen {
  padding: 0;
}

.kline-panel.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.kline-panel .modal-header {
  cursor: default;
  user-select: none;
  position: relative;
  padding: 12px 96px 10px 16px;
  align-items: flex-start;
}

.kline-panel .modal-header .kline-controls,
.kline-panel .modal-header .kline-header-actions,
.kline-panel .modal-header select {
  cursor: auto;
  user-select: auto;
}

.kline-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.kline-icon-btn {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.kline-icon-btn:hover {
  color: var(--text);
  border-color: var(--accent2);
}

.kline-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}
.kline-controls label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-header h2 { font-size: 16px; font-weight: 600; }
.kline-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; order: 1; }
.kline-subtitle {
  font-size: 12px;
  color: var(--muted);
  flex: 1 1 100%;
  order: 2;
  min-width: 0;
}
.kline-controls { order: 3; }
.kline-mobile-view-toggle { order: 2; }
.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }

.greentrack-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.greentrack-hint {
  font-size: 12px;
  color: var(--muted);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--accent2);
}

.green-track-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 10px;
}

.green-track-stat {
  flex: 1 1 160px;
  min-width: 150px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.green-track-stat-label {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  line-height: 1.35;
}

.green-track-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  margin-top: 2px;
}

.green-track-stat-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.green-track-next-col {
  font-size: 12px;
  color: var(--muted);
  vertical-align: top;
}

.green-track-table th,
.green-track-table td {
  text-align: center;
  white-space: nowrap;
}

.green-track-table .green-track-subhead th {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding-top: 0;
}

.green-track-date {
  text-align: left !important;
  vertical-align: top;
  font-weight: 600;
}

.green-track-next {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.green-track-rank {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.green-track-empty {
  color: var(--muted);
  text-align: center !important;
}

.green-track-stock-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--accent2);
  font: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(130, 110, 220, 0.45);
  text-underline-offset: 2px;
}

.green-track-stock-link:hover {
  color: var(--link-hover);
}

.green-track-price-input {
  width: 100%;
  min-width: 52px;
  max-width: 72px;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--bg2);
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.green-track-price-input:hover {
  border-color: var(--border);
}

.green-track-price-input:focus {
  outline: none;
  border-color: var(--accent2);
  background: var(--bg);
}

.green-track-price-input.manual {
  border-color: rgba(255, 180, 80, 0.45);
  background: rgba(255, 180, 80, 0.08);
}

.green-track-price-input.saving {
  opacity: 0.55;
}

.green-track-profit-cell {
  white-space: nowrap;
}

.monthly-track-content {
  padding: 0 12px 16px;
}

.monthly-track-content .table-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
}

.sim-track-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}

.sim-track-stat {
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
}

.sim-track-stat-label {
  font-size: 11px;
  color: var(--muted, #787776);
  margin-bottom: 4px;
}

.sim-track-stat-value {
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.sim-track-months {
  margin-bottom: 16px;
}

.sim-month-table,
.sim-day-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sim-month-table th,
.sim-month-table td,
.sim-day-table th,
.sim-day-table td {
  padding: 6px 8px;
  border: 1px solid var(--border, #333);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sim-month-table th:first-child,
.sim-month-table td:first-child,
.sim-day-table td:nth-child(1),
.sim-day-table td:nth-child(2),
.sim-day-table td:nth-child(3) {
  text-align: left;
}

.sim-month-table thead th,
.sim-day-table thead th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.sim-month-table .monthly-total-row td {
  font-weight: 600;
}

.sim-month-sub {
  display: none;
}

.sim-day-head td {
  text-align: left !important;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
}

.sim-day-net {
  float: right;
  font-weight: 650;
}

.sim-skip-row td {
  color: var(--muted, #787776);
}

.sim-status-filled { color: var(--muted, #9a9a9a); }
.sim-status-open { color: #60a5fa; }
.sim-status-skipped { color: var(--muted, #787776); }

.sim-mode-green { color: #60a5fa; }
.sim-mode-jw { color: #c084fc; }
.sim-mode-hpqb { color: #f87171; }

.monthly-compare-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.monthly-compare-table th,
.monthly-compare-table td {
  padding: 6px 8px;
  border: 1px solid var(--border, #333);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.monthly-compare-table th:first-child,
.monthly-compare-table td:first-child {
  text-align: left;
}

.monthly-compare-table thead th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.monthly-compare-table .monthly-strategy-head {
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  min-width: 156px;
  border-bottom: 1px solid var(--border, #333);
}

.monthly-compare-table .monthly-strategy-sep {
  border-left: 2px solid rgba(255, 255, 255, 0.22);
  padding-left: 10px;
}

.monthly-compare-table .monthly-strategy-sep-major {
  border-left-width: 3px;
  border-left-color: rgba(255, 255, 255, 0.32);
}

.monthly-compare-table thead .monthly-strategy-sep {
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.08);
}

.monthly-compare-table tbody td.monthly-strategy-sep {
  padding-left: 10px;
}

.monthly-compare-table .monthly-subhead th {
  top: 36px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted, #787776);
}

.monthly-compare-table .monthly-mode-head {
  min-width: 48px;
}

.monthly-compare-table .monthly-month-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--sticky-bg);
  font-weight: 600;
  min-width: 72px;
}

.monthly-compare-table thead .monthly-month-col {
  z-index: 3;
}

.monthly-compare-table .monthly-total-row td {
  font-weight: 600;
}

.monthly-compare-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

.monthly-compare-table tbody tr:hover .monthly-month-col {
  background-color: rgba(255, 255, 255, 0.06);
}

.profit-up { color: var(--red); font-variant-numeric: tabular-nums; }
.profit-down { color: var(--green); font-variant-numeric: tabular-nums; }
.profit-flat { color: var(--muted); font-variant-numeric: tabular-nums; }
.profit-na { color: var(--muted); }

/* 明亮主题补充 */
[data-theme="dark"] #panel-selection .highlight-rank-1 {
  color: #ffd666;
  background: rgba(255, 214, 102, 0.12);
}

[data-theme="dark"] #panel-selection .highlight-rank-3 {
  color: #e8a86b;
  background: rgba(232, 168, 107, 0.12);
}

[data-theme="light"] #stockTable thead th.th-metric-xcjw {
  background: #f3e8ff;
  color: #7e22ce;
}

[data-theme="light"] #stockTable thead th.th-metric-jssb {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="light"] #stockTable thead th.th-metric-cjs {
  background: #dbeafe;
  color: #1d4ed8;
}

[data-theme="light"] #intradayTable thead th.th-metric-xcpzqb {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="light"] #intradayTable thead th.th-metric-xcpzdx {
  background: #dcfce7;
  color: #15803d;
}

[data-theme="light"] #intradayTable thead th.th-metric-xczpqb {
  background: #dbeafe;
  color: #1d4ed8;
}

[data-theme="light"] #intradayTable .metric-xcpzqb { color: #dc2626; }
[data-theme="light"] #intradayTable .metric-xcpzdx { color: #16a34a; }
[data-theme="light"] #intradayTable .metric-xczpqb { color: #2563eb; }

[data-theme="light"] .env-state-rotation {
  color: var(--muted);
}

[data-theme="light"] #stockTable .pct-badge.pos { color: var(--red); }
[data-theme="light"] #stockTable .pct-badge.neg { color: var(--green); }
[data-theme="light"] #stockTable .metric-xcjw { color: #9333ea; }
[data-theme="light"] #stockTable .metric-jsjl { color: #c2410c; }
[data-theme="light"] #stockTable .metric-jssb { color: #dc2626; }
[data-theme="light"] #stockTable .metric-cjs { color: #2563eb; }

[data-theme="light"] .green-track-table .metric-xcjw { color: #9333ea; }
[data-theme="light"] .green-track-table .metric-jssb { color: #dc2626; }
[data-theme="light"] .green-track-table .metric-cjs { color: #2563eb; }

[data-theme="light"] .green-track-table thead th.th-metric-xcjw {
  background: #f3e8ff;
  color: #7e22ce;
}

[data-theme="light"] .green-track-table thead th.th-metric-jssb {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="light"] .green-track-table thead th.th-metric-cjs {
  background: #dbeafe;
  color: #1d4ed8;
}

[data-theme="light"] .date-picker-popover {
  box-shadow: 0 8px 24px var(--shadow);
}

[data-theme="light"] .price-view-filter-btn.is-active {
  box-shadow: 0 0 0 2px #111111;
}

[data-theme="light"] .filter-current-hint:not(.is-empty) {
  color: #b45309;
}

[data-theme="light"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .monthly-compare-table thead th {
  background: var(--bg3);
}

[data-theme="light"] .monthly-compare-table .monthly-strategy-sep {
  border-left-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .monthly-compare-table .monthly-strategy-sep-major {
  border-left-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] tbody tr:hover {
  background: var(--row-hover);
}

[data-theme="light"] .green-track-table tbody tr:hover {
  background: var(--row-hover);
}

.kline-status {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  min-height: 32px;
  flex-shrink: 0;
}
.kline-chart {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.kline-panel.has-intraday .kline-chart {
  flex: 3 1 0;
  min-height: 320px;
}

.kline-intraday-section {
  border-top: 1px solid var(--border);
  flex: 2 1 0;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.kline-intraday-section.hidden {
  display: none;
}

.kline-intraday-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 0;
}

.kline-intraday-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.kline-intraday-close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.kline-intraday-close:hover { color: var(--text); }

.kline-intraday-status {
  padding: 6px 16px;
  font-size: 12px;
  color: var(--muted);
  min-height: 24px;
}

.kline-intraday-chart {
  width: 100%;
  flex: 1 1 auto;
  min-height: 180px;
  height: auto;
}

.kline-panel.is-fullscreen .kline-chart {
  min-height: 0;
}

.kline-panel.is-fullscreen .kline-intraday-section {
  min-height: 0;
}

@media (max-width: 900px) {
  #panel-selection .selection-layout {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
  #panel-selection .table-wrap {
    flex: none;
    max-height: calc(100vh - 280px);
  }
  #panel-selection .sidebar.selection-sidebar {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    max-height: 320px;
  }
  #panel-selection .selection-highlights { flex: none; overflow-y: auto; }
  .sidebar { width: 100%; max-height: 240px; }
}

.th-short { display: none; }
.xc-stock-code { display: none; }
.m-panel-tools,
.m-cols-panel,
.m-sub-panel,
.m-tabbar,
.m-sheet,
.m-market-chrome,
.m-rank-chrome,
.m-track-hub,
.m-mine-panel,
.m-filter-sheet,
.m-stock-cards,
.m-top5-strip,
#panel-m-track,
#panel-m-mine { display: none; }

.admin-sync-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 16px;
}

.admin-sync-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-sync-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.admin-sync-row .input {
  width: auto;
  min-width: 100px;
}

.admin-sync-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 24px;
  flex-wrap: wrap;
}

/* —— 后台策略回测 —— */
.admin-bt-modes {
  display: grid;
  gap: 8px;
  margin: 8px 0 16px;
}
.admin-bt-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 8px 10px;
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
}
.admin-bt-mode-row label.admin-bt-mode-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  margin: 0;
}
.admin-bt-mode-row .admin-bt-mode-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.admin-bt-mode-row .admin-bt-mode-top .input {
  width: 72px;
}
.admin-bt-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 8px;
}
.admin-bt-chart-head h4 {
  margin: 0;
}
.admin-bt-chart-toggles {
  display: inline-flex;
  gap: 8px;
}
.admin-bt-chart-btn.is-active {
  border-color: #38bdf8;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.16);
}
.admin-bt-chart-wrap {
  width: 100%;
  min-height: 340px;
  position: relative;
  overflow: visible;
}
.admin-bt-chart {
  width: 100%;
  height: 340px;
  min-height: 340px;
  border: 1px solid var(--border, #334155);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  position: relative;
  overflow: hidden;
}
/* 只约束 echarts 主画布，不要波及 tooltip */
.admin-bt-chart > div:first-child {
  width: 100% !important;
  height: 100% !important;
}
.admin-bt-fold {
  border: 1px solid var(--border, #334155);
  border-radius: 8px;
  padding: 0;
  background: rgba(15, 23, 42, 0.28);
}
.admin-bt-fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  user-select: none;
}
.admin-bt-fold > summary::-webkit-details-marker { display: none; }
.admin-bt-fold > summary::before {
  content: "▸";
  color: #94a3b8;
  width: 1em;
}
.admin-bt-fold[open] > summary::before { content: "▾"; }
.admin-bt-fold > summary > span:first-of-type {
  font-weight: 600;
  color: var(--text, #e2e8f0);
}
.admin-bt-fold-hint {
  color: var(--muted, #94a3b8);
  font-size: 12px;
}
.admin-bt-fold-count {
  margin-left: auto;
  color: #38bdf8;
  font-size: 12px;
}
.admin-bt-fold .admin-bt-tags {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}
.admin-bt-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.admin-bt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: flex-end;
}
@media (min-width: 1200px) {
  .admin-bt-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    align-items: end;
  }
  .admin-bt-row label {
    min-width: 0;
  }
  .admin-bt-row .input,
  .admin-bt-row select {
    width: 100%;
    min-width: 0;
  }
}
.admin-bt-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.admin-bt-row .input,
.admin-bt-row select {
  min-width: 140px;
}
.admin-bt-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  font-size: 13px;
}
.admin-bt-tags {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-bt-tag-group {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
}
.admin-bt-tag-group-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.admin-bt-result {
  margin-top: 8px;
}
.admin-bt-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 14px;
  margin: 10px 0 16px;
}
.admin-bt-summary-grid > div {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-bt-summary-grid span {
  font-size: 12px;
  color: var(--muted);
}
.admin-bt-summary-grid b {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}
.admin-bt-stock-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--accent2, #8b7cf6);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(130, 110, 220, 0.45);
  text-underline-offset: 2px;
}
.admin-bt-stock-link:hover {
  color: var(--link-hover, #a78bfa);
}
.admin-bt-kline-panel {
  width: min(1280px, 96vw);
  max-height: 92vh;
}
.admin-bt-kline-chart {
  height: min(62vh, 560px);
  min-height: 360px;
}
.admin-bt-kline-mark-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 8px;
}
.admin-bt-kline-mark-stats[hidden] {
  display: none;
}
.admin-bt-kline-stat {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #334155);
  background: var(--bg2, #1a1a1a);
  font-size: 12px;
  color: var(--muted, #9ca3af);
}
.admin-bt-kline-stat strong {
  color: var(--text, #e8e6e3);
  font-weight: 600;
}
.admin-bt-kline-stat .pos { color: #ef4444; }
.admin-bt-kline-stat .neg { color: #22c55e; }
.admin-bt-kline-stat .na { color: var(--muted, #9ca3af); }

.admin-bt-detail-wrap {
  max-height: 420px;
  overflow: auto;
}
#btTradesTable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg2, #1a1a1a);
}
#btTradesTable .admin-bt-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
}
#btTradesTable .admin-bt-sort-btn:hover {
  color: var(--accent2, #8b7cf6);
}
#btTradesTable .admin-bt-sort-btn .admin-bt-sort-ind {
  font-size: 10px;
  opacity: 0.35;
  min-width: 1em;
}
#btTradesTable .admin-bt-sort-btn.is-active .admin-bt-sort-ind {
  opacity: 1;
  color: var(--accent2, #8b7cf6);
}
#btTradesTable td.pos { color: #ef4444; }
#btTradesTable td.neg { color: #22c55e; }

.admin-section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0 20px;
}

/* —— 后台直播频道 —— */
.admin-live-box {
  margin-top: 0;
  padding: 18px 18px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--bg2)) 0%, var(--bg2) 48%);
}

.admin-live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.admin-live-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.admin-live-desc {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.admin-live-date {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.admin-live-date .input {
  min-width: 160px;
  min-height: 40px;
}

.admin-live-paste {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  margin-bottom: 16px;
}

.admin-live-paste-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.admin-live-textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.5;
}

.admin-live-paste-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 10px;
}

.admin-live-paste-tip {
  font-size: 12px;
  color: var(--muted);
}

.admin-live-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-live-slot {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-live-slot.is-filled {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.admin-live-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-live-slot-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.admin-live-slot-badge.is-evening {
  color: #0f766e;
  background: color-mix(in srgb, #14b8a6 16%, transparent);
}

.admin-live-clear-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.admin-live-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.admin-live-field .input {
  width: 100%;
  min-height: 40px;
}

.admin-live-field-pw .input {
  max-width: 160px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.admin-live-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 4px;
}

.admin-live-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-live-raw {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-all;
}

.admin-live-history {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.admin-live-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.admin-live-history-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.admin-live-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-live-history-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.admin-live-hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.admin-live-hist-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.admin-live-hist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-live-hist-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.admin-live-hist-tag.is-evening {
  color: #0f766e;
  background: color-mix(in srgb, #14b8a6 14%, transparent);
}

.admin-live-hist-tag.is-empty {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
}

.admin-live-hist-del {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

@media (max-width: 860px) {
  .admin-live-slots {
    grid-template-columns: 1fr;
  }

  .admin-live-box {
    padding: 14px 12px 12px;
  }

  .admin-live-date {
    width: 100%;
  }

  .admin-live-date .input {
    width: 100%;
  }

  .admin-live-footer-actions .btn-primary,
  .admin-live-footer-actions .btn-secondary,
  .admin-live-paste-actions .btn-primary {
    width: 100%;
  }

  .admin-live-history-head .btn-secondary {
    width: 100%;
  }
}

.admin-expire-user-name {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
}

.admin-expire-date-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.admin-expire-date-input {
  width: 100%;
  min-height: 44px;
  font-size: 16px; /* 避免 iOS 自动放大 */
  padding: 10px 12px;
}

.admin-expire-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.admin-expire-actions .auth-submit,
.admin-expire-actions .btn-secondary {
  width: 100%;
  min-height: 44px;
}

/* —— 管理后台手机适配 —— */
@media (max-width: 768px) {
  .admin-page-header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-page-title {
    font-size: 18px;
  }

  .admin-page-main {
    padding: 12px 12px 32px;
    max-width: none;
  }

  .admin-page-body-inner {
    padding-top: 12px;
  }

  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding: 0 8px;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tab {
    flex: 0 0 auto;
    padding: 10px 12px;
    white-space: nowrap;
    font-size: 13px;
  }

  .admin-gen-row,
  .admin-user-toolbar,
  .admin-modes-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-user-toolbar .input,
  .admin-gen-row .input {
    min-width: 0;
    width: 100%;
  }

  .admin-msg {
    margin-left: 0;
  }

  .admin-check-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-sync-form,
  .admin-ziwei-form {
    flex-direction: column;
    gap: 12px;
  }

  .admin-sync-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .admin-sync-row .input,
  .admin-sync-row select,
  .admin-sync-row input[type="time"],
  .admin-sync-row input[type="number"],
  .admin-sync-row input[type="text"] {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    font-size: 16px;
  }

  .admin-sync-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-sync-actions .btn-primary,
  .admin-sync-actions .btn-secondary {
    width: 100%;
    min-height: 44px;
  }

  .admin-table-wrap,
  .admin-table-wrap-page,
  .admin-users-wrap {
    max-height: none;
    overflow: visible;
  }

  /* 用户管理：表格改为卡片，避免横向挤压与日历裁切 */
  .admin-users-table thead {
    display: none;
  }

  .admin-users-table,
  .admin-users-table tbody,
  .admin-users-table tr,
  .admin-users-table td {
    display: block;
    width: 100%;
  }

  .admin-users-table tr.admin-user-row {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .admin-users-table td {
    border: none;
    padding: 6px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
  }

  .admin-users-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    min-width: 3.5em;
  }

  .admin-users-table td.admin-user-actions {
    flex-direction: column;
    align-items: stretch;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
  }

  .admin-users-table td.admin-user-actions::before {
    margin-bottom: 6px;
  }

  .admin-user-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .admin-user-actions .btn-secondary,
  .admin-user-actions .btn-danger {
    width: 100%;
    min-height: 40px;
    font-size: 13px;
    padding: 8px 10px;
  }

  .admin-user-actions .btn-danger {
    grid-column: 1 / -1;
  }

  /* 其他宽表同样横向可滚，避免整页被撑破 */
  .admin-table-wrap-page:not(.admin-users-wrap) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-mobile-modal {
    width: calc(100vw - 24px);
    max-width: none;
    max-height: min(92vh, 100%);
    margin: 12px auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-mobile-modal .modal-body {
    padding: 14px 16px 20px;
    overflow: visible;
  }

  .admin-mobile-modal .auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .admin-mobile-modal .auth-form input {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .modal {
    align-items: flex-start;
    padding: 8px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* —— 直播频道 —— */
.live-channel-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 4px 24px;
}

.live-channel-header {
  margin-bottom: 16px;
}

.live-channel-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.live-channel-hint,
.live-channel-date {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.live-channel-howto {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg2));
}

.live-channel-howto-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.live-channel-howto-list {
  margin: 0;
  padding-left: 1.25em;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}

.live-channel-howto-list li + li {
  margin-top: 2px;
}

.live-channel-howto-list strong {
  font-weight: 700;
  color: var(--accent);
}

.live-channel-cards {
  display: grid;
  gap: 12px;
}

.live-channel-card {
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 12px;
  padding: 16px;
}

.live-channel-card.is-empty {
  opacity: 0.85;
}

.live-channel-card-badge {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 600;
}

.live-channel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.live-channel-card-head .live-channel-card-badge {
  margin-bottom: 0;
}

.live-channel-card-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.live-channel-summary-body {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  word-break: break-word;
}

.admin-live-summary {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
}

.admin-live-summary.is-filled {
  border-color: color-mix(in srgb, var(--accent, #3b82f6) 45%, var(--border));
}

.admin-live-slot-badge.is-summary {
  background: color-mix(in srgb, #5b8def 22%, transparent);
  color: #8bb4ff;
}

.live-channel-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.live-channel-card-link:hover {
  filter: brightness(1.05);
}

.live-channel-password-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 8px;
}

.live-channel-password-label {
  font-size: 13px;
  color: var(--muted);
}

.live-channel-password-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.live-channel-copy-pw-btn {
  margin-left: auto;
  min-height: 36px;
}

.live-channel-wechat-tip {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.live-channel-qr-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 12px;
}

.live-channel-qr {
  width: 200px;
  height: 200px;
  display: block;
}

.live-channel-qr-fallback {
  color: #666;
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

.live-channel-card-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.live-channel-card-actions .btn-primary {
  width: 100%;
  min-height: 44px;
}

.live-channel-hist-open {
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.live-channel-hist-open:hover {
  text-decoration: underline;
}

.live-channel-qr-modal .btn-primary {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
}

.live-channel-card-url {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.4;
}

.live-channel-card-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.live-channel-history {
  margin-top: 24px;
}

.live-channel-hist-title {
  margin: 0 0 10px;
  font-size: 15px;
}

.live-channel-hist-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.live-channel-hist-row a {
  color: var(--accent);
}

.live-channel-hist-row .muted {
  color: var(--muted);
}

@media (max-width: 768px) {
  html.is-mobile #panel-livechannel.active {
    flex: 1 1 0%;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .live-channel-panel {
    padding: 12px 8px 28px;
  }

  .live-channel-card-link {
    width: 100%;
  }
}

/* Mobile APP styles: see mobile.css */

/* IE10/11：gap 无效、flex 子项 width:auto 不会撑满，右侧会出现大块空白 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  html,
  body,
  #mainApp,
  main,
  .panel.active,
  #panel-selection .selection-layout,
  #panel-selection .content,
  #panel-intraday .content,
  .toolbar,
  .table-wrap {
    width: 100%;
    max-width: 100%;
  }

  .header {
    display: -ms-flexbox;
    -ms-flex-align: center;
    -ms-flex-pack: justify;
  }

  #panel-selection .selection-layout {
    display: -ms-flexbox;
    -ms-flex-align: stretch;
  }

  #panel-selection .sidebar.selection-sidebar {
    -ms-flex: 0 0 280px;
    margin-right: 16px;
  }

  #panel-selection .content,
  #panel-intraday .content {
    display: -ms-flexbox;
    -ms-flex-direction: column;
    -ms-flex: 1 1 0px;
  }

  #panel-selection .table-wrap,
  #panel-intraday .table-wrap {
    -ms-flex: 1 1 0px;
    width: 100%;
  }

  table {
    width: 100%;
  }
}

/* 今日精算 */
#panel-jingsuan.active {
  overflow: hidden;
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - 88px);
  height: calc(100vh - var(--header-h) - 32px);
}
.jingsuan-layout {
  --intraday-list-pct: var(--xc-jingsuan-split, 62);
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  gap: 0;
  width: 100%;
}
.jingsuan-main {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc(var(--intraday-list-pct) * 1%);
  width: calc(var(--intraday-list-pct) * 1%);
  min-width: 280px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.jingsuan-wrap {
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 12px;
}
.jingsuan-layout.is-resizing {
  cursor: col-resize;
  user-select: none;
}
.jingsuan-layout.is-resizing iframe,
.jingsuan-layout.is-resizing canvas {
  pointer-events: none;
}
.jingsuan-layout.is-resizing .intraday-split-handle::before {
  background: rgba(236, 128, 141, 0.85);
}
@media (max-width: 900px) {
  .jingsuan-layout {
    flex-direction: column;
  }
  .jingsuan-main {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }
  #panel-jingsuan .intraday-split-handle {
    display: none;
  }
  #panel-jingsuan .intraday-chart-dock {
    flex: 0 0 auto;
    width: 100%;
    height: min(280px, 36vh);
  }
}
.jingsuan-section-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.jingsuan-section-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.jingsuan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 18px 20px;
  align-items: start;
}
.jingsuan-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.jingsuan-card-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.jingsuan-card-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.jingsuan-card-count::before { content: "×"; }
.jingsuan-card-body {
  flex: 1 1 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  overflow: visible;
}
/* 单模式仅 1 只：卡片别拉太宽 */
.jingsuan-cards.is-single-mode .jingsuan-card[data-stock-count="1"] .jingsuan-card-body {
  max-width: 560px;
}
/* 股票很多时卡内再分列；少量保持纵向，信息一行一行看全 */
.jingsuan-card.is-multi-stock .jingsuan-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 16px;
  align-content: start;
}
.jingsuan-card.is-dense-stock .jingsuan-card-body {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 12px;
}
.jingsuan-cards.is-single-mode .jingsuan-card.is-multi-stock .jingsuan-card-body {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.jingsuan-stock-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main time"
    "metrics metrics"
    "foot foot";
  align-items: start;
  gap: 10px 14px;
  padding: 10px 4px;
  min-width: 0;
}
.jingsuan-stock-block + .jingsuan-stock-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dotted rgba(255, 255, 255, 0.14);
}
.jingsuan-card.is-multi-stock .jingsuan-stock-block {
  margin-top: 0;
  padding: 10px 6px;
  border-radius: 6px;
}
.jingsuan-card.is-multi-stock .jingsuan-stock-block + .jingsuan-stock-block {
  margin-top: 0;
  padding-top: 10px;
  border-top: 0;
}
.jingsuan-stock-block.is-clickable {
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.jingsuan-stock-block.is-clickable:hover {
  background: rgba(255, 255, 255, 0.04);
}
.jingsuan-stock-block.is-clickable:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #3b82f6) 70%, transparent);
  outline-offset: 2px;
}
.jingsuan-stock-block.is-chart-active {
  outline: 1px solid rgba(236, 128, 141, 0.55);
  background: rgba(236, 128, 141, 0.12);
}
[data-theme="light"] .jingsuan-stock-block.is-clickable:hover {
  background: rgba(15, 23, 42, 0.04);
}
.jingsuan-stock-main {
  grid-area: main;
  min-width: 0;
}
.jingsuan-stock {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  word-break: break-all;
}
.jingsuan-time {
  grid-area: time;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  padding-top: 2px;
}
.jingsuan-metrics {
  grid-area: metrics;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
  min-width: 0;
  overflow: visible;
}
.jingsuan-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.jingsuan-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5em;
  padding: 1px 6px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 3px;
  border: 1px solid;
  background: transparent;
}
.jingsuan-tag-open {
  color: #4ea1ff;
  border-color: #4ea1ff;
}
.jingsuan-tag-pct {
  color: #b388ff;
  border-color: #b388ff;
}
.jingsuan-tag-pnl {
  color: #ff9f43;
  border-color: #ff9f43;
}
.jingsuan-val {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.jingsuan-val.flat { color: var(--muted); }
.jingsuan-card-foot {
  grid-area: foot;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  word-break: break-word;
  white-space: normal;
  overflow: visible;
}
.jingsuan-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}
[data-theme="light"] .jingsuan-card-body {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .jingsuan-stock-block + .jingsuan-stock-block {
  border-top-color: rgba(0, 0, 0, 0.12);
}

/* —— 交易铁律 —— */
.trading-rules-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}
.trading-rules-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.trading-rules-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.trading-rules-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.trading-rules-intro {
  margin: 0 0 22px;
  padding: 12px 14px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.55;
  color: #ef4444;
  letter-spacing: 0.01em;
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 0 8px 8px 0;
}
.trading-rules-section {
  margin: 0 0 28px;
}
.trading-rules-section-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 650;
  color: var(--text);
}
.trading-rules-p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
}
.trading-rules-figure {
  margin: 14px 0 18px;
  padding: 0;
}
.trading-rules-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.trading-rules-figure figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.trading-rules-disclaimer {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
html.is-mobile .trading-rules-page {
  padding: 4px 12px 88px;
}
html.is-mobile .trading-rules-title {
  font-size: 20px;
}
html.is-mobile .trading-rules-intro {
  font-size: 17px;
  padding: 10px 12px;
  margin-bottom: 18px;
}
html.is-mobile .trading-rules-section-title {
  font-size: 16px;
}
html.is-mobile .trading-rules-p {
  font-size: 14px;
  line-height: 1.7;
}

/* ===== 大盘看盘（开盘啦）——与站点风格统一 ===== */
#panel-watch.active {
  display: block;
  overflow: auto;
  padding: 0;
  min-height: calc(100vh - var(--header-h, 56px));
  background: var(--bg);
}

.watch-shell {
  --watch-up: var(--red);
  --watch-down: var(--green);
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 16px 28px;
  color: var(--text);
}

.watch-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.watch-brand {
  min-width: 0;
}

.watch-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.watch-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.watch-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.watch-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(82, 65, 159, 0.35);
  color: var(--link-hover, #c4b5fd);
  font-size: 12px;
  background: rgba(82, 65, 159, 0.12);
}

.watch-live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent2);
}

.watch-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  grid-template-areas:
    "breadth live live"
    "plates hot news"
    "pool pool pool";
  gap: 12px;
  align-items: stretch;
}

.watch-breadth { grid-area: breadth; }
.watch-live { grid-area: live; }
.watch-plates { grid-area: plates; }

.watch-plate-table {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.watch-plate-head,
.watch-plate-row {
  display: grid;
  grid-template-columns: minmax(52px, 1.15fr) 54px 44px 58px 48px 56px;
  gap: 4px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.watch-plate-head {
  flex-shrink: 0;
  padding: 0 4px 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.watch-plate-body {
  overflow: auto;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.watch-plate-row {
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.watch-plate-row:hover {
  border-color: var(--border);
  background: var(--row-hover);
}

.watch-plate-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-plate-code {
  color: var(--muted);
  font-size: 11px;
}

.watch-plate-num {
  text-align: right;
}

.watch-plate-amt {
  text-align: right;
  color: var(--text-secondary);
  font-size: 11px;
}

.watch-plate-num.is-up { color: var(--watch-up); }
.watch-plate-num.is-down { color: var(--watch-down); }
.watch-plate-num.is-flat { color: var(--muted); }

@media (max-width: 760px) {
  .watch-plate-head,
  .watch-plate-row {
    grid-template-columns: minmax(48px, 1fr) 48px 40px 52px 44px 52px;
    gap: 2px;
    font-size: 11px;
  }
}
.watch-hot { grid-area: hot; }
.watch-news { grid-area: news; }
.watch-pool { grid-area: pool; }

.watch-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  padding: 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.watch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -12px -12px 12px;
  padding: 10px 12px;
  background: var(--panel-head-bg);
  border-bottom: 1px solid var(--panel-head-border);
  flex-shrink: 0;
}

.watch-card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.watch-card-tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  background: var(--bg3);
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-breadth-hero {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.watch-breadth-stat {
  text-align: center;
}

.watch-breadth-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.watch-breadth-stat strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.1;
}

.watch-breadth-stat.is-up strong { color: var(--watch-up); }
.watch-breadth-stat.is-down strong { color: var(--watch-down); }

.watch-breadth-meter {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border);
}

.watch-breadth-meter-up {
  background: var(--watch-up);
  width: 50%;
  transition: width 0.35s ease;
}

.watch-breadth-meter-down {
  background: var(--watch-down);
  width: 50%;
  transition: width 0.35s ease;
}

.watch-limit-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.watch-limit-chip {
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-secondary);
}

.watch-limit-chip b {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.watch-limit-chip.is-up { color: var(--watch-up); }
.watch-limit-chip.is-up b { color: var(--watch-up); }
.watch-limit-chip.is-down { color: var(--watch-down); }
.watch-limit-chip.is-down b { color: var(--watch-down); }
.watch-limit-chip.is-flat { color: var(--muted); }

.watch-buckets {
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  gap: 2px;
  align-items: end;
  height: 52px;
  margin-top: auto;
}

.watch-bucket {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.watch-bucket span {
  display: block;
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: var(--muted);
  opacity: 0.35;
  transition: height 0.3s ease;
}

.watch-bucket.is-up span { background: var(--watch-up); opacity: 0.85; }
.watch-bucket.is-down span { background: var(--watch-down); opacity: 0.85; }
.watch-bucket.is-flat span { background: var(--muted); opacity: 0.45; }

.watch-capacity-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.watch-muted { color: var(--muted); }

.watch-capacity-chart {
  height: 88px;
  width: 100%;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
}

.watch-live-feed {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.watch-live-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
}

.watch-live-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.watch-live-user {
  font-size: 11px;
  color: var(--accent2);
  margin-bottom: 2px;
}

.watch-live-text {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.watch-live-stocks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.watch-live-stock {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.watch-live-stock.up { color: var(--watch-up); }
.watch-live-stock.down { color: var(--watch-down); }

.watch-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 340px;
  overflow: auto;
}

.watch-list.is-dense { max-height: 280px; }

.watch-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.watch-row:hover {
  border-color: var(--border);
  background: var(--row-hover);
}

.watch-row-idx {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.watch-row-name {
  font-size: 13px;
  font-weight: 600;
}

.watch-row-sub {
  font-size: 11px;
  color: var(--muted);
}

.watch-row-pct {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.watch-row-pct.is-up { color: var(--watch-up); }
.watch-row-pct.is-down { color: var(--watch-down); }
.watch-row-pct.is-flat { color: var(--muted); }

.watch-news-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 340px;
  overflow: auto;
}

.watch-news-item {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
}

.watch-news-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.watch-news-title {
  font-size: 13px;
  line-height: 1.45;
}

.watch-pool-plates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.watch-pool-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text-secondary);
}

.watch-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.watch-gate-wrap {
  max-width: 520px;
  margin: 48px auto;
}

@media (max-width: 1100px) {
  .watch-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "breadth live"
      "plates hot"
      "news pool";
  }
}

@media (max-width: 760px) {
  .watch-shell { padding: 10px 10px 88px; }
  .watch-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .watch-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "breadth"
      "live"
      "plates"
      "hot"
      "news"
      "pool";
  }
  .watch-breadth-stat strong { font-size: 24px; }
  .watch-live-feed { max-height: 240px; }
}

/* 盘中起爆实盘配置 */
.pzqb-trade-title { font-size: 1.1rem; margin: 0 8px 0 0; }
.pzqb-trade-hint { color: var(--muted, #8b9bb4); font-size: 13px; margin: 8px 16px; line-height: 1.5; }
.pzqb-trade-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 14px; padding: 8px 16px 16px; }
.pzqb-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.pzqb-field input[type=checkbox] { width: auto; margin-right: 6px; }
.pzqb-trade-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 720px) {
  .pzqb-trade-form { grid-template-columns: 1fr 1fr; }
}
