﻿@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Noto+Serif+SC:wght@500;700;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-base: #070f19;
  --bg-pane: rgba(11, 20, 34, 0.84);
  --bg-pane-strong: rgba(8, 16, 28, 0.95);
  --bg-soft: rgba(18, 32, 52, 0.72);
  --bg-topbar: rgba(8, 14, 24, 0.88);
  --line: rgba(116, 146, 186, 0.32);
  --line-strong: rgba(143, 174, 215, 0.54);
  --text-main: #e6eefb;
  --text-body: #becde4;
  --text-soft: #87a1c6;
  --accent: #35a4ff;
  --accent-2: #41d5ff;
  --signal-red: #ff5252;
  --signal-blue: #43a0ff;
  --signal-yellow: #ffbc57;
  --ok: #35d399;
  --warn: #ffb74d;
  --danger: #ff7f7f;
  --shadow-soft: 0 18px 36px rgba(2, 8, 16, 0.35);
  --shadow-hard: 0 24px 56px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1100px 500px at -15% -20%, rgba(53, 164, 255, 0.24), transparent 70%),
    radial-gradient(800px 380px at 120% -8%, rgba(65, 213, 255, 0.16), transparent 68%),
    radial-gradient(600px 520px at 82% 112%, rgba(255, 188, 87, 0.11), transparent 72%),
    var(--bg-base);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(146, 173, 206, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 173, 206, 0.04) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  mask-image: radial-gradient(circle at center, black 24%, transparent 85%);
  opacity: 0.42;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px;
  border-right: 1px solid rgba(158, 190, 232, 0.2);
  background:
    linear-gradient(165deg, rgba(20, 36, 56, 0.88), rgba(8, 15, 27, 0.95));
  box-shadow: inset -1px 0 0 rgba(158, 190, 232, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 10px;
  border: 1px solid rgba(131, 165, 210, 0.28);
  background: linear-gradient(140deg, rgba(37, 64, 97, 0.72), rgba(17, 31, 51, 0.82));
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #04243d;
  background: linear-gradient(140deg, var(--accent-2), #7df2ff);
}

.logo {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  font-weight: 700;
  color: #f3f8ff;
  letter-spacing: 0.2px;
}

.logo-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #8ea7cc;
  letter-spacing: 0.35px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #a9bedf;
  font-size: 14px;
  transition: all 140ms ease;
}

.nav-item:hover {
  color: #eff7ff;
  border-color: rgba(152, 190, 238, 0.35);
  background: linear-gradient(90deg, rgba(53, 164, 255, 0.24), rgba(53, 164, 255, 0.04));
}

