/* =========================================================================
   戎糖小记 · Sugrong Log — base.css
   设计令牌 / reset / 版式 / 导航 / 页脚 / 通用组件
   移动优先：先写手机，再在 min-width 里加宽
   ========================================================================= */

:root {
  --font-sans: "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB",
               "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei UI",
               "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-round: "Yuanti SC", "YouYuan", "Quicksand", var(--font-sans);

  /* 纸：整站的底。奶油纸 #fffaf7 打底，再压一层玫瑰色的光（见 body 的 background-image） */
  --paper:   #fffaf7;
  --paper-2: #fdf1ed;

  --pink:        #ffbcc5;
  --pink-soft:   #ffd9de;
  --pink-mist:   #fff5f0;   /* 交替色块：比纸再深半格，偏暖不偏粉 */
  --pink-mist-2: var(--paper);
  --rose:        #ff8fa3;
  --rose-ink:    #d6455f;   /* 需要看清的小号粉字（导航选中、文字链接） */
  --coral:       #ff6b6b;
  --petal:       #ffe4e8;

  --ink:    #322c2d;
  --ink-2:  #5d5455;
  --ink-3:  #8d8486;
  --ink-4:  #b8afb1;
  --line:   #f1e2e5;
  --line-2: #f8eef0;
  --white:  #ffffff;

  --shell: 1160px;
  --gutter: clamp(18px, 5vw, 44px);
  --header-h: 62px;

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  --shadow-sm: 0 2px 10px rgba(255, 137, 163, .14);
  --shadow:    0 12px 34px rgba(255, 137, 163, .18);
  --shadow-lg: 0 26px 70px rgba(180, 90, 110, .20);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}
@media (min-width: 900px) {
  html { scroll-padding-top: calc(var(--header-h) + 20px); }
}

body {
  margin: 0;
  /* 奶油纸 + 三团光：左上偏橘、右上偏粉、底部偏蜜桃。
     用 fixed 挂在 body 上（而不是伪元素），滚动时光跟着画面不动，
     各区块自己盖上去就是「纸上的一块块色」，不会打架 */
  background-color: var(--paper);
  background-image:
    radial-gradient(62% 50% at 2% -8%,  rgba(255, 203, 166, .58), transparent 72%),
    radial-gradient(56% 46% at 102% 2%, rgba(250, 196, 211, .52), transparent 74%),
    radial-gradient(96% 64% at 50% 112%, rgba(255, 226, 204, .52), transparent 76%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .015em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--pink); color: #7a2b34; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 10px; left: 50%; transform: translate(-50%, -180%);
  z-index: 1200; padding: 10px 22px; border-radius: 999px;
  background: var(--coral); color: #fff; font-size: 14px;
  box-shadow: var(--shadow); transition: transform .3s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ------------------------------------------------------------- layout */
.shell {
  width: 100%;
  max-width: min(100% - var(--gutter) * 2, var(--shell));
  margin-inline: auto;
  position: relative;
}

.section { padding: clamp(52px, 11vw, 104px) 0; }

/* 整站就一张纸：不再一条一块地换底色。
   区块之间的节奏靠留白和标题，不靠色块 —— 底下那三团光可以一路透上来。
   band-base / band-tint 两个类保留（有些页面挂着），但都不再上色 */
main > section,
main > section:nth-of-type(even),
main > section.band-base,
main > section.band-tint { background: transparent; }

.section-head { margin-bottom: clamp(26px, 6vw, 48px); }
.section-head--center { text-align: center; }
.section-head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

/* ------------------------------------------------------------- 文字 */
.eyebrow {
  display: inline-block;
  position: relative;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--rose);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.eyebrow::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--pink), var(--rose) 60%, var(--coral));
}
@media (min-width: 900px) {
  .eyebrow { font-size: 13px; margin-bottom: 22px; }
}

