/* BZ Quant 2.0 —— 深色紧凑主题（延续旧版风格） */
:root {
  --bg: #0b0d10; --panel: #14171c; --panel2: #101317; --border: #1f242b; --border2: #2a3038;
  --text: #d6dbdf; --muted: #8a93a0; --dim: #5d6672;
  --blue: #2563eb; --green: #22c55e; --red: #ef4444; --amber: #f59e0b;
}
html, body { background: var(--bg); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; }
[v-cloak] { display: none; }
.mono, .num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.panel-title { font-size: 12px; font-weight: 600; color: #c4cad2; }
.label { font-size: 11px; color: var(--muted); }
.hint { font-size: 11px; color: var(--dim); }

.input { background: #0e1115; border: 1px solid var(--border2); color: #e2e6eb; padding: 3px 7px; border-radius: 4px; font-size: 12px; height: 26px; }
.input:focus { outline: none; border-color: #4a90e2; }
.input:disabled { opacity: .55; cursor: not-allowed; }
.input.invalid { border-color: var(--red); }
select.input { padding-right: 4px; }
input[type=number] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=date].input { color-scheme: dark; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); }

.btn { padding: 4px 10px; border-radius: 4px; font-size: 12px; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; line-height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; } .btn-primary:hover:not(:disabled) { background: #1e54d4; }
.btn-secondary { background: var(--border2); color: var(--text); } .btn-secondary:hover:not(:disabled) { background: #353b44; }
.btn-danger { background: #b91c1c; color: #fff; } .btn-danger:hover:not(:disabled) { background: #991b1b; }
.btn-success { background: #15803d; color: #fff; } .btn-success:hover:not(:disabled) { background: #166534; }
.btn-quick { background: #1f2937; color: #93a3b8; padding: 2px 8px; font-size: 11px; }
.btn-quick:hover:not(:disabled) { background: #2a3038; color: #cbd5e1; }
.btn-quick.active { background: var(--blue); color: #fff; }
.btn-quick.danger { color: #f87171; }

table { font-size: 12px; border-collapse: collapse; }
table th { color: var(--muted); font-weight: 500; padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--panel); }
table td { padding: 5px 8px; border-bottom: 1px solid #191d23; white-space: nowrap; }
table tbody tr:hover td { background: #1a1e24; }
table th.r, table td.r { text-align: right; }
table th.c, table td.c { text-align: center; }
table thead.sticky th { position: sticky; top: 0; z-index: 1; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--text); }
tr.sub th { font-size: 10px; padding-top: 0; }
td.best { background: rgba(34, 197, 94, .13); color: var(--green); font-weight: 600; }
.scroll { overflow: auto; }

.pos { color: var(--green); } .neg { color: var(--red); } .warn { color: var(--amber); } .muted { color: var(--muted); } .dim { color: var(--dim); }

.badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 500; color: #fff; line-height: 16px; white-space: nowrap; }
.b-gray { background: #4b5563; } .b-blue { background: #2563eb; } .b-green { background: #16a34a; } .b-red { background: #dc2626; }
.b-amber { background: #b45309; } .b-purple { background: #7c3aed; }
.b-outline-green { background: rgba(22,163,74,.15); color: #4ade80; border: 1px solid rgba(22,163,74,.4); }
.b-outline-red { background: rgba(220,38,38,.15); color: #f87171; border: 1px solid rgba(220,38,38,.4); }
.b-outline-gray { background: rgba(75,85,99,.2); color: #9ca3af; border: 1px solid #374151; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px 1px 8px; border-radius: 4px; margin: 2px; font-size: 11px; background: #1d4ed8; color: #fff; }
.chip button { opacity: .7; padding: 0 3px; border-radius: 3px; } .chip button:hover { opacity: 1; background: rgba(255,255,255,.15); }
.chip.ro { padding-right: 8px; background: #1f2937; color: #cbd5e1; }

.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--border2); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 6px; background: #1f242b; border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #2563eb, #38bdf8); transition: width .4s ease; }

.tab { padding: 6px 16px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); }
.tab:hover { color: var(--text); } .tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }

.seg { display: inline-flex; border: 1px solid var(--border2); border-radius: 4px; overflow: hidden; }
.seg button { padding: 2px 10px; font-size: 11px; color: var(--muted); background: transparent; }
.seg button.on { background: var(--blue); color: #fff; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }

/* 弹窗 / 抽屉 */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 12px 14px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.x-btn { color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; } .x-btn:hover { color: #fff; }
.drawer-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; justify-content: flex-end; }
.drawer { background: var(--bg); border-left: 1px solid var(--border); width: 100%; max-width: 1000px; height: 100%; overflow: auto; }

/* 结论条 */
.verdict { border-radius: 8px; padding: 10px 14px; display: flex; gap: 12px; align-items: flex-start; }
.verdict.pass { background: rgba(22,163,74,.12); border: 1px solid rgba(22,163,74,.5); }
.verdict.fail { background: rgba(220,38,38,.12); border: 1px solid rgba(220,38,38,.5); }
.verdict .big { font-size: 18px; font-weight: 700; white-space: nowrap; }

.metric { background: var(--panel2); border: 1px solid #1a1e24; border-radius: 6px; padding: 6px 8px; }
.metric .k { font-size: 10px; color: var(--muted); } .metric .v { font-size: 14px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.riskbar { background: #0f1216; border-bottom: 1px solid var(--border); }
.riskbar .item { display: flex; flex-direction: column; line-height: 1.2; }
.riskbar .item .k { font-size: 10px; color: var(--dim); } .riskbar .item .v { font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.killon { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .55; } }

/* 提示 */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { padding: 8px 12px; border-radius: 6px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4); border: 1px solid; cursor: pointer; word-break: break-all; }
.toast.error { background: #2a1214; border-color: #7f1d1d; color: #fecaca; }
.toast.success { background: #0f2417; border-color: #166534; color: #bbf7d0; }
.toast.info { background: #111c2e; border-color: #1e3a8a; color: #bfdbfe; }

.chart-tip { position: absolute; pointer-events: none; background: rgba(15,18,22,.95); border: 1px solid var(--border2); border-radius: 4px; padding: 3px 7px; font-size: 11px; white-space: nowrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; }
.kv > .k { color: var(--muted); }
.changed { color: var(--amber); }
.dot-changed::after { content: '•'; color: var(--amber); margin-left: 3px; }

/* ⓘ 悬浮说明 */
.info-tip { display: inline-block; margin-left: 3px; color: var(--dim); cursor: help; font-size: 11px; line-height: 1; flex-shrink: 0; outline: none; }
.info-tip:hover, .info-tip:focus { color: #93c5fd; }
.tip-pop { position: fixed; z-index: 1000; background: #1c2129; color: #d6dbdf; border: 1px solid var(--border2); border-radius: 6px; padding: 7px 10px; font-size: 12px; line-height: 1.55; white-space: pre-line; box-shadow: 0 6px 20px rgba(0,0,0,.45); pointer-events: none; }
.tip-pop.above { transform: translateY(-100%); }
