/* 内页样式：沿用首页（index.html）的配色、圆角、阴影和黏土贴纸 */
:root {
  --bg: #FFF9EE;
  --sun: #FFC845;
  --coral: #FF7B5C;
  --mint: #3DC9A4;
  --sky: #5B9DFF;
  --grape: #8C7BFF;
  --ink: #2E3A59;
  --muted: #6B7590;
  --xhs: #FF2442;
  --card: #FFFFFF;
  --line: #F1E6D3;
  --radius: 24px;
  --shadow: 0 10px 30px rgba(46, 58, 89, .10);
  --shadow-up: 0 22px 44px rgba(46, 58, 89, .16);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 8% 0%, #FFE9B0 0, transparent 28%),
    radial-gradient(circle at 96% 12%, #FFE1D6 0, transparent 26%),
    radial-gradient(circle at 90% 70%, #DDEBFF 0, transparent 30%),
    var(--bg);
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 900; letter-spacing: .5px; }
h2 { font-size: clamp(21px, 2.6vw, 27px); font-weight: 900; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }

/* 无障碍：跳到正文，平时隐藏 */
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 16px; border-radius: 999px; background: var(--ink); color: #fff; }
.skip:focus { top: 12px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 8px; }

/* ---------- 版心 ---------- */
.container { width: min(1180px, 100% - 48px); margin: 0 auto; padding: 22px 0 90px; min-height: 65vh; }
section { margin-bottom: 28px; }

/* 面包屑 */
.crumb { font-size: 14px; color: var(--muted); margin: 6px 0 18px; }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--coral); }

