/* 明之算官网：暖白纸张 + 墨色文字 + 青绿主色 + 朱红点缀；标题宋体，正文黑体。动画只用 transform / opacity */
:root {
  --paper: #f7f5f0;
  --paper-2: #efece4;
  --card: #ffffff;
  --ink: #1d2a2e;
  --ink-2: #4b5a5e;
  --ink-3: #8a9598;
  --line: rgba(29, 42, 46, 0.09);
  --brand: #1f8f83;
  --brand-2: #17766c;
  --brand-soft: #dff3ef;
  --seal: #c0392b;
  --marker: rgba(95, 205, 192, 0.42);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: 'Songti SC', 'STSong', 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  --sans: -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --r: 18px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
.serif {
  font-family: var(--serif);
}
.wrap {
  width: min(1160px, 100% - 48px);
  margin: 0 auto;
}
[hidden] {
  display: none !important;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 28px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(31, 143, 131, 0.7);
}
.btn-primary:hover {
  background: var(--brand-2);
}
.btn-ghost {
  border: 1.5px solid rgba(29, 42, 46, 0.18);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
}
.btn-light {
  background: #fff;
  color: var(--ink);
}
.btn-sm {
  height: 38px;
  padding: 0 18px;
  font-size: 14px;
}

/* ---------- 顶栏 ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background 0.3s, box-shadow 0.3s;
}
.nav.solid {
  background: rgba(247, 245, 240, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-in {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  border-radius: 9px;
  box-shadow: 0 6px 14px -8px rgba(160, 40, 30, 0.6);
}
.brand-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 5px;
}
.menu {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 15px;
  color: var(--ink-2);
}
.menu a {
  position: relative;
  padding: 4px 0;
}
.menu a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}
.menu a:hover {
  color: var(--ink);
}
.menu a:hover::after {
  transform: scaleX(1);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 148px 0 72px;
}
.paper {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(29, 42, 46, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(29, 42, 46, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-in {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 40px;
  min-height: 460px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--seal);
}
.kicker::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--seal);
}
h1 {
  margin-top: 22px;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 1px;
}
@media (min-width: 961px) {
  /* 每一行都是后台里写好的一整句，不在句中折行 */
  h1 .ln {
    white-space: nowrap;
  }
}
.mark {
  background: linear-gradient(transparent 62%, var(--marker) 62%, var(--marker) 92%, transparent 92%);
}
.lead {
  margin-top: 22px;
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--ink-2);
  text-wrap: pretty;
  word-break: keep-all;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}
.hint {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-3);
}

/* 四本练习本：扇形叠放，鼠标经过时散开一点 */
.books {
  position: relative;
  height: 440px;
}
.book {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 210px;
  height: 280px;
  margin: -140px 0 0 -105px;
  border-radius: 8px 16px 16px 8px;
  background: var(--cover);
  box-shadow: 0 30px 50px -28px rgba(29, 42, 46, 0.45), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  overflow: hidden;
  transition: transform 0.7s var(--ease);
}
.book i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 22px;
  background: var(--spine);
}
.book i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(transparent 0 26px, rgba(255, 255, 255, 0.35) 26px 27px);
}
.book::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}
.book b {
  position: absolute;
  right: 14px;
  top: 6px;
  font-family: 'Times New Roman', var(--serif);
  font-style: italic;
  font-size: 92px;
  line-height: 1;
  color: var(--spine);
  opacity: 0.22;
}
/* 书名竖排在书脊旁边，叠在一起也看得见 */
.book span {
  position: absolute;
  left: 34px;
  top: 26px;
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--ink);
}
.book span::after {
  content: '';
  display: block;
  width: 3px;
  height: 30px;
  margin-top: 12px;
  margin-right: 0;
  border-radius: 2px;
  background: var(--spine);
}
.b1 {
  transform: translate(-150px, 30px) rotate(-14deg);
}
.b2 {
  transform: translate(-52px, -6px) rotate(-5deg);
}
.b3 {
  transform: translate(48px, -16px) rotate(4deg);
}
.b4 {
  transform: translate(146px, 12px) rotate(13deg);
}
.books:hover .b1 {
  transform: translate(-176px, 24px) rotate(-17deg);
}
.books:hover .b2 {
  transform: translate(-62px, -18px) rotate(-6deg);
}
.books:hover .b3 {
  transform: translate(58px, -28px) rotate(5deg);
}
.books:hover .b4 {
  transform: translate(172px, 6px) rotate(16deg);
}
/* 进场：从下往上落位 */
.books .book {
  opacity: 0;
}
.ready .books .book {
  opacity: 1;
  transition: transform 0.7s var(--ease), opacity 0.6s;
}
.ready .b1 {
  transition-delay: 0.15s;
}
.ready .b2 {
  transition-delay: 0.25s;
}
.ready .b3 {
  transition-delay: 0.35s;
}
.ready .b4 {
  transition-delay: 0.45s;
}

