/* ==========================================================================
   Room and Compass —— 内页重构（Page Rebuild）
   --------------------------------------------------------------------------
   加载顺序：… → polish → atelier → <页面私有 css> → pages-rebuild
   必须排在页面私有样式表（learn.css / 页面内联<style>）之后，
   否则会被它们的同等特异度规则吃掉 —— 这是上一轮「改了却看不出」的主因之一。

   改造目标（不改结构，只改视觉表达）：
     ·页头区统一改成「墨底题头」：与首页首屏同源的语言，
       内页一打开就与首页是同一套设计，而不是白底文档。
     · 卡片从「白底+ 1px 灰线」改成「纸片 + 朱砂序号 + 烫金标签」。
     · 列表项（res-card / faq）加左侧朱砂竖线，形成竖向节奏。
     · 眉题 eyebrow 加朱砂短线，形成统一的分区标记。

   与 hero-rebuild.css 的分工：
     hero-rebuild 管首屏（沉浸深色），pages-rebuild 管内页题头与卡片（半深题头），
   两者共用同一套墨底 / 烫金 / 朱砂令牌，视觉上是一个系统。
   ========================================================================== */

/* ==========================================================================
   1. 内页题头：墨底 band
   --------------------------------------------------------------------------
   只把「标题区」压深，正文区仍保持浅色 —— 少量深色、主体浅色，
   与首屏形成「进入正文」的明暗节奏，而不是整页刷黑。
   ========================================================================== */

/* learn 目录页题头：一张洇了色的水粉纸 —— 不是深色块 */
body .learn-intro {
  position: relative;
  isolation: isolate;
  max-width: none;
  margin: 16px 0 0;
  padding: clamp(30px, 3.8vw, 46px) clamp(24px, 4vw, 56px);
  text-align: center;
  border-radius: var(--radius-lg);
  color: var(--text);
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 62% 70% at 10% -10%, rgba(219,187,169,.18), transparent 62%),
    radial-gradient(ellipse 58% 66% at 92% 112%, rgba(180,198,210,.15), transparent 64%),
    radial-gradient(ellipse 90% 60% at 50% 40%,  rgba(242,235,224,.22), transparent 70%);
}

/* 纸上的「水渍圈」：三层同心细环，像杯子搁在纸上留下的痕迹。
   极淡 —— 只有凑近才看得见，这是细节而非装饰。 */
body .learn-intro::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, 88%); aspect-ratio: 1;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  box-shadow:
    0 0 0 1px  rgba(138,99,83,.030),
    0 0 0 34px rgba(138,99,83,.009),
    0 0 0 70px rgba(138,99,83,.005);
}

body .learn-intro .eyebrow {
  color: var(--accent);
  letter-spacing: .24em;
  font-weight: 600;
  opacity: 1;
}
body .learn-intro h1 {
  color: var(--text);
  font-size: clamp(26px, 3.3vw, 42px);
  line-height: 1.26;
  font-weight: 600;
  letter-spacing: -.008em;
  margin: 12px 0 16px;
  background: none;
  -webkit-background-clip: border-box; background-clip: border-box;
  -webkit-text-fill-color: currentColor;
}
body .learn-intro .lede {
  color: var(--text-2);
  font-size: clamp(14px, 1.2vw, 15.6px);
  line-height: 1.9;
  max-width: 56ch;
  margin: 0 auto;
}

/* 题头与下方分区间距：让墨块有「落地」的呼吸感 */
body .learn-intro + .section-head { margin-top: 34px; }

/* 封面图：压成题头的一部分 —— 降饱和 + 压暗 + 圆角内嵌 */
body .learn-hero { margin: 20px 0 0; }
body .learn-hero .lh-cover {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), var(--edge-light);
  /* 原图是高饱和的金色罗盘，与性冷淡的水粉调冲突 ——
     去饱和 + 提一点亮，让它变成一张「旧照片」而不是一张插画。 */
  filter: saturate(.52) contrast(.95) brightness(1.05);
}

/* ==========================================================================
   2. 通用内页题头：page-head / article-head / doc-head
   ========================================================================== */

/* .page-head 走「水粉纸块」——与 learn 题头同一母题：浅底 + 洇色 + 水渍圈。
   .article-head / .doc-head 是文章正文前的窄条，只用一道极细顶线，
   不做成块，避免长文阅读时被大色块压住。 */
