/* ============================================================
   鸣鹤子学 — 品牌定制样式
   配色：暖白底 + 墨色字 + 朱砂红点缀
   字体：思源黑体（标题/导航）+ 思源宋体（正文）
   ============================================================ */

/* --- @font-face declarations --- */
/* v2: 只保留2个字重（Heavy标题 + Medium正文），减少加载量 */

@font-face {
  font-family: 'SourceHanSansSC';
  src: url('/fonts/SourceHanSansCN-Heavy.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SourceHanSerifSC';
  src: url('/fonts/SourceHanSerifCN-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Brand Colors --- */

:root {
  /* 核心 */
  --brand-red: #B5453A;         /* 朱砂红 */
  --brand-red-light: #D4655A;   /* 浅朱 */
  --brand-red-dark: #8B332B;    /* 深朱 */
  --brand-ink: #2C2C2C;         /* 墨色 */
  --brand-ink-light: #4A4A4A;   /* 浅墨 */
  --brand-paper: #FAF8F5;       /* 宣纸白 */
  --brand-paper-dark: #F0EDE8;  /* 旧纸色 */

  /* 覆盖 PaperMod 默认变量 */
  --theme: var(--brand-paper);
  --entry: #FFFFFF;
  --primary: var(--brand-ink);
  --secondary: var(--brand-ink-light);
  --tertiary: var(--brand-paper-dark);
  --content: var(--brand-ink);
  --border: #E5E0D8;
}

/* --- Base Typography --- */

body {
  font-family: 'SourceHanSerifSC', 'Noto Serif CJK SC', 'Source Han Serif SC',
               'Songti SC', 'SimSun', serif;
  font-weight: 500;
  line-height: 1.85;
  background: var(--brand-paper);
  color: var(--brand-ink);
}

/* --- Headings --- */

h1, h2, h3, h4, h5, h6,
.page-header h1,
.post-title,
.archive-title {
  font-family: 'SourceHanSansSC', 'Noto Sans CJK SC', 'Source Han Sans SC',
               'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 900;
  line-height: 1.3;
  color: var(--brand-ink);
}

/* --- Navigation --- */

nav, .post-meta, .footer, .top-link {
  font-family: 'SourceHanSansSC', 'Noto Sans CJK SC', sans-serif;
  font-weight: 400;
}

.header {
  border-bottom: 1px solid var(--border);
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(10px);
}

nav a {
  color: var(--brand-ink-light);
  transition: color 0.2s;
}

nav a:hover {
  color: var(--brand-red);
}

/* --- Brand accent: links --- */

a {
  color: var(--brand-red);
  text-decoration: none;
}

a:hover {
  color: var(--brand-red-dark);
}

/* --- Code --- */

code, pre, kbd, samp,
.highlight,
pre code {
  font-family: Menlo, Consolas, 'Courier New', monospace;
}

/* --- Blockquote --- */

blockquote {
  font-family: 'SourceHanSerifSC', 'Noto Serif CJK SC', serif;
  font-style: normal;
  border-left: 3px solid var(--brand-red);
  padding-left: 1.2em;
  color: var(--brand-ink-light);
}

/* ============================================================
   首页 Hero 布局
   ============================================================ */

/* 隐藏 PaperMod 默认的 homeInfoParams */
.home-info {
  display: none;
}

/* Hero 区域 */
.hero {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
  text-align: left;
  z-index: 1;
}

/* Hero 背景图（纯文字，不叠图） */

/* Hero 顶部装饰线 */
.hero::before {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--brand-red);
  margin-bottom: 2rem;
}

/* Hero 下方山水画 — 画归画，字归字 */
.hero-painting {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1.5rem;
  opacity: 0.85;
}

.hero-painting img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.hero-brand {
  font-family: 'SourceHanSansSC', sans-serif;
  font-weight: 200;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brand-red);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: 'SourceHanSerifSC', serif;
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  color: var(--brand-ink);
}

.hero-subtitle {
  font-family: 'SourceHanSerifSC', serif;
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.9;
  color: var(--brand-ink-light);
  margin-bottom: 2.5rem;
}

.hero-subtitle strong {
  color: var(--brand-ink);
  font-weight: 700;
}

/* CTA 按钮 */
.hero-cta {
  display: inline-block;
  font-family: 'SourceHanSansSC', sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  padding: 0.7rem 2rem;
  border: 1.5px solid var(--brand-red);
  color: var(--brand-red);
  background: transparent;
  transition: all 0.25s;
  text-decoration: none;
}

.hero-cta:hover {
  background: var(--brand-red);
  color: #fff;
}

/* 导航链接组 */
.hero-nav {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem 2rem;
}

.hero-nav a {
  font-family: 'SourceHanSansSC', sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--brand-ink-light);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.hero-nav a::before {
  content: '—';
  color: var(--brand-red);
  font-weight: 200;
  font-size: 0.8rem;
}

.hero-nav a:hover {
  color: var(--brand-ink);
  border-bottom-color: var(--brand-red);
}

/* ============================================================
   内页 Hero（关于/服务/课程/评价）
   ============================================================ */

.page-hero {
  max-width: 720px;
  margin: 2rem auto 1rem;
  padding: 0 1.5rem;
  text-align: left;
}

.page-brand {
  font-family: 'SourceHanSansSC', sans-serif;
  font-weight: 200;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--brand-red);
  margin: 0 0 0.5rem;
}

