/* ============================================================
   诗韵 · 个人主页
   风格方向：米色手账本（有机自然 + 剪贴簿）
   纸质底色 + 胶带贴纸 + 陶土红单一强调色
   ============================================================ */

:root {
  /* 颜色 */
  --paper:      #F5EFE3;   /* 纸张底色 */
  --paper-deep: #EDE2CD;   /* 数字条 / 分区带 */
  --card:       #FFFBF2;   /* 卡片纸面 */
  --ink:        #3A312A;   /* 暖黑正文 */
  --ink-soft:   #4C4137;   /* 段落文字 */
  --muted:      #6F6153;   /* 次要文字 */
  --clay:       #B54E2A;   /* 唯一强调色 */
  --sage:       #7C8C63;   /* 橄榄绿（辅助） */
  --blush:      #C99A8A;   /* 藕粉（胶带） */
  --line:       rgba(58, 49, 42, .12);

  /* 字体：全部系统字体，零网络请求。
     展示字优先圆体；机器上没有圆体时退到宋体——
     宁可让大字变成"纸上印出来的字"，也不要变成网页默认的黑体。 */
  --font-display: "YouYuan", "Yuanti SC", "Songti SC", "STSong", "SimSun",
                  "Noto Serif SC", "Source Han Serif SC", serif;
  --font-body:    "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei",
                  "Hiragino Sans GB", system-ui, sans-serif;

  /* 动效 */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --dur:  560ms;

  /* 布局 */
  --pad: 22px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 滚动条做细做淡，别在纸面上留下一道灰杠 */
  scrollbar-width: thin;
  scrollbar-color: rgba(58, 49, 42, .22) transparent;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(58, 49, 42, .2);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(58, 49, 42, .32); }

/* 在手机外壳预览页里预览时不需要滚动条 */
html.is-framed { scrollbar-width: none; }
html.is-framed::-webkit-scrollbar { width: 0; height: 0; }

body {
  margin: 0;
  background: #E9DECB;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.9;
  letter-spacing: .015em;
  overflow-x: hidden;            /* 任何宽度都不出现横向滚动条 */
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

b, strong { font-weight: 700; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  background: var(--ink);
  color: #FFF8EF;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- 桌面：一张纸摆在桌面上 ---------- */
.desk { padding: 0; }

.paper {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--pad) 96px;
  background: var(--paper);
  overflow: hidden;
}

/* 纸纹：极淡的噪点，模拟纸纤维 */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.paper > *:not(.grain) { position: relative; z-index: 1; }

/* ---------- 胶带 ---------- */
.tape {
  position: absolute;
  background: rgba(201, 154, 138, .55);
  /* 撕口：两端各切掉一角，让边缘不那么"矩形" */
  clip-path: polygon(1% 4%, 99% 0, 100% 96%, 98% 100%, 2% 98%, 0 8%);
  box-shadow: 0 1px 2px rgba(90, 70, 48, .10);
  pointer-events: none;
}

.tape--photo {
  top: -12px;
  left: 50%;
  width: 78px;
  height: 22px;
  margin-left: -52px;
  transform: rotate(-5deg);
  z-index: 2;
}

/* ---------- 首屏 ---------- */
.hero {
  padding-top: 44px;
  text-align: center;
}

.portrait {
  position: relative;
  width: 138px;
  margin: 0 auto 28px;
  padding: 8px;
  background: var(--card);
  border-radius: 3px;
  transform: rotate(-1.6deg);
  box-shadow: 0 12px 26px rgba(104, 80, 52, .18);
}

.portrait img {
  border-radius: 1px;
  object-fit: cover;
  object-position: center 16%;
}

.name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 14vw, 76px);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: .2em;
  color: var(--ink);
}

/* 字距会在末字后留一份空隙，去掉它，居中才是真的居中 */
.name .ch:last-child { margin-right: -.2em; }

.tagline {
  margin: 14px 0 0;
  font-size: clamp(14.5px, 4vw, 16px);
  color: var(--muted);
  letter-spacing: .1em;
  text-wrap: balance;
}

.quote {
  margin: 30px 0 0;
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--clay);
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(19px, 5.3vw, 24px);
  line-height: 1.85;
  color: var(--ink);
  text-wrap: balance;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 30px;
  padding: 0 44px;
  background: var(--clay);
  color: #FFF8EF;
  font-size: 15.5px;
  letter-spacing: .14em;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(181, 78, 42, .26);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
}

.cta:hover { transform: translateY(-2px); background: #A3431F; box-shadow: 0 14px 28px rgba(181, 78, 42, .3); }
.cta:active { transform: translateY(0) scale(.985); }

.wechat-line {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .06em;
}
.wechat-line b { color: var(--ink); letter-spacing: .03em; }

/* ---------- 数字条 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 40px calc(var(--pad) * -1) 0;
  padding: 26px 6px 24px;
  background: #E9DDC6;
  border-top: 1px solid rgba(58, 49, 42, .14);
  border-bottom: 1px solid rgba(58, 49, 42, .14);
  text-align: center;
}

.stat { padding: 0 4px; }
.stat + .stat { border-left: 1px solid rgba(58, 49, 42, .14); }

.stat__num {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(30px, 8.4vw, 40px);
  font-weight: 400;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat__label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .12em;
}

/* 手绘圈：用椭圆伪元素画，比 SVG 描边更好控制；
   出现时从左往右"落笔"揭开，而不是整块淡入 */
.stat__num--mark::before {
  content: "";
  position: absolute;
  inset: -16% -12%;
  border: 2.4px solid var(--clay);
  border-radius: 50% 47% 52% 49% / 58% 62% 38% 42%;
  transform: rotate(-2.5deg);
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 900ms var(--ease) 260ms, opacity 200ms linear 260ms;
}

.stats.in .stat__num--mark::before {
  opacity: 1;
  clip-path: inset(0 0 0 0);
}

/* ---------- 分区通用 ---------- */
.section { margin-top: 58px; }

.sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--ink);
  text-transform: none;
}

/* 标题前的手作圆点 */
.sec-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clay);
  flex: none;
}

.sec-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(58, 49, 42, .16);
}

/* ---------- 关于我 ---------- */
.prose p {
  margin: 0 0 14px;
  color: var(--ink-soft);
}
.prose p:last-child { margin-bottom: 0; }

.prose p:last-child {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(124, 140, 99, .10);
  border-radius: 10px;
  color: var(--ink);
}

/* ---------- 做过的事 ---------- */
#works { counter-reset: card; }

.card {
  position: relative;
  margin-bottom: 20px;
  padding: 26px 22px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(122, 96, 64, .07);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
  counter-increment: card;
}

/* 卡片右上角的序号，像手账里贴的编号签 */
.card::after {
  content: "0" counter(card);
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  color: rgba(58, 49, 42, .13);
  letter-spacing: .02em;
  pointer-events: none;
}

.card:nth-of-type(odd)  { transform: rotate(-.6deg); }
.card:nth-of-type(even) { transform: rotate(.6deg); }
.card:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 16px 30px rgba(122, 96, 64, .13); }

/* 每张卡片顶部的胶带 */
.card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 64px;
  height: 18px;
  margin-left: -32px;
  background: rgba(201, 154, 138, .5);
  clip-path: polygon(2% 6%, 98% 0, 100% 94%, 96% 100%, 3% 97%, 0 12%);
  transform: rotate(-3deg);
  transition: transform 320ms var(--ease);
}
.card:nth-of-type(even)::before { transform: rotate(3deg); background: rgba(124, 140, 99, .34); }
.card:hover::before { transform: rotate(0deg) translateY(-2px); }

.card__title {
  margin: 0;
  padding-right: 42px;
  font-size: 18.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.card__sub {
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--clay);
  letter-spacing: .1em;
  vertical-align: 2px;
}

.card__lead {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.8;
}

.card__meta {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(58, 49, 42, .1);
}

.meta-row { display: grid; gap: 2px; margin-bottom: 12px; }
.meta-row:last-child { margin-bottom: 0; }

.meta-row dt {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
}

.meta-row dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

/* ---------- 标签 ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--ink);
  background: #EFE1C8;
  border-radius: 999px;
  border: 1px solid rgba(58, 49, 42, .06);
  box-shadow: 0 2px 5px rgba(122, 96, 64, .10);
  letter-spacing: .04em;
  transition: transform 200ms var(--ease), background 200ms var(--ease);
}

.tag:nth-child(odd)  { transform: rotate(-1.2deg); }
.tag:nth-child(even) { transform: rotate(1deg); }
.tag:hover { transform: rotate(0deg) translateY(-2px); background: #EBDCC2; }

/* ---------- 联系方式 ---------- */
.contact { text-align: center; }

.qr-card {
  position: relative;
  display: inline-block;
  margin-top: 4px;
  padding: 12px 12px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(122, 96, 64, .10);
  transform: rotate(-1deg);
  transition: transform 320ms var(--ease);
}
.qr-card:hover { transform: rotate(0deg) scale(1.02); }

.qr-card img { width: 150px; height: 150px; object-fit: contain; border-radius: 4px; }

