:root {
  color-scheme: dark;
  --bg: #090d14;
  --panel: #282933;
  --panel-2: #111720;
  --row: #2d2c2b;
  --line: #383d49;
  --text: #f5f7fb;
  --muted: #a6acb8;
  --soft: #707789;
  --accent: #ff3044;
  --green: #49c978;
  --blue: #3e92ff;
  --warn: #ffb238;
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 215px 1fr;
  background: var(--bg);
  color: var(--text);
}

button,
select {
  font: inherit;
}

.sidebar {
  min-height: 100vh;
  padding: 42px 23px;
  background: var(--panel);
  border-right: 1px solid #1c202a;
}

.panel {
  padding-bottom: 38px;
  margin-bottom: 38px;
  border-bottom: 1px solid #555763;
}

.panel:last-child {
  border-bottom: 0;
}

.panel h2 {
  margin: 0 0 24px;
  font-size: 22px;
  letter-spacing: 0;
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field span {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 700;
}

.stepper {
  display: grid;
  grid-template-columns: 1fr 38px 38px;
  align-items: center;
  height: 44px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #070b12;
}

.stepper output {
  padding-left: 14px;
  font-weight: 800;
}

.stepper button {
  height: 44px;
  border: 0;
  background: #070b12;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.stepper button:hover,
.ghost:hover {
  background: #1c2532;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-weight: 800;
  line-height: 1.45;
}

.checkline input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.ghost {
  width: 100%;
  min-height: 44px;
  border: 1px solid #4a505e;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.status p {
  margin: 0 0 17px;
}

.status b {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 600;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--soft);
}

.dot.live {
  background: var(--blue);
}

.dot.ok {
  background: var(--green);
}

.workspace {
  min-width: 0;
  padding: 72px 86px 56px;
}

.product-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 52px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.accuracy-strip {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(600px, 2fr);
  gap: 28px;
  margin: 0 0 28px;
  padding: 22px 24px;
  border: 1px solid #343b48;
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(73, 201, 120, 0.09), transparent 42%),
    #111720;
}

.accuracy-heading p,
.accuracy-heading h2,
.accuracy-heading span,
.accuracy-metrics dt,
.accuracy-metrics dd {
  margin: 0;
}

.accuracy-heading p {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.accuracy-heading h2 {
  margin-top: 5px;
  font-size: 24px;
}

.accuracy-heading span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.accuracy-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #343b48;
}

.accuracy-metrics div {
  min-width: 0;
  padding: 12px 14px;
  background: #171e28;
}

.accuracy-metrics dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.accuracy-metrics dd {
  margin-top: 7px;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.product-nav-item {
  display: inline-flex;
  align-items: center;
  height: 52px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
}

.product-nav-item.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.product-nav-item.disabled {
  color: var(--soft);
  cursor: default;
}

.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.hero h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: 0;
}

.hero p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.radar-mark {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 2px solid #aeb6c6;
  border-radius: 50%;
  transform: rotate(-28deg);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.08);
}

.radar-mark::before,
.radar-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 2px;
  background: #7f8798;
  transform: translate(-50%, -50%) rotate(48deg);
}