.nav-item.active {
  color: #f4fbff;
  border-color: rgba(153, 192, 241, 0.5);
  background: linear-gradient(90deg, rgba(53, 164, 255, 0.38), rgba(53, 164, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(178, 212, 255, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  border: 1px solid rgba(152, 190, 238, 0.28);
  border-radius: 12px;
  padding: 11px;
  color: #92abd0;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(12, 24, 41, 0.72);
}

.shell-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 22px;
  border-bottom: 1px solid rgba(137, 170, 213, 0.28);
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
}

.topbar-title {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 700;
  color: #eff6ff;
  letter-spacing: 0.18px;
}

.topbar-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-link {
  font-size: 12px;
  color: #cfe0f8;
  border: 1px solid rgba(151, 186, 232, 0.4);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(19, 34, 54, 0.74);
}

.top-link:hover {
  color: #f2f8ff;
  border-color: rgba(170, 207, 255, 0.65);
  background: rgba(39, 70, 106, 0.72);
}

.main {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.page-title {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(140, 173, 214, 0.38);
  background:
    linear-gradient(128deg, rgba(18, 33, 53, 0.88), rgba(12, 25, 42, 0.94));
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.page-title::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(65, 213, 255, 0.3), transparent 70%);
}

.page-title h1 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 30px;
  font-weight: 700;
  color: #f1f7ff;
  position: relative;
  z-index: 1;
}

.page-title p {
  margin: 8px 0 0;
  max-width: 780px;
  color: #b9cae4;
  line-height: 1.6;
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border-radius: 14px;
  border: 1px solid rgba(136, 170, 213, 0.35);
  background:
    linear-gradient(152deg, rgba(16, 30, 49, 0.88), rgba(10, 20, 35, 0.92));
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.card h2,
.card h3 {
  margin: 0 0 10px;
  font-family: "Noto Serif SC", serif;
  font-size: 17px;
  font-weight: 700;
  color: #eaf2ff;
}

.stat-value {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  color: #f3f8ff;
}

.stat-muted {
  font-size: 13px;
  line-height: 1.55;
  color: #9ab1d3;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #90aad2;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(131, 165, 205, 0.42);
  background: rgba(14, 27, 46, 0.92);
  color: #e6efff;
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 208, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(53, 164, 255, 0.24);
  background: rgba(20, 38, 63, 0.95);
}

input[type="range"] {
  padding: 0;
  accent-color: #4ac4ff;
}

.inline-field {
  min-width: 170px;
}

.wide-inline-field {
  min-width: 260px;
  flex: 1;
}

button {
  border-radius: 10px;
  border: 1px solid rgba(123, 201, 255, 0.45);
  background: linear-gradient(140deg, #1787e5, #3cbaf5);
  color: #f8fcff;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(19, 119, 204, 0.32);
  filter: saturate(1.12);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  color: #d8e7ff;
  border-color: rgba(131, 166, 210, 0.55);
  background: linear-gradient(140deg, rgba(33, 53, 81, 0.9), rgba(23, 40, 64, 0.95));
}

button.secondary:hover {
  border-color: rgba(174, 208, 250, 0.8);
  box-shadow: 0 8px 16px rgba(6, 15, 28, 0.48);
}

button.warn {
  border-color: rgba(255, 195, 116, 0.6);
  background: linear-gradient(140deg, #d9871f, #f0b43f);
  color: #201405;
}

button.danger {
  border-color: rgba(255, 144, 144, 0.7);
  background: linear-gradient(140deg, #d24141, #ed6767);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.msg {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid rgba(124, 159, 201, 0.5);
  background: rgba(19, 35, 57, 0.9);
  color: #bbcff0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.msg.ok {
  border-color: rgba(93, 214, 161, 0.6);
  background: rgba(12, 52, 39, 0.85);
  color: #8df8cb;
}

.msg.error {
  border-color: rgba(255, 124, 124, 0.65);
  background: rgba(65, 22, 22, 0.84);
  color: #ffc4c4;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  margin: 2px 6px 2px 0;
  border: 1px solid rgba(132, 168, 214, 0.5);
  background: rgba(20, 38, 61, 0.86);
  color: #d2e3fb;
  font-size: 12px;
  line-height: 1;
}

.badge.ok {
  border-color: rgba(88, 205, 153, 0.5);
  background: rgba(20, 57, 44, 0.85);
  color: #9ff2cd;
}

.badge.warn {
  border-color: rgba(243, 185, 95, 0.56);
  background: rgba(63, 45, 19, 0.86);
  color: #ffdba8;
}

.badge.danger {
  border-color: rgba(239, 124, 124, 0.56);
  background: rgba(61, 25, 25, 0.86);
  color: #ffb9b9;
}

.table-wrap {
  border-radius: 12px;
  border: 1px solid rgba(130, 164, 207, 0.38);
  background: rgba(9, 20, 34, 0.86);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid rgba(116, 144, 184, 0.22);
  padding: 9px 10px;
  white-space: nowrap;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(16, 33, 55, 0.96);
  color: #cde0fc;
  font-weight: 700;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover td {
  background: rgba(27, 50, 80, 0.65);
}

#scanResultBody tr.active-row td {
  background: rgba(49, 93, 148, 0.7);
}

pre.code {
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(123, 156, 197, 0.38);
  background: rgba(8, 17, 29, 0.95);
  color: #d5e3f8;
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.48;
  font-family: "JetBrains Mono", "Consolas", monospace;
}

.scan-progress-wrap {
  margin-top: 10px;
  border: 1px solid rgba(126, 160, 202, 0.4);
  border-radius: 12px;
  padding: 10px;
  background: rgba(14, 28, 47, 0.75);
}

.scan-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #b6cae8;
}

.scan-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(73, 97, 134, 0.55);
}

#scanProgressBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #1d8be9 0%, #4ad1ff 100%);
  transition: width 220ms ease;
}

.scan-live-log {
  margin-top: 10px;
  min-height: 130px;
  max-height: 280px;
  border-radius: 12px;
  border: 1px solid rgba(109, 140, 178, 0.5);
  background: rgba(8, 16, 28, 0.95);
  color: #d3def2;
  padding: 10px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", "Consolas", monospace;
}

.mt8 {
  margin-top: 8px;
}

.compact-row {
  gap: 8px;
  margin-bottom: 8px;
}

.scan-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
}

.match-focus-panel {
  margin-top: 10px;
  margin-bottom: 6px;
  border: 1px solid rgba(136, 174, 221, 0.5);
  border-radius: 14px;
  padding: 12px 14px;
  background:
    linear-gradient(140deg, rgba(22, 43, 69, 0.86), rgba(10, 23, 38, 0.92));
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.match-focus-label {
  font-size: 12px;
  color: #99b5dc;
}

.match-focus-score {
  margin-top: 4px;
  font-size: 52px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #e8f2ff;
  text-shadow: 0 0 24px rgba(57, 180, 255, 0.26);
  transition: color 180ms ease, text-shadow 180ms ease;
}

.match-focus-score[data-level="xl"] {
  color: #49e89a;
  text-shadow: 0 0 26px rgba(73, 232, 154, 0.35);
}

.match-focus-score[data-level="high"] {
  color: #7de3ff;
  text-shadow: 0 0 26px rgba(125, 227, 255, 0.35);
}

.match-focus-score[data-level="mid"] {
  color: #ffd36d;
  text-shadow: 0 0 24px rgba(255, 211, 109, 0.32);
}

.match-focus-score[data-level="low"] {
  color: #ff9a9a;
  text-shadow: 0 0 24px rgba(255, 154, 154, 0.3);
}

.match-focus-meta {
  display: grid;
  gap: 6px;
  text-align: right;
  font-size: 12px;
  color: #b7cbed;
}

#klineChart {
  width: 100%;
  min-height: 280px;
  flex: 1;
}

.scanner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(420px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.scanner-stage {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.scanner-workbench {
  --sticky-top: 66px;
  --sticky-gap: 12px;
  position: sticky;
  top: var(--sticky-top);
  height: calc(100vh - var(--sticky-top) - var(--sticky-gap));
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.scanner-tabs-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(132, 169, 215, 0.4);
  border-radius: 12px;
  background: rgba(11, 23, 38, 0.88);
}

.scanner-tab-btn {
  border-radius: 10px;
  border: 1px solid rgba(125, 165, 214, 0.45);
  background: rgba(22, 39, 62, 0.9);
  color: #c5daf8;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.scanner-tab-btn.active {
  border-color: rgba(141, 209, 255, 0.78);
  background: linear-gradient(140deg, rgba(30, 93, 160, 0.84), rgba(23, 66, 120, 0.9));
  color: #eff7ff;
}

.scanner-tab-panels {
  flex: 1;
  min-height: 0;
}

.scanner-tab-panel {
  display: none;
  height: 100%;
  min-height: 0;
}

.scanner-tab-panel.active {
  display: block;
}

.scanner-tab-panel > .card {
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.scanner-tab-panel[data-tab-panel="rank"] > .scan-result-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scanner-tab-panel[data-tab-panel="rank"] > .scan-result-card .table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.scanner-chart-card {
  --sticky-top: 66px;
  --sticky-gap: 12px;
  position: sticky;
  top: var(--sticky-top);
  height: calc(100vh - var(--sticky-top) - var(--sticky-gap));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(166, 198, 238, 0.5);
  background:
    linear-gradient(155deg, rgba(10, 23, 40, 0.93), rgba(9, 20, 33, 0.96));
  box-shadow: var(--shadow-hard);
}

.scanner-chart-card::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(53, 164, 255, 0.25), transparent 72%);
  pointer-events: none;
}

.scanner-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  flex-wrap: wrap;
}

.scanner-control-card .controls {
  gap: 9px;
}

.manual-check-card {
  margin-top: 0;
}

.api-update-card {
  margin-top: 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #46b8ff;
}

.compact-log {
  min-height: 130px;
  max-height: 240px;
}

.rule-config-panel {
  margin-top: 10px;
  border: 1px solid rgba(126, 164, 211, 0.46);
  border-radius: 12px;
  padding: 10px;
  background: rgba(10, 21, 36, 0.76);
}

.rule-config-panel > summary {
  cursor: pointer;
  color: #bad0f1;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.rule-config-panel > summary::-webkit-details-marker {
  display: none;
}

.rule-config-panel > summary::before {
  content: "▸";
  margin-right: 6px;
  color: #7ab5f6;
}

.rule-config-panel[open] > summary::before {
  content: "▾";
}

.rule-config-toolbar {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.rule-param-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rule-param-item {
  border: 1px solid rgba(126, 163, 208, 0.34);
  border-radius: 10px;
  padding: 8px;
  background: rgba(12, 25, 41, 0.86);
}

.rule-param-item label {
  margin-bottom: 6px;
  font-size: 12px;
  color: #a8c0e4;
}

.rule-param-item label [data-role="value"] {
  color: #8de6ff;
  font-weight: 800;
}

.rule-param-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
  align-items: center;
}

.rule-param-row input[type="number"] {
  padding: 6px 8px;
  font-size: 12px;
}

.rule-toggle-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rule-advanced {
  margin-top: 10px;
  border: 1px dashed rgba(128, 163, 209, 0.48);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(10, 21, 35, 0.75);
}

.rule-advanced > summary {
  cursor: pointer;
  color: #a8bfe2;
  font-size: 12px;
  list-style: none;
}

.rule-advanced > summary::-webkit-details-marker {
  display: none;
}

.rule-advanced > summary::before {
  content: "▸";
  margin-right: 6px;
  color: #7fb3f1;
}

.rule-advanced[open] > summary::before {
  content: "▾";
}

.hero-panel {
  border-width: 1px;
  box-shadow: var(--shadow-hard);
}

.hero-panel p {
  max-width: 760px;
}

.holiday-tip {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid rgba(129, 165, 210, 0.42);
  background: rgba(14, 27, 45, 0.72);
  color: #b8cee9;
  padding: 9px 11px;
  font-size: 13px;
}

.holiday-tip.warn {
  border-color: rgba(255, 194, 102, 0.62);
  background: rgba(63, 47, 18, 0.8);
  color: #ffe1a8;
}

/* settings page */
body[data-page="settings"] .settings-main {
  gap: 16px;
}

body[data-page="settings"] .settings-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(520px, 1.2fr);
  gap: 14px;
  align-items: start;
}

