/* ============================================================
   SPiCa — 白天 / Q版
   气质的根基是三个数：字距 .08em、行高 1.9、正文宽 860px。
   改这三样最伤筋动骨，配色和插画都是其次。
   ============================================================ */

:root {
  --ink:        #33414E;
  --ink-mid:    #5D6B77;
  --ink-light:  #93A0AA;

  --bg:         #FAFCFC;
  --bg-warm:    #FDFEFE;

  --accent:     #39C5BB;   /* 只用于细线 / 下划线 / hover，面积极小才高级 */
  --pink:       #F3C9D2;   /* 全站只出现一次 */

  --line:       rgba(51, 65, 78, .10);
  --line-soft:  rgba(51, 65, 78, .06);

  --serif: "Shippori Mincho", "Noto Serif SC", "Source Han Serif SC",
           "Songti SC", "STSong", "SimSun", serif;
  --sans:  "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
           "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;

  --wrap: 860px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  /* 细体只适合大字：13~15px 的汉字用 300 会糊笔画。气质靠行高/字距/留白，不靠细体 */
  font-weight: 400;
  font-size: 15px;
  line-height: 1.9;          /* ← 灵魂之一 */
  letter-spacing: 0.08em;    /* ← 灵魂之二 */
  -webkit-font-smoothing: antialiased;

  background-image: radial-gradient(rgba(51, 65, 78, .05) 1px, transparent 1px);
  background-size: 4px 4px;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }


/* ---------- 左侧竖排目录 ---------- */

.side-nav {
  position: fixed;
  left: 2.4rem; top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.side-nav a {
  display: flex; flex-direction: column; gap: .12rem;
  font-size: 10px; letter-spacing: .22em;
  color: var(--ink-light);
  transition: color .5s ease;
}
.side-nav a .cn { font-size: 9px; letter-spacing: .3em; opacity: .7; }
.side-nav a::before {
  content: ""; width: 12px; height: 1px;
  background: var(--line); margin-bottom: .45rem;
  transition: width .5s ease, background .5s ease;
}
.side-nav a:hover,
.side-nav a.on { color: var(--ink); }
.side-nav a:hover::before,
.side-nav a.on::before { width: 28px; background: var(--accent); }


/* ---------- HERO：白天 ---------- */

.hero {
  position: relative; overflow: hidden;
  min-height: 92vh; min-height: 92svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  /* 人物已经画进场景里了（脚踩在路上、有投影），所以 hero 不再叠单独的角色层。
     天空蓝比之前淡一档：这版稿子本身几乎全是纸白，蓝加重会把铅笔线压掉。 */
  background:
    linear-gradient(to bottom,
      rgba(188, 224, 232, .40) 0%,
      rgba(211, 234, 238, .20) 28%,
      rgba(250, 252, 252, 0)  54%),
    url("assets/hero-scene-figure3.webp") center bottom / cover no-repeat,
    var(--bg);
}
/* 底部渐隐到页面底色，否则 hero 和正文之间会有一道硬边 */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(250, 252, 252, 0) 78%, var(--bg) 100%);
}

.clouds { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.clouds img {
  position: absolute; will-change: transform; opacity: .34;
  /* 不能用 animation 简写:简写会把 duration 重置成 0s,而本规则(类+标签)特异性
     高于 .c1(单类),0s 会压过 48s,云直接钉死——2026-07-26 修的就是这个 */
  animation-name: drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes drift {
  from { transform: translateX(-34vw); }
  to   { transform: translateX(134vw); }
}
/* 跨度是 168vw（-34 → 134），所以 48s ≈ 3.5vw/s：肉眼看得见在飘，又不至于赶路。
   三个周期互质，避免它们周期性地排成一列。 */
.c1 { top:  9%; width: 26vw; min-width: 200px; animation-duration: 48s; }
.c2 { top: 24%; width: 17vw; min-width: 140px; animation-duration: 67s; animation-delay: -30s; opacity: .26; }
.c3 { top: 38%; width: 32vw; min-width: 250px; animation-duration: 89s; animation-delay: -55s; opacity: .20; }

.hero-inner { position: relative; z-index: 3; padding: 0 1.5rem; }


.hero-name {
  margin: 0 0 .8rem;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.8rem, 4.6vw, 2.6rem);
  letter-spacing: .24em; text-indent: .24em; line-height: 1.5;
}
.hero-id { margin: 0 0 1.5rem; font-size: 10px; letter-spacing: .34em; color: var(--ink-light); }
/* 颜色三级规则：正文=ink，辅助（日期/标签/meta）=ink-mid，装饰和占位=ink-light */
.hero-tag { margin: 0 auto; max-width: 26em; font-size: 13px; line-height: 2.1; color: var(--ink); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 2.2rem; z-index: 3;
  width: 1px; height: 42px; overflow: hidden;
  background: linear-gradient(to bottom, transparent, var(--line));
}
.scroll-hint::after {
  content: ""; position: absolute; left: 0; top: -42px;
  width: 1px; height: 42px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: drop 3.2s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes drop {
  0%   { transform: translateY(0);    opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(88px); opacity: 0; }
}


/* ---------- 模块 ---------- */

.sec { padding: 6.5rem 0; }

.sec-title {
  display: flex; align-items: baseline; gap: 1.1rem;
  margin: 0 0 2.8rem; font-weight: 400;
}
.sec-title .en { font-family: var(--serif); font-size: 1.1rem; letter-spacing: .28em; }
.sec-title .cn { font-size: 10px; letter-spacing: .34em; color: var(--ink-light); }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* 文字 + 角色两栏，逐段左右交替 */
.row { display: grid; grid-template-columns: 1fr 210px; gap: 2.5rem; align-items: center; }
.sec.flip .row { grid-template-columns: 210px 1fr; }
/* 单独设计的整幅插图（.art）比 chibi 高瘦，给它更宽的一栏 */
.row.wide { grid-template-columns: 1fr 250px; }
.sec.flip .row.wide { grid-template-columns: 250px 1fr; }
.sec.flip .row .art { order: 1; }
.sec.flip .row .body  { order: 2; }
.sec.flip .row .chibi { order: 1; }

.body > p { margin: 0 0 1.5rem; }
.body > p:last-child { margin-bottom: 0; }
.muted { color: var(--ink-light); font-size: 12px; }

/* 必须是 max-height + max-width 的组合，不能用固定 height 配 max-width：
   后者在「图比容器宽」时会砍宽度却死守高度，把图横向压扁（explain 那张就是）。
   自然比例的章节小场景不再上下浮动——桌子梯子邮筒跟着飘会很怪，Q 版才禁得起 bob。 */
.chibi img {
  max-height: 320px; max-width: 100%;
  width: auto; height: auto;
  display: block; margin: 0 auto;
}
/* ---------- 关于：静帧插图 ----------
   局部逐帧动画（摆腿/翻页/点脚尖）试了三版，观感都勉强，先用静帧。
   这一帧来自六帧共识板合成，是最干净的一张。 */
.art .still {
  display: block; margin: 0 auto;
  max-height: 400px; max-width: 100%;
  width: auto; height: auto;
}


/* ---------- 文章列表(首页 posts 章,由 build.py 填充) ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li {
  display: flex; gap: 1.4rem; align-items: baseline;
  padding: .7rem 0; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.post-date { font-size: 10px; letter-spacing: .2em; color: var(--ink-light); flex-shrink: 0; }
.post-list a { color: var(--ink); border-bottom: 1px solid transparent; transition: border-color .4s ease; }
.post-list a:hover { border-color: var(--accent); }

/* ---------- 文章页(posts/*.html,模板在 build.py 里) ---------- */
.post-wrap { max-width: var(--wrap); margin: 0 auto; padding: 4.5rem 2rem 5rem; }
.post-back { font-size: 11px; letter-spacing: .2em; color: var(--ink-light); }
.post-back:hover { color: var(--ink); }
.post-title {
  font-family: var(--serif); font-weight: 400;
  font-size: 1.5rem; letter-spacing: .12em; margin: 2.4rem 0 .6rem;
}
.post-meta { font-size: 10px; letter-spacing: .24em; color: var(--ink-light); margin: 0 0 3rem; }
.post-body { font-size: 14px; }
.post-body h2 { font-family: var(--serif); font-weight: 400; font-size: 1.1rem; letter-spacing: .2em; margin: 2.8rem 0 1rem; }
.post-body h3 { font-size: 14px; letter-spacing: .12em; margin: 2.2rem 0 .8rem; }
.post-body p { margin: 0 0 1.5rem; }
.post-body img { max-width: 100%; height: auto; display: block; margin: 2rem auto; }
.post-body code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .92em; background: rgba(51, 65, 78, .05);
  padding: .1em .35em; border-radius: 3px;
}
.post-body pre {
  background: rgba(51, 65, 78, .04); border: 1px solid var(--line-soft);
  padding: 1rem 1.2rem; overflow-x: auto; line-height: 1.7;
}
.post-body pre code { background: none; padding: 0; }
.post-body blockquote {
  margin: 1.5rem 0; padding: .2rem 0 .2rem 1.2rem;
  border-left: 2px solid var(--accent); color: var(--ink-mid);
}
.post-body a { color: var(--ink); border-bottom: 1px solid var(--accent); }
.post-body ul, .post-body ol { margin: 0 0 1.5rem; padding-left: 1.6em; }
.post-body hr { border: none; height: 1px; background: var(--line-soft); margin: 2.5rem 0; }
.post-foot { margin-top: 5rem; text-align: center; }

/* ---------- more:她在看手机回消息 ----------
   .chat 定高 = 插画渲染高(320px),行内 align-items:center 下两者底边对齐,
   输入框正好落在鞋子的高度;消息多了只在内部滚,容器高度永远不变 */
.chat { height: 320px; display: flex; flex-direction: column; }
.chat-log {
  flex: 1; display: flex; flex-direction: column; gap: .7rem;
  overflow-y: auto;
  padding: .2rem 2px;
  scrollbar-width: none;             /* 滚动条藏掉,滚轮/触摸照常 */
}
.chat-log::-webkit-scrollbar { display: none; }
/* 消息贴底,像手机聊天;比 justify-content:flex-end 稳,不吃滚动 */
.chat-log > :first-child { margin-top: auto; }
.bubble {
  max-width: 85%; padding: .55rem .9rem;
  font-size: 13px; line-height: 1.8;
  border: 1px solid var(--line); background: var(--bg-warm);
  border-radius: 2px 10px 10px 10px;   /* 缺一角,手贴的便签感 */
}
.bubble.me {
  align-self: flex-end;
  background: rgba(57, 197, 187, .07);
  border-radius: 10px 2px 10px 10px;
}
.bubble.wait { color: var(--ink-light); letter-spacing: .3em; }
.chat-form {
  display: flex; gap: .8rem; align-items: baseline;
  margin-top: 1.2rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--line);
  transition: border-color .4s ease;
}
.chat-form:focus-within { border-color: var(--accent); }
.chat-form input {
  flex: 1; border: none; outline: none; background: none;
  font: inherit; font-size: 13px; color: var(--ink); letter-spacing: .08em;
}
.chat-form input::placeholder { color: var(--ink-light); }
.chat-form button {
  border: none; background: none; cursor: pointer;
  font: inherit; font-size: 11px; letter-spacing: .24em; color: var(--ink-mid);
  padding: 0 .2rem;
}
.chat-form button:hover { color: var(--accent); }
.chat-form button:disabled { color: var(--ink-light); cursor: default; }

