:root {
  color-scheme: light;
  --news-paper: #edf2f5;
  --news-surface: #ffffff;
  --news-ink: #172a38;
  --news-muted: #627482;
  --news-line: #d7e1e7;
  --news-teal: #176b78;
  --news-teal-soft: #e6f2f2;
  --news-navy: #173748;
  --news-warm: #94621a;
  font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--news-paper);
  color: var(--news-ink);
}

button,
input { font: inherit; }

button,
a,
input { -webkit-tap-highlight-color: transparent; }

button { cursor: pointer; }

button:disabled { cursor: wait; opacity: .66; }

.news-shell {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.news-skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--news-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.news-skip-link:focus { transform: translateY(0); }

.news-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 720px);
  align-items: start;
  gap: 18px;
  padding: 0 0 16px;
  border-bottom: 1px solid #d3dee4;
}

.news-calendar {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.news-calendar-heading {
  display: grid;
  gap: 5px;
}

.news-calendar h2 {
  margin: 0;
  color: #536f7c;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
  white-space: nowrap;
}

.news-calendar-grid {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.news-calendar-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid #d5e2e4;
  border-radius: 6px;
  background: #f8fcfc;
  color: #285665;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.news-calendar-item.news-calendar-exdiv { border-left: 3px solid #b7832f; }
.news-calendar-item.news-calendar-macro { border-left: 3px solid #398060; }

.news-calendar-item:hover { border-color: #9fc2c5; background: #eef8f8; }

.news-calendar-empty {
  margin: 0;
  color: #6f7f87;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.news-heading { min-width: 0; }

.news-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  color: var(--news-teal);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
}

.news-eyebrow span { color: #9aabb5; }

.news-topbar h1 {
  margin: 0;
  color: #152d3c;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.15;
}

.news-top-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: min(100%, 720px);
  min-width: 0;
  align-items: start;
  gap: 9px;
}

.news-home-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid #cfdae0;
  border-radius: 9px;
  background: #fff;
  color: #284456;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.news-home-link { white-space: nowrap; }

.news-home-link:hover {
  border-color: #a8c3ca;
  background: #fafdfe;
}

.news-control-panel {
  margin: 19px 0 14px;
  padding: 15px 16px 12px;
  border: 1px solid #d9e3e8;
  border-radius: 12px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 4px 14px rgba(28, 54, 69, .035);
}

.news-control-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.news-filters {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.news-filter {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #526874;
  font-size: 12px;
  font-weight: 750;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.news-filter:hover:not(:disabled) {
  border-color: #d7e2e6;
  background: #f4f8f9;
  color: #274657;
}

.news-filter.is-active {
  border-color: #bfd5d9;
  background: var(--news-teal-soft);
  color: #155c68;
}

.news-filter-count {
  display: inline-grid;
  min-width: 21px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(32, 70, 85, .07);
  color: inherit;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.news-filter.is-active .news-filter-count { background: rgba(23, 107, 120, .12); }

.news-meta {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid #edf1f3;
  color: #72828c;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.news-status {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
  padding: 15px 17px;
  border: 1px dashed #c7d5dc;
  border-radius: 11px;
  background: rgba(255, 255, 255, .82);
  color: #5d707c;
  font-size: 13px;
  line-height: 1.65;
}

.news-status[hidden] { display: none; }
.news-status p { margin: 0; }
.news-status.is-error { border-style: solid; border-color: #e4c9bb; background: #fffaf7; color: #764a32; }

.news-retry {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 1px solid #cad8de;
  border-radius: 7px;
  background: #fff;
  color: #294c5e;
  font-size: 12px;
  font-weight: 750;
}

.news-retry:hover { border-color: #90b4bd; background: #f4f9fa; }

.news-list { display: grid; gap: 12px; }

.news-card {
  min-width: 0;
  padding: clamp(17px, 2.3vw, 24px);
  border: 1px solid #d8e2e7;
  border-left: 4px solid #96aab4;
  border-radius: 11px;
  background: var(--news-surface);
  box-shadow: 0 5px 16px rgba(28, 54, 69, .035);
}

.news-card.news-market_major { border-left-color: #b7832f; }
.news-card.news-industry_event { border-left-color: #398060; }
.news-card.news-stock_flash { border-left-color: #3b7194; }

.news-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #74848d;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.news-category {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #e0e8eb;
  border-radius: 999px;
  background: #f4f7f8;
  color: #405c6b;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .02em;
}

.news-market_major .news-category { border-color: #ecdfc6; background: #fbf5e9; color: #78551b; }
.news-industry_event .news-category { border-color: #d3e6db; background: #edf7f1; color: #286449; }
.news-stock_flash .news-category { border-color: #d4e2eb; background: #eff5f9; color: #315f7c; }

.news-card h2 {
  margin: 12px 0 0;
  color: #1c3544;
  font-size: clamp(18px, 2.1vw, 22px);
  font-weight: 780;
  letter-spacing: -.02em;
  line-height: 1.48;
}

.news-card h2 a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
.news-card h2 a:hover { color: var(--news-teal); text-decoration: underline; }

.news-card-image {
  max-width: min(100%, 420px);
  margin: 14px 0 0;
  padding: 8px;
  border: 1px solid #d8e2e7;
  border-radius: 9px;
  background: #f7fafb;
}

.news-card-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.news-card-image figcaption {
  margin-top: 6px;
  color: #74848d;
  font-size: 10px;
  line-height: 1.4;
}

.news-original-title {
  margin: 6px 0 0;
  color: #74848d;
  font-size: 11px;
  line-height: 1.55;
}

.news-copy {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: #405663;
  font-size: 13px;
  line-height: 1.8;
}

.news-copy p { margin: 0; }

.news-copy-structured {
  display: grid;
  gap: 12px;
}

.news-copy-lead {
  color: #294956;
  font-weight: 650;
}

.news-copy-paragraph { color: #405663; }

.news-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
}

.news-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d5e3e5;
  border-left: 3px solid var(--news-teal);
  border-radius: 8px;
  background: #f5fbfb;
}

.news-metric-label {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: #285665;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.news-metric-label small {
  color: #6b7e86;
  font-size: 10px;
  font-weight: 600;
}

.news-metric strong {
  color: #173f50;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.news-metric-positive { border-left-color: #398060; background: #f2faf5; }
.news-metric-positive strong { color: #236449; }
.news-metric-negative { border-left-color: #477d9b; background: #f1f7fa; }
.news-metric-negative strong { color: #315f7c; }
.news-metric-revision { border-left-color: #b7832f; background: #fff9ed; }
.news-metric-revision strong { color: #78551b; }

.news-insight {
  padding: 10px 12px;
  border-left: 3px solid var(--news-teal);
  border-radius: 0 8px 8px 0;
  background: #f7fbfb;
}

.news-insight h3 {
  margin: 0 0 4px;
  color: #2d6673;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .03em;
}

.news-insight p { margin: 0; }
.news-insight-context { border-left-color: #b7832f; background: #fffbf2; }
.news-insight-context h3 { color: #78551b; }
.news-insight-next { border-left-color: #365e77; background: #f3f7fa; }
.news-insight-next h3 { color: #315f7c; }

.news-copy-additional {
  display: grid;
  gap: 8px;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #edf1f3;
}

.news-source {
  color: #225f77;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.news-source:hover { text-decoration: underline; text-underline-offset: 3px; }
.news-source-text { cursor: default; }
.news-source-text:hover { text-decoration: none; }

.news-related-stocks { display: flex; flex-wrap: wrap; gap: 6px; }

.news-related-stocks a {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #d8e5e9;
  border-radius: 999px;
  background: #f7fafb;
  color: #385f70;
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}

.news-related-stocks a:hover { border-color: #a9c9cf; background: #edf6f7; }

.news-home-link:focus-visible,
.news-calendar-item:focus-visible,
.news-filter:focus-visible,
.news-retry:focus-visible,
.news-related-stocks a:focus-visible,
.news-card h2 a:focus-visible,
.news-source:focus-visible {
  outline: 3px solid rgba(23, 107, 120, .34);
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .news-shell { width: min(100% - 36px, 1160px); padding-top: 26px; }
  .news-topbar { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .news-top-actions { width: 100%; justify-self: stretch; }
  .news-calendar-grid { justify-content: flex-start; }
  .news-control-row { align-items: stretch; flex-direction: column; gap: 12px; }
}

@media (max-width: 560px) {
  .news-shell { width: min(100% - 26px, 1160px); padding-top: 19px; }
  .news-topbar { gap: 16px; padding-bottom: 18px; }
  .news-calendar { width: 100%; }
  .news-calendar-heading { align-items: flex-start; }
  .news-top-actions { width: 100%; }
  .news-home-link { min-width: 0; flex: 1; padding: 0 10px; font-size: 12px; }
  .news-control-panel { margin-top: 13px; padding: 11px 10px 9px; }
  .news-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .news-filter { justify-content: space-between; min-height: 37px; padding: 0 9px; font-size: 11px; }
  .news-status { align-items: flex-start; padding: 12px; font-size: 12px; }
  .news-card { padding: 15px 14px; }
  .news-card h2 { font-size: 18px; }
  .news-copy { font-size: 12px; line-height: 1.75; }
  .news-card-top { align-items: flex-start; }
  .news-card-top time { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