.h2 {
  font-size: clamp(24px, 6.2vw, 40px);
  line-height: 1.32;
  font-weight: 800;
  letter-spacing: -.01em;
}
.h2 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--rose), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede {
  font-size: clamp(14.5px, 3.8vw, 16.5px);
  line-height: 1.95;
  color: var(--ink-2);
  max-width: 46em;
}
.muted { color: var(--ink-3); }
.text-center { text-align: center; }

/* ------------------------------------------------------------- 按钮 */
.btn {
  --btn-bg: linear-gradient(135deg, var(--rose), var(--coral));
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .04em;
  box-shadow: 0 10px 24px rgba(255, 107, 107, .26);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(255, 107, 107, .3); }
.btn:active { transform: translateY(0) scale(.99); }
.btn-arrow { width: 20px; height: 10px; flex: none; }
.btn-arrow path {
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn:hover .btn-arrow { animation: nudge .5s var(--ease); }
@keyframes nudge { 50% { transform: translateX(4px); } }

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn--ghost:hover { border-color: var(--pink); color: var(--rose); box-shadow: var(--shadow-sm); }

.btn--sm { padding: 9px 18px; font-size: 13.5px; }

.link-plain {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--rose);
  letter-spacing: .06em;
}
.link-plain:hover { color: var(--coral); }

/* ------------------------------------------------------------- 导航
   两种状态，一次「收拢」：
   · 顶部（默认）：完全透明 —— logo 在最左、导航在最右，横着摊开；
     压深色首图时（.is-over-hero）字转白。
   · 滚过 24px（.is-stuck）：整条往中间收成一颗暗玻璃胶囊，字转白。
   收拢靠 width 过渡（宽度由 ui.js 量出「内容宽度」写进 --pill-w），
   过程中两头始终在盒子里，不会有一截字露到胶囊外面。
   ------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 900;
  height: var(--header-h);
  display: flex; align-items: center;
  background: transparent;
  box-shadow: none;
}
.header-inner {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  /* 顶部通栏：不套 .shell 的 1160 上限，logo 贴到视口最左、导航贴到最右，
     只留一点点安全边距，滚起来才收成居中的胶囊 */
  max-width: none;
  margin-inline: auto;
  gap: clamp(14px, 2.6vw, 38px);
  padding: 6px clamp(14px, 2.2vw, 30px);
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: 0 0 0 0 rgba(20, 12, 16, 0);
  /* blur(0) 而不是 none：滚动态才有得过渡。
     代价是它始终是「包含块」，手机抽屉打开时在下面把它摘掉。 */
  backdrop-filter: blur(0px) saturate(1);
  -webkit-backdrop-filter: blur(0px) saturate(1);
  transition:
    width .62s cubic-bezier(.55, .05, .2, 1),
    gap .5s var(--ease), padding .5s var(--ease),
    background .42s var(--ease), border-color .42s var(--ease),
    box-shadow .42s var(--ease), backdrop-filter .42s var(--ease);
}
/* 压深色首图时，字转白；胶囊留给滚动态 */
.is-over-hero .brand-name,
.is-over-hero .brand-en { color: #fff; }
/* 首图很亮的时候，白字靠一圈软影立住，不用压一层黑 */
.is-over-hero .brand,
.is-over-hero .nav-link { text-shadow: 0 1px 14px rgba(28, 16, 20, .45); }
.is-over-hero .brand-en { opacity: .8; }
.is-over-hero .brand-logo { filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, .5)); }

