/* ============================================
   慢者生存 — 优化版样式表
   字体: 思源黑体 (Noto Sans SC) — 圆滑现代
   ============================================ */

:root {
  /* 色彩系统 */
  --bg: #FBF8F3;
  --bgc: #FFFFFF;
  --bgs: #F6F1E8;
  --t: #1A1611;
  --t2: #524739;
  --t3: #968773;
  --a: #B86B1A;
  --ah: #9C5810;
  --ap: #F2DCC0;
  --accent-soft: rgba(184, 107, 26, 0.08);
  --bd: rgba(180, 100, 20, 0.10);
  --bdh: rgba(180, 100, 20, 0.22);
  --sh: 0 4px 24px rgba(160, 80, 10, 0.06);
  --shl: 0 12px 44px rgba(160, 80, 10, 0.10);
  --r1: 10px;
  --r2: 16px;
  --r3: 24px;
  --r4: 32px;

  /* 字体 — 圆滑无衬线为主 */
  --ff: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", system-ui, -apple-system, sans-serif;
  --fs: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", system-ui, -apple-system, sans-serif;

  /* 布局 */
  --nh: 64px;
  --content-w: 720px;
  --wide-w: 960px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nh) + 24px);
}

body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--t);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.8;
  font-feature-settings: "palt";
}

::selection { background: var(--ap); color: var(--ah); }

a { color: var(--a); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--ah); }

/* ====== 进度条 ====== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--a), #D4831E);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* ====== 导航 ====== */
nav.t {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nh);
  background: rgba(251, 248, 243, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bd);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 5vw, 2.5rem);
}

.nb {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--t);
  font-family: var(--ff);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ni {
  width: 34px; height: 34px;
  border-radius: var(--r1);
  background: linear-gradient(135deg, var(--a), #D4831E);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(184, 107, 26, 0.3);
}

.nr {
  font-family: var(--fs);
  font-size: 0.8rem;
  color: var(--t3);
  font-weight: 400;
}

/* 目录抽屉按钮 */
.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--t);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.nav-links a {
  font-family: var(--fs);
  font-size: 0.85rem;
  color: var(--t2);
  font-weight: 400;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--a); }

/* ====== 封面 ====== */
.cv {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nh) + 3rem) 2rem 5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.cv-bg-wrap {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
}

.cv-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
}

.cv-glow-1 {
  width: 700px; height: 700px;
  top: -250px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(184, 107, 26, 0.18) 0%, transparent 70%);
}

.cv-glow-2 {
  width: 500px; height: 500px;
  bottom: -150px; right: -5%;
  background: radial-gradient(circle, rgba(200, 100, 20, 0.12) 0%, transparent 70%);
}

.cv-glow-3 {
  width: 400px; height: 400px;
  top: 30%; left: -10%;
  background: radial-gradient(circle, rgba(240, 180, 60, 0.08) 0%, transparent 70%);
}

.cv-line {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(184, 107, 26, 0.12) 30%, rgba(184, 107, 26, 0.12) 70%, transparent);
}

.cv-i {
  position: relative;
  z-index: 1;
  max-width: 760px;
  width: 100%;
}

.cv-top {
  animation: fadeIn 0.8s ease-out 0.05s both;
  margin-bottom: 2rem;
}

.bg {
  font-family: var(--fs);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--a);
  padding: 6px 18px;
  background: var(--ap);
  border: 1px solid var(--bdh);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cv-title-block {
  animation: fadeIn 0.8s ease-out 0.18s both;
  margin-bottom: 1.5rem;
}

.cv-ttl-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.ct {
  font-family: var(--ff);
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 700;
  color: var(--t);
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}

.cv-ttl-sub {
  font-family: var(--fs);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  color: var(--t3);
  text-transform: uppercase;
  margin-top: 0.8rem;
  animation: fadeIn 0.8s ease-out 0.28s both;
}

.cv-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.6rem auto;
  animation: fadeIn 0.8s ease-out 0.38s both;
}

.cv-divider-line {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--a), transparent);
}

.cv-divider-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--a);
  flex-shrink: 0;
}

.cv-quote-block {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 3rem auto 0;
  animation: fadeIn 0.8s ease-out 0.85s both;
}

.cq {
  padding: 2rem 2.5rem;
  background: var(--bgc);
  border: 1px solid var(--bd);
  border-radius: var(--r4);
  box-shadow: var(--sh);
  text-align: left;
  position: relative;
}

.cq::before {
  content: '\201C';
  position: absolute;
  top: 0.6rem; left: 1.2rem;
  font-size: 3.5rem;
  color: var(--a);
  opacity: 0.15;
  font-family: Georgia, serif;
  line-height: 1;
}

