:root {
  --ink: #161616;
  --muted: #64625f;
  --paper: #fbfaf7;
  --line: #ded9cf;
  --coral: #e85d4f;
  --teal: #007d75;
  --sun: #f2b84b;
  --plum: #653b5e;
  --leaf: #55723d;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(21, 20, 18, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(251, 250, 247, 0.86);
  border-bottom: 1px solid rgba(222, 217, 207, 0.85);
  backdrop-filter: blur(16px);
}

.brand,
.topnav,
.hero-actions,
.metrics,
.section-head,
.range-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
  font-size: 13px;
}

.topnav {
  gap: 6px;
}

.topnav a,
.ghost-button,
.tab,
.chip {
  min-height: 38px;
  border-radius: 8px;
}

.topnav a {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a:hover {
  color: var(--ink);
  background: rgba(22, 22, 22, 0.06);
}

.ghost-button,
.tab,
.chip {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.ghost-button {
  padding: 9px 14px;
  font-weight: 700;
}

.ghost-button.dark {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 68px));
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #20201e;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: center;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.5) 34%, rgba(0, 0, 0, 0.1) 74%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.04));
}

.hero-content {
  position: relative;
  width: min(680px, calc(100% - 36px));
  margin-left: clamp(18px, 6vw, 88px);
  padding-bottom: min(9vh, 86px);
  color: var(--white);
}

.kicker {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(70px, 13vw, 156px);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 610px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.87);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.7;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 0;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  color: var(--white);
  background: var(--coral);
}

.secondary-button {
  color: var(--ink);
  background: var(--sun);
}

.metrics {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 36px));
  margin: -44px auto 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics div {
  flex: 1;
  min-width: 0;
  padding: 18px 22px;
  border-right: 1px solid var(--line);
}

.metrics div:last-child {
  border-right: 0;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1;
}

.metrics span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 24px;
  width: min(1180px, calc(100% - 36px));
  margin: 34px auto 0;
  align-items: start;
}

.filters {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 12px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.panel.compact {
  padding-bottom: 12px;
}

label,
.label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf9;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
}

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

.chip {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.chip.active {
  color: var(--white);
  background: var(--teal);
  border-color: var(--teal);
}

.range-row {
  gap: 12px;
}

.range-row input {
  padding: 0;
}

.range-row strong {
  width: 36px;
  text-align: right;
}

.feed-panel {
  min-width: 0;
}

.section-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
}

.sort-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: #eee8dd;
  border-radius: 10px;
}

.tab {
  min-width: 62px;
  padding: 7px 11px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 6px 16px rgba(36, 34, 30, 0.1);
}

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

.story-card {
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(30, 28, 24, 0.06);
}

.story-card.clickable {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.story-card.clickable:hover,
.story-card.clickable:focus-visible {
  border-color: rgba(0, 125, 117, 0.42);
  box-shadow: 0 16px 34px rgba(30, 28, 24, 0.12);
  outline: none;
  transform: translateY(-2px);
}

.story-top,
.story-meta,
.story-actions {
  display: flex;
  align-items: center;
}

.story-top {
  justify-content: space-between;
  gap: 12px;
}

.badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--white);
  background: var(--plum);
  font-size: 12px;
  font-weight: 850;
}

.region {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.story-card h3 {
  margin: 18px 0 10px;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: 0;
}

.story-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.story-meta {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.read-cue {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  margin-top: 14px;
  padding: 7px 10px;
  color: var(--teal);
  background: rgba(0, 125, 117, 0.08);
  border: 1px solid rgba(0, 125, 117, 0.18);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
}

.meter {
  margin-top: auto;
  padding-top: 18px;
}

.meter-line {
  height: 8px;
  background: #ece7de;
  border-radius: 999px;
  overflow: hidden;
}

.meter-line span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sun), var(--teal));
}

.story-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.story-actions .region {
  margin-right: auto;
}

.save-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  cursor: pointer;
  font-weight: 900;
}

.save-button.active {
  color: var(--white);
  background: var(--leaf);
  border-color: var(--leaf);
}

.sinophone-radar,
.pulse,
.submit-band {
  width: min(1180px, calc(100% - 36px));
  margin: 64px auto 0;
}

