/* ============================================================
   拍小票识别学习站 —— 设计方向：纸与印
   展示字体：宋体（Songti）  正文：系统 sans  数字：等宽
   强调色：单一朱红，取票据 / 印章的语境
   全站零外部资源：无 CDN、无外链字体、无图片，图形全部 CSS 绘制
   ============================================================ */

:root {
  --paper: #f7f4ec;
  --paper-2: #fffdf7;
  --ink: #201d18;
  --ink-2: #4a453c;
  --ink-3: #7d766a;
  --rule: #e0d9c9;
  --rule-2: #cfc6b2;
  --seal: #9d3b2c;
  --seal-2: #7a2d21;

  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gut: clamp(20px, 4vw, 34px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 var(--gut); }

a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }

/* ---------------- 顶栏 ---------------- */
.site { padding-top: 32px; }
.site-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.site-name {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.site-name:hover { color: var(--seal); }

nav.top { display: flex; gap: 26px; flex-wrap: wrap; }
nav.top a {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-decoration: none;
  padding-bottom: 4px;
  transition: color 0.3s var(--ease);
}
nav.top a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--seal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
nav.top a:hover { color: var(--ink-2); }
nav.top a:hover::after { transform: scaleX(1); }
nav.top a.on { color: var(--seal); }
nav.top a.on::after { transform: scaleX(1); }

/* ---------------- Hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: clamp(30px, 4.5vw, 58px);
  align-items: center;
  padding: clamp(52px, 8vw, 96px) 0 clamp(44px, 7vw, 76px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 26px;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--seal); }

.display {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.95rem, 4.4vw, 3.05rem);
  line-height: 1.22;
  letter-spacing: 0.012em;
  margin: 0 0 26px;
  color: var(--ink);
  text-wrap: balance;
}
.display em { font-style: normal; color: var(--seal); }

.lede {
  max-width: 30em;
  margin: 0 0 34px;
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-2);
}

.actions { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.3s var(--ease);
}
.btn:hover { background: var(--seal); }
.btn .arw { transition: transform 0.35s var(--ease); }
.btn:hover .arw { transform: translateX(4px); }

.btn-ghost {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule-2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn-ghost:hover { color: var(--seal); border-color: var(--seal); }

/* ---------------- 小票 ---------------- */
.receipt-wrap { animation: rise 1s var(--ease) 0.18s both; }

.receipt {
  position: relative;
  background: var(--paper-2);
  padding: 28px 26px 30px;
  box-shadow: 0 1px 0 rgba(32, 29, 24, 0.05), 0 26px 50px -32px rgba(32, 29, 24, 0.45);
  transform: rotate(-1.4deg);
}
.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 8px;
  background: var(--paper-2);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 12px);
  mask-image: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 12px);
}
.receipt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 38%, rgba(255, 255, 255, 0.8) 50%, transparent 62%);
  background-size: 100% 320%;
  background-repeat: no-repeat;
  animation: shine 2s var(--ease) 0.6s 1 both;
}
@keyframes shine {
  from { background-position: 0 -120%; }
  to   { background-position: 0 220%; }
}

.r-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.r-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--ink);
}
.r-sub {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-align: center;
  color: var(--ink-3);
}

.r-rows { list-style: none; margin: 0; padding: 0; }
.r-rows li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 9px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 1px dotted var(--rule-2);
}
.r-rows li:last-child { border-bottom: none; }
.r-rows .amt {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.r-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--rule-2);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.r-total b { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.06em; }

.barcode {
  height: 22px;
  margin-top: 20px;
  opacity: 0.72;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 1px, transparent 1px 3px,
    var(--ink) 3px 4px, transparent 4px 7px,
    var(--ink) 7px 9px, transparent 9px 12px
  );
}

.seal {
  position: absolute;
  right: -12px;
  bottom: -18px;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 2px solid var(--seal);
  border-radius: 50%;
  background: rgba(247, 244, 236, 0.7);
  color: var(--seal);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-align: center;
  transform: rotate(-11deg);
}

/* ---------------- 笔记列表 ---------------- */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.sec-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink);
}
.sec-head .cnt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

