/* 栗子妈妈启蒙工具箱 · 数学 · 静态稿
   方向：桌上的棉签和牛皮纸 */

:root {
  --paper: #f5eee0;
  --paper-2: #ece2cf;
  --card: #fffaf1;
  --ink: #1f2a44;
  --ink-soft: #5c6479;
  --line: #d8c9ad;
  --shadow: 0 1px 0 #e4d7bd, 0 8px 24px -14px rgba(60, 40, 10, .35);

  --hat-1: #d9733a;   /* 数数 胡萝卜橙 */
  --hat-2: #5b9450;   /* 分与合 青草绿 */
  --hat-3: #3c6aa8;   /* 位值 棉签蓝 */
  --hat-4: #b0513c;   /* 两位数口算 砖红 */
  --hat-5: #76579f;   /* 巧算 葡萄紫 */

  --hat-1-soft: #f6dcc8;
  --hat-2-soft: #dbe9d3;
  --hat-3-soft: #d6e2f1;
  --hat-4-soft: #f0d6cd;
  --hat-5-soft: #e3daee;

  --title: "LXGW WenKai", "Kaiti SC", "STKaiti", "KaiTi", serif;
  --body: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(120, 90, 40, .05) 1px, transparent 1.2px),
    radial-gradient(rgba(120, 90, 40, .04) 1px, transparent 1.2px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 5px;
  color: var(--ink);
  font: 16px/1.75 var(--body);
}
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--title); font-weight: 700; line-height: 1.3; margin: 0; }
p { margin: 0 0 .6em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ── 页头 ── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(245, 238, 224, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px dashed var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 10px; height: 54px; }
.brand { font-family: var(--title); font-size: 18px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand svg { width: 28px; height: 28px; }
.top .xhs {
  margin-left: auto; font-size: 13px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px;
}
.btn-mini {
  font: inherit; font-size: 12px; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 2px 10px; cursor: pointer; color: var(--ink);
}

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px/1 var(--body);
  padding: 12px 18px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff8ec;
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.hat { border-color: var(--hc); background: var(--hc); }

/* ── 卡片 ── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.tag {
  display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-soft);
}
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

/* ── 折叠 ── */
details.fold { border-top: 1px dashed var(--line); padding: 10px 0; }
details.fold summary {
  cursor: pointer; list-style: none; font-family: var(--title); font-size: 18px;
  display: flex; align-items: center; gap: 8px;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "＋"; margin-left: auto; color: var(--ink-soft); }
details.fold[open] summary::after { content: "－"; }
details.fold .fold-body { padding-top: 8px; }

/* ── 页脚 ── */
.foot { margin-top: 56px; padding: 28px 0 40px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink-soft); }
.foot .wrap { display: grid; gap: 10px; }
.foot strong { color: var(--ink); font-family: var(--title); font-size: 17px; }
.foot .row { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* ── 进场 ── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* ── 打印 ── */
@media print {
  .top, .foot, .no-print { display: none !important; }
  body { background: #fff; }
}

/* 窄屏页头 */
.brand { white-space: nowrap; }
.top .xhs { white-space: nowrap; }
@media (max-width: 480px) {
  .brand { font-size: 16px; }
  .top .xhs .handle { display: none; }
}

/* 页头 logo + slogan */
.brand .logo img { width: 30px; height: 30px; object-fit: contain; display: block; mix-blend-mode: multiply; }
.brand .bname { display: flex; flex-direction: column; line-height: 1.15; }
.brand .bname small { font-family: var(--body); font-size: 11px; color: var(--ink-soft); font-weight: 400; letter-spacing: .5px; }
.foot .wrap > span:first-of-type { font-family: var(--title); color: var(--hat-1); }

/* 名片卡（两页共用） */
.promo { margin-top: 34px; display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start;
  background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 18px; box-shadow: 4px 4px 0 var(--hat-1-soft); }
.promo-art { width: 72px; height: auto; mix-blend-mode: multiply; }
.promo h3 { font-size: 22px; }
.promo .slogan { font-family: var(--title); font-size: 17px; color: var(--hat-1); margin: 2px 0 8px; }
.promo .perks { margin: 0; padding-left: 1.1em; font-size: 14.5px; }
.promo .perks li { margin-bottom: 2px; }
.promo .contact { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin-top: 10px; }
.page-end { height: 40px; }

/* 微信图标（代替「微信」两个字） */
img.wx, .promo img.wx, .lock img.wx { width: 1.35em !important; height: 1.35em !important; max-width: none; flex: none; vertical-align: -0.32em; margin: 0 2px; display: inline-block; }
.wx-line { display: inline-flex; align-items: center; gap: 4px; }
.wx-line img.wx { vertical-align: 0; margin: 0; }

/* 访问计数（累计到门槛才显示） */
.visits { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 18px 0 0; }
.visits b { color: var(--ink); font-family: var(--title); font-size: 15px; }
