:root {
  --void: #06080d;
  --bg: #0a0e14;
  --text: #e8edf4;
  --text-secondary: #8b97a8;
  --text-tertiary: #5c6778;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --mint: #059669;
  --rose: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --max-w: min(96vw, 1680px);
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-brand: "STKaiti", "KaiTi", "Microsoft YaHei", serif;

  /* card scope — soft gray, not pure white */
  --card-bg: #e4e7ed;
  --card-muted: #d8dce4;
  --card-text: #1a1f28;
  --card-text-2: #4a5260;
  --card-text-3: #7a8494;
  --card-border: #c8ced8;
  --card-border-strong: #b0b8c4;
  --card-input: #eef0f4;
}

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

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--void);
  color: var(--text);
  min-height: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Background (unchanged) ── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56, 189, 248, 0.1), transparent 55%),
    radial-gradient(ellipse 55% 42% at 82% 18%, rgba(99, 102, 241, 0.07), transparent 52%),
    radial-gradient(ellipse 48% 38% at 18% 62%, rgba(52, 211, 153, 0.06), transparent 48%),
    linear-gradient(180deg, #06080d 0%, #0a0e14 40%, #080b10 100%);
  animation: ambient-breathe 28s ease-in-out infinite;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: ambient-glow-drift 22s ease-in-out infinite;
}

.glow-ice {
  width: 520px;
  height: 520px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 70%);
}

.glow-mint {
  width: 480px;
  height: 480px;
  top: 30%;
  right: -100px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.14), transparent 70%);
  animation-delay: -7s;
}

.glow-rose {
  width: 400px;
  height: 400px;
  bottom: 5%;
  left: 25%;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.12), transparent 70%);
  animation-delay: -14s;
}

@keyframes ambient-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.06); }
}

@keyframes ambient-glow-drift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.48; }
  33% { transform: translate(1.5%, -1%) scale(1.04); opacity: 0.58; }
  66% { transform: translate(-1%, 1.5%) scale(0.98); opacity: 0.52; }
}

@media (prefers-reduced-motion: reduce) {
  .ambient,
  .ambient-glow {
    animation: none;
  }
}

.app {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* ── Brand header ── */
.brand-header {
  text-align: center;
  padding: 48px 0 40px;
}

.bagua-logo-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
}

.bagua-logo-spin {
  position: relative;
  z-index: 2;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: drop-shadow(0 0 20px rgba(94, 184, 232, 0.2));
}

.logo-halo {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 184, 232, 0.15), transparent 70%);
  animation: pulse 3.5s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.45; transform: scale(1.05); }
}

.title-main {
  font-family: var(--font-brand);
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: normal;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: var(--text);
}

.brand-sub {
  margin-top: 12px;
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--text-tertiary);
  font-family: var(--font-brand);
}

/* ── Cards: white surface, dark text ── */
.main { display: flex; flex-direction: column; gap: 24px; }

.surface,
.empty-state {
  --text: var(--card-text);
  --text-secondary: var(--card-text-2);
  --text-tertiary: var(--card-text-3);
  --border: var(--card-border);
  --border-strong: var(--card-border-strong);
  --bg: var(--card-muted);
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.18);
}

.surface {
  border-radius: var(--radius);
}

.surface-head { padding: 28px 32px 0; }
.surface-head.compact { padding: 22px 28px 0; }

.surface-head h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.surface-head p {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.surface-body { padding: 24px 28px 28px; font-size: 0.875rem; }

/* ── Input split card ── */
.input-surface {
  max-width: 640px;
  margin: 0 auto;
  transition: max-width 0.35s ease;
}

.input-surface.is-expanded {
  max-width: 100%;
}

.input-split {
  display: grid;
  grid-template-columns: 1fr;
}

.input-split.is-expanded {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 0;
}

.input-col {
  border-right: none;
}

.input-split.is-expanded .input-col {
  border-right: 1px solid var(--card-border);
}

.summary-col {
  display: none;
  flex-direction: column;
  padding: 20px 24px;
  background: transparent; /* 与左侧 surface 同底，避免右下角色差 */
  justify-content: flex-start;
  align-self: stretch;
  height: auto;
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.input-split.is-expanded .summary-col {
  display: flex;
}

.summary-head {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--card-text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}

.quick-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
  flex: 0 0 auto;
}

.quick-empty {
  grid-column: 1 / -1;
  color: var(--card-text-3);
  font-size: 0.82rem;
  text-align: center;
  padding: 48px 0;
}

.quick-item {
  padding: 12px 14px;
  background: var(--card-input);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
}

.quick-item.is-wide {
  grid-column: 1 / -1;
}

.quick-value.is-codes {
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

.ai-codes-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  align-items: center;
}

.ai-code-chip {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.28);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.hunt-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.hunt-kpi {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 255, 255, 0.9);
}

.hunt-kpi span {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
}

.hunt-kpi strong {
  display: block;
  font-size: 1.05rem;
  margin-top: 0.15rem;
  color: #0f172a;
}

.hunt-kpi em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.1rem;
}

@media (max-width: 900px) {
  .hunt-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.quick-label {
  font-size: 0.72rem;
  color: var(--card-text-3);
  margin-bottom: 6px;
}

.quick-label .you-qi-tag,
.quick-summary .you-qi-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: #9a3412;
  background: rgba(251, 146, 60, 0.22);
  border: 1px solid rgba(234, 88, 12, 0.35);
}

.quick-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--card-text);
  letter-spacing: 0.06em;
  font-family: "SF Mono", Consolas, monospace;
}

.quick-hint {
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--card-text-3);
}

.date-row {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 12px;
  padding: 28px 32px 0;
}

.date-field {
  display: flex;
  align-items: center;
  background: var(--card-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.date-trigger {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--card-text-2);
  padding: 0;
}

.date-trigger:hover { color: var(--card-text); }

.date-field input[type="date"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 10px 12px 10px 0;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.date-field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: none;
  width: 0;
  height: 0;
  pointer-events: none;
}

.field-minute input {
  text-align: center;
}

.ymdh-row {
  display: grid;
  grid-template-columns: 42px repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  padding: 28px 32px 0;
}

.ymdh-row > .date-trigger {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-input);
  margin-bottom: 0;
}

.ymdh-row > .date-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
}

.ai-formula-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 16px 32px 0;
  padding: 12px 14px;
  background: var(--card-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--card-text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.ai-formula-label {
  flex-shrink: 0;
  color: var(--card-text-2);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.ai-formula-value {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  font-family: ui-monospace, "Cascadia Code", "Sarasa Mono SC", Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--card-text);
  background: transparent;
  padding: 0;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
}

.ai-formula-line {
  display: block;
  line-height: 1.4;
}

.ai-formula-value .calc-delta {
  color: #2563eb;
  font-weight: 700;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.input-col .form-grid {
  grid-template-columns: repeat(2, 1fr);
  padding: 16px 32px 0;
}

.input-col .actions {
  padding: 24px 32px 28px;
}

.input-col .error {
  margin: 0 32px 24px;
}

/* ── Form ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
  padding: 28px 32px 0;
}

.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  background: var(--card-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--font);
  text-align: center;
  transition: border-color 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--border-strong);
}

.field-wide { grid-column: 1 / -1; text-align: center; padding-top: 4px; }

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
}

.check-label input { accent-color: var(--accent); width: auto; }

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 28px 32px 32px;
}

.btn {
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--card-text);
  color: #fff;
  border: 1px solid var(--card-text);
  min-width: 132px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover { background: #1f2937; border-color: #1f2937; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  background: var(--card-bg);
  color: var(--card-text-2);
  border: 1px solid var(--card-border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  color: var(--card-text);
  border-color: var(--card-border-strong);
  background: var(--card-muted);
}

.error {
  margin: 0 32px 24px;
  padding: 11px 16px;
  background: #e8d4d6;
  border: 1px solid #d4a8ad;
  color: var(--rose);
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.error.hidden { display: none; }

.hidden { display: none !important; }
.field-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
}
.field-hint.hidden { display: none; }

/* ── Empty ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  font-size: 0.85rem;
}
.empty-state.hidden { display: none; }

/* ── Results ── */
.results { display: flex; flex-direction: column; gap: 24px; }
.results.hidden { display: none; }

.results-grid { display: grid; gap: 24px; }
.results-top { grid-template-columns: 1fr 1fr; }
.results-pred { grid-template-columns: repeat(4, 1fr); }

/* ── Bazi ── */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.meta-row span { color: var(--text-tertiary); }

.bazi-highlight {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 14px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.lunar-line {
  padding-bottom: 14px;
  margin-bottom: 0;
  font-size: 0.88rem;
  color: var(--card-text);
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.bazi-highlight strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* ── 四柱竖排表 ── */
.bazi-chart {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.82rem;
}

.bazi-chart th,
.bazi-chart td {
  border: 1px solid var(--card-border);
  text-align: center;
  vertical-align: middle;
  padding: 8px 6px;
}

.bazi-chart thead th {
  background: var(--card-muted);
  font-weight: 600;
  color: var(--card-text);
  font-size: 0.78rem;
}

.bazi-label-col,
.bz-row-label {
  width: 44px;
  background: var(--card-muted);
  color: var(--card-text-3);
  font-size: 0.68rem;
  font-weight: 500;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.12em;
  padding: 10px 4px !important;
}

.bazi-chart tbody td {
  color: var(--card-text-secondary);
}

.bazi-chart .bz-day-col {
  background: rgba(37, 99, 235, 0.06);
}

.bz-kong-tag {
  display: block;
  font-style: normal;
  font-size: 0.62rem;
  color: var(--rose);
  margin-top: 2px;
}

.bz-row-main td {
  padding: 12px 6px;
}

.bz-gan,
.bz-zhi {
  display: inline-block;
  font-family: var(--font-brand);
  font-weight: 700;
  line-height: 1;
}

.bz-gan { font-size: 1.65rem; letter-spacing: 0.05em; }
.bz-zhi { font-size: 1.65rem; letter-spacing: 0.05em; }

.el-mu { color: #059669; }
.el-huo { color: #dc2626; }
.el-tu { color: #b45309; }
.el-jin { color: #475569; }
.el-shui { color: #2563eb; }

.bz-hide-cell {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 4px;
  min-height: 32px;
  line-height: 1.4;
}

.bz-hide-item {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 2px;
  white-space: nowrap;
}

.bz-hide-gan {
  font-family: var(--font-brand);
  font-size: 0.92rem;
  font-weight: 600;
}

.bz-hide-god {
  font-size: 0.72rem;
  color: var(--card-text-3);
}

.bz-hide-qi {
  font-size: 0.62rem;
  color: var(--card-text-3);
  opacity: 0.85;
}

.bz-hide-sep {
  color: var(--card-text-3);
  opacity: 0.45;
  font-size: 0.72rem;
  margin: 0 1px;
}

.bz-qi-main .bz-hide-gan { font-size: 0.98rem; }

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.pillar {
  text-align: center;
  padding: 16px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pillar-kong { border-color: #c9a0a5; background: #ddd0d2; }

.pillar em {
  display: block;
  font-style: normal;
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.pillar strong {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.08em;
}

.pillar-god {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pillar-sub {
  margin-top: 5px;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  line-height: 1.5;
}

.stat-block { margin-bottom: 18px; }

.stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.74rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.chip em { font-style: normal; color: var(--text-tertiary); margin-left: 4px; }

.bazi-note {
  padding: 14px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  line-height: 1.7;
}

/* ── Hexagram ── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.calc-card {
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.calc-card-label {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.calc-card-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.calc-card-detail {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.calc-rules {
  padding: 12px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.8;
}

.hex-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.hex-tag {
  padding: 4px 10px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.hex-tag-youhun {
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.12);
}

.hex-tag-guihun {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
}

.hex-duo {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hex-panel {
  flex: 1;
  min-width: 260px;
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hex-name {
  padding: 10px 16px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border-bottom: none;
}

.rules-yao-panel .hex-name {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.hex-name-sub {
  padding: 0 16px 10px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.rules-yao-panel .hex-name-sub {
  /* 有副标题时，标题本身不再画底边 */
  margin-top: -1px;
}

.rules-yao-panel:has(.hex-name-sub) .hex-name {
  border-bottom: none;
  padding-bottom: 8px;
}

.hex-arrow {
  align-self: center;
  font-size: 1.1rem;
  color: var(--text-tertiary);
}

.liuyao-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.liuyao-table th {
  padding: 9px 6px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.liuyao-table td {
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.liuyao-table tr:last-child td { border-bottom: none; }

.cell-pos { color: var(--text-tertiary); font-size: 0.7rem; }
.cell-god { color: var(--text-secondary); }
.cell-qin { color: var(--text); }
.cell-najia { color: var(--text-secondary); font-size: 0.76rem; }

.yao-line {
  display: inline-block;
  width: 44px;
  height: 6px;
  border-radius: 1px;
  vertical-align: middle;
}

.yao-yang { background: var(--text); }

.yao-yin {
  background: transparent;
  position: relative;
}

.yao-yin::before,
.yao-yin::after {
  content: "";
  position: absolute;
  top: 0;
  width: 18px;
  height: 6px;
  border-radius: 1px;
  background: var(--text);
}

.yao-yin::before { left: 0; }
.yao-yin::after { right: 0; }

.tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin: 0 1px;
}

.liuyao-table tr.row-moving td {
  background: rgba(37, 99, 235, 0.14);
  border-top: 1px solid rgba(37, 99, 235, 0.28);
  border-bottom: 1px solid rgba(37, 99, 235, 0.28);
}

.liuyao-table tr.row-moving .cell-pos,
.liuyao-table tr.row-moving .cell-qin,
.liuyao-table tr.row-moving .cell-najia {
  color: #1e40af;
  font-weight: 600;
}

.liuyao-table tr.row-moving .tag-dong {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.12);
}

.tag-shi { color: var(--mint); border: 1px solid #a7f3d0; }
.tag-ying { color: var(--accent); border: 1px solid #bfdbfe; }
.tag-dong { color: var(--rose); font-size: 0.88rem; }

/* ── Predictions ── */
.pred-meta {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pred-meta b { color: var(--text); font-weight: 600; }

.tier {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.tier:last-child { border-bottom: none; }

.tier-k {
  min-width: 2.5em;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.tier-v {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

.hint {
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

/* ── Site footer ── */
.site-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(10, 14, 20, 0.6) 0%, #070a0f 100%);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
}

.site-footer-inner {
  width: var(--max-w);
  margin: 0 auto;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.site-footer-brand {
  display: none;
}

.site-footer-logo {
  font-family: var(--font-brand);
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: var(--text);
}

.site-footer-tagline {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.site-footer-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

/* 主导航：未选描边淡字；选中浅底深字（黑底高对比） */
.site-footer-link {
  box-sizing: border-box;
  min-width: 6.75rem;
  width: 6.75rem;
  height: 2.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.42);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.site-footer-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(248, 250, 252, 0.55);
}

.site-footer-link.is-active {
  color: #0f172a;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  border-color: #fff;
  font-weight: 780;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 4px 14px rgba(0, 0, 0, 0.35);
}

.site-footer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 0.68rem;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}

.site-footer-dot {
  opacity: 0.5;
}

/* ── 独立子页：与首页同壳、全宽自适应 ── */
.brand-header-compact {
  padding: 28px 0 20px;
}

.bagua-logo-wrap-sm {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
}

.bagua-logo-wrap-sm .bagua-logo-spin {
  width: 56px;
  height: 56px;
}

.page-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.page-desc {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

/* 规则页：浅色 surface，铺满 .app 宽度 */
.rules-surface {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}

.rules-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-muted);
}

.rules-nav-tier {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
}

.rules-nav-tier-parent {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--card-border);
}

.rules-nav-tier-child {
  position: relative;
  padding-left: 28px;
  background: #fff;
}

.rules-nav-tier-child::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: #cbd5e1;
}

.rules-nav-label {
  flex: 0 0 auto;
  min-width: 3.2rem;
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #94a3b8;
  text-transform: none;
}

.rules-nav-label-group {
  display: block;
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0;
  max-width: 4.5rem;
  line-height: 1.25;
}

.rules-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.rules-nav-empty {
  font-size: 0.74rem;
  color: var(--card-text-3, #94a3b8);
}

.rules-tab {
  padding: 7px 13px;
  font-size: 0.74rem;
  border-radius: 999px;
  border: 1px solid var(--card-border-strong);
  background: var(--card-bg);
  color: var(--card-text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.rules-tab-parent {
  font-weight: 650;
  padding: 9px 18px;
  font-size: 0.84rem;
  border-radius: 10px;
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.rules-tab-child {
  font-size: 0.72rem;
  padding: 6px 12px;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.rules-tab:hover {
  color: var(--card-text);
  border-color: #94a3b8;
}

.rules-tab-parent.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.rules-tab-child.active {
  background: #334155;
  border-color: #334155;
  color: #fff;
  box-shadow: 0 4px 12px rgba(51, 65, 85, 0.22);
}

.rules-tab-year {
  font-size: 0.7rem;
  padding: 5px 11px;
  background: #fff;
  border-color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.rules-tab-year.active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
  box-shadow: 0 3px 10px rgba(30, 58, 95, 0.2);
}

.rules-nav-tier-child .rules-nav-label,
.rules-nav-tier-year .rules-nav-label {
  color: #64748b;
}

.rules-nav-tier-year {
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
  margin-top: 2px;
}

.rules-year-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1e3a5f;
  background: #e8eef5;
  border-radius: 6px;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .rules-nav-tier {
    flex-direction: column;
    gap: 8px;
  }

  .rules-nav-tier-child,
  .rules-nav-tier-year {
    padding-left: 18px;
  }

  .rules-nav-label {
    margin-top: 0;
  }

  .rules-nav-label-group {
    display: inline;
    margin-left: 0.35rem;
  }
}

.rules-body {
  padding: 20px 24px 28px;
  color: var(--card-text);
}

.rules-loading,
.rules-error {
  color: var(--card-text-2);
  font-size: 0.9rem;
}

.rules-section { margin-bottom: 24px; }

.rules-text h3,
.rules-table-wrap h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--card-text);
}

.rules-text ul {
  margin: 0 0 8px;
  padding-left: 1.2em;
  color: var(--card-text-2);
  font-size: 0.86rem;
  line-height: 1.7;
}

.rules-fold-bar {
  display: flex;
  justify-content: center;
  margin: 0.55rem 0 0.25rem;
}

.rules-table tr.rules-row-extra.is-folded {
  display: none;
}

.page-rules .btn-stone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  border-radius: 8px;
  color: #1e293b;
  border: 1px solid rgba(100, 116, 139, 0.55);
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 55%, #cbd5e1 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
  cursor: pointer;
}

.page-rules .btn-stone:hover {
  filter: brightness(1.03);
}

.rules-yao-grid {
  display: grid;
  grid-template-columns: repeat(var(--rules-yao-cols, 4), minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  margin-bottom: 1.25rem;
}

.rules-yao-panel {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.rules-yao-panel .hex-name {
  font-size: 0.72rem;
  padding: 8px 6px;
}

.rules-yao-panel .hex-name-sub {
  font-size: 0.62rem;
  padding: 0 6px 6px;
}

.rules-yao-panel .liuyao-table {
  font-size: 0.68rem;
}

.rules-yao-panel .liuyao-table th,
.rules-yao-panel .liuyao-table td {
  padding: 5px 4px;
}

.rules-yao-panel .yao-line {
  width: 32px;
  height: 5px;
}

.rules-yao-panel .yao-yin::before,
.rules-yao-panel .yao-yin::after {
  width: 12px;
  height: 5px;
}

@media (max-width: 1400px) {
  .rules-yao-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .rules-yao-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .rules-yao-grid {
    grid-template-columns: 1fr;
  }
}

.rules-subtable {
  margin: 1rem 0 1.25rem;
}

.rules-subtitle {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--card-text-2);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.rules-sec-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--card-text-3);
}

.rules-meta {
  margin: 0 0 10px;
  font-size: 0.76rem;
  color: var(--card-text-3);
}

.rules-scroll {
  overflow: auto;
  max-height: none;
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: #fff;
}

.rules-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

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

.rules-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card-muted);
  font-weight: 600;
  color: var(--card-text);
  border-bottom: 1px solid var(--card-border-strong);
}

.rules-table td {
  color: var(--card-text);
}

.rules-table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

.rules-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.06);
}

.rules-table td:last-child {
  white-space: normal;
  max-width: none;
}

.rules-source {
  margin: 16px 0 0;
  font-size: 0.74rem;
  color: var(--card-text-3);
}

.rules-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 12px;
}

.rules-search-input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--card-border-strong);
  background: #fff;
  color: var(--card-text);
  font-family: var(--font);
  font-size: 0.86rem;
}

.rules-search-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: rgba(37, 99, 235, 0.55);
}

.rules-search-meta {
  font-size: 0.78rem;
  color: var(--card-text-3);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.rules-mode {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.rules-mode-exact {
  background: rgba(5, 150, 105, 0.15);
  color: #047857;
}

.rules-mode-fuzzy {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.rules-hit {
  background: rgba(250, 204, 21, 0.45);
  color: inherit;
  padding: 0 0.1em;
  border-radius: 2px;
}

.rules-empty {
  text-align: center;
  color: var(--card-text-3);
  padding: 1.5rem !important;
}

.lab-options-card {
  padding: 0.65rem 0.85rem !important;
  margin-bottom: 0 !important;
}

.lab-options-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.75rem;
}

.lab-opt-label {
  align-self: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--card-text-2);
  margin-right: 0.15rem;
  white-space: nowrap;
}

.lab-opt {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--card-text-3);
  font-weight: 600;
}

.lab-opt input[type="number"] {
  width: 5.5rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid var(--card-border);
  border-radius: 7px;
  background: #fff;
  color: var(--card-text);
}

.lab-opt-check {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  height: 2rem;
  color: var(--card-text-2);
}

.lab-opt-meta {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--card-text-3);
  align-self: center;
}

.bagua-scorer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0.55rem 0 0.35rem;
  font-size: 0.78rem;
  color: var(--card-text-2);
}

.bagua-scorer-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.76rem;
  color: var(--card-text-2);
  cursor: pointer;
}

.bagua-batch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem;
  margin: 0.55rem 0 0.75rem;
}

.bagua-batch-row label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--card-text-3);
  font-weight: 600;
}

.bagua-batch-row input[type="date"] {
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid var(--card-border);
  border-radius: 7px;
  background: #fff;
}

.bagua-predict-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.75rem;
}

.bagua-predict-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--card-text-3);
  font-weight: 600;
}