/* 数据亮点 */
.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), 1fr);
  margin-top: 56px;
  padding: 26px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat {
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
}
.stat span {
  font-size: 14px;
  color: var(--ink-3);
}

/* ---------- 通用分区 ---------- */
.sec {
  padding: 104px 0;
}
.sec-tint {
  background: var(--paper-2);
}
.sec-ink {
  background: #1d2a2e;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.sec-ink::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.sec-head {
  max-width: 640px;
  margin-bottom: 52px;
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--brand);
}
.eyebrow.light {
  color: #5fcdc0;
}
h2 {
  margin-top: 10px;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.3;
  font-weight: 800;
  text-wrap: balance;
}
.sec-lead {
  margin-top: 14px;
  font-size: 16px;
  color: var(--ink-2);
}

/* ---------- 课程卡片：练习本 ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.course {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 28px 24px 24px 44px;
  border-radius: 10px 20px 20px 10px;
  background: var(--cover, #fff);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  box-shadow: 0 18px 36px -30px rgba(29, 42, 46, 0.5);
}
.course:hover {
  transform: translateY(-6px) rotate(-0.6deg);
  box-shadow: 0 30px 50px -32px rgba(29, 42, 46, 0.55);
}
.course::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 18px;
  background: var(--spine, #ccc);
}
.course .glyph {
  position: absolute;
  right: 14px;
  top: 4px;
  font-family: 'Times New Roman', var(--serif);
  font-style: italic;
  font-size: 96px;
  line-height: 1;
  color: var(--spine);
  opacity: 0.16;
}
.course h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
}
.course .sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-2);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.chips span {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
}
.course .go {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.course .go i {
  font-style: normal;
  transition: transform 0.25s var(--ease);
}
.course:hover .go i {
  transform: translateX(4px);
}
.skeleton {
  background: linear-gradient(100deg, #eceae3 30%, #f4f2ec 50%, #eceae3 70%);
  background-size: 300% 100%;
  animation: shine 1.4s linear infinite;
}
.skeleton::before {
  display: none;
}
@keyframes shine {
  to {
    background-position: -150% 0;
  }
}

/* ---------- 服务闭环 ---------- */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.step {
  position: relative;
  padding: 30px 28px 28px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 0 1px 0 var(--line);
  transition: transform 0.3s var(--ease);
}
.step:hover {
  transform: translateY(-4px);
}
.step em {
  font-family: var(--serif);
  font-style: normal;
  font-size: 15px;
  font-weight: 800;
  color: var(--seal);
  letter-spacing: 1px;
}
.step h3 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 800;
}
.step p {
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-2);
}

