:root {
  --bg: #f4efe6;
  --surface: rgba(255, 252, 247, 0.86);
  --surface-strong: #fffdf8;
  --line: rgba(68, 50, 29, 0.12);
  --text: #2d2115;
  --muted: #7a6650;
  --brand: #a94e1a;
  --brand-strong: #d2641f;
  --accent: #146551;
  --shadow: 0 24px 60px rgba(83, 52, 24, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(215, 99, 31, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(20, 101, 81, 0.15), transparent 28%),
    linear-gradient(180deg, #f8f4eb 0%, #f1eadf 100%);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 248, 240, 0.98), rgba(255, 252, 247, 0.92)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(169, 78, 26, 0.15);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(169, 78, 26, 0.14), transparent 65%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--brand);
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.06;
}

.hero__desc {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.content-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.control-panel,
.result-panel {
  padding: 22px;
}

.control-panel {
  align-self: start;
  position: sticky;
  top: 18px;
}

.result-panel {
  grid-column: 2;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel__subhead {
  margin: -8px 0 18px;
}

.panel__head h2 {
  margin: 0;
  font-size: 22px;
}

.ghost-button {
  border: 1px solid rgba(169, 78, 26, 0.18);
  background: rgba(255, 255, 255, 0.74);
  color: var(--brand);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.filters {
  display: grid;
  gap: 14px;
}

.input-group {
  display: grid;
  gap: 8px;
}

.input-group span {
  font-size: 13px;
  color: var(--muted);
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(68, 50, 29, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.input-group input:focus,
.input-group select:focus,
.ghost-button:focus {
  outline: 2px solid rgba(169, 78, 26, 0.24);
  outline-offset: 2px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.active-filter {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(169, 78, 26, 0.08);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.status-text {
  color: var(--muted);
  font-size: 13px;
}

.results {
  display: block;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(68, 50, 29, 0.08);
}

.result-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.88);
}

.result-table th {
  padding: 14px 12px;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  background: rgba(247, 241, 232, 0.9);
  border-bottom: 1px solid rgba(68, 50, 29, 0.08);
  white-space: nowrap;
}

.result-table td {
  padding: 14px 12px;
  vertical-align: top;
  border-bottom: 1px solid rgba(68, 50, 29, 0.06);
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
}

.result-table tbody tr:last-child td {
  border-bottom: none;
}

.rank-cell {
  width: 66px;
  font-weight: 800;
  color: var(--brand);
}

.weight-cell,
.count-cell {
  white-space: nowrap;
  font-weight: 700;
}

.bar-cell {
  width: 190px;
}

.table-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(68, 50, 29, 0.08);
  margin-top: 6px;
}

.table-bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e7983b 0%, #d2641f 48%, #146551 100%);
}

.clinical-list {
  display: grid;
  gap: 6px;
}

.clinical-item {
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(68, 50, 29, 0.05);
  line-height: 1.55;
}

.clinical-list__extra {
  display: grid;
  gap: 6px;
}

.expand-button {
  justify-self: start;
  margin-top: 2px;
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.expand-button:hover {
  color: var(--brand-strong);
}

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

.empty-state {
  padding: 36px 18px;
  text-align: center;
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 980px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .control-panel,
  .result-panel {
    grid-column: auto;
  }

  .control-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 14px;
  }

  .hero,
  .control-panel,
  .result-panel {
    padding: 18px;
    border-radius: 22px;
  }
}
