/* 黑红版：白底黑字、黑线分区、朱红只点关键信息，不用卡片和圆角。
   字体与 ciyuan-os 一致：Geist（西文、数字）、MiSans Medium（中文标题）、Noto Sans SC（中文正文）。 */
:root {
  --ink: #16161a; --muted: #5c5c66; --line: #e4e4e8; --line-2: #c9c9d0; --soft: #f6f6f3;
  --red: #b3261e; --red-soft: #fbf1ef; --bar2: #b9b9c0;
  --font-sans: "Geist Variable", "Noto Sans SC Variable", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --font-display: "Geist Variable", "MiSans", "Noto Sans SC Variable", "PingFang SC", "Microsoft YaHei UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 14px/1.6 var(--font-sans); font-synthesis: none; color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { color: var(--red); text-decoration-color: var(--red); }
small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.muted { color: var(--muted); }
.r { text-align: right; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* 外框 */
#app { display: flex; min-height: 100vh; }
.side { width: 228px; flex: none; border-right: 1px solid var(--ink); padding: 30px 24px 24px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { font: 500 21px/1.4 var(--font-display); padding-bottom: 18px; border-bottom: 3px solid var(--ink); margin-bottom: 8px; }
.side nav a { position: relative; display: block; padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; text-decoration: none; }
.side nav a::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border: 1px solid var(--line-2); }
.side nav a:hover { color: var(--red); }
.side nav a.on { color: var(--red); font-weight: 500; }
.side nav a.on::before { background: var(--red); border-color: var(--red); }
.side-foot { margin: auto 0 0; padding-top: 4px; border-top: 1px solid var(--ink); font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.side-foot dt { margin-top: 12px; font-size: 12px; letter-spacing: .12em; color: var(--ink); }
.side-foot dd { margin: 2px 0 0; }

.main { flex: 1; min-width: 0; max-width: 1760px; padding: 34px 56px 80px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
/* 两栏：宽屏并排，窄了叠起来 */
.cols { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 0 56px; align-items: start; }
.cols-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cols-wide { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); gap: 0 48px; }
h1 { font: 500 30px/1.4 var(--font-display); margin: 0 0 26px; }
h2 { font: 500 19px/1.5 var(--font-display); margin: 0; }
section { margin-bottom: 44px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 45px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); margin-bottom: 18px; }
.sec-head .muted { font-size: 12.5px; }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.8; max-width: 980px; margin: 14px 0 0; }
.empty-line { padding: 26px 0; color: var(--muted); }
.back { display: inline-block; margin-bottom: 12px; font-size: 13px; }
h1.lot-title { font-size: 24px; line-height: 1.5; padding-bottom: 18px; border-bottom: 3px solid var(--ink); }
.lot-title .tag { margin-left: 8px; vertical-align: 5px; }

/* 控件 */
button, select, input[type=search] { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--ink); border-radius: 0; height: 34px; padding: 0 14px; }
button { cursor: pointer; }
button:hover, select:hover { background: var(--soft); }
button.primary { background: var(--ink); color: #fff; font-weight: 500; }
button.primary:hover { background: var(--red); border-color: var(--red); }
select { padding: 0 8px; }
select.on { border-color: var(--red); color: var(--red); font-weight: 500; }
.filters, .toolbar, .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { margin-bottom: 18px; }
.actions { margin-top: 16px; }
input[type=search] { width: 340px; padding: 0 10px; }
input[type=search]:focus { outline: 0; box-shadow: inset 0 -2px var(--red); }
.seg { display: inline-flex; flex-wrap: wrap; }
.seg button { margin-left: -1px; }
.seg button:first-child { margin-left: 0; }
.seg button.on { background: var(--ink); color: #fff; font-weight: 500; position: relative; z-index: 1; }

/* 在跟线索 */
.mine { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding-top: 14px; margin-bottom: 40px; }
.mine-n { padding: 2px 16px 14px 20px; border-left: 1px solid var(--line-2); color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.mine-n:first-child { padding-left: 0; border-left: 0; }
.mine-n b { display: block; font: 600 38px/1.25 var(--font-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
a.mine-n:hover { background: var(--soft); }
a.mine-n:hover b { color: var(--red); }
.changes { margin-top: 18px; font-size: 13.5px; counter-reset: ch; }
.changes-h { color: var(--muted); font-size: 12.5px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.changes a { counter-increment: ch; display: flex; align-items: baseline; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.changes a::before { content: counter(ch); flex: none; width: 18px; font: 600 15px/1.4 var(--font-sans); color: var(--red); }
.changes a:hover .ch-t { color: var(--red); }
.ch-op { width: 64px; flex: none; color: var(--muted); font-size: 12.5px; }
.ch-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-d { flex: none; color: var(--red); font-weight: 500; }

/* 指标 */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); border-bottom: 1px solid var(--ink); margin-bottom: 26px; }
.kpi { padding: 2px 16px 14px 20px; border-left: 1px solid var(--line-2); min-width: 0; }
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi-l { color: var(--muted); font-size: 13px; }
.kpi-v { font: 600 34px/1.3 var(--font-sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-v small { display: inline; margin-left: 5px; font-size: 13px; letter-spacing: 0; }
.kpi-d { color: var(--muted); font-size: 12px; min-height: 19px; white-space: nowrap; }
.kpis-2 { grid-template-columns: repeat(2, 1fr); margin-bottom: 0; }
.kpis-2 .kpi { padding-top: 12px; }
.kpis-2 .kpi:nth-child(odd) { border-left: 0; padding-left: 0; }
.kpis-2 .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); padding-top: 2px; }

/* 趋势图 */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font-sans); }
.chart .b1 { fill: var(--ink); }
.chart .b2 { fill: var(--bar2); }
.chart .ln { fill: none; stroke: var(--red); stroke-width: 1.8; }
.chart .dot { fill: #fff; stroke: var(--red); stroke-width: 1.8; }
.chart .hit { fill: transparent; }
.chart .yr { cursor: pointer; }
.chart .yr:hover .hit, .chart .yr.on .hit { fill: var(--soft); }
.chart .yr.on .xl { fill: var(--red); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 20px; font-size: 12.5px; margin: 8px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.k1 { background: var(--ink); } .k2 { background: var(--bar2); }
.k3 { height: 2px !important; background: var(--red); vertical-align: 3px !important; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 400; font-size: 12.5px; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.tbl th.r { text-align: right; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl tbody tr:last-child td { border-bottom-color: var(--ink); }
.tbl.wrap td, .tbl td.name, .tbl td.name-w, .result .tbl td:last-child { white-space: normal; }
.tbl.wrap td:nth-child(2) { white-space: nowrap; }
.tbl td.r { font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--soft); }
.tbl tr.click:hover td:first-child { color: var(--red); }
.tbl tr.cur td { background: var(--red-soft); font-weight: 500; }
.tbl tr.cur td:first-child { box-shadow: -10px 0 var(--red-soft), -13px 0 var(--red); }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th.sortable.on { color: var(--red); font-weight: 500; }
.tbl td.name { min-width: 240px; font-weight: 500; }
.tbl td.name-w { min-width: 120px; }
.tbl td.when small { white-space: nowrap; }
.cols-wide .tbl td.name { min-width: 150px; }

.tag { display: inline-block; font: 400 12.5px/20px var(--font-sans); padding: 0 9px; border: 1px solid var(--line-2); color: var(--muted); vertical-align: 2px; white-space: nowrap; }
.tag-deal { color: #fff; background: var(--red); border-color: var(--red); font-weight: 500; }
.tag-wait { color: var(--ink); border-color: var(--ink); }
.tag-live { color: #fff; background: var(--ink); border-color: var(--ink); }

/* 详情 */
.info { display: grid; grid-template-columns: 110px 1fr 110px 1fr; gap: 0; margin: 0; }
.info-1 { grid-template-columns: 90px 1fr; }
.info dd { word-break: break-all; }
.info dt { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.info dd { margin: 0; padding: 10px 28px 10px 0; border-bottom: 1px solid var(--line); }

/* 导入 */
.drop { display: block; border: 1px dashed var(--ink); padding: 34px 26px; text-align: center; cursor: pointer; margin-bottom: 18px; font: 500 18px/1.5 var(--font-display); }
.drop:hover, .drop.over { border-style: solid; border-color: var(--red); background: var(--red-soft); }
.drop small { margin-top: 6px; font-family: var(--font-sans); }
.result { border: 1px solid var(--ink); border-left: 3px solid var(--ink); padding: 14px 18px; margin-bottom: 18px; }
.result.ok { border-left-color: var(--red); }
.result.bad { border-color: var(--red); border-left-color: var(--red); }
.result .tbl { margin-top: 12px; }
.result b { font-weight: 500; }

@media (max-width: 1500px) {
  .cols, .cols-even, .cols-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .main { padding: 24px; }
  .mine { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(4) { border-left: 0; padding-left: 0; }
  .tbl { display: block; overflow-x: auto; }
}

/* 层级路径、行情块 */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs i { font-style: normal; margin: 0 8px; color: var(--line-2); }
.crumbs span { color: var(--ink); }
.kpis-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.kpis-3 .kpi { padding-top: 12px; }
.kpis-3 .kpi:nth-child(3n+1) { border-left: 0; padding-left: 0; }
.kpis-3 .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); padding-top: 2px; }
.tbl-gap { margin-top: 26px; }
.tbl td.name-c { font-weight: 500; }
.info dd small { margin-top: 2px; }
.toolbar .muted { font-size: 12.5px; }

/* 单栏：返回按钮、页签 */
.main { max-width: 1480px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.back-btn { display: inline-block; margin-right: 18px; padding: 0 14px; height: 34px; line-height: 32px; border: 1px solid var(--ink); color: var(--ink); font-size: 14px; text-decoration: none; }
.back-btn:hover { background: var(--ink); color: #fff; }
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--ink); margin: 0 0 20px; }
.tabs button { height: 44px; padding: 0; border: 0; border-bottom: 3px solid transparent; background: none; font: 500 17px/1 var(--font-display); color: var(--muted); }
.tabs button:hover { background: none; color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--red); }
.tabs em { font: 400 13px var(--font-sans); margin-left: 6px; color: var(--muted); }
.chart { max-width: 980px; }
.kpis-3 { grid-template-columns: repeat(6, 1fr); }
.kpis-3 .kpi:nth-child(3n+1) { border-left: 1px solid var(--line-2); padding-left: 20px; }
.kpis-3 .kpi:first-child { border-left: 0; padding-left: 0; }
.kpis-3 .kpi:nth-child(-n+3) { border-bottom: 0; }
.kpis-3 { border-top: 0; }

.pager { display: flex; align-items: center; gap: 22px; margin-top: 16px; font-size: 13px; }
.pager select { height: 30px; margin: 0 4px; }
.pager-nav { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.pager button { height: 30px; }
.pager button:disabled { color: var(--line-2); border-color: var(--line-2); cursor: default; background: #fff; }

/* 总览：三列联动 */
.ov-bar { justify-content: space-between; }
.ov-legend { margin: 0; gap: 16px; }
.ov-legend .sq { margin-right: 6px; vertical-align: -1px; }
.ov { position: relative; display: grid; grid-template-columns: 200px 330px minmax(0, 1fr); column-gap: clamp(70px, 9vw, 150px); align-items: start; margin-bottom: 14px; }
.ov-links { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ov-links path { fill: none; stroke: var(--ink); stroke-opacity: .2; }
.ov-links path.dim { stroke-opacity: .07; }
.ov-links path.loose { stroke-dasharray: 2 3; }
.ov-links path.hi { stroke: var(--red); stroke-opacity: .75; }
.ov-h { font: 500 17px/1.5 var(--font-display); padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.ov-h em { font: 400 12.5px var(--font-sans); color: var(--muted); margin-left: 8px; }
.ov-row { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 6px 10px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.ov-row:hover { background: var(--soft); }
.ov-row.on { background: var(--red-soft); box-shadow: inset 3px 0 var(--red); font-weight: 500; }
.ov-row.off { color: var(--line-2); }
.ov-n { margin-left: auto; flex: none; font-variant-numeric: tabular-nums; }
.ov-n small { display: inline; margin-left: 2px; }
.ov-row.off .ov-n small { color: var(--line-2); }
.ov-kind { align-items: flex-start; }
.ov-kind .ov-name { flex: none; width: 92px; }
.ov-sq { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 4px; }
.sq { display: inline-block; width: 13px; height: 13px; border: 1px solid var(--line-2); background: #fff; }
.sq-deal { background: var(--red); border-color: var(--red); }
.sq-live { background: var(--ink); border-color: var(--ink); }
.sq-wait { border-color: var(--ink); }
.sq-fail { background: var(--bar2); border-color: var(--bar2); }
.sq.dim { opacity: .18; }
.ov:has(.ov-row.on[data-sel^="e:"]) .ov-kind:not(.off) {
  background: var(--red-soft);
}
.ov:has(.ov-row.on[data-sel^="e:"]) .ov-kind:not(.off) .sq {
  opacity: 1;
}
a.sq:hover { outline: 2px solid var(--red); outline-offset: 1px; opacity: 1; }
.ov-clear { margin-left: 16px; height: 30px; }