.site-header.is-stuck {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* 滚动后：收成一颗暗玻璃胶囊（宽度 = 内容宽度，由 JS 量出来） */
.site-header.is-stuck .header-inner {
  width: var(--pill-w, max-content);
  gap: clamp(10px, 2.4vw, 34px);
  padding: 6px 10px 6px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 58%),
    rgba(26, 17, 22, .62);
  border-color: rgba(255, 255, 255, .18);
  backdrop-filter: blur(20px) saturate(1.55);
  -webkit-backdrop-filter: blur(20px) saturate(1.55);
  box-shadow:
    0 16px 40px rgba(28, 14, 20, .26),
    0 1px 0 rgba(255, 255, 255, .10),
    inset 0 1px 0 rgba(255, 255, 255, .16);
}
/* 暗玻璃上的字一律转白 */
.site-header.is-stuck .brand-name,
.site-header.is-stuck .brand-en { color: #fff; text-shadow: none; }
.site-header.is-stuck .brand-en { opacity: .7; }
.site-header.is-stuck .brand-logo { filter: brightness(0) invert(1); }
.site-header.is-stuck .nav-link { color: rgba(255, 255, 255, .82); text-shadow: none; }
.site-header.is-stuck .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.site-header.is-stuck .nav-link.is-active { color: #fff; background: rgba(255, 255, 255, .16); }
.site-header.is-stuck .nav-link.is-active::after { background: #fff; }
.site-header.is-stuck .nav-toggle span { background: #fff; }
/* 抽屉打开时不做收拢动画，直接长回来 */
body.nav-open .site-header.is-stuck .header-inner { width: 100%; }

/* 手机端：顶部同样是「左 logo / 右菜单键」，贴着屏幕两边；
   滚动后收成居中的小胶囊 */
@media (max-width: 899px) {
  .header-inner {
    width: 100%;
    max-width: none;
    padding: 5px 10px 5px 16px;
    gap: 10px;
  }
  .site-header.is-stuck .header-inner {
    width: max(var(--pill-w, 168px), 168px);
    padding: 4px 6px 4px 14px;
  }
}

.brand { display: inline-flex; align-items: center; gap: 9px; z-index: 2; }
.brand-logo { height: 32px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-round);
  font-size: 17px; font-weight: 700; letter-spacing: .14em;
  color: var(--ink);
}
.brand-en {
  font-size: 8.5px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 3px;
}
.is-over-hero .brand-name,
.is-over-hero .brand-en { color: #fff; }
/* 首图很亮的时候，白字靠一圈软影立住，不用压一层黑 */
.is-over-hero .brand,
.is-over-hero .nav-link { text-shadow: 0 1px 14px rgba(28, 16, 20, .45); }
.is-over-hero .brand-en { opacity: .8; }
.is-over-hero .brand-logo { filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, .5)); }

.nav { display: none; }
.nav-list { display: flex; gap: 4px; align-items: center; }
.nav-link {
  position: relative;
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  letter-spacing: .05em;
  color: var(--ink-2);
  border-radius: 999px;
  transition: color .25s, background .25s;
}
.nav-link:hover { color: var(--rose-ink); background: rgba(255, 188, 197, .18); }
.nav-link.is-active { color: var(--rose-ink); font-weight: 600; }
.nav-link.is-active::after {
  content: ''; position: absolute; left: 50%; bottom: 2px;
  width: 14px; height: 2px; border-radius: 2px; transform: translateX(-50%);
  background: var(--rose);
}
.is-over-hero .nav-link { color: rgba(255, 255, 255, .88); }
.is-over-hero .nav-link:hover,
.is-over-hero .nav-link.is-active { color: #fff; background: rgba(255, 255, 255, .14); }
.is-over-hero .nav-link.is-active::after { background: #fff; }

.nav-toggle {
  position: relative; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-content: center; gap: 5px;
  margin-right: -6px;
}
.nav-toggle span {
  display: block; width: 20px; height: 1.8px; border-radius: 2px;
  background: var(--ink); transition: transform .35s var(--ease), opacity .2s, background .3s;
}
.is-over-hero .nav-toggle span { background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .45); }
body.nav-open .nav-toggle span { background: var(--ink); }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(3.4px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { transform: translateY(-3.4px) rotate(-45deg); }

/* 手机抽屉 */
@media (max-width: 899px) {
  /* 关键：backdrop-filter 会让元素成为「包含块」，抽屉是 fixed inset:0，
     会被关在胶囊里。抽屉打开时把玻璃的滤镜摘掉，fixed 才回到视口。 */
  body.nav-open .header-inner {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* 打开瞬间不要动画：宽度从胶囊长回通栏的过程会把 logo 和 X 一起推着走 */
    transition: none;
  }
  /* 收拢动画的 transform 也会临时成为包含块，抽屉打开时一并停掉 */
  body.nav-open .site-header.is-stuck .header-inner { animation: none; }
  .nav {
    display: block;
    position: fixed; inset: 0;
    z-index: 1;
    padding: calc(var(--header-h) + 28px) var(--gutter) 40px;
    /* 实底：以前是 .97 + blur，背后页面的图和字会隐隐透出来，像没盖住 */
    background: #fffafb;
    opacity: 0; visibility: hidden;
    /* 打开时几乎立刻变实：以前 0.35s 的淡入会有一瞬间半透明，背后的
       大图和标题透出来，看着像「没盖住」。菜单项本身另有错峰上浮动画。 */
    transition: opacity .12s linear, visibility .3s;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav { opacity: 1; visibility: visible; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link {
    padding: 18px 6px;
    font-size: 21px;
    color: var(--ink);
    border-bottom: 1px solid var(--line-2);
    border-radius: 0;
    opacity: 0;
    transform: translateY(12px);
  }
  /* 抽屉底色永远是浅色，必须压过 .is-over-hero / .is-stuck 的白字，
     否则窄屏下「白字压白底」完全看不见 */
  .site-header .nav-link,
  body.nav-open .site-header .nav-link { color: var(--ink); text-shadow: none; }
  .site-header .nav-link:hover,
  body.nav-open .site-header .nav-link:hover { color: var(--rose-ink); background: rgba(255, 188, 197, .16); }
  .site-header .nav-link.is-active,
  body.nav-open .site-header .nav-link.is-active { color: var(--rose-ink); background: transparent; }
  .nav-link.is-active::after { display: none; }
  /* 抽屉打开时，品牌字与 logo 也回到深色 */
  body.nav-open .site-header .brand-name { color: var(--ink); }
  body.nav-open .site-header .brand-en { color: var(--ink-3); opacity: 1; }
  body.nav-open .site-header .brand-logo { filter: none; }
  /* 抽屉里的 X 要回到深色（暗玻璃胶囊那套白线只属于收起态） */
  body.nav-open .site-header .nav-toggle span { background: var(--ink); box-shadow: none; }
  /* 抽屉打开时导航条恢复通栏浅色实底：抽屉内容超出屏幕会滚动，
     否则滚上去的菜单项会从透明的导航条底下穿过去，和 logo 撞在一起。
     注意这里不能再用 backdrop-filter——带 blur 的元素会变成 fixed
     后代的包含块，把全屏抽屉 .nav 困在 62px 高的导航条里（小窗口 bug 根因） */
  body.nav-open .site-header {
    background: #fffafa;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    /* 抽屉要贴在视口上，台头这一层不能是包含块：
       transform / filter 一律按死（转换动画也已改成只淡入，见 headerFadeIn） */
    transform: none !important;
    filter: none !important;
  }
  /* 悬浮胶囊在抽屉打开时暂时还原成普通通栏布局（logo 左、X 右），
     尺寸/内边距和顶部常态完全一致，避免打开抽屉的一瞬间 logo 跳位置 */
  body.nav-open .site-header.is-stuck .header-inner {
    width: 100%;
    max-width: none;
    gap: 10px;
    padding: 5px 10px 5px 16px;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
  }
  body.nav-open .nav-link {
    opacity: 1;
    transform: none;
    transition: opacity .34s var(--ease), transform .38s var(--ease);
  }
  body.nav-open .nav-list li:nth-child(1) .nav-link { transition-delay: .04s; }
  body.nav-open .nav-list li:nth-child(2) .nav-link { transition-delay: .08s; }
  body.nav-open .nav-list li:nth-child(3) .nav-link { transition-delay: .12s; }
  body.nav-open .nav-list li:nth-child(4) .nav-link { transition-delay: .16s; }
  body.nav-open .nav-list li:nth-child(5) .nav-link { transition-delay: .20s; }
  body.nav-open .nav-list li:nth-child(6) .nav-link { transition-delay: .24s; }
}
@media (min-width: 900px) {
  .nav { display: block; }
  .nav-toggle { display: none; }
  :root { --header-h: 74px; }
  .brand-logo { height: 38px; }
  .brand-name { font-size: 19px; }
}

/* ------------------------------------------------------------- 页脚
   极简版：只剩描边大字 + 一行小链接 + 版权
   ------------------------------------------------------------- */
.site-footer {
  position: relative;
  padding: clamp(38px, 7vw, 72px) 0 clamp(26px, 4vw, 38px);
  /* 页脚也不再铺一块渐变：让它就是纸的尽头，只留一条细线分界 */
  background: transparent;
  border-top: 1px solid var(--line-2);
  overflow: hidden;
  text-align: center;
}

/* 大字：SVG 描边，宽度永远跟着容器，不会溢出 */
.footer-word {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto clamp(18px, 3.4vw, 28px);
  user-select: none;
}
.footer-word text {
  fill: none;
  stroke: rgba(255, 148, 168, .68);
  stroke-width: 1.1;
  font-family: var(--font-sans);
  font-size: 132px;
  font-weight: 700;
}

.footer-meta { display: grid; justify-items: center; gap: 10px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 20px;
}
.footer-links a {
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--ink-2);
  transition: color .25s;
}
.footer-links a:hover { color: var(--rose-ink); }
.footer-links #footerEmail {
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--pink-soft);
}
.footer-links #footerEmail:hover { color: var(--rose-ink); border-color: var(--rose); }
.footer-copy {
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--ink-4);
}

/* ------------------------------------------------------------- 通用组件 */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: .04em;
  white-space: nowrap;
  transition: all .25s var(--ease);
}
.chip:hover { border-color: var(--pink); color: var(--rose); }
.chip.is-on {
  background: linear-gradient(135deg, var(--rose), var(--coral));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 107, .24);
}
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pink-mist);
  color: var(--rose);
  font-size: 11.5px;
  letter-spacing: .08em;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.field { display: grid; gap: 7px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .05em; }
