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

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

button,
input {
  font: inherit;
}

.tool-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: background 160ms ease, border-color 160ms ease, transform 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.85);
}

.btn-ghost {
  background: transparent;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 0 36px;
}

.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  background: rgba(12, 31, 27, 0.88);
  border: 1px solid var(--border);
  padding: 18px;
}

.sidebar h1 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

.sidebar p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.menu-list {
  display: grid;
  gap: 8px;
}

.menu-button {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.76);
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}

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

.content {
  min-width: 0;
}

.panel {
  display: grid;
  gap: 22px;
}

.hero-card,
.section-card,
.table-shell,
.verify-shell,
.sync-shell {
  background: rgba(11, 29, 25, 0.92);
  border: 1px solid var(--border);
}

.hero-card,
.section-card,
.verify-shell,
.sync-shell {
  padding: 24px;
}

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

.panel h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
}

.lead {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  margin-top: 18px;
}

.search-bar input,
.verify-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.84);
  color: var(--text);
  padding: 0 14px;
}

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

.stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

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

.metric-value {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
}

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

.section-head p {
  margin: 0;
  color: var(--muted);
}

.table-shell {
  overflow: hidden;
}

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

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

table {
  width: 100%;
  min-width: 1100px;
  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.8);
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.mono {
  font-family: var(--mono);
  word-break: break-all;
}

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

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

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

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

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

.empty-state,
.load-error {
  color: var(--muted);
  text-align: center;
}

.verify-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  margin-top: 18px;
}

.verify-card {
  margin-top: 18px;
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.78);
  padding: 18px;
}

.verify-head,
.sync-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.verify-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 16px;
}

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

.drawer {
  position: fixed;
  inset: 0;
  display: grid;
  justify-items: end;
  background: rgba(4, 11, 9, 0.52);
}

.drawer[hidden] {
  display: none;
}

.drawer-panel {
  width: min(720px, 100%);
  height: 100%;
  background: #071512;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 180ms ease;
  overflow-y: auto;
}

.drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(7, 21, 18, 0.96);
}

.drawer-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.drawer-body {
  padding: 20px;
}

.detail-section {
  margin-bottom: 22px;
}

.detail-section h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.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: 12px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--border);
  background: rgba(16, 39, 34, 0.64);
  padding: 14px;
}

.timeline-time {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}

.timeline-content h4 {
  margin: 0 0 8px;
}

.timeline-content p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.6;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.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;
  align-content: start;
}

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

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

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

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

  .search-bar,
  .verify-form,
  .stats-grid,
  .sync-grid,
  .detail-grid,
  .verify-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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