:root {
  color-scheme: light;
  --ink: #172933;
  --muted: #516671;
  --line: #d9e3e5;
  --paper: #f5f8f8;
  --white: #fff;
  --dark: #0a1c27;
  --accent: #087063;
  --mint: #b7f6de;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-underline-offset: .19em; }
a:focus-visible { outline: 2px solid #0b8d90; outline-offset: 4px; border-radius: 3px; }
.skip { position: absolute; top: -4rem; left: 1rem; z-index: 2; padding: .55rem 1rem; background: white; }
.skip:focus { top: 1rem; }
.shell { width: min(1230px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.site-bar { min-height: 69px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  background: #0b302f;
  border-radius: 50%;
}
.brand-mark::after { content: ""; width: 1.5rem; height: .52rem; border: 1px solid var(--mint); border-radius: 50%; transform: rotate(-32deg); }
.site-bar nav { display: flex; gap: .45rem; flex-wrap: wrap; }
.site-bar nav a {
  display: block;
  padding: .35rem .72rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
}
.site-bar nav a:hover, .site-bar nav a[aria-current] { background: #e7f2ee; color: #174f48; }
.site-search { display: flex; flex: 0 1 245px; min-width: 0; }
.site-search input, .site-search button {
  min-height: 38px;
  border: 1px solid #ccdada;
  padding: .31rem .58rem;
  color: var(--ink);
  background: #f7faf9;
  font: inherit;
  font-size: .88rem;
}
.site-search input { width: 100%; min-width: 0; border-radius: 7px 0 0 7px; }
.site-search button { cursor: pointer; white-space: nowrap; border-left: 0; border-radius: 0 7px 7px 0; color: var(--accent); }
.site-search button:hover { background: #e7f2ee; }

.hero {
  margin-top: 22px;
  border: 1px solid #213743;
  border-radius: 18px;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(90deg, #0b1e2b 46%, #0b1e2bee 50%, #0b1e2b33 70%, #0b1e2b22),
    url("moonlit-earth.jpg") center right / auto 144% no-repeat, #0b1e2b;
}
.hero-content { padding: clamp(24px, 3.2vw, 43px); }
.hero-date {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0 0 13px;
  color: var(--mint);
  font-size: .89rem;
}
.hero-date time { font-family: ui-monospace, monospace; letter-spacing: .08em; }
.hero-date span { border-left: 1px solid #56807d; padding-left: .8rem; }
.hero h1 { margin: 0; line-height: 1.14; font-size: clamp(2.45rem, 5vw, 4rem); letter-spacing: .025em; }
.hero h1 + p { margin: 10px 0 16px; color: #ddeceb; font-size: clamp(.95rem, 2vw, 1.12rem); }
.hero-links { display: flex; gap: .65rem; flex-wrap: wrap; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: .38rem .85rem;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}
.button.primary { background: var(--mint); color: #0c342d; }
.button.primary:hover { background: #d4ffec; }
.button.secondary { border-color: #6c9396; background: #0b1e2b9c; color: #edf7f6; }
.button.secondary:hover { background: #26434a; }

.home-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}
.home-stats a { color: var(--muted); padding: .52rem .82rem; text-align: center; text-decoration: none; font-size: .9rem; }
.home-stats a + a { border-left: 1px solid var(--line); }
.home-stats a:hover { color: var(--accent); background: #f1f8f6; }
.home-stats strong { color: var(--ink); padding-inline-end: .17rem; font-size: 1.16rem; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 350px); gap: 26px; align-items: start; margin-top: 26px; }
.section-heading, .panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.section-heading { margin-bottom: 14px; }
.section-heading h2, .panel-heading h2 { margin: 0; line-height: 1.35; font-size: 1.42rem; }
.section-heading span, .section-heading > a { font-size: .88rem; }
.section-heading span { color: var(--muted); }
.editor-lead {
  display: grid;
  gap: .37rem;
  border: 1px solid #bad8d3;
  border-left: 4px solid #269083;
  border-radius: 10px;
  padding: 16px 18px;
  background: #edf7f5;
}
.editor-lead span { color: #16594e; font-weight: 650; font-size: .88rem; }
.lead-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .72rem; }
.lead-meta .bookmark { margin-inline-start: auto; }
.editor-lead > a { color: var(--ink); font-weight: 740; text-decoration: none; font-size: clamp(1.25rem, 2.3vw, 1.58rem); line-height: 1.33; }
.editor-lead > a:hover { color: var(--accent); text-decoration: underline; }
.editor-lead p { margin: .16rem 0 0; color: #324751; }
.date-divider { font-size: .89rem; color: var(--muted); margin: 1.05rem 0 .42rem; font-weight: 600; }
.topic-links { display: flex; gap: .45rem; flex-wrap: wrap; margin: 0 0 15px; }
.topic-links a {
  border: 1px solid #cfe0df;
  border-radius: 6px;
  color: #2d5e58;
  background: #edf5f3;
  padding: .22rem .61rem;
  text-decoration: none;
  font-size: .88rem;
}
.topic-links a:hover { background: #d9eeea; }
.window-switch a[aria-current] { background: #17584e; color: #fff; border-color: #17584e; }
.story { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 18px 21px 20px; margin-bottom: 11px; }
.metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem .62rem;
  color: var(--muted);
  font-size: .88rem;
}
time { font-variant-numeric: tabular-nums; }
.metadata a { text-decoration: none; }
.metadata a:hover { text-decoration: underline; }
.stage { border-radius: 5px; background: #e6f1ef; color: #1a5a51; padding: .08em .48em; }
.origin-badge { padding: .08em .48em; border-radius: 5px; white-space: nowrap; }
.origin-badge.core { background: #dcefe8; color: #185746; }
.origin-badge.supplement { background: #ebeff1; color: #495d67; }
.story :is(h2, h3, h4) { font-size: clamp(1.13rem, 2.1vw, 1.4rem); margin: .46em 0 .38em; line-height: 1.4; }
.story :is(h2, h3, h4) a, .rank-list a, .directory a { color: var(--ink); text-decoration: none; }
.story :is(h2, h3, h4) a:hover, .rank-list a:hover, .directory a:hover { color: var(--accent); text-decoration: underline; }
.story p { margin: 0 0 .7rem; color: #324751; font-size: .98rem; }
.source-summary { color: #38615e; font-size: .85rem; }
.story-foot { display: flex; gap: .45rem 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.bookmark {
  cursor: pointer;
  border: 1px solid #cde0dc;
  border-radius: 6px;
  padding: .23rem .67rem;
  color: #246254;
  background: #fbfdfc;
  font: inherit;
  font-size: .88rem;
}
.bookmark:hover, .bookmark[aria-pressed="true"] { background: #e3f2ee; border-color: #a6c9c1; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #087063; outline-offset: 2px; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 19px; }
.side-stack { display: grid; gap: 14px; }
.panel-heading { margin-bottom: .45rem; }
.panel-heading a { font-size: .88rem; }
.rank-list { margin: 0; padding: 0; list-style: none; }
.rank-list li {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .5rem;
  border-bottom: 1px solid #e4ecec;
  padding: .75rem 0;
  line-height: 1.45;
}
.place { font: 650 .85rem ui-monospace, monospace; color: #087063; }
.rank-list a { font-weight: 620; }
.rank-count, .panel-note { font-size: .82rem; color: var(--muted); }
.rank-count { white-space: nowrap; }
.panel-note { margin: .8rem 0 0; }
.full-ranking { max-width: 860px; }
.full-ranking .rank-list li:last-child { border: 0; }
.watch-list { list-style: none; margin: 0; padding: 0; }
.watch-list li { display: grid; gap: .18rem; padding: .62rem 0; }
.watch-list li + li { border-top: 1px solid var(--line); }
.watch-list a { font-size: .88rem; font-weight: 670; justify-self: start; }
.watch-list span { color: var(--muted); font-size: .91rem; }

.page-heading { margin: 43px 0 22px; }
.page-heading h1 { margin: 0 0 9px; font-size: clamp(1.95rem, 4.5vw, 3rem); line-height: 1.24; }
.page-heading p { margin: 0; color: var(--muted); }
.listing, .directory { max-width: 860px; }
.directory { list-style: none; padding: 0; }
.directory li { display: flex; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; margin-bottom: .6rem; border: 1px solid var(--line); border-radius: 9px; background: white; }
.directory a { font-weight: 680; }
.directory span { color: var(--muted); font-size: .91rem; }
.topic-directory li { padding-inline: .85rem; }
.side-stack .topic-directory { margin: 0; }
.side-stack .topic-directory li { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .47rem 0; margin: 0; font-size: .91rem; }
.side-stack .topic-directory li:last-child { border: 0; padding-bottom: 0; }
.topic-index .topic-directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; max-width: 930px; }
.topic-index li { align-items: baseline; padding: 1rem; margin: 0; }
.edition-directory a, .source-directory li > div:first-child { display: grid; gap: .25rem; }
.edition-directory time { color: var(--muted); font-size: .89rem; }
.source-links { display: flex; gap: .4rem .9rem; flex-wrap: wrap; font-size: .9rem; }
.source-links a { color: var(--accent); }
.source-group h2 { font-size: 1.23rem; margin: 1.25rem 0 .55rem; }
.source-group h2 span { color: var(--muted); font-size: .9rem; font-weight: 400; margin-left: .35rem; }
.filters {
  display: grid;
  grid-template-columns: minmax(165px, 1.5fr) repeat(4, minmax(110px, 1fr)) auto;
  align-items: end;
  gap: .7rem;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.filters label { display: grid; gap: .28rem; min-width: 0; color: var(--muted); font-size: .9rem; }
.filters input, .filters select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  background: #f7faf9;
  color: var(--ink);
  border: 1px solid #cbdcda;
  border-radius: 6px;
  padding: .35rem .55rem;
  font: inherit;
}
.filters select {
  appearance: none;
  padding-inline-end: 1.4rem;
  background-image: linear-gradient(45deg, transparent 50%, #45706b 50%), linear-gradient(135deg, #45706b 50%, transparent 50%);
  background-position: calc(100% - 11px) 50%, calc(100% - 6px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.button.reset { cursor: pointer; color: var(--accent); border-color: #cbdcda; background: #edf5f3; }
.button.reset:hover { background: #def0eb; }
.results-note { color: var(--muted); font-size: .91rem; margin: 1rem 0; }
.empty-state { padding: 1.15rem; border: 1px dashed #c4d6d3; border-radius: 10px; background: var(--white); color: var(--muted); }
.event-page { max-width: 800px; margin: 2rem auto; }
.breadcrumb { color: var(--muted); font-size: .9rem; }
.event-page .page-heading { margin-top: 1.5rem; }
.event-page .metadata { margin-bottom: .8rem; }
.lede { font-size: clamp(1.03rem, 2vw, 1.2rem); }
.watch { background: #eaf4f2; padding: 1rem 1.2rem; border-left: 3px solid #4d9288; border-radius: 0 9px 9px 0; }
.watch h2, .sources h2 { margin: 0 0 .4rem; font-size: 1.18rem; }
.watch p { margin: 0; }
.sources { margin-top: 1.45rem; }
.sources ul { list-style: none; margin: 0; padding: 0; }
.sources li { display: flex; justify-content: space-between; gap: .35rem .9rem; flex-wrap: wrap; padding: .7rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.sources li span { color: var(--muted); font-size: .88rem; }
.related { margin: 1.45rem 0; }
.related h2 { margin: 0 0 .3rem; font-size: 1.18rem; }
.related ul { padding-inline-start: 1.25rem; margin-top: 0; }
.related li { margin-bottom: .23rem; }
.brief-page { max-width: 860px; }
.brief-heading { border-bottom: 2px solid #a8c9c2; padding-bottom: 1.05rem; }
.brief-heading .breadcrumb { margin-bottom: .55rem; }
.brief-intro { border-left: 3px solid #71a79b; padding: .55rem 1rem; background: #eaf4f2; font-size: 1.07rem; }
.brief-page section > h2 { font-size: 1.35rem; margin-top: 1.5rem; }
.brief-watch ul { list-style: none; padding: 0; margin: 0; }
.brief-watch li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.brief-watch li p { color: var(--muted); margin: .2rem 0 0; }
.empty { color: var(--muted); }
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-top: 35px;
  padding: 18px 0 23px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}
.footer a { color: var(--muted); }
.footer nav { display: flex; flex-wrap: wrap; gap: .45rem 1.1rem; }
@media (max-width: 850px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hero { background-size: cover, auto 112%; }
  .site-bar { flex-wrap: wrap; padding: .65rem 0; gap: .35rem .8rem; }
  .site-search { flex: 1 1 100%; }
  .site-search input { flex: 1 1 auto; }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filter-search { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 30px); }
  .site-bar { flex-wrap: wrap; gap: .35rem; padding: .72rem 0; min-height: 0; }
  .site-bar nav { gap: .13rem; }
  .site-bar nav a { padding: .36rem .48rem; }
  .hero {
    margin-top: 15px;
    border-radius: 13px;
    background-image: linear-gradient(90deg, #0b1e2b 12%, #0b1e2bd4 51%, #0b1e2b66), url("moonlit-earth.jpg");
    background-position: center, 68% center;
    background-size: cover, auto 100%;
  }
  .hero-content { padding: 26px 20px; }
  .hero h1 { font-size: clamp(1.94rem, 8vw, 2.7rem); }
  .home-grid { margin-top: 23px; }
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-stats a:nth-child(3) { border-left: 0; }
  .home-stats a:nth-child(n+3) { border-top: 1px solid var(--line); }
  .story, .panel { padding: 15px; }
  .page-heading { margin-top: 27px; }
  .event-page { margin-top: 1.2rem; }
  .topic-index .topic-directory { grid-template-columns: minmax(0, 1fr); }
}

.date-group .story .metadata time { display: none; }

.date-group .story .metadata time { display: none; }
