@charset "UTF-8";

/* ============================================================
   多多画廊 · 编辑型壁纸浏览器
   纸感、墨色、朱红；大字号中文 + Fraunces 英文/数字。
   ============================================================ */

:root {
  --paper: #f2ecdd;
  --paper-2: #faf6ec;
  --paper-3: #e6ddca;
  --paper-4: #d8ccb4;
  --ink: #171410;
  --ink-2: #3b352b;
  --ink-3: #6f6657;
  --muted: #948a78;
  --line: rgba(23, 20, 16, 0.14);
  --line-strong: rgba(23, 20, 16, 0.26);
  --accent: #ce3f1a;
  --accent-deep: #a72f0e;
  --pine: #254a3c;
  --viewer: #0b0a08;
  --rail-w: 232px;
  --pad: clamp(20px, 4vw, 64px);
  --radius: 2px;
  --mbar-h: calc(60px + env(safe-area-inset-top, 0px));
  --tab-h: calc(62px + env(safe-area-inset-bottom, 0px));
  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  --font-sans: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 0.75, 0.24, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

html.is-viewer-open,
html.is-viewer-open body {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
  flex: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------ 纹理 / 进度 / 跳转 ------------------------------ */

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 90;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ------------------------------ 应用骨架 ------------------------------ */

.shell {
  min-height: 100dvh;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  padding: 28px 22px 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.55), rgba(242, 236, 221, 0.12) 42%, rgba(230, 221, 202, 0.28)),
    var(--paper);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  border-radius: 1px;
  box-shadow: 4px 4px 0 var(--paper-3), 4px 4px 0 1px var(--line);
  transition: transform 0.35s var(--ease), background 0.25s;
}

.brand:hover .brand__mark {
  transform: rotate(-4deg);
  background: var(--accent);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__text strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand__text small {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.rail__eyebrow {
  margin: 46px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.rail__nav {
  display: flex;
  flex-direction: column;
}

.rail-link {
  position: relative;
  display: grid;
  grid-template-columns: 22px 20px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 8px 10px 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s, padding 0.2s var(--ease);
}

.rail-link:last-child {
  border-bottom: 1px solid var(--line);
}

.rail-link:hover {
  background: var(--paper-2);
  padding-left: 14px;
  color: var(--ink);
}

.rail-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: transparent;
  transition: background 0.2s;
}

.rail-link.is-active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(206, 63, 26, 0.06), transparent 70%);
}

.rail-link.is-active::before {
  background: var(--accent);
}