.bagua-predict-form input,
.bagua-predict-form select {
  height: 2rem;
  padding: 0 0.45rem;
  border: 1px solid var(--card-border);
  border-radius: 7px;
  background: #fff;
  color: var(--card-text);
  min-width: 7rem;
}

.bagua-pred-history.hidden {
  display: none;
}

.bagua-pred-hist-card {
  margin-top: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(186, 198, 214, 0.55);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.96));
  overflow: hidden;
}

.bagua-pred-hist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
}

.bagua-pred-hist-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.bagua-pred-hist-toggle .bagua-entry-card-title {
  margin: 0;
}

.bagua-pred-hist-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--card-text-3);
  border-bottom: 2px solid var(--card-text-3);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.bagua-pred-hist-card.is-collapsed .bagua-pred-hist-chevron {
  transform: rotate(-45deg);
}

.bagua-pred-hist-card.is-collapsed .bagua-pred-hist-body {
  display: none;
}

.bagua-pred-hist-card .bagua-table-wrap {
  margin: 0 0.75rem 0.75rem;
}

.bagua-hist-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.25rem;
}

.bagua-hist-actions .bagua-calc-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
}

.bagua-actual-row {
  margin-top: 0.35rem;
}

.bagua-batch-result {
  margin-top: 0.5rem;
}

/* 页面加宽、压缩空白 */
.page-lab .app {
  width: min(98vw, 1920px);
  padding: 0 12px 24px;
}

.page-lab .brand-header-compact {
  padding: 12px 0 4px;
}

.page-lab .brand-header-compact .title-main {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.page-lab .brand-header-compact .brand-sub {
  margin-top: 2px;
  font-size: 0.78rem;
  opacity: 0.72;
}

.page-lab .page-toolbar {
  margin-bottom: 0;
  gap: 0.6rem;
  padding: 4px 0 2px;
}

.page-lab .page-title {
  font-size: 1.05rem;
}

.page-lab .main {
  gap: 12px;
}

/* 淡色毛玻璃按钮 */
.btn-frost-primary,
.btn-frost-accent {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(186, 230, 253, 0.55);
  color: #075985;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 6px 16px rgba(125, 211, 252, 0.14);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn-frost-primary {
  min-width: 150px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.38) 42%),
    linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 48%, #bae6fd 100%);
}

.btn-frost-accent {
  padding: 6px 14px;
  font-size: 0.78rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.42) 45%),
    linear-gradient(135deg, #f8fbff 0%, #eef6fc 55%, #dbeafe 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 3px 10px rgba(147, 197, 253, 0.16);
}

.btn-frost-primary:hover:not(:disabled),
.btn-frost-accent:hover:not(:disabled) {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 8px 20px rgba(125, 211, 252, 0.22);
}

.btn-frost-primary:disabled,
.btn-frost-accent:disabled,
.btn-frost:disabled,
.btn-ink:disabled,
.btn-stone:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-frost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid rgba(100, 116, 139, 0.45);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s, background 0.15s;
}

.btn-frost:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
}

/* 主操作 / 次操作：与 .btn + .btn-secondary 同尺寸，仅配色不同 */
.btn-ink,
.btn-stone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s, background 0.15s, border-color 0.15s;
}

.btn-ink {
  color: #f8fafc;
  border-color: rgba(15, 23, 42, 0.85);
  background:
    linear-gradient(180deg, #3f3f46 0%, #18181b 58%, #09090b 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 4px 12px rgba(0, 0, 0, 0.28);
}

.btn-ink:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 8px 18px rgba(0, 0, 0, 0.32);
}

