:root {
  --frame: #1d232f;
  --frame-inner: #2f3947;
  --grid-line: rgba(152, 171, 200, 0.45);
  --cell-bg: #f5f9ff;
  --cell-bg-soft: #ffffff;
  --cell-alt-bg: #d5e3fb;
  --cell-alt-bg-soft: #e1ebff;
  --head-bg: #21252f;
  --head-text: #d9e1f1;
  --brand-text: #d7d7df;
  --red-band: #6f1f27;
  --red-band-dark: #4f1820;
  --green-fill: #179060;
  --green-fill-deep: #1c7e5c;
  --green-text: #c8f2dd;
  --green-text-soft: #2f875f;
  --red-text: #b63e3c;
  --name-text: #1d2440;
  --head-h: 6.2%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.1), transparent 20%),
    linear-gradient(to bottom, #232a34, #151b23 38%, #11161d 100%);
}

body {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

.board-wrap {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  position: fixed;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(187, 201, 223, 0.2);
  box-shadow:
    inset 0 0 0 1px rgba(228, 236, 248, 0.1),
    0 0 30px rgba(0, 0, 0, 0.45);
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 20%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05) 48%, rgba(255, 255, 255, 0.02)),
    linear-gradient(to bottom, #323a46, #1e242d 100%);
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 6%, rgba(255, 255, 255, 0.85) 0 1.1%, transparent 2.4%),
    radial-gradient(circle at 46% 6%, rgba(255, 255, 255, 0.82) 0 1.2%, transparent 2.6%),
    radial-gradient(circle at 82% 6%, rgba(255, 255, 255, 0.82) 0 1.1%, transparent 2.4%);
  opacity: 0.9;
  pointer-events: none;
}

.board {
  position: absolute;
  inset: 0;
  padding: 0.65% 0.6%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(39, 18, 23, 0.45), rgba(97, 24, 31, 0.3) 50%, rgba(40, 16, 22, 0.45)),
    linear-gradient(to bottom, #2c3139 0, #181d25 100%);
}

.top-bar {
  height: 7.6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5% 0 1.2%;
  background:
    linear-gradient(90deg, rgba(103, 28, 37, 0.78), rgba(111, 32, 41, 0.62) 50%, rgba(105, 31, 39, 0.76)),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent 40%);
  border: 1px solid rgba(197, 168, 172, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6vw;
}

.brand-icon {
  width: clamp(16px, 1.6vw, 28px);
  height: clamp(16px, 1.6vw, 28px);
  border: 2px solid #c4c8d9;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.brand-logo {
  max-width: min(30vw, 360px);
  height: clamp(24px, 3.9vw, 56px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-logo img {
  width: auto;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-icon::before,
.brand-icon::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  border-top: 2px solid #c4c8d9;
  border-radius: 10px;
}

.brand-icon::before {
  top: 34%;
}

.brand-icon::after {
  top: 52%;
}

.brand-text .title {
  color: var(--brand-text);
  font-size: clamp(14px, 1.75vw, 24px);
  font-weight: 900;
  line-height: 1;
}

.brand-text .subtitle {
  margin-top: 0.15vw;
  color: #cfd1dc;
  font-size: clamp(5px, 0.6vw, 9px);
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand-title-only {
  color: #FFF4B8 !important;
  -webkit-text-fill-color: #FFF4B8 !important;
  text-fill-color: #FFF4B8 !important;
  background: none !important;
  font-size: clamp(20px, 2.7vw, 40px);
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
  margin-left: 0.8vw;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  -webkit-text-stroke: 0 transparent;
  filter: none !important;
  opacity: 1 !important;
}

.clock {
  color: #dde4f5;
  font-size: clamp(12px, 1.65vw, 24px);
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.content {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 49.5% 4.6% 45.9%;
  gap: 0;
}

.market {
  min-width: 0;
  min-height: 0;
}

.left-market {
  display: grid;
  grid-template-columns: 7.8% 92.2%;
  position: relative;
}

.right-market {
  display: block;
}

.side-labels {
  display: grid;
  grid-template-rows: var(--head-h) 1fr 1fr;
  background:
    linear-gradient(
      to bottom,
      var(--head-bg) 0,
      var(--head-bg) var(--head-h),
      rgba(133, 37, 46, 0.95) var(--head-h),
      rgba(108, 30, 39, 0.96) 55%,
      rgba(84, 24, 32, 0.98) 100%
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 50%, rgba(255, 255, 255, 0.05));
  margin-top: 0;
  height: 100%;
  overflow: hidden;
}

.side-labels::before {
  content: "";
  display: block;
  background: var(--head-bg);
}

.left-market::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  top: calc(var(--head-h) + (100% - var(--head-h)) / 2);
  border-top: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.side-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f2f5fb;
  font-size: clamp(12px, 1.45vw, 20px);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.side-label.top {
  border-bottom: 0;
}

.center-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(
      to bottom,
      var(--head-bg) 0,
      var(--head-bg) var(--head-h),
      rgba(133, 37, 46, 0.95) var(--head-h),
      rgba(108, 30, 39, 0.96) 55%,
      rgba(84, 24, 32, 0.98) 100%
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 50%, rgba(255, 255, 255, 0.05));
  margin-top: 0;
  height: calc(100% + 1px);
}

.center-divider span {
  writing-mode: vertical-rl;
  text-orientation: upright;
  color: #edf2ff;
  font-size: clamp(13px, 1.55vw, 21px);
  font-weight: 700;
  letter-spacing: 0.2em;
}

.table-area {
  height: 100%;
  display: grid;
  grid-template-rows: var(--head-h) 1fr;
  min-width: 0;
  min-height: 0;
  border-left: 0;
  border-top: 0;
}

.table-head,
.row {
  display: grid;
  grid-template-columns: 1.18fr 1.16fr 1.16fr 0.84fr;
}

.table-head {
  min-height: 0;
  background: var(--head-bg);
}

.table-head > div {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--head-text);
  font-size: clamp(11px, 1.38vw, 20px);
  font-weight: 700;
  border-right: 0;
  border-bottom: 0;
}

.table-head > div:last-child {
  border-right: 0;
}

.rows {
  display: grid;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--grid-line);
  border-top: 1px solid var(--grid-line);
}

.row {
  min-height: 0;
}

.row > div {
  border-right: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
}

.row > div:last-child {
  border-right: 0;
}

.name,
.val,
.highlow {
  background: linear-gradient(to bottom, var(--cell-bg-soft), var(--cell-bg));
}

.row:nth-child(odd) .name,
.row:nth-child(odd) .val:not(.val-green),
.row:nth-child(odd) .highlow {
  background: linear-gradient(to bottom, var(--cell-alt-bg-soft), var(--cell-alt-bg));
}

.name {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--name-text);
  font-size: clamp(12px, 1.7vw, 24px);
  font-weight: 800;
  white-space: nowrap;
}

