:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #18202c;
  --muted: #6d7886;
  --line: #dfe5ec;
  --blue: #0b63ce;
  --cyan: #0a7f9f;
  --red: #d92525;
  --green: #0aa64b;
  --amber: #b7791f;
  --strike: #f0f3f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(10, 127, 159, 0.08), transparent 300px),
    var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(1920px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar,
.underlying-panel,
.quote-board,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(36, 51, 74, 0.07);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

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

.topbar > div:first-child {
  min-width: 0;
}

.metric {
  min-width: 118px;
  padding: 8px 10px;
  border-left: 3px solid var(--cyan);
  background: #f7fafc;
}

.metric span,
.label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong,
.underlying-panel strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

button {
  height: 40px;
  padding: 0 16px;
  border: 1px solid #0957b8;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.workspace-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.workspace-tabs button {
  min-width: 102px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.workspace-tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.underlying-panel {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
  padding: 16px 18px;
}

.month-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.month-tabs button {
  min-width: 112px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.month-tabs button.active {
  border-color: var(--blue);
  background: #eaf2ff;
  color: var(--blue);
}

.quote-board {
  overflow: hidden;
}

.board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.board-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.table-wrap.compact {
  max-height: 520px;
}

.tquote-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tquote-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 36px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.tquote-table .group-row th {
  top: 0;
  height: 34px;
  background: #eef2f7;
  text-align: center;
  font-size: 14px;
}

.tquote-table thead tr:nth-child(2) th {
  top: 34px;
}

.tquote-table td {
  height: 42px;
  border-bottom: 1px solid var(--line);
  padding: 6px 9px;
  text-align: right;
  font-size: 13px;
}

.tquote-table th:first-child,
.tquote-table td:first-child,
.tquote-table th:nth-child(11),
.tquote-table td:nth-child(11) {
  text-align: left;
}

.strike-head,
.strike-cell {
  background: var(--strike) !important;
  color: var(--ink) !important;
  text-align: center !important;
  font-weight: 850;
}

.contract-code {
  color: #2d3748;
  font-size: 12px;
  line-height: 1.2;
}

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

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

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

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

.data-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 1fr) minmax(240px, 0.8fr);
  gap: 14px;
}

.panel {
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title span,
.panel-title a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.panel-title a {
  color: var(--blue);
  font-weight: 800;
}

.info-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  padding: 6px 16px 16px;
}

.info-list div {
  min-width: 0;
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid #edf1f5;
}

.info-list dt {
  color: var(--muted);
  font-size: 12px;
}

.info-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 750;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px;
}

.metric-tile {
  min-height: 72px;
  padding: 12px;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  background: #fafbfd;
}

.metric-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-tile strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.source-links,
.document-list {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.source-links a,
.document-item {
  min-width: 0;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  background: #fbfcfe;
}

.source-links a {
  display: block;
  padding: 10px 12px;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.components-panel {
  margin-top: 14px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  height: 38px;
  border-bottom: 1px solid var(--line);
  padding: 7px 12px;
  text-align: right;
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  color: var(--blue);
  font-weight: 800;
}

.data-table th:first-child,
.data-table td:first-child,
.data-table th:nth-child(2),
.data-table td:nth-child(2),
.data-table th:last-child,
.data-table td:last-child {
  text-align: left;
}

.documents-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}

.document-item {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.document-date {
  color: var(--muted);
  font-size: 12px;
}

.document-title {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
}

.document-title:hover,
.source-links a:hover,
.panel-title a:hover {
  color: var(--cyan);
}

.document-tag {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4f7;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .shell {
    width: calc(100vw - 24px);
  }

  .tquote-table td,
  .tquote-table th {
    padding-left: 7px;
    padding-right: 7px;
  }
}

@media (max-width: 900px) {
  .shell {
    width: calc(100vw - 16px);
    padding-top: 12px;
  }

  .topbar,
  .board-title,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 24px;
    line-height: 1.16;
  }

  .actions,
  .workspace-tabs,
  .month-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .underlying-panel,
  .data-grid,
  .documents-layout {
    grid-template-columns: 1fr;
  }

  .info-list,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .document-item {
    grid-template-columns: 1fr;
  }
}
