/* =========================================================
   余映潮 · 语文潮  个人主页样式
   设计方向：Quiet Craft（沉静匠气）+ 中式学者质感
   配色：墨色 / 宣纸 / 潮水青 / 印章红
   ========================================================= */

/* ---------- 设计变量 ---------- */
:root {
  --ink:        #1f2328;   /* 墨色 主文字 */
  --ink-soft:   #4a5159;   /* 次级文字 */
  --ink-mute:   #8b9199;   /* 辅助文字 */
  --paper:      #faf7f0;   /* 宣纸 底色 */
  --paper-2:    #f3eee2;   /* 宣纸 深 */
  --line:       #e4dcc9;   /* 分隔线 */
  --tide:       #2c5f5d;   /* 潮水青 主强调 */
  --tide-deep:  #1f4a48;   /* 潮水深 */
  --tide-soft:  #e8efed;   /* 潮水浅底 */
  --seal:       #9c2b25;   /* 印章红 */
  --seal-soft:  #b9443c;
  --gold:       #a8864a;   /* 暗金 点缀 */

  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans:  "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --brush:"Ma Shan Zheng", "Noto Serif SC", cursive;

  --maxw: 1120px;
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(31,35,40,.04), 0 2px 8px rgba(31,35,40,.04);
  --shadow-md: 0 4px 16px rgba(31,35,40,.06), 0 12px 32px rgba(31,35,40,.06);
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* 选区配色 */
::selection { background: var(--tide); color: #fff; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 247, 240, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(250,247,240,.94); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-seal {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--seal); color: #faf7f0;
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px rgba(156,43,37,.15);
  letter-spacing: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: .08em; }
.brand-sub { font-size: 11px; color: var(--ink-mute); letter-spacing: .12em; margin-top: 2px; }

.nav-links { display: flex; gap: 6px; }
.nav-links a {
  padding: 8px 14px; font-size: 14px; color: var(--ink-soft);
  border-radius: var(--radius);
  transition: color .2s var(--ease), background .2s var(--ease);
  position: relative;
}
.nav-links a:hover { color: var(--tide); background: var(--tide-soft); }
.nav-links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; background: var(--tide);
  transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .3s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero 首页 ---------- */
.hero {
  position: relative;
  padding: 90px 0 120px;
  background:
    radial-gradient(ellipse 80% 60% at 80% 0%, rgba(44,95,93,.06), transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 30%, rgba(156,43,37,.04), transparent 55%),
    var(--paper);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 64px;
  align-items: center;
}

.hero-eyebrow {
  font-size: 13px; color: var(--tide); letter-spacing: .18em;
  font-weight: 500; margin-bottom: 22px;
  display: inline-flex; align-items: center; gap: 10px;
}
.hero-eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--tide); }

.hero-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(64px, 11vw, 132px);
  line-height: 1;
  letter-spacing: .04em;
  color: var(--ink);
  margin-bottom: 8px;
}
.title-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: charIn .7s var(--ease) forwards;
}
.title-char:nth-child(1) { animation-delay: .05s; }
.title-char:nth-child(2) { animation-delay: .18s; }
.title-char:nth-child(3) { animation-delay: .31s; }
@keyframes charIn { to { opacity: 1; transform: translateY(0); } }

.hero-en {
  font-size: 13px; letter-spacing: .42em; color: var(--ink-mute);
  margin-bottom: 28px; padding-left: 4px;
}

.hero-tagline {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 24px;
}

.hero-meta {
  font-size: 13px; color: var(--ink-mute); letter-spacing: .04em;
  margin-bottom: 36px;
}
.hero-meta .dot { margin: 0 10px; color: var(--line); }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 28px; font-size: 14px; font-weight: 500; letter-spacing: .06em;
  border-radius: var(--radius);
  transition: all .25s var(--ease);
}
.btn-primary { background: var(--tide); color: #faf7f0; box-shadow: 0 4px 14px rgba(44,95,93,.25); }
.btn-primary:hover { background: var(--tide-deep); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(44,95,93,.3); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--tide); color: var(--tide); }

