/* ============================================================
   Capynana · 设计系统  v0.1
   风格：柔和纸感 × 治愈系编辑风（温暖、精致、低门槛）
   字体合规：Noto Sans SC / Noto Serif SC（思源系列，OFL 1.1 可商用）
   ============================================================ */
:root {
  --paper: #faf6ee;
  --paper-deep: #f3ecdd;
  --card: #fffdf8;
  --ink: #352a20;
  --ink-2: #7d6c58;
  --ink-3: #a89478;
  --line: #eae0cd;
  --line-strong: #d8c9ab;

  --banana: #f0b429;
  --banana-soft: #fdf3d7;
  --banana-ink: #8a6206;
  --coral: #e8785a;
  --coral-soft: #fbe9e2;
  --coral-ink: #a04328;
  --teal: #2e8b74;
  --teal-soft: #e2f1ea;
  --teal-ink: #1d5f4e;
  --lilac: #8a79c9;
  --lilac-soft: #edeaf8;
  --lilac-ink: #5b4a99;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --shadow-sm: 0 1px 2px rgba(83, 62, 32, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(83, 62, 32, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(83, 62, 32, 0.28);

  --font-display: "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 纸张质感：极淡的颗粒噪点，避免"AI 白板感" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(120, 90, 40, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 32px;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.logo-img {
  width: 36px; height: 36px; border-radius: 12px; object-fit: cover;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.logo:hover .logo-img { transform: rotate(-8deg) scale(1.06); }
.nav-links { display: flex; gap: 26px; font-size: 15px; color: var(--ink-2); margin-left: auto; }
.nav-links a { transition: color 0.2s; padding: 4px 0; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active { border-bottom: 2px solid var(--banana); }
.nav-cta {
  background: var(--ink); color: var(--banana-soft) !important;
  padding: 8px 20px; border-radius: 999px; font-size: 14px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-cta:hover { transform: translateY(-1px); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  padding: 12px 28px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--banana); color: #4a3503; }
.btn-ink { background: var(--ink); color: #fdf6e3; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line-strong); color: var(--ink); }
.btn-sm { padding: 8px 18px; font-size: 14px; }

/* ---------- 标签 pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 4px 12px; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink-2);
  border: 1px solid var(--line);
}
.pill-banana { background: var(--banana-soft); color: var(--banana-ink); border-color: #f0dfae; }
.pill-teal { background: var(--teal-soft); color: var(--teal-ink); border-color: #c4e4d7; }
.pill-coral { background: var(--coral-soft); color: var(--coral-ink); border-color: #f3d2c5; }
.pill-lilac { background: var(--lilac-soft); color: var(--lilac-ink); border-color: #d9d2f0; }

/* ---------- 区块标题（编辑风 kicker） ---------- */
.kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: 0.2em; color: var(--coral-ink);
  font-weight: 500;
}
.kicker::before { content: ""; width: 22px; height: 2px; background: var(--coral); border-radius: 2px; }
.h2 {
  font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700; line-height: 1.3; margin: 10px 0 8px;
}
.sub { color: var(--ink-2); font-size: 15.5px; max-width: 560px; }

/* 荧光笔划重点效果 */
.mark {
  background: linear-gradient(transparent 58%, var(--banana) 58%, var(--banana) 92%, transparent 92%);
  padding: 0 2px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------- 课程卡片 ---------- */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.course-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
  display: flex; flex-direction: column;
}
.course-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.course-thumb {
  height: 150px; position: relative;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  color: rgba(53, 42, 32, 0.55);
}
.course-thumb .thumb-badge { position: absolute; top: 12px; left: 12px; }
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-body h3 { font-size: 17px; font-weight: 700; line-height: 1.4; }
.course-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.course-foot {
  margin-top: auto; padding-top: 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px dashed var(--line);
}
.price { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--coral-ink); }
.price small { font-size: 12px; color: var(--ink-3); font-family: var(--font-body); font-weight: 400; }

/* ---------- 表单 ---------- */
.input {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--card); font-family: inherit; font-size: 15px; color: var(--ink);
  transition: border-color 0.2s;
}
.input:focus { outline: none; border-color: var(--banana); box-shadow: 0 0 0 3px var(--banana-soft); }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 90px; border-top: 1px solid var(--line);
  background: var(--paper-deep);
  padding: 44px 0 36px;
  position: relative; z-index: 1;
}
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 0 28px; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer h4 { font-size: 14px; margin-bottom: 12px; color: var(--ink); }
.footer ul { list-style: none; font-size: 14px; color: var(--ink-2); display: grid; gap: 8px; }
.footer ul a:hover { color: var(--ink); }
.footer-note { font-size: 12.5px; color: var(--ink-3); margin-top: 28px; }

/* ---- 通用交互组件（由 cpn.js 使用） ---- */
.cpn-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fdf6e3;
  font-size: 14px; line-height: 1.5;
  padding: 12px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; z-index: 9999;
  transition: opacity 0.25s, transform 0.25s;
  max-width: min(90vw, 480px); text-align: center;
}
.cpn-toast.show { opacity: 1; transform: translate(-50%, 0); }
.cpn-toast.is-ok { background: var(--teal-ink); }
.cpn-toast.is-err { background: var(--coral-ink); }

/* ---------- 引导成交弹窗（支付通道接入前的临时承接） ---------- */
.cpn-modal {
  position: fixed; inset: 0; z-index: 9998;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.cpn-modal.show { display: flex; }
.cpn-modal-mask {
  position: absolute; inset: 0;
  background: rgba(53, 42, 32, 0.42);
  backdrop-filter: blur(3px);
  animation: cpnFade .18s ease-out;
}
.cpn-modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 448px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 30px 26px;
  animation: cpnPop .22s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes cpnFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cpnPop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.cpn-modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--paper-deep); color: var(--ink-2);
  font-size: 19px; line-height: 1; cursor: pointer;
}
.cpn-modal-x:hover { background: var(--line); }
.cpn-modal-kicker {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--banana-ink); background: var(--banana-soft);
  padding: 4px 11px; border-radius: 999px; margin-bottom: 12px;
}
.cpn-modal-card h3 { font-family: var(--font-display); font-size: 20px; line-height: 1.45; margin-bottom: 10px; }
.cpn-modal-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.cpn-modal-card ol { margin: 14px 0 18px; padding-left: 0; list-style: none; counter-reset: s; display: grid; gap: 9px; }
.cpn-modal-card ol li {
  counter-increment: s; position: relative; padding-left: 30px;
  font-size: 13.5px; color: var(--ink); line-height: 1.65;
}
.cpn-modal-card ol li::before {
  content: counter(s);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal-ink);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.cpn-modal-actions { display: grid; gap: 9px; margin-top: 4px; }
.cpn-modal-actions .btn { width: 100%; justify-content: center; }
.cpn-modal-note {
  margin-top: 14px; padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-3);
}
.cpn-modal-note a { color: var(--teal-ink); text-decoration: underline; }

.nav-user {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 500; color: var(--ink);
  padding: 7px 16px; border-radius: 999px;
  background: var(--banana-soft); border: 1.5px solid #f0dfae;
  transition: background 0.2s;
}
.nav-user::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.nav-user:hover { background: var(--banana); }

/* ---------- 通用 section ---------- */
.section { padding: 72px 0 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }

@media (max-width: 900px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links a:not(.nav-cta) { display: none; }
}
@media (max-width: 600px) {
  .course-grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 18px; }
}
