:root {
  --bg: #f3efe6;
  --bg-strong: #e9e1d3;
  --panel: #fffdfa;
  --panel-soft: #f9f4ea;
  --line: #d6cab4;
  --line-strong: #bba98a;
  --text: #1d1a16;
  --muted: #6f675c;
  --accent: #b6521f;
  --accent-deep: #8b3b14;
  --ink-green: #0f8a58;
  --ink-red: #c33a2c;
  --shadow: 0 16px 36px rgba(69, 53, 24, 0.09);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(181, 99, 32, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(14, 113, 77, 0.14), transparent 24%),
    linear-gradient(180deg, #f7f1e7 0%, var(--bg) 56%, #ece3d6 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(250, 245, 237, 0.82);
  border-bottom: 1px solid rgba(123, 98, 47, 0.12);
}

.topbar-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 16px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #c7682b 0%, #7d3511 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 26px rgba(125, 53, 17, 0.22);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 16px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.topnav a {
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
}

.topnav a.active,
.topnav a:hover {
  color: var(--accent-deep);
  background: rgba(182, 82, 31, 0.12);
}

.global-search {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-search input,
.hero-actions input,
.analysis-toolbar input,
select {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #cb6a2d 0%, #a94718 100%);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(125, 53, 17, 0.22);
}

button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-deep);
  border: 1px solid rgba(123, 98, 47, 0.18);
  box-shadow: none;
}

.shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 22px;
  padding: 28px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 249, 237, 0.96), rgba(255, 253, 248, 0.94)),
    linear-gradient(135deg, rgba(192, 121, 55, 0.20), rgba(9, 80, 56, 0.08));
  border: 1px solid rgba(123, 98, 47, 0.14);
  box-shadow: var(--shadow);
}

.compact-hero {
  grid-template-columns: minmax(0, 1fr) auto;
}

.hero-kicker,
.section-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-card h1,
.analysis-hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
}

.hero-card p,
.analysis-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}

.hero-side,
.hero-actions,
.hero-side-small {
  display: grid;
  gap: 14px;
  align-content: start;
}

.metric-row,
.hero-side {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric-row {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.metric-box {
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffef9 0%, var(--panel-soft) 100%);
  border: 1px solid rgba(123, 98, 47, 0.14);
}

.metric-box .label {
  font-size: 13px;
  color: var(--muted);
}

.metric-box .value {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
}

.metric-box .meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.page-grid {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.page-grid-main {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.stack {
  display: grid;
  gap: 22px;
}

.card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel) 0%, #fff8ee 100%);
  border: 1px solid rgba(123, 98, 47, 0.14);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head h2,
.card-head h3 {
  margin: 8px 0 0;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.table-shell {
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(123, 98, 47, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.data-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.data-table.compact-table {
  min-width: 0;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(123, 98, 47, 0.1);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(247, 239, 224, 0.96);
  color: #433625;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: rgba(246, 220, 200, 0.32);
}

.name-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.entity-link {
  text-decoration: none;
}

.entity-link:hover strong {
  text-decoration: underline;
}

.name-cell strong {
  font-size: 14px;
}

.mono-copy {
  font-family: "Consolas", "SFMono-Regular", monospace;
  word-break: break-all;
}

.name-cell small,
.muted-copy,
.info-list .sub {
  color: var(--muted);
  font-size: 12px;
}

.sub-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.text-link {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(182, 82, 31, 0.12);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
}

.pill.positive {
  background: rgba(15, 138, 88, 0.14);
  color: var(--ink-green);
}

.pill.negative {
  background: rgba(195, 58, 44, 0.14);
  color: var(--ink-red);
}

.value-positive {
  color: var(--ink-green);
  font-weight: 800;
}

.value-negative {
  color: var(--ink-red);
  font-weight: 800;
}

.info-list {
  display: grid;
  gap: 12px;
}

.info-item {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(123, 98, 47, 0.1);
}

.info-item strong {
  display: block;
  font-size: 14px;
}

.divider {
  height: 1px;
  margin: 16px 0;
  background: rgba(123, 98, 47, 0.12);
}

.loading-state,
.empty-panel {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(123, 98, 47, 0.28);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.66);
}

@media (max-width: 1200px) {
  .topbar-inner,
  .hero-card,
  .page-grid-main {
    grid-template-columns: 1fr;
  }

  .global-search {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 18px 14px 28px;
  }

  .topbar-inner,
  .hero-card,
  .card {
    padding-left: 18px;
    padding-right: 18px;
  }

  .toolbar,
  .global-search,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