/* 名片卡片 */
.hero-card {
  position: relative;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 32px 28px;
  box-shadow: var(--shadow-md);
}
.hero-card::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid rgba(228,220,201,.6);
  border-radius: 2px; pointer-events: none;
}
.card-seal {
  position: absolute; top: -18px; right: 24px;
  background: var(--seal); color: #faf7f0;
  font-family: var(--serif); font-weight: 700; font-size: 13px;
  padding: 8px 14px; border-radius: 2px;
  letter-spacing: .15em;
  box-shadow: 0 4px 10px rgba(156,43,37,.3);
}
.card-list { margin-bottom: 18px; }
.card-list > div {
  display: grid; grid-template-columns: 56px 1fr; gap: 16px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.card-list > div:last-child { border-bottom: none; }
.card-list dt { font-size: 13px; color: var(--ink-mute); letter-spacing: .1em; }
.card-list dd { font-size: 14px; color: var(--ink); font-weight: 500; }
.card-foot { font-size: 11px; color: var(--ink-mute); text-align: center; letter-spacing: .05em; }

/* 装饰浪纹 */
.hero-wave {
  position: absolute; left: 0; right: 0; bottom: 0; height: 60px;
  background-image:
    radial-gradient(circle at 12px 0, transparent 12px, var(--paper) 12px);
  background-size: 32px 32px;
  background-position: 0 32px;
  opacity: .7;
}

/* ---------- 通用 Section ---------- */
.section { padding: 96px 0; }
.section--paper { background: var(--paper-2); }
.section--ink { background: var(--ink); color: #f3eee2; }

.section-head { margin-bottom: 56px; max-width: 640px; }
.section-head--light .section-title,
.section-head--light .section-desc { color: #f3eee2; }
.section-head--light .section-desc { color: rgba(243,238,226,.7); }
.section-head--light .section-num { color: var(--seal-soft); border-color: rgba(243,238,226,.2); }

.section-num {
  display: inline-block;
  font-family: var(--serif); font-weight: 500;
  font-size: 15px; color: var(--seal);
  padding: 4px 14px; border: 1px solid var(--line);
  border-radius: 2px; letter-spacing: .1em;
  margin-bottom: 18px;
}
.section-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(30px, 4vw, 42px);
  color: var(--ink); letter-spacing: .04em;
  margin-bottom: 14px;
}
.section-desc { font-size: 15px; color: var(--ink-soft); line-height: 1.8; }

/* ---------- 教学主张 三大支柱 ---------- */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.pillar {
  position: relative;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 32px 36px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.pillar:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--tide); }
.pillar--accent { background: var(--ink); color: #f3eee2; border-color: var(--ink); }
.pillar--accent .pillar-name { color: #fff; }
.pillar--accent .pillar-en { color: rgba(243,238,226,.6); }
.pillar--accent .pillar-text { color: rgba(243,238,226,.85); }
.pillar--accent .pillar-no { color: var(--seal-soft); }
.pillar--accent:hover { border-color: var(--tide); }

.pillar-no {
  font-family: var(--serif); font-weight: 300; font-size: 44px;
  color: var(--tide); line-height: 1; margin-bottom: 24px;
  letter-spacing: .02em;
}
.pillar-name {
  font-family: var(--serif); font-weight: 700; font-size: 24px;
  color: var(--ink); margin-bottom: 4px; letter-spacing: .04em;
}
.pillar-en {
  font-size: 12px; color: var(--ink-mute); letter-spacing: .2em;
  text-transform: uppercase; margin-bottom: 18px;
}
.pillar-text { font-size: 14.5px; line-height: 1.85; color: var(--ink-soft); }

.pillar-note {
  margin-top: 32px;
  font-size: 15px; line-height: 1.95; color: var(--ink-soft);
  background: #fffdf7; border: 1px solid var(--line);
  border-left: 3px solid var(--seal);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.pillar-note strong { color: var(--tide); font-weight: 600; }

/* ---------- 重要文章 列表 ---------- */
.article-list { display: grid; gap: 18px; }
.article-item {
  display: grid; grid-template-columns: 130px 1fr; gap: 32px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.article-item:hover { border-color: var(--tide); box-shadow: var(--shadow-sm); }

.article-meta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.article-cat {
  font-size: 12px; font-weight: 500; color: var(--tide);
  background: var(--tide-soft); padding: 4px 12px; border-radius: 2px;
  letter-spacing: .08em;
}
.article-date { font-size: 12px; color: var(--ink-mute); letter-spacing: .04em; }

.article-body { min-width: 0; }
.article-title {
  font-family: var(--serif); font-weight: 600; font-size: 20px;
  color: var(--ink); margin-bottom: 10px; letter-spacing: .02em;
  line-height: 1.4;
}
.article-excerpt { font-size: 14.5px; color: var(--ink-soft); line-height: 1.85; margin-bottom: 14px; }

.article-toggle {
  font-size: 13px; color: var(--tide); font-weight: 500;
  padding: 4px 0; letter-spacing: .06em;
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap .25s var(--ease), color .2s;
}
.article-toggle::after { content: "▾"; font-size: 10px; transition: transform .3s var(--ease); }
.article-toggle:hover { color: var(--tide-deep); gap: 10px; }
.article-toggle.is-open::after { transform: rotate(180deg); }

.article-detail {
  max-height: 0; overflow: hidden;
  transition: max-height .45s var(--ease), margin-top .45s var(--ease), opacity .3s;
  opacity: 0;
}
.article-detail.is-open { max-height: 480px; margin-top: 14px; opacity: 1; }
.article-detail p {
  font-size: 14px; color: var(--ink-soft); line-height: 1.9;
  padding: 16px 18px; background: var(--paper); border-left: 3px solid var(--tide);
  border-radius: 2px;
}
.article-detail strong { color: var(--tide); font-weight: 600; }

/* ---------- 代表著作 ---------- */
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.book {
  display: flex; flex-direction: column;
  background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.book:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.book-cover {
  height: 220px; padding: 32px 28px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--tide-deep); color: #f3eee2;
  position: relative;
}
.book-cover::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid rgba(243,238,226,.25);
}
.book-cover--alt { background: var(--ink); }
.book-cover--accent { background: var(--seal); }
.book-cover-title {
  font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.35;
  letter-spacing: .04em; position: relative; z-index: 1;
}
.book-cover-author { font-size: 12px; letter-spacing: .15em; opacity: .8; position: relative; z-index: 1; }
.book-cover-pub { font-size: 11px; letter-spacing: .1em; opacity: .6; position: relative; z-index: 1; }

.book-info { padding: 24px 26px 28px; }
.book-title {
  font-family: var(--serif); font-weight: 600; font-size: 17px;
  color: var(--ink); margin-bottom: 4px; line-height: 1.4;
}
.book-meta { font-size: 12px; color: var(--tide); letter-spacing: .08em; margin-bottom: 12px; }
.book-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.8; }

/* ---------- 教学语录 ---------- */
.quotes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.quote {
  padding: 36px 32px; border: 1px solid rgba(243,238,226,.12);
  border-radius: var(--radius); position: relative;
  transition: border-color .3s, background .3s;
}
.quote:hover { border-color: var(--seal-soft); background: rgba(243,238,226,.03); }
.quote--feature { grid-column: span 2; background: rgba(156,43,37,.08); border-color: rgba(156,43,37,.2); }
.quote p {
  font-family: var(--serif); font-size: 20px; font-weight: 400; line-height: 1.7;
  color: #f3eee2; margin-bottom: 16px;
}
.quote--feature p { font-size: 28px; font-weight: 500; }
.quote cite { font-size: 13px; color: var(--seal-soft); letter-spacing: .08em; font-style: normal; }
.quote::before {
  content: "“"; position: absolute; top: 8px; left: 20px;
  font-family: var(--serif); font-size: 60px; color: var(--seal-soft);
  opacity: .3; line-height: 1;
}

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: start; }
.about-text p { font-size: 15.5px; color: var(--ink-soft); line-height: 2; margin-bottom: 20px; }
.about-text p:first-letter {
  font-family: var(--serif); font-weight: 700; color: var(--tide);
}
.about-side { display: grid; gap: 20px; }
.about-stat {
  background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 30px; display: flex; align-items: baseline; gap: 16px;
  transition: border-color .25s, transform .25s;
}
.about-stat:hover { border-color: var(--tide); transform: translateX(4px); }
.stat-num {
  font-family: var(--serif); font-weight: 700; font-size: 44px;
  color: var(--tide); line-height: 1;
}
.stat-unit { font-size: 18px; color: var(--ink-mute); font-weight: 400; margin-left: 2px; }
.stat-label { font-size: 14px; color: var(--ink-soft); }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--ink); color: rgba(243,238,226,.8);
  padding: 56px 0 40px;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-seal {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--seal); color: #faf7f0;
  font-family: var(--serif); font-weight: 700; font-size: 24px;
  border-radius: 2px;
}
.footer-name { font-family: var(--serif); font-weight: 600; font-size: 16px; color: #f3eee2; letter-spacing: .08em; }
.footer-url { font-size: 12px; color: rgba(243,238,226,.5); letter-spacing: .1em; }
.footer-copy { font-size: 13px; line-height: 1.9; color: rgba(243,238,226,.65); }
.footer-note { font-size: 11.5px; color: rgba(243,238,226,.4); max-width: 560px; line-height: 1.8; padding-top: 8px; border-top: 1px solid rgba(243,238,226,.1); margin-top: 8px; }

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed; right: 28px; bottom: 28px; z-index: 90;
  width: 46px; height: 46px;
  background: var(--ink); color: #f3eee2;
  border-radius: 50%;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .25s;
  box-shadow: var(--shadow-md);
}
.back-top.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { background: var(--tide); transform: translateY(-3px); }