.cq p {
  font-size: 0.95rem;
  line-height: 2;
  color: var(--t2);
}

.cm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-family: var(--fs);
  font-size: 0.8rem;
  color: var(--t3);
  margin: 1.8rem 0 2.2rem;
  animation: fadeIn 0.8s ease-out 0.58s both;
}

.cm-i { display: flex; align-items: center; gap: 0.4rem; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 44px;
  background: linear-gradient(135deg, var(--a), #D4831E);
  color: #fff;
  border-radius: var(--r2);
  font-family: var(--fs);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 28px rgba(184, 107, 26, 0.25), 0 2px 8px rgba(184, 107, 26, 0.15);
  animation: fadeIn 0.8s ease-out 0.68s both;
  border: none;
  cursor: pointer;
}

.cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 38px rgba(184, 107, 26, 0.32), 0 3px 12px rgba(184, 107, 26, 0.2);
  color: #fff;
}

.cta-arrow {
  display: inline-block;
  transition: transform 0.3s;
}

.cta:hover .cta-arrow { transform: translateX(4px); }

/* ====== 章节列表 ====== */
.cs2 {
  padding: 5rem 2rem 5rem;
  background: var(--bgs);
  border-top: 1px solid var(--bd);
}

.cs2-i {
  max-width: var(--wide-w);
  margin: 0 auto;
}

.sh {
  text-align: center;
  margin-bottom: 3rem;
}

.sh-l {
  font-family: var(--fs);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--a);
  display: block;
  margin-bottom: 0.8rem;
}

.sh h2 {
  font-family: var(--ff);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
}

.cc {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: var(--bgc);
  border: 1px solid var(--bd);
  border-radius: var(--r3);
  text-decoration: none;
  color: var(--t);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.cc::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--a), #D4831E);
  opacity: 0;
  transition: opacity 0.3s;
}

.cc:hover {
  border-color: var(--a);
  transform: translateX(4px);
  box-shadow: var(--sh);
  color: var(--t);
}

.cc:hover::before { opacity: 1; }

.cn {
  font-family: var(--fs);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--a);
  min-width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--ap);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}

.cc:hover .cn {
  background: var(--a);
  color: #fff;
}

.ci { flex: 1; min-width: 0; }

.ct2 {
  font-family: var(--ff);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.4;
}

.cd {
  font-family: var(--fs);
  font-size: 0.76rem;
  color: var(--t3);
  margin-top: 0.2rem;
}

.ca {
  color: var(--a);
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.3s;
  flex-shrink: 0;
}

.cc:hover .ca { opacity: 1; transform: translateX(0); }

/* ====== 文章页 ====== */
.article-wrap {
  padding-top: var(--nh);
}

.article-header {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
}

.article-header .eyebrow {
  font-family: var(--fs);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--a);
  margin-bottom: 1rem;
}

.article-header h1 {
  font-family: var(--ff);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-bottom: 0.8rem;
}

.article-header .subtitle {
  font-family: var(--fs);
  font-size: 0.95rem;
  color: var(--t3);
  font-weight: 400;
}

.article-header .divider {
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--a), #D4831E);
  border-radius: 2px;
  margin: 1.5rem auto 0;
}

article.al {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

article.al h1 {
  font-family: var(--ff);
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.35;
  color: var(--t);
}

article.al h1:first-child { margin-top: 0; }

article.al h3 {
  font-family: var(--ff);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--t);
  letter-spacing: 0.01em;
  position: relative;
  padding-left: 0;
}

article.al h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.15rem;
  background: linear-gradient(180deg, var(--a), #D4831E);
  border-radius: 2px;
  margin-right: 0.6rem;
  vertical-align: -0.1rem;
}

article.al p {
  font-family: var(--ff);
  font-size: 1.0625rem;
  line-height: 2.05;
  color: var(--t2);
  margin-bottom: 1.4rem;
  text-align: justify;
  letter-spacing: 0.01em;
  word-break: break-word;
}

article.al p:first-of-type {
  font-size: 1.1rem;
  color: var(--t2);
  font-weight: 400;
}

/* ====== 章节 Prev/Next 导航 ====== */
.chapter-nav {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1rem;
  border-top: 1px solid var(--bd);
  margin-top: 2rem;
}

.cn-link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.2rem;
  border-radius: var(--r2);
  background: var(--bgc);
  border: 1px solid var(--bd);
  text-decoration: none;
  transition: all 0.25s;
  flex: 1;
  max-width: 48%;
}

.cn-link:hover {
  border-color: var(--a);
  box-shadow: var(--sh);
}

