:root {
  --bg: #07111f;
  --surface: #0d1726;
  --surface-2: #101c2e;
  --header: #14243a;
  --border: #26364c;
  --border-strong: #3c5675;
  --text: #e7eef8;
  --muted: #9fb0c4;
  --up: #22c55e;
  --down: #ef4444;
  --flat: #94a3b8;
  --accent: #38bdf8;
  --font: "HarmonyOS Sans SC", "HarmonyOS Sans", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  --mono: "HarmonyOS Sans SC", "HarmonyOS Sans", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  --tabs-height: 48px;
  --title-height: 44px;
  --head-height: 70px;
}

* {
  box-sizing: border-box;
}

html,
body,
.stock-page {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.stock-page {
  overflow: auto;
  padding: var(--tabs-height) 0 24px;
}

.layer-tabs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100vw;
  min-width: 100vw;
  height: 48px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-strong);
  background: #07111f;
}

.layer-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0 4px;
  flex: 1 1 10%;
  min-width: 0;
  justify-content: center;
  color: var(--muted);
  background: #0d1726;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.layer-tab em {
  min-width: 16px;
  border-radius: 999px;
  padding: 1px 4px;
  color: #dff6ff;
  background: rgba(56, 189, 248, 0.12);
  font-style: normal;
  font-size: 10px;
}

.layer-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.layer-tab.active {
  border-color: rgba(56, 189, 248, 0.7);
  color: var(--text);
  background: rgba(56, 189, 248, 0.16);
}

.layer-section {
  min-width: max-content;
  margin: 0 0 22px;
  background: var(--bg);
}

.layer-title {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100vw;
  min-width: 100vw;
  height: 44px;
  margin: 0;
  padding: 0 14px 0 14px;
  border-bottom: 1px solid var(--border-strong);
  background: #07111f;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.layer-title::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: var(--tabs-height);
  height: var(--title-height);
  background: #07111f;
  pointer-events: none;
  z-index: -1;
}

.layer-title,
.stock-table thead tr {
  box-shadow: 9999px 0 0 #07111f, -9999px 0 0 #07111f;
}

.layer-title::after {
  content: none;
}

.layer-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stock-table {
  width: auto;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  line-height: 1.45;
}

.stock-table th,
.stock-table td {
  max-width: 180px;
  min-width: 0;
  padding: 7px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  background: var(--surface);
}

.stock-table th {
  position: sticky;
  top: var(--title-height);
  z-index: 4;
  background: var(--header);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 -1px 0 var(--border-strong);
}

.stock-table thead tr {
  background: var(--header);
}

.th-label {
  height: 26px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-filter {
  height: 28px;
  padding-top: 4px;
}

.filter-control {
  width: 100%;
  height: 24px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 6px;
  outline: none;
  color: var(--text);
  background: #07111f;
  font-family: var(--font);
  font-size: 12px;
}

.filter-control::placeholder {
  color: #6f8197;
}

.filter-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.14);
}

.filter-control option {
  color: #0d1726;
  background: #ffffff;
}

.stock-table tbody tr:nth-child(even) td {
  background: var(--surface-2);
}

.stock-table tbody tr:hover td {
  background: #14243a;
}

.stock-table th:first-child,
.stock-table td:first-child {
  border-left: 1px solid var(--border);
}

.stock-table td.sticky-1,
.stock-table th.sticky-1,
.stock-table td.sticky-2,
.stock-table th.sticky-2,
.stock-table td.sticky-3,
.stock-table th.sticky-3 {
  position: sticky;
  z-index: 3;
  box-shadow: 1px 0 0 var(--border);
}

.stock-table th.sticky-1,
.stock-table th.sticky-2,
.stock-table th.sticky-3 {
  z-index: 6;
}

.sticky-1 {
  left: 0;
  width: 136px;
  min-width: 136px;
}

.sticky-2 {
  left: 136px;
  width: 108px;
  min-width: 108px;
}

.sticky-3 {
  left: 244px;
  width: 56px;
  min-width: 56px;
}

.num,
.mono {
  font-family: var(--mono);
  white-space: nowrap;
}

.num {
  text-align: right;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 6px;
  color: #dff6ff;
  background: rgba(56, 189, 248, 0.12);
  white-space: nowrap;
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

.flat {
  color: var(--flat);
}

.spark {
  width: 104px;
  height: 34px;
  display: block;
}

.muted {
  color: var(--muted);
}

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

.col-direction {
  min-width: 136px;
  width: 136px;
  max-width: 136px;
}

.col-name {
  min-width: 108px;
  width: 108px;
  max-width: 108px;
}

.col-region,
.col-status,
.col-core,
.col-priority,
.col-confidence {
  min-width: 58px;
  width: 58px;
  max-width: 58px;
}

.col-company-type {
  min-width: 76px;
  width: 76px;
  max-width: 76px;
}

.col-revenue-strength {
  min-width: 150px;
  width: 150px;
  max-width: 150px;
}

.col-ticker {
  min-width: 92px;
  width: 92px;
  max-width: 92px;
}

.col-market {
  min-width: 76px;
  width: 76px;
  max-width: 76px;
}

.col-price {
  min-width: 88px;
  width: 88px;
  max-width: 88px;
}

.col-change {
  min-width: 86px;
  width: 86px;
  max-width: 86px;
}

.col-cap {
  min-width: 106px;
  width: 106px;
  max-width: 106px;
}

.col-pe,
.col-score,
.col-flag {
  min-width: 60px;
  width: 60px;
  max-width: 60px;
}

.col-spark {
  min-width: 108px;
  width: 108px;
  max-width: 108px;
}

.col-medium {
  min-width: 150px;
  width: 150px;
  max-width: 150px;
}

.col-long {
  min-width: 190px;
  width: 190px;
  max-width: 190px;
}