.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14.5px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--pink-soft);
  box-shadow: 0 0 0 4px rgba(255, 188, 197, .22);
}
.textarea { min-height: 90px; resize: vertical; line-height: 1.8; }

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px dashed var(--line);
}
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }

.skeleton {
  background: linear-gradient(100deg, #f7eef0 20%, #fdf7f8 40%, #f7eef0 60%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* 进场动画 */
.reveal { opacity: 1; transform: none; }
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  /* 关了动效就直接把菜单项摆出来，别让它停在 opacity:0 */
  .nav-link { opacity: 1; transform: none; transition: none; }
}

/* 加载条（首屏） */
.page-cover {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: var(--pink-mist-2);
  transition: opacity .5s var(--ease), visibility .5s;
}
.page-cover_box { display: grid; justify-items: center; gap: 10px; }
.page-cover_brand {
  font-family: var(--font-round);
  font-size: 22px; letter-spacing: .3em; color: var(--ink);
}
.page-cover_sub { font-size: 9px; letter-spacing: .4em; text-transform: uppercase; color: var(--ink-3); }
.page-cover_bar {
  display: block; width: 92px; height: 2px; margin-top: 10px;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
.page-cover_bar i {
  display: block; width: 40%; height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--coral));
  animation: coverBar 1.1s var(--ease) infinite;
}
@keyframes coverBar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
/* 首页「字母开窗」、留言页「拆信封」自己就是开场，别再叠一层转圈封面
   （否则「戎糖小记」会压在信封上淡出，看起来像两段文字叠在一起） */