ol.notes { list-style: none; margin: 0; padding: 0; }
ol.notes li { border-bottom: 1px solid var(--rule); }
ol.notes a {
  display: grid;
  grid-template-columns: 38px 100px 1fr 24px;
  align-items: baseline;
  gap: 0 16px;
  padding: 24px 6px;
  margin: 0 -6px;
  text-decoration: none;
  color: inherit;
  transition: background 0.3s var(--ease);
}
ol.notes a:hover { background: var(--paper-2); }
ol.notes .idx {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
ol.notes .date {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
ol.notes .ttl {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: 0.012em;
  color: var(--ink);
  transition: color 0.3s var(--ease);
}
ol.notes a:hover .ttl { color: var(--seal); }
ol.notes .go {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-3);
  justify-self: end;
  transition: transform 0.35s var(--ease), color 0.3s var(--ease);
}
ol.notes a:hover .go { transform: translateX(5px); color: var(--seal); }

/* ---------------- 关于条 ---------------- */
.about {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: clamp(24px, 4vw, 56px);
  margin-top: clamp(60px, 8vw, 96px);
  padding-top: clamp(44px, 6vw, 64px);
  border-top: 1px solid var(--rule);
}
.about-k {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.about p {
  max-width: 34em;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-2);
}
.facts { list-style: none; margin: 0; padding: 0; }
.facts li {
  display: flex;
  align-items: baseline;
  gap: 11px;
  padding: 9px 0;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
}
.facts li:last-child { border-bottom: none; }
.facts li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  background: var(--seal);
  transform: translateY(-2px);
}

/* ---------------- 文章页 ---------------- */
article { max-width: 660px; margin: 0 auto; padding-top: clamp(46px, 7vw, 78px); }

h1.page {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1.38;
  letter-spacing: 0.012em;
  font-weight: 600;
  margin: 0 0 18px;
}
.meta {
  margin: 0 0 40px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

article h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 44px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
article h2:first-of-type { margin-top: 6px; padding-top: 0; border-top: none; }

article h3 {
  font-size: 15.5px;
  font-weight: 600;
  margin: 24px 0 9px;
  color: var(--ink);
}

article p { margin: 0 0 18px; font-size: 16px; line-height: 1.95; color: var(--ink-2); }
article ul, article ol { margin: 0 0 18px; padding-left: 22px; font-size: 15.5px; line-height: 1.9; color: var(--ink-2); }
article li { margin-bottom: 9px; }
article li:last-child { margin-bottom: 0; }
article strong { color: var(--ink); font-weight: 600; }

article code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: #eeeadf;
  color: #2f4a3e;
  padding: 2px 5px;
  border-radius: 3px;
}

blockquote {
  margin: 0 0 20px;
  padding: 18px 22px;
  background: var(--paper-2);
  border-left: 2px solid var(--seal);
}
blockquote p { margin: 0; font-size: 15px; line-height: 1.9; color: var(--ink-2); }
blockquote p:last-child { margin: 0; }

.back {
  display: inline-block;
  margin-top: 44px;
  font-size: 13.5px;
  color: var(--seal);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule-2);
  transition: border-color 0.3s var(--ease);
}
.back:hover { border-bottom-color: var(--seal); }

/* ---------------- 页脚 ---------------- */
footer.site {
  margin-top: clamp(56px, 8vw, 88px);
  padding: 24px 0 54px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
footer.site .row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
footer.site p { margin: 0; }
footer.site a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
footer.site a:hover { color: var(--seal); border-bottom-color: var(--seal); }

/* ---------------- 动效 ---------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.hero-copy > * { animation: rise 0.85s var(--ease) both; }
.hero-copy > *:nth-child(1) { animation-delay: 0.02s; }
.hero-copy > *:nth-child(2) { animation-delay: 0.09s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.23s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 46px; }
  .receipt-wrap { max-width: 400px; width: 100%; margin: 0 auto 10px; }
  .about { grid-template-columns: 1fr; gap: 18px; }
  .about-k { padding-bottom: 4px; }
}

@media (max-width: 700px) {
  ol.notes a {
    grid-template-columns: 32px 1fr 20px;
    grid-template-areas:
      "idx ttl go"
      ".   date .";
    gap: 3px 12px;
    padding: 20px 4px;
    margin: 0 -4px;
  }
  ol.notes .idx { grid-area: idx; }
  ol.notes .ttl { grid-area: ttl; font-size: 16.5px; }
  ol.notes .go { grid-area: go; }
  ol.notes .date { grid-area: date; font-size: 11px; }
}

@media (max-width: 540px) {
  .site-bar { flex-direction: column; align-items: flex-start; gap: 14px; }
  nav.top { gap: 18px; }
  .receipt { padding: 24px 20px 26px; transform: none; }
  .seal { right: -6px; bottom: -14px; width: 66px; height: 66px; font-size: 11.5px; }
  .btn { padding: 12px 20px; }
}
