:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  --ink: #242426;
  --muted: #626267;
  --rule: #e1e1e5;
  --paper: #fff;
  --accent: #41444a;
  --control-ink: #48484f;
  --detail-ink: #535358;
  --meta-ink: #73737a;
  --panel: #f5f5f7;
  --track: #eeeef1;
  --active-tab: #fff;
  --row-hover: #f7f7f9;
  --featured: #f7f7f8;
  --featured-lead: #f2f2f4;
  --featured-hover: #eeeeef;
  --review-selection-bg: color-mix(in srgb, var(--accent) 10%, var(--paper));
  --on-accent: #fff;
  --notice-border: #eadbbc;
  --notice-bg: #fbf2e6;
  --notice-ink: #713c21;
  --new-border: #efd8ac;
  --new-bg: #fff1d6;
  --new-ink: #784313;
  --inactive-bg: #ececef;
  --inactive-border: #dedee3;
  --inactive-ink: #66666c;
  --slider-handle: #d0d0d5;
  --skeleton: #eceef0;
  --error-ink: #a12d32;
  --serif: "Songti SC", "Noto Serif CJK SC", STSong, SimSun, Georgia, serif;
}


:root[data-weekday="1"] { --accent: #38765a; }
:root[data-weekday="2"] { --accent: #3a6ea0; }
:root[data-weekday="3"] { --accent: #7754a2; }
:root[data-weekday="4"] { --accent: #a55d31; }
:root[data-weekday="5"] { --accent: #a64465; }
:root[data-weekday="6"] { --accent: #35777b; }
:root[data-weekday="0"] { --accent: #565ba4; }

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --accent: #c1c4ce;
    --paper: #141518;
    --ink: #f1f1f4;
    --muted: #b1b3bd;
    --rule: #35363e;
    --control-ink: #d7d8df;
    --detail-ink: #c6c7d0;
    --meta-ink: #b1b3bd;
    --panel: #222329;
    --track: #24252b;
    --active-tab: #353742;
    --row-hover: #212228;
    --featured: #202126;
    --featured-lead: #26272e;
    --featured-hover: #30313a;
    --on-accent: #15171c;
    --notice-border: #65452a;
    --notice-bg: #33251c;
    --notice-ink: #ffd3a9;
    --new-border: #775132;
    --new-bg: #402c1c;
    --new-ink: #ffcf94;
    --inactive-bg: #31323b;
    --inactive-border: #42444f;
    --inactive-ink: #aeb0bd;
    --slider-handle: #636673;
    --skeleton: #30323a;
    --error-ink: #ff9ca3;
  }
  :root[data-weekday="0"] { --accent: #a6a7dc; }
  :root[data-weekday="1"] { --accent: #83c4a5; }
  :root[data-weekday="2"] { --accent: #93b9db; }
  :root[data-weekday="3"] { --accent: #bf9bd9; }
  :root[data-weekday="4"] { --accent: #d9ab81; }
  :root[data-weekday="5"] { --accent: #d999b4; }
  :root[data-weekday="6"] { --accent: #80bec3; }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--paper);
}
#app { background-color: var(--paper); }

/* Give Safari a color sample inside the existing mobile top gutter. */
@media (display-mode: standalone) and (pointer: coarse) and (max-width: 1024px) {
  .standalone-status-edge {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1;
    height: 12px;
    background-color: var(--paper);
    pointer-events: none;
  }
}
@media (pointer: coarse) {
  html,
  html body {
    overflow: hidden;
    overscroll-behavior: none;
  }
  #app {
    position: fixed;
    inset: 0 0 auto;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }
}
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); text-underline-offset: .22em; }
:where(a, button, input, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
[hidden] { display: none !important; }

:root { --reader-gutter: clamp(16px, 4%, 32px); }

.wrap {
  width: min(calc(100% - var(--reader-gutter) - var(--reader-gutter)), 1060px);
  margin-inline: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: .07em;
}
.mark { display: grid; place-items: center; width: 36px; height: 36px; flex: none; color: var(--accent); font-size: 1.45rem; font-weight: 800; line-height: 1; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin: 29px 0 23px;
  padding: 39px clamp(24px, 5vw, 55px) 45px;
  border: 1px solid #d8f0e3;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 89% 12%, #bef3d6 0%, transparent 52%),
    radial-gradient(ellipse at 75% 110%, #d5f8e5 0%, transparent 56%),
    radial-gradient(ellipse at 99% 78%, #dbfae9 0%, transparent 58%),
    linear-gradient(110deg, #f6fefa 22%, #eafbf2 100%);
}
.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: radial-gradient(circle, #38946145 .8px, transparent 1px) 0 0 / 9px 9px;
  mask-image: linear-gradient(90deg, transparent 35%, #000 88%);
  pointer-events: none;
}
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 5.45vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.15;
}
.hero p, .selection p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.hero p { font-size: .9375rem; }

.primary, .secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 15px;
  font-size: .875rem;
  font-weight: 660;
  white-space: nowrap;
  text-decoration: none;
}
.primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 6px #00000026;
}
.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 88%, black);
}
.primary:disabled:not([aria-busy]), .primary[aria-disabled="true"] {
  background: var(--inactive-bg);
  border-color: var(--inactive-border);
  box-shadow: none;
  color: var(--inactive-ink);
}
.primary[aria-busy=true] {
  background: var(--accent);
  background-size: 230% 100%;
  animation: shimmer 1.65s ease-in-out infinite;
}
.secondary {
  background: var(--paper);
  color: var(--control-ink);
  border-color: var(--rule);
}
.secondary:hover { background: var(--panel); }

.board {
  background: var(--paper);
  margin-bottom: 0;
}

h2 { margin: 0; font-family: var(--serif); font-size: 1.375rem; }


.notice {
  margin: 0;
  padding: 11px 18px;
  border-bottom: 1px solid var(--notice-border);
  background: var(--notice-bg);
  color: var(--notice-ink);
  font-size: .875rem;
}
.empty {
  min-height: 275px;
  display: grid;
  justify-items: center;
  align-content: center;
  padding: 28px 15px;
  text-align: center;
}

.empty strong { font-size: 1.0625rem; }
.empty p { margin: 7px 0 0; color: var(--muted); font-size: .875rem; }

.feed-wrap { animation: reveal .32s ease-out both; }

.selection {
  position: sticky;
  z-index: 1;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: 0 -5px 20px #1c432d10;
}
.selection #selected-count { margin-inline-end: auto; font-weight: 400; }
.selection p { font-size: .8125rem; }
dialog {
  width: min(590px, calc(100% - 24px));
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop { background: #183e2975; }





@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { to { background-position: 230% 0; } }
@media (prefers-reduced-motion: reduce) {
  .feed-wrap, .primary[aria-busy=true] { animation: none; }
}
@media (max-width: 620px) {
  .brand { min-height: 60px; }
  .hero { margin-top: 18px; padding: 25px 20px; gap: 16px; }
  .hero h1 { margin-bottom: 8px; }
  .hero p { font-size: .875rem; }


  .selection { gap: 5px; padding: 9px 7px; }
  .selection p { display: none; }
  .selection strong, .selection .primary, .selection .secondary { font-size: .8125rem; }
  .selection .primary, .selection .secondary { padding-inline: 8px; }
}

@media (max-width: 620px) {
  .mobile-handoff { flex-wrap: wrap; }
}


.qr-version { color: var(--muted); font-size: .75rem; }

.channels, .editions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 12px; }
.channels { border-bottom: 1px solid var(--rule); padding-bottom: 9px; }
.channels button, .editions button {
  border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 650;
  border-radius: 6px; padding: 8px 13px; min-height: 40px; font-size: .9rem;
}
.channels button[aria-pressed=true], .editions button[aria-pressed=true] {
  background: var(--panel); border-color: var(--rule); color: var(--accent);
}
.channels button:hover, .editions button:hover { background: var(--panel); }




@media (prefers-reduced-motion: no-preference) {
  :root {
    --motion-quick: 160ms;
    --motion-entry: 320ms;
    --ease-out: cubic-bezier(.2,.75,.3,1);
  }

  .hero::before {
    transition: opacity var(--motion-entry) ease;
  }

  .primary, .secondary, .channels button, .editions button {
    transition: background-color var(--motion-quick) ease, color var(--motion-quick) ease,
      border-color var(--motion-quick) ease, box-shadow var(--motion-quick) ease,
      transform var(--motion-quick) var(--ease-out);
  }
  .primary:not(:disabled):not([aria-disabled="true"]):active,
  .secondary:not(:disabled):active, .channels button:active, .editions button:active {
    transform: translateY(1px) scale(.98);
  }

  .channels button, .editions button { position: relative; }
  .channels button::after, .editions button::after {
    position: absolute;
    inset: auto 12px 3px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
    opacity: 0;
    transform: scaleX(.35);
    transition: opacity var(--motion-quick) ease, transform var(--motion-entry) var(--ease-out);
  }
  .channels button[aria-pressed=true]::after, .editions button[aria-pressed=true]::after {
    opacity: .72;
    transform: scaleX(1);
  }

  .notice:not([hidden]) {
    animation: reveal 220ms var(--ease-out) both;
  }
  #app .feed-list .item-content { transition: background-color 170ms ease; }

  dialog[open] { animation: dialog-in 280ms var(--ease-out) both; }
  dialog[open]::backdrop { animation: backdrop-in 230ms ease both; }

  @media (hover: hover) {
    .hero:hover::before { opacity: .64; }
    .primary:not(:disabled):not([aria-disabled="true"]):hover,
    .secondary:not(:disabled):hover {
      box-shadow: 0 5px 12px #29754b23;
    }
  }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(11px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Framework7 iOS components share the reader palette and page layout. */
#app {
  --f7-text-color: var(--ink);
  --f7-range-bar-bg-color: var(--slider-handle);
  --f7-range-bar-active-bg-color: var(--accent);
  --f7-theme-color: var(--accent);
  --f7-ios-primary: var(--accent);
  --f7-page-bg-color: var(--paper);
  --f7-font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#app .page-content {
  color: var(--ink);
  font-family: var(--f7-font-family);
}
#app .wrap {
  margin-inline: auto;
}
#app .channels {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 4px;
  background: var(--track);
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
#app .channels .button {
  --f7-button-pressed-bg-color: transparent;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 7px 5px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
}

#app .channels .button[aria-pressed="true"] {
  background: var(--active-tab);
  color: var(--accent);
  box-shadow: 0 1px 4px #00000015;
}
#app .channels .button { position: relative; overflow: visible; }
.channel-label { position: relative; display: inline-block; }
.channel-new-count {
  position: absolute;
  z-index: 1;
  inset: -9px auto auto calc(100% - 1px);
  min-width: 16px;
  height: 16px;
  padding-inline: 3px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 10px/16px system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
}
#app .segmented .button::after { content: none; }
#app :is(.primary,.secondary) {
  width: auto;
  height: auto;
  text-transform: none;
}
@media (max-width: 410px) {
  #app .channels .button { font-size: .81rem; }
}

/* Keep the reading surface focused on channel, headlines and actions. */
.brand h1 { margin: 0; color: var(--ink); font-size: 1rem; font-weight: 700; letter-spacing: 0; }


.compact-reader { padding-top: 10px; }
.daily-quote {
  margin: 8px 0 20px;
  padding: 10px 14px;
  border-inline-start: 2px solid var(--accent);
  background: var(--panel);
  border-radius: 0 8px 8px 0;
}
.daily-quote blockquote { margin: 0; color: var(--ink); font-size: .875rem; line-height: 1.55; }
.daily-quote figcaption { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; margin-top: 5px; font-size: .75rem; }
.daily-quote figcaption::before { content: '—'; margin-inline-end: -6px; color: var(--muted); }
#app .compact-reader .channels { margin-bottom: 12px; }
.visually-hidden {
  position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}
@media (max-width: 390px) {
  .brand { gap: 7px; }
  .brand h1 { font-size: .9rem; }
  .brand .mark { width: 30px; height: 30px; }

}


#app .feed-list { margin: 0; --f7-list-bg-color: var(--paper); --f7-list-item-border-color: var(--rule); }
#app .feed-list ul { margin: 0; }
#app .feed-list .item-content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 50px;
  padding: 0 15px;
  color: var(--ink);
  cursor: pointer;
}
#app .feed-list label.item-content input {
  display: block;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
}
#app .feed-list .item-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 10px 0;
}
#app .feed-list .item-inner:has(> .feed-rank) { grid-template-columns: 2.35rem minmax(0, 1fr); }
#app .feed-list .item-inner:has(> :is(.feed-publication-time, .feed-item-meta)) {
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
}
.feed-publication-time {
  color: var(--muted);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  text-align: end;
  white-space: nowrap;
}
#app .feed-list .item-title {
  font-size: var(--reading-font-size, 1rem);
  min-width: 0;
  white-space: normal;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
#app #news-home-title:not([hidden]) ~ .feed-list .item-title,
#app #news-live-rows .item-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.feed-rank {
  align-self: start;
  justify-self: start;
  color: var(--detail-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
#app .feed-list .item-inner:has(.wiki-news-thumbnail:not([hidden])) {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 9px;
}
.wiki-news-thumbnail {
  display: block;
  width: clamp(64px, 22vw, 120px);
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 5px;
}
.feed-new-badge {
  display: inline-block;
  margin-inline-end: .4em;
  padding: .12em .4em;
  border: 1px solid var(--new-border);
  border-radius: .35em;
  background: var(--new-bg);
  color: var(--new-ink);
  font-size: .75rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: .04em;
  vertical-align: middle;
  translate: 0 -1px;
}
#app .feed-list [data-focus-rank] .feed-new-badge { translate: 0 -2px; }
#app .feed-list .item-content:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
@media (hover: hover) {
  #app .feed-list li:not(.selected) .item-content:hover { background-color: var(--row-hover); }
}
@media (max-width: 620px) {
  #app .feed-list .item-content { gap: 8px; padding-inline: 10px; }
  #app .feed-list .item-inner:has(> .feed-rank) { grid-template-columns: 1.8rem minmax(0, 1fr); }
}

#app #rows:has(> [data-focus-rank]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
#app #rows:has(> [data-focus-rank]) > li:not([data-focus-rank]) .item-content:has(.feed-rank) {
  padding-inline-start: 16px;
}
#app #rows > li:not([data-focus-rank]) .item-content:has(.feed-rank) {
  align-content: center;
}
#app #rows > li:not([data-focus-rank]) .item-inner:has(> .feed-rank) {
  align-self: center;
  align-content: center;
  align-items: baseline;
  padding-block: 10px;
}
#app #rows > li:not([data-focus-rank]) .item-inner:has(> .feed-rank) > .feed-rank {
  align-self: baseline;
}
#app #rows > li:not([data-focus-rank]) .item-inner:has(> .feed-rank) > .item-title {
  margin-block: 0;
}
#app #rows > li[data-focus-rank] {
  min-width: 0;
  margin-bottom: 8px;
}
#app .feed-list [data-focus-rank] .item-content {
  align-items: start;
  height: 100%;
  min-height: 64px;
  padding: 10px 15px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--featured);
}
#app .feed-list :is([data-focus-rank="2"], [data-focus-rank="3"]) .item-content {
  align-content: start;
}
#app .feed-list :is([data-focus-rank="2"], [data-focus-rank="3"]) .item-inner {
  align-content: start;
  align-items: baseline;
}
#app .feed-list :is([data-focus-rank="2"], [data-focus-rank="3"]) .feed-rank {
  align-self: baseline;
}
#app .feed-list :is([data-focus-rank="2"], [data-focus-rank="3"]):not(.selected) .item-content {
  background: color-mix(in srgb, var(--featured) 55%, var(--paper));
}
#app .feed-list [data-focus-rank="1"] .item-content {
  align-content: center;
  padding-block: 14px;
  background: var(--featured-lead);
}
#app .feed-list [data-focus-rank] .item-inner { padding-block: 0; }
#app .feed-list [data-focus-rank] .item-inner::after { display: none; }
#app .feed-list [data-focus-rank] .feed-rank {
  color: var(--accent);
  font-size: calc(var(--reading-font-size, 1rem) * 1.1);
  line-height: 1.4;
}
#app .feed-list [data-focus-rank="1"] .item-inner {
  align-content: center;
  align-items: baseline;
}
#app .feed-list [data-focus-rank="1"] .feed-rank {
  align-self: baseline;
  font-size: calc(var(--reading-font-size, 1rem) * 1.45);
}
#app .feed-list [data-focus-rank] .item-title {
  font-size: calc(var(--reading-font-size, 1rem) * 1.1);
  font-weight: 650;
  line-height: 1.4;
}
#app .feed-list [data-focus-rank="1"] .item-title {
  font-size: calc(var(--reading-font-size, 1rem) * 1.45);
  font-weight: 750;
}
@media (hover: hover) {
  #app .feed-list [data-focus-rank]:not(.selected) .item-content:hover { background: var(--featured-hover); }
}
@media (min-width: 621px) {
  #app #rows:has(> [data-focus-rank="2"]):has(> [data-focus-rank="3"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8px;
  }
  #app #rows > li:not([data-focus-rank="2"], [data-focus-rank="3"]) { grid-column: 1 / -1; }
}