.btn-stone {
  color: #1e293b;
  border-color: rgba(100, 116, 139, 0.55);
  background:
    linear-gradient(180deg, #ffffff 0%, #e2e8f0 55%, #cbd5e1 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 3px 8px rgba(15, 23, 42, 0.12);
}

.btn-stone:hover:not(:disabled) {
  filter: brightness(1.03);
  transform: translateY(-1px);
  border-color: rgba(71, 85, 105, 0.65);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 6px 14px rgba(15, 23, 42, 0.16);
}

.btn-xs {
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  min-height: 0;
  border-radius: 6px;
}

.page-lab .btn-frost-primary,
.page-lab .btn-frost-accent {
  color: #f8fafc;
  border-color: rgba(15, 23, 42, 0.75);
  background: linear-gradient(180deg, #3f3f46 0%, #18181b 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.page-lab .bagua-calc-btn {
  color: #1e293b;
  border: 1px solid rgba(100, 116, 139, 0.5);
  background: linear-gradient(180deg, #fff 0%, #e2e8f0 100%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  font-weight: 600;
}

.page-lab .bagua-calc-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
  border-color: rgba(71, 85, 105, 0.6);
}

.page-lab .bagua-calc-btn-accent {
  color: #f8fafc;
  border-color: rgba(15, 23, 42, 0.8);
  background: linear-gradient(180deg, #3f3f46 0%, #18181b 100%);
}

.page-lab .bagua-calc-btn.done {
  color: #f8fafc;
  border-color: rgba(39, 39, 42, 0.7);
  background: linear-gradient(180deg, #52525b 0%, #27272a 100%);
}

.bagua-hist-fold {
  display: flex;
  justify-content: center;
  margin: 0.55rem 0 0.35rem;
}

.bagua-hist-pager-below {
  margin-top: 0.65rem;
  justify-content: center;
}

#hist-table tr.hist-row-extra.is-folded,
#calc-table tr.hist-row-extra.is-folded,
tr.hist-row-extra.is-folded {
  display: none !important;
}

.lab-predict-badge[hidden] {
  display: none !important;
}

/* 预测区 */
.lab-predict-card {
  padding: 0 !important;
  overflow: hidden;
}

.lab-predict-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.05rem 1.25rem 0.95rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.04) 0%, transparent 42%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.lab-predict-head-text {
  min-width: 0;
}

.lab-predict-head .bagua-block-title {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

.lab-predict-lead {
  margin: 0.35rem 0 0;
  max-width: 36rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #64748b;
}

.lab-predict-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  margin-top: 0.15rem;
}

.lab-predict-badge.is-busy {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(219, 234, 254, 0.7);
}

.lab-predict-badge.is-ok {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(209, 250, 229, 0.65);
}

.lab-predict-badge.is-err {
  color: #b91c1c;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(254, 226, 226, 0.7);
}

.lab-predict-body {
  padding: 1.05rem 1.15rem 1.2rem;
  background:
    radial-gradient(90% 70% at 8% 0%, rgba(148, 163, 184, 0.16), transparent 55%),
    radial-gradient(70% 60% at 100% 0%, rgba(30, 58, 95, 0.08), transparent 48%),
    linear-gradient(180deg, #f1f5f9 0%, #ffffff 48%);
}

.lab-predict-hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 0.95rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .lab-predict-hero {
    grid-template-columns: 1fr;
  }
}

.lab-predict-hero-main,
.lab-predict-hero-side {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.lab-predict-hero-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem 1.2rem 1.2rem;
  background:
    linear-gradient(145deg, #0f172a 0%, #1e293b 48%, #334155 100%);
  color: #e2e8f0;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.lab-predict-hero-main::after {
  content: "";
  position: absolute;
  inset: auto -20% -45% 35%;
  height: 70%;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.22), transparent 68%);
  pointer-events: none;
}

.lab-predict-hero-side {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.05rem 1.05rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(148, 163, 184, 0.12);
}

.lab-predict-side-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.lab-predict-side-title {
  margin-top: -0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.lab-predict-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.lab-predict-field-lg {
  max-width: 16rem;
}

.lab-predict-label {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.lab-predict-hero-main .lab-predict-label {
  color: rgba(226, 232, 240, 0.72);
}

.lab-predict-field input[type="date"] {
  min-width: 10.5rem;
  height: 2.45rem;
  padding: 0 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lab-predict-hero-main .lab-predict-field input[type="date"] {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.lab-predict-field input[type="date"]:focus {
  outline: none;
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.18);
}

.lab-predict-meta {
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.78);
  min-height: 1.25rem;
}

.lab-predict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.15rem;
  position: relative;
  z-index: 1;
}

.lab-predict-cta {
  min-width: 8.5rem;
  height: 2.55rem !important;
  padding: 0 1.25rem !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.lab-predict-hero-main .btn-stone {
  height: 2.55rem;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc;
}

.lab-predict-hero-main .btn-stone:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.lab-predict-batch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem;
}

.lab-predict-batch-row .lab-predict-field input[type="date"] {
  min-width: 8.5rem;
}

.lab-predict-batch-btn {
  align-self: flex-start;
  margin-top: 0.15rem;
  min-width: 7.2rem;
  height: 2.35rem;
}

.page-lab .lab-predict-card .bagua-predict-result {
  margin-top: 1rem;
}

.page-lab .lab-predict-card .bagua-predict-card {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.94);
  padding: 1rem 1.05rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.page-lab .lab-predict-card .bagua-pred-hist-card {
  margin-top: 0.95rem;
}

/* 演算历史 */
.calc-kpi-card {
  padding: 0;
  margin: 0;
}

.calc-kpi-grid {
  display: block;
}

.calc-kpi-board {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.calc-kpi-board.is-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

.calc-kpi-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  border-radius: 12px;
  padding: 0.75rem 0.8rem 0.85rem;
  box-sizing: border-box;
}

/* 左：实盘 — 灰白 */
.calc-kpi-shell.row-live {
  background: linear-gradient(165deg, #f7f8f9 0%, #f1f2f4 55%, #eceef1 100%);
  border: 1px solid #d5d8de;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.calc-kpi-shell.row-live .calc-kpi-shell-head {
  border-bottom-color: #dde1e6;
}

.calc-kpi-shell.row-live .calc-kpi-row-title {
  color: #3a4050;
}

.calc-kpi-shell.row-live .calc-kpi-panel {
  background: rgba(255, 255, 255, 0.78);
  border-color: #d8dce3;
}

.calc-kpi-shell.row-live .calc-kpi-panel-head {
  color: #4a5160;
}

/* 右：全史 — 白 */
.calc-kpi-shell.row-train {
  background: #ffffff;
  border: 1px solid #e2e5ea;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1);
}

.calc-kpi-shell.row-train .calc-kpi-shell-head {
  border-bottom-color: #eceff3;
}

.calc-kpi-shell.row-train .calc-kpi-row-title {
  color: #3a4050;
}

.calc-kpi-shell.row-train .calc-kpi-row-title.is-sub {
  color: #5a6170;
}

.calc-kpi-shell.row-train .calc-kpi-panel {
  background: #ffffff;
  border-color: #e2e5ea;
}

.calc-kpi-shell.row-train .calc-kpi-panel-head {
  color: #4a5160;
}

.calc-kpi-shell.row-train .calc-kpi-shell-block + .calc-kpi-shell-block {
  border-top-color: #eceff3;
}

.calc-kpi-shell-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid transparent;
  flex: 0 0 auto;
}

.calc-kpi-shell-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.55rem;
}

/* 左右竖排三块均分，架构对齐 */
.calc-kpi-shell.row-live .calc-kpi-shell-body,
.calc-kpi-shell.row-train .calc-kpi-shell-body {
  gap: 0.55rem;
}

.calc-kpi-shell.row-live .calc-kpi-row-metrics.is-stack,
.calc-kpi-shell.row-train .calc-kpi-row-metrics.is-stack {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  height: 100%;
  min-height: 0;
}

.calc-kpi-shell.row-live .calc-kpi-panel,
.calc-kpi-shell.row-train .calc-kpi-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.calc-kpi-shell.row-live .calc-kpi-panel-body,
.calc-kpi-shell.row-train .calc-kpi-panel-body {
  flex: 1 1 auto;
  align-content: center;
}

.calc-kpi-shell.row-train .calc-kpi-shell-block {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 0;
}

.calc-kpi-shell.row-train .calc-kpi-shell-block + .calc-kpi-shell-block {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed transparent;
}

.calc-kpi-shell-block.is-empty {
  opacity: 0.75;
}

.calc-kpi-row {
  border: 0;
  background: transparent;
  padding: 0;
}

.calc-kpi-row.is-empty {
  opacity: 0.75;
}

.calc-kpi-row-head {
  margin-bottom: 0.35rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.calc-kpi-row-title {
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #0f172a;
  line-height: 1.45;
  word-break: break-word;
  flex: 1 1 auto;
  min-width: 0;
}

.calc-kpi-row-title.is-sub {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.calc-kpi-row-meta {
  display: none;
}

.calc-kpi-row-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.calc-kpi-row-metrics.is-stack {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (max-width: 1100px) {
  .calc-kpi-board.is-duo {
    grid-template-columns: 1fr;
  }

  .calc-kpi-shell.row-live .calc-kpi-row-metrics.is-stack,
  .calc-kpi-shell.row-train .calc-kpi-shell-block {
    grid-template-rows: none;
    flex: none;
    height: auto;
  }
}

.calc-kpi-row-empty {
  grid-column: 1 / -1;
  padding: 0.7rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  border-radius: 10px;
  background: #f1f5f9;
}

/* 大卡内小面板：默认中性；左右大卡各自覆写为统一配色 */
.calc-kpi-panel {
  border-radius: 10px;
  border: 1px solid #d8dee8;
  background: #f8fafc;
  padding: 0.5rem 0.55rem 0.55rem;
  min-width: 0;
}

.calc-kpi-panel.is-xiao,
.calc-kpi-panel.is-wei,
.calc-kpi-panel.is-codes,
.calc-kpi-panel.is-pred {
  /* 颜色由所属 .calc-kpi-shell 统一，避免左右同系打架 */
  background: inherit;
  border-color: inherit;
}

.calc-kpi-shell .calc-kpi-panel.is-xiao,
.calc-kpi-shell .calc-kpi-panel.is-wei,
.calc-kpi-shell .calc-kpi-panel.is-codes,
.calc-kpi-shell .calc-kpi-panel.is-pred {
  background: rgba(255, 255, 255, 0.75);
}

.calc-kpi-panel-head {
  font-size: 0.78rem;
  font-weight: 750;
  color: #475569;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  text-align: center;
  flex: 0 0 auto;
}

.calc-kpi-panel-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.calc-kpi-panel-body.is-groups {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 0.4rem;
  align-items: stretch;
}

.calc-kpi-group {
  display: flex;
  align-items: stretch;
  gap: 0.3rem;
  min-width: 0;
  border-radius: 10px;
  padding: 0.28rem;
  border: 1px solid transparent;
}

.calc-kpi-group.is-roll {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(30, 58, 95, 0.28);
}

.calc-kpi-group.is-you {
  background: rgba(180, 83, 9, 0.06);
  border-color: rgba(180, 83, 9, 0.28);
}

.calc-kpi-group-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}

.calc-kpi-group-side {
  flex: 1.15 1 0;
  min-width: 0;
  display: flex;
}

.calc-kpi-group .calc-kpi-mini {
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
}

.calc-kpi-group.is-roll .calc-kpi-mini.is-streak {
  background: rgba(255, 255, 255, 0.72);
}

.calc-kpi-group.is-you .calc-kpi-mini {
  width: 100%;
}

.calc-kpi-mini.is-streak .calc-kpi-mini-v.is-pair {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
}

.calc-kpi-streak-part {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.02rem;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
}

button.calc-kpi-streak-part.is-jump {
  cursor: pointer;
  border-radius: 6px;
}

button.calc-kpi-streak-part.is-jump:hover {
  background: rgba(148, 163, 184, 0.16);
}

button.calc-kpi-streak-part.is-jump.is-active {
  background: rgba(37, 99, 235, 0.12);
}

.calc-kpi-streak-k {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
}

.calc-kpi-streak-part.is-lose .calc-kpi-streak-k,
.calc-kpi-streak-part.is-lose .calc-kpi-streak-n {
  color: #b91c1c;
}

.calc-kpi-streak-n {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 小卡：胜率 / 连中 / 连挂 */
.calc-kpi-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.4rem 0.4rem 0.45rem;
  min-width: 0;
  text-align: center;
}

.calc-kpi-mini-k {
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}

.calc-kpi-mini-v {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc-kpi-mini.is-rate .calc-kpi-mini-v {
  font-size: 1.2rem;
}

.calc-kpi-mini-v small {
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 0.05rem;
  color: #64748b;
  white-space: nowrap;
}

.calc-kpi-mini-frac {
  font-size: 0.7rem;
  font-weight: 650;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  margin-top: 0.05rem;
  white-space: nowrap;
}

.calc-kpi-mini-frac small {
  color: #94a3b8;
  font-weight: 600;
}

.calc-kpi-mini.is-lose .calc-kpi-mini-v {
  color: #b91c1c;
}

.calc-kpi-occur {
  display: inline;
  margin-left: 0.15rem;
  font-size: 0.62rem;
  font-weight: 650;
  color: #dc2626;
  white-space: nowrap;
}

button.calc-kpi-mini.is-jump {
  cursor: pointer;
  font: inherit;
  width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

button.calc-kpi-mini.is-jump:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

button.calc-kpi-mini.is-jump.is-lose:hover {
  border-color: rgba(185, 28, 28, 0.4);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.1);
}

button.calc-kpi-mini.is-jump.is-active {
  border-color: rgba(37, 99, 235, 0.5);
  background: #eff6ff;
}

button.calc-kpi-mini.is-jump.is-lose.is-active {
  border-color: rgba(185, 28, 28, 0.45);
  background: #fef2f2;
}

@media (max-width: 900px) {
  .calc-kpi-row-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .calc-kpi-panel-body {
    grid-template-columns: 1fr;
  }

  .calc-kpi-panel-body.is-groups {
    grid-template-columns: 1fr;
  }

  .calc-kpi-group.is-roll {
    flex-direction: column;
  }
}

.calc-kpi-lane {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 1rem 1.15rem 1.05rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(241, 245, 249, 0.88) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.calc-kpi-lane::before {
  display: none;
}

.calc-kpi-lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.calc-kpi-lane-tag {
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: #0f172a;
}

.calc-kpi-lane-hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.calc-kpi-hero {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.calc-kpi-hero-num {
  font-size: clamp(2.1rem, 3.2vw, 2.75rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.calc-kpi-hero-num small {
  font-size: 1rem;
  font-weight: 700;
  margin-left: 0.1rem;
  color: #64748b;
}

.calc-kpi-hero-label {
  padding-bottom: 0.2rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: #64748b;
}

.calc-kpi-replay {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #94a3b8;
}
.calc-kpi-replay small {
  font-size: 0.72rem;
  opacity: 0.9;
}

.calc-kpi-lane-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.calc-kpi-stat {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 0.45rem 0.55rem;
}

button.calc-kpi-stat.is-jump {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button.calc-kpi-stat.is-jump:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  background: rgba(239, 246, 255, 0.95);
}

button.calc-kpi-stat.is-jump.is-lose:hover {
  border-color: rgba(185, 28, 28, 0.4);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
  background: rgba(254, 242, 242, 0.95);
}

button.calc-kpi-stat.is-jump.is-active {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(219, 234, 254, 0.95);
}

button.calc-kpi-stat.is-jump.is-lose.is-active {
  border-color: rgba(185, 28, 28, 0.5);
  background: rgba(254, 226, 226, 0.95);
}

.calc-kpi-stat-k {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
  margin-bottom: 0.15rem;
}

.calc-kpi-stat-v {
  font-size: 1.05rem;
  font-weight: 750;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.calc-kpi-stat-v small {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.calc-kpi-stat.is-lose .calc-kpi-stat-v small.calc-kpi-occur {
  color: #b91c1c;
  font-weight: 650;
}

.calc-kpi-stat.is-lose .calc-kpi-stat-v {
  color: #b91c1c;
}

#calc-history-root tr.is-streak-hl.is-streak-win > td,
#calc-history-root tr.is-streak-hl.is-streak-lose > td {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--ch-streak-bar, #64748b);
}

#calc-history-root tr.is-streak-hl.is-streak-win > td {
  --ch-streak-bar: #2f6f5e;
}

#calc-history-root tr.is-streak-hl.is-streak-lose > td {
  --ch-streak-bar: #9a5562;
}

.calc-kpi-note.is-ok {
  color: #047857;
}
.calc-kpi-note.is-err {
  color: #b91c1c;
}
.calc-formula-arrow {
  color: #64748b;
  font-weight: 700;
}

.calc-hist-head #btn-rebuild-expert {
  flex-shrink: 0;
}

.calc-pager #calc-clear-hl {
  margin-left: 0.5rem;
}

.calc-kpi-foot {
  display: none;
}

.calc-kpi-foot-item {
  display: none;
}

@media (max-width: 900px) {
  .calc-kpi-row-metrics {
    grid-template-columns: 1fr;
  }
}

.calc-kpi-note {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #64748b;
}

.calc-hit {
  display: inline-block;
  margin-right: 0.25rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.calc-hit.is-yes {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
}

.calc-hit.is-no {
  color: #b91c1c;
  background: rgba(248, 113, 113, 0.14);
}

.calc-cell-formula code {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #334155;
  white-space: nowrap;
}

.calc-cell-formula .calc-delta {
  color: #2563eb;
  font-weight: 800;
}

.calc-cell-reason {
  max-width: 22rem;
  min-width: 12rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #475569;
  white-space: normal;
  word-break: break-word;
}

.calc-cell-ai-codes {
  max-width: 16rem;
  font-size: 0.78rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.calc-cell-ai-codes .ai-code {
  display: inline-block;
  margin: 0.05rem 0.12rem;
  color: #334155;
  font-weight: 650;
}

.calc-cell-ai-codes .ai-code.is-hit {
  color: #047857;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.16);
  border-radius: 4px;
  padding: 0 0.2rem;
}

.ai-codes-n {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}

.calc-mark {
  background: rgba(250, 204, 21, 0.55);
  color: inherit;
  padding: 0 0.05em;
  border-radius: 2px;
}

.calc-ideas-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--card-text-2);
  font-size: 0.84rem;
  line-height: 1.75;
}

/* 塔 B 计算规则流程图 */
.calc-flow-card .surface-head {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-flow-lead {
  margin: 0;
  max-width: 42rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #64748b;
  font-weight: 500;
}

.calc-flow-body {
  padding-top: 0.25rem;
}

.calc-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.calc-flow-node {
  width: min(100%, 34rem);
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  padding: 0.85rem 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.calc-flow-node strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.95rem;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.calc-flow-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #94a3b8;
  text-transform: none;
}

.calc-flow-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #64748b;
}

.calc-flow-in {
  border-color: rgba(30, 58, 95, 0.18);
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
}

.calc-flow-in strong {
  color: #f8fafc;
}

.calc-flow-in .calc-flow-kicker,
.calc-flow-in .calc-flow-meta {
  color: rgba(226, 232, 240, 0.7);
}

.calc-flow-focus {
  border-color: rgba(30, 58, 95, 0.22);
  background:
    radial-gradient(90% 80% at 100% 0%, rgba(148, 163, 184, 0.18), transparent 55%),
    linear-gradient(180deg, #fff 0%, #eef2f7 100%);
}

.calc-flow-formulas {
  display: grid;
  gap: 0.28rem;
  margin-top: 0.55rem;
}

.calc-flow-formulas code,
.calc-flow-foot code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.72rem;
  color: #334155;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 6px;
  padding: 0.22rem 0.45rem;
}

.calc-flow-formulas code {
  display: block;
}

.calc-flow-arrow {
  width: 2px;
  height: 1.1rem;
  background: linear-gradient(180deg, #cbd5e1, #94a3b8);
  position: relative;
  margin: 0.15rem 0;
}

.calc-flow-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #94a3b8;
  transform: translateX(-50%);
}

.calc-flow-split-label {
  width: min(100%, 34rem);
  margin: 0.35rem 0 0.55rem;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.04em;
}

.calc-flow-split {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.15rem;
}

.calc-flow-branch .calc-flow-node {
  width: 100%;
  height: 100%;
  padding: 0.75rem 0.8rem;
}

.calc-flow-out .calc-flow-result {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1e3a5f;
  background: #e8eef5;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.calc-flow-compare {
  border-style: dashed;
  background: #fafafa;
}

.calc-flow-foot {
  margin: 1rem 0 0;
  font-size: 0.74rem;
  line-height: 1.55;
  color: #64748b;
}

@media (max-width: 960px) {
  .calc-flow-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .calc-flow-split {
    grid-template-columns: 1fr;
  }
}

/* 旧选中态已并入 .site-footer-link.is-active（黑底浅 pill） */

/* 智能回测卡 */
.lab-smart-card {
  overflow: hidden;
}

.lab-smart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, #fbfcfe, #f1f5f9);
}

.lab-smart-body { padding: 8px 10px 10px; }

.bagua-step-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  border: none;
  background: transparent;
}

@media (max-width: 900px) {
  .bagua-step-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .bagua-step-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.bagua-step-tab {
  padding: 0.62rem 0.35rem;
  border-radius: 9px;
  border: 1px solid #d5dbe6;
  background: linear-gradient(180deg, #ffffff, #f4f6f9);
  color: #475569;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
}

.bagua-step-tab:hover:not(:disabled) {
  border-color: #93c5fd;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.08);
}

.bagua-step-tab.active {
  background: linear-gradient(180deg, #f8fbff, #e8f2fc);
  border-color: #7db8f0;
  color: #1e40af;
  box-shadow: 0 0 0 1px rgba(125, 184, 240, 0.2), 0 4px 12px rgba(37, 99, 235, 0.1);
}

.bagua-step-tab.active::after { display: none; }

.bagua-step-tab.done:not(.active) {
  background: linear-gradient(180deg, #f7fdf9, #eefbf3);
  border-color: #9ad4b3;
  color: #047857;
}

.bagua-step-tab:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.lab-smart-body .bagua-progress {
  margin: 0 0 8px;
}

#bagua-workspace > .bagua-progress {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.bagua-tab-panels {
  min-height: 0;
  padding: 0;
  background: transparent;
}

.lab-smart-body .bagua-dim-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
}

.page-lab .lab-smart-card .bagua-dim-summary {
  margin-bottom: 6px;
}

.page-lab .lab-smart-card .bagua-dim-summary h4 {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.page-lab .lab-smart-card .bagua-stat-row {
  gap: 5px;
}

.page-lab .lab-smart-card .bagua-stat-chip {
  background: rgba(248, 250, 252, 0.95);
  border-color: #e2e8f0;
  color: #64748b;
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
  border-radius: 6px;
}

.page-lab .lab-smart-card .bagua-stat-chip strong {
  color: #0f172a;
}

.bagua-dim-count {
  margin: 0 0 6px;
  font-size: 0.7rem;
  color: #94a3b8;
  letter-spacing: 0.06em;
}

.page-lab .lab-smart-card .bagua-combo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 6px;
  max-height: none;
  overflow: visible;
  margin-top: 0;
  padding-right: 0;
}

.page-lab .lab-smart-card .bagua-combo-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 9px 7px;
  text-align: left;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e8ecf1;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}

.page-lab .lab-smart-card .bagua-combo-card:hover {
  transform: translateY(-1px);
  border-color: #c7d7ea;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.page-lab .lab-smart-card .bagua-combo-card.tone-high {
  border-color: #d1fae5;
  background: linear-gradient(180deg, #ffffff, #f8fdfb);
}

.page-lab .lab-smart-card .bagua-combo-card.tone-mid {
  border-color: #dbeafe;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.page-lab .lab-smart-card .bagua-combo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.page-lab .lab-smart-card .bagua-combo-key {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.page-lab .lab-smart-card .bagua-combo-rate {
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.page-lab .lab-smart-card .bagua-combo-line {
  font-size: 0.68rem;
  line-height: 1.4;
  color: #64748b;
  word-break: break-all;
  min-height: 1.9em;
}

.page-lab .lab-smart-card .bagua-combo-meta {
  margin-top: auto;
  padding: 3px 0 0;
  border-top: 1px solid #f1f5f9;
  font-size: 0.66rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* 历史录入卡片 */
.bagua-entry-card {
  margin-bottom: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(186, 198, 214, 0.55);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.96) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 8px 22px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.bagua-entry-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
}

.bagua-entry-card-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.bagua-entry-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem 0.85rem;
  padding: 0.85rem 0.95rem 0.95rem;
}

.bagua-entry-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.bagua-entry-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #64748b;
}

.bagua-entry-field input,
.bagua-entry-field select {
  min-width: 9rem;
  height: 2.15rem;
  padding: 0 0.65rem;
  border: 1px solid #d5dde8;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 0.86rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bagua-entry-field input:focus,
.bagua-entry-field select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.bagua-entry-field #inp-number {
  min-width: 5.5rem;
  width: 5.5rem;
}

.bagua-entry-field #inp-branch {
  min-width: 8.5rem;
}

.bagua-entry-save {
  height: 2.15rem;
  min-width: 5.5rem;
  padding: 0 1.1rem;
  margin-left: 0.15rem;
}

.bagua-entry-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

.bagua-entry-preview[hidden] {
  display: none !important;
}

.bagua-entry-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.bagua-hist-pager {
  margin: 0 0 0.65rem;
  padding: 0.35rem 0;
}

.page-lab #bagua-history-root .bagua-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.page-lab #bagua-history-root .bagua-table {
  margin: 0;
}

.page-lab #bagua-history-root .bagua-table thead th {
  background: #f1f5f9;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* 回测结果（对齐 huice 结构） */
.bagua-bt-wrap { display: flex; flex-direction: column; gap: 0.75rem; }
.bagua-bt-title {
  margin: 0;
  font-size: 0.95rem;
  color: var(--card-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bagua-bt-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
@media (max-width: 900px) {
  .bagua-bt-stats-grid { grid-template-columns: 1fr; }
}
.bagua-bt-stat-card {
  padding: 0.65rem 0.75rem;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--card-text-2);
}
.bagua-bt-stat-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--card-text);
}
.bagua-bt-stat-card.bt-zhi { background: #f0f7ff; border-color: #bfdbfe; }
.bagua-bt-stat-card.bt-num { background: #fff8f0; border-color: #fed7aa; }
.bagua-bt-stat-card.bt-cfg { background: #f3faf5; border-color: #bbf7d0; }
.bagua-bt-metric-table { font-size: 0.75rem; }
.bagua-bt-metric-table th,
.bagua-bt-metric-table td { white-space: nowrap; }
.bagua-bt-detail-title { margin: 0.25rem 0; font-size: 0.88rem; }
.bagua-table .hit-yes { background: #e8f5e9; text-align: center; }
.bagua-table .hit-no { background: #ffebee; text-align: center; }
.bagua-bt-num-hit {
  color: #6b21a8;
  font-weight: 700;
  background: #fef9c3;
  padding: 1px 4px;
  border-radius: 3px;
}
.bagua-bt-details-cell {
  min-width: 280px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--card-text-2);
  vertical-align: top;
}
.bagua-bt-details-cell strong { color: var(--card-text); }

/* 实验室页：块用首页 surface，控件适配浅底 */
.page-lab .bagua-workspace {
  width: 100%;
}

.page-lab .bagua-block {
  padding: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--card-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.18);
}

.page-lab .surface-head.compact {
  padding: 12px 14px 0;
}

.page-lab .surface-body {
  padding: 10px 12px 12px;
}

.page-lab .bagua-block-title {
  margin: 0;
  color: var(--card-text);
  font-size: 0.95rem;
}

.page-lab .surface-head .bagua-block-hint {
  margin: 6px 0 0;
  color: var(--card-text-3);
}

.page-lab .bagua-block-hint,
.page-lab .bagua-hint {
  color: var(--card-text-3);
}

.page-lab .bagua-stat-chip {
  background: var(--card-muted);
  border-color: var(--card-border);
  color: var(--card-text-2);
}

.page-lab .bagua-stat-chip strong {
  color: var(--card-text);
}

.page-lab .bagua-calc-btn {
  background: #fff;
  border-color: var(--card-border-strong);
  color: var(--card-text);
}

.page-lab .bagua-calc-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.4);
}

.page-lab .bagua-calc-btn.done {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.35);
  color: #047857;
}

.page-lab .bagua-calc-btn-accent {
  background: var(--accent);
  border-color: var(--accent-dim);
  color: #fff;
}

.page-lab .bagua-progress-bar {
  background: rgba(0, 0, 0, 0.08);
}

.page-lab .bagua-progress-text {
  color: var(--card-text-3);
}

.page-lab .bagua-predict-form label {
  color: var(--card-text-2);
}

.page-lab .bagua-predict-form input[type="date"] {
  background: #fff;
  border: 1px solid var(--card-border-strong);
  color: var(--card-text);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
}

.page-lab .bagua-dim-panel,
.page-lab .bagua-predict-result,
.page-lab #bagua-backtest-result,
.page-lab #bagua-history-root {
  color: var(--card-text);
}

.page-lab .bagua-dim-panel {
  background: var(--card-muted);
  border-color: var(--card-border);
}

.page-lab .lab-smart-body > .bagua-tab-panels > .bagua-dim-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  border-color: #e2e8f0;
}