/* ---------- 页头大卡片（带黏土贴纸） ---------- */
.intro {
  position: relative; overflow: hidden; margin-bottom: 30px;
  padding: 40px 210px 38px 44px; border-radius: 32px; background: #fff; box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 92% 18%, #FFF0C2 0, transparent 34%),
    radial-gradient(circle at 78% 110%, #E3EEFF 0, transparent 38%),
    #fff;
}
.intro::before, .intro::after {
  content: ""; position: absolute; pointer-events: none;
  background: center / contain no-repeat; filter: drop-shadow(0 10px 12px rgba(46, 58, 89, .14));
}
.intro::before { right: 92px; top: 26px; width: 84px; height: 84px; background-image: url(/assets/stickers/o08.webp); transform: rotate(-8deg); }
.intro::after { right: 26px; bottom: 18px; width: 92px; height: 92px; background-image: url(/assets/stickers/o01.webp); transform: rotate(10deg); }
.intro h1 { margin-bottom: 12px; }
.lead { font-size: 17px; color: var(--muted); max-width: 760px; margin-bottom: 0; }
.eyebrow {
  display: inline-block; margin-bottom: 12px; padding: 4px 14px; border-radius: 999px;
  background: #FFF1E9; color: #D9583B; font-size: 14px; font-weight: 700;
}
.note {
  margin: 16px 0 0; padding: 10px 16px; border-radius: 16px; background: #FFF6DA;
  color: #7A5B1E; font-size: 14px; max-width: 760px;
}
.note a { color: #B5651D; font-weight: 700; }
.tiny { font-size: 13px; color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); }

/* ---------- 卡片网格（年级、文章、教材入口） ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin-bottom: 30px; }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; margin-bottom: 30px; }
.works-grid .card { padding: 10px 10px 16px; }
.works-grid .card .pic { margin: 0 0 8px; }
.works-grid .card h2, .works-grid .card .tiny, .works-grid .card .more { padding: 0 8px; }
.works-grid .card h2 { font-size: 17px; }
.works-grid .card .tiny { letter-spacing: 0; font-weight: 400; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border-radius: var(--radius); padding: 22px 24px; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s;
}
.card:nth-child(odd):hover { transform: translateY(-6px) rotate(-1deg); box-shadow: var(--shadow-up); }
.card:nth-child(even):hover { transform: translateY(-6px) rotate(1deg); box-shadow: var(--shadow-up); }
.card h2 { font-size: 21px; margin: 0; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }
.card .tiny { letter-spacing: 2px; font-weight: 700; }
.card .pic { margin: -10px -12px 8px; aspect-ratio: 3 / 2; border-radius: 16px; overflow: hidden; background: #FFF3CE; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.card:hover .pic img { transform: scale(1.06); }
.card .more { margin-top: auto; padding-top: 8px; color: var(--coral); font-weight: 700; }
.card.feature { background: linear-gradient(135deg, #FFF4D6, #FFE3D8); }
.card.feature .eyebrow { background: #fff; align-self: flex-start; }

/* ---------- 册页：单元列表 ---------- */
.unit-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 30px; }
.unit-row {
  position: relative; display: flex; gap: 18px; align-items: flex-start;
  background: #fff; border-radius: var(--radius); padding: 22px 22px 20px; box-shadow: var(--shadow);
  transition: transform .3s, box-shadow .3s;
}
.unit-row:hover { transform: translateY(-4px); box-shadow: var(--shadow-up); }
.unit-row > div { flex: 1; min-width: 0; }
.unit-row h2 { font-size: 20px; margin: 2px 0 6px; }
.unit-row h2 a { text-decoration: none; }
.unit-row h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.unit-row p { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.unit-row .tiny { display: inline-block; padding: 2px 12px; border-radius: 999px; background: #F2F6FF; color: #4A6FB5; font-weight: 700; }
.unit-row > .more { align-self: center; color: var(--coral); font-weight: 700; text-decoration: none; white-space: nowrap; }
.unit-no {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  font-size: 20px; font-weight: 900; color: #fff; background: var(--sun);
}
.unit-row:nth-child(5n+1) .unit-no { background: var(--sun); color: #6B4A00; }
.unit-row:nth-child(5n+2) .unit-no { background: var(--coral); }
.unit-row:nth-child(5n+3) .unit-no { background: var(--mint); }
.unit-row:nth-child(5n+4) .unit-no { background: var(--sky); }
.unit-row:nth-child(5n+5) .unit-no { background: var(--grape); }

/* ---------- 单元页 / 课时页正文 ---------- */
.facts { display: flex; flex-wrap: wrap; gap: 12px; margin: -6px 0 26px; }
.facts > div { display: flex; flex-direction: column; padding: 12px 20px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.facts strong { font-size: 16px; }
.lesson-content > section:not(.cta) {
  background: #fff; border-radius: var(--radius); padding: 26px 30px 12px; box-shadow: var(--shadow);
}
.lesson-content > section h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; }
.lesson-content > section:not(.cta) h2::before {
  content: ""; width: 10px; height: 22px; border-radius: 6px; background: var(--sun); flex-shrink: 0;
}
.lesson-content > section:nth-of-type(3n+2) h2::before { background: var(--coral); }
.lesson-content > section:nth-of-type(3n+3) h2::before { background: var(--mint); }
.lesson-content > section p { color: #4A556F; }
.lesson-index { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; counter-reset: les; }
.lesson-index li { counter-increment: les; }
.lesson-index a {
  display: flex; align-items: center; gap: 12px; height: 100%; padding: 12px 16px; border-radius: 16px;
  background: var(--bg); text-decoration: none; font-weight: 700; transition: background .2s, transform .2s;
}
.lesson-index a::before {
  content: counter(les); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--coral); font-size: 14px; box-shadow: 0 3px 8px rgba(46, 58, 89, .08);
}
.lesson-index a span:first-child { flex: 1; }
.lesson-index a:hover { background: #FFF1E0; transform: translateY(-2px); }
.lesson-index .tiny { font-weight: 400; }
.original-note { border: 2px dashed #FFD58A; }

/* ---------- 引流卡片（去小红书看课件） ---------- */
.cta, .below {
  position: relative; overflow: hidden; border-radius: 32px; padding: 34px 220px 30px 40px; margin: 34px 0 10px;
  background: linear-gradient(120deg, #FF9F7E 0%, #FFB86B 55%, #FFD36E 100%); color: #fff;
  box-shadow: 0 20px 50px rgba(255, 142, 114, .28);
}
.cta h2, .below h2 { color: #fff; font-size: clamp(22px, 2.8vw, 28px); }
.cta p, .below p { color: rgba(255, 255, 255, .95); max-width: 640px; }
.cta::after, .below::after {
  content: ""; position: absolute; right: 34px; bottom: -6px; width: 170px; height: 170px; pointer-events: none;
  background: url(/assets/stickers/o11.webp) center / contain no-repeat; filter: drop-shadow(0 12px 16px rgba(120, 50, 20, .25));
}
.below { background: linear-gradient(120deg, #7FB3FF 0%, #9C8CFF 100%); box-shadow: 0 20px 50px rgba(91, 157, 255, .25); }
.below::after { background-image: url(/assets/stickers/o12.webp); }
.below a { color: #fff; font-weight: 700; }

/* 按钮：和首页一样的胶囊按钮，主按钮是小红书红 */
.button {
  display: inline-flex; align-items: center; gap: 8px; margin: 6px 12px 6px 0; padding: 13px 26px; border-radius: 999px;
  background: var(--xhs); color: #fff; font-weight: 700; text-decoration: none;
  box-shadow: 0 10px 24px rgba(255, 36, 66, .28); transition: transform .2s, box-shadow .2s;
}
.button:hover { transform: translateY(-3px); }
.cta .button, .below .button { background: #fff; color: var(--xhs); box-shadow: 0 10px 24px rgba(120, 40, 20, .18); }
.button.secondary { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---------- 文章与“关于我”等 Markdown 页面 ---------- */
.container > h1 { margin-top: 10px; }
.container > article:not(.lesson-content), .prose {
  background: #fff; border-radius: 32px; padding: 40px 48px; box-shadow: var(--shadow); max-width: 860px; margin: 0 auto;
}
.container > article:not(.lesson-content) h2 { margin-top: 1.4em; }
.container > article:not(.lesson-content) a, .prose a { color: #D9583B; font-weight: 700; }
.container ul, .container ol { padding-left: 1.4em; }
.container blockquote { margin: 1em 0; padding: 12px 18px; border-left: 5px solid var(--sun); background: #FFF8E4; border-radius: 0 14px 14px 0; }

/* ---------- 页脚 ---------- */
.footer { margin-top: 20px; padding: 40px 24px 46px; text-align: center; color: var(--muted); background: rgba(255, 255, 255, .6); border-top: 1px solid var(--line); }
.footer-inner { max-width: 760px; margin: 0 auto; }
.footer strong { display: block; font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.footer a { color: var(--ink); font-weight: 700; text-decoration: none; }
.footer a:hover { color: var(--coral); }
.footer small { display: block; margin-top: 10px; font-size: 12px; }

/* ---------- 手机 ---------- */
@media (max-width: 860px) {
  .unit-list { grid-template-columns: 1fr; }
  .intro { padding: 30px 26px 30px; }
  .intro::before { width: 56px; height: 56px; right: 18px; top: 14px; opacity: .9; }
  .intro::after { display: none; }
  .cta, .below { padding: 28px 26px 120px; }
  .cta::after, .below::after { width: 110px; height: 110px; right: 18px; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 28px); padding-top: 12px; }
  .intro { padding-right: 70px; border-radius: 24px; }
  .lesson-content > section:not(.cta) { padding: 20px 20px 8px; }
  .container > article:not(.lesson-content), .prose { padding: 26px 22px; border-radius: 24px; }
  .unit-row { padding: 18px; gap: 14px; }
  .unit-row > .more { display: none; }
  .unit-no { width: 44px; height: 44px; font-size: 17px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
