:root {
  color-scheme: light;
  --paper: #f7f3eb;
  --surface: #fffdf9;
  --navy: #253b50;
  --text: #344b61;
  --muted: #6f8296;
  --gold: #b97d3d;
  --gold-dark: #91602d;
  --gold-soft: #f7ead7;
  --line: #e3d4bf;
  --shadow: 0 10px 28px rgba(45, 55, 63, 0.07);
  --max-width: 1040px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--paper);
}

body {
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.site-header {
  flex: 0 0 auto;
  background: rgba(247, 243, 235, 0.94);
}

.header-inner,
main {
  width: min(calc(100% - 56px), var(--max-width));
  margin-inline: auto;
}

main {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.header-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #fffdf9;
  background: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 10px rgba(37, 59, 80, 0.12);
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--muted);
  font-size: 10px;
}

.edition {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.edition::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 125, 61, 0.12);
}

.intro {
  flex: 0 0 auto;
  padding: 12px 0 20px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  margin-top: 12px;
}

.published-total {
  margin: 0;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.6;
}

.community-invite {
  color: var(--muted);
  font-weight: 500;
}

#visitor-rank {
  padding-inline: 2px;
  color: var(--gold-dark);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.follow-trigger {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--gold-dark);
  background: transparent;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(185, 125, 61, 0.42);
  text-underline-offset: 3px;
  cursor: pointer;
}

.follow-trigger:hover,
.follow-trigger:focus-visible {
  color: var(--navy);
  text-decoration-color: var(--gold);
  outline: none;
}

.follow-trigger:focus-visible {
  border-radius: 3px;
  box-shadow: 0 0 0 3px rgba(185, 125, 61, 0.18);
}

.follow-dialog {
  width: min(430px, calc(100% - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
}

.follow-dialog::backdrop {
  background: rgba(28, 42, 55, 0.38);
  backdrop-filter: blur(3px);
}

.follow-dialog-card {
  position: relative;
  padding: 30px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(30, 43, 55, 0.22);
  text-align: center;
}

.dialog-close {
  position: absolute;
  top: 13px;
  right: 15px;
  width: 31px;
  height: 31px;
  padding: 0 0 2px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-family: Georgia, serif;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  border-color: var(--line);
  color: var(--navy);
  background: var(--paper);
  outline: none;
}

.dialog-eyebrow {
  margin: 0 0 6px;
  color: var(--gold-dark);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.follow-dialog h2 {
  max-width: 340px;
  margin: 0 auto 21px;
  color: var(--navy);
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.45;
}

.dialog-title-nowrap {
  white-space: nowrap;
}

.qr-frame {
  width: min(286px, 100%);
  margin-inline: auto;
  padding: 13px;
  border: 1px solid #e3c9a5;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 5px #fffaf2;
}

.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.feed-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-top: 1px solid var(--line);
}

.timeline {
  padding: 28px 0 50px;
}

.date-group {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 24px;
}

.date-group + .date-group {
  margin-top: 52px;
}

.date-heading {
  position: sticky;
  top: 20px;
  z-index: 3;
  align-self: start;
  margin: 0;
  padding: 1px 0 8px;
  color: var(--muted);
  background: var(--paper);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.date-heading strong {
  display: block;
  margin-bottom: 2px;
  color: var(--navy);
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.cards {
  --time-column: 58px;
  --entry-gap: 24px;
  min-width: 0;
  position: relative;
  display: grid;
  gap: 14px;
}

.cards::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: calc(var(--time-column) + (var(--entry-gap) / 2));
  width: 1px;
  background: var(--line);
}

.timeline-entry {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: var(--time-column) minmax(0, 1fr);
  gap: var(--entry-gap);
  align-items: start;
}

.entry-time {
  position: relative;
  padding-top: 24px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.entry-time::after {
  content: "";
  position: absolute;
  top: 29px;
  right: calc((var(--entry-gap) / -2) - 4px);
  z-index: 2;
  width: 7px;
  height: 7px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1px #d9bd96;
}

.news-card {
  padding: 24px 26px 23px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.news-card:hover {
  border-color: #d5b98f;
  box-shadow: 0 14px 34px rgba(45, 55, 63, 0.1);
  transform: translateY(-1px);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.source-type {
  padding: 2px 8px;
  border: 1px solid #e3c9a5;
  border-radius: 999px;
  color: var(--gold-dark);
  background: var(--gold-soft);
  font-size: 11px;
  line-height: 1.5;
}

.news-card h2 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(21px, 3.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.45;
}

.summary {
  margin: 13px 0 0;
  color: #536a7f;
  font-size: 14px;
}

.source-link {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 12px;
  border: 1px solid #d9bd96;
  border-radius: 8px;
  color: var(--gold-dark);
  background: #fffaf2;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.source-link:hover,
.source-link:focus-visible {
  color: #fff;
  background: var(--gold);
  border-color: var(--gold);
  outline: none;
}

.source-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(185, 125, 61, 0.22);
}

.status {
  margin: 8px 0 56px 152px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.feed-scroll footer {
  width: 100%;
  margin-inline: auto;
  padding: 27px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.feed-scroll footer p {
  margin: 0;
}

@media (max-width: 700px) {
  .header-inner,
  main {
    width: min(calc(100% - 30px), var(--max-width));
  }

  .header-inner {
    min-height: 58px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 11px;
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .intro {
    padding: 10px 0 16px;
  }

  .intro-meta {
    margin-top: 9px;
  }

  .published-total {
    font-size: 10.5px;
  }

  .date-group {
    display: block;
  }

  .date-group + .date-group {
    margin-top: 36px;
  }

  .date-heading {
    top: 0;
    margin-bottom: 14px;
    padding: 12px 0 10px;
  }

  .date-heading strong {
    display: inline;
    margin-right: 8px;
    font-size: 24px;
  }

  .cards {
    --time-column: 48px;
    --entry-gap: 16px;
  }

  .entry-time {
    padding-top: 20px;
    font-size: 11px;
  }

  .entry-time::after {
    top: 25px;
  }

  .news-card {
    padding: 21px 20px 20px;
    border-radius: 12px;
  }

  .status {
    margin-left: 0;
  }

  .follow-dialog-card {
    padding: 28px 20px 24px;
    border-radius: 15px;
  }

  .follow-dialog h2 {
    padding-inline: 14px;
    font-size: 20px;
  }
}

@media (max-width: 430px) {
  .edition {
    display: none;
  }

  h1 {
    font-size: 30px;
  }

  .cards {
    --time-column: 42px;
    --entry-gap: 13px;
  }

  .news-card {
    padding-inline: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .news-card {
    transition: none;
  }
}