.brand-trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

/* Header belongs to the same scroll container as the news list. */
#app #reader-view > .page > .page-content {
  margin-top: env(safe-area-inset-top, 0px);
  padding-top: 0;
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  background: var(--paper);
}
@media (max-width: 1024px) and (pointer: coarse) {
  #app #reader-view > .page > .page-content {
    margin-top: calc(env(safe-area-inset-top, 0px) + 16px);
  }
}
#app .top {
  background: var(--paper);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.feed-meta { display: flex; justify-content: flex-end; min-height: 30px; align-items: center; }
#feed-time { position: relative; font-size: .75rem; color: var(--meta-ink); border: 0; background: transparent; }
#feed-time { display: flex; align-items: center; gap: 5px; cursor: pointer; list-style: none; padding: 6px 0 8px 12px; }
.feed-time-icon { width: .875rem; height: .875rem; flex: none; }
#feed-time #feed-time-label { margin-inline: 0; }
.feed-time-detail {
  margin: 0;
  padding: 10px 12px;
  color: var(--detail-ink); white-space: pre-line; overflow-wrap: anywhere;
  font-size: .8125rem; line-height: 1.6;
}

#app #reader-view > .page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-top: 0;
  background: var(--paper);
}
#app #feed-scroll > .top {
  position: relative;
  top: auto;
  z-index: 10;
}
.brand { gap: 8px; }
.brand h1 { flex: 0 1 auto; min-width: 0; }
#app .top .right { grid-column: 2; justify-self: end; }
.brand .feed-meta { margin-inline-start: auto; min-width: 0; flex: 0 1 auto; text-align: right; }
#feed-time { padding: 10px 0 10px 6px; letter-spacing: 0; font-weight: 400; }
@media (max-width: 410px) {
  .brand h1 { font-size: .875rem; }
  #feed-time { font-size: .6875rem; }
  #feed-time { max-width: 118px; }
}

