:root {
  --bg: #edf5fc;
  --surface: #ffffff;
  --surface-2: #f6faff;
  --ink: #102033;
  --muted: #5c6f84;
  --line: #d7e5f2;
  --accent: #1f6fb2;
  --accent-2: #0d8aa6;
  --warm: #2f80d8;
  --gold: #557da8;
  --danger: #4c6f96;
  --shadow: 0 18px 45px rgba(20, 62, 103, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(31, 111, 178, 0.11), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 62%, #dfeefa 100%);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1760px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 26px 0 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 22px 24px;
  border: 1px solid rgba(31, 111, 178, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.brand-block {
  min-width: 0;
}

.eyebrow,
.section-kicker,
.current-kicker,
.detail-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.eyebrow span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warm);
}

h1,
h2,
h3,
p,
dl {
  margin-top: 0;
}

h1 {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.22;
  letter-spacing: 0;
}

.lead {
  max-width: 860px;
  margin-bottom: 0;
  color: #51687e;
  font-size: 15px;
  line-height: 1.7;
}

.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 10px;
  min-width: 520px;
  margin-bottom: 0;
}

.meta-strip div {
  min-width: 0;
  padding: 12px 12px;
  border: 1px solid rgba(31, 111, 178, 0.18);
  border-radius: 8px;
  background: #f6faff;
}

.meta-strip dt,
.detail-metrics dt {
  color: var(--muted);
  font-size: 12px;
}

.meta-strip dd,
.detail-metrics dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.table-area,
.detail-panel,
.figure-showcase {
  border: 1px solid rgba(31, 111, 178, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.table-area,
.figure-showcase {
  min-width: 0;
  padding: 18px;
}

.figure-showcase {
  margin-top: 18px;
}

.section-bar {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-bar h2,
.detail-heading h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.table-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.table-stats span,
.source-pill,
.detail-index {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(31, 111, 178, 0.18);
  border-radius: 999px;
  background: #f6faff;
  white-space: nowrap;
}

.table-stats strong {
  margin-right: 4px;
  color: var(--ink);
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.figure-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(31, 111, 178, 0.18);
  border-radius: 8px;
  background: #f8fbff;
}

.figure-card-wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(360px, 0.85fr) minmax(320px, 1.15fr);
}

.figure-card figure {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(31, 111, 178, 0.16);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.figure-card img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.figure-card:not(.figure-card-wide) img {
  aspect-ratio: 1 / 1;
}

.figure-card-wide img {
  max-height: 660px;
}

.figure-copy {
  min-width: 0;
  align-self: center;
}

.figure-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.figure-copy h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.figure-copy p,
.figure-copy li {
  color: #41586f;
  font-size: 14px;
  line-height: 1.75;
}

.figure-copy p {
  margin-bottom: 10px;
}

.figure-copy ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.filter-btn {
  display: inline-grid;
  grid-template-columns: 9px auto auto;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(31, 111, 178, 0.18);
  border-radius: 8px;
  color: #1d3149;
  background: #f6faff;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: rgba(31, 111, 178, 0.48);
}

.filter-btn.is-active {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.filter-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.74;
}

.filter-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  text-align: center;
  font-size: 12px;
}

.search-row {
  margin-bottom: 14px;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  gap: 12px;
  align-items: center;
  max-width: 520px;
  padding: 9px 12px;
  border: 1px solid rgba(31, 111, 178, 0.2);
  border-radius: 8px;
  background: #f8fbff;
}

.search-box span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.table-stage {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  min-height: 660px;
}

.table-list {
  min-width: 0;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.table-card {
  width: 100%;
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid rgba(31, 111, 178, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: #f7fbff;
  text-align: left;
  cursor: pointer;
}

.table-card:hover {
  border-color: rgba(31, 111, 178, 0.42);
  background: #ffffff;
}

.table-card.is-figure {
  background: #f3fbff;
}

.table-card.is-active {
  border-color: var(--accent);
  background: #eaf4ff;
  box-shadow: inset 4px 0 0 var(--accent);
}

.table-card.is-figure.is-active {
  border-color: var(--accent-2);
  background: #e9f8fb;
  box-shadow: inset 4px 0 0 var(--accent-2);
}

.card-top {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.card-tag {
  max-width: 150px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-size {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.table-frame {
  min-width: 0;
  border: 1px solid rgba(31, 111, 178, 0.18);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.current-table-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(31, 111, 178, 0.18);
  background: #f5f9fe;
}

.current-table-head h3 {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.table-scroll {
  max-height: 680px;
  overflow: auto;
}

.inline-figure {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-height: 0;
  padding: 18px;
  background: #f8fbff;
}

.inline-figure figure {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(31, 111, 178, 0.16);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.inline-figure img {
  display: block;
  width: 100%;
  max-height: 780px;
  object-fit: contain;
}

.inline-figure-copy {
  align-self: start;
  min-width: 0;
}

.inline-figure-copy h3 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.4;
}

.inline-figure-copy p {
  margin: 0;
  color: #41586f;
  font-size: 14px;
  line-height: 1.75;
}

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

td,
th {
  min-width: 92px;
  max-width: 210px;
  padding: 9px 10px;
  border: 1px solid #d9e7f3;
  vertical-align: top;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

tbody tr:first-child td,
tbody tr:nth-child(2) td {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #1d312d;
  background: #e9f4fe;
  font-weight: 750;
}

tbody tr:nth-child(2) td {
  top: 38px;
  background: #f4f8fd;
}

tbody tr:hover td {
  background: #f8fbff;
}

.detail-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
}

.detail-status {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.category-pill {
  display: inline-grid;
  grid-template-columns: 10px auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.category-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
}

.detail-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(31, 111, 178, 0.18);
}

.detail-heading p:last-child {
  margin: 10px 0 0;
  color: #51687e;
  font-size: 14px;
  line-height: 1.7;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.detail-metrics div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(31, 111, 178, 0.16);
  border-radius: 8px;
  background: #f6faff;
}

.detail-metrics dd small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.process-ribbon {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}

.process-ribbon span {
  min-width: 0;
  padding: 7px 4px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent-2);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.process-ribbon span:nth-child(2) {
  background: var(--warm);
}

.process-ribbon span:nth-child(3) {
  background: var(--gold);
}

.process-ribbon span:nth-child(4) {
  background: var(--accent);
}

.process-ribbon span:nth-child(5) {
  background: #335b82;
}

.detail-section {
  padding: 14px 0 0;
  border-top: 1px solid rgba(31, 111, 178, 0.16);
}

.detail-section + .detail-section {
  margin-top: 14px;
}

.detail-section h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.detail-section p,
.detail-section li {
  color: #41586f;
  font-size: 14px;
  line-height: 1.75;
}

.detail-section p {
  margin-bottom: 0;
}

.detail-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

  .figure-grid,
  .figure-card,
  .figure-card-wide,
  .inline-figure {
    grid-template-columns: 1fr;
  }

  .figure-card-wide {
    grid-column: auto;
  }
}

@media (max-width: 960px) {
  .page-shell {
    width: min(100vw - 22px, 1760px);
    padding-top: 12px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .meta-strip {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-stage {
    grid-template-columns: 1fr;
  }

  .table-list {
    max-height: 260px;
  }

  h1 {
    font-size: 23px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .table-area,
  .detail-panel {
    padding: 14px;
  }

  .section-bar,
  .current-table-head {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .meta-strip,
  .detail-metrics {
    grid-template-columns: 1fr;
  }

  .process-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }
}