.qr-card__cap {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .16em;
}

.tape--qr {
  top: -10px;
  left: 50%;
  width: 64px;
  height: 18px;
  margin-left: -32px;
  transform: rotate(3deg);
  background: rgba(232, 217, 190, .95);
}

.wx {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  font-size: 14.5px;
  color: var(--muted);
}
.wx b { letter-spacing: .02em; }

.copy {
  min-height: 36px;
  padding: 4px 14px;
  font-family: inherit;
  font-size: 12px;
  color: var(--clay);
  background: transparent;
  border: 1px solid rgba(181, 78, 42, .45);
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}
.copy:hover { background: rgba(181, 78, 42, .08); }
.copy:active { transform: scale(.97); }

.platforms {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  border-top: 1px dashed rgba(58, 49, 42, .16);
}

.platforms li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px;
  border-bottom: 1px dashed rgba(58, 49, 42, .16);
  font-size: 14.5px;
}

.p-label { color: var(--muted); font-size: 12.5px; letter-spacing: .12em; }
.p-value { color: var(--ink); }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px dashed rgba(58, 49, 42, .18);
  text-align: center;
}

.foot__quote {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
  text-wrap: balance;
}

.foot__copy {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted);
}

/* ---------- 吸底按钮 ---------- */
.sticky-cta {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 26px;
  background: var(--ink);
  color: #FFF8EF;
  font-size: 14.5px;
  letter-spacing: .1em;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(58, 49, 42, .28);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}

.sticky-cta:hover { background: #2C2520; }
.sticky-cta.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(14px);
  pointer-events: none;
}

/* ---------- 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* 逐字落笔 */
.ch { display: inline-block; opacity: 0; transform: translateY(8px); }
.ch.in {
  opacity: 1;
  transform: none;
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}
/* 空格：定宽空盒子，避免衬线字体的全角空格撑开句子 */
.ch--space { width: .34em; }

/* ---------- 平板 ---------- */
@media (min-width: 600px) {
  :root { --pad: 36px; }
  body { font-size: 16px; }
  .portrait { width: 152px; }
  .card { padding: 26px 26px 22px; }
  .qr-card img { width: 168px; height: 168px; }
  .tag { font-size: 13.5px; }
}

/* ---------- 宽平板起：纸从边缘退开，有厚度 ---------- */
@media (min-width: 760px) {
  .desk { padding: 32px 20px 48px; }

  .paper {
    border-radius: 24px;
    box-shadow:
      0 24px 60px rgba(104, 80, 52, .18),
      0 6px 16px rgba(104, 80, 52, .08);
  }
}

/* ---------- 桌面：纸放在桌面上，首屏改为左右错列 ---------- */
@media (min-width: 900px) {
  .desk { padding: 56px 24px 72px; }

  .paper {
    padding: 0 64px 112px;
    border-radius: 26px;
    box-shadow:
      0 30px 70px rgba(104, 80, 52, .20),
      0 6px 18px rgba(104, 80, 52, .10);
  }

  /* 首屏：照片占左栏，姓名与副题在右，引言横贯整张纸 */
  .hero {
    display: grid;
    grid-template-columns: 196px minmax(0, 1fr);
    column-gap: 46px;
    align-items: start;
    padding-top: 72px;
    text-align: left;
  }

  .portrait { grid-column: 1; grid-row: 1 / 3; width: 196px; margin: 0; }
  .name {
    grid-column: 2; grid-row: 1;
    font-size: 76px;
    letter-spacing: .1em;
    text-indent: 0;
  }
  .tagline { grid-column: 2; grid-row: 2; margin-top: 18px; font-size: 16px; }
  .quote { grid-column: 1 / -1; grid-row: 3; margin-top: 44px; font-size: 24px; }
  .cta { grid-column: 1 / -1; grid-row: 4; justify-self: start; margin-top: 30px; }
  .wechat-line { grid-column: 1 / -1; grid-row: 5; margin-top: 12px; }

  .section { margin-top: 76px; }
  .stats { padding: 30px 6px 28px; }
  .stat__num { font-size: 40px; }

  .sticky-cta { left: auto; right: 34px; transform: none; }
  .sticky-cta.is-hidden { transform: translateY(14px); }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .reveal { opacity: 1 !important; transform: none !important; }
  .ch { opacity: 1 !important; transform: none !important; }
  .stat__num--mark::before { opacity: 1 !important; clip-path: none !important; }
  .card, .tag, .qr-card, .portrait { transform: none !important; }
  .card:hover, .tag:hover, .qr-card:hover, .cta:hover { transform: none !important; }
}