/* ---------- 滚动渐入 ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-card { max-width: 460px; }
  .pillars { grid-template-columns: 1fr; }
  .books { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .quotes { grid-template-columns: 1fr; }
  .quote--feature { grid-column: span 1; }
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px; gap: 4px;
  }
  .nav-links.is-open a { padding: 12px 14px; }

  .hero { padding: 56px 0 80px; }
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }

  .article-item { grid-template-columns: 1fr; gap: 14px; padding: 22px; }
  .article-meta { flex-direction: row; align-items: center; }
  .books { grid-template-columns: 1fr; }
  .quote p { font-size: 17px; }
  .quote--feature p { font-size: 22px; }
  .back-top { right: 18px; bottom: 18px; }
}

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .title-char { opacity: 1; transform: none; }
}

/* ==================== 内容库（v2 新增） ==================== */
.section--lib {
  background: linear-gradient(180deg, var(--paper) 0%, #f5f0e5 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.lib-card {
  background: #fffdf8;
  padding: 36px 22px 32px;
  text-align: center;
  transition: background .35s var(--ease);
}

.lib-card:hover { background: #ffffff; }

.lib-num {
  display: block;
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: var(--tide);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.lib-num em {
  font-style: normal;
  font-size: 24px;
  vertical-align: 14px;
  margin-left: 1px;
  color: var(--gold);
}

.lib-label {
  display: block;
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: .02em;
}

.lib-note {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-mute);
  letter-spacing: .04em;
}

@media (max-width: 960px) {
  .lib-grid { grid-template-columns: repeat(2, 1fr); }
  .lib-num { font-size: 40px; }
}

@media (max-width: 720px) {
  .lib-card { padding: 26px 14px 24px; }
  .lib-num { font-size: 34px; }
  .lib-label { font-size: 14px; }
}

/* 内容库可点卡片（v3） */
.lib-card--on {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.lib-card--on:hover { background: #ffffff; }
.lib-card--on:hover .lib-num { color: var(--tide-deep); }
.lib-go {
  display: block;
  margin-top: 12px;
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--gold);
  opacity: 0;
  transform: translateY(-3px);
  transition: all .3s var(--ease);
}
.lib-card--on:hover .lib-go { opacity: 1; transform: translateY(0); }
@media (max-width: 720px) {
  .lib-go { opacity: 1; transform: none; }
}