body .page-head {
  position: relative;
  isolation: isolate;
  margin: 24px 0 26px;
  padding: clamp(30px, 3.8vw, 46px) clamp(24px, 3.8vw, 50px);
  border-radius: var(--radius-lg);
  color: var(--text);
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 60% 80% at 8% -14%, rgba(219,187,169,.19), transparent 62%),
    radial-gradient(ellipse 56% 74% at 94% 118%, rgba(180,198,210,.15), transparent 64%);
}
/* 同款水渍圈，尺度比 learn 小一档 */
body .page-head::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, 74%); aspect-ratio: 1;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  box-shadow:
    0 0 0 1px  rgba(138,99,83,.028),
    0 0 0 28px rgba(138,99,83,.008),
    0 0 0 58px rgba(138,99,83,.005);
}
body .page-head h1 {
  color: var(--text) !important;
  background: none;
  -webkit-background-clip: border-box; background-clip: border-box;
  -webkit-text-fill-color: currentColor;
}
body .page-head p {
  color: var(--text-2) !important;
}

/* 文章/长文题头：朱砂顶线 */
body .article-head,
body .doc-head {
  position: relative;
  padding-top: 34px;
}
body .article-head::before,
body .doc-head::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    var(--accent) 0%, rgba(138,99,83,.35) 34%, rgba(169,156,134,.28) 62%, transparent 100%);
}
body .page-head h1,
body .article-head h1,
body .doc-head h1 {
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.2;
  letter-spacing: -.022em;
  font-weight: 700;
  color: var(--text);
}
body .page-head p,
body .article-head .doc-hook {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.8;
  max-width: 64ch;
}
/* 眉题：朱砂短线 + 字距 */
body .page-head .eyebrow {
  color: var(--accent);
  letter-spacing: .2em;
  font-weight: 700;
}
body .page-head .eyebrow::before,
body .learn-intro .eyebrow::before {
  content: '';
  display: inline-block;
  width: 22px; height: 2px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 2px;
  background: var(--accent);
}

/* 返回链接：变成一枚「路标」 */
body .article-head .ah-back {
  min-height: 44px;
  padding: 0 14px 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-contact), var(--edge-light);
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s;
}
body .article-head .ah-back:hover {
  transform: translateX(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--halo-accent);
}

/* ==========================================================================
   3. lesson-card：纸片 + 朱砂序号印
   ========================================================================== */

/* 特异度提到 body 级，压过 learn.css 的 .lesson-card */
body .lesson-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--paper-grad);
  box-shadow: var(--shadow), var(--edge-light);
  overflow: hidden;
  transition:
    transform .28s cubic-bezier(.16,.84,.44,1),
    box-shadow .28s cubic-bezier(.16,.84,.44,1),
    border-color .28s;
}
body .lesson-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lift), var(--edge-light-strong);
}
/* 图片区：底部一道朱砂渐隐，压住图片下沿 */
body .lesson-card .lc-img {
  border-bottom: 1px solid var(--border);
}
body .lesson-card .lc-img::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 46%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(16,27,35,.20));
  opacity: 0;
  transition: opacity .3s var(--ease);
}
body .lesson-card:hover .lc-img::after { opacity: 1; }

/* 序号：白圆改朱砂印 —— 这是卡片上最抢眼的一笔 */
body .lesson-card .lc-no {
  width: 34px; height: 34px;
  top: 12px; left: 12px;
  border-radius: 50%;
  background: linear-gradient(168deg, #8F6857 0%, #8A6353 52%, #845D4E 100%);
  color: #FFF6EC;
  font-size: 13px;
  font-weight: 700;
  border: 0;
  box-shadow:
    0 0 0 1px rgba(255,254,251,.30),
    0 0 0 5px rgba(138,99,83,.14),
    0 6px 16px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.28);
  transition: transform .25s cubic-bezier(.16,.84,.44,1), box-shadow .25s;
}
body .lesson-card:hover .lc-no {
  transform: scale(1.1);
  box-shadow:
    0 0 0 1px rgba(255,254,251,.34),
    0 0 0 7px rgba(138,99,83,.18),
    0 8px 22px rgba(0,0,0,.34),
    inset 0 1px 0 rgba(255,255,255,.3);
}