.rail-link__index {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.rail-link.is-active .rail-link__index {
  color: var(--accent);
}

.rail-link__icon {
  color: currentColor;
  opacity: 0.78;
}

.rail-link__label {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.rail-link__label b {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.rail-link__label small {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.rail-link__count {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.rail-link__count.is-empty {
  background: var(--paper-3);
  color: var(--muted);
}

.rail-link__arrow {
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
  color: var(--muted);
}

.rail-link:hover .rail-link__arrow,
.rail-link.is-active .rail-link__arrow {
  opacity: 1;
  transform: none;
}

.rail__foot {
  margin-top: auto;
  padding-top: 22px;
}

.live {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.live__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(37, 74, 60, 0.35);
}

.live[data-state="ok"] .live__dot {
  background: var(--pine);
  animation: livePulse 2.4s infinite;
}

.live[data-state="ok"] .live__text {
  color: var(--pine);
}

.live[data-state="loading"] .live__dot {
  background: var(--accent);
  animation: livePulse 1.1s infinite;
}

.live[data-state="loading"] .live__text {
  color: var(--accent);
}

.live[data-state="error"] .live__dot {
  background: var(--accent-deep);
}

.live[data-state="error"] .live__text {
  color: var(--accent-deep);
}

.live__text {
  margin-left: auto;
  color: var(--ink-3);
  font-weight: 600;
}

.rail__note {
  margin-top: 18px;
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted);
}

.rail__credit {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.14em;
  color: rgba(111, 102, 87, 0.6);
}

/* ------------------------------ 移动端栏位 ------------------------------ */

.mobile-bar {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--mbar-h);
  padding: env(safe-area-inset-top, 0px) 18px 0;
  align-items: center;
  justify-content: space-between;
  background: rgba(242, 236, 221, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand--mobile .brand__mark {
  width: 34px;
  height: 34px;
  font-size: 18px;
  box-shadow: 3px 3px 0 var(--paper-3), 3px 3px 0 1px var(--line);
}

.brand--mobile .brand__text strong {
  font-size: 15px;
}

.brand--mobile .brand__text small {
  font-size: 7px;
}

.mobile-bar__search {
  color: var(--ink);
}

.tabbar {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  height: var(--tab-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  grid-template-columns: repeat(5, 1fr);
  background: rgba(242, 236, 221, 0.93);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  transition: color 0.2s;
}

.tab__icon {
  transition: transform 0.25s var(--ease);
}

.tab__label {
  font-size: 9px;
  letter-spacing: 0.05em;
}

.tab.is-active {
  color: var(--ink);
}

.tab.is-active .tab__icon {
  transform: translateY(-2px);
  color: var(--accent);
}

.tab.is-active::after {
  content: "";
  position: absolute;
  bottom: calc(5px + env(safe-area-inset-bottom, 0px));
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.tab__badge {
  position: absolute;
  top: 7px;
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

.tab__badge.is-empty {
  display: none;
}

/* ------------------------------ 主区域 ------------------------------ */

.main {
  --content-cap: 2200px;
  margin-left: calc(
    var(--rail-w) + max(0px, (100% - var(--rail-w) - var(--content-cap)) / 2)
  );
  padding: 48px var(--pad) 120px;
  max-width: var(--content-cap);
  min-height: 100dvh;
}

.main:focus {
  outline: none;
}

.is-routing .main {
  opacity: 0.72;
  transition: opacity 0.15s;
}

.noscript {
  padding: 80px 0;
  text-align: center;
  font-size: 16px;
  color: var(--ink-3);
}

/* ------------------------------ 通用排版 ------------------------------ */

.kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.kicker__index {
  color: var(--accent);
  font-weight: 700;
}

.kicker__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.kicker__sep {
  opacity: 0.4;
}

.kicker--light {
  color: rgba(250, 246, 236, 0.72);
}

.kicker--light .kicker__index {
  color: #f0a38b;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.52fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.page-head__title {
  margin-top: 18px;
  font-family: var(--font-sans);
  font-size: clamp(2.9rem, 6.6vw, 6.6rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.052em;
  text-wrap: balance;
}

.page-head__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 4px;
}

.page-head__lede {
  max-width: 42ch;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-3);
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-foot {
  margin-top: 56px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* ------------------------------ 按钮 / 链接 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 20px -10px rgba(206, 63, 26, 0.7);
}

.btn--ghost:hover {
  background: var(--paper-2);
  border-color: var(--ink);
}

.btn--light {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.btn--light:hover {
  background: #fffdf7;
}

.btn--ghost-light {
  border-color: rgba(250, 246, 236, 0.38);
  color: var(--paper);
}

.btn--ghost-light:hover {
  background: rgba(250, 246, 236, 0.12);
  border-color: var(--paper);
}

.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.text-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.text-btn--danger {
  color: var(--accent-deep);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.icon-btn:hover {
  background: var(--paper-2);
  border-color: var(--line);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.link-arrow:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ------------------------------ 首页 Hero ------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, 0.96fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  min-height: min(760px, calc(100dvh - 150px));
  padding: 18px 0 30px;
}

.hero__copy {
  max-width: 640px;
}

.hero__kicker {
  margin-bottom: 26px;
}

.hero__title {
  font-size: clamp(3.3rem, 7.6vw, 8.4rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.hero__accent {
  color: var(--accent);
}

.hero__lede {
  max-width: 50ch;
  margin: 30px 0 32px;
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-3);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hero__meta b {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.hero__meta-sep {
  color: var(--line-strong);
}

.hero__collage {
  position: relative;
  height: clamp(430px, 62vh, 680px);
}

.hero__frame {
  position: absolute;
  display: block;
  padding: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 50px -30px rgba(23, 20, 16, 0.55);
  transition: transform 0.45s var(--ease), box-shadow 0.45s, z-index 0s;
}

.hero__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__frame--a {
  left: 0;
  top: 7%;
  width: 46%;
  height: 56%;
  z-index: 2;
  transform: rotate(-4deg);
}

.hero__frame--b {
  right: 4%;
  top: 0;
  width: 41%;
  height: 50%;
  z-index: 1;
  transform: rotate(3deg);
}

.hero__frame--c {
  left: 26%;
  bottom: 2%;
  width: 38%;
  height: 47%;
  z-index: 3;
  transform: rotate(-1.5deg);
}

.hero__frame:hover {
  transform: rotate(0) scale(1.025);
  z-index: 8;
  box-shadow: 0 30px 70px -30px rgba(23, 20, 16, 0.62);
}

.hero__frame-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}

.hero__frame-caption b {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero__frame::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), transparent 38%);
  pointer-events: none;
}

.hero__frame-caption {
  z-index: 1;
}

.hero__frame-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(23, 20, 16, 0.06) 0 1px, transparent 1px 9px),
    var(--paper-3);
  font-size: 44px;
  font-weight: 800;
  color: var(--ink-3);
}

.hero__stamp {
  position: absolute;
  right: 0;
  bottom: 6%;
  width: 94px;
  height: 94px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  transform: rotate(9deg);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.06em;
  z-index: 4;
}

.hero__stamp::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(206, 63, 26, 0.55);
  border-radius: 50%;
}

.hero__stamp small {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 6px;
  letter-spacing: 0.1em;
}

.hero__figure-no {
  position: absolute;
  left: 0;
  bottom: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.hero__frame.has-failed-img::after,
.topic-hero.has-failed-img .topic-hero__shade {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 60%);
}

/* ------------------------------ 走马灯 ------------------------------ */

.ticker {
  margin: 18px calc(-1 * var(--pad)) 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: rgba(250, 246, 236, 0.45);
}

.ticker__line {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  width: max-content;
  animation: marquee 46s linear infinite;
}

.ticker:hover .ticker__line {
  animation-play-state: paused;
}

.ticker__item {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  white-space: nowrap;
}

.ticker__star {
  color: var(--accent);
  font-size: 9px;
}

/* ------------------------------ 首页区块 ------------------------------ */

.home-section {
  margin-top: clamp(48px, 7vw, 88px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.section-head__kicker {
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head__title {
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.feed-count {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.topics-toolbar {
  padding-top: 10px;
}

.topics-toolbar__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 340px;
  min-width: min(260px, 100%);
  height: 42px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-field:focus-within {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--paper-3);
}

.filter-field > svg {
  color: var(--muted);
}

.filter-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline: none;
}

.filter-input::placeholder {
  color: var(--muted);
}

.filter-clear {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.filter-clear:hover {
  background: var(--paper-3);
  color: var(--ink);
}

.sort-host {
  display: inline-flex;
}

.topics-toolbar .feed-count {
  margin-left: auto;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 2px;
}

.live-badge__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulse 1.8s infinite;
}

/* ------------------------------ 分类横滑 ------------------------------ */

.cat-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 168px;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.cat-rail::-webkit-scrollbar,
.topic-rail::-webkit-scrollbar,
.chip-bar::-webkit-scrollbar {
  display: none;
}

.cat-tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-3);
  scroll-snap-align: start;
  box-shadow: 0 12px 30px -26px rgba(23, 20, 16, 0.5);
}

.cat-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.5s;
}

.cat-tile__img.is-loaded {
  opacity: 1;
}

.cat-tile:hover .cat-tile__img {
  transform: scale(1.06);
}

.cat-tile__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 9, 7, 0.72), rgba(10, 9, 7, 0.05) 55%, rgba(10, 9, 7, 0.18));
}

.cat-tile__index {
  position: absolute;
  top: 10px;
  left: 10px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  opacity: 0.8;
}

.cat-tile__body {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--paper);
}

.cat-tile__name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.cat-tile__count {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  opacity: 0.68;
}

.cat-tile__arrow {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 246, 236, 0.45);
  border-radius: 50%;
  color: var(--paper);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  background: rgba(10, 9, 7, 0.18);
  backdrop-filter: blur(3px);
}

.cat-tile:hover .cat-tile__arrow {
  opacity: 1;
  transform: none;
}

.cat-tile--plain {
  background:
    repeating-linear-gradient(135deg, rgba(23, 20, 16, 0.055) 0 1px, transparent 1px 10px),
    var(--paper-3);
}

.cat-tile--plain .cat-tile__veil {
  background: linear-gradient(0deg, rgba(23, 20, 16, 0.7), transparent 62%);
}

.cat-tile__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 76px;
  font-weight: 900;
  color: rgba(23, 20, 16, 0.12);
  letter-spacing: -0.08em;
}

/* ------------------------------ 专题横滑 / 网格 ------------------------------ */

.topic-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(238px, 24vw, 300px);
  gap: 16px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.topic-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  scroll-snap-align: start;
  isolation: isolate;
}

