:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #d8e0eb;
  --line-soft: #e7edf5;
  --text: #102033;
  --muted: #667994;
  --muted-2: #8a9aaf;
  --green: #059669;
  --green-bg: #e9f8f2;
  --red: #dc2626;
  --red-bg: #fff0f0;
  --blue: #1f6feb;
  --blue-bg: #eaf2ff;
  --orange: #b45309;
  --orange-bg: #fff7ed;
  --shadow: 0 10px 28px rgba(16, 32, 51, 0.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}
.page { min-width: 1260px; padding: 18px 22px 28px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.title h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; font-weight: 760; }
.title .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 8px; }
.search { width: 310px; height: 36px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); padding: 0 12px; outline: none; }
.select, .button { height: 36px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); padding: 0 12px; font-weight: 650; }
.button { cursor: pointer; }
.button.primary { border-color: #b9d3ff; background: var(--blue); color: #fff; }
.button.danger { border-color: #ffcaca; background: var(--red-bg); color: var(--red); }
.summary { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); border: 1px solid var(--line); background: var(--panel); margin-bottom: 10px; }
.metric { min-height: 68px; padding: 12px 16px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric .label { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.metric .value { font-size: 22px; line-height: 1; font-weight: 760; }
.metric .hint { margin-top: 7px; color: var(--muted-2); font-size: 11px; }
.status-strip { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); background: var(--panel); min-height: 56px; padding: 10px 12px; margin-bottom: 12px; }
.status-label { min-width: 86px; color: var(--muted); font-size: 12px; }
.pill-row { display: flex; gap: 7px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; border-radius: 6px; padding: 4px 8px; border: 1px solid #b9e6d2; background: var(--green-bg); color: var(--green); font-size: 12px; font-weight: 650; white-space: nowrap; }
.pill.warning { border-color: #f2caa5; background: var(--orange-bg); color: var(--orange); }
.pill.danger { border-color: #ffcaca; background: var(--red-bg); color: var(--red); }
.pill.muted { border-color: var(--line); background: #f8fafc; color: var(--muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.connection-card { min-height: 42px; align-items: center; gap: 8px; padding: 7px 9px; }
.connection-main { display: grid; gap: 2px; min-width: 82px; }
.connection-main strong { color: var(--text); font-size: 12px; line-height: 1.1; font-weight: 800; }
.connection-main em { color: currentColor; font-style: normal; font-size: 11px; line-height: 1.1; font-weight: 760; font-variant-numeric: tabular-nums; }
.connection-state { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 20px; border-radius: 5px; background: rgba(255, 255, 255, 0.64); color: currentColor; font-size: 11px; font-weight: 800; }
.tabs { display: inline-flex; border: 1px solid var(--line); background: #edf2f8; border-radius: 8px; padding: 4px; margin-bottom: 12px; }
.tab { height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 0 18px; font-weight: 700; }
.tab.active { color: var(--text); background: var(--panel); box-shadow: 0 1px 3px rgba(16, 32, 51, 0.12); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 8px; }
.section-head h2 { margin: 0; font-size: 19px; line-height: 1.2; font-weight: 800; }
.section-head .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.view-count { min-width: 84px; text-align: right; color: var(--muted); font-size: 12px; font-weight: 760; font-variant-numeric: tabular-nums; }
.path-filters { display: flex; align-items: center; gap: 10px; min-height: 46px; border: 1px solid var(--line); background: var(--panel); padding: 8px 10px; margin-bottom: 10px; }
.path-filter { display: inline-flex; align-items: center; gap: 7px; }
.path-filter span { color: var(--muted); font-size: 12px; font-weight: 760; white-space: nowrap; }
.path-filter .select { height: 30px; min-width: 126px; padding: 0 9px; }
.path-filter-note { margin-left: auto; color: #40516a; font-size: 12px; font-weight: 700; }
.manage-tools { display: flex; align-items: center; gap: 10px; min-height: 54px; border: 1px solid var(--line); background: var(--panel); padding: 9px 10px; margin-bottom: 10px; }
.manage-filter { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.manage-filter span { color: var(--muted); font-size: 12px; font-weight: 760; white-space: nowrap; }
.manage-filter .select { height: 32px; min-width: 150px; padding: 0 9px; }
.manage-action-bar { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.field-input { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fbfdff; color: var(--text); padding: 0 10px; outline: none; font: inherit; width: 100%; }
.field-input:disabled { color: var(--muted); background: #f1f5f9; }
.field-input.code { text-transform: uppercase; font-weight: 800; letter-spacing: 0; }
.manage-message { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.manage-message.success { color: var(--green); }
.manage-message.danger { color: var(--red); }
.table-wrap { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
thead { background: #eef3f9; }
th { height: 42px; color: #40516a; font-size: 12px; text-align: right; font-weight: 760; border-bottom: 1px solid var(--line); padding: 0 14px; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; width: 250px; }
th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3) { width: 150px; }
th:nth-child(4), td:nth-child(4), th:nth-child(5), td:nth-child(5), th:nth-child(6), td:nth-child(6), th:nth-child(7), td:nth-child(7), th:nth-child(8), td:nth-child(8) { width: 125px; }
table.alert-mode th:first-child, table.alert-mode td:first-child { width: 240px; }
table.alert-mode th:nth-child(2), table.alert-mode td:nth-child(2), table.alert-mode th:nth-child(3), table.alert-mode td:nth-child(3) { width: 170px; }
table.alert-mode th:nth-child(4), table.alert-mode td:nth-child(4) { width: 120px; }
table.alert-mode th:nth-child(5), table.alert-mode td:nth-child(5) { width: 150px; }
table.alert-mode th:nth-child(6), table.alert-mode td:nth-child(6), table.alert-mode th:nth-child(7), table.alert-mode td:nth-child(7), table.alert-mode th:nth-child(8), table.alert-mode td:nth-child(8) { width: 110px; }
table.compare-mode th:first-child, table.compare-mode td:first-child { width: 230px; }
table.compare-mode th:nth-child(2), table.compare-mode td:nth-child(2), table.compare-mode th:nth-child(3), table.compare-mode td:nth-child(3) { width: 165px; }
table.compare-mode th:nth-child(4), table.compare-mode td:nth-child(4) { width: 115px; }
table.compare-mode th:nth-child(5), table.compare-mode td:nth-child(5) { width: 160px; }
table.compare-mode th:nth-child(6), table.compare-mode td:nth-child(6), table.compare-mode th:nth-child(7), table.compare-mode td:nth-child(7) { width: 105px; }
table.manage-mode th:first-child, table.manage-mode td:first-child { width: 180px; }
table.manage-mode th:nth-child(2), table.manage-mode td:nth-child(2) { width: 210px; }
table.manage-mode th:nth-child(3), table.manage-mode td:nth-child(3) { width: 170px; }
table.manage-mode th:nth-child(4), table.manage-mode td:nth-child(4) { width: 280px; }
table.manage-mode th:nth-child(5), table.manage-mode td:nth-child(5) { width: 110px; }
table.manage-mode th:nth-child(6), table.manage-mode td:nth-child(6) { width: 120px; }
table.manage-mode th:nth-child(7), table.manage-mode td:nth-child(7) { width: 110px; }
table.manage-mode th:nth-child(8), table.manage-mode td:nth-child(8) { width: 110px; }
td { height: 54px; border-bottom: 1px solid var(--line-soft); padding: 0 14px; text-align: right; vertical-align: middle; white-space: nowrap; }
tbody tr:nth-child(even) { background: #fbfdff; }
tbody tr:hover { background: #f2f7ff; }
tbody tr.clickable-row { cursor: pointer; }
tbody tr.selected { background: #eaf2ff; }
.asset { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-bg); color: var(--blue); font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.asset-main { min-width: 0; }
.symbol { font-weight: 800; line-height: 1.2; }
.name { color: var(--muted); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.price { font-variant-numeric: tabular-nums; font-weight: 760; }
.venue { display: block; color: var(--muted-2); font-size: 11px; font-weight: 600; margin-top: 4px; }
.path-cell { white-space: normal; line-height: 1.25; }
.path-cell strong { display: block; font-size: 13px; line-height: 1.2; }
.path-role { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.path-spread { font-size: 15px; font-variant-numeric: tabular-nums; }
.manage-row td { height: 62px; }
.manage-display-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.coverage-cell { white-space: normal; text-align: left; }
.coverage-tag, .coverage-empty, .source-badge { display: inline-flex; align-items: center; min-height: 22px; border-radius: 6px; padding: 3px 7px; margin: 2px 3px 2px 0; font-size: 11px; font-weight: 760; }
.coverage-tag { border: 1px solid #b9e6d2; background: var(--green-bg); color: var(--green); }
.coverage-tag.manual-tag { border-color: #b9d3ff; background: var(--blue-bg); color: var(--blue); }
.coverage-empty { border: 1px solid #ffcaca; background: var(--red-bg); color: var(--red); }
.source-badge { border: 1px solid var(--line); background: #f8fafc; color: var(--muted); margin: 0; }
.source-badge.manual { border-color: #f2caa5; background: var(--orange-bg); color: var(--orange); }
.source-badge.custom { border-color: #b9d3ff; background: var(--blue-bg); color: var(--blue); }
.coverage-status strong { display: block; font-variant-numeric: tabular-nums; }
.coverage-status span { display: block; margin-top: 3px; font-size: 11px; }
.manage-actions { white-space: normal; }
.mini-button { height: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); padding: 0 9px; margin-left: 5px; font-size: 12px; font-weight: 760; cursor: pointer; }
.mini-button.muted { color: var(--red); background: var(--red-bg); border-color: #ffcaca; }
.mini-button.muted-light { color: var(--muted); background: #f8fafc; border-color: var(--line); }
.alert-line { color: #344357; }
.positive { color: var(--green); font-weight: 800; }
.negative { color: var(--red); font-weight: 800; }
.neutral { color: var(--muted); font-weight: 800; }
.rate-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 78px; height: 24px; border-radius: 6px; padding: 0 8px; border: 1px solid #f2caa5; background: var(--orange-bg); color: var(--orange); font-size: 12px; font-weight: 760; font-variant-numeric: tabular-nums; }
.rate-badge.green { border-color: #b9e6d2; background: var(--green-bg); color: var(--green); }
.rate-badge.danger { border-color: #ffcaca; background: var(--red-bg); color: var(--red); }
.time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.updated { color: #344357; font-variant-numeric: tabular-nums; font-weight: 650; }
.empty { height: 120px; text-align: center !important; color: var(--muted); }
.footer-note { color: var(--muted); font-size: 12px; margin-top: 10px; }
.details-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: 390px;
  height: 100vh;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -16px 0 36px rgba(16, 32, 51, 0.12);
  padding: 18px;
  overflow-y: auto;
}
.details-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; margin-bottom: 14px; }
.details-kicker { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.details-kicker-gap { margin-top: 14px; }
.details-head h3 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 820; }
.details-sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.close-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; color: var(--text); cursor: pointer; font-size: 22px; line-height: 1; }
.details-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.spot-card { border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px; background: #fbfdff; }
.spot-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.spot-card strong { display: block; font-size: 20px; line-height: 1; font-weight: 820; font-variant-numeric: tabular-nums; }
.spot-card em { display: block; color: var(--muted-2); font-style: normal; font-size: 11px; margin-top: 7px; }
.alert-settings { border: 1px solid var(--line-soft); border-radius: 8px; background: #fbfdff; padding: 12px; margin-bottom: 12px; }
.threshold-editor { display: grid; grid-template-columns: minmax(0, 1fr) 56px 82px; align-items: end; gap: 6px; }
.threshold-editor label { display: grid; gap: 5px; }
.threshold-editor label span { color: var(--muted); font-size: 12px; font-weight: 760; }
.threshold-editor .field-input { height: 30px; font-variant-numeric: tabular-nums; }
.threshold-editor .mini-button { height: 30px; margin-left: 0; padding: 0 7px; }
.alert-settings-note { color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 8px; }
.alert-settings-note.success { color: var(--green); }
.alert-settings-note.danger { color: var(--red); }
.blacklist-list { display: grid; gap: 6px; margin-top: 8px; }
.blacklist-empty { border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); background: #f8fafc; padding: 9px; font-size: 11px; font-weight: 700; text-align: center; }
.blacklist-item { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); padding: 8px; }
.blacklist-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.blacklist-item span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blacklist-item .mini-button { margin-left: 0; }
.alert-path-panel { border: 1px solid #ffcaca; background: var(--red-bg); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.alert-path-list { display: grid; gap: 8px; }
.alert-path-card { border: 1px solid #f2caa5; border-radius: 7px; background: var(--panel); padding: 10px; }
.alert-path-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.alert-path-top strong { color: var(--red); font-size: 18px; line-height: 1; font-variant-numeric: tabular-nums; }
.alert-path-top span { color: var(--orange); font-size: 12px; font-weight: 760; }
.alert-route { color: var(--text); font-size: 12px; font-weight: 760; }
.alert-action { color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 6px; }
.alert-card-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.venue-list { display: grid; gap: 8px; }
.spot-list { margin-bottom: 4px; }
.venue-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--panel); }
.venue-card.muted { background: #f8fafc; color: var(--muted); }
.venue-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.venue-top strong { font-size: 13px; }
.venue-top span { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.venue-price { font-size: 22px; line-height: 1; font-weight: 820; font-variant-numeric: tabular-nums; }
.venue-book { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.venue-time { color: var(--muted-2); font-size: 11px; margin-top: 8px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 32, 51, 0.34);
}
.symbol-modal {
  width: min(780px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(16, 32, 51, 0.22);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 820; }
.modal-sub { color: var(--muted); font-size: 12px; margin-top: 6px; }
.modal-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; padding: 16px 18px 8px; }
.field { display: grid; gap: 6px; }
.field span, .mapping-symbol-field span { color: var(--muted); font-size: 12px; font-weight: 760; }
.modal-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px; }
.modal-section-title strong { font-size: 14px; font-weight: 820; }
.modal-section-title span { color: var(--muted); font-size: 12px; }
.mapping-list { display: grid; gap: 8px; padding: 0 18px; }
.mapping-row {
  display: grid;
  grid-template-columns: 112px minmax(220px, 1fr) 130px 68px;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}
.mapping-kind strong { display: block; font-size: 13px; font-weight: 820; }
.mapping-kind span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.mapping-symbol-field { display: grid; gap: 5px; }
.mapping-meta { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.mapping-empty { margin: 0 18px; border: 1px dashed var(--line); border-radius: 8px; background: #f8fafc; color: var(--muted); padding: 18px; text-align: center; font-size: 12px; font-weight: 700; }
.mapping-add { display: grid; grid-template-columns: 100px 150px minmax(180px, 1fr) 104px; gap: 8px; padding: 14px 18px 8px; align-items: center; }
.mapping-add .select, .mapping-add .button { height: 34px; }
.modal-help { color: var(--muted); font-size: 12px; font-weight: 700; padding: 0 18px 14px; }
.modal-help.success { color: var(--green); }
.modal-help.danger { color: var(--red); }
.modal-footer { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding: 14px 18px 18px; }
.modal-footer-spacer { flex: 1; }