/* Mobile pull gesture exposes an icon without adding resting page height. */
#app .mobile-ptr { overscroll-behavior-y: contain; }
#app .mobile-ptr .ptr-preloader { opacity: 0; }
#app .mobile-ptr .pull-result {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--meta-ink);
  font-size: .8125rem;
}
#app .mobile-ptr .pull-result.is-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent);
  color: color-mix(in oklab, var(--accent) 94%, white);
  font-weight: 600;
}
#app .mobile-ptr .pull-result.is-success::before {
  content: "✓" / "";
  display: inline-grid;
  place-items: center;
  inline-size: 12px;
  block-size: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
}
#app .board-viewport.pull-refresh-covered::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--paper) 48%, transparent);
  pointer-events: none;
}
#app .mobile-ptr:is(.ptr-pull-up,.ptr-refreshing) .ptr-preloader { opacity: 1; }
#app .mobile-ptr .ptr-preloader .preloader {
  --f7-ptr-preloader-size: 22px;
  --f7-preloader-color: var(--meta-ink);
}
@media (prefers-reduced-motion: reduce) {
  #app .mobile-ptr .preloader, #app .mobile-ptr .preloader-inner { animation: none !important; }
  #app .mobile-ptr > * { transition-duration: 0.01ms !important; }
}

