@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Noto+Serif+SC:wght@500;600;700&display=swap");

:root {
  --bg: #f4efe7;
  --bg-accent: #ebe3d5;
  --surface: rgba(255, 252, 247, 0.82);
  --surface-strong: #fffaf2;
  --text: #26211c;
  --muted: #6f665e;
  --line: rgba(67, 53, 41, 0.14);
  --accent: #7b5d49;
  --accent-soft: rgba(123, 93, 73, 0.12);
  --shadow: 0 24px 60px rgba(58, 41, 25, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --container: min(1080px, calc(100vw - 32px));
  --progress-todo: #a0937d;
  --progress-reading: #5b8a72;
  --progress-done: #3d7a5f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(123, 93, 73, 0.08), transparent 20%),
    linear-gradient(180deg, #f7f2eb 0%, var(--bg) 100%);
  line-height: 1.72;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(123, 93, 73, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 93, 73, 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 88%);
}

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

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

.container {
  width: var(--container);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(244, 239, 231, 0.72);
  border-bottom: 1px solid rgba(67, 53, 41, 0.08);
}

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

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

.brand {
  font-family: "Noto Serif SC", serif;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
  background: rgba(255, 250, 242, 0.85);
  transform: translateY(-1px);
}

.hero {
  min-height: 56vh;
  display: flex;
  align-items: center;
  padding: 64px 0 56px;
}

.hero-copy,
.section-block,
.page-intro,
.link-card,
.catalog-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-copy {
  width: min(760px, 100%);
  padding: 40px;
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  font-family: "Noto Serif SC", serif;
  line-height: 1.28;
}

h1 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

h3 {
  font-size: 1.15rem;
}

.hero-lead {
  margin: 0 0 12px;
  font-size: 1.08rem;
  color: var(--accent);
}

.hero-note,
.intro-text,
.section-note,
.reading-summary,
.site-footer,
.hero-panel p {
  color: var(--muted);
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover,
.text-link:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--text);
  color: #fefaf5;
  box-shadow: 0 18px 28px rgba(38, 33, 28, 0.16);
}

.button-secondary {
  background: rgba(255, 250, 242, 0.9);
  border-color: var(--line);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
}

.section-block,
.page-intro {
  padding: 32px;
  margin-bottom: 28px;
}

.share-block {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 250, 242, 0.9)),
    var(--surface);
}

.share-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.share-input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.92);
  color: var(--text);
  font: inherit;
}

.share-tip {
  margin: 12px 0 0;
  color: var(--muted);
}

.loading-card {
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(123, 93, 73, 0.28);
  background: rgba(255, 250, 242, 0.88);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.error-card {
  margin-bottom: 28px;
}

.section-heading {
  margin-bottom: 24px;
}

.updates-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.updates-list li {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.updates-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.update-date {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.page-intro {
  margin-top: 34px;
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.92rem;
}

.back-link:hover {
  text-decoration: underline;
}

.intro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.intro-chips span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.88);
  border: 1px solid var(--line);
  color: var(--muted);
}

.progress-stats:empty {
  display: none;
}

/* ── Search & Filter ── */

.filter-block {
  padding: 20px 32px;
}

.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent);
}

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

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.filter-chips:empty {
  display: none;
}

.filter-group-label {
  color: var(--muted);
  font-size: 0.88rem;
  margin-right: 2px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-chip:hover {
  border-color: rgba(123, 93, 73, 0.34);
}

.filter-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

/* ── Mini TOC ── */

.mini-toc-wrapper {
  margin-bottom: 20px;
}

.mini-toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  box-shadow: var(--shadow);
}

.mini-toc summary {
  font-size: 0.95rem;
}

.mini-toc ol {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.mini-toc a {
  color: var(--accent);
  font-size: 0.94rem;
}

.mini-toc a:hover {
  text-decoration: underline;
}

/* ── Back to Top ── */

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(58, 41, 25, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-2px);
}

/* ── Progress Button ── */

.item-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.item-footer details {
  flex: 1;
  min-width: 0;
}

.progress-btn {
  flex-shrink: 0;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.92);
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.progress-btn:hover {
  border-color: rgba(123, 93, 73, 0.34);
}

.progress-btn.progress-todo {
  background: rgba(160, 147, 125, 0.12);
  border-color: var(--progress-todo);
  color: var(--progress-todo);
}

.progress-btn.progress-reading {
  background: rgba(91, 138, 114, 0.12);
  border-color: var(--progress-reading);
  color: var(--progress-reading);
}

.progress-btn.progress-done {
  background: rgba(61, 122, 95, 0.15);
  border-color: var(--progress-done);
  color: var(--progress-done);
}

/* ── Catalog Page ── */

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

.catalog-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.catalog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(123, 93, 73, 0.28);
}

.catalog-desc {
  color: var(--muted);
  flex: 1;
}

.catalog-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.catalog-enter {
  align-self: flex-start;
  font-size: 0.92rem;
  min-height: 40px;
  padding: 0 18px;
}

.search-source-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

.search-source-tag:hover {
  text-decoration: underline;
}

/* ── Reading Items ── */

.reading-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.reading-item {
  padding: 24px 24px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.86);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.reading-item:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 93, 73, 0.28);
}

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

.reading-badges {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.reading-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.reading-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.reading-author {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.98rem;
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(123, 93, 73, 0.35);
  text-underline-offset: 3px;
  word-break: break-word;
}

.reading-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.reading-link {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(123, 93, 73, 0.18);
  background: rgba(255, 250, 242, 0.96);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.reading-link:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 93, 73, 0.34);
  box-shadow: 0 12px 24px rgba(58, 41, 25, 0.08);
}

.reading-link-label {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}

.reading-link-meta {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  word-break: break-all;
}

.reading-item em {
  font-style: italic;
}

details {
  margin-top: 14px;
  border-top: 1px dashed rgba(67, 53, 41, 0.16);
  padding-top: 14px;
}

summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--text);
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "＋";
  float: right;
  color: var(--accent);
}

details[open] summary::after {
  content: "－";
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
}

.reading-list-compact .reading-item {
  background: rgba(255, 248, 240, 0.9);
}

.comments-block {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 250, 242, 0.92)),
    var(--surface);
}

.giscus-shell {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(123, 93, 73, 0.24);
  background: rgba(255, 250, 242, 0.88);
  color: var(--muted);
}

.giscus-shell code {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(123, 93, 73, 0.1);
  color: var(--accent);
}

.giscus {
  margin-top: 20px;
}

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

.link-card {
  padding: 26px;
}

.placeholder-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.inline-note {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 242, 0.88);
  border: 1px dashed rgba(123, 93, 73, 0.26);
  color: var(--muted);
}

.site-footer {
  padding: 14px 0 34px;
}

.site-footer a {
  color: var(--accent);
}

@media (max-width: 900px) {
  .hero {
    padding-top: 36px;
  }

  .links-grid,
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 0;
  }

  .hero-copy,
  .section-block,
  .page-intro,
  .link-card,
  .catalog-card {
    padding: 22px;
    border-radius: 22px;
  }

  .filter-block {
    padding: 16px 22px;
  }

  .updates-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .reading-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .reading-badges {
    justify-content: flex-start;
  }

  .share-row {
    flex-direction: column;
    align-items: stretch;
  }

  .item-footer {
    flex-direction: column;
  }

  .progress-btn {
    align-self: flex-end;
    margin-top: 0;
  }

  .back-to-top {
    bottom: 20px;
    right: 16px;
  }
}