.topic-card__media {
  position: absolute;
  inset: 0;
}

.topic-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.6s;
}

.topic-card__media img.is-loaded {
  opacity: 1;
}

.topic-card:hover .topic-card__media img {
  transform: scale(1.05);
}

.topic-card__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(8, 7, 6, 0.82), rgba(8, 7, 6, 0.08) 58%, rgba(8, 7, 6, 0.28));
  transition: opacity 0.3s;
}

.topic-card__top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 1;
}

.topic-card__index {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  opacity: 0.72;
}

.topic-card__class {
  max-width: 60%;
  padding: 3px 8px;
  border: 1px solid rgba(250, 246, 236, 0.32);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: rgba(250, 246, 236, 0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-card__body {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1;
}

.topic-card__name {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.topic-card__meta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-card.is-placeholder,
.topic-card.has-failed-img {
  background:
    repeating-linear-gradient(45deg, rgba(250, 246, 236, 0.08) 0 1px, transparent 1px 12px),
    #2a251e;
}

.topic-grid-host {
  margin-top: 6px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 16px;
}

.topic-grid .topic-card {
  aspect-ratio: 4 / 5;
}

/* ------------------------------ 分类页 ------------------------------ */

.hot-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 28px;
  padding: clamp(24px, 4vw, 48px);
  margin-bottom: 18px;
  background:
    radial-gradient(circle at 82% 18%, rgba(206, 63, 26, 0.35), transparent 42%),
    linear-gradient(120deg, #1c1812, #2a231a);
  color: var(--paper);
  border: 1px solid var(--ink);
  overflow: hidden;
}

.hot-card::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(250, 246, 236, 0.14);
  pointer-events: none;
}

.hot-card__main {
  min-width: 0;
}

.hot-card__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: 0;
  padding-bottom: 12px;
}

.hot-card__kicker {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(250, 246, 236, 0.52);
}

.hot-card__title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-top: 12px;
}

.hot-card__cn {
  font-size: clamp(3rem, 6vw, 6rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.hot-card__en {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.7rem);
  font-style: italic;
  font-weight: 300;
  color: #e9a28b;
}

.hot-card__lede {
  margin-top: 18px;
  max-width: 38ch;
  font-size: 12px;
  line-height: 1.8;
  color: rgba(250, 246, 236, 0.66);
}

.hot-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
  align-content: flex-start;
  justify-content: flex-end;
}