/* Reading settings: compact toolbar entry, an iOS-style sheet on mobile. */
.feed-rank { font-size: var(--reading-font-size, 1rem); }
.settings-trigger, .settings-close {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 40px; width: 40px; height: 44px; padding: 0;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted);
}
.settings-trigger:hover { background: var(--panel); color: var(--accent); }
.brand { gap: 4px; }
.brand-trigger { white-space: nowrap; }
.brand .feed-meta { flex-shrink: 1; }
#feed-time { white-space: nowrap; }
.settings-dialog {
  width: min(460px, calc(100% - 32px)); max-width: none;
  max-height: 85dvh; padding: 0; border: 0;
  border-radius: 24px; background: var(--panel); color: var(--ink);
  animation: none !important;
}
.settings-panel { padding: 12px 24px 24px; }
.settings-handle { display: none; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 20px; }
.settings-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.settings-close { font-size: 1.6rem; width: 36px; height: 40px; color: var(--meta-ink); }
.settings-card { background: var(--paper); border-radius: 16px; padding: 18px 18px 14px; }
.font-setting-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 1rem; }
.font-setting-title output { color: var(--meta-ink); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.font-slider-row { display: flex; align-items: center; gap: 14px; margin-top: 18px; height: 44px; color: var(--meta-ink); }
.font-slider-row > span:first-child { font-size: .8125rem; }
.font-slider-row > span:last-child { font-size: 1.375rem; }
#font-size { flex: 1; min-width: 0; margin: 0; }
.font-stops { display: flex; justify-content: space-between; margin: 0 22px; font-size: .75rem; color: var(--meta-ink); }
.font-preview { margin-top: 14px; padding: 16px 18px; background: var(--paper); border-radius: 16px; }
.font-preview > span { display: block; font-size: .75rem; color: var(--meta-ink); }
.font-preview p { font-size: var(--reading-font-size,1rem); line-height: 1.6; margin: 8px 0 0; }
.settings-save { display: block; width: 100%; min-height: 48px; margin-top: 24px; border: 0; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 1rem; }
.settings-version { display: block; margin-top: 12px; color: var(--muted); font-size: .75rem; text-align: center; }
.settings-save:active { background: color-mix(in srgb, var(--accent) 86%, black); }
.settings-error { font-size: .8125rem; color: var(--error-ink); }
@media (max-width: 620px) {
  .settings-dialog { width: 100%; max-height: 88dvh; border-radius: 26px 26px 0 0; }
  .settings-panel { padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .settings-handle { display: block; width: 36px; height: 5px; border-radius: 5px; background: var(--slider-handle); margin: 0 auto 6px; }
}
@media (max-width: 370px) {
  .brand h1 { font-size: .8125rem; }
  #feed-time { font-size: .625rem; padding-left: 0; }
}

.settings-saved { margin: 16px 0 0; color: var(--accent); font-size: .8125rem; text-align: center; }
.settings-save:disabled { background: var(--inactive-bg); color: var(--inactive-ink); cursor: default; }

/* Focus the sheet title on entry, rather than making Close look selected. */
#settings-title:focus { outline: none; }
.settings-close { -webkit-tap-highlight-color: transparent; }
.settings-close:focus:not(:focus-visible) { outline: none; }

/* Keep SVG subparts from consuming the first touch on the settings control. */
.settings-trigger svg { pointer-events: none; }
#app .feed-list .feed-date-divider {
  position: static;
  height: auto;
  min-height: 40px;
  margin: 12px 0 0;
  padding: 10px 15px;
  background: var(--panel);
  color: var(--meta-ink);
}
#app .feed-list .feed-date-divider:first-child { margin-top: 0; }
.feed-date-divider h4 { margin: 0; font-size: .8125rem; font-weight: 600; line-height: 1.5; }
.news-section-title {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.5;
}
#news-live-section { margin-top: 24px; }
.wiki-section-title { margin: 0 0 8px; font-size: 1.125rem; line-height: 1.4; }
#wiki-more-section { margin-top: 22px; }
#app #wiki-more-rows::before,
#app #wiki-more-rows::after,
#app #wiki-more-rows > .feed-date-divider::before,
#app #wiki-more-rows > .feed-date-divider::after,
#app #wiki-more-rows > li:has(+ .feed-date-divider) .item-inner::after,
#app #wiki-more-rows > li:last-child .item-inner::after { display: none; }
.feed-section-status { padding: 10px 15px; color: var(--muted); font-size: .875rem; }

/* Keep drag translations inside the list without creating another scroll container. */
#app #feed-scroll { overflow-x: hidden; overscroll-behavior-x: none; }
#app .mobile-ptr .board-viewport { overflow-x: clip; touch-action: pan-y pinch-zoom; }
#app .feed-retry { display: inline-flex; min-height: 36px; }
#app #retry-feed { margin-top: 10px; }

#reader-view {
  --reader-nav-size: 54px;
  --reader-nav-height: calc(var(--reader-nav-size) + 10px + env(safe-area-inset-bottom, 0px));
  --brief-edge-gap: 16px;
  --brief-inline-inset: calc(var(--brief-edge-gap) + env(safe-area-inset-right, 0px) + var(--feed-scrollbar-width, 0px));
}
#app .daily-brief {
  position: absolute;
  z-index: 19;
  inset-inline-end: var(--brief-inline-inset);
  bottom: calc(var(--brief-edge-gap) + env(safe-area-inset-bottom, 0px));
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 3px 6px color-mix(in srgb, var(--accent) 30%, transparent),
              0 8px 18px color-mix(in srgb, var(--accent) 24%, transparent);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