body .lesson-card .lc-body { padding: 17px 19px 18px; }
/* 标签：改烫金，像一枚馆藏编号签 */
body .lesson-card .lc-tag {
  color: var(--accent);
  letter-spacing: .12em;
  font-weight: 700;
  margin-bottom: 8px;
}
body .lesson-card .lc-title {
  font-size: 17.5px;
  line-height: 1.42;
  letter-spacing: -.012em;
  color: var(--text);
}
body .lesson-card .lc-hook {
  color: var(--text-2);
  line-height: 1.72;
}
/* 底部阅读入口：加箭头，悬停右移 */
body .lesson-card .lc-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
body .lesson-card .lc-read { color: var(--accent); font-weight: 700; letter-spacing: .02em; }
body .lesson-card .lc-read::after {
  content: ' →';
  display: inline-block;
  transition: transform .25s cubic-bezier(.16,.84,.44,1);
}
body .lesson-card:hover .lc-read::after { transform: translateX(4px); }

/* ==========================================================================
   4. res-card / faq-item：左侧朱砂竖线
   ========================================================================== */

body .res-card {
  position: relative;
  padding: 22px 24px 22px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--paper-grad);
  box-shadow: var(--shadow), var(--edge-light);
  transition:
    transform .26s cubic-bezier(.16,.84,.44,1),
    box-shadow .26s cubic-bezier(.16,.84,.44,1),
    border-color .26s;
}
body .res-card::before {
  content: '';
  position: absolute;
  top: 16px; bottom: 16px; left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #A5796A, rgba(138,99,83,.18));
  opacity: .8;
  transition: opacity .26s, top .26s, bottom .26s;
}
body .res-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-lift), var(--edge-light-strong);
}
body .res-card:hover::before { opacity: 1; top: 10px; bottom: 10px; }

body .res-card h2 {
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -.014em;
  color: var(--text);
}
body .res-card p { font-size: 14px; line-height: 1.8; color: var(--text-2); }
body .res-more {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .03em;
}

/* 长文页 FAQ：每条也挂朱砂编号感 —— 用左侧竖线而非改动结构 */
body .faq-item {
  position: relative;
  padding: 16px 18px 16px 20px;
  border-radius: var(--radius);
  background: var(--paper-grad);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-contact), var(--edge-light);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s;
}
body .faq-item:hover {
  transform: translateX(3px);
  border-color: var(--accent-line);
}
body .faq-item::before {
  content: '';
  position: absolute;
  top: 14px; bottom: 14px; left: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .55;
}
body .faq-item h3 { font-size: 15.2px; color: var(--text); }
body .faq-item p { color: var(--text-2); line-height: 1.85; }

/* 文末 CTA：改成朱砂笺 —— 一张压朱砂的便条 */
body .doc-cta {
  position: relative;
  padding: 20px 22px 20px 24px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,254,251,.5), transparent 60%),
    var(--accent-soft);
  border: 1px solid var(--accent-line);
  box-shadow: var(--shadow-contact), var(--edge-light);
  overflow: hidden;
}
body .doc-cta::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: linear-gradient(180deg, #A5796A, rgba(138,99,83,.25));
}

/* CTA 便条里的按钮：与上面的说明文字留一口气，
   宽度随文字而不是撑满整张便条（撑满会像一条横幅，不像一个动作）。 */
body .doc-cta-act { margin: 14px 0 0; }
body .doc-cta-act .btn { display: inline-flex; width: auto; }

/* ==========================================================================
   5. 分区标题：统一朱砂标记
   ========================================================================== */

body .learn-page .section-head .eyebrow,
body .wrap .section-head .eyebrow {
  color: var(--accent);
  letter-spacing: .18em;
  font-weight: 700;
}

/* 免责声明：淡金细线分隔，弱化但保留 */
body .learn-disclaimer {
  border-top-color: var(--border);
  color: var(--text-3);
}

/* ==========================================================================
   6. 深色模式微调
   --------------------------------------------------------------------------
   墨底题头在用户系统为深色时与页面底色接近，加一道描边把边界说清楚。
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  body .learn-intro {
    box-shadow: 0 0 0 1px rgba(169,156,134,.22), 0 24px 60px rgba(0,0,0,.45);
  }
  body .learn-intro .lede { color: rgba(232,228,219,.82); }
}