:root {
  --ink: #1d1d1b;
  --muted: #66645e;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --line: #d9d4c8;
  --red: #b7342c;
  --blue: #255c99;
  --green: #24705e;
  --gold: #b7812c;
  --shadow: 0 16px 40px rgba(30, 24, 14, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(29, 29, 27, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 24px;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 245, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-weight: 800;
  letter-spacing: 0;
}

.edition,
.kicker {
  margin: 0 0 5px;
  color: var(--red);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 4vw, 2.8rem);
  line-height: 0.95;
  white-space: nowrap;
}

.tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  background: #fff;
}

.lang-button {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.86rem;
}

.lang-button:last-child {
  border-right: 0;
}

.lang-button[aria-pressed="true"] {
  color: #fff;
  background: var(--ink);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(34vw, 340px);
  min-width: 210px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
}

.icon-button,
.close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 24px;
  padding: 24px clamp(16px, 3vw, 36px) 42px;
}

.rail,
.briefs {
  position: sticky;
  top: 92px;
  align-self: start;
}

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

.tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  text-align: left;
}

.tab[aria-selected="true"] {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.market-tape,
.briefs section,
.lead,
.story-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.market-tape {
  margin-top: 18px;
  padding: 16px;
}

.market-tape h2,
.briefs h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.ticker {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.86rem;
}

.ticker strong {
  color: var(--green);
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 5px;
  height: 96px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.mini-chart i {
  display: block;
  background: linear-gradient(180deg, var(--blue), var(--green));
}

.paper {
  min-width: 0;
}

.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, 0.98fr);
  gap: 0;
  overflow: hidden;
  min-height: 300px;
  box-shadow: var(--shadow);
}

.lead-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 4vw, 42px);
}

.lead h2 {
  max-width: 10ch;
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 6vw, 5.4rem);
  line-height: 0.92;
}

.lead h2.long-lead-title {
  max-width: 100%;
  font-size: clamp(1.35rem, 1.75vw, 2rem);
  line-height: 1.18;
}

.lead p:not(.kicker) {
  max-width: 640px;
  color: #44413c;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.7;
}

.lead img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 300px;
  border-left: 1px solid var(--line);
}

.lead-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  color: var(--muted);
}

.lead-actions button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  color: #fff;
  background: var(--red);
  cursor: pointer;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 14px;
  padding-bottom: 12px;
  border-bottom: 3px double var(--ink);
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
}

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

.story-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 18px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.story-image {
  width: calc(100% + 36px);
  height: 150px;
  margin: -18px -18px 16px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: #e7e3d8;
}

.story-card.priority .story-image {
  height: 210px;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.story-card.priority {
  grid-column: span 2;
  min-height: 315px;
  background: #fff;
}

.story-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.78rem;
}

.badge {
  color: #fff;
  background: var(--blue);
  padding: 4px 8px;
}

.story-card h3 {
  margin-bottom: 12px;
  font-size: clamp(1.26rem, 2vw, 2rem);
  line-height: 1.1;
}

.story-card p {
  color: #4a4741;
  line-height: 1.62;
}

.story-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.82rem;
}

.briefs {
  display: grid;
  gap: 18px;
}

.briefs section {
  padding: 16px;
}

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-heading span {
  color: #fff;
  background: var(--red);
  padding: 3px 7px;
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
}

.brief-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief-list li {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  line-height: 1.48;
}

.deep-read article {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.deep-read h3 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

.deep-read p:not(.kicker) {
  color: var(--muted);
  line-height: 1.55;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  padding: 0;
  background: #fffdf7;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(24, 22, 18, 0.44);
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.4rem;
}

#dialogContent {
  padding: clamp(24px, 5vw, 44px);
}

#dialogContent h2 {
  margin: 8px 48px 16px 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.98;
}

#dialogContent p {
  color: #3f3c36;
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-image {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  background: rgba(250, 248, 239, 0.8);
}

.article-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.article-image figcaption {
  padding: 8px 12px;
  color: var(--muted);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.78rem;
}

.article-lede {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 1.18rem;
  color: var(--ink);
}

.article-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.article-body section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.article-body h3 {
  margin-bottom: 8px;
  color: var(--blue);
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.86rem;
}

.source-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(250, 248, 239, 0.8);
}

.source-box p {
  margin-bottom: 8px;
  font-size: 0.94rem;
}

.source-box p:last-child {
  margin-bottom: 0;
}

.brief-mode .story-card {
  min-height: auto;
}

.brief-mode .story-card p {
  display: none;
}

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

  .briefs {
    grid-column: 1 / -1;
    position: static;
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 780px) {
  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    white-space: normal;
  }

  .tools,
  .search {
    width: 100%;
    min-width: 0;
  }

  .language-toggle {
    width: 100%;
  }

  .lang-button {
    flex: 1;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .rail {
    position: static;
  }

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

  .market-tape {
    display: none;
  }

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

  .lead img {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .story-grid,
  .briefs {
    grid-template-columns: 1fr;
  }

  .story-card.priority {
    grid-column: auto;
  }
}