.cn-label {
  font-family: var(--fs);
  font-size: 0.74rem;
  color: var(--t3);
}

.cn-title {
  font-family: var(--ff);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--t);
}

.cn-link.next {
  text-align: right;
  margin-left: auto;
}

.cn-link.placeholder { visibility: hidden; pointer-events: none; }

/* ====== 回到顶部 ====== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bgc);
  border: 1px solid var(--bd);
  box-shadow: var(--sh);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 800;
  color: var(--a);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--a);
  background: var(--ap);
}

/* ====== Footer ====== */
footer.ft {
  background: var(--t);
  color: rgba(255, 255, 255, 0.6);
  padding: 3.5rem 2rem;
  text-align: center;
}

.ftt {
  font-family: var(--ff);
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
}

.ftd {
  font-family: var(--fs);
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.6rem;
}

.fth {
  width: 36px; height: 2px;
  background: var(--a);
  border-radius: 2px;
  margin: 1.4rem auto;
}

.ftn {
  font-family: var(--fs);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.05em;
}

.ftn a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: color 0.2s;
}

.ftn a:hover { color: var(--a); }

/* ====== 目录侧边栏 (桌面) ====== */
.toc-sidebar {
  position: fixed;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 500;
  display: none;
}

.toc-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-sidebar a {
  display: block;
  font-family: var(--fs);
  font-size: 0.74rem;
  color: var(--t3);
  padding: 0.35rem 0;
  padding-left: 0.8rem;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  line-height: 1.5;
}

.toc-sidebar a:hover,
.toc-sidebar a.active {
  color: var(--a);
  border-color: var(--a);
}

/* ====== 移动端目录按钮 ====== */
.mobile-toc {
  display: none;
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bgc);
  border: 1px solid var(--bd);
  box-shadow: var(--sh);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 800;
  color: var(--a);
}

/* ====== 移动端目录面板 ====== */
.toc-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 60vh;
  background: var(--bgc);
  border-top: 1px solid var(--bdh);
  border-radius: var(--r4) var(--r4) 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  z-index: 950;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.toc-panel.open { transform: translateY(0); }

.toc-panel h4 {
  font-family: var(--ff);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.toc-panel ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.toc-panel a {
  display: block;
  font-family: var(--fs);
  font-size: 0.82rem;
  color: var(--t2);
  padding: 0.6rem 0.8rem;
  border-radius: var(--r1);
  background: var(--bgs);
  transition: all 0.2s;
}

.toc-panel a:hover,
.toc-panel a.current {
  background: var(--ap);
  color: var(--a);
}

.toc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 940;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.toc-overlay.open { opacity: 1; pointer-events: auto; }

/* ====== 动画 ====== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 长文阅读进度动画 */
.fade-in {
  animation: fadeIn 0.6s ease-out both;
}

/* ====== 响应式适配 ====== */
@media (max-width: 1024px) {
  .toc-sidebar { display: none; }
}

@media (min-width: 1400px) {
  .toc-sidebar { display: block; }
}

@media (max-width: 768px) {
  html { font-size: 16px; }

  nav.t { padding: 0 1rem; }

  .nr { display: none; }

  .cv {
    padding: calc(var(--nh) + 2rem) 1.25rem 4rem;
    min-height: 100svh;
  }

  .cv-ttl-row { gap: 1rem; }
  .ct { letter-spacing: 0.04em; }
  .cq { padding: 1.6rem 1.5rem; }
  .cq p { font-size: 0.9rem; }

  .cs2 { padding: 4rem 1rem 4rem; }
  .cl { grid-template-columns: 1fr; }

  article.al {
    padding: 1.5rem 1.25rem 3rem;
  }

  article.al p {
    font-size: 1rem;
    line-height: 2;
    text-align: left;
  }

  .article-header { padding: 2rem 1.25rem 1rem; }

  .chapter-nav {
    flex-direction: column;
    padding: 1.5rem 1.25rem 3rem;
  }

  .cn-link { max-width: 100%; }

  .mobile-toc { display: flex; }

  .back-to-top { bottom: 1rem; right: 1rem; }

  .nav-links { display: none; }
  .nav-menu-btn { display: block; }

  .toc-panel ul { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  html { font-size: 15px; }
  .ct { font-size: clamp(2.5rem, 14vw, 4rem); }
}

/* ====== 打印优化 ====== */
@media print {
  nav.t, .scroll-progress, .back-to-top, .toc-sidebar, .mobile-toc, .chapter-nav { display: none; }
  body { font-size: 12pt; line-height: 1.8; }
  article.al { max-width: 100%; }
}
