:root {
  --bg: #f7efe5;
  --bg-secondary: #fffaf3;
  --surface: rgba(255, 250, 243, 0.88);
  --paper: #fffdf8;
  --paper-strong: #fff5ea;
  --text: #24170f;
  --text-secondary: #735c49;
  --border: rgba(93, 60, 33, 0.12);
  --accent: #d75c2f;
  --accent-strong: #b74822;
  --accent-hover: #e86d3a;
  --shadow: 0 24px 64px rgba(126, 72, 37, 0.14);
  --shadow-hover: 0 32px 88px rgba(126, 72, 37, 0.22);
  --shadow-subtle: 0 8px 24px rgba(126, 72, 37, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(255, 206, 149, 0.4), transparent 38%),
    radial-gradient(circle at top right, rgba(240, 118, 78, 0.2), transparent 32%),
    radial-gradient(circle at bottom center, rgba(255, 180, 120, 0.15), transparent 45%),
    linear-gradient(180deg, #fff9f2 0%, #f7efe5 42%, #f5ece3 100%);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

.page-noise {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.page-blur {
  position: fixed;
  width: 38rem;
  height: 38rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.page-blur-a {
  top: -12rem;
  left: -12rem;
  background: rgba(236, 121, 69, 0.48);
  animation-delay: 0s;
}

.page-blur-b {
  right: -12rem;
  bottom: -12rem;
  background: rgba(72, 157, 170, 0.28);
  animation-delay: -10s;
}

a {
  color: inherit;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header,
.main-content,
.footer,
.detail-layout,
.cover-preview-page {
  position: relative;
  z-index: 1;
}

.header {
  padding: 40px 0 24px;
}

.header-content {
  display: grid;
  gap: 24px;
}

.header-copy,
.search-panel,
.status-card,
.detail-toc,
.reading-card,
.detail-hero-copy {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.header-copy:hover,
.search-panel:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.header-copy {
  border-radius: var(--radius-xl);
  padding: 32px;
  background: linear-gradient(135deg, rgba(255, 250, 243, 0.92) 0%, rgba(255, 245, 235, 0.88) 100%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
}

.eyebrow::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.site-title,
.detail-page-title,
.note-cover-title {
  font-family: "Outfit", "Noto Sans SC", sans-serif;
}

.site-title {
  font-size: clamp(2.1rem, 4vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-strong) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-subtitle,
.detail-summary,
.status-text,
.feed-card-preview,
.detail-meta,
.detail-site-name,
.group-count,
.detail-toc-link,
.footer,
.cover-preview-toolbar {
  color: var(--text-secondary);
}

.site-subtitle {
  max-width: 44rem;
  font-size: 1rem;
}

.search-panel {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.search-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

input[type=search] {
  width: 100%;
  padding: 18px 20px 18px 52px;
  border-radius: 999px;
  border: 1px solid rgba(93, 60, 33, 0.16);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-subtle);
}

input[type=search]::placeholder {
  color: #a18b79;
}

input[type=search]:focus {
  border-color: rgba(215, 92, 47, 0.5);
  box-shadow: 0 0 0 5px rgba(215, 92, 47, 0.15), var(--shadow);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
}

.main-content,
.detail-layout {
  padding-bottom: 72px;
}

.status-panel.hidden,
.detail-toc.hidden {
  display: none;
}

.status-card {
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 28px;
}

.status-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.status-action,
.back-link,
.cover-preview-link {
  appearance: none;
  border: 1px solid rgba(93, 60, 33, 0.14);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
}

.status-action:hover,
.back-link:hover,
.cover-preview-link:hover,
.feed-card:hover,
.note-cover:hover {
  transform: translateY(-3px);
}

.status-action:hover,
.back-link:hover,
.cover-preview-link:hover {
  border-color: rgba(215, 92, 47, 0.35);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 32px rgba(215, 92, 47, 0.18);
}

.group {
  margin: 44px 0;
}

.group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.group h2 {
  font-family: "Outfit", "Noto Sans SC", sans-serif;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.group-count {
  font-size: 13px;
  font-weight: 700;
}

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

.feed-card-link {
  text-decoration: none;
  color: inherit;
}

.feed-card {
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 252, 246, 0.95) 0%, rgba(255, 248, 238, 0.92) 100%);
  border: 1px solid rgba(93, 60, 33, 0.1);
  box-shadow: var(--shadow);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.feed-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(215, 92, 47, 0.03) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.feed-card:hover {
  border-color: rgba(215, 92, 47, 0.28);
  box-shadow: var(--shadow-hover);
}

.feed-card:hover::before {
  opacity: 1;
}

.feed-card-cover {
  padding: 16px;
}

.feed-card-figure,
.paper-figure-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(93, 60, 33, 0.1);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.feed-card-figure {
  aspect-ratio: 4 / 3;
}

.paper-figure-card {
  display: grid;
  gap: 0;
}

.feed-card-cover .note-cover {
  min-height: 0;
  aspect-ratio: 4 / 3;
  padding: 14px;
  gap: 10px;
}

.note-cover-title-only {
  justify-content: flex-end;
}

.note-cover-title-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  min-height: 100%;
}

.paper-figure-card-detail {
  min-height: 100%;
}

.paper-figure-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(241, 226, 211, 0.9));
}

.paper-figure-card-detail .paper-figure-image {
  max-height: 520px;
  object-fit: contain;
  background: #fffdf8;
}

.paper-figure-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(36, 23, 15, 0.76);
  color: #fffaf4;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.paper-figure-caption {
  padding: 14px 16px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  background: rgba(255, 253, 248, 0.94);
  border-top: 1px solid rgba(93, 60, 33, 0.08);
}

.feed-card-body {
  padding: 0 20px 20px;
}

.feed-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.feed-chip,
.meta-pill,
.reading-badge,
.reading-step,
.reading-step-note,
.note-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.feed-chip,
.meta-pill,
.reading-step-note {
  background: rgba(215, 92, 47, 0.08);
  color: var(--accent);
}

.feed-chip.subtle,
.reading-step,
.note-chip-muted {
  background: rgba(93, 60, 33, 0.07);
  color: var(--text-secondary);
}

.feed-card-title {
  font-size: 1.15rem;
  line-height: 1.4;
  font-weight: 800;
  margin-bottom: 10px;
}

.feed-card-preview {
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 16px;
}

.feed-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(93, 60, 33, 0.08);
}

.feed-card-action {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  position: relative;
  transition: color 0.3s ease;
}

.feed-card:hover .feed-card-action {
  color: var(--accent-hover);
}

.feed-card-action::after {
  content: "→";
  margin-left: 6px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.feed-card:hover .feed-card-action::after {
  transform: translateX(4px);
}

.feed-card-stats {
  font-size: 12px;
  color: var(--text-secondary);
}

.note-cover {
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-radius: 28px;
  overflow: hidden;
  color: var(--cover-ink, #fff8ef);
  background: linear-gradient(160deg, var(--cover-from, #ef6c3f) 0%, var(--cover-to, #f6b13d) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), var(--shadow);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.note-cover:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), var(--shadow-hover);
}

.note-cover::before,
.note-cover::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.note-cover::before {
  width: 15rem;
  height: 15rem;
  right: -5rem;
  top: -4rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.38) 0%, transparent 68%);
}

.note-cover::after {
  width: 14rem;
  height: 14rem;
  left: -5rem;
  bottom: -6rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 70%);
}

.note-cover-mesh {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.14), transparent 42%),
    radial-gradient(circle at 70% 24%, var(--cover-spot, rgba(255, 255, 255, 0.3)) 0%, transparent 32%),
    radial-gradient(circle at 22% 78%, rgba(255, 255, 255, 0.16) 0%, transparent 34%);
  mix-blend-mode: screen;
  opacity: 0.88;
}

.note-cover-top,
.note-cover-body,
.note-cover-points,
.note-cover-bottom {
  position: relative;
  z-index: 1;
}

.note-cover-top,
.note-cover-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.note-chip {
  background: var(--cover-chip, rgba(255, 255, 255, 0.16));
  color: var(--cover-ink, #fff8ef);
  border: 1px solid var(--cover-stroke, rgba(255, 255, 255, 0.24));
  backdrop-filter: blur(10px);
}

.note-cover-kicker {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cover-muted, rgba(255, 248, 239, 0.82));
  margin-bottom: 14px;
  font-weight: 700;
}

.note-cover-title {
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin: 0;
  max-width: 14ch;
  text-wrap: balance;
}

.note-cover-title-only .note-cover-title {
  font-size: clamp(2.05rem, 4.5vw, 2.9rem);
  line-height: 0.98;
  max-width: none;
}

.feed-card-cover .note-cover-title {
  font-size: 1.36rem;
  line-height: 1.16;
  letter-spacing: -0.04em;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-card-cover .note-cover-title-only .note-cover-title {
  font-size: 1.5rem;
  line-height: 1.08;
  max-width: none;
}

.note-cover-hook {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--cover-muted, rgba(255, 248, 239, 0.82));
  max-width: 28rem;
}

.feed-card-cover .note-cover-hook {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-cover-points {
  display: grid;
  gap: 10px;
  list-style: none;
}

.feed-card-cover .note-cover-points {
  gap: 8px;
}

.note-cover-points li {
  position: relative;
  padding: 12px 14px 12px 42px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  font-size: 14px;
  line-height: 1.65;
}

.feed-card-cover .note-cover-points li {
  padding: 10px 12px 10px 34px;
  font-size: 13px;
  line-height: 1.45;
}

.note-cover-points li::before {
  content: "•";
  position: absolute;
  left: 16px;
  top: 10px;
  font-size: 24px;
  line-height: 1;
}

.feed-card-cover .note-cover-points li::before {
  left: 12px;
  top: 8px;
}

.note-cover-meta {
  font-size: 13px;
  color: var(--cover-muted, rgba(255, 248, 239, 0.82));
}

.feed-card-cover .note-cover-bottom {
  margin-top: auto;
}

.detail-page-header {
  padding-bottom: 12px;
}

.detail-page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.back-link::before {
  content: "←";
  margin-right: 8px;
}

.detail-site-name {
  font-size: 14px;
  font-weight: 700;
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.detail-hero-copy {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.detail-page-title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

.detail-meta {
  font-size: 15px;
  margin-bottom: 16px;
}

.detail-meta a,
.footer a {
  color: var(--accent);
  text-decoration: none;
}

.detail-meta a:hover,
.footer a:hover {
  color: var(--accent-strong);
}

.detail-summary {
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 16px;
}

.detail-micro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: start;
}

.reading-flow {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.reading-card {
  border-radius: 28px;
  padding: 28px;
  background: linear-gradient(135deg, rgba(255, 250, 243, 0.92) 0%, rgba(255, 245, 235, 0.88) 100%);
  transition: all 0.3s ease;
}

.reading-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.reading-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.reading-badge,
.reading-step {
  background: rgba(215, 92, 47, 0.12);
  color: var(--accent);
}

.reading-intro-hook {
  font-size: 20px;
  line-height: 1.55;
  font-weight: 800;
  margin-bottom: 16px;
}

.reading-intro-points {
  list-style: none;
  display: grid;
  gap: 10px;
}

.reading-intro-points li {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(93, 60, 33, 0.08);
}

.reading-card h2 {
  font-family: "Outfit", "Noto Sans SC", sans-serif;
  font-size: 1.65rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.reading-card-content h3,
.reading-card-content h4 {
  margin: 24px 0 12px;
  font-size: 1rem;
  color: var(--text);
}

.reading-card-content p,
.reading-card-content ul,
.reading-card-content ol {
  margin: 14px 0;
}

.reading-card-content ul,
.reading-card-content ol {
  padding-left: 24px;
}

.reading-card-content li {
  margin: 10px 0;
  color: var(--text-secondary);
}

.reading-card-content p,
.reading-card-content li {
  line-height: 1.85;
}

.reading-card-content strong {
  color: var(--text);
}

.reading-card-content code {
  background: rgba(215, 92, 47, 0.08);
  color: var(--accent);
  border-radius: 8px;
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.reading-card-content a {
  color: var(--accent);
  text-decoration: none;
}

.reading-card-content a:hover {
  text-decoration: underline;
}

.detail-toc {
  position: sticky;
  top: 24px;
  border-radius: 24px;
  padding: 18px;
}

.detail-toc-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}

.detail-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-toc-link {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.detail-toc-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.25s ease;
}

.detail-toc-link:hover,
.detail-toc-link.is-active {
  background: rgba(215, 92, 47, 0.1);
  color: var(--accent);
  padding-left: 16px;
}

.detail-toc-link:hover::before,
.detail-toc-link.is-active::before {
  height: 60%;
}

.paper-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.paper-nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.paper-nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(215, 92, 47, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.paper-nav-link:hover {
  transform: translateY(-3px);
  border-color: rgba(215, 92, 47, 0.35);
  box-shadow: var(--shadow-hover);
}

.paper-nav-link:hover::before {
  opacity: 1;
}

.paper-nav-prev {
  grid-column: 1;
}

.paper-nav-next {
  grid-column: 2;
  text-align: right;
}

.paper-nav-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.paper-nav-title {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cover-page {
  min-height: 100vh;
}

.cover-preview-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.cover-preview-shell {
  width: min(100%, 640px);
  display: grid;
  gap: 16px;
}

.note-cover-standalone {
  min-height: 820px;
}

.cover-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 6px;
}

.lazy-sentinel {
  height: 1px;
}

.footer {
  padding: 28px 0 36px;
  text-align: center;
  font-size: 14px;
}

.feed-card-link:focus-visible,
.back-link:focus-visible,
.cover-preview-link:focus-visible,
.detail-toc-link:focus-visible,
.paper-nav-link:focus-visible,
input[type=search]:focus-visible,
.status-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(215, 92, 47, 0.12);
}

@media (max-width: 960px) {
  .detail-hero-grid,
  .detail-shell {
    grid-template-columns: 1fr;
  }

  .detail-toc {
    position: static;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100%, calc(100% - 24px));
  }

  .header {
    padding-top: 24px;
  }

  .header-copy,
  .search-panel,
  .detail-hero-copy,
  .reading-card {
    padding: 20px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .note-cover {
    min-height: 390px;
    padding: 18px;
  }

  .note-cover-title {
    font-size: 1.95rem;
  }

  .detail-page-topbar,
  .group-heading,
  .cover-preview-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-page-title {
    font-size: 2.1rem;
  }

  .paper-nav {
    grid-template-columns: 1fr;
  }

  .paper-nav-next {
    grid-column: 1;
  }

  .note-cover-standalone {
    min-height: 700px;
  }
}

:root {
  --bg: #f4f6fa;
  --bg-secondary: #eef1f6;
  --surface: #ffffff;
  --paper: #ffffff;
  --paper-strong: #f8f9fc;
  --text: #111827;
  --text-secondary: #667085;
  --border: #e3e7ef;
  --border-strong: #d4d9e3;
  --accent: #5b5bd6;
  --accent-strong: #4545b8;
  --accent-hover: #6d6de3;
  --accent-soft: #eeeeff;
  --cyan: #08a7a1;
  --shadow: 0 14px 36px rgba(16, 24, 40, 0.07);
  --shadow-hover: 0 22px 52px rgba(16, 24, 40, 0.12);
  --shadow-subtle: 0 4px 14px rgba(16, 24, 40, 0.05);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

body {
  background:
    radial-gradient(circle at 8% -12%, rgba(91, 91, 214, 0.12), transparent 30rem),
    radial-gradient(circle at 96% 8%, rgba(8, 167, 161, 0.08), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.65;
}

::selection {
  background: rgba(91, 91, 214, 0.18);
  color: var(--text);
}

.page-noise {
  background-image: radial-gradient(rgba(17, 24, 39, 0.2) 0.6px, transparent 0.6px);
  background-size: 18px 18px;
  opacity: 0.08;
}

.page-blur {
  display: none;
}

.container {
  width: min(1240px, calc(100% - 56px));
}

.header {
  padding: 24px 0 38px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--text);
  color: #ffffff;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-subtle);
}

.site-nav-status,
.search-availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.site-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(8, 167, 161, 0.11);
}

.header-content {
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.header-copy,
.search-panel,
.status-card,
.detail-toc,
.reading-card,
.detail-hero-copy {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header-copy,
.header-copy:hover {
  position: relative;
  min-height: 360px;
  padding: clamp(34px, 5vw, 64px);
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.06), transparent 46%),
    #101828;
  box-shadow: 0 26px 70px rgba(16, 24, 40, 0.18);
  transform: none;
}

.header-copy::before {
  content: "";
  position: absolute;
  right: -7rem;
  bottom: -9rem;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 54px rgba(91, 91, 214, 0.12),
    0 0 0 108px rgba(8, 167, 161, 0.06);
}

.header-copy::after {
  content: "VIDEO";
  position: absolute;
  right: 34px;
  top: 24px;
  color: rgba(255, 255, 255, 0.035);
  font-family: "Manrope", sans-serif;
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 1;
  pointer-events: none;
}

.header-copy > * {
  position: relative;
  z-index: 1;
}

.header-copy .eyebrow {
  color: #a9a9ff;
}

.header-copy .eyebrow::before {
  background: #6ee7df;
}

.eyebrow {
  margin-bottom: 22px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.site-title,
.detail-page-title,
.note-cover-title,
.group h2 {
  font-family: "Manrope", "Noto Sans SC", sans-serif;
}

.site-title {
  max-width: 760px;
  margin-bottom: 18px;
  background: none;
  color: #ffffff;
  font-size: clamp(2.45rem, 5vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.08;
  -webkit-text-fill-color: currentColor;
}

.site-title-nowrap {
  display: inline-block;
  white-space: nowrap;
}

.site-subtitle {
  max-width: 640px;
  color: #aeb8ca;
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  line-height: 1.8;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d6dce8;
  font-size: 12px;
  font-weight: 700;
}

.search-panel,
.search-panel:hover {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 4vw, 40px);
  border-radius: var(--radius-xl);
  transform: none;
  box-shadow: var(--shadow);
}

.search-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.search-panel-title {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.search-label {
  margin-bottom: 9px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.search-icon {
  left: 17px;
  width: 18px;
  height: 18px;
  color: #7b8494;
}

input[type=search] {
  padding: 16px 16px 16px 48px;
  border-color: var(--border-strong);
  border-radius: 13px;
  background: #f8f9fb;
  box-shadow: none;
  font-family: inherit;
  font-size: 14px;
}

input[type=search]::placeholder {
  color: #98a2b3;
}

input[type=search]:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.11);
  transform: none;
}

.search-hint {
  margin-top: 15px;
  color: #8b95a5;
  font-size: 12px;
  line-height: 1.7;
}

.main-content {
  padding-bottom: 88px;
}

.status-card {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
}

.group {
  margin: 0 0 56px;
  scroll-margin-top: 24px;
}

.group-heading {
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.group h2 {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.group-count {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  font-size: 11px;
}

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

.feed-card-link {
  min-width: 0;
}

.feed-card {
  display: flex;
  flex-direction: column;
  border-color: var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-subtle);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.feed-card::before {
  display: none;
}

.feed-card:hover {
  border-color: #cbd2df;
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.feed-card-cover {
  padding: 10px 10px 0;
}

.feed-card-figure,
.paper-figure-card {
  border-color: var(--border);
  border-radius: 13px;
  background: #f2f4f7;
  box-shadow: none;
}

.feed-card-figure {
  aspect-ratio: 16 / 10;
}

.paper-figure-image {
  transition: transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.feed-card:hover .paper-figure-image {
  transform: scale(1.025);
}

.paper-figure-badge {
  top: 10px;
  left: 10px;
  min-height: 26px;
  padding: 5px 9px;
  background: rgba(16, 24, 40, 0.74);
  font-size: 10px;
}

.feed-card-cover .note-cover {
  aspect-ratio: 16 / 10;
  border-radius: 13px;
}

.feed-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.feed-card-meta {
  gap: 6px;
  margin-bottom: 13px;
}

.feed-chip,
.meta-pill,
.reading-badge,
.reading-step,
.reading-step-note,
.note-chip {
  min-height: 26px;
  padding: 5px 9px;
  font-size: 10px;
}

.feed-chip,
.meta-pill,
.reading-step-note {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.feed-chip.subtle,
.reading-step,
.note-chip-muted {
  background: #f1f3f6;
  color: #697386;
}

.feed-card-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.48;
}

.feed-card-preview {
  display: block;
  margin-bottom: 22px;
  overflow: visible;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.75;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

.feed-card-footer {
  margin-top: auto;
  padding-top: 15px;
  border-color: var(--border);
}

.feed-card-action {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.feed-card-stats {
  color: #8a94a5;
  font-size: 10px;
}

.footer {
  padding: 34px 0 42px;
  border-top: 1px solid var(--border);
  color: #7b8494;
  font-size: 12px;
}

.footer a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.detail-page-header {
  padding-bottom: 28px;
}

.detail-page-topbar {
  margin-bottom: 18px;
}

.back-link,
.cover-preview-link,
.status-action {
  border-color: var(--border-strong);
  border-radius: 11px;
  background: #ffffff;
  box-shadow: none;
}

.back-link::before {
  content: "←";
  margin-right: 7px;
}

.back-link:hover,
.cover-preview-link:hover,
.status-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
  transform: translateY(-1px);
}

.detail-site-name {
  color: #7b8494;
  font-size: 12px;
  font-weight: 700;
}

.detail-hero-grid {
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
  align-items: stretch;
}

.detail-hero-cover,
.detail-hero-copy {
  min-width: 0;
}

.detail-hero-cover .paper-figure-card,
.detail-hero-cover .note-cover {
  height: 100%;
  min-height: 450px;
  border-radius: var(--radius-xl);
}

.detail-hero-cover .paper-figure-card {
  height: auto;
  min-height: 0;
}

.paper-figure-caption,
.reading-intro-hook,
.reading-intro-points {
  display: block;
  max-height: none;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.reading-intro-points li {
  max-height: none;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-line-clamp: unset;
}

.detail-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 4.5vw, 56px);
  border-radius: var(--radius-xl);
}

.detail-hero-copy .eyebrow {
  color: var(--accent);
}

.detail-page-title {
  margin-bottom: 20px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.12;
}

.detail-meta {
  margin-bottom: 18px;
  color: var(--text-secondary);
  font-size: 12px;
}

.detail-meta a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.detail-summary {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.85;
}

.detail-micro-meta {
  margin-top: 24px;
}

.detail-layout {
  padding-bottom: 88px;
}

.detail-shell {
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 22px;
}

.reading-flow {
  gap: 14px;
}

.reading-card {
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
}

.reading-card:hover {
  box-shadow: var(--shadow);
  transform: none;
}

.reading-card-section h2 {
  margin-bottom: 20px;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.reading-card-content p,
.reading-card-content li {
  color: #515b6b;
  font-size: 14px;
  line-height: 1.9;
}

.reading-card-content code {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.reading-card-content a {
  color: var(--accent);
}

.detail-toc {
  top: 20px;
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
}

.detail-toc-title {
  color: #8a94a5;
  font-size: 10px;
}

.detail-toc-link {
  border-radius: 10px;
  font-size: 12px;
}

.detail-toc-link:hover,
.detail-toc-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.detail-toc-link::before {
  background: var(--accent);
}

.paper-nav {
  gap: 14px;
  margin-top: 22px;
}

.paper-nav-link {
  padding: 20px;
  border-color: var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-subtle);
}

.paper-nav-link::before {
  display: none;
}

.paper-nav-link:hover {
  border-color: #cbd2df;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.paper-nav-label {
  color: var(--accent);
  font-size: 11px;
}

.paper-nav-title {
  font-size: 13px;
}

.cover-preview-page {
  background: var(--bg);
}

.cover-preview-toolbar {
  color: var(--text-secondary);
}

.feed-card-link:focus-visible,
.back-link:focus-visible,
.cover-preview-link:focus-visible,
.detail-toc-link:focus-visible,
.paper-nav-link:focus-visible,
input[type=search]:focus-visible,
.status-action:focus-visible {
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.14);
}

body.has-paper-modal,
body.has-image-lightbox {
  overflow: hidden;
}

.paper-figure-image[data-zoomable="true"] {
  cursor: zoom-in;
}

.paper-figure-image[data-zoomable="true"]:focus-visible {
  outline: 3px solid rgba(91, 91, 214, 0.5);
  outline-offset: -3px;
}

.paper-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px 36px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: visibility 200ms ease, opacity 200ms ease;
}

.paper-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.paper-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.paper-modal-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1420px, 100%);
  height: min(920px, calc(100dvh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: #f4f6fa;
  box-shadow: 0 36px 100px rgba(15, 23, 42, 0.38);
  transform: translateY(18px) scale(0.985);
  transition: transform 220ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.paper-modal.is-open .paper-modal-panel {
  transform: translateY(0) scale(1);
}

.paper-modal-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 62px;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.paper-modal-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 13px;
}

.paper-modal-kicker {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

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

.paper-modal-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.paper-modal-open-link,
.paper-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.paper-modal-open-link {
  padding: 8px 13px;
}

.paper-modal-close {
  width: 38px;
  padding: 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.paper-modal-open-link:hover,
.paper-modal-close:hover {
  border-color: #c5c9f5;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.paper-modal-open-link:focus-visible,
.paper-modal-close:focus-visible,
.image-lightbox button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.17);
}

.paper-modal-content {
  position: relative;
  min-height: 0;
  background: var(--bg);
}

.paper-modal-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity 180ms ease;
}

.paper-modal-frame.is-ready {
  opacity: 1;
}

.paper-modal-loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.paper-modal-loader.hidden {
  visibility: hidden;
  opacity: 0;
}

.paper-modal-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d9ddea;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: paper-modal-spin 700ms linear infinite;
}

@keyframes paper-modal-spin {
  to {
    transform: rotate(360deg);
  }
}

.embedded-detail {
  background: var(--bg);
}

.embedded-detail .page-noise,
.embedded-detail .page-blur,
.embedded-detail .detail-page-topbar,
.embedded-detail .footer {
  display: none;
}

.embedded-detail .container {
  width: min(1180px, calc(100% - 36px));
}

.embedded-detail .detail-page-header {
  padding: 20px 0 18px;
}

.embedded-detail .detail-layout {
  padding-bottom: 36px;
}

@media (min-width: 1041px) {
  .embedded-detail .detail-hero-copy {
    padding: 28px 32px;
  }

  .embedded-detail .detail-page-title {
    margin-bottom: 16px;
    font-size: clamp(1.6rem, 2.35vw, 2.15rem);
    line-height: 1.16;
    letter-spacing: -0.035em;
  }

  .embedded-detail .detail-hero-cover .paper-figure-card {
    height: 100%;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .embedded-detail .detail-hero-cover .paper-figure-image {
    min-height: 0;
    max-height: none;
  }
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1300;
  visibility: hidden;
  overflow: hidden;
  background: rgba(4, 8, 18, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: visibility 180ms ease, opacity 180ms ease;
}

.image-lightbox.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 78px 54px 92px;
}

.image-lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  cursor: zoom-in;
  user-select: none;
  touch-action: none;
  will-change: transform;
  transition: transform 120ms ease;
}

.image-lightbox-image.is-zoomed {
  cursor: grab;
}

.image-lightbox-image.is-dragging {
  cursor: grabbing;
  transition: none;
}

.image-lightbox-topbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  color: #ffffff;
}

.image-lightbox-caption {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-lightbox-caption.hidden {
  visibility: hidden;
}

.image-lightbox-close,
.image-lightbox-controls button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.image-lightbox-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 25px;
  line-height: 1;
}

.image-lightbox-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(12, 18, 30, 0.72);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.image-lightbox-controls button {
  min-width: 42px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
}

.image-lightbox-controls button:hover,
.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.image-lightbox-controls .image-lightbox-scale {
  min-width: 64px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

@media (max-width: 1040px) {
  .header-content {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  }

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

  .detail-hero-grid,
  .detail-shell {
    grid-template-columns: 1fr;
  }

  .detail-toc {
    position: static;
    order: -1;
  }

  .detail-toc-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100%, calc(100% - 28px));
  }

  .header {
    padding-top: 16px;
    padding-bottom: 28px;
  }

  .site-nav {
    margin-bottom: 14px;
  }

  .site-nav-status {
    max-width: 46%;
    text-align: right;
  }

  .header-content {
    grid-template-columns: 1fr;
  }

  .header-copy,
  .header-copy:hover {
    min-height: 330px;
    padding: 30px 24px;
  }

  .header-copy::after {
    right: 20px;
    top: 34px;
  }

  .site-title {
    font-size: clamp(2.3rem, 12vw, 3.55rem);
  }

  .search-panel,
  .search-panel:hover {
    padding: 24px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .group {
    margin-bottom: 44px;
  }

  .feed-card-title {
    font-size: 1.08rem;
  }

  .detail-page-topbar,
  .group-heading,
  .cover-preview-toolbar {
    flex-direction: row;
    align-items: center;
  }

  .detail-hero-cover .paper-figure-card,
  .detail-hero-cover .note-cover {
    min-height: 320px;
  }

  .detail-page-title {
    font-size: clamp(1.9rem, 10vw, 2.7rem);
  }

  .paper-nav {
    grid-template-columns: 1fr;
  }

  .paper-nav-next {
    grid-column: 1;
    text-align: left;
  }

  .paper-modal {
    padding: 0;
  }

  .paper-modal-panel {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .paper-modal-toolbar {
    min-height: 56px;
    padding: 8px 10px 8px 14px;
  }

  .paper-modal-heading {
    gap: 8px;
  }

  .paper-modal-kicker {
    display: none;
  }

  .paper-modal-title {
    max-width: 42vw;
    font-size: 11px;
  }

  .paper-modal-open-link {
    padding: 7px 9px;
    font-size: 10px;
  }

  .paper-modal-close {
    width: 36px;
    min-height: 36px;
  }

  .embedded-detail .container {
    width: min(100%, calc(100% - 24px));
  }

  .embedded-detail .detail-page-header {
    padding-top: 12px;
  }

  .image-lightbox-stage {
    padding: 68px 14px 88px;
  }

  .image-lightbox-topbar {
    padding: 12px 14px;
  }

  .image-lightbox-caption {
    max-width: calc(100vw - 76px);
  }

  .image-lightbox-controls {
    bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.site-nav-actions,
.detail-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.theme-toggle {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.16);
}

.theme-toggle-icons {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.theme-toggle-icon {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: scale(0.72) rotate(-18deg);
  transition: opacity 160ms ease, transform 180ms ease;
}

.theme-toggle[data-theme-preference="system"] .theme-toggle-icon-system,
.theme-toggle[data-theme-preference="light"] .theme-toggle-icon-light,
.theme-toggle[data-theme-preference="dark"] .theme-toggle-icon-dark {
  opacity: 1;
  transform: scale(1) rotate(0);
}

html[data-theme="dark"] {
  --bg: #0d1119;
  --bg-secondary: #121722;
  --surface: #151b26;
  --paper: #151b26;
  --paper-strong: #1b2230;
  --text: #f1f4f9;
  --text-secondary: #9da8b8;
  --border: #293141;
  --border-strong: #354052;
  --accent: #9292ff;
  --accent-strong: #b2b2ff;
  --accent-hover: #a6a6ff;
  --accent-soft: rgba(128, 128, 255, 0.14);
  --cyan: #38cfc5;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  --shadow-hover: 0 22px 52px rgba(0, 0, 0, 0.34);
  --shadow-subtle: 0 4px 14px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% -12%, rgba(111, 111, 232, 0.16), transparent 30rem),
    radial-gradient(circle at 96% 8%, rgba(8, 167, 161, 0.1), transparent 26rem),
    var(--bg);
}

html[data-theme="dark"] .page-noise {
  background-image: radial-gradient(rgba(226, 232, 240, 0.25) 0.6px, transparent 0.6px);
  opacity: 0.06;
}

html[data-theme="dark"] .site-brand-mark {
  background: var(--accent);
  color: #0d1119;
}

html[data-theme="dark"] .header-copy,
html[data-theme="dark"] .header-copy:hover {
  border-color: #2a3344;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.045), transparent 46%),
    #111722;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .search-panel,
html[data-theme="dark"] .status-card,
html[data-theme="dark"] .detail-toc,
html[data-theme="dark"] .reading-card,
html[data-theme="dark"] .detail-hero-copy,
html[data-theme="dark"] .feed-card,
html[data-theme="dark"] .paper-nav-link {
  background: var(--surface);
}

html[data-theme="dark"] input[type=search] {
  border-color: var(--border-strong);
  background: #101620;
  color: var(--text);
}

html[data-theme="dark"] input[type=search]:focus {
  background: #121a26;
}

html[data-theme="dark"] input[type=search]::placeholder {
  color: #717d90;
}

html[data-theme="dark"] .group-count,
html[data-theme="dark"] .back-link,
html[data-theme="dark"] .cover-preview-link,
html[data-theme="dark"] .status-action,
html[data-theme="dark"] .paper-modal-open-link,
html[data-theme="dark"] .paper-modal-close,
html[data-theme="dark"] .theme-toggle {
  background: #171e2a;
  color: var(--text);
}

html[data-theme="dark"] .feed-card-figure,
html[data-theme="dark"] .paper-figure-card {
  background: #101620;
}

html[data-theme="dark"] .paper-figure-card-detail .paper-figure-image {
  background: #f7f7f4;
}

html[data-theme="dark"] .paper-figure-caption {
  border-top-color: var(--border);
  background: #171e2a;
}

html[data-theme="dark"] .feed-chip.subtle,
html[data-theme="dark"] .reading-step,
html[data-theme="dark"] .note-chip-muted {
  background: #212938;
  color: #aeb8c8;
}

html[data-theme="dark"] .reading-card-content p,
html[data-theme="dark"] .reading-card-content li {
  color: #b4bdca;
}

html[data-theme="dark"] .reading-card-intro {
  border-color: #333d59;
  background: linear-gradient(135deg, #171e2d 0%, #151b27 100%);
}

html[data-theme="dark"] .reading-card-intro .reading-badge {
  background: rgba(146, 146, 255, 0.2);
  color: #c4c4ff;
}

html[data-theme="dark"] .reading-intro-points li {
  border-color: rgba(146, 146, 255, 0.3);
  background: #222a46;
  color: #eef0ff;
  box-shadow: inset 3px 0 0 rgba(146, 146, 255, 0.75);
}

html[data-theme="dark"] .paper-modal-panel,
html[data-theme="dark"] .paper-modal-content,
html[data-theme="dark"] .paper-modal-frame,
html[data-theme="dark"] .embedded-detail {
  background: var(--bg);
}

html[data-theme="dark"] .paper-modal-toolbar {
  border-bottom-color: var(--border);
  background: rgba(21, 27, 38, 0.97);
}

html[data-theme="dark"] .paper-modal-panel {
  border-color: #30394a;
}

@media (max-width: 760px) {
  .site-nav-actions,
  .detail-topbar-actions {
    gap: 8px;
  }

  .site-nav-status {
    max-width: none;
  }

  .site-nav-status,
  .detail-site-name {
    display: none;
  }

  .theme-toggle-label {
    display: none;
  }

  .theme-toggle {
    width: 38px;
    padding: 0;
  }
}