/* 分隔线 ✧ */
.divider { position: relative; height: 1px; background: var(--line-soft); }
.divider::before {
  content: "✧"; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 1.1rem; background: var(--bg);
  color: var(--accent); font-size: 10px; line-height: 1;
}


/* ---------- 关于：元信息 ---------- */

.meta {
  margin: 2.2rem 0 0;
  display: grid; grid-template-columns: 4.2rem 1fr;
  gap: .8rem 1.5rem; font-size: 13px;
}
.meta dt { color: var(--ink-light); font-size: 11px; letter-spacing: .2em; }
.meta dd { margin: 0; color: var(--ink-mid); }


/* ---------- 作品 ---------- */

.work-list { list-style: none; margin: 0; padding: 0; }
.work { padding: 1.9rem 0; border-top: 1px solid var(--line-soft); }
.work:last-child { border-bottom: 1px solid var(--line-soft); }

.work-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: .7rem;
}
.work-head h3 {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: 1rem; letter-spacing: .16em;
}
.work-tag { font-size: 10px; letter-spacing: .2em; color: var(--ink-light); white-space: nowrap; }

.work-desc { margin: 0 0 .9rem; font-size: 13px; color: var(--ink); }
.work-links { margin: 0; font-size: 11px; letter-spacing: .14em; }
.work-links a {
  color: var(--ink-mid); padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  transition: color .4s ease, border-color .4s ease;
}
.work-links a:hover { color: var(--ink); border-color: var(--accent); }
.work-links .sep { color: var(--ink-light); margin: 0 .55rem; }
.work-muted { color: var(--ink-light); letter-spacing: .12em; }


/* ---------- 喜欢的东西 ---------- */

