:root {
  --bg: #071512;
  --bg-elevated: #0b1d19;
  --surface: #102722;
  --surface-soft: #163831;
  --surface-alt: #122c27;
  --border: rgba(111, 155, 142, 0.22);
  --text: #e9efe8;
  --muted: #9db3aa;
  --accent: #f1a62b;
  --accent-soft: rgba(241, 166, 43, 0.12);
  --ok: #32b271;
  --warn: #d8a33b;
  --danger: #d96f5f;
  --blue: #4f8fff;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(31, 157, 136, 0.16), transparent 26%),
    linear-gradient(180deg, #091a17 0%, #071512 100%);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(9, 22, 19, 0.92);
  border-bottom: 1px solid var(--border);
}

.container {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(4, 7px);
  gap: 3px;
}

.brand-mark span {
  width: 7px;
  height: 12px;
  background: linear-gradient(180deg, #f6b24f 0%, #d88717 100%);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: var(--muted);
  padding: 4px 0;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.72);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(241, 166, 43, 0.34);
}

.btn-primary {
  background: var(--accent);
  color: #111;
  border-color: transparent;
}

.btn-secondary {
  background: rgba(22, 56, 49, 0.84);
}

.workspace {
  display: grid;
  gap: 20px;
  padding: 28px 0 36px;
}

.hero,
.filters,
.tabs-shell,
.detail-shell,
.footer-note,
.footer {
  background: rgba(11, 29, 25, 0.92);
  border: 1px solid var(--border);
}

.hero,
.filters,
.tabs-shell,
.detail-shell,
.footer-note {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  gap: 20px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.04;
}

.hero-subtitle {
  margin: 10px 0 0;
  font-size: 20px;
  color: var(--text);
}

.hero-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 980px;
}

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

.stat-card {
  padding: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17, 43, 38, 0.96), rgba(12, 31, 27, 0.96));
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.field select {
  min-height: 42px;
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.82);
  color: var(--text);
  padding: 0 12px;
}

.filter-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.tabs-head {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.72);
  color: var(--muted);
  cursor: pointer;
}

.tab-button.active {
  color: var(--text);
  border-color: rgba(241, 166, 43, 0.26);
  background: rgba(23, 56, 49, 0.92);
}

.tab-panel[hidden] {
  display: none;
}

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

.section-head h2 {
  margin: 0;
  font-size: 28px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 880px;
}

.table-shell {
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.6);
  overflow: hidden;
}

.table-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(111, 155, 142, 0.12);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(16, 39, 34, 0.84);
}

tbody tr:hover {
  background: rgba(23, 56, 49, 0.48);
}

.status-pill,
.risk-pill,
.source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
}

.status-pill.good,
.risk-pill.low {
  color: #7ad9aa;
  background: rgba(50, 178, 113, 0.12);
}

.status-pill.warn,
.risk-pill.medium,
.risk-pill.observe {
  color: #f0bf5d;
  background: rgba(216, 163, 59, 0.12);
}

.status-pill.bad,
.risk-pill.high {
  color: #f58f82;
  background: rgba(217, 111, 95, 0.12);
}

.source-pill {
  color: #9dd7c7;
  background: rgba(31, 157, 136, 0.12);
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

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

.question-card {
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.76);
  color: var(--text);
  text-align: left;
  padding: 16px;
  cursor: pointer;
  min-height: 110px;
}

.question-card:hover,
.question-card.active {
  border-color: rgba(241, 166, 43, 0.26);
  background: rgba(23, 56, 49, 0.94);
}

.question-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.detail-shell h3 {
  margin: 0 0 16px;
  font-size: 22px;
}

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

.detail-item {
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.72);
  padding: 14px;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.detail-item strong {
  display: block;
  line-height: 1.6;
}

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

.footer-note {
  color: var(--muted);
  line-height: 1.75;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 18px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 1180px) {
  .filters-grid,
  .stats-grid,
  .questions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .container {
    width: min(100% - 24px, 1440px);
  }

  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .filters-grid,
  .stats-grid,
  .questions-grid,
  .detail-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions,
  .tabs-head,
  .table-actions {
    flex-wrap: wrap;
  }
}