.hot-card__chip {
  padding: 4px 9px;
  border: 1px solid rgba(250, 246, 236, 0.24);
  border-radius: 999px;
  font-size: 10px;
  color: rgba(250, 246, 236, 0.82);
}

.hot-card__arrow {
  position: absolute;
  right: 26px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 246, 236, 0.4);
  border-radius: 50%;
  color: var(--paper);
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease);
}

.hot-card:hover .hot-card__arrow {
  background: var(--paper);
  color: var(--ink);
  transform: rotate(45deg);
}

.catalog-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 640px;
  margin: 30px 0 34px;
}

.catalog-note__mark {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 0.7;
  color: var(--accent);
}

.catalog-note p {
  font-size: 12px;
  line-height: 1.85;
  color: var(--ink-3);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid var(--line);
}

.category-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.5s;
}

.category-card__media img.is-loaded {
  opacity: 1;
}

.category-card:hover .category-card__media img {
  transform: scale(1.05);
}

.category-card__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 9, 7, 0.48), transparent 52%);
  opacity: 0.72;
}

.category-card__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 92px;
  font-weight: 900;
  color: rgba(23, 20, 16, 0.13);
}

.category-card--plain .category-card__media {
  background:
    repeating-linear-gradient(135deg, rgba(23, 20, 16, 0.06) 0 1px, transparent 1px 12px),
    var(--paper-3);
}

.category-card__body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 2px 0;
}

.category-card__index {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted);
}

.category-card__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-card__name {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.category-card__meta {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.category-card__arrow {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.25s var(--ease), color 0.2s;
}

.category-card:hover .category-card__arrow {
  color: var(--accent);
  transform: translate(3px, -3px);
}

/* ------------------------------ 详情头 ------------------------------ */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  transition: color 0.2s, border-color 0.2s;
}

.back-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: clamp(24px, 4vw, 60px);
  align-items: end;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.detail-title {
  margin-top: 16px;
  font-size: clamp(3rem, 8vw, 7.4rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.detail-lede {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.detail-art {
  position: relative;
  width: 170px;
  height: 202px;
  padding: 8px;
  justify-self: end;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px -30px rgba(23, 20, 16, 0.6);
  transform: rotate(2.5deg);
}

.detail-art__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s;
}

.detail-art__img.is-loaded {
  opacity: 1;
}

.detail-art__frame {
  position: absolute;
  inset: -9px;
  border: 1px solid var(--line);
  transform: rotate(-4deg);
  z-index: -1;
}

.detail-art__glyph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, rgba(23, 20, 16, 0.05) 0 1px, transparent 1px 11px),
    var(--paper-3);
  font-size: 72px;
  font-weight: 900;
  color: var(--ink-3);
}

.detail-art--hot {
  border-color: var(--accent);
}

.detail-art--hot .detail-art__glyph {
  background: var(--accent);
  color: var(--paper);
}

/* ------------------------------ 粘性控制条 ------------------------------ */

.sticky-controls {
  position: sticky;
  top: 0;
  z-index: 22;
  margin: 0 calc(-1 * var(--pad)) 24px;
  padding: 0 var(--pad) 10px;
  background: rgba(242, 236, 221, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.chip-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 1px 4px;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
}

.chip-bar--filter {
  mask-image: none;
  -webkit-mask-image: none;
  flex-wrap: wrap;
  row-gap: 8px;
  overflow: visible;
  padding-top: 10px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-row--wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s var(--ease);
}

.chip:hover {
  background: var(--paper-2);
  border-color: var(--ink-3);
}

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip__avatar {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper-3);
  flex: none;
}

.chip__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chip__count {
  font-family: var(--font-mono);
  font-size: 8px;
  opacity: 0.55;
}

.chip.is-active .chip__count {
  opacity: 0.65;
}

.controls-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
}

.controls-row__spacer {
  flex: 1 1 20px;
}

.segmented-host {
  display: inline-flex;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(250, 246, 236, 0.7);
}

.segmented__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 10px;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}

.segmented__item:hover {
  color: var(--ink);
}

.segmented__item.is-active {
  background: var(--ink);
  color: var(--paper);
}

.segmented__count {
  font-family: var(--font-mono);
  font-size: 8px;
  opacity: 0.55;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 35px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 10px;
  color: var(--ink-3);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.sort-btn:hover {
  background: var(--paper-2);
  color: var(--ink);
  border-color: var(--ink-3);
}

.feeds-placeholder {
  height: 40px;
}

/* ------------------------------ 瀑布流 ------------------------------ */

.feed {
  position: relative;
}

.feed-host {
  scroll-margin-top: 130px;
}

.masonry {
  position: relative;
  width: 100%;
  min-height: 30vh;
  transition: height 0.3s var(--ease);
}

.masonry > * {
  position: absolute;
  top: 0;
  left: 0;
}

.wall-card {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  contain: layout paint;
  opacity: 0;
  animation: cardIn 0.55s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition: border-color 0.25s, box-shadow 0.3s;
}

.wall-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 44px -32px rgba(23, 20, 16, 0.7);
}

