:root {
  --bg: #0b1220;
  --panel: #131c2e;
  --panel-2: #1a2437;
  --line: #26324a;
  --text: #e8eefc;
  --muted: #8b9bb8;
  --green: #34d399;
  --yellow: #fbbf24;
  --grey: #94a3b8;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  padding-bottom: 40px;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  background: rgba(11, 18, 32, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: .3px; }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
}

.mode { display: flex; background: var(--panel-2); border-radius: 999px; padding: 3px; }
.mode-btn {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
  font-family: inherit; cursor: pointer;
}
.mode-btn.active { background: var(--blue); color: #08111f; font-weight: 600; }

main { padding: 16px; max-width: 720px; margin: 0 auto; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}

.fields { display: grid; gap: 12px; }
@media (min-width: 560px) { .fields { grid-template-columns: repeat(3, 1fr); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 12.5px; color: var(--muted); }
.field input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 16px;
  font-family: inherit; width: 100%;
}
.field input:focus { outline: none; border-color: var(--blue); }

.primary {
  width: 100%; margin-top: 14px; padding: 13px;
  background: var(--blue); color: #08111f; border: 0; border-radius: 11px;
  font-size: 15.5px; font-weight: 650; font-family: inherit; cursor: pointer;
}
.primary:disabled { opacity: .55; cursor: default; }

.hint { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

.status {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
  color: var(--muted); font-size: 14px;
}
.status.error { color: var(--red); border-color: #4a2330; }

.summary {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.stat {
  flex: 1 1 90px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.stat .n { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.a .n { color: var(--green); }
.stat.b .n { color: var(--yellow); }
.stat.c .n { color: var(--grey); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card.grade-A { border-left: 3px solid var(--green); }
.card.grade-B { border-left: 3px solid var(--yellow); }
.card.grade-C { border-left: 3px solid var(--grey); }
.card.grade-机构级, .card.grade-不可执行 { border-left: 3px solid #475569; opacity: .82; }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-size: 17px; font-weight: 650; }
.card-code { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.badge {
  flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px; white-space: nowrap;
}
.badge.A { background: rgba(52,211,153,.15); color: var(--green); }
.badge.B { background: rgba(251,191,36,.15); color: var(--yellow); }
.badge.C { background: rgba(148,163,184,.15); color: var(--grey); }
.badge.other { background: rgba(148,163,184,.12); color: #64748b; }

.hero { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 4px; }
.hero .big { font-size: 30px; font-weight: 750; color: var(--green); line-height: 1.1;
             font-variant-numeric: tabular-nums; }
.hero .big.neg { color: var(--red); }
.hero .cap { font-size: 12.5px; color: var(--muted); }

.profit {
  margin: 14px 0; padding: 13px 14px; border-radius: 11px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.profit .label { font-size: 12.5px; color: var(--muted); }
.profit .value { font-size: 22px; font-weight: 700; color: var(--text);
                 font-variant-numeric: tabular-nums; margin-top: 2px; }
.profit .value.pos { color: var(--green); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; margin: 14px 0; }
.grid .k { font-size: 12px; color: var(--muted); }
.grid .v { font-size: 14.5px; font-variant-numeric: tabular-nums; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  font-size: 12.5px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.chip.good { color: var(--green); border-color: rgba(52,211,153,.35); }
.chip.warn { color: var(--yellow); border-color: rgba(251,191,36,.35); }
.chip.bad { color: var(--red); border-color: rgba(248,113,113,.35); }

.ghost {
  width: 100%; margin-top: 14px; padding: 11px;
  background: transparent; color: var(--blue); border: 1px solid var(--line);
  border-radius: 11px; font-size: 14.5px; font-family: inherit; cursor: pointer;
}
.ghost:hover { border-color: var(--blue); }

.steps { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.steps ol { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 9px; font-size: 14px; }
.steps li strong { color: var(--blue); font-weight: 600; }
.steps .note {
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
  background: var(--panel-2); border-radius: 9px; padding: 10px 12px;
}

.pro { display: none; }
body.pro-mode .pro { display: block; }

.pro-box {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.pro-box h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; }

.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--panel-2); margin: 6px 0 4px; }
.bar i { display: block; height: 100%; }
.bar .lo { background: #475569; }
.bar .mid { background: var(--blue); }
.bar .hi { background: #1d4ed8; }
.barlabel { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

.empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.empty .big { font-size: 40px; margin-bottom: 8px; }

.foot { max-width: 720px; margin: 8px auto 0; padding: 0 16px; }
.disclaimer {
  font-size: 12px; color: var(--muted); line-height: 1.7;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin: 0 0 10px;
}
.disclaimer strong { color: var(--text); }
.meta { font-size: 11.5px; color: #64748b; text-align: center; margin: 0; }

.hidden { display: none !important; }

/* ---------- 顶栏「手机看」按钮 ---------- */
.icon-btn {
  flex-shrink: 0; padding: 6px 10px; font-size: 12.5px; font-family: inherit;
  background: var(--panel-2); color: var(--muted); cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; white-space: nowrap;
}
.icon-btn:hover { color: var(--text); border-color: var(--blue); }

/* ---------- 手机访问面板 ---------- */
.phone h3 { margin: 0 0 12px; font-size: 15px; }
.qr-wrap {
  display: flex; justify-content: center; padding: 12px;
  background: #fff; border-radius: 12px; width: fit-content; margin: 0 auto;
}
.qr-wrap img { display: block; width: 180px; height: 180px; }
.phone-url {
  text-align: center; margin: 12px 0 6px; font-size: 15px; font-weight: 600;
  color: var(--blue); word-break: break-all; font-variant-numeric: tabular-nums;
}

/* ---------- 市场状态条 ---------- */
.marketbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted);
}
.marketbar .led {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--grey);
}
.marketbar .state { font-weight: 650; color: var(--text); }
.marketbar .sep { color: #334158; }
.marketbar .countdown { font-variant-numeric: tabular-nums; color: var(--blue); }

.marketbar.live { border-color: rgba(52,211,153,.4); }
.marketbar.live .led { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.marketbar.live .state { color: var(--green); }

.marketbar.closed { border-color: rgba(251,191,36,.35); }
.marketbar.closed .led { background: var(--yellow); }
.marketbar.closed .state { color: var(--yellow); }

@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---------- 数据模式徽标 ---------- */
.datamode {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.datamode.intraday { background: rgba(251,191,36,.16); color: var(--yellow); }
.datamode.eod { background: rgba(52,211,153,.14); color: var(--green); }

.card-intraday-note {
  margin-top: 10px; font-size: 12.5px; color: var(--yellow);
  background: rgba(251,191,36,.09); border: 1px solid rgba(251,191,36,.28);
  border-radius: 9px; padding: 9px 11px; line-height: 1.55;
}