body[data-page="home"] .page-cover,
body[data-page="contact"] .page-cover { display: none; }
body.is-ready .page-cover { opacity: 0; visibility: hidden; pointer-events: none; }
html:not(.js) .page-cover { display: none; }
/* 兜底：脚本没跑起来（网络/风控卡住）时，封面 4.5 秒后自己撤掉，
   别让人一直盯着「戎糖小记」转圈 */
.page-cover { animation: coverFailsafe 1ms 4.5s forwards; }
@keyframes coverFailsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}


/* ============================================================ 首页开场：字 → 穿过 O → 首图 → 文案
   ① 一行 SUGRONG LOG 逐字浮起（每字 0.6s，间隔 0.055s），停半拍看清
   ② 视线从字母 O 的洞里钻进去：洞里是**下面那层真首图**，洞一放大，
      照片就从那个孔里铺开 —— 不是另贴一张图，所以不糊、也不会有交接的跳
   ③ 标题 / 说明 / 按钮 / 台头 逐项浮出

   为什么不是旧的「按字形挖空的 SVG mask 再放大 14 倍」：
   那等于每帧重新光栅化一整屏遮罩，纯合成变成纯重绘，慢机器上必卡。
   这里只有一个 46px 的圆 + 它的一圈 box-shadow，全程 transform，
   O 的位置和大小由脚本按真实字形量出来（字体换了也对得上）。
   · 只首页有；每次进首页都播（从后退缓存回来也播）
   · 脚本被拦 / 关掉动效：整块不显示，绝不挡页面
   ============================================================ */