.wall-card__media {
  position: absolute;
  inset: 0;
}

.media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.5s;
}

.media__img.is-loaded {
  opacity: 1;
}

.wall-card:hover .media__img {
  transform: scale(1.035);
}

.wall-card__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 9, 7, 0.24), transparent 28%),
    linear-gradient(0deg, rgba(10, 9, 7, 0.58), transparent 34%);
  opacity: 0.9;
  transition: opacity 0.25s;
  pointer-events: none;
}

.wall-card:hover .wall-card__veil {
  opacity: 1;
}

.wall-card__open {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.wall-card__open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.wall-card__top {
  position: absolute;
  top: 9px;
  left: 9px;
  right: 9px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  z-index: 3;
  pointer-events: none;
}

.wall-card__index {
  padding: 2px 6px;
  background: rgba(242, 236, 221, 0.85);
  border: 1px solid rgba(23, 20, 16, 0.08);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

.wall-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.wall-card__bottom {
  position: absolute;
  left: 10px;
  right: 46px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 3;
  color: rgba(250, 246, 236, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.wall-card__author {
  font-size: 10px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  opacity: 0.72;
}

.wall-card__fav {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  width: 32px;
  height: 32px;
  background: rgba(242, 236, 221, 0.9);
  border: 1px solid rgba(23, 20, 16, 0.08);
  color: var(--ink);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s var(--ease), background 0.2s, color 0.2s;
}

.wall-card__fav.is-active {
  opacity: 1;
  transform: none;
  background: var(--accent);
  color: var(--paper);
}

.wall-card:hover .wall-card__fav,
.wall-card__fav:focus-visible {
  opacity: 1;
  transform: none;
}

.wall-card__fav:hover {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .wall-card__fav {
    opacity: 1;
    transform: none;
  }
}

.wall-card.has-failed-img .media__img {
  display: none;
}

.wall-card.has-failed-img .wall-card__media {
  background:
    repeating-linear-gradient(45deg, rgba(23, 20, 16, 0.055) 0 1px, transparent 1px 12px),
    var(--paper-3);
}

.wall-card.has-failed-img .wall-card__media::after {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 42px;
  color: rgba(23, 20, 16, 0.22);
}

/* 文字卡 */

.note-card {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  opacity: 0;
  animation: cardIn 0.55s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}

.note-card--accent {
  background: var(--accent);
  border-color: var(--accent);
}

.note-card__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px;
  overflow: hidden;
}

.note-card__inner::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -32px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(250, 246, 236, 0.2);
  border-radius: 50%;
}

.note-card__kicker {
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.16em;
  opacity: 0.6;
}

.note-card__title {
  font-size: clamp(17px, 2vw, 26px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.note-card__text {
  font-size: 10px;
  line-height: 1.7;
  opacity: 0.66;
}

.note-card__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.note-card__link:hover {
  color: #ffd9cd;
}

/* 骨架 */

.skeleton-card {
  background: var(--paper-3);
  border-color: transparent;
  opacity: 1;
  animation: none;
}

.skeleton-card__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 252, 243, 0.55) 48%, transparent 76%);
  transform: translateX(-100%);
  animation: shimmer 1.6s infinite;
}

/* ------------------------------ 加载 / 空态 ------------------------------ */

.feed-status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 26px 0;
}

.loading-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.loading-row__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBounce 1s infinite;
}

.loading-row__dot:nth-child(2) {
  animation-delay: 0.12s;
}

.loading-row__dot:nth-child(3) {
  animation-delay: 0.24s;
}

.loading-row__text {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.end-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  color: var(--muted);
}

.end-row__line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.end-row__text {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.end-row__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.end-row__link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 26px 0;
  padding: clamp(34px, 7vw, 70px) 24px;
  border: 1px dashed var(--line-strong);
  background: rgba(250, 246, 236, 0.42);
  text-align: center;
}

.feed-status > .state-panel {
  width: 100%;
}

.state-panel__glyph {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 86px);
  line-height: 0.9;
  color: var(--accent);
  opacity: 0.9;
}

.state-panel__title {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.state-panel__text {
  max-width: 40ch;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-3);
}

.state-panel .btn {
  margin-top: 8px;
}

/* ------------------------------ 专题详情 ------------------------------ */

.topic-hero {
  position: relative;
  height: clamp(430px, 64vh, 680px);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--paper);
  isolation: isolate;
}

.topic-hero__media {
  position: absolute;
  inset: 0;
}

.topic-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 0.7s, transform 1.2s var(--ease);
}

.topic-hero__media img.is-loaded {
  opacity: 1;
  transform: none;
}

.topic-hero__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(120px, 22vw, 300px);
  font-weight: 900;
  color: rgba(250, 246, 236, 0.08);
}

.topic-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 7, 6, 0.32), transparent 32%),
    linear-gradient(0deg, rgba(8, 7, 6, 0.86), rgba(8, 7, 6, 0.08) 58%, rgba(8, 7, 6, 0.18));
}

.topic-hero__content {
  position: absolute;
  left: clamp(20px, 4vw, 54px);
  right: clamp(20px, 4vw, 54px);
  bottom: clamp(24px, 4vw, 48px);
  z-index: 2;
  max-width: 880px;
}