#app .daily-brief[aria-disabled="true"] { opacity: .65; cursor: wait; }
#app #reader-view .page-content {
  padding-bottom: calc(8px + var(--reader-nav-height));
}
#app #reader-view .page:has(#review-actions:not([hidden])) > .page-content {
  padding-bottom: calc(78px + var(--reader-nav-height));
}
#app .summary-fab {
  inset-inline-end: var(--brief-inline-inset);
  bottom: calc(var(--reader-nav-height) + var(--brief-edge-gap));
}
#app .summary-fab .daily-brief { position: relative; inset: auto; }
#app .summary-fab[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  #app .summary-fab {
    transition: opacity 200ms ease, translate 200ms ease, scale 200ms ease, visibility 0s;
  }
  #app .summary-fab[aria-hidden="true"] {
    transition-delay: 0s, 0s, 0s, 200ms;
  }
  #app .summary-fab[aria-hidden="true"] { scale: .94; }
}
.summary-loader { display: none; --f7-preloader-size: 22px; --f7-preloader-color: var(--on-accent); }
.daily-brief[aria-busy="true"] > svg { display: none; }
.daily-brief[aria-busy="true"] .summary-loader { display: block; }
#app .empty:has(.feed-skeleton:not([hidden])) {
  display: block;
  margin: 0;
  padding: 0;
}
.feed-skeleton {
  --f7-skeleton-color: var(--skeleton);
  width: 100%;
}
.feed-skeleton-row {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 68px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--rule);
}
.feed-skeleton-row .skeleton-block { height: 11px; width: 84%; border-radius: 5px; }
.feed-skeleton-row .skeleton-block:last-child { width: 44%; }
.feed-skeleton-row:nth-child(even) .skeleton-block:first-child { width: 72%; }
@media (prefers-reduced-motion: no-preference) {
  .feed-skeleton-row .skeleton-block { animation: skeleton-pulse 1.25s ease-in-out infinite alternate; }
}
@keyframes skeleton-pulse { to { opacity: .5; } }
#app .board-viewport { position: relative; }