.likes { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.likes li {
  display: flex; align-items: baseline; gap: 1.4rem;
  padding: .75rem 0; border-bottom: 1px solid var(--line-soft);
}
.likes .k {
  width: 4.5rem; flex-shrink: 0;
  font-size: 10px; letter-spacing: .24em; color: var(--ink-light);
}
.likes .v { color: var(--ink); }

/* ---------- 手帐拼贴 ----------
   「抠出来的图贴上去像贴纸」在场景里是缺陷，在这儿是主题本身：
   白边（切图时外扩 9px 的纸底）、胶带、歪斜、投影全都往外露。
   歪斜只放 rotate，位置错落用 margin 做 —— hover 摆正时不会连位置一起跳。 */
.collage {
  width: 100%; max-width: 250px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .5rem .6rem; align-items: start;
}
.stk { position: relative; transition: transform .45s cubic-bezier(.2,.6,.2,1); }
.stk img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 3px 5px rgba(51, 65, 78, .14));
}
/* 和纸胶带：半透明才像胶带，两端的锯齿是撕出来的毛边 */
.stk::after {
  content: ""; position: absolute; top: -8px; left: 24%;
  width: 52%; height: 17px;
  background: rgba(168, 205, 216, .45);
  box-shadow: 0 1px 2px rgba(51, 65, 78, .08);
  clip-path: polygon(0 0, 100% 0, 97% 18%, 100% 34%, 96% 52%, 100% 68%, 97% 84%, 100% 100%,
                     0 100%, 3% 84%, 0 68%, 4% 52%, 0 34%, 3% 18%);
}
.s-game  { transform: rotate(-5deg); }
.s-music { transform: rotate(4deg);  margin-top: 1.1rem; }
.s-sport { transform: rotate(3deg);  margin-top: -.4rem; }
.s-alone { transform: rotate(-4deg); margin-top: .5rem; }
.s-game::after  { left: 14%; transform: rotate(-10deg); }
.s-music::after { left: 40%; transform: rotate(8deg); }
.s-sport::after { left: 30%; transform: rotate(-6deg); }
.s-alone::after { left: 38%; transform: rotate(12deg); }
/* 摸一下就摆正 —— 像用手把贴纸抚平 */
.stk:hover { transform: rotate(0) scale(1.04); z-index: 2; }


/* ---------- 日志 ---------- */

.log { margin: 0; }
.log-item { padding: 1.3rem 0; border-bottom: 1px solid var(--line-soft); }
.log-item:first-child { padding-top: 0; }
.log-date { font-size: 10px; letter-spacing: .2em; color: var(--ink-light); }
.log-item p { margin: .35rem 0 0; font-size: 13px; color: var(--ink); }


/* ---------- 联系 ---------- */

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li {
  display: flex; align-items: baseline; gap: 1.5rem;
  padding: .9rem 0; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.link-label { width: 4.5rem; flex-shrink: 0; font-size: 10px; letter-spacing: .24em; color: var(--ink-light); }
.link-list a {
  color: var(--ink); border-bottom: 1px solid transparent;
  transition: color .4s ease, border-color .4s ease;
}
.link-list a:hover { border-color: var(--accent); }

/* 机密文档式涂黑条。真实内容不在页面源码里——不是遮住,是真没有 */
.redacted {
  display: inline-block;
  width: 8em; height: 1.15em;
  background: var(--ink);
  border-radius: 1px;
  vertical-align: text-bottom;
  transform: rotate(-.3deg);
}


/* ---------- 页脚 ---------- */

.foot {
  padding: 5rem 0 4rem; text-align: center;
  background: var(--bg-warm); border-top: 1px solid var(--line-soft);
}
.foot-mark { margin: 0 0 1.2rem; color: var(--pink); font-size: 12px; letter-spacing: .4em; }
.foot-note { margin: 0 0 1.8rem; font-size: 12px; color: var(--ink-mid); }
.foot-copy { margin: 0; font-size: 10px; letter-spacing: .24em; color: var(--ink-light); }


/* ---------- 滚动淡入 ---------- */

.reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2,.6,.2,1);
}
.reveal.on { opacity: 1; transform: none; }


/* ---------- 响应式 ---------- */

@media (max-width: 900px) { .side-nav { display: none; } }

@media (max-width: 720px) {
  /* .row.wide 是 (0,2,0)，比单独的 .row 特异性高，必须一起点名才压得住 */
  .row, .sec.flip .row,
  .row.wide, .sec.flip .row.wide { grid-template-columns: 1fr; gap: 1.5rem; }
  .sec.flip .row .body,
  .sec.flip .row .art,
  .sec.flip .row .chibi { order: initial; }
  .chibi img { max-height: 260px; }
  .chat { height: 300px; }
  .art .still { max-height: 320px; }
  .sec { padding: 4.5rem 0; }
  .work-head { flex-direction: column; gap: .25rem; }
}

@media (max-width: 480px) {
  body { font-size: 14px; letter-spacing: .06em; }
  .meta { grid-template-columns: 1fr; gap: .1rem 0; }
  .meta dd { margin-bottom: .9rem; }
  .likes li, .link-list li { flex-direction: column; gap: .1rem; }
}


/* ---------- 无障碍 ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .clouds img { animation: none; }
  .stk { transition: none; }
  .scroll-hint::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