/* ---------- 活动 ---------- */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.event {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 26px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--c-bg), var(--c-bg2));
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  transition: transform 0.3s var(--ease);
}
.event:hover {
  transform: translateY(-4px);
}
.event .ebook {
  flex: none;
  width: 86px;
  height: 116px;
  padding: 12px 8px 0 16px;
  border-radius: 4px 9px 9px 4px;
  background: var(--c-accent);
  color: #fff;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  transform: rotate(-4deg);
  box-shadow: 0 14px 22px -12px rgba(0, 0, 0, 0.5);
  border-left: 7px solid rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.event .ebook img {
  width: 86px;
  height: 116px;
  margin: -12px 0 0 -23px;
  object-fit: cover;
  max-width: none;
}
.event .tag {
  display: inline-block;
  padding: 0 8px;
  border: 1.5px solid var(--c-accent2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--c-accent2);
}
.event h3 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.4;
}
.event p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--c-sub);
}

/* ---------- 学习中心 ---------- */
.learn {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 48px;
}
.learn p {
  margin-top: 16px;
  max-width: 560px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.72);
}
.qr-card {
  justify-self: center;
  width: 260px;
  padding: 26px 26px 22px;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  transform: rotate(2deg);
}
.qr {
  width: 208px;
  height: 208px;
  margin: 0 auto;
  border-radius: 14px;
  background: #f4f7f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 13px;
  color: var(--ink-3);
}
.qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.qr-t {
  margin-top: 14px;
  font-weight: 700;
}
.qr-s {
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- 关于 ---------- */
.about-body {
  max-width: 780px;
  font-family: var(--serif);
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 2;
  color: var(--ink-2);
}
.about-body p + p {
  margin-top: 14px;
}

/* ---------- 联系 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-list {
  display: grid;
  grid-template-columns: 96px 1fr;
  row-gap: 18px;
  padding: 32px 34px;
  border-radius: 22px;
  background: var(--card);
}
.contact-list dt {
  font-size: 14px;
  color: var(--ink-3);
  padding-top: 3px;
}
.contact-list dd {
  font-size: 18px;
  font-weight: 600;
}
.contact-list dd a {
  border-bottom: 1px solid rgba(31, 143, 131, 0.35);
}
.contact-qrs {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.cqr {
  width: 160px;
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
}
.cqr .qr {
  width: 128px;
  height: 128px;
  margin-bottom: 10px;
  font-size: 12px;
}

/* ---------- 页脚 ---------- */
.foot {
  padding: 34px 0 40px;
  border-top: 1px solid var(--line);
}
.foot-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 4px;
}
.foot-brand img {
  border-radius: 7px;
}
.foot-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}
.foot-meta a:hover {
  color: var(--ink);
}

/* ---------- 滚动进场 ---------- */
.reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .books .book {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .skeleton {
    animation: none;
  }
}

/* ---------- 小屏 ---------- */
@media (max-width: 960px) {
  .hero {
    padding-top: 112px;
  }
  .hero-in {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .books {
    height: 300px;
    transform: scale(0.72);
    margin: -20px 0 -30px;
  }
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .learn,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 36px);
  }
  .menu {
    display: none;
  }
  .nav-in {
    justify-content: space-between;
  }
  .sec {
    padding: 72px 0;
  }
  .sec-head {
    margin-bottom: 34px;
  }
  .books {
    height: 250px;
    transform: scale(0.6);
    margin: -30px 0 -40px;
  }
  .course-grid,
  .steps {
    grid-template-columns: 1fr;
  }
  .course {
    min-height: 220px;
  }
  /* 数据亮点：4 个时排 2×2，其余一行排下 */
  .stats {
    margin-top: 36px;
    padding: 20px 0;
    row-gap: 18px;
  }
  .stats.n4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat b {
    font-size: 26px;
  }
  .stat span {
    font-size: 12px;
  }
  .contact-list {
    grid-template-columns: 76px 1fr;
    padding: 24px;
  }
  .qr-card {
    transform: none;
  }
  .foot-in {
    flex-direction: column;
    align-items: flex-start;
  }
}