.topic-hero__title {
  margin-top: 14px;
  font-size: clamp(3rem, 8vw, 7.4rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.06em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

.topic-hero__meta {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(250, 246, 236, 0.7);
}

.topic-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(250, 246, 236, 0.34);
  border-radius: 999px;
  background: rgba(8, 7, 6, 0.18);
  backdrop-filter: blur(4px);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

a.hero-chip:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.hero-chip--ghost {
  opacity: 0.66;
}

.topic-hero__corner {
  position: absolute;
  top: 22px;
  right: 20px;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.3em;
  color: rgba(250, 246, 236, 0.55);
  z-index: 2;
}

.topic-hero__no {
  position: absolute;
  top: 22px;
  left: 24px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: rgba(250, 246, 236, 0.66);
  z-index: 2;
}

.topic-hero.has-failed-img .topic-hero__media {
  background:
    repeating-linear-gradient(45deg, rgba(250, 246, 236, 0.06) 0 1px, transparent 1px 14px),
    #221d17;
}

/* ------------------------------ 搜索 ------------------------------ */

.search-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 24;
  margin: 0 calc(-1 * var(--pad)) 26px;
  padding: 12px var(--pad) 16px;
  background: linear-gradient(180deg, var(--paper) 70%, rgba(242, 236, 221, 0.76));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 8px 0 18px;
  border: 1px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 5px 5px 0 var(--paper-3);
  transition: box-shadow 0.2s, transform 0.2s;
}

.search-field:focus-within {
  box-shadow: 5px 5px 0 var(--accent);
}

.search-field__icon {
  color: var(--muted);
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: none;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.search-clear:hover {
  background: var(--paper-3);
  color: var(--ink);
}

.search-submit {
  height: 42px;
  flex: none;
}

.discovery {
  display: flex;
  flex-direction: column;
  gap: 38px;
  padding-top: 4px;
}

.search-block {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.search-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.search-block__title {
  font-size: clamp(17px, 2vw, 23px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.search-block__hint {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.popular-list {
  display: flex;
  flex-direction: column;
}

.popular-row {
  display: grid;
  grid-template-columns: 30px 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 9px 4px;
  border-top: 1px solid var(--line);
  transition: background 0.18s, padding 0.18s var(--ease);
}

.popular-row:last-child {
  border-bottom: 1px solid var(--line);
}

.popular-row:hover {
  background: var(--paper-2);
  padding-left: 9px;
}

.popular-row__index {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted);
}

.popular-row__media {
  width: 58px;
  height: 58px;
  overflow: hidden;
  background: var(--paper-3);
}

.popular-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s;
}

.popular-row__media img.is-loaded {
  opacity: 1;
}

.popular-row__glyph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-3);
}

.popular-row__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.popular-row__text b {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.popular-row__text small {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.03em;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popular-row > svg {
  color: var(--muted);
}

.search-suggest {
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  padding: 6px;
  box-shadow: 8px 8px 0 var(--paper-3);
}

.search-suggest__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.search-suggest__hint {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.suggest-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 0.15s;
}

.suggest-row:last-of-type {
  border-bottom: 0;
}

.suggest-row:hover,
.suggest-row.is-active {
  background: var(--paper-3);
}

.suggest-row__media {
  width: 52px;
  height: 52px;
  overflow: hidden;
  background: var(--paper-3);
}

.suggest-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s;
}

.suggest-row__media img.is-loaded {
  opacity: 1;
}

.suggest-row__glyph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-3);
}

.suggest-row__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.suggest-row__text b {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-row__text small {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--muted);
}

.suggest-row__type {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.suggest-row > svg {
  color: var(--muted);
}

.suggest-live {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 12px 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  text-align: left;
}

.suggest-live svg:last-child {
  margin-left: auto;
}

.search-suggest__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  color: var(--ink-3);
  font-size: 12px;
}

.search-results {
  padding-top: 4px;
}

.search-results__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 20px;
  border-top: 1px solid var(--line);
  margin-bottom: 8px;
}

.search-results__title {
  margin-top: 8px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
}

/* ------------------------------ 收藏页 ------------------------------ */

.saved-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.saved-toolbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.saved-grid-host + .page-foot {
  margin-top: 40px;
}

/* ------------------------------ Viewer ------------------------------ */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(8, 7, 6, 0.96);
  color: var(--paper);
  opacity: 0;
  transition: opacity 0.24s var(--ease);
}

.viewer.is-open {
  opacity: 1;
}

.viewer__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.055), transparent 58%);
}

.viewer__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 56px 0 138px;
  cursor: grab;
  touch-action: none;
}

.viewer__stage.is-video {
  cursor: default;
  touch-action: auto;
}

.viewer__anim,
.viewer__canvas {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  will-change: transform, opacity;
}