#app .top { height: auto; margin: 0; }
#app .top .navbar-inner {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  height: auto;
  padding: 0;
  transform: none;
}
#app .top::after { display: none; }
#app .feed-list .icon-checkbox { display: none; }
#app .settings-dialog { overflow: auto; }
#app .settings-dialog.popup {
  left: 50%; top: 50%; height: auto; margin: 0;
  transform: translate(-50%, calc(-50% + 12px)); opacity: 0;
  transition-property: transform, opacity;
}
#app .settings-dialog.popup.modal-in { transform: translate(-50%, -50%); opacity: 1; }
#app .settings-dialog.sheet-modal { height: auto; }
#app .settings-card, #app .font-preview { margin-inline: 0; }
#app .settings-card { margin-block: 0; }
#app .settings-dialog .sheet-modal-inner { height: auto; }
#app #feed-time-popover .popover-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: center;
  gap: 3px;
  padding: 10px;
}
#app .feed-time-detail { padding: 0; }
.feed-time-detail dl { display: grid; gap: 4px; margin: 0; }
.feed-time-detail dl > div { display: grid; grid-template-columns: 2.25em minmax(0, 1fr); gap: 4px; align-items: baseline; }
.feed-time-detail dt { color: var(--muted); font-size: .6875rem; }
.feed-time-detail dd { margin: 0; font-size: .75rem; font-variant-numeric: tabular-nums; }
.time-site-info { display: grid; justify-items: center; gap: 3px; }
.time-site-info img { display: block; width: 100%; height: auto; background: #fff; }
#weather-attribution { color: var(--muted); font-size: .625rem; }
#app #feed-time-popover {
  --f7-popover-width: min(280px, calc(100vw - 24px));
  --f7-popover-border-radius: 12px;
  --f7-popover-bg-color: var(--paper);
}
/* Override Framework7's iOS glass effect on the reader's dialogs. */
#app :is(.settings-dialog, .settings-dialog .card, #feed-time-popover, #feed-time-popover .popover-inner) {
  background-image: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#app :is(#feed-time-popover, #feed-time-popover .popover-inner) {
  background-color: var(--paper);
}
#app #feed-time-popover {
  border: 1px solid var(--rule);
}
#app :is(.popup-backdrop, .sheet-backdrop) {
  background: rgb(0 0 0 / 40%);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