.intro {
  position: fixed; inset: 0; z-index: 1900;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  /* 纸面由 .intro_eye 的那圈阴影提供，这里保持透明 */
  background: transparent;
  /* 兜底：脚本活着却一直没开演（加载卡住/报错）时，6.5 秒后自己撤掉，绝不留白屏 */
  animation: introFailsafe 1ms 6.5s forwards;
}
@keyframes introFailsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
html:not(.js) .intro,
html.no-intro .intro { display: none; }
@media (prefers-reduced-motion: reduce) { .intro { display: none; } }

/* 「洞」+ 纸面（一圈 1200px 的环形阴影）。
   平时圆里也是纸色，所以看不出来；只有开演那一刻把填充去掉才露照片 */
.intro_eye {
  position: absolute;
  left: var(--ox, 50%);
  top: var(--oy, 45%);
  width: var(--od, 46px);
  height: var(--od, 46px);
  margin: calc(var(--od, 46px) / -2) 0 0 calc(var(--od, 46px) / -2);
  border-radius: 50%;
  background: var(--pink-mist-2);
  /* 这圈阴影就是「纸面」：spread 要够到屏幕四角（1440 屏约 940px） */
  box-shadow: 0 0 0 1000px var(--pink-mist-2);
  z-index: 0;
  transform: scale(1);
  transform-origin: 50% 50%;
  will-change: transform;
}

.intro_word {
  position: relative; z-index: 1;
  margin: 0;
  white-space: nowrap;
  /* 衬线的大写刊头：笔画有粗细对比，压在纸面上像印上去的 */
  font-family: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  /* 先按 vw 占位，紧跟 #intro 的内联脚本会量出实际字宽收到屏宽 76% */
  font-size: min(11vw, 152px);
  font-weight: 700;
  letter-spacing: .1em;
  color: #402e34;
  /* 压在纸上的一点印痕：字不是浮在半空的一层 */
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85);
  transform: scale(var(--k, 1));
  /* 放大的中心 = 字母 O（脚本量出来塞进 --wx/--wy），镜头才像是从洞里进去的 */
  transform-origin: var(--wx, 50%) var(--wy, 50%);
}
.intro_word span {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) scale(.94);
}
.intro_gap { width: .32em; }