.val {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(14px, 2vw, 28px);
  font-weight: 900;
  white-space: nowrap;
}

.val-green {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(to bottom, var(--green-fill), var(--green-fill-deep));
  color: var(--green-text);
}

.val-green-text {
  color: var(--green-text-soft);
}

.val-red-text {
  color: var(--red-text);
}

.price-changed {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent 35%),
    linear-gradient(to bottom, #18a56f, #138a5d) !important;
  color: #e9fff5 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  transition: background 0.25s ease, color 0.25s ease;
}

.highlow {
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
  padding: 2% 0;
  font-size: clamp(10px, 1.25vw, 18px);
  font-weight: 500;
  line-height: 1;
}

.highlow .hi {
  color: #a15356;
}

.highlow .lo {
  color: #4f8667;
}

.highlow .price-changed {
  display: inline-block;
  min-width: 78%;
  text-align: center;
  border-radius: 4px;
  padding: 0.04em 0.1em;
}

.notice-bar {
  height: 4.8%;
  min-height: 24px;
  margin-top: 0;
  background: linear-gradient(to bottom, #0a0d12, #121721);
  border-top: 1px solid rgba(170, 186, 212, 0.22);
  border-bottom: 1px solid rgba(170, 186, 212, 0.08);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.notice-track {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.notice-text {
  display: inline-block;
  padding-left: 100%;
  color: #dce5f8;
  font-size: clamp(11px, 1.3vw, 18px);
  letter-spacing: 0.02em;
  animation: ticker 20s linear infinite;
}

@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@media (max-width: 720px) {
  .top-bar {
    height: 8%;
    padding: 0 2.2% 0 1.8%;
  }

  .brand {
    gap: 1.2vw;
  }

  .brand-text .title {
    font-size: clamp(12px, 4vw, 18px);
  }

  .brand-text .subtitle {
    font-size: clamp(5px, 1.7vw, 8px);
  }

  .clock {
    font-size: clamp(10px, 3.4vw, 16px);
  }

  .content {
    grid-template-columns: 1fr;
    grid-template-rows: 49% 3% 48%;
  }

  .left-market {
    grid-template-columns: 9.5% 90.5%;
  }

  .center-divider {
    margin-top: 0;
    height: auto;
  }

  .center-divider span {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    letter-spacing: 0.25em;
    font-size: clamp(10px, 2.8vw, 14px);
  }

  .side-label {
    font-size: clamp(10px, 2.9vw, 16px);
  }

  .table-head > div {
    font-size: clamp(10px, 2.9vw, 14px);
  }

  .name {
    font-size: clamp(11px, 3.1vw, 16px);
  }

  .val {
    font-size: clamp(12px, 3.5vw, 18px);
  }

  .highlow {
    font-size: clamp(9px, 2.5vw, 12px);
  }

  .notice-bar {
    min-height: 22px;
  }

  .notice-text {
    font-size: clamp(10px, 3vw, 14px);
    animation-duration: 14s;
  }
}

@media (max-width: 420px) {
  .left-market {
    grid-template-columns: 11% 89%;
  }

  .table-head,
  .row {
    grid-template-columns: 1.05fr 1.1fr 1.1fr 0.85fr;
  }
}