.page-lab .bagua-dim-summary h4 {
  color: var(--card-text);
}

.page-lab .bagua-combo-card {
  background: #fff;
  border-color: var(--card-border);
}

.page-lab .lab-smart-card .bagua-combo-line { color: #64748b; }
.page-lab .lab-smart-card .bagua-combo-meta { color: #94a3b8; }
.page-lab .bagua-combo-line { color: var(--accent); }
.page-lab .bagua-combo-meta { color: var(--card-text-3); }

.page-lab .bagua-table th {
  background: var(--card-muted);
  color: var(--card-text-2);
}

.page-lab .bagua-table th,
.page-lab .bagua-table td {
  border-color: var(--card-border);
  color: var(--card-text);
}

.page-lab .bagua-dim-line em {
  color: var(--card-text-3);
}

@media (max-width: 640px) {
  .page-toolbar { align-items: stretch; }
  .page-toolbar-actions { width: 100%; }
  .page-toolbar-actions .btn { flex: 1; min-width: 0; }
}

@media (max-width: 1200px) {
  .results-pred { grid-template-columns: repeat(2, 1fr); }
  .results-top { grid-template-columns: 1fr; }
  .input-split,
  .input-split.is-expanded { grid-template-columns: 1fr; }
  .input-split.is-expanded .summary-col { order: -1; }
  .input-split.is-expanded .input-col {
    order: 0;
    border-right: none;
    border-top: none;
    border-bottom: none;
  }
  .input-split.is-expanded .summary-col {
    border-bottom: 1px solid var(--card-border);
  }
  .input-col { border-right: none; border-bottom: 1px solid var(--card-border); }
  .summary-col { min-height: 0; padding: 16px 20px; height: auto; }
  .input-split.is-expanded .quick-summary { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .ymdh-row {
    grid-template-columns: 40px repeat(4, 1fr);
    gap: 8px;
    padding: 16px 20px 0;
  }
  .ai-formula-row { margin: 12px 20px 0; padding: 10px 12px; }
  .app { padding: 0 16px 32px; }
  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 16px 16px;
  }
  .site-footer-bar {
    flex-wrap: wrap;
    padding: 12px 16px 16px;
    text-align: center;
  }
  .brand-header { padding: 36px 0 28px; }
  /* 首页：整体略下移 */
  .page-home .brand-header {
    padding-top: calc(36px + 1.25rem + env(safe-area-inset-top, 0px));
    padding-bottom: 1rem;
  }
  .title-main { letter-spacing: 0.22em; text-indent: 0.22em; }
  .ai-formula-line { font-size: 0.88rem; }
  .form-grid { grid-template-columns: repeat(2, 1fr); padding: 24px 20px 0; }
  .actions { padding: 24px 20px; }
  .surface-head, .surface-body { padding-left: 20px; padding-right: 20px; }
  .results-pred { grid-template-columns: 1fr; }
  .input-col .form-grid { grid-template-columns: repeat(2, 1fr); }
  .input-col .actions { padding: 20px; }
  .input-col .error { margin: 0 20px 20px; }
  .field-date { padding: 16px 20px 0; }
  .date-row { padding: 16px 20px 0; grid-template-columns: 1fr 72px; }
  .summary-col { padding: 20px; }
  .pillars-grid { grid-template-columns: repeat(2, 1fr); }
  /* 八卦介绍卡：三卡横排 */
  .calc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 14px;
  }
  .calc-card { padding: 8px 6px; }
  .calc-card-label { font-size: 0.6rem; margin-bottom: 4px; }
  .calc-card-value { font-size: 0.76rem; }
  .calc-card-detail { font-size: 0.58rem; line-height: 1.35; word-break: break-all; }
  /* 主卦 + 变卦：同行对照 */
  .hex-duo {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .hex-arrow {
    flex: 0 0 auto;
    align-self: center;
    transform: none;
    font-size: 0.82rem;
    padding: 0 2px;
  }
  .hex-panel {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }
  .hex-duo .hex-panel:first-of-type { flex: 1.35 1 0; }
  .hex-duo .hex-panel:last-of-type { flex: 0.85 1 0; }
  .hex-name { padding: 8px 6px 6px; font-size: 0.72rem; }
  .hex-name-sub { padding: 0 6px 8px; font-size: 0.62rem; }
  .liuyao-table { font-size: 0.58rem; }
  .liuyao-table th { padding: 4px 2px; font-size: 0.56rem; }
  .liuyao-table td { padding: 4px 2px; }
  .cell-pos { font-size: 0.56rem; }
  .cell-najia { font-size: 0.58rem; }
  .yao-line { width: 26px; height: 4px; }
  .yao-yin::before,
  .yao-yin::after { width: 11px; height: 4px; }
  .tag { font-size: 0.52rem; padding: 0 3px; }
  .tag-dong { font-size: 0.72rem; }
  .btn { flex: 1 1 45%; min-width: 0; }
}

/* ── 统计实验室（主页卡片 + 弹窗） ── */
.lab-section { margin-top: 8px; }
.lab-section-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

.lab-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.lab-card-wide { grid-column: 1 / -1; }

.lab-card {
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.lab-card:hover,
.lab-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  border-color: var(--accent);
  outline: none;
}
.lab-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--card-text);
}
.lab-brief {
  font-size: 0.82rem;
  color: var(--card-text-2);
  line-height: 1.5;
  min-height: 2.4em;
}
.lab-hint {
  font-size: 0.72rem;
  color: var(--card-text-3);
  display: block;
  margin-top: 0.65rem;
}

.lab-panel {
  width: min(1200px, 96vw);
  max-height: min(90vh, 920px);
}

.lab-modal-body pre {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.75rem;
  border-radius: 8px;
  overflow: auto;
  font-size: 0.78rem;
  max-height: 280px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.lab-table-wrap { overflow-x: auto; margin-top: 0.75rem; }
.lab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.lab-table th,
.lab-table td {
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.4rem 0.55rem;
  text-align: left;
}
.lab-table th {
  background: rgba(255, 255, 255, 0.06);
  color: var(--rp-text, var(--text));
}
.lab-table tr.hit { background: rgba(5, 150, 105, 0.12); }
.lab-table tr.miss { background: rgba(220, 38, 38, 0.08); }

.lab-form {
  display: grid;
  gap: 0.55rem;
  max-width: 420px;
  margin-top: 1rem;
}
.lab-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--rp-text-2, var(--text-secondary));
}
.lab-form input {
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(0, 0, 0, 0.25);
  color: var(--rp-text, var(--text));
}

.lab-btn {
  margin-top: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  width: fit-content;
}
.lab-btn.secondary {
  background: rgba(148, 163, 184, 0.2);
  color: var(--rp-text, var(--text));
}
.lab-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.lab-pager {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--rp-text-2, var(--text-secondary));
}

.lab-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.lab-stat-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 0.65rem;
  border-radius: 10px;
  text-align: center;
}
.lab-stat-box strong {
  display: block;
  font-size: 1.15rem;
  color: #7dd3fc;
  margin-bottom: 0.15rem;
}

.lab-enrich-preview { margin-top: 0.5rem; font-size: 0.8rem; }
.lab-enrich-preview pre { max-height: 180px; }

body.lab-open { overflow: hidden; }

.lab-hint { color: var(--text-secondary); font-size: 0.85rem; margin: 0.5rem 0 0.75rem; line-height: 1.5; }
.lab-overall { margin: 0.75rem 0; font-size: 0.95rem; }
.lab-rate-good { color: var(--mint); }
.lab-rate-bad { color: var(--rose); }
.lab-dim-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.lab-dim-tab {
  padding: 0.35rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.06); color: var(--text-secondary); cursor: pointer; font-size: 0.85rem;
}
.lab-dim-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.lab-dim-panel.hidden { display: none; }
.lab-dim-block h4 { margin: 0.5rem 0; font-size: 0.95rem; }
.lab-stats-inline { margin-bottom: 0.75rem; }
.lab-combo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem;
  max-height: 360px; overflow-y: auto; margin-top: 0.5rem;
}
.lab-combo-card {
  padding: 0.5rem; border-radius: var(--radius-sm); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08); text-align: center; font-size: 0.8rem;
}
.lab-combo-key { font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.lab-combo-nums { color: var(--accent); word-break: break-all; }
.lab-combo-rate { margin-top: 0.25rem; color: var(--text-secondary); }
.lab-detail-cols { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.75rem 0; }
.lab-detail-col { flex: 1; min-width: 240px; font-size: 0.88rem; line-height: 1.7; }
.lab-dim-br { color: #60a5fa; font-style: italic; }
.lab-freq { display: inline-block; margin: 0.1rem 0.2rem; padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.85rem; }
.lab-freq small { opacity: 0.7; margin-left: 2px; }
.lab-freq-5 { background: rgba(234,179,8,0.25); }
.lab-freq-4 { background: rgba(249,115,22,0.2); }
.lab-freq-3 { background: rgba(59,130,246,0.2); }
.lab-freq-2 { background: rgba(16,185,129,0.15); }
.lab-freq-1 { background: rgba(255,255,255,0.06); }
.lab-freq-0 { background: rgba(255,255,255,0.03); opacity: 0.65; }
.lab-num-set { font-size: 1.05rem; line-height: 1.8; word-break: break-all; }
.lab-stats-table td:nth-child(4) { font-weight: 600; }


.miss { color: #f87171; }

/* ── 统计实验室：全屏弹窗（页脚入口） ── */
.bagua-lab-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 20px);
}

.bagua-lab-modal.hidden { display: none; }

.bagua-lab-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
}

.bagua-lab-panel {
  position: relative;
  width: min(98vw, 1440px);
  height: min(96vh, 920px);
  display: flex;
  flex-direction: column;
  background: #0f141c;
  color: #eef2f7;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.bagua-lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: #161c27;
  flex-shrink: 0;
}

.bagua-lab-header-main h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.bagua-lab-sub {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #8b97a8;
}

.bagua-lab-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.bagua-lab-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #b8c2d0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.bagua-lab-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.bagua-lab-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.1rem 1.25rem;
}

body.bagua-lab-open { overflow: hidden; }

.bagua-calc-btn-quick {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  border-color: #059669 !important;
  color: #fff !important;
  font-weight: 600;
  white-space: nowrap;
}

.bagua-calc-btn-quick:disabled { opacity: 0.5; }

@media (max-width: 640px) {
  .bagua-lab-header { flex-wrap: wrap; }
  .bagua-lab-header-actions { width: 100%; justify-content: space-between; }
  .bagua-lab-panel { width: 100%; height: 100%; max-height: 100vh; border-radius: 12px; }
}

/* ── 工作区内容（弹窗内） ── */
.bagua-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bagua-block {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.bagua-block.hidden { display: none; }

.bagua-block-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.bagua-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.bagua-block-hint,
.bagua-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.feat-catalog-hint {
  margin-top: -0.25rem;
}

.bagua-data-bar,
.bagua-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.bagua-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.bagua-stat-chip strong { color: var(--text); font-weight: 600; }

.bagua-calc-toolbar,
.bagua-predict-toolbar,
.bagua-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.bagua-calc-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 0.84rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.bagua-calc-btn:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
}

.bagua-calc-btn:disabled { opacity: 0.38; cursor: not-allowed; }

.bagua-calc-btn.done {
  opacity: 0.55;
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(5, 150, 105, 0.35);
}

.bagua-calc-btn-accent {
  background: var(--accent);
  border-color: var(--accent-dim);
  color: #fff;
}

.bagua-calc-btn-accent:hover:not(:disabled) {
  background: var(--accent-dim);
}

.bagua-progress { margin: 0.5rem 0 0.75rem; }
.bagua-progress.hidden { display: none; }

.bagua-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bagua-progress-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 3px;
  transition: width 0.35s ease;
}

.bagua-progress-text {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.bagua-results-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bagua-dim-panel {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.bagua-dim-panel.hidden { display: none; }

.bagua-dim-summary h4 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  color: var(--text);
}

.bagua-combo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.5rem;
  max-height: none;
  overflow: visible;
  margin-top: 0.5rem;
  padding-right: 0;
}

.bagua-combo-card {
  padding: 0.55rem 0.45rem;
  text-align: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
  transition: transform 0.12s, border-color 0.12s;
}

.bagua-combo-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.4);
}