@media (prefers-reduced-motion: reduce) {
  #app .settings-dialog { transition-duration: 1ms; }
  #app .preloader-inner, #app .preloader-inner-line { animation: none; }
}

#app .summary-fab .daily-brief > .icon { width: 26px; height: 26px; }
#app .settings-trigger .icon { width: 21px; height: 21px; }
#app .settings-close .icon { width: 18px; height: 18px; }
#app #feed-time .icon { width: .875rem; height: .875rem; }

.feed-item-meta {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 7px;
}
.feed-publisher {
  color: var(--muted);
  font-size: .8125rem;
  white-space: nowrap;
}
#time-source { white-space: pre-line; }

#app .reader-nav {
  position: absolute;
  inset: auto max(var(--reader-gutter), env(safe-area-inset-right, 0px))
    calc(10px + env(safe-area-inset-bottom, 0px)) max(var(--reader-gutter), env(safe-area-inset-left, 0px));
  z-index: 21;
  width: auto;
  max-width: 1060px;
  height: var(--reader-nav-size);
  margin-inline: auto;
  border: 1px solid color-mix(in srgb, var(--paper) 58%, var(--rule));
  border-radius: 999px;
  background: var(--paper);
  box-shadow: inset 0 1px 2px color-mix(in srgb, white 24%, transparent),
    0 6px 22px rgb(0 0 0 / 15%);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #app .reader-nav {
    background: color-mix(in srgb, var(--paper) 54%, transparent);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    backdrop-filter: blur(15px) saturate(150%);
  }
}
#app .reader-nav::before, #app .reader-nav::after { display: none; }
#app .reader-nav .toolbar-inner {
  position: static;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  padding: 4px;
  gap: 0;
  overflow: visible;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
}
#app #review-actions {
  position: absolute;
  z-index: 22;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--reader-nav-height) + 20px);
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Keep the group in the render tree only when motion is allowed, so exit can fade. */
@media (prefers-reduced-motion: no-preference) {
  #app #review-actions {
    opacity: 1;
    --review-fade: 85ms;
    visibility: visible;
    transition: opacity var(--review-fade) ease-out, visibility 0s;
  }
  #app #review-actions[hidden] {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition-delay: 0s, var(--review-fade);
  }
}
#app #review-actions .fab {
  position: static;
  --f7-fab-bg-color: var(--accent);
  --f7-fab-text-color: var(--on-accent);
  --f7-fab-border-radius: 999px;
}
#app #review-actions .fab > :is(button, a) {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 68px;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--f7-fab-border-radius);
  background: var(--f7-fab-bg-color);
  color: var(--f7-fab-text-color);
  box-shadow: 0 3px 10px rgb(0 0 0 / 15%);
  backdrop-filter: none;
  font-size: .9375rem;
  font-weight: 650;
  text-decoration: none;
}
#app #review-actions .review-clear-fab {
  --f7-fab-bg-color: var(--panel);
  --f7-fab-text-color: var(--ink);
}
#app .reader-nav .tab-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  overflow: visible;
  height: 100%;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}
.review-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding-inline: 5px;
  line-height: 1;
  border-radius: 999px;
  background: var(--on-accent);
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
#app .reader-nav .tab-link-active {
  color: var(--accent);
}
#app .reader-nav-icon { position: relative; display: grid; place-items: center; flex: none; }
#app .reader-nav .icon { width: 22px; height: 22px; }
#app .reader-nav .reader-nav-icon-filled { display: none; }
#app .reader-nav .tab-link-active .reader-nav-icon::after {
  content: '';
  position: absolute;
  inset-block-end: -7px;
  inset-inline-start: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