@media (prefers-reduced-motion: no-preference) {
  /* ① 逐字浮起：从下面升上来、微微放大到位 */
  .intro.is-play .intro_word span {
    animation: introLetter .6s cubic-bezier(.18, .82, .28, 1) both;
  }
  .intro.is-play .intro_word span:nth-child(1)  { animation-delay: .04s; }
  .intro.is-play .intro_word span:nth-child(2)  { animation-delay: .095s; }
  .intro.is-play .intro_word span:nth-child(3)  { animation-delay: .15s; }
  .intro.is-play .intro_word span:nth-child(4)  { animation-delay: .205s; }
  .intro.is-play .intro_word span:nth-child(5)  { animation-delay: .26s; }
  .intro.is-play .intro_word span:nth-child(6)  { animation-delay: .315s; }
  .intro.is-play .intro_word span:nth-child(7)  { animation-delay: .37s; }
  .intro.is-play .intro_word span:nth-child(8)  { animation-delay: .425s; }
  .intro.is-play .intro_word span:nth-child(9)  { animation-delay: .48s; }
  .intro.is-play .intro_word span:nth-child(10) { animation-delay: .535s; }
  .intro.is-play .intro_word span:nth-child(11) { animation-delay: .59s; }

  /* ② 穿过 O：洞里的纸色褪掉（照片出现在字母的孔里），洞再往外撑开。
      加速曲线 = 一开始还在孔里，最后一刻猛地冲出去 */
  .intro.is-leaving .intro_eye {
    background-color: transparent;
    animation: introEyeIn .82s cubic-bezier(.34, .38, .36, 1) both;
  }
  /* 字跟着被「冲开」：以 O 为原点往外散，前 40% 就淡干净 ——
     它压在洞的上层，淡慢了一步就会在照片上留一层灰字影 */
  .intro.is-leaving .intro_word {
    animation: introWordGo .52s cubic-bezier(.3, .1, .6, 1) both;
  }
  /* 最后把整块开场收掉。纸是环、洞是照片，所以淡出时照片不会跟着变淡 */
  .intro.is-done {
    opacity: 0;
    transition: opacity .38s ease;
  }
  /* 压暗层跟着一起回来：图一露出来就已经是「压过一层」的样子，
     等文字上来时正好到位，不会先亮一下再暗下去 */
  html.js body.is-intro.is-leaving .hero_scrim {
    opacity: 1;
    transition: opacity 1.05s ease .1s;
  }
}