.radar-mark::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.tabs {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  min-height: 42px;
  margin-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.tab {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.tab.active {
  color: #ff4657;
  border-bottom-color: var(--accent);
}

.table-card {
  overflow: hidden;
  border: 1px solid #303642;
  border-radius: var(--radius);
  background: #151a23;
}

.table-head {
  display: none;
}

.main-table-head {
  min-height: 62px;
}

.table-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.search-box,
.filter-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 250px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #404754;
  border-radius: 6px;
  outline: none;
  background: #0d121a;
  color: var(--text);
}

.search-box input:focus {
  border-color: var(--blue);
}

.filter-box select {
  width: 150px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #404754;
  border-radius: 6px;
  outline: none;
  background: #0d121a;
  color: var(--text);
  font-weight: 800;
}

.filter-box select:focus {
  border-color: var(--blue);
}

.table-wrap {
  width: 100%;
  max-height: calc(100vh - 255px);
  min-height: 420px;
  overflow: auto;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  min-width: 1730px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  height: 38px;
  padding: 0 10px;
  border-right: 1px solid #444852;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2),
th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7),
th:nth-child(15),
td:nth-child(15),
th:nth-child(16),
td:nth-child(16),
th:nth-child(17),
td:nth-child(17) {
  text-align: left;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
}

th:nth-child(2),
td:nth-child(2) {
  position: sticky;
  left: 92px;
  width: 190px;
  min-width: 190px;
  max-width: 190px;
  border-right: 2px solid #555b68;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: #1d222c;
  font-weight: 700;
}

th:first-child,
th:nth-child(2) {
  z-index: 4;
}

td:first-child,
td:nth-child(2) {
  z-index: 1;
  background: var(--row);
}

.sort-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.sort-button:hover {
  color: var(--text);
}

td {
  color: #b5bbc6;
  background: var(--row);
}

tr:hover td {
  background: #343334;
}

.watch-cell {
  text-align: center;
}

.watch-button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8f96a5;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.watch-button:hover,
.watch-button.selected {
  color: #ffbf3f;
}

.hot {
  color: #ff4050;
  font-weight: 900;
}

.cold {
  color: #4cc37a;
  font-weight: 900;
}

.mid {
  color: var(--warn);
  font-weight: 900;
}

.halt {
  color: #a2a8b4;
}

.pass {
  color: var(--green);
  font-weight: 900;
}

.fail {
  color: #ff4050;
  font-weight: 900;
}

.pending {
  color: var(--warn);
  font-weight: 900;
}

.muted-value {
  color: var(--muted);
  font-weight: 700;
}

.reference-value {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.05;
}

.reference-value small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.calibrated-value {
  color: var(--warn);
  font-weight: 900;
}

.empty {
  height: 72px;
  color: var(--muted);
  text-align: center !important;
}

.load-status {
  height: 46px;
  color: var(--muted);
  background: #181e28;
  text-align: center !important;
}

select {
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: #292b36;
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid #1c202a;
  }

  .workspace {
    padding: 28px 18px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .tabs {
    overflow-x: auto;
  }

  .product-nav {
    overflow-x: auto;
    margin-bottom: 24px;
  }

  .accuracy-strip {
    grid-template-columns: 1fr;
  }

  .accuracy-metrics {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    overflow-x: auto;
  }

  .main-table-head {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .search-box input {
    width: min(100%, 320px);
  }

  .filter-box select {
    width: min(100%, 220px);
  }

  .table-wrap {
    max-height: 65vh;
    min-height: 360px;
  }
}

@media (max-width: 700px) {
  body {
    min-width: 0;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    background: #1d2029;
  }

  .panel {
    margin: 0;
    padding: 12px;
    border: 1px solid #3a3f4b;
    border-radius: var(--radius);
    background: var(--panel);
  }

  .panel:first-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .panel h2 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 16px;
  }

  .field {
    min-width: 0;
    margin: 0;
  }

  .field span {
    min-height: 32px;
    margin-bottom: 5px;
    font-size: 12px;
  }

  .stepper {
    grid-template-columns: 1fr 34px 34px;
    height: 38px;
  }

  .stepper button {
    height: 38px;
  }

  .automation {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
  }

  .checkline {
    margin: 0;
    font-size: 13px;
  }

  .ghost {
    width: auto;
    min-height: 38px;
    padding: 0 14px;
  }

  .status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    font-size: 11px;
    line-height: 1.35;
  }

  .status p {
    min-width: 0;
    margin: 0;
  }

  .status b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    padding: 18px 10px 24px;
  }

  .product-nav {
    gap: 22px;
    min-height: 44px;
    margin-bottom: 20px;
    scrollbar-width: none;
  }

  .product-nav-item {
    height: 44px;
    flex: 0 0 auto;
    font-size: 15px;
  }

  .hero {
    gap: 12px;
    margin-bottom: 18px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .hero p {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
  }

  .radar-mark {
    width: 32px;
    height: 32px;
  }

  .tabs {
    gap: 20px;
    min-height: 40px;
    margin-bottom: 10px;
    scrollbar-width: none;
  }

  .tab {
    height: 40px;
    flex: 0 0 auto;
    font-size: 13px;
  }

  .main-table-head {
    min-height: 0;
    gap: 10px;
    padding: 10px;
  }

  .table-heading h2 {
    font-size: 15px;
  }

  .search-box,
  .filter-box {
    width: 100%;
  }

  .search-box span,
  .filter-box span {
    display: none;
  }

  .search-box input {
    width: 100%;
    height: 40px;
    font-size: 16px;
  }

  .filter-box select {
    width: 100%;
    height: 40px;
    font-size: 16px;
  }

  .table-wrap {
    max-height: 62dvh;
    min-height: 420px;
  }

  table {
    min-width: 760px;
    font-size: 12px;
  }

  th,
  td {
    height: 42px;
    padding: 0 7px;
  }

  th:first-child,
  td:first-child {
    width: 68px;
    min-width: 68px;
    max-width: 68px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    left: 68px;
    width: 122px;
    min-width: 122px;
    max-width: 122px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(6),
  td:nth-child(6),
  th:nth-child(9),
  td:nth-child(9),
  th:nth-child(10),
  td:nth-child(10),
  th:nth-child(12),
  td:nth-child(12),
  th:nth-child(13),
  td:nth-child(13) {
    display: none;
  }

  .watch-button {
    width: 34px;
    height: 34px;
  }

  .standalone-workspace {
    padding: 18px 10px 24px;
  }
}

.standalone-page {
  display: block;
}

.standalone-workspace {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 54px 34px;
}

.compact-hero {
  justify-content: space-between;
}

.compact-hero h1 {
  margin-top: 12px;
}

.back-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.visible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.visible-head h2 {
  margin: 0;
  font-size: 16px;
}

.visible-head span {
  color: var(--muted);
  font-size: 13px;
}

.strategy-table-wrap {
  max-height: calc(100vh - 230px);
}

.strategy-table {
  min-width: 760px;
}