.viewer__media {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.viewer__placeholder {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(30px) brightness(0.5);
  transform: scale(1.08);
  opacity: 0.9;
  transition: opacity 0.4s;
}

.viewer__image {
  position: relative;
  max-width: 92vw;
  max-height: calc(100dvh - 210px);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.viewer__image.is-loaded {
  opacity: 1;
}

.viewer__video {
  position: relative;
  max-width: 92vw;
  max-height: calc(100dvh - 210px);
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.4s;
}

.viewer__video.is-loaded {
  opacity: 1;
}

.viewer__error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: rgba(250, 246, 236, 0.7);
  font-size: 13px;
}

.viewer__error a {
  border-bottom: 1px solid currentColor;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
}

.viewer__top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 18px;
  background: linear-gradient(180deg, rgba(8, 7, 6, 0.7), transparent);
  transition: opacity 0.24s, transform 0.24s var(--ease);
}

.viewer__btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 246, 236, 0.14);
  border-radius: 50%;
  background: rgba(250, 246, 236, 0.06);
  color: var(--paper);
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s;
}

.viewer__btn:hover {
  background: rgba(250, 246, 236, 0.14);
  border-color: rgba(250, 246, 236, 0.4);
}

.viewer__counter {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(250, 246, 236, 0.64);
}

.viewer__counter-current {
  color: var(--paper);
}

.viewer__slash {
  opacity: 0.4;
}

.viewer__fav .fav-btn {
  width: 42px;
  height: 42px;
  background: rgba(250, 246, 236, 0.06);
  border: 1px solid rgba(250, 246, 236, 0.14);
  color: var(--paper);
  opacity: 1;
  transform: none;
}

.viewer__fav .fav-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.viewer__bottom {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(20px, 4vw, 44px) calc(22px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(8, 7, 6, 0.86), rgba(8, 7, 6, 0.3) 62%, transparent);
  transition: opacity 0.24s, transform 0.24s var(--ease);
}

.viewer__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.viewer__author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(250, 246, 236, 0.14);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.avatar__img {
  border-radius: 50%;
}

.viewer__author-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.viewer__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer__sub {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: rgba(250, 246, 236, 0.5);
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.stat-row__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(250, 246, 236, 0.64);
}

.viewer__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.viewer__label {
  padding: 3px 8px;
  border: 1px solid rgba(250, 246, 236, 0.2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: rgba(250, 246, 236, 0.64);
}

.viewer__actions {
  display: flex;
  gap: 10px;
  flex: none;
}

.viewer__hint {
  position: absolute;
  left: 50%;
  bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: rgba(250, 246, 236, 0.34);
  white-space: nowrap;
  transition: opacity 0.24s;
}

.viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(250, 246, 236, 0.16);
  border-radius: 50%;
  background: rgba(8, 7, 6, 0.32);
  color: var(--paper);
  backdrop-filter: blur(8px);
  opacity: 0.75;
  transition: opacity 0.2s, background 0.2s;
}

.viewer__nav:hover {
  opacity: 1;
  background: rgba(250, 246, 236, 0.12);
}

.viewer__nav:disabled {
  opacity: 0.16;
}

.viewer__nav--prev {
  left: 18px;
}

.viewer__nav--next {
  right: 18px;
}

.viewer.is-chrome-hidden .viewer__top,
.viewer.is-chrome-hidden .viewer__bottom,
.viewer.is-chrome-hidden .viewer__hint,
.viewer.is-chrome-hidden .viewer__nav {
  opacity: 0;
  pointer-events: none;
}

.viewer.is-chrome-hidden .viewer__top {
  transform: translateY(-10px);
}

.viewer.is-chrome-hidden .viewer__bottom {
  transform: translateY(10px);
}

/* ------------------------------ Toast ------------------------------ */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  border: 1px solid rgba(250, 246, 236, 0.14);
  border-radius: 999px;
  background: rgba(23, 20, 16, 0.94);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.02em;
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s, transform 0.22s var(--ease);
}

.toast.is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------ 动画 ------------------------------ */

@keyframes cardIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 74, 60, 0.34);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(37, 74, 60, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 74, 60, 0);
  }
}

@keyframes dotBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes marquee {
  to {
    transform: translateX(-33.3333%);
  }
}

@keyframes enterUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.main.view-enter .page-head,
.main.view-enter .hero__copy,
.main.view-enter .hero__collage,
.main.view-enter .detail-head,
.main.view-enter .topic-hero,
.main.view-enter .search-bar-wrap,
.main.view-enter .saved-toolbar {
  animation: enterUp 0.6s var(--ease) both;
}

.main.view-enter .hero__collage {
  animation-delay: 0.07s;
}

.main.view-enter .detail-head,
.main.view-enter .topic-hero,
.main.view-enter .search-bar-wrap {
  animation-delay: 0.04s;
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 1180px) {
  .page-head {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  }
}

