:root {
  color-scheme: dark;
  --bg: #11161c;
  --panel: #171e26;
  --panel-soft: #1d252e;
  --sidebar: #050607;
  --ink: #f4f7fb;
  --muted: #9aa6b2;
  --line: #2a3440;
  --red: #ef3340;
  --blue: #3478f6;
  --green: #4f9b5f;
  --yellow: #c5a54a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

body.light {
  color-scheme: light;
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --sidebar: #11161c;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e0e8;
  --shadow: 0 24px 70px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-frame {
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 32px clamp(16px, 3vw, 42px);
}

.topbar {
  display: grid;
  grid-template-columns: 250px minmax(260px, 1fr) minmax(560px, auto);
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 950;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 44px;
  height: 38px;
  display: inline-block;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(239, 51, 64, 0.62) 0 48%, transparent 48%),
    linear-gradient(90deg, transparent 0 34%, var(--red) 34% 100%);
}

.search-box {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  min-height: 56px;
  color: var(--muted);
}

.search-box span {
  color: var(--ink);
  font-size: 2.4rem;
  line-height: 1;
}

.search-box input {
  width: 100%;
  min-height: 52px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  font-weight: 750;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: var(--ink);
  font-weight: 900;
}

.weather-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.weather-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(42, 52, 64, 0.86);
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 900;
}

.weather-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #101828;
  background: linear-gradient(135deg, #f9d86a, #ff9f1c);
  font-size: 0.82rem;
  line-height: 1;
}

.weather-icon.rain {
  color: #fff;
  background: linear-gradient(135deg, #4dabf7, #22577a);
}

.weather-icon.cloud {
  color: #101828;
  background: linear-gradient(135deg, #e7eef6, #a8b5c4);
}

.weather-icon.snow {
  color: #0d3b66;
  background: linear-gradient(135deg, #f8fbff, #b9e6ff);
}

.weather-city {
  color: var(--muted);
}

.weather-temp {
  color: var(--ink);
}

.mini-market {
  color: var(--muted);
  white-space: nowrap;
}

.app-button,
.circle-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font-weight: 950;
}

.app-button {
  min-height: 40px;
  border-color: transparent;
  padding: 0;
  font-size: 1.15rem;
}

.circle-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.shell {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 24px;
  min-height: min(720px, calc(100vh - 64px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 44px;
  border-radius: 28px;
  background: var(--sidebar);
  color: #fff;
  box-shadow: var(--shadow);
}

.side-nav {
  display: grid;
  gap: 18px;
}

.side-tab {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 14px;
  padding: 0 30px;
  color: rgba(255, 255, 255, 0.42);
  background: transparent;
  text-align: left;
  font-weight: 950;
  text-transform: uppercase;
}

.side-tab.active,
.side-tab:hover {
  color: #fff;
  background: #24282d;
}

.wordle-tab span {
  display: inline-flex;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-size: 0.82rem;
}

.side-footer {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.64);
  font-weight: 850;
}

.content-stage {
  min-height: 720px;
  padding: clamp(28px, 4vw, 58px);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-weight: 950;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
}

.status-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  max-width: 360px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.market-tape {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 26px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

.app-market-tape {
  width: 100%;
  margin: 0 0 34px;
  border-radius: 16px;
}

.market-head {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
}

.market-head span {
  font-weight: 950;
}

.market-head small,
.market-source {
  color: var(--muted);
}

.market-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.market-item {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.market-item strong,
.market-value span:first-child {
  font-weight: 950;
}

.market-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.market-change {
  font-weight: 950;
}

.market-change.up {
  color: #13a58f;
}

.market-change.down {
  color: #ef675f;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 28px;
}

.featured-carousel {
  position: relative;
  margin-bottom: 34px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--panel-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.carousel-track {
  min-height: clamp(360px, 42vw, 560px);
}

.featured-slide {
  position: relative;
  min-height: clamp(360px, 42vw, 560px);
  display: none;
  overflow: hidden;
  cursor: pointer;
}

.featured-slide.active {
  display: block;
}

.featured-media {
  width: 100%;
  height: 100%;
  min-height: clamp(360px, 42vw, 560px);
  margin: 0;
  border-radius: 0;
}

.featured-media img,
.featured-media .article-visual {
  filter: saturate(1.02) contrast(1.04);
}

.featured-overlay {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 10px;
  padding: clamp(22px, 4vw, 46px);
  color: #fff;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.45) 32%, rgba(0, 0, 0, 0.86) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 74%);
}

.featured-overlay h2 {
  max-width: min(880px, 86%);
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: clamp(2.1rem, 4.6vw, 4.35rem);
  line-height: 0.98;
  font-weight: 950;
}

.featured-title.compact {
  max-width: min(840px, 82%);
  font-size: clamp(1.8rem, 3.8vw, 3.55rem);
  line-height: 1.01;
}

.featured-title.dense {
  max-width: min(800px, 80%);
  -webkit-line-clamp: 4;
  font-size: clamp(1.55rem, 3.1vw, 2.75rem);
  line-height: 1.04;
}

.featured-overlay p {
  max-width: min(720px, 82%);
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 750;
  line-height: 1.45;
}

.carousel-arrow {
  position: absolute;
  top: 45%;
  z-index: 3;
  width: 54px;
  height: 70px;
  border: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
  font-size: 4rem;
  line-height: 1;
}

.carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.44);
}

.carousel-arrow-left {
  left: 0;
}

.carousel-arrow-right {
  right: 0;
}

.carousel-dots {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 251, 0.96));
  border-top: 1px solid rgba(226, 232, 240, 0.92);
}

.carousel-dot {
  width: clamp(34px, 4vw, 46px);
  height: clamp(34px, 4vw, 46px);
  justify-self: center;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: #0d151c;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  font-weight: 950;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.carousel-dot.active {
  border-color: #ff3047;
  color: #fff;
  background: linear-gradient(135deg, #ff3148, #df1e36);
  box-shadow: 0 10px 22px rgba(239, 51, 64, 0.26);
}

.article-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.article-card:focus-visible,
.article-card:hover {
  outline: 2px solid rgba(239, 51, 64, 0.64);
  outline-offset: 8px;
}

.article-card.featured {
  grid-column: span 2;
}

.article-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.article-visual {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: end;
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--visual-a), var(--visual-b));
}

.article-visual strong {
  max-width: 90%;
  font-size: clamp(1.15rem, 2vw, 1.9rem);
  line-height: 1;
  font-weight: 950;
}

.article-visual span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96) contrast(1.03);
}