.bagua-combo-key { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; }
.bagua-combo-line { font-size: 0.75rem; color: #60a5fa; word-break: break-all; }
.bagua-combo-meta { font-size: 0.72rem; margin-top: 0.25rem; color: var(--text-secondary); }

.bagua-rate-up { color: var(--mint); }
.bagua-rate-down { color: var(--rose); }

.bagua-table-wrap { overflow-x: auto; }

.bagua-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.bagua-table th,
.bagua-table td {
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.bagua-table th {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-weight: 600;
}

.bagua-table tr.hit { background: rgba(5, 150, 105, 0.1); }
.bagua-table tr.miss { background: rgba(220, 38, 38, 0.06); }

.bagua-table-compact { margin-top: 0.75rem; }

.bagua-predict-card,
.bagua-predict-result {
  margin-top: 0.5rem;
}

.bagua-predict-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  line-height: 1.65;
}

.bagua-predict-cols > div { flex: 1; min-width: 220px; }

.bagua-dim-line { margin-bottom: 0.35rem; }
.bagua-dim-line em { color: var(--text-tertiary); font-style: normal; font-size: 0.8rem; }
.bagua-branches { color: #60a5fa; }

.bagua-freq {
  display: inline-block;
  margin: 0.1rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  font-size: 0.82rem;
}

.bagua-freq small { opacity: 0.65; margin-left: 2px; }
.bagua-freq-6 { background: rgba(168, 85, 247, 0.24); }
.bagua-freq-5 { background: rgba(234, 179, 8, 0.22); }
.bagua-freq-4 { background: rgba(249, 115, 22, 0.18); }
.bagua-freq-3 { background: rgba(59, 130, 246, 0.18); }
.bagua-freq-2 { background: rgba(16, 185, 129, 0.14); }
.bagua-freq-1 { background: rgba(255, 255, 255, 0.06); }
.bagua-freq-0 { opacity: 0.55; }

.bagua-freq-block { font-size: 0.84rem; }
.bagua-freq-line { margin: 0.35rem 0; }

.bagua-num-line { font-size: 1rem; line-height: 1.75; word-break: break-all; }

.bagua-entry {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(0, 0, 0, 0.12);
}

.bagua-entry summary { cursor: pointer; font-weight: 600; margin-bottom: 0.5rem; }

.bagua-form {
  display: grid;
  gap: 0.5rem;
  max-width: 360px;
  margin-top: 0.5rem;
}

.bagua-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.bagua-form input {
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.bagua-err { color: var(--rose); }

#enrich-preview pre {
  font-size: 0.75rem;
  max-height: 160px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .bagua-calc-toolbar { gap: 0.35rem; }
  .bagua-calc-btn { flex: 1 1 calc(50% - 0.35rem); min-width: 7rem; }
}

.bagua-predict-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.bagua-predict-form label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.bagua-predict-form input[type="date"] {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.bagua-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.65rem 0 0.45rem;
}

.bagua-tab-bar-sub { margin-top: 0.25rem; }

.bagua-tab-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
}

.bagua-tab-btn:hover { border-color: rgba(96, 165, 250, 0.45); color: var(--text); }

.bagua-tab-btn.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.55);
  color: #93c5fd;
}

.bagua-dist-cell {
  font-size: 0.75rem;
  line-height: 1.5;
  max-width: 420px;
}

.bagua-num-stat {
  display: inline-block;
  margin: 0.1rem 0.2rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.num-red { color: #f87171; }
.num-blue { color: #60a5fa; }
.num-green { color: #34d399; }

#number-table-root { margin-top: 0.5rem; }

/* ===== 演算历史 · 顶栏标签 / 笔画猎杀 ===== */
.calc-workspace {
  --text: var(--card-text);
  --text-secondary: var(--card-text-2);
  --text-tertiary: var(--card-text-3);
  --border: var(--card-border);
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.calc-lottery-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0.65rem 0.85rem 0.35rem;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #d7dde8 0%, #cfd6e2 100%);
  border-bottom: 1px solid rgba(100, 116, 139, 0.4);
}

/* 主标签：AO/HK、总决策/梅花/八卦 — 墨色实底选中 */
.calc-lottery-tab {
  border: 1px solid rgba(71, 85, 105, 0.35);
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  padding: 0.42rem 1.35rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.calc-lottery-tab:hover:not(.is-active) {
  color: #334155;
  background: rgba(15, 23, 42, 0.1);
  border-color: rgba(71, 85, 105, 0.5);
}

.calc-lottery-tab.is-active {
  color: #fff;
  background: #0f172a;
  border-color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.28);
}

.calc-family-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0;
  padding: 0.75rem 0.85rem 0.55rem;
  flex-wrap: wrap;
  background:
    linear-gradient(180deg, #e8ecf2 0%, #d9dee6 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.calc-family-tab {
  border: 1px solid rgba(100, 116, 139, 0.3);
  background: rgba(15, 23, 42, 0.05);
  color: #64748b;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.calc-family-tab:hover:not(.is-active) {
  color: #334155;
  background: rgba(15, 23, 42, 0.09);
  border-color: rgba(71, 85, 105, 0.45);
}

.calc-family-tab.is-active {
  color: #fff;
  background: #1e293b;
  border-color: #1e293b;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
}

/* 子标签：专家 pill — 青绿选中，与主标签墨色区分 */
.calc-expert-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0.45rem 0.85rem 0.35rem;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #f1f5f9 0%, #e8ecf2 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.calc-expert-tabs:empty {
  display: none;
}

.calc-expert-tab {
  border: 1px solid rgba(100, 116, 139, 0.22);
  background: rgba(255, 255, 255, 0.55);
  color: #94a3b8;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.calc-expert-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  border-color: rgba(13, 148, 136, 0.35);
}

.calc-expert-tab.is-active {
  color: #fff;
  background: #0f766e;
  border-color: #0f766e;
  box-shadow: 0 1px 6px rgba(15, 118, 110, 0.35);
}

.calc-top-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0.65rem 0.85rem 0;
  flex-wrap: wrap;
  background:
    linear-gradient(180deg, #d9dee6 0%, #cfd5df 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
}

.calc-top-tab[hidden] {
  display: none !important;
}

.calc-pending {
  color: #94a3b8;
  font-size: 0.85em;
}

.calc-top-tab {
  position: relative;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.04);
  color: #94a3b8;
  padding: 0.65rem 1.15rem 0.7rem;
  border-radius: 10px 10px 0 0;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.calc-top-tab:hover:not(.is-active) {
  color: #475569;
  background: rgba(255, 255, 255, 0.45);
}

.calc-top-tab.is-active {
  background: var(--card-bg);
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.35);
  border-bottom-color: var(--card-bg);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.5) inset;
  font-weight: 750;
}

.calc-top-tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #0f766e;
}

.calc-today-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .calc-today-grid { grid-template-columns: 1fr 1fr; }
}

#calc-today-banner .surface-head.compact {
  padding-bottom: 0.35rem;
}
#calc-today-banner .surface-body {
  padding-top: 0.75rem;
  padding-bottom: 1rem;
}
.calc-today-item .calc-kpi-stat-k {
  display: block;
  margin-bottom: 0.25rem;
}
.calc-today-foot {
  margin: 0.65rem 0 0;
}
.calc-expert-tabs:empty {
  display: none;
}

.calc-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: #fff;
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.35;
}

.calc-table th,
.calc-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  text-align: left;
  vertical-align: top;
}

.calc-table thead th {
  position: sticky;
  top: 0;
  background: #eef2f7;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
  z-index: 1;
}

.calc-table tbody tr:hover {
  background: rgba(241, 245, 249, 0.85);
}

.calc-table .calc-six {
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.calc-table .calc-codes {
  max-width: 22rem;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.calc-pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.calc-month-kpi {
  margin-top: 0.75rem;
  padding: 0;
  border: none;
  background: transparent;
}

.calc-month-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.55rem;
}

.calc-month-kpi-tag {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0;
  min-width: 0;
  min-height: 5.4rem;
  padding: 0.65rem 0.55rem 1.65rem;
  border-radius: 10px;
  border: 1px solid #d8dee8;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  font-variant-numeric: tabular-nums;
}

.calc-month-kpi-tag-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  width: 100%;
}

.calc-month-kpi-tag-ym {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.02em;
}

.calc-month-kpi-tag-n {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.calc-month-kpi-tag #btn-rebuild-expert {
  position: absolute;
  right: 0.4rem;
  bottom: 0.38rem;
  margin: 0;
  padding: 0.22rem 0.55rem;
  font-size: 0.74rem;
  line-height: 1.2;
  border-radius: 6px;
}