body[data-page="settings"] .settings-card {
  min-height: 100%;
}

body[data-page="settings"] .settings-log {
  min-height: 430px;
  max-height: calc(100vh - 320px);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi-item {
  border-radius: 12px;
  border: 1px solid rgba(126, 162, 204, 0.35);
  background: rgba(15, 29, 47, 0.84);
  padding: 10px;
}

.kpi-item .label {
  font-size: 12px;
  color: #8ea9d0;
}

.kpi-item .value {
  margin-top: 5px;
  font-size: 19px;
  font-weight: 800;
  color: #eef5ff;
}

.page-title,
.card {
  animation: fade-rise 320ms ease both;
}

.main > *:nth-child(2) {
  animation-delay: 30ms;
}

.main > *:nth-child(3) {
  animation-delay: 70ms;
}

.main > *:nth-child(4) {
  animation-delay: 110ms;
}

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1320px) {
  .scanner-layout {
    grid-template-columns: 1fr;
  }

  .scanner-workbench,
  .scanner-chart-card {
    position: static;
    top: auto;
    height: auto;
  }

  .scanner-tab-panels {
    min-height: auto;
  }

  .scanner-tab-panel {
    height: auto;
  }

  .scanner-tab-panel > .card {
    height: auto;
    overflow: visible;
  }

  .scan-result-card .table-wrap {
    max-height: 520px;
  }

  #klineChart {
    min-height: 560px;
    flex: none;
  }

  .match-focus-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .rule-param-grid {
    grid-template-columns: 1fr;
  }

  .match-focus-meta {
    text-align: left;
  }

  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="settings"] .settings-layout {
    grid-template-columns: 1fr;
  }

  body[data-page="settings"] .settings-log {
    min-height: 300px;
    max-height: 420px;
  }
}

@media (max-height: 900px) {
  #klineChart {
    min-height: 240px;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    position: static;
  }

  .main {
    padding: 14px;
  }

  .grid.cols-2,
  .grid.cols-3,
  .kpi-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 14px;
  }

  .topbar-title {
    font-size: 19px;
  }

  .page-title {
    padding: 14px;
  }

  .page-title h1 {
    font-size: 24px;
  }

  .controls {
    align-items: stretch;
  }

  .inline-field,
  .wide-inline-field {
    min-width: 100%;
  }

  button {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
  }

  #klineChart {
    min-height: 470px;
  }
}