.category {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #0d151c;
  background: #e7f1ef;
  font-size: 0.82rem;
  font-weight: 950;
}

.article-card h3 {
  margin: 14px 0 10px;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  line-height: 1.14;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 650;
}

.signal-row,
.tag-row,
.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.signal-row {
  margin-top: 14px;
}

.signal-row span,
.tag-row span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.tag-row {
  margin-top: 8px;
}

.article-meta {
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.article-link {
  width: max-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 950;
}

.detail-stage {
  max-width: 1040px;
}

.back-button {
  min-height: 42px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
  font-weight: 950;
}

.detail-article {
  display: grid;
  gap: 26px;
}

.detail-hero {
  margin-bottom: 0;
}

.detail-body {
  display: grid;
  gap: 16px;
}

.detail-body h1 {
  max-width: 920px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.03;
}

.detail-meta {
  margin: 0;
  padding: 0;
}

.detail-summary {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}

.detail-summary h2 {
  margin: 0;
  font-size: 1.1rem;
}

.detail-summary p,
.detail-note {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 650;
}

.detail-note {
  font-size: 0.92rem;
}

.detail-source {
  margin-top: 2px;
}

.wordle-stage {
  max-width: 980px;
  min-height: auto;
}

.wordle-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(260px, 1fr);
  gap: 32px;
  align-items: start;
}

.wordle-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 360px;
}

.wordle-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-weight: 950;
  text-transform: uppercase;
}

.wordle-cell.correct {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.wordle-cell.present {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #111;
}

.wordle-cell.absent {
  border-color: #3a434d;
  background: #3a434d;
  color: #fff;
}

.wordle-controls {
  display: grid;
  gap: 12px;
}

.wordle-controls label {
  color: var(--muted);
  font-weight: 950;
}

.wordle-input-row {
  display: flex;
  gap: 10px;
}

.wordle-input-row input {
  min-width: 0;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--panel-soft);
  text-transform: uppercase;
  font-weight: 950;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 18px;
  color: #fff;
  font-weight: 950;
}

.primary-button {
  background: var(--blue);
  border-color: var(--blue);
}

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

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

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .weather-strip {
    order: -1;
    width: 100%;
    justify-content: flex-start;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 18px;
  }

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

  .side-tab {
    min-height: 54px;
    padding: 0 16px;
  }
}

@media (max-width: 760px) {
  .app-frame {
    padding: 18px 12px;
  }

  .content-stage {
    padding: 20px;
  }

  .stage-header,
  .wordle-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .market-tape,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .carousel-dots {
    gap: 6px;
    padding: 10px;
  }

  .weather-strip {
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .weather-strip::-webkit-scrollbar {
    display: none;
  }

  .weather-chip {
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.78rem;
  }

  .carousel-arrow {
    width: 42px;
    height: 58px;
    font-size: 3rem;
  }

  .market-strip {
    grid-auto-columns: minmax(165px, 78vw);
  }

  .article-card.featured {
    grid-column: span 1;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }
}