@keyframes introLetter {
  from { opacity: 0; transform: translateY(28px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* 洞张开：一边撑大、一边滑到画面正中 —— 像镜头凑近字母、把孔对准视野中心，
   最后照片落定的构图就和首图原本的构图一致（洞停在字母里放大，画面会偏左上） */
@keyframes introEyeIn {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(var(--ex, 0px), var(--ey, 0px)) scale(var(--es, 40)); }
}
@keyframes introWordGo {
  0%   { opacity: 1; transform: scale(var(--k, 1)); }
  38%  { opacity: 0; }
  100% { opacity: 0; transform: scale(calc(var(--k, 1) * 1.26)); }
}

/* 手机上 O 的孔只有 10 来 px，要放大约 87 倍才铺满 —— 同样的 0.82s 在手机上
   显得「一下冲出去」，比桌面急躁得多。小屏这一段单独拉长到 1.1s（ui.js 里
   收尾的延时跟着放宽，否则纸环会在洞还没张开时就撤掉） */
@media (max-width: 899px), (max-aspect-ratio: 1 / 1) {
  .intro.is-leaving .intro_eye {
    animation-duration: 1.1s;
  }
}

/* ③ 首图落定 + 文案浮现
   开场期间先把首屏文案和台头按住（浅纸上白字读不清），结束再逐项放出来 */
@media (prefers-reduced-motion: no-preference) {
  html.js body.is-intro .hero_body,
  html.js body.is-intro .hero_meta,
  html.js body.is-intro .scroll-cue,
  html.js body.is-intro .site-header { opacity: 0; transition: none; }
  html.js body.is-intro .hero_scrim { opacity: 0; transition: none; }
  /* 万一开场卡住没收尾，4.2 秒后文案也自己浮出来 */
  html.js body.is-intro .hero_body,
  html.js body.is-intro .hero_meta,
  html.js body.is-intro .scroll-cue,
  html.js body.is-intro .site-header,
  html.js body.is-intro .hero_scrim {
    animation: introShowFailsafe 1ms 4.2s forwards;
  }

  /* 首图：先在近处（1.1，像贴着洞看），穿过去之后缓缓退回原位。
     提前提成合成层 —— 洞一开就能直接画，不用那一帧现建层 */
  html.js body.is-intro .hero_media { transform: scale(1.1); will-change: transform; }
  html.js body.is-intro .hero_media img { animation-play-state: paused; }
  html.js body.is-intro .hero_scrim,
  html.js body.is-intro .intro_eye { will-change: opacity, transform; }
  html.js body.is-intro.is-leaving .hero_media {
    transform: scale(1);
    transition: transform 1.6s cubic-bezier(.16, .7, .24, 1);
  }

  html.js body.is-intro-done .hero_body [data-reveal] {
    animation: heroLineIn .82s cubic-bezier(.2, .8, .28, 1) both;
    /* 纸还在淡出（0.38s），文案再晚一点起，别压在纸上 */
    animation-delay: .42s;
  }
  html.js body.is-intro-done .hero_body [data-delay="1"] { animation-delay: .53s; }
  html.js body.is-intro-done .hero_body [data-delay="2"] { animation-delay: .64s; }
  html.js body.is-intro-done .hero_body [data-delay="3"] { animation-delay: .75s; }
  /* 台头单独用「只淡入」的动画：heroLineIn 带 transform，只要它挂在元素上
     （both 填充），.site-header 就一直是 fixed 后代的包含块 ——
     手机全屏抽屉会被关进 62px 高的导航条里，只剩上面一截 */
  html.js body.is-intro-done .site-header {
    animation: headerFadeIn .7s var(--ease-soft) .36s both;
  }
  html.js body.is-intro-done .scroll-cue,
  html.js body.is-intro-done .hero_meta {
    animation: heroLineIn .8s var(--ease-soft) .62s both;
  }
}
@keyframes introShowFailsafe { to { opacity: 1; } }
/* 台头入场只动透明度：它旁边挂着全屏抽屉（fixed inset:0），
   祖先上只要有 transform，抽屉就会被裁在导航条那一小块里 */
@keyframes headerFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes heroLineIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroScrimIn { from { opacity: 0; } to { opacity: 1; } }

/* toast */
.toast-wrap {
  position: fixed; left: 50%; bottom: 26px; z-index: 1600;
  transform: translateX(-50%);
  display: grid; gap: 8px; pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(50, 44, 45, .92);
  color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toastIn .3s var(--ease);
}
.toast.is-bad { background: rgba(214, 69, 69, .94); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 1500;
  display: grid; place-items: center;
  padding: 4vmin;
  background: rgba(28, 20, 22, .92);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 100%; max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  object-fit: contain;
}
.lightbox_cap {
  margin-top: 14px; color: rgba(255, 255, 255, .82);
  font-size: 13px; text-align: center; letter-spacing: .05em;
}
.lightbox_close {
  position: absolute; top: 14px; right: 14px;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 22px; line-height: 1;
  background: rgba(255, 255, 255, .12);
}
.lightbox_close:hover { background: rgba(255, 255, 255, .22); }
.lightbox_nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; background: rgba(255, 255, 255, .1);
  font-size: 18px;
}
.lightbox_nav:hover { background: rgba(255, 255, 255, .2); }
.lightbox_nav--prev { left: 10px; }
.lightbox_nav--next { right: 10px; }
@media (max-width: 600px) { .lightbox_nav { display: none; } }