.sinophone-radar {
  padding-top: 10px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--teal);
  background: rgba(0, 125, 117, 0.1);
  border: 1px solid rgba(0, 125, 117, 0.2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

.radar-search {
  display: grid;
  grid-template-columns: 1fr 150px 150px auto;
  gap: 10px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(30, 28, 24, 0.06);
}

.radar-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.radar-status {
  min-height: 24px;
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

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

.radar-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 5px solid var(--teal);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(30, 28, 24, 0.06);
}

.radar-card.risk-high {
  border-top-color: var(--coral);
}

.radar-card.risk-medium {
  border-top-color: var(--sun);
}

.radar-card h3 {
  margin: 18px 0 10px;
  font-size: 21px;
  line-height: 1.3;
}

.radar-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 11px;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
}

.compact-link {
  min-height: 40px;
  padding: 8px 12px;
}

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

.pulse-item {
  min-height: 164px;
  padding: 16px;
  color: var(--white);
  background: var(--ink);
  border-radius: 8px;
}

.pulse-item:nth-child(2) {
  background: var(--teal);
}

.pulse-item:nth-child(3) {
  background: var(--plum);
}

.pulse-item:nth-child(4) {
  background: var(--leaf);
}

.pulse-item span {
  display: block;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 850;
}

.pulse-item strong {
  display: block;
  font-size: 20px;
  line-height: 1.3;
}

.submit-band {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 440px);
  gap: 28px;
  align-items: start;
  padding: clamp(22px, 5vw, 48px);
  background: #e7dccd;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.submit-band h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
}

.submit-band p {
  max-width: 650px;
  color: #494640;
  line-height: 1.75;
}

.tip-form {
  display: grid;
  gap: 10px;
}

.full {
  width: 100%;
}

.form-note {
  min-height: 24px;
  margin: 0;
  color: var(--teal);
  font-weight: 800;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 36px));
  margin: 28px auto 34px;
  color: var(--muted);
  font-size: 13px;
}

.story-dialog {
  width: min(720px, calc(100% - 28px));
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.story-dialog::backdrop {
  background: rgba(18, 17, 15, 0.46);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 12px;
}

.dialog-head h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.18;
}

.close-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.dialog-summary {
  margin: 0;
  padding: 0 24px 20px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.dialog-article {
  display: grid;
  gap: 14px;
  padding: 0 24px 22px;
}

.dialog-article section {
  padding: 16px;
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dialog-article strong {
  display: block;
  margin-bottom: 8px;
}

.dialog-article p {
  margin: 0;
  color: #494640;
  line-height: 1.75;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dialog-grid div {
  padding: 16px;
  border-right: 1px solid var(--line);
}

.dialog-grid div:last-child {
  border-right: 0;
}

.dialog-grid span,
.dialog-grid strong {
  display: block;
}

.dialog-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dialog-grid strong {
  margin-top: 8px;
  font-size: 22px;
}

.dialog-note {
  padding: 20px 24px 24px;
  background: #f5efe5;
}

.dialog-note strong {
  display: block;
  margin-bottom: 8px;
}

.dialog-note p {
  margin: 0;
  color: #494640;
  line-height: 1.7;
}

.dialog-source {
  margin-top: 16px;
}

@media (max-width: 880px) {
  .topnav {
    display: none;
  }

  .metrics,
  .workspace,
  .submit-band {
    grid-template-columns: 1fr;
  }

  .metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .filters {
    position: static;
  }

  .radar-search,
  .story-grid,
  .radar-grid,
  .pulse-list {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .dialog-grid div:nth-child(2) {
    border-right: 0;
  }

  .dialog-grid div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .hero {
    min-height: 690px;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 10px;
  }

  .ghost-button {
    padding-inline: 10px;
  }

  .hero-content {
    width: calc(100% - 28px);
    margin-left: 14px;
  }

  .hero-copy {
    font-size: 16px;
  }

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

  .metrics div,
  .metrics div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .metrics div:last-child {
    border-bottom: 0;
  }

  .story-card {
    min-height: 0;
  }

  .footer {
    flex-direction: column;
  }
}