.calc-month-kpi-tag:has(#btn-rebuild-expert[style*="display: none"]),
.calc-month-kpi-tag:not(:has(#btn-rebuild-expert)) {
  padding-bottom: 0.65rem;
  min-height: 0;
}

.calc-month-kpi-cards {
  display: contents;
}

.calc-month-kpi-cards .calc-kpi-panel {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  min-width: 0;
}

.calc-month-kpi-cards .calc-kpi-panel-body.is-month {
  display: block;
  grid-template-columns: none;
}

.calc-month-kpi-cards .calc-kpi-mini {
  text-align: center;
}

@media (max-width: 720px) {
  .calc-month-kpi {
    margin-top: 0.55rem;
  }
  .calc-month-kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .calc-month-kpi-tag {
    min-height: 4.35rem;
    padding: 0.45rem 0.28rem 1.35rem;
  }
  .calc-month-kpi-tag-ym {
    font-size: 0.72rem;
  }
  .calc-month-kpi-tag-n {
    font-size: 1.12rem;
  }
  .calc-month-kpi-tag #btn-rebuild-expert {
    right: 0.28rem;
    bottom: 0.28rem;
    padding: 0.18rem 0.42rem;
    font-size: 0.68rem;
  }
  .calc-month-kpi-cards .calc-kpi-panel {
    padding: 0.4rem 0.35rem 0.45rem;
  }
  .calc-month-kpi-cards .calc-kpi-panel-head {
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
  }
  .calc-month-kpi-cards .calc-kpi-mini {
    padding: 0.15rem 0.1rem;
  }
  .calc-month-kpi-cards .calc-kpi-mini-v,
  .calc-month-kpi-cards .calc-kpi-mini.is-rate .calc-kpi-mini-v {
    font-size: 1.02rem;
  }
  .calc-month-kpi-cards .calc-kpi-mini-frac {
    font-size: 0.68rem;
  }
}

@media (max-width: 380px) {
  .calc-month-kpi-tag-ym { font-size: 0.68rem; }
  .calc-month-kpi-tag-n { font-size: 1rem; }
  .calc-month-kpi-cards .calc-kpi-mini-v,
  .calc-month-kpi-cards .calc-kpi-mini.is-rate .calc-kpi-mini-v {
    font-size: 0.92rem;
  }
}

.calc-hit {
  display: inline-block;
  margin-right: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.calc-hit.is-yes { color: #15803d; }
.calc-hit.is-no { color: #b91c1c; }

.calc-workspace-body {
  padding: 1rem 1.05rem 1.15rem;
}

.calc-top-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calc-workspace .surface.bagua-block {
  box-shadow: none;
  background: linear-gradient(180deg, #f7f8fb 0%, #eef1f6 100%);
}

.calc-top-panel[hidden] { display: none !important; }

/* 猎杀历史 · 自动轻猎日卡片 */
.lh-day-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.lh-day-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fa 100%);
  overflow: hidden;
}
.lh-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(241, 245, 249, 0.65);
}
.lh-day-date {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.lh-day-meta {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}
.lh-day-body {
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.lh-run-card {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  padding: 0.65rem 0.75rem;
}
.lh-run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.lh-run-time {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}
.lh-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.lh-tag.is-run { background: #dbeafe; color: #1d4ed8; }
.lh-tag.is-beat { background: #dcfce7; color: #15803d; }
.lh-tag.is-ok { background: #f1f5f9; color: #475569; }
.lh-tag.is-skip { background: #fef3c7; color: #b45309; }
.lh-tag.is-err { background: #fee2e2; color: #b91c1c; }
.lh-section { margin-top: 0.35rem; }
.lh-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lh-table { display: flex; flex-direction: column; gap: 2px; }
.lh-row {
  display: grid;
  grid-template-columns: 5.5rem 4.5rem 1fr;
  gap: 0.5rem;
  font-size: 0.78rem;
  padding: 0.2rem 0;
  align-items: start;
}
.lh-row.lh-head {
  color: #94a3b8;
  font-weight: 600;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.25rem;
}
.lh-row.is-beat .lh-action { color: #15803d; font-weight: 600; }
.lh-row.is-err .lh-action { color: #b91c1c; }
.lh-expert { font-weight: 600; color: #0f172a; }
.lh-why { color: #64748b; word-break: break-word; }
.lh-beat-list {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #475569;
}
.lh-beat-list code {
  font-size: 0.7rem;
  background: #f1f5f9;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}
.lh-skip, .lh-err {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: #b45309;
}
.lh-err { color: #b91c1c; }

/* 猎杀历史 · 横版铺排（五块一行） */
.lh-strip {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 9.5rem;
  margin-top: 0.65rem;
  gap: 0;
}
.lh-strip-arrow {
  flex: 0 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 300;
  color: #cbd5e1;
  user-select: none;
}
.lh-panel {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.lh-panel-mode { flex: 1.35 1 0; }
.lh-panel-mode.is-meihua { background: #f5f3ff; }
.lh-panel-mode.is-bagua { background: #f0fdfa; }
.lh-panel-dec {
  flex: 0.85 1 0;
  justify-content: flex-start;
  background: #eff6ff;
}
.lh-panel-dec.is-final { background: #fffbeb; flex: 0.95 1 0; }
.lh-panel-dec.is-beat { background: #ecfdf5; border-color: rgba(22, 163, 74, 0.3); }
.lh-panel-dec.is-err { background: #fef2f2; border-color: rgba(220, 38, 38, 0.35); }
.lh-panel-dec.is-skip { background: #f8fafc; }
.lh-panel-dec.is-trial { background: #fff7ed; border-color: rgba(234, 88, 12, 0.28); }
.lh-panel-dec.is-empty { background: #f8fafc; opacity: 0.8; }
.lh-panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.55rem;
  letter-spacing: 0.03em;
}
.lh-dim-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.lh-dim-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.15);
}
.lh-dim-item.is-beat { background: #dcfce7; border-color: rgba(22, 163, 74, 0.22); }
.lh-dim-item.is-skip { background: rgba(255, 255, 255, 0.55); }
.lh-dim-item.is-trial { background: #ffedd5; border-color: rgba(234, 88, 12, 0.22); }
.lh-dim-item.is-err { background: #fee2e2; border-color: rgba(220, 38, 38, 0.22); }
.lh-dim-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.lh-dim-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}
.lh-dim-act {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.lh-dim-item.is-beat .lh-dim-act { color: #15803d; }
.lh-dim-item.is-err .lh-dim-act { color: #b91c1c; }
.lh-cover-block {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.72rem;
  line-height: 1.45;
  color: #14532d;
}
.lh-cover-reason { font-weight: 600; color: #166534; }
.lh-cover-row { display: flex; gap: 0.4rem; align-items: flex-start; }
.lh-cover-k {
  flex: 0 0 2rem;
  font-weight: 700;
  color: #64748b;
}
.lh-cover-v { flex: 1; color: #1e293b; word-break: break-word; }
.lh-panel-dec .lh-cover-block { background: rgba(255, 255, 255, 0.8); }
.lh-dec-status {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}
.lh-panel-dec.is-beat .lh-dec-status { color: #15803d; }
.lh-panel-dec.is-trial .lh-dec-status { color: #c2410c; }
.lh-panel-dec.is-err .lh-dec-status { color: #b91c1c; }
.lh-dim-item.is-trial .lh-dim-act { color: #c2410c; }
.lh-dec-why {
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: #64748b;
}
.lh-dec-cover {
  margin-top: 0.45rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  background: rgba(220, 252, 231, 0.65);
  font-size: 0.72rem;
  color: #166534;
  line-height: 1.4;
}
.lh-dec-err {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #b91c1c;
}
.lh-run-card { padding: 0.65rem 0.85rem; }
.lh-run-head { margin-bottom: 0.35rem; }
.lh-day-body { padding: 0.65rem 1rem 0.85rem; }
.lh-day-card { border-radius: 16px; }
.lh-tag.is-warn { background: #ffedd5; color: #c2410c; }
@media (max-width: 1100px) {
  .lh-strip {
    flex-wrap: wrap;
    min-height: 0;
    gap: 0.5rem;
  }
  .lh-strip-arrow {
    flex: 0 0 1.5rem;
    font-size: 1.1rem;
  }
  .lh-panel-mode { flex: 1 1 calc(50% - 2rem); min-width: 12rem; }
  .lh-panel-dec { flex: 1 1 calc(33% - 2rem); min-width: 7rem; }
}
@media (max-width: 640px) {
  .lh-day-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.75rem 0.85rem;
  }
  .lh-day-body {
    padding: 0.55rem 0.75rem 0.75rem;
  }
  .lh-tag {
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    max-width: 100%;
  }
  .lh-strip {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.35rem;
    min-height: 0;
  }
  .lh-strip-arrow {
    transform: rotate(90deg);
    flex: 0 0 1.1rem;
    width: auto;
    min-height: 1.1rem;
    font-size: 1rem;
    line-height: 1;
  }
  .lh-panel-mode,
  .lh-panel-dec {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 0.65rem 0.75rem;
  }
  .lh-dim-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.25rem 0.5rem;
  }
  .lh-dim-label {
    font-size: 0.82rem;
  }
  .lh-dim-act {
    font-size: 0.74rem;
    text-align: right;
    flex: 1 1 5.5rem;
    line-height: 1.35;
    word-break: break-word;
  }
  .lh-dec-status {
    font-size: 0.92rem;
    line-height: 1.4;
    word-break: break-word;
  }
  .lh-cover-block {
    font-size: 0.68rem;
    padding: 0.35rem 0.4rem;
  }
  .lh-cover-row {
    flex-direction: column;
    gap: 0.12rem;
  }
  .lh-cover-k {
    flex: none;
    font-size: 0.66rem;
  }
  .lh-cover-v {
    font-size: 0.68rem;
  }
  .lh-dec-why,
  .lh-dec-err {
    font-size: 0.7rem;
    word-break: break-word;
  }
}

@media (max-width: 380px) {
  .lh-day-date { font-size: 0.95rem; }
  .lh-day-meta { font-size: 0.72rem; }
  .lh-panel-title { font-size: 0.78rem; }
  .lh-dim-item { padding: 0.4rem 0.48rem; }
  .lh-dim-act { font-size: 0.7rem; }
  .lh-dec-status { font-size: 0.86rem; }
}

/* 特征说明 · 顶部 KPI 卡片 */
.feat-kpi-card {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.92), rgba(255, 255, 255, 0.98));
}
.feat-kpi-head { margin-bottom: 0.65rem; }
.feat-kpi-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}
.feat-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.25rem, 1fr));
  gap: 0.5rem;
}
.feat-kpi-metric {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.88);
  min-width: 0;
}
.feat-kpi-k {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  color: #64748b;
}
.feat-kpi-v {
  display: block;
  font-size: 1.08rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0.12rem;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.feat-kpi-sub {
  display: block;
  font-style: normal;
  font-size: 0.62rem;
  color: #94a3b8;
  margin-top: 0.08rem;
}
.feat-kpi-desc {
  margin: 0.65rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #475569;
  word-break: break-word;
}

/* 特征说明 · 锁盘 / 登记分区 */
.feat-zone {
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}
.feat-zone:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.feat-zone-title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
}

@media (max-width: 640px) {
  .feat-kpi-card {
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.85rem;
  }
  .feat-kpi-title { font-size: 0.88rem; }
  .feat-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
  .feat-kpi-v { font-size: 0.98rem; }
  .feat-kpi-desc { font-size: 0.74rem; line-height: 1.5; }
  .feat-zone {
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
  }
  .feat-zone-title {
    font-size: 0.84rem;
    margin-bottom: 0.5rem;
  }
  .feat-catalog-hint,
  .hunt-meta-line {
    font-size: 0.76rem;
    line-height: 1.45;
    word-break: break-word;
  }
  .hunt-feat-section-sum {
    font-size: 0.8rem;
    padding: 0.5rem 0.65rem;
    line-height: 1.35;
    word-break: break-word;
  }
  .hunt-feat-section .hunt-feat-grid {
    padding: 0.45rem 0.5rem 0.6rem;
  }
  .hunt-feat-cell {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.2rem 0.45rem;
    padding: 0.4rem 0.48rem;
    font-size: 0.74rem;
  }
  .hunt-feat-key {
    grid-column: 1 / -1;
    font-size: 0.64rem;
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  .hunt-feat-zh {
    word-break: break-word;
  }
}

/* 深色页顶栏：主按钮用浅色块，与「返回主站」同尺寸，仅配色区分 */
.page-lab .page-toolbar-actions .btn-ink,
.page-lab .page-toolbar-actions .btn-frost,
.page-calc-history .page-toolbar-actions .btn-ink,
.page-calc-history .page-toolbar-actions .btn-frost {
  color: #0f172a;
  border-color: rgba(226, 232, 240, 0.85);
  background: linear-gradient(180deg, #ffffff 0%, #e8edf4 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 4px 14px rgba(15, 23, 42, 0.28);
}

.page-lab .page-toolbar-actions .btn-ink:hover:not(:disabled),
.page-lab .page-toolbar-actions .btn-frost:hover:not(:disabled),
.page-calc-history .page-toolbar-actions .btn-ink:hover:not(:disabled),
.page-calc-history .page-toolbar-actions .btn-frost:hover:not(:disabled) {
  filter: brightness(1.03);
  transform: translateY(-1px);
  border-color: #fff;
}

.hunt-hero .surface-head { margin-bottom: 0.35rem; }
.hunt-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}
.hunt-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}
.hunt-field input,
.hunt-field select {
  min-width: 7rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 0.9rem;
}
.hunt-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #475569;
  padding-bottom: 0.35rem;
}
.hunt-progress-wrap { margin-top: 0.35rem; }
.hunt-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.hunt-progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0f766e, #0369a1);
  transition: width 0.35s ease;
}
.hunt-progress-msg {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}
.hunt-sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0 0.75rem;
}
.hunt-sub-tab {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
  color: #475569;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.hunt-sub-tab.is-active {
  background: #134e4a;
  color: #ecfdf5;
  border-color: #134e4a;
}
.hunt-sub-panel[hidden] { display: none !important; }
.hunt-metric-block { margin: 0.75rem 0 1rem; }
.hunt-metric-title {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.92rem;
  color: #0f172a;
}
.hunt-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
@media (max-width: 800px) {
  .hunt-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hunt-metric {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
}
.hunt-metric span {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}
.hunt-metric strong {
  display: block;
  font-size: 1.15rem;
  color: #0f172a;
  margin-top: 0.15rem;
}
.hunt-metric small {
  color: #94a3b8;
  font-size: 0.72rem;
}
.hunt-feat-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.hunt-feat-cloud code {
  font-size: 0.7rem;
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  color: #334155;
}
.hunt-note {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.5;
}
.hunt-meta-line {
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 0.5rem;
}
.hunt-log {
  max-height: 320px;
  overflow: auto;
  background: #0b1220;
  color: #cbd5e1;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.hunt-log-sm { max-height: 220px; }
.hunt-predict-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.hunt-predict-hero > div,
.hunt-predict-out > div {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
.hunt-kicker {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.hunt-predict-out {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 800px) {
  .hunt-predict-hero,
  .hunt-predict-out { grid-template-columns: 1fr 1fr; }
}
.hunt-predict-out span {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}
.hunt-predict-out strong {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
#hunt-predict-root tr.is-top {
  background: rgba(16, 185, 129, 0.12);
}
.hunt-top5 { font-size: 0.72rem; color: #64748b; max-width: 280px; }

.hunt-metric-grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .hunt-metric-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hunt-metric-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hunt-metric.tone-warn {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.22);
}
.hunt-metric.tone-warn strong { color: #c2410c; }
.hunt-compare-wrap { margin: 0.75rem 0 1.1rem; }
.hunt-compare-table td.is-up { color: #047857; font-weight: 700; }
.hunt-compare-table td.is-down { color: #b91c1c; font-weight: 600; }
.hunt-compare-table td.is-tie { color: #64748b; }

.hunt-howto { line-height: 1.65; }
.hunt-tip { font-size: 0.68rem; color: #94a3b8; font-weight: 500; margin-top: 0.15rem; }
.hunt-result-line {
  font-size: 0.88rem;
  color: #0f172a;
  background: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin: 0 0 0.75rem;
}
.hunt-feat-grid { display: flex; flex-direction: column; gap: 0.45rem; }
.hunt-feat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
@media (max-width: 900px) {
  .hunt-feat-row { grid-template-columns: 1fr; }
}
.hunt-feat-cell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  font-size: 0.78rem;
}
.hunt-feat-cell.is-empty { visibility: hidden; }
.hunt-feat-idx {
  font-weight: 700;
  color: #64748b;
  min-width: 1.4rem;
}
.hunt-feat-zh { color: #0f172a; font-weight: 600; }
.hunt-feat-key {
  font-size: 0.68rem;
  color: #64748b;
  background: #eef2ff;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.hunt-feat-section {
  margin: 0.75rem 0 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.hunt-feat-section-sum {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}
.hunt-feat-section-sum::-webkit-details-marker { display: none; }
.hunt-feat-section[open] > .hunt-feat-section-sum {
  border-bottom-color: rgba(148, 163, 184, 0.35);
}
.hunt-feat-section .hunt-feat-grid {
  padding: 0.55rem 0.65rem 0.7rem;
}
.hunt-meta-line {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}

/* 系统数据 · 历史开奖分页 */
.draw-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.draw-history-head h3 {
  margin: 0;
}
.draw-next-hint {
  margin: 0 0 0.55rem;
  color: #64748b;
  font-size: 0.88rem;
}
.draw-pending {
  color: #94a3b8;
  font-size: 0.85em;
}
.rules-table tbody tr.is-pending td {
  background: rgba(148, 163, 184, 0.08);
}
.draw-sync-status {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
}
.draw-sync-status.is-error {
  color: #b91c1c;
}
.draw-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin: 0.65rem 0;
}
.draw-page-meta {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}
.draw-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}
.draw-page-select {
  min-width: 4.2rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 600;
}
.draw-pager .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== 登录 / 用户顶栏 / 隐藏 AI训练入口 ===== */
.nav-lab-hidden,
a.nav-lab-hidden[hidden] {
  display: none !important;
}
/* ── Auth：底栏账号 + putitrading 风玻璃登录 ── */
.footer-auth {
  display: contents;
}

.footer-auth-who {
  display: none;
}
button.site-footer-link {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
}
.auth-modal.open {
  display: flex;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.48);
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 40px 36px 32px;
  border-radius: 16px;
  background: linear-gradient(
    165deg,
    rgba(228, 232, 240, 0.58) 0%,
    rgba(148, 156, 168, 0.3) 48%,
    rgba(62, 68, 80, 0.52) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 28px 56px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  color: #f2f4f8;
}
.auth-modal.open .auth-card {
  transform: translateY(0);
  opacity: 1;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
}
.auth-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(148, 163, 184, 0.35));
}
.auth-title {
  margin: 0 0 28px;
  font-family: var(--font-brand, inherit);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  text-align: center;
  color: #fafbfd;
}
.auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: rgba(232, 234, 239, 0.4);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.auth-close:hover { color: #f2f4f8; }
.auth-form { display: block; }
.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(232, 234, 239, 0.44);
  margin-bottom: 8px;
  font-weight: 500;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8eaef;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}
.auth-field input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}
.auth-enter {
  width: 100%;
  margin-top: 8px;
  cursor: pointer;
  padding: 13px 16px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: #f2f4f8;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(
    165deg,
    rgba(228, 232, 240, 0.58) 0%,
    rgba(148, 156, 168, 0.3) 48%,
    rgba(62, 68, 80, 0.52) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 8px 22px rgba(0, 0, 0, 0.28);
}
.auth-enter:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(
    165deg,
    rgba(242, 244, 248, 0.72) 0%,
    rgba(176, 184, 196, 0.38) 48%,
    rgba(78, 84, 96, 0.46) 100%
  );
  border-color: rgba(255, 255, 255, 0.5);
}
.auth-enter:disabled { opacity: 0.65; cursor: wait; }
.auth-err {
  margin: 12px 0 0;
  min-height: 1.2em;
  color: #f28f8f;
  font-size: 0.82rem;
  text-align: center;
}
.auth-hint {
  margin: 16px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(232, 234, 239, 0.4);
  text-align: center;
}

/* ── 用户后台 ── */
.page-admin .app {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.page-admin .brand-header,
.page-admin .main,
.page-admin .page-toolbar {
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.page-admin .main {
  max-width: 1080px;
}
.page-admin .muted { color: rgba(232, 234, 239, 0.44); font-size: 0.85rem; }
.admin-stack { display: grid; gap: 1.25rem; width: 100%; }
.admin-card {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.03) 100%
  );
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.page-admin .page-toolbar {
  margin-bottom: 0.15rem;
}
.page-admin .page-toolbar-text .muted,
.page-admin .brand-sub,
.admin-edit-hint {
  display: none !important;
}
.admin-card-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}
.admin-card-body { padding: 1.1rem 1.25rem 1.25rem; }
.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}
.admin-form-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.65rem;
}
.admin-form-row .admin-field {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  gap: 0.35rem;
}
.admin-form-row .admin-field-role,
.admin-form-row .admin-field-term {
  flex: 0 0 7.5rem;
}
.admin-edit-card {
  width: min(92vw, 420px);
  max-height: min(90vh, 720px);
  overflow: auto;
}
.admin-edit-form {
  display: grid;
  gap: 0.75rem;
}
.admin-edit-form .admin-field {
  display: grid;
  gap: 0.3rem;
}
.admin-edit-form label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(232, 234, 239, 0.44);
}
.admin-edit-form input,
.admin-edit-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  color: #f2f4f8;
  font: inherit;
}
.admin-edit-form input:disabled {
  opacity: 0.55;
}
.admin-edit-hint {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(232, 234, 239, 0.4);
}
.admin-edit-actions {
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.admin-edit-spacer {
  flex: 1 1 auto;
}
.admin-form-row .admin-form-actions {
  flex: 0 0 auto;
  margin: 0;
  padding-bottom: 1px;
}
.admin-form .admin-field { display: grid; gap: 0.35rem; }
.admin-form .admin-field-full { grid-column: 1 / -1; }
.admin-form label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(232, 234, 239, 0.44);
}
.admin-form input,
.admin-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  color: #f2f4f8;
  font: inherit;
  outline: none;
}
.admin-form input:focus,
.admin-form select:focus {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.admin-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.admin-btn-grad {
  cursor: pointer;
  padding: 0.7rem 1.35rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #f2f4f8;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(
    165deg,
    rgba(228, 232, 240, 0.58) 0%,
    rgba(148, 156, 168, 0.3) 48%,
    rgba(62, 68, 80, 0.52) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}
.admin-btn-grad:hover {
  background: linear-gradient(
    165deg,
    rgba(242, 244, 248, 0.72) 0%,
    rgba(176, 184, 196, 0.38) 48%,
    rgba(78, 84, 96, 0.46) 100%
  );
}
.admin-btn-ghost {
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(242, 244, 248, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}
.admin-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}
.admin-btn-danger {
  cursor: pointer;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.75rem;
  color: #f28f8f;
  border: 1px solid rgba(242, 143, 143, 0.35);
  background: rgba(239, 107, 107, 0.08);
}
.admin-btn-danger:hover {
  background: rgba(239, 107, 107, 0.18);
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: rgba(232, 234, 239, 0.44);
  font-weight: 500;
  padding: 0.45rem 0.55rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-table td {
  padding: 0.75rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
  color: rgba(242, 244, 248, 0.92);
}
.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.admin-user-cell { display: grid; gap: 0.15rem; }
.admin-user-name { font-weight: 560; letter-spacing: 0.04em; }
.admin-user-sub {
  font-size: 0.72rem;
  color: rgba(232, 234, 239, 0.4);
}
.admin-ip-cell {
  display: grid;
  gap: 0.12rem;
  font-size: 0.8rem;
  line-height: 1.35;
  max-width: 14rem;
}
.admin-ip { letter-spacing: 0.02em; }
.admin-ip-loc {
  color: rgba(232, 234, 239, 0.44);
  font-size: 0.72rem;
}
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(232, 234, 239, 0.78);
}
.admin-badge-ok {
  border-color: rgba(52, 194, 134, 0.35);
  background: rgba(52, 194, 134, 0.12);
  color: #5ad4a0;
}
.admin-badge-bad {
  border-color: rgba(242, 143, 143, 0.35);
  background: rgba(239, 107, 107, 0.12);
  color: #f28f8f;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.admin-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(232, 234, 239, 0.4);
  letter-spacing: 0.08em;
}
.admin-pwd-modal {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.48);
}
.admin-pwd-modal.open { display: flex; }
.admin-pwd-card {
  width: min(92vw, 340px);
  padding: 1.4rem 1.35rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(
    165deg,
    rgba(40, 44, 54, 0.92) 0%,
    rgba(18, 20, 26, 0.96) 100%
  );
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.admin-pwd-card h3 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
}
.admin-pwd-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  color: #f2f4f8;
  font: inherit;
}
.admin-pwd-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}
@media (max-width: 640px) {
  .footer-auth {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .auth-card { padding: 32px 24px 28px; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form-row {
    flex-wrap: wrap;
  }
  .admin-form-row .admin-field,
  .admin-form-row .admin-field-role {
    flex: 1 1 calc(50% - 0.4rem);
  }
  .admin-form-row .admin-form-actions {
    flex: 1 1 100%;
  }
}

.calc-kpi-row-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.calc-kpi-row-metrics.is-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calc-cell-infer {
  white-space: nowrap;
  text-align: center;
}

.btn-infer-detail {
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 650;
  border-radius: 8px;
}

.calc-wei-only .wei-head {
  letter-spacing: 0.06em;
}

.calc-infer-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.calc-infer-modal.open {
  display: flex;
}

.calc-infer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
}

.calc-infer-modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #d8e0ea;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  padding: 1rem 1.05rem 1.15rem;
}

.calc-infer-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.calc-infer-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  color: #0f172a;
}

.calc-infer-modal-meta {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.calc-infer-modal-body {
  display: grid;
  gap: 0.75rem;
}

.calc-infer-block {
  border-radius: 12px;
  border: 1px solid #dbe3ee;
  background: #fff;
  padding: 0.7rem 0.8rem;
}

.calc-infer-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
}

.calc-infer-block-head small {
  font-weight: 600;
  color: #94a3b8;
}

.calc-infer-block-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem 0.35rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  color: #0f172a;
}

.infer-code {
  display: inline-block;
  min-width: 1.55rem;
  text-align: center;
  padding: 0.08rem 0.18rem;
  border-radius: 5px;
  background: #eef2f7;
  font-size: 0.8rem;
  font-weight: 650;
}

.infer-code.is-hit {
  background: #dcfce7;
  color: #166534;
  font-weight: 800;
}

.calc-you-tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  vertical-align: middle;
}

.calc-table tbody tr.is-pending td {
  background: #fff;
}

.calc-table tbody tr.is-xiao-miss,
.calc-table tbody tr.is-xiao-miss:hover {
  background: var(
    --ch-miss-xiao-grad,
    linear-gradient(90deg, #fef9fb 0%, #fdf3f7 50%, #fbecf1 100%)
  );
}

.calc-table tbody tr.is-xiao-miss > td,
.calc-table tbody tr.is-xiao-miss:hover > td {
  background: transparent;
}

.calc-table tbody tr:not(.is-xiao-miss):not(.is-streak-hl) > td {
  background: #fff;
}

.calc-table tbody tr:not(.is-xiao-miss):not(.is-streak-hl):hover > td {
  background: #fff;
}

.calc-cell-pred-codes {
  max-width: 22rem;
  min-width: 12rem;
  font-size: 0.78rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.calc-cell-pred-codes .pred-code {
  display: inline-block;
  margin: 0.05rem 0.12rem;
  color: #334155;
  font-weight: 650;
}

.calc-cell-pred-codes .pred-code.is-hit,
.calc-wei-only .wei-digit.is-hit {
  color: #047857;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 999px;
  min-width: 1.6em;
  min-height: 1.6em;
  padding: 0.14em 0.3em;
  line-height: 1.15;
  text-align: center;
  box-sizing: border-box;
  display: inline-block;
}



.calc-kpi-panel.is-pred {
  /* 归属大卡统一配色，见 .calc-kpi-shell .calc-kpi-panel */
}

.calc-kpi-mini.is-you .calc-kpi-mini-k {
  color: #92400e;
}
.calc-kpi-mini.is-you .calc-kpi-mini-v {
  color: #b45309;
}

.calc-wei-only .wei-digit {
  display: inline-block;
  margin: 0 0.04rem;
  min-width: 1.05em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: #334155;
}


/* 底栏 Tab：桌面全文 pill；移动端图标短文 +「我的」半屏 */
.site-footer-link .tab-ico { display: none; }
.site-footer-link .tab-txt-short { display: none; }
.site-footer-link .tab-txt-full { display: inline; }
.site-footer-link.tab-mine { display: none; }
.site-footer-link.tab-mine.is-member-hidden,
.site-footer-link.tab-mine[hidden] { display: none !important; }
.footer-session-bar { display: none !important; }
.site-mine-sheet { display: none; }
.app-hide-mobile { }
.calc-kpi-train-toggle { display: none; }

/* ===== 2026-09-15 · 移动端 TabBar + 数据/历史精简（正确版） ===== */
@media (max-width: 720px) {
  :root { --mobile-dock-h: 56px; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    padding-bottom: calc(var(--mobile-dock-h) + env(safe-area-inset-bottom, 0px) + 12px);
  }
  body.mine-sheet-open { overflow: hidden; }
  .app {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 16px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .app-hide-mobile { display: none !important; }

  /* LOGO 保留，仅压矮 */
  .page-calc-history .brand-header,
  .page-rules .brand-header {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
  }

  .page-calc-history .brand-header-compact,
  .page-rules .brand-header-compact { padding: 14px 0 6px; }
  .page-calc-history .bagua-logo-wrap-sm,
  .page-rules .bagua-logo-wrap-sm {
    width: 44px; height: 44px; margin-bottom: 4px;
  }
  .page-calc-history .bagua-logo-wrap-sm .bagua-logo-spin,
  .page-rules .bagua-logo-wrap-sm .bagua-logo-spin {
    width: 40px; height: 40px;
  }
  .page-calc-history .title-main,
  .page-rules .title-main {
    font-size: 1.15rem; letter-spacing: 0.14em; text-indent: 0.14em;
  }
  .page-toolbar {
    flex-direction: column; align-items: stretch; gap: 0.35rem; margin-bottom: 0.55rem;
  }
  .page-calc-history .page-title,
  .page-rules .page-title { font-size: 1rem; margin: 0; }

  body.page-calc-history .calc-workspace {
    border-radius: 10px;
    box-shadow: none;
  }

  body.page-calc-history .calc-lottery-tabs,
  body.page-calc-history .calc-family-tabs,
  body.page-calc-history .calc-expert-tabs,
  body.page-calc-history .calc-top-tabs {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* AO / HK：移动端两卡片铺满一行 */
  body.page-calc-history .calc-lottery-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 0.4rem;
    padding-top: 0.45rem;
    padding-bottom: 0.4rem;
  }

  body.page-calc-history .calc-lottery-tab {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    text-align: center;
    padding: 0.52rem 0.35rem;
    border-radius: 8px;
    font-size: 0.92rem;
  }

  body.page-calc-history .calc-family-tab,
  body.page-calc-history .calc-expert-tab,
  body.page-calc-history .calc-top-tab {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    font-size: 0.82rem;
  }

  /* 当月 KPI：移动端保持横版四格（年月 | 六肖 | 六尾 | 码） */
  body.page-calc-history .calc-month-kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.32rem;
  }

  body.page-calc-history .calc-month-kpi-tag {
    min-height: 4.2rem;
    padding: 0.42rem 0.24rem 1.28rem;
  }

  body.page-calc-history .calc-month-kpi-tag #btn-rebuild-expert {
    position: absolute;
    right: 0.22rem;
    bottom: 0.22rem;
    margin: 0;
    padding: 0.14rem 0.36rem;
    font-size: 0.62rem;
  }

  body.page-calc-history .calc-six .xiao-digit.is-hit,
  body.page-calc-history .calc-wei-only .wei-digit.is-hit,
  body.page-calc-history .calc-cell-pred-codes .pred-code.is-hit {
    min-width: 1.45em;
    min-height: 1.45em;
    padding: 0.08em 0.22em;
    font-size: 0.95em;
  }

  body.page-calc-history .calc-you-tag {
    font-size: 0.62rem;
    padding: 0.04rem 0.28rem;
  }

  body.page-calc-history .calc-kpi-train-toggle {
    color: #3d6278;
  }

  /* App TabBar */
  .site-footer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; margin-top: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(12, 16, 24, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
  }

  .site-footer-brand, .site-footer-bar { display: none !important; }
  .site-footer-inner {
    display: block; width: 100%; max-width: none; margin: 0;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
  }
  .footer-auth { display: none !important; }
  .site-footer-nav.site-tabbar, .site-footer-nav {
    display: flex; flex-wrap: nowrap; width: 100%; gap: 0;
    min-height: var(--mobile-dock-h); padding: 0;
  }
  .site-footer-nav > .site-footer-link,
  .site-footer-nav > a.site-footer-link,
  .site-footer-nav > button.site-footer-link {
    flex: 1 1 0; min-width: 0; margin: 0;
    border: 0 !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important;
    color: rgba(148, 163, 184, 0.92);
    min-height: var(--mobile-dock-h); padding: 6px 2px 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font-size: 0.62rem; font-weight: 650; letter-spacing: 0; line-height: 1.1;
    -webkit-tap-highlight-color: transparent;
  }
  .site-footer-nav > .site-footer-link.is-active,
  .site-footer-nav > .site-footer-link.tab-mine[aria-expanded="true"] {
    color: #5eead4; font-weight: 780;
  }
  .site-footer-link .tab-ico {
    display: block; width: 22px; height: 22px; background: currentColor; opacity: 0.88;
    -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
  }
  .site-footer-link.is-active .tab-ico,
  .site-footer-link.tab-mine[aria-expanded="true"] .tab-ico { opacity: 1; }
  .site-footer-link[data-tab="home"] .tab-ico {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 3.2 3.5 10.2V21h5.5v-6.2h6V21H20.5V10.2L12 3.2z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 3.2 3.5 10.2V21h5.5v-6.2h6V21H20.5V10.2L12 3.2z'/></svg>");
  }
  .site-footer-link[data-tab="data"] .tab-ico {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h16v3.2H4V4zm0 6.4h16V20H4V10.4zm2.4 2.2v5.2h4.2v-5.2H6.4zm6.2 0V20H18v-7.4h-5.4z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M4 4h16v3.2H4V4zm0 6.4h16V20H4V10.4zm2.4 2.2v5.2h4.2v-5.2H6.4zm6.2 0V20H18v-7.4h-5.4z'/></svg>");
  }
  .site-footer-link[data-tab="hist"] .tab-ico {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 3.5a8.5 8.5 0 1 0 8.2 10.6h-2.1A6.4 6.4 0 1 1 12 5.6c1.7 0 3.2.6 4.4 1.7L14 9.7h6.5V3.2l-2.3 2.3A8.45 8.45 0 0 0 12 3.5zm-.9 4.2v5.1l4.2 2.5.9-1.5-3.3-1.9V7.7h-1.8z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 3.5a8.5 8.5 0 1 0 8.2 10.6h-2.1A6.4 6.4 0 1 1 12 5.6c1.7 0 3.2.6 4.4 1.7L14 9.7h6.5V3.2l-2.3 2.3A8.45 8.45 0 0 0 12 3.5zm-.9 4.2v5.1l4.2 2.5.9-1.5-3.3-1.9V7.7h-1.8z'/></svg>");
  }
  .site-footer-link[data-tab="mine"] .tab-ico {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 3.8a4.2 4.2 0 1 1 0 8.4 4.2 4.2 0 0 1 0-8.4zm0 10.1c4.1 0 7.7 2.1 7.7 5.1v1.2H4.3V19c0-3 3.6-5.1 7.7-5.1z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M12 3.8a4.2 4.2 0 1 1 0 8.4 4.2 4.2 0 0 1 0-8.4zm0 10.1c4.1 0 7.7 2.1 7.7 5.1v1.2H4.3V19c0-3 3.6-5.1 7.7-5.1z'/></svg>");
  }
  .site-footer-link .tab-txt-short { display: block; }
  .site-footer-link .tab-txt-full { display: none; }
  .site-footer-link.tab-mine { display: flex; }
  .site-footer-link.tab-mine.is-member-hidden,
  .site-footer-link.tab-mine[hidden] { display: none !important; }
  .site-footer-nav > .nav-lab-hidden { display: none !important; }

  .site-mine-sheet {
    display: block; position: fixed; inset: 0; z-index: 95; pointer-events: none;
  }
  .site-mine-sheet[hidden] { display: none !important; }
  .site-mine-sheet.is-open { pointer-events: auto; }
  .site-mine-sheet-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,0.45);
    opacity: 0; transition: opacity 0.2s ease;
  }
  .site-mine-sheet.is-open .site-mine-sheet-backdrop { opacity: 1; }
  .site-mine-sheet-panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 8px 16px calc(14px + var(--mobile-dock-h) + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0; background: #0f172a;
    border-top: 1px solid rgba(148,163,184,0.28);
    transform: translateY(110%); transition: transform 0.22s ease;
  }
  .site-mine-sheet.is-open .site-mine-sheet-panel { transform: translateY(0); }
  .site-mine-sheet-grab {
    width: 36px; height: 4px; border-radius: 999px;
    background: rgba(148,163,184,0.45); margin: 4px auto 12px;
  }
  .site-mine-sheet-title {
    margin: 0 0 8px; font-size: 0.9rem; font-weight: 750; color: #e2e8f0;
  }
  .site-mine-sheet-who { margin: 0 0 12px; font-size: 0.78rem; color: #94a3b8; }
  .site-mine-sheet-actions { display: flex; flex-direction: column; gap: 8px; }
  .site-mine-sheet-actions a,
  .site-mine-sheet-actions button {
    display: flex; align-items: center; justify-content: center;
    min-height: 44px; border-radius: 12px; font-size: 0.9rem; font-weight: 700;
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
  }
  .site-mine-act-admin {
    background: rgba(15, 118, 110, 0.35);
    border-color: rgba(45, 212, 191, 0.45) !important;
    color: #99f6e4 !important;
  }
  .site-mine-act-out {
    background: rgba(127, 29, 29, 0.4);
    border-color: rgba(248, 113, 113, 0.45) !important;
    color: #fecaca !important;
  }

  .calc-lottery-tabs, .calc-family-tabs, .calc-expert-tabs, .calc-top-tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .calc-lottery-tabs::-webkit-scrollbar,
  .calc-family-tabs::-webkit-scrollbar,
  .calc-expert-tabs::-webkit-scrollbar,
  .calc-top-tabs::-webkit-scrollbar { display: none; }
  .calc-lottery-tab, .calc-family-tab, .calc-expert-tab, .calc-top-tab {
    flex: 0 0 auto; white-space: nowrap;
  }

  /* KPI：单列竖排，禁 height 均分叠字；训练默认可折叠 */
  .calc-kpi-board.is-duo { grid-template-columns: 1fr; gap: 0.5rem; }
  .calc-kpi-shell { padding: 0.45rem 0.5rem 0.5rem; height: auto !important; }
  .calc-kpi-shell-head {
    display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap;
    margin-bottom: 0.4rem; padding-bottom: 0.35rem;
  }
  .calc-kpi-shell-body,
  .calc-kpi-shell.row-train .calc-kpi-shell-block,
  .calc-kpi-shell.row-live .calc-kpi-panel,
  .calc-kpi-shell.row-train .calc-kpi-panel {
    height: auto !important;
    min-height: 0;
    flex: none !important;
  }
  .calc-kpi-shell.row-live .calc-kpi-row-metrics.is-stack {
    grid-template-rows: none !important;
    height: auto !important;
    gap: 0.4rem;
  }
  .calc-kpi-row-metrics,
  .calc-kpi-row-metrics.is-cols-3 {
    grid-template-columns: 1fr !important;
    gap: 0.4rem;
    height: auto !important;
  }
  .calc-kpi-panel { padding: 0.4rem 0.45rem; height: auto !important; }
  .calc-kpi-panel-head { font-size: 0.72rem; margin-bottom: 0.25rem; }
  /* 大卡已单列满宽：组内可横排（与通畅的实盘卡一致），勿再挤三列 */
  .calc-kpi-panel-body.is-groups {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) !important;
    gap: 0.3rem;
    align-content: start !important;
  }
  .calc-kpi-group {
    gap: 0.25rem;
    padding: 0.22rem;
    min-width: 0;
  }
  .calc-kpi-group.is-roll { flex-direction: row !important; }
  .calc-kpi-group-main,
  .calc-kpi-group-side { flex: 1 1 0; min-width: 0; width: auto; }
  .calc-kpi-mini { padding: 0.3rem 0.35rem; gap: 0.08rem; overflow: hidden; }
  .calc-kpi-mini-k { font-size: 0.6rem; }
  .calc-kpi-mini-v,
  .calc-kpi-mini.is-rate .calc-kpi-mini-v {
    font-size: 0.95rem !important;
    line-height: 1.2;
  }
  .calc-kpi-streak-n { font-size: 0.88rem; }
  .calc-kpi-mini-frac { font-size: 0.62rem; }
  .calc-kpi-shell.row-train.is-collapsed .calc-kpi-shell-body { display: none; }
  .calc-kpi-train-toggle {
    display: inline-flex; align-items: center; margin-left: auto;
    border: 0; background: transparent; color: #92400e;
    font-size: 0.72rem; font-weight: 700; cursor: pointer; padding: 0.15rem 0.25rem;
  }

  /* 历史：width max-content 真横滑，不压叠；藏次要列 */
  .calc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    overscroll-behavior-x: contain;
  }
  .calc-table {
    width: max-content !important;
    min-width: 100%;
    table-layout: auto;
    font-size: 0.72rem;
  }
  .calc-table th, .calc-table td {
    padding: 0.3rem 0.35rem;
    white-space: nowrap;
    vertical-align: middle;
  }
  .calc-table th:nth-child(3), .calc-table td:nth-child(3),
  .calc-table th:nth-child(4), .calc-table td:nth-child(4),
  .calc-table th:nth-child(5), .calc-table td:nth-child(5),
  .calc-table th:nth-child(7), .calc-table td:nth-child(7),
  .calc-table th:nth-child(8), .calc-table td:nth-child(8) { display: none; }
  /* 预测码：固定宽 + 强制换行，禁止溢到命中/明细 */
  .calc-table td.calc-cell-pred-codes,
  .calc-table th:nth-child(11) {
    white-space: normal !important;
    min-width: 5.2rem !important;
    max-width: 6.6rem !important;
    width: 6.6rem;
    overflow: hidden;
    vertical-align: top;
    word-break: break-all;
    line-height: 1.35;
    font-size: 0.66rem;
  }
  .calc-cell-pred-codes .pred-code {
    margin: 0 0.06rem 0.05rem 0;
  }
  .calc-cell-pred-codes .calc-you-tag,
  .calc-cell-pred-codes > small {
    display: inline-block;
    margin-top: 0.1rem;
  }
  .calc-table td:nth-child(12),
  .calc-table th:nth-child(12) {
    white-space: nowrap !important;
    vertical-align: middle;
  }
  .calc-cell-infer { white-space: nowrap !important; }
  .btn-infer-detail {
    min-height: 30px; padding: 0.22rem 0.4rem; font-size: 0.68rem;
    white-space: nowrap;
  }

  .page-rules .rules-nav-tier { flex-direction: column; gap: 6px; padding: 10px 12px; min-width: 0; max-width: 100%; }
  .page-rules .rules-nav { min-width: 0; max-width: 100%; }
  .page-rules .rules-surface { min-width: 0; }
  .page-rules .rules-nav-tier-child::before { display: none; }
  /* 分类：换行展全（长文案别塞横滑） */
  .page-rules .rules-nav-parents {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }
  .page-rules .rules-tab-parent {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 0.76rem;
  }
  /* 子表 / 年：真横滑（年可能很多） */
  .page-rules .rules-nav-children,
  .page-rules .rules-nav-years {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }
  .page-rules .rules-nav-children::-webkit-scrollbar,
  .page-rules .rules-nav-years::-webkit-scrollbar { height: 3px; }
  .page-rules .rules-tab-child,
  .page-rules .rules-tab-year { flex: 0 0 auto; white-space: nowrap; }
  .page-rules .rules-body { padding: 12px; min-width: 0; }
  .page-rules .rules-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .page-rules .rules-table { font-size: 0.74rem; min-width: 480px; }
  .page-rules .rules-table th, .page-rules .rules-table td { padding: 0.35rem 0.4rem; }

  .calc-infer-modal-card, .auth-card {
    width: calc(100vw - 20px); max-width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    overflow: auto;
  }
}

/* ===== 演算历史 · 深色全局 + 内容白卡（禁黄） ===== */
/* 全局背景走全站 ambient 深色；仅 calc-workspace / 表格等内容区白底 */

.page-calc-history {
  --ch-pearl: #ffffff;
  --ch-surface: #ffffff;
  --ch-ink: #101418;
  --ch-ink-soft: #2a3038;
  --ch-muted: #6b7280;
  --ch-border: rgba(30, 41, 59, 0.11);
  --ch-border-strong: rgba(30, 41, 59, 0.18);
  --ch-accent: #2c4a62;
  --ch-accent-soft: #3d6278;
  --ch-navy: #151b24;
  --ch-navy-mid: #1f2833;
  --ch-you-fg: #475569;
  --ch-bd-live: rgba(44, 74, 98, 0.28);
  --ch-bd-train: rgba(30, 41, 59, 0.2);
  --ch-bd-xiao: rgba(200, 130, 150, 0.55);
  --ch-bd-wei: rgba(74, 115, 104, 0.5);
  --ch-bd-pred: rgba(60, 90, 120, 0.48);
  --ch-bd-you: rgba(71, 85, 105, 0.28);
  --ch-miss-xiao-grad: linear-gradient(90deg, #fef9fb 0%, #fdf3f7 50%, #fbecf1 100%);
  --ch-miss-xiao-bd: #dfa0b2;
  --ch-miss-xiao-bd-soft: rgba(223, 160, 178, 0.22);
  --ch-kline-arrow-grad: linear-gradient(90deg, #f0fdf4 0%, #ecfdf5 50%, #d1fae5 100%);
  --ch-kline-arrow-bd-soft: rgba(52, 211, 153, 0.22);
  --ch-pending-fg: #475569;
  --ch-win-fg: #2f6f5e;
  --ch-win-bd: rgba(47, 111, 94, 0.42);
  --ch-lose-fg: #b04a5a;
  --ch-lose-bd: rgba(176, 74, 90, 0.42);
  --ch-tab-bar: #ffffff;
  --ch-tab-inactive-bg: transparent;
  --ch-tab-inactive-fg: #64748b;
  --ch-tab-active: linear-gradient(180deg, #273040 0%, #151b24 100%);
  --ch-kpi-bd-black: #101418;
  --ch-kpi-bd-grey: rgba(30, 41, 59, 0.32);
  --ch-kpi-bd-grey-light: rgba(100, 116, 139, 0.38);
  --ch-kpi-you: #6d28d9;
}

.page-calc-history .calc-workspace {
  background: var(--ch-pearl);
  border-color: var(--ch-border);
  box-shadow: 0 1px 4px rgba(16, 20, 28, 0.05);
}

.page-calc-history .calc-lottery-tabs,
.page-calc-history .calc-family-tabs,
.page-calc-history .calc-expert-tabs,
.page-calc-history .calc-top-tabs {
  background: var(--ch-tab-bar);
  border-bottom-color: var(--ch-border-strong);
}

.page-calc-history .calc-lottery-tab:not(.is-active),
.page-calc-history .calc-family-tab:not(.is-active) {
  color: var(--ch-tab-inactive-fg);
  background: var(--ch-tab-inactive-bg);
  border-color: var(--ch-border);
}

.page-calc-history .calc-lottery-tab.is-active,
.page-calc-history .calc-family-tab.is-active {
  color: #f5f6f7;
  background: var(--ch-tab-active);
  border-color: #1e232b;
  box-shadow: 0 3px 14px rgba(12, 14, 18, 0.32);
}

.page-calc-history .calc-expert-tab.is-active {
  background: var(--ch-accent-soft);
  border-color: var(--ch-accent-soft);
  box-shadow: 0 2px 12px rgba(47, 69, 69, 0.24);
}

.page-calc-history .calc-top-tab.is-active {
  color: var(--ch-accent);
  border-color: rgba(47, 69, 69, 0.22);
}

.page-calc-history .calc-top-tab.is-active::after {
  background: var(--ch-accent-soft);
}

.page-calc-history .calc-kpi-shell.row-live,
.page-calc-history .calc-kpi-shell.row-train {
  background: transparent;
  border: 1px solid rgba(30, 41, 59, 0.14);
  box-shadow: none;
}

.page-calc-history .calc-kpi-shell-head {
  border-bottom: 1px solid rgba(30, 41, 59, 0.1);
}

.page-calc-history .calc-kpi-shell-head,
.page-calc-history .calc-kpi-row-title {
  color: var(--ch-ink-soft);
}

.page-calc-history .calc-kpi-row-title.is-sub {
  color: var(--ch-muted);
}

/* 大卡：黑框 · 透明底 */
.page-calc-history .calc-kpi-shell .calc-kpi-panel,
.page-calc-history .calc-month-kpi-cards .calc-kpi-panel {
  background: transparent;
  border: 1.5px solid var(--ch-kpi-bd-black);
  box-shadow: none;
}

.page-calc-history .calc-kpi-panel-head {
  color: var(--ch-ink-soft);
}

.page-calc-history .calc-kpi-panel-body.is-groups {
  gap: 0.35rem;
}

/* 组：无边框，只留间距 */
.page-calc-history .calc-kpi-group.is-roll,
.page-calc-history .calc-kpi-group.is-you {
  background: transparent;
  border: none;
  padding: 0;
  gap: 0.35rem;
}

/* 小卡：灰框 · 透明底 */
.page-calc-history .calc-kpi-mini {
  background: transparent;
  border: 1px solid var(--ch-kpi-bd-grey);
  box-shadow: none;
}

.page-calc-history .calc-kpi-mini-k,
.page-calc-history .calc-kpi-mini-frac,
.page-calc-history .calc-kpi-mini-v small,
.page-calc-history .calc-kpi-streak-k {
  color: var(--ch-muted);
}

.page-calc-history .calc-kpi-mini-v,
.page-calc-history .calc-kpi-hero-num,
.page-calc-history .calc-kpi-streak-n {
  color: var(--ch-ink);
}

.page-calc-history .calc-kpi-mini.is-you {
  background: transparent;
  border: 1px dashed rgba(109, 40, 217, 0.38);
}

.page-calc-history .calc-kpi-mini.is-you .calc-kpi-mini-k,
.page-calc-history .calc-kpi-mini.is-you .calc-kpi-mini-v {
  color: var(--ch-kpi-you);
}

.page-calc-history .calc-kpi-streak-part.is-lose .calc-kpi-streak-k,
.page-calc-history .calc-kpi-streak-part.is-lose .calc-kpi-streak-n,
.page-calc-history .calc-kpi-mini.is-lose .calc-kpi-mini-v,
.page-calc-history .calc-kpi-occur {
  color: var(--ch-lose-fg);
}

.page-calc-history button.calc-kpi-mini.is-jump:hover,
.page-calc-history button.calc-kpi-streak-part.is-jump:hover {
  border-color: var(--ch-kpi-bd-grey-light);
  box-shadow: none;
}

.page-calc-history button.calc-kpi-mini.is-jump.is-active,
.page-calc-history button.calc-kpi-streak-part.is-jump.is-active {
  background: transparent;
  border-color: var(--ch-kpi-bd-black);
  box-shadow: none;
}

.page-calc-history .calc-kpi-group.is-roll .calc-kpi-mini.is-streak {
  background: transparent;
}

.page-calc-history button.calc-kpi-streak-part.is-jump:hover,
.page-calc-history button.calc-kpi-streak-part.is-jump.is-active {
  background: transparent;
}

.page-calc-history button.calc-kpi-mini.is-jump.is-lose.is-active {
  background: transparent;
}

.page-calc-history .calc-you-tag {
  color: var(--ch-kpi-you);
  background: transparent;
  border: 1px solid rgba(109, 40, 217, 0.32);
}

.page-calc-history .calc-kpi-train-toggle {
  color: var(--ch-accent-soft);
}

.page-calc-history .calc-kpi-row-empty {
  background: transparent;
  border: 1px dashed var(--ch-kpi-bd-grey-light);
  color: var(--ch-muted);
}

/* 月 KPI：日期黑框 + 三列黑框 */
.page-calc-history .calc-month-kpi-tag {
  background: transparent;
  border: 1.5px solid var(--ch-kpi-bd-black);
  box-shadow: none;
}

.page-calc-history .calc-month-kpi-tag-ym {
  color: var(--ch-muted);
}

.page-calc-history .calc-month-kpi-tag-n {
  color: var(--ch-ink);
}

.page-calc-history .calc-month-kpi-cards .calc-kpi-mini {
  background: transparent;
  border: none;
  padding: 0.15rem 0;
}

.page-calc-history .calc-month-kpi-cards .calc-kpi-panel-head {
  color: var(--ch-ink-soft);
}

.page-calc-history .calc-month-kpi-cards .calc-kpi-mini-v,
.page-calc-history .calc-month-kpi-cards .calc-kpi-mini-k {
  color: var(--ch-ink);
}

.page-calc-history .surface.bagua-block {
  background: transparent;
  border: none;
  box-shadow: none;
}

.page-calc-history .surface.bagua-block .surface-head {
  border-bottom-color: var(--ch-border);
}

.page-calc-history .calc-hist-head.compact {
  display: none;
}

.page-calc-history .bagua-block-title {
  color: var(--ch-ink-soft);
  letter-spacing: 0.04em;
}

.page-calc-history .calc-zhi {
  font-weight: 750;
  letter-spacing: 0.04em;
}

.page-calc-history .calc-table .num-red {
  color: #dc2626;
  font-weight: 750;
}

.page-calc-history .calc-table .num-blue {
  color: #2563eb;
  font-weight: 750;
}

.page-calc-history .calc-table .num-green {
  color: #059669;
  font-weight: 750;
}

.page-calc-history .calc-table-wrap {
  border-color: var(--ch-border-strong);
  border-radius: 14px;
  background: var(--ch-surface);
  box-shadow: 0 8px 28px rgba(20, 24, 32, 0.06);
}

.page-calc-history .calc-table thead th {
  background: linear-gradient(180deg, var(--ch-navy-mid) 0%, var(--ch-navy) 100%);
  color: #eef2f7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 650;
  letter-spacing: 0.03em;
}

.page-calc-history .calc-table th,
.page-calc-history .calc-table td {
  border-bottom-color: rgba(20, 24, 32, 0.06);
}

.page-calc-history .calc-table tbody tr:hover:not(.is-xiao-miss):not(.is-kline-arrow) {
  background: transparent;
}

.page-calc-history .calc-table tbody tr:nth-child(even):not(.is-xiao-miss):not(.is-kline-arrow) > td,
.page-calc-history .calc-table tbody tr:hover:not(.is-xiao-miss):not(.is-kline-arrow) > td {
  background: #fff;
}

.page-calc-history .calc-table tbody tr.is-kline-arrow,
.page-calc-history .calc-table tbody tr.is-kline-arrow:hover {
  background: var(--ch-kline-arrow-grad);
}

.page-calc-history .calc-table tbody tr.is-kline-arrow > td,
.page-calc-history .calc-table tbody tr.is-kline-arrow:hover > td {
  background: transparent;
  border-bottom-color: var(--ch-kline-arrow-bd-soft);
}

.page-calc-history .calc-table tbody tr.is-xiao-miss,
.page-calc-history .calc-table tbody tr.is-xiao-miss:hover {
  background: var(--ch-miss-xiao-grad);
}

.page-calc-history .calc-table tbody tr.is-xiao-miss > td,
.page-calc-history .calc-table tbody tr.is-xiao-miss:hover > td {
  background: transparent;
  border-bottom-color: var(--ch-miss-xiao-bd-soft);
}

.page-calc-history .calc-six .xiao-digit.is-hit {
  display: inline-block;
  min-width: 1.55em;
  min-height: 1.55em;
  padding: 0.12em 0.28em;
  line-height: 1.15;
  text-align: center;
  border-radius: 999px;
  color: #064e3b;
  font-weight: 800;
  background: #6ee7b7;
  border: none;
  box-sizing: border-box;
}

.page-calc-history .calc-hit {
  display: inline-block;
  min-width: 2.1em;
  padding: 0.12em 0.38em;
  margin-right: 0.28rem;
  line-height: 1.15;
  text-align: center;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.76rem;
  border: none;
  box-sizing: border-box;
}

.page-calc-history .calc-hit.is-yes {
  color: #064e3b;
  background: #6ee7b7;
}

.page-calc-history .calc-hit.is-no {
  color: #7f1d1d;
  background: #fecaca;
}

.page-calc-history .calc-cell-pred-codes .pred-code.is-hit,
.page-calc-history .calc-wei-only .wei-digit.is-hit {
  color: #064e3b;
  background: #6ee7b7;
  border: none;
  border-radius: 999px;
  font-weight: 800;
}

.page-calc-history .btn-infer-detail.btn-stone {
  padding: 0.22rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1px solid rgba(100, 116, 139, 0.32);
  box-shadow: none;
  transform: none;
}

.page-calc-history .btn-infer-detail.btn-stone:hover:not(:disabled) {
  color: #475569;
  background: transparent;
  border-color: rgba(71, 85, 105, 0.45);
  box-shadow: none;
  transform: none;
  filter: none;
}

.page-calc-history .calc-kpi-note {
  color: var(--ch-muted);
}

/* 强弱 K 线（KPI 下方 · 单框 + 图内 HUD） */
.page-calc-history .calc-strength-kline-frame {
  margin-top: 0.85rem;
  border-radius: 10px;
  border: 1px solid #2a2e39;
  background: #131722;
  overflow: hidden;
}

.page-calc-history .calc-strength-kline-chart-wrap {
  position: relative;
  width: 100%;
}

.page-calc-history .calc-strength-kline-chart {
  width: 100%;
  min-height: 330px;
}

.page-calc-history .calc-kline-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  padding: 0.45rem 0.55rem 0.35rem;
  background: linear-gradient(180deg, rgba(19, 23, 34, 0.94) 0%, rgba(19, 23, 34, 0.72) 70%, rgba(19, 23, 34, 0) 100%);
  pointer-events: none;
}

.page-calc-history .calc-kline-hud-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}

.page-calc-history .calc-kline-mini {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: rgba(30, 34, 45, 0.92);
  border: 1px solid rgba(120, 123, 134, 0.35);
  font-size: 0.72rem;
  line-height: 1.2;
  pointer-events: auto;
}

.page-calc-history .calc-kline-mini-k {
  color: #848e9c;
}

.page-calc-history .calc-kline-mini-v {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f0f3fa;
}

.page-calc-history .calc-kline-mini-sub {
  color: #848e9c;
  font-size: 0.68rem;
}

.page-calc-history .calc-kline-mini.is-arrow .calc-kline-mini-v {
  color: #fb923c;
}

.page-calc-history .calc-kline-mini.is-dot .calc-kline-mini-v {
  color: #22d3ee;
}

.page-calc-history .calc-kline-hud-legend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-left: auto;
  font-size: 0.68rem;
  color: #848e9c;
}

.page-calc-history .calc-kline-hud-legend .lg::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.25rem;
  border-radius: 2px;
  vertical-align: -0.08em;
}

.page-calc-history .calc-kline-hud-legend .lg.is-up::before {
  background: #f6465d;
}

.page-calc-history .calc-kline-hud-legend .lg.is-down::before {
  background: #0ecb81;
}

.page-calc-history .calc-kline-hud-legend .lg.is-pending::before {
  background: #a855f7;
}

.page-calc-history .calc-kline-hud-legend .lg.is-ma::before {
  background: #67e8f9;
  height: 2px;
  border-radius: 0;
  width: 0.75rem;
}

.page-calc-history .calc-kline-tip-row .is-up-k {
  color: #f6465d;
}

.page-calc-history .calc-kline-tip-row .is-down-k {
  color: #0ecb81;
}

.page-calc-history .calc-kline-hud-btn {
  pointer-events: auto;
  padding: 0.18rem 0.5rem;
  font-size: 0.68rem;
  border-radius: 5px;
  border: 1px solid rgba(120, 123, 134, 0.45);
  background: rgba(30, 34, 45, 0.92);
  color: #d1d4dc;
  cursor: pointer;
}

.page-calc-history .calc-kline-hud-btn:hover {
  border-color: #848e9c;
  color: #f0f3fa;
}

.page-calc-history .calc-strength-kline-chart .bagua-hint {
  color: #848e9c;
  padding: 1.2rem;
}

.page-calc-history .calc-kline-tip {
  position: absolute;
  z-index: 5;
  max-width: 260px;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(20, 24, 36, 0.96);
  border: 1px solid rgba(120, 123, 134, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #d1d4dc;
}

.page-calc-history .calc-kline-tip-title {
  font-weight: 700;
  color: #f0f3fa;
  margin-bottom: 0.35rem;
}

.page-calc-history .calc-kline-tip-row {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.page-calc-history .calc-kline-tip-row span:first-child {
  flex: 0 0 3.2em;
  color: #848e9c;
}

.page-calc-history .calc-kline-tip-row.muted {
  color: #848e9c;
}

.page-calc-history .calc-kline-tip-row .is-yes {
  color: #0ecb81;
  font-weight: 700;
}

.page-calc-history .calc-kline-tip-row .is-no {
  color: #f6465d;
  font-weight: 700;
}

