/* Homepage, 我的片单 and /s/ search pages. Paper, ink and warm orange; lines, type and
   posters carry the hierarchy instead of cards, shadows or gradients. */
:root {
  color-scheme: light dark;
  --bg: #f3efe8; --panel: #fffdf8; --ink: #17151a; --muted: #6c6670; --soft-ink: #4d484e;
  --line: rgba(23, 21, 26, .17); --field: #a6a09a; --accent: #cb5a2b; --action: #a74119;
  --rule: var(--ink); --on-action: #fffdf8; --action-hover: #8f3713; --poster-bg: #e5dfd6;
  --skeleton: rgba(23, 21, 26, .05); --skeleton-pulse: rgba(23, 21, 26, .14); --toast-line: #8e8790; --backdrop: rgba(23, 21, 26, .3);
  --selection: #ecc9b6;
}
/* Dark follows the system: the same pages after the lights go down. Warm near-black like a
   screening room, cream text, and amber where the paper theme uses orange. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #13110f; --panel: #1d1a16; --ink: #f2eadd; --muted: #a89d8d; --soft-ink: #d3c8b7;
    --line: rgba(242, 234, 221, .13); --field: #5f574d; --accent: #d9963f; --action: #e9a84c;
    --rule: rgba(242, 234, 221, .42); --on-action: #1b1307; --action-hover: #f4c070; --poster-bg: #27231e;
    --skeleton: rgba(242, 234, 221, .06); --skeleton-pulse: rgba(242, 234, 221, .14); --toast-line: #6f665c; --backdrop: rgba(0, 0, 0, .6);
    --selection: rgba(233, 168, 76, .35);
  }
}
::selection { background: var(--selection); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
a, button, input, summary { touch-action: manipulation; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.35; }
p, h1, h2, h3, strong, dd { overflow-wrap: anywhere; }
img { display: block; max-width: 100%; }
:where(a, button, input, summary, [tabindex]):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
:where(h1, main)[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 30; padding: 10px 14px; background: var(--panel); border: 1px solid var(--rule); }
.skip-link:focus { top: 8px; }
.page-shell { width: min(1184px, calc(100% - 64px)); margin: 0 auto; }

/* Masthead: brand, one search field, 我的片单 */
.masthead { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 48px; padding: 18px 0 16px; border-bottom: 1px solid var(--rule); }
.brand { font-size: 28px; font-weight: 800; letter-spacing: -1px; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--action); font-size: 16px; font-weight: 500; letter-spacing: 0; }
.search-form { display: flex; min-width: 0; min-height: 48px; border: 1px solid var(--field); border-radius: 4px; background: var(--panel); }
.search-form:focus-within { border-color: var(--ink); }
.search-form input { flex: 1; min-width: 0; width: 100%; padding: 10px 15px; border: 0; background: none; border-radius: 3px 0 0 3px; }
.search-form input:focus-visible { outline: none; }
.search-form input::-webkit-search-cancel-button { cursor: pointer; filter: grayscale(1); }
.search-form input::placeholder { color: var(--muted); opacity: 1; }
.search-form button { flex-shrink: 0; min-height: 46px; padding: 0 22px; background: var(--action); color: var(--on-action); font-weight: 600; border-radius: 0 3px 3px 0; }
.search-form button:hover { background: var(--action-hover); }
.library-link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.library-link[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
.saved-count { color: var(--action); font-size: 13px; }
.storage-warning, .notice { margin: 14px 0; padding: 6px 12px; border-left: 2px solid var(--accent); color: var(--soft-ink); font-size: 13px; }
.notice:has(.retry-button, .retry-link) { padding-block: 0; }
.notice .retry-button, .notice .retry-link { display: inline-flex; align-items: center; min-height: 40px; margin-left: 6px; color: var(--action); font-weight: 600; vertical-align: middle; }

/* Home */
.recent-summary { display: flex; align-items: center; gap: 18px; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 13px; }
.summary-label, .summary-source { color: var(--muted); white-space: nowrap; }
.summary-title { min-width: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.recent-summary a { min-height: 44px; display: inline-flex; align-items: center; flex-shrink: 0; color: var(--action); text-decoration: none; }
.recent-summary a:hover { text-decoration: underline; }
.recent-summary .summary-all { margin-left: auto; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 24px 0 20px; }
.section-head h1 { font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 30px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.edition { color: var(--muted); font-size: 12px; line-height: 1.7; text-align: right; }
.film-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 190px)); justify-content: space-between; gap: 34px 25px; }
.film { display: flex; flex-direction: column; min-width: 0; }
.poster-link { display: block; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: var(--poster-bg); border-radius: 2px; }
.poster-link img { width: 100%; height: 100%; object-fit: cover; }
.poster-link.image-missing { display: grid; place-items: center; color: var(--muted); font-size: 13px; text-decoration: none; }
.film-title { margin-top: 12px; font-size: 17px; font-weight: 700; }
.film-meta { margin-top: 2px; color: var(--muted); font-size: 12px; }
.film-note { margin-top: 8px; color: var(--soft-ink); font-size: 13px; line-height: 1.65; }
.film-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; border-bottom: 1px solid var(--line); }
.film-search { min-height: 44px; display: inline-flex; align-items: center; color: var(--action); font-size: 13px; font-weight: 600; text-decoration: none; }
.film-search:hover, .text-links a:hover { text-decoration: underline; }
.save-button { min-height: 44px; padding: 0 2px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.save-button:hover, .save-button[aria-pressed="true"] { color: var(--action); }
.tonight-entry { margin-top: 44px; }
.tonight-entry-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.tonight-entry-head h2 { font-size: 21px; }
.tonight-entry-head a { min-height: 44px; display: inline-flex; align-items: center; color: var(--action); font-size: 14px; font-weight: 700; text-decoration: none; }
.tonight-entry-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.situations { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.situation { display: block; min-width: 0; color: inherit; text-decoration: none; }
.situation-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; overflow: hidden; border-radius: 3px; background: var(--poster-bg); }
.situation-strip img { display: block; width: 100%; height: auto; aspect-ratio: 270 / 397; object-fit: cover; background: var(--poster-bg); }
.situation:hover .situation-strip img { opacity: .88; }
.situation:hover .situation-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.situation-name { display: block; margin-top: 10px; font-size: 17px; font-weight: 700; line-height: 1.3; }
.situation-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.browse-more { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--rule); }
.browse-block h2 { font-size: 18px; }
.browse-block p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.text-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 6px; }
.text-links a { min-height: 40px; display: inline-flex; align-items: center; color: var(--action); text-decoration: none; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 44px; padding: 16px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.site-footer a { display: inline-flex; min-height: 44px; align-items: center; }

/* Search results: same markup from app.js and the Worker */
.back-link { min-height: 44px; display: inline-flex; align-items: center; margin-top: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.back-link:hover { color: var(--ink); }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding-bottom: 14px; }
.results-heading { min-width: 0; }
.results-heading h1 { font-size: 26px; }
.results-summary { margin-top: 4px; color: var(--muted); font-size: 13px; }
.results-tools { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.save-outline { padding: 0 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--ink); font-size: 13px; }
.source-preferences { position: relative; font-size: 13px; }
.source-preferences summary { min-height: 44px; display: flex; align-items: center; color: var(--muted); cursor: pointer; }
.source-preferences[open] summary { color: var(--ink); }
.preferences-panel { position: absolute; z-index: 5; right: 0; top: calc(100% + 4px); width: min(340px, calc(100vw - 32px)); padding: 14px; border: 1px solid var(--rule); border-radius: 3px; background: var(--panel); }
.preferences-panel p { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
[data-source-preferences] { display: flex; flex-wrap: wrap; gap: 8px; }
[data-source-preferences] button { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; font-size: 13px; }
[data-source-preferences] [aria-pressed="true"] { border-color: var(--accent); color: var(--action); font-weight: 600; }
.result-group { margin: 22px 0 30px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.group-title { font-size: 17px; }
.group-count { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.group-description { margin: 8px 0 2px; color: var(--muted); font-size: 13px; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 128px; gap: 24px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.result-row > * { min-width: 0; }
.result-row:hover { background: var(--panel); box-shadow: -8px 0 var(--panel), 8px 0 var(--panel); }
.result-main { display: grid; gap: 3px; }
.result-title { font-size: 17px; font-weight: 600; }
.result-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.result-source { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; font-size: 14px; }
.site-icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.link-kind { flex-basis: 100%; padding-left: 24px; color: var(--muted); font-size: 12px; }
.result-action { justify-self: end; color: var(--action); font-size: 14px; font-weight: 600; white-space: nowrap; }
.result-row[data-kind="search"] .result-title { font-weight: 500; }
.match-note { margin: 18px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--soft-ink); font-size: 14px; }
.result-match .result-title { color: var(--ink); }
.match-tag { display: block; margin-top: 2px; color: var(--action); font-size: 12px; font-weight: 700; }
.result-row[data-kind="search"] .result-action { padding: 6px 12px; border: 1px solid var(--field); border-radius: 3px; background: var(--panel); color: var(--ink); font-weight: 500; font-size: 13px; }
.source-note { margin: 26px 0; padding-left: 14px; border-left: 2px solid var(--accent); color: var(--muted); font-size: 13px; }
.empty-state { margin: 22px 0 8px; }
.empty-state h2 { font-size: 21px; }
.empty-state p { margin-top: 6px; color: var(--muted); }
.retry-button { min-height: 44px; }
.empty-state .retry-button { margin-top: 14px; padding: 0 18px; border: 1px solid var(--field); border-radius: 3px; background: var(--panel); font-weight: 600; }
.loading-state { display: grid; gap: 14px; padding: 22px 0 60px; border-top: 1px solid var(--rule); }
.loading-state span { display: block; height: 44px; background: var(--skeleton); border-radius: 2px; }
/* A light band sweeps across from the first frame, so even a short wait reads as working. */
@media (prefers-reduced-motion: no-preference) {
  .loading-state span { background: linear-gradient(90deg, var(--skeleton) 30%, var(--skeleton-pulse) 50%, var(--skeleton) 70%) 0 0 / 300% 100%;
    animation: loading-sweep 1s linear infinite; }
  .loading-state span:nth-child(2) { animation-delay: -.12s; }
  .loading-state span:nth-child(3) { animation-delay: -.24s; }
  @keyframes loading-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
}

/* Leaving for a /s/ page (pending-nav.js): progress shows on the click, before the network answers. */
.is-navigating, .is-navigating * { cursor: progress; }
.is-navigating body::before { content: ""; position: fixed; z-index: 40; top: 0; left: 0; width: 100%; height: 3px; background: var(--accent);
  transform-origin: left; transform: scaleX(.5); }
@media (prefers-reduced-motion: no-preference) {
  .is-navigating body::before { animation: nav-progress 3s cubic-bezier(.1, .8, .2, 1) forwards; }
  @keyframes nav-progress { from { transform: scaleX(.08); } to { transform: scaleX(.92); } }
}
.about-site { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--rule); }
.about-intro h2 { font-size: 18px; }
.about-lead { margin-top: 10px; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 21px; font-weight: 700; line-height: 1.45; }
.about-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.about-sites { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.about-sites li { padding: 3px 9px; border: 1px solid var(--line); border-radius: 3px; color: var(--soft-ink); font-size: 12px; }
.about-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 36px; margin: 0; }
.about-faq div { padding-top: 12px; border-top: 1px solid var(--line); }
/* Three answers: the first, what the site is for, runs across both columns. */
.about-faq div:first-child { grid-column: 1 / -1; }
.about-faq dt { font-size: 15px; font-weight: 700; }
.about-faq dd { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.about-faq a { display: flex; align-items: center; width: fit-content; min-height: 44px; color: var(--action); font-weight: 600; text-decoration: none; white-space: nowrap; }
.about-faq a:hover { text-decoration: underline; text-underline-offset: 3px; }
.title-facts { margin: 4px 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); font-size: 14px; }
.title-facts h2 { font-size: 15px; }
.title-facts p { margin-top: 6px; color: var(--soft-ink); }
.title-facts .title-facts-meta { color: var(--muted); }
.title-facts-meta span { white-space: nowrap; }
.related-links, .faq { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.related-links h2, .faq h2 { font-size: 17px; }
.faq dl { display: grid; gap: 4px; margin-top: 10px; font-size: 14px; }
.faq dt { font-weight: 600; margin-top: 8px; }
.faq dd { color: var(--muted); }

/* 我的片单 */
.library-view { margin-top: 26px; }
.library-view h1 { font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 30px; }
.library-intro { margin-top: 6px; color: var(--muted); font-size: 13px; }
.library-bar { display: flex; align-items: center; gap: 20px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.library-tabs { display: flex; gap: 28px; }
.library-tabs a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.library-tabs a[aria-current="page"] { color: var(--action); box-shadow: inset 0 -2px var(--accent); font-weight: 600; }
.history-clear { margin-left: auto; min-height: 44px; color: var(--muted); font-size: 13px; }
.history-clear:hover { color: var(--ink); }
.library-hint { margin-top: 10px; color: var(--muted); font-size: 12px; }
.history-list { margin: 4px 0 0; padding: 0; list-style: none; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.history-copy { display: grid; gap: 2px; min-width: 0; }
.history-title { font-size: 18px; }
.history-meta { color: var(--muted); font-size: 13px; }
.history-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0 20px; }
.history-link { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; text-decoration: none; white-space: nowrap; }
.history-link:hover { text-decoration: underline; }
.history-primary, a.history-link { color: var(--action); }
.history-primary { font-weight: 600; }
.history-save, .history-remove { color: var(--muted); }
.history-save[aria-pressed="true"] { color: var(--action); }
.history-empty { padding: 32px 0; color: var(--muted); }
.history-toast { position: fixed; z-index: 20; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; width: max-content; max-width: calc(100% - 24px); padding: 8px 10px 8px 16px; background: var(--ink); color: var(--panel); border-radius: 3px; font-size: 13px; }
.history-toast .history-button { min-height: 40px; padding: 0 12px; border: 1px solid var(--toast-line); border-radius: 3px; flex-shrink: 0; }
.history-dialog { max-width: min(460px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); color: var(--ink); }
.history-dialog::backdrop { background: var(--backdrop); }
.history-dialog h2 { margin-bottom: 10px; font-size: 22px; }
.history-dialog p { color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.dialog-actions .history-button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 3px; }
.dialog-actions .history-danger { background: var(--action); border-color: var(--action); color: var(--on-action); font-weight: 600; }

@media (max-width: 1100px) {
  .masthead { gap: 24px; }
  .film-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 22px; }
  .summary-source { display: none; }
}
@media (max-width: 700px) {
  body { font-size: 14px; }
  .page-shell { width: calc(100% - 32px); }
  .masthead { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 12px 0 14px; }
  .brand { font-size: 25px; }
  .brand span { font-size: 14px; }
  .library-link { font-size: 14px; }
  .search-form { grid-row: 2; grid-column: 1 / -1; min-height: 46px; }
  .search-form input { padding: 9px 12px; font-size: 16px; }
  .search-form button { min-height: 44px; padding: 0 16px; font-size: 15px; }
  .recent-summary { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding: 4px 0; font-size: 12px; }
  .summary-title { max-width: 45vw; }
  .section-head { margin: 20px 0 16px; gap: 12px; }
  .section-head h1 { font-size: 25px; }
  .edition { font-size: 11px; }
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
  .film-title { margin-top: 9px; font-size: 16px; }
  .film-meta { font-size: 11px; }
  .film-note { font-size: 12px; }
  .film-search, .save-button { font-size: 12px; }
  .tonight-entry { margin-top: 34px; }
  .tonight-entry-head h2 { font-size: 18px; }
  .situations { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .situation-name { font-size: 15px; }
  .browse-more { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 30px; padding-top: 18px; }
  .browse-block h2 { font-size: 17px; }
  .about-site { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 34px; padding-top: 18px; }
  .about-lead { font-size: 19px; }
  .about-faq { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .site-footer { display: block; margin-top: 30px; font-size: 11px; }
  .site-footer p + p { margin-top: 2px; }
  .results-head { flex-direction: column; align-items: stretch; gap: 6px; padding-bottom: 6px; }
  .results-heading h1 { font-size: 23px; }
  .results-tools { justify-content: space-between; }
  .preferences-panel { right: auto; left: 0; }
  .source-preferences:last-child .preferences-panel { left: auto; right: 0; }
  .result-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 0; }
  .result-main { grid-column: 1 / -1; }
  .result-title { font-size: 16px; }
  .result-meta { font-size: 12px; }
  .result-source { font-size: 13px; }
  .link-kind { flex-basis: auto; padding-left: 0; font-size: 11px; }
  .result-action { font-size: 13px; }
  .group-description, .source-note { font-size: 12px; }
  .library-view { margin-top: 20px; }
  .library-view h1 { font-size: 26px; }
  .library-tabs { gap: 22px; }
  .history-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 0 6px; }
  .history-title { font-size: 17px; }
  .history-meta { font-size: 12px; }
  .history-actions { gap: 0 18px; }
}
@media (max-width: 360px) {
  .section-head h1 { font-size: 22px; }
  .edition { white-space: nowrap; }
  .search-form input { padding: 9px 10px; }
  .search-form button { padding: 0 13px; }
}
@media (prefers-reduced-motion: no-preference) {
  .poster-link img { transition: filter .15s; }
  .poster-link:hover img { filter: brightness(1.05); }
}

/* 爱壹帆 → 酷播 address change: history note and search-term card */
.move-tip { margin: 14px 0; padding: 10px 14px; border-left: 2px solid var(--accent); background: var(--panel); color: var(--soft-ink); font-size: 13px; }
.move-tip .move-title { display: block; color: var(--ink); font-size: 14px; }
.move-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.move-links a, .move-links button { display: inline-flex; align-items: center; min-height: 44px; color: var(--action); font-weight: 600; text-decoration: none; }
.move-links a:hover, .move-links button:hover { text-decoration: underline; }
.move-links .move-dismiss { color: var(--muted); }

/* Static guide pages (/guide/*) */
.guide { max-width: 720px; padding-top: 18px; }
.guide h1 { margin: 10px 0 8px; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: 30px; }
.guide-lead { font-size: 16px; }
.guide-section { margin-top: 28px; }
.guide-section h2 { font-size: 17px; margin-bottom: 6px; }
.guide-section ol { margin: 0; padding-left: 22px; }
.guide-section li + li { margin-top: 4px; }
/* The search-term card already says it; don't repeat the history note above it. */
body:has(#search-results:not([hidden]) #move-notice:not([hidden])) [data-move-tip] { display: none; }

/* Dark theme only: the homepage's lead poster lights the top of the page. */
.screen-glow { display: none; }
@media (prefers-color-scheme: dark) {
  .screen-glow { display: block; position: absolute; z-index: -1; inset: 0 0 auto; height: 640px; overflow: hidden; pointer-events: none;
    -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); }
  .screen-glow::before { content: ""; position: absolute; inset: -80px; background: var(--lead-poster) center 30% / cover; filter: blur(56px) saturate(1.25) brightness(.42); }
  .poster-link { box-shadow: 0 0 0 1px rgba(242, 234, 221, .06); }
  .site-icon { padding: 1px; background: #f2eadd; border-radius: 3px; }
}
@media (prefers-color-scheme: dark) and (prefers-reduced-motion: no-preference) {
  .poster-link { transition: box-shadow .25s cubic-bezier(.2, .8, .2, 1); }
  .poster-link:hover { box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .9), 0 0 56px -12px rgba(233, 168, 76, .4); }
}

/* iPhone Safari only: how to add the site to the home screen (home-screen-hint.js). */
.home-hint {
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: var(--panel); color: var(--soft-ink); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  box-shadow: 0 6px 24px var(--backdrop); font-size: 13px; line-height: 1.45;
}
.home-hint img { flex: none; width: 40px; height: 40px; border-radius: 9px; }
.home-hint p { margin: 0; flex: 1; min-width: 0; }
.home-hint strong { display: block; color: var(--ink); font-size: 14px; }
.home-hint-close {
  flex: none; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); background: transparent;
  color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
}
body:has(.home-hint) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