@media (max-width: 1080px) {
  .rail {
    display: none;
  }

  .mobile-bar,
  .tabbar {
    display: flex;
  }

  .tabbar {
    display: grid;
  }

  .main {
    margin-left: 0;
    padding: calc(var(--mbar-h) + 26px) var(--pad) calc(var(--tab-h) + 46px);
    max-width: none;
  }

  .sticky-controls {
    top: var(--mbar-h);
  }

  .search-bar-wrap {
    top: var(--mbar-h);
  }

  .hero {
    min-height: auto;
    padding-top: 8px;
  }

  .hero__collage {
    height: clamp(380px, 52vw, 560px);
  }

  .topic-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .hero__copy {
    max-width: none;
  }

  .hero__collage {
    height: clamp(360px, 58vw, 520px);
  }

  .page-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .page-head__aside {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
  }

  .page-head__lede {
    max-width: 52ch;
  }

  .hot-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .hot-card__side {
    align-items: flex-start;
    padding-bottom: 0;
  }

  .hot-card__chips {
    max-height: 82px;
    overflow: hidden;
    justify-content: flex-start;
    margin-top: 20px;
  }

  .hot-card__arrow {
    display: none;
  }

  .detail-art {
    width: 140px;
    height: 168px;
  }

  .viewer__bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .viewer__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .page-head__title {
    font-size: clamp(2.6rem, 11vw, 3.8rem);
  }

  .hero__title {
    font-size: clamp(3rem, 15vw, 4.6rem);
  }

  .hero__lede {
    margin-top: 24px;
    font-size: 13px;
  }

  .hero__meta {
    gap: 9px;
  }

  .hero__meta b {
    font-size: 18px;
  }

  .ticker {
    margin-top: 12px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head__title {
    font-size: 1.35rem;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .category-card__name {
    font-size: 18px;
  }

  .cat-rail {
    grid-auto-columns: 148px;
  }

  .detail-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-art {
    display: none;
  }

  .detail-title {
    font-size: clamp(2.8rem, 15vw, 4.4rem);
  }

  .sticky-controls {
    margin-bottom: 16px;
  }

  .controls-row {
    gap: 8px;
  }

  .controls-row .feed-count {
    width: auto;
    margin-left: auto;
    text-align: right;
  }

  .segmented__item {
    padding: 0 10px;
  }

  .topic-hero {
    height: 56vh;
    min-height: 380px;
  }

  .topic-hero__title {
    font-size: clamp(2.7rem, 13vw, 4rem);
  }

  .topic-hero__meta {
    font-size: 8px;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .filter-field {
    flex: 1 1 100%;
  }

  .topics-toolbar .feed-count {
    width: auto;
    text-align: right;
    margin-left: auto;
  }

  .chip-bar--filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent 100%);
  }

  .topic-grid .topic-card__name {
    font-size: 18px;
  }

  .topic-grid .topic-card__body {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .topic-grid .topic-card__class {
    display: none;
  }

  .popular-row {
    grid-template-columns: 24px 50px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .popular-row__media {
    width: 50px;
    height: 50px;
  }

  .search-field {
    height: 54px;
    padding-left: 14px;
  }

  .search-submit {
    padding: 0 13px;
  }

  .search-submit svg {
    display: none;
  }

  .search-submit::before {
    content: "";
  }

  .viewer__stage {
    padding: 50px 0 160px;
  }

  .viewer__image,
  .viewer__video {
    max-width: 96vw;
    max-height: calc(100dvh - 250px);
  }

  .viewer__nav {
    display: none;
  }

  .viewer__bottom {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .viewer__hint {
    font-size: 7px;
  }

  .note-card__text {
    display: none;
  }

  .note-card__title {
    font-size: 18px;
  }

  .note-card__inner {
    padding: 14px;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .page-head__aside {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__title {
    font-size: clamp(2.8rem, 16vw, 4rem);
  }

  .hero__actions .btn {
    flex: 1;
  }

  .hero__collage {
    height: 340px;
  }

  .hero__stamp {
    width: 74px;
    height: 74px;
    font-size: 12px;
  }

  .hero__frame-no {
    display: none;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hot-card__chips {
    max-height: 70px;
  }

  .search-field {
    gap: 7px;
    padding-left: 12px;
  }

  .search-submit {
    padding: 0 11px;
    font-size: 11px;
  }

  .viewer__labels {
    display: none;
  }

  .toast-root {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

/* 桌面横向滚动：可见细滚动条 + 鼠标拖拽 + 滚轮（仅 chip-bar） */

@media (hover: hover) and (pointer: fine) {
  [data-hscroll] {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    cursor: grab;
  }

  [data-hscroll] a,
  [data-hscroll] button {
    cursor: pointer;
  }

  [data-hscroll].is-dragging {
    cursor: grabbing;
    user-select: none;
  }

  [data-hscroll].is-dragging * {
    cursor: grabbing;
  }

  [data-hscroll]::-webkit-scrollbar {
    display: block;
    width: 5px;
    height: 5px;
  }

  [data-hscroll]::-webkit-scrollbar-track {
    background: transparent;
  }

  [data-hscroll]::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border: 0;
    border-radius: 999px;
  }

  [data-hscroll]::-webkit-scrollbar-thumb:hover {
    background: var(--ink-3);
  }

  .chip-bar {
    mask-image: none;
    -webkit-mask-image: none;
    padding-bottom: 8px;
  }

  .chip-row {
    padding-bottom: 6px;
  }

  .cat-rail,
  .topic-rail {
    padding-bottom: 12px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ticker__line {
    animation: none;
  }

  .wall-card,
  .note-card {
    opacity: 1;
  }
}

/* 滚动条 */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(23, 20, 16, 0.18);
  border: 3px solid var(--paper);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(23, 20, 16, 0.32);
}
