:root {
  color-scheme: dark;
  --bg: #0c1016;
  --surface: #121821;
  --raised: #181f2a;
  --line: #2b3543;
  --text: #eef1f5;
  --muted: #a6b2c3;
  --orange: #ffad61;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.55 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.masthead { border-bottom: 1px solid var(--line); background: #10151d; }
.masthead-inner, .shell { width: min(100% - 72px, 1264px); margin-inline: auto; }
.masthead-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; font: 700 .86rem/1.24 var(--mono); letter-spacing: .055em; }
.brand-icon { display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 10px; background: var(--orange); border-radius: 5px; }
.brand-icon i { width: 4px; height: 7px; background: var(--bg); }
.brand-icon i:nth-child(2) { height: 12px; }
.brand-icon i:nth-child(3) { height: 17px; }
.languages { display: flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.languages button, #close { background: transparent; color: var(--muted); border: 0; border-radius: 3px; padding: 6px 9px; font-size: .875rem; }
.languages button[aria-pressed="true"] { background: var(--raised); color: var(--orange); }
.languages button:hover, #close:hover { color: var(--text); }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; padding-block: 43px 26px; }
.mode { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .875rem; }
.mode > span:first-child { color: var(--orange); background: #302316; border: 1px solid #6d4628; border-radius: 4px; padding: 2px 8px; font: 700 .875rem/1.5 var(--mono); letter-spacing: .09em; }
h1 { margin: 12px 0 0; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.14; letter-spacing: -.035em; }
.timezone { display: grid; text-align: right; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.timezone strong { color: var(--text); font: 600 .875rem/1.7 var(--mono); }
.feed, dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.feed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
h2 { margin: 0; font-size: 1.15rem; }
.search { position: relative; width: min(100%, 330px); }
.search input { width: 100%; min-height: 42px; padding: 8px 12px 8px 38px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 5px; font-size: .875rem; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search-icon { position: absolute; top: 13px; left: 14px; width: 12px; height: 12px; border: 1.5px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; top: 9px; left: 8px; width: 6px; height: 1.5px; background: var(--muted); transform: rotate(45deg); }
.categories { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 22px 18px; }
.categories button { background: var(--raised); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 6px 11px; font-size: .875rem; }
.categories button:hover { color: var(--text); border-color: var(--muted); }
.categories button[aria-pressed="true"] { color: var(--bg); background: var(--orange); border-color: var(--orange); font-weight: 700; }
.feed-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); border-top: 1px solid var(--line); padding: 9px 22px; font-size: .875rem; }
.columns, .news-row {
  display: grid;
  grid-template-columns: minmax(95px, .75fr) minmax(130px, 1.1fr) minmax(110px, .95fr) minmax(0, 3.6fr) minmax(73px, .58fr);
  gap: 16px;
  align-items: center;
  padding-inline: 22px;
}
.columns { border-block: 1px solid var(--line); background: var(--raised); color: var(--muted); padding-block: 9px; font-size: .875rem; }
.news { margin: 0; padding: 0; list-style: none; }
.news-row { min-height: 63px; padding-block: 12px; }
.news-row + .news-row { border-top: 1px solid var(--line); }
.news-row:hover { background: var(--raised); }
.news-row > * { min-width: 0; overflow-wrap: anywhere; }
.news-row time { display: grid; color: var(--muted); font: .875rem/1.4 var(--mono); }
.news-row time strong { color: var(--text); font-size: .95rem; }
.source { color: var(--muted); font-size: .875rem; }
.tag { justify-self: start; padding: 2px 7px; border: 1px solid #554233; border-radius: 4px; color: var(--orange); font-size: .875rem; }
.headline { font-weight: 600; }
.original { justify-self: start; color: var(--orange); font-size: .875rem; text-underline-offset: 4px; }
.original:hover { color: var(--text); }
.empty { margin: 0; padding: 45px 22px; color: var(--muted); text-align: center; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding-block: 18px 27px; color: var(--muted); font: .8rem/1.5 var(--mono); }
dialog { width: min(100% - 32px, 560px); padding: 24px; color: var(--text); }
dialog::backdrop { background: #05070bc9; }
.article-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
#article-body { color: var(--muted); }
@media (max-width: 800px) {
  .masthead-inner, .shell { width: calc(100% - 36px); }
  .columns { display: none; }
  .news-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "time tag" "headline headline" "source link";
    gap: 8px 12px;
    padding-block: 14px;
  }
  .news-row:first-child { border-top: 1px solid var(--line); }
  .news-row time { grid-area: time; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
  .news-row .tag { grid-area: tag; justify-self: end; }
  .news-row .headline { grid-area: headline; }
  .news-row .source { grid-area: source; }
  .news-row .original { grid-area: link; justify-self: end; }
}
@media (max-width: 510px) {
  .masthead-inner, .shell { width: calc(100% - 24px); }
  .masthead-inner { min-height: 65px; }
  .brand { gap: 7px; font-size: .78rem; }
  .brand-icon { padding: 8px; }
  .intro { padding-block: 25px 20px; flex-wrap: wrap; gap: 8px; }
  .timezone { display: flex; align-items: baseline; gap: 8px; }
  .feed-toolbar { display: grid; padding: 14px; gap: 10px; }
  .search { width: 100%; }
  .categories, .feed-meta, .news-row { padding-inline: 14px; }
}