#app .reader-nav .tabbar-label { font-size: .6875rem; white-space: nowrap; }
#app .reader-nav .channel-new-count { inset: -4px auto auto calc(100% - 5px); }
#app .board.home-feed { min-height: 52vh; margin-bottom: 0; }

#app .reader-nav.is-scroll-hidden:not(:has(:focus-visible)) {
  opacity: 0;
  translate: 0 18px;
  visibility: hidden;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  #app .reader-nav {
    --reader-nav-transition-duration: 220ms;
    transition:
      opacity var(--reader-nav-transition-duration) ease,
      translate var(--reader-nav-transition-duration) ease,
      visibility 0s;
  }
  #app .reader-nav.is-scroll-hidden:not(:has(:focus-visible)) {
    transition-delay: 0s, 0s, var(--reader-nav-transition-duration);
  }
}

#app .top .title { grid-column: 1; justify-self: start; margin: 0; text-align: left; color: var(--ink); font-size: 1.125rem; font-weight: 700; }

#app .top .navbar-heading {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
#app .top .home-wordmark { display: none; }
#app .top:not(.source-navbar) .navbar-heading { align-items: baseline; }
#app .top:not(.source-navbar) .home-wordmark {
  display: inline-block;
  flex: none;
  color: var(--accent);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
}
#app .top.source-navbar .title { font-size: 1.5rem; font-weight: 700; }

#app .top .title {
  position: static;
  left: auto;
  right: auto;
  transform: none !important;
  min-width: 0;
  max-width: 100%;
}
#app .top .right {
  position: static;
  transform: none !important;
  background: transparent;
  box-shadow: none;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#app .top .right::before, #app .top .right::after { display: none; }
#app .top .settings-trigger {
  background: transparent;
  box-shadow: none;
}
#app .top .settings-trigger:hover {
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}
@media (pointer: fine) {
  #app #reader-view > .page > .page-content {
    padding-top: 8px;
  }
}
@media (min-width: 1025px), (pointer: fine) {
  #app #reader-view > .page:has([data-channel="home"][aria-pressed="true"]) > .page-content {
    padding-top: 8px;
  }
  #app .compact-reader:has(.board:not(.home-feed)) {
    padding-top: 4px;
  }
}


@media (pointer: coarse) {
  #app .top .navbar-inner { width: min(calc(100% - var(--reader-gutter) - var(--reader-gutter)), 760px); }
  #home-edition {
    width: min(100%, 760px);
    margin-inline: auto;
  }
}
@media (pointer: coarse) and (max-width: 620px) {
  #app .page:has(.reader-nav [data-channel="zhihu"][aria-pressed="true"]) .compact-reader {
    padding-top: 14px;
  }
  #app .page:has(.reader-nav [data-channel="zaobao"][aria-pressed="true"]) .compact-reader {
    padding-top: 7px;
  }
}
#home-edition { font-size: var(--reading-font-size, 1rem); }
#app .compact-reader:has(.home-feed) { padding-top: 4px; }
#home-edition > .edition-section:first-child h2 { padding-top: 14px; }
.edition-section + .edition-section { margin-top: 20px; }
.edition-section h2 {
  margin: 0;
  padding: 8px 0 10px;
  border-bottom: 2px solid var(--accent);
  font-size: 1.25em;
}
.edition-section ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: edition-rank;
}
.edition-section li {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
  gap: 12px;
  padding-block: 14px;
  padding-inline-end: 6px;
  border-bottom: 1px solid var(--rule);
  counter-increment: edition-rank;
}
.edition-section > ol > li:last-child { border-bottom: 0; }
.edition-section li:has(.edition-select) { position: relative; }
.edition-select { position: absolute; inset: 0; cursor: pointer; }
#app .feed-list li.selected .item-content,
#app .edition-section li:has(.edition-select input:checked) {
  background-color: var(--review-selection-bg);
}
.edition-section li:has(.edition-select input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.edition-section li::before {
  content: counter(edition-rank);
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}
.edition-section h3 { margin: 0; font-size: 1.0625em; line-height: 1.45; }
.edition-section p { margin: 5px 0 0; color: var(--detail-ink); line-height: 1.65; }
.edition-section .edition-summary { font-size: .875em; }
.edition-section .edition-sources { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .875em; color: var(--accent); }
.edition-section .edition-sources a {
  position: relative;
  z-index: 1;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .15em;
}
.edition-section .edition-sources a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-entry {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}
.site-entry-card {
  width: min(100%, 360px);
}
.site-entry-card h1 { margin: 0 0 24px; font-size: 1.5rem; }
.site-entry-card label { display: block; margin-bottom: 8px; }
.site-entry-card input,
.site-entry-card button {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
}
.site-entry-card input {
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--ink);
}
.site-entry-card p { color: var(--error-ink); }
.site-entry-card p:empty { margin: 0 0 16px; }
.site-entry-card button {
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
}