.page-hero h1 {
  font-family: 'SourceHanSerifSC', serif;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.3;
  margin: 0 0 0.8rem;
  color: var(--brand-ink);
}

.page-lead {
  font-family: 'SourceHanSerifSC', serif;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--brand-ink-light);
}

/* ============================================================
   评价页引用块
   ============================================================ */

.testimonial-block {
  max-width: 680px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

.testimonial-quote {
  font-family: 'SourceHanSerifSC', serif;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--brand-ink);
  padding: 1.2rem 1.5rem;
  border-left: 3px solid var(--brand-red);
  background: rgba(181, 69, 58, 0.04);
  border-radius: 0 6px 6px 0;
}

/* ============================================================
   首页文章区域隐藏
   ============================================================ */

/* PaperMod 首页自动生成的博客列表 */
.home-info + .first-entry,
article.first-entry,
.post-content + .page-header + .first-entry {
  display: none;
}

/* 首页文章区域 — v2 已在 _index.md 中控制显示/隐藏，不再全局隐藏 */

/* ============================================================
   文章列表
   ============================================================ */

.post-entry {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 1.5rem 0;
  margin-bottom: 0;
  transition: background 0.2s;
}

.post-entry:hover {
  background: rgba(181, 69, 58, 0.03);
}

.entry-header h2 {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 0.3rem;
}

.entry-content {
  color: var(--brand-ink-light);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ============================================================
   首页互动演示卡片
   ============================================================ */

.home-demos {
  max-width: 720px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
}

.home-demos-lead {
  font-family: 'SourceHanSansSC', sans-serif;
  font-weight: 200;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  color: var(--brand-red);
  margin-bottom: 1.2rem;
}

.home-demos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
}

.home-demo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: var(--brand-ink);
  transition: all 0.25s;
}

.home-demo-card:hover {
  border-color: var(--brand-red);
  box-shadow: 0 2px 12px rgba(181,69,58,0.08);
  transform: translateY(-1px);
}

.home-demo-card .demo-icon {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.home-demo-card .demo-title {
  font-family: 'SourceHanSansSC', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.home-demo-card .demo-desc {
  font-family: 'SourceHanSerifSC', serif;
  font-size: 0.73rem;
  color: var(--brand-ink-light);
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 768px) {
  .home-demos-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid var(--border);
  background: transparent;
}

.footer a {
  color: var(--brand-ink-light);
  font-size: 0.8rem;
}

.footer a:hover {
  color: var(--brand-red);
}

/* ============================================================
   全局微调
   ============================================================ */

/* 内页内容区加宽 */
.post-content,
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  font-size: 1.05rem;
  line-height: 2;
}

/* 段落间距 */
.post-content p,
.page-content p {
  margin-bottom: 1.5rem;
}

/* h2 节奏 */
.post-content h2,
.page-content h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 1.35rem;
}

/* h3 节奏 */
.post-content h3,
.page-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
  color: var(--brand-red);
}

/* 首段首个 h2 不设过大上边距 */
.page-hero + hr + h2,
.page-hero + h2 {
  margin-top: 2rem;
}

/* 分隔线 */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ============================================================
   服务页卡片（可选升级）
   ============================================================ */

/* 服务项标题更突出 */
.post-content h3 + p,
.page-content h3 + p {
  margin-top: 0.3rem;
}

/* ============================================================
   滚动条（仅 webkit）
   ============================================================ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--brand-paper);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-paper-dark);
  border-radius: 3px;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .hero {
    padding: 2.5rem 1rem 1.5rem;
  }

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

  .page-hero h1 {
    font-size: 1.5rem;
  }

  .page-hero {
    padding: 0 1rem;
  }

  .post-content,
  .page-content {
    padding: 0 1rem;
    font-size: 1rem;
  }

  .testimonial-block {
    padding: 0 1rem;
  }
}
