/* ============ 山房 · 开门见山 · 夜色版 ============ */

:root {
  --bg: #0a0a0a;
  --ink: #e9e9e9;
  --grey: #9a9a9a;
  --dim: #676767;
  --faint: #1c1c1c;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #d8d8d8;
  --accent-bright: #f5f5f5;
  --serif: 'Songti SC', 'STSong', 'Noto Serif SC', 'SimSun', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
::selection { background: var(--accent); color: #0a0a0a; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* WP admin bar offset (front-end) */
body.admin-bar { padding-top: 32px; }
@media (max-width: 782px) { body.admin-bar { padding-top: 46px; } }

/* ===== 汉堡 ===== */
.burger {
  position: fixed; top: 10px; right: 10px; z-index: 130;
  width: 46px; height: 46px; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.burger span {
  display: block; width: 20px; height: 1.5px; background: var(--ink);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s, background 0.3s;
}
body.menu-open .burger span { background: #f5f5f5; }
.burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== 全屏菜单 =====
   布局对齐首页底部 .enter：居中 580px 列（移动端 26px 边距）。
   入场用 animation-delay（而不是 transition-delay），避免悬停交互被延迟拖累。 */
.menu {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(8, 8, 8, 0.97);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 0 26px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s;
}
.menu.open { opacity: 1; visibility: visible; }
.menu .menu-list { display: flex; flex-direction: column; list-style: none; padding: 0; margin: 0; width: 100%; max-width: 580px; }
.menu a {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.7rem, 7.5vw, 2.8rem); letter-spacing: 0.15em;
  color: #7d7d78; text-decoration: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 4px; border-bottom: 1px solid var(--line);
  transition: color 0.35s, padding-left 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.menu .menu-list li:first-child a { border-top: 1px solid var(--line); }
.menu.open a { animation: sfMenuIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.menu.open .menu-list li:nth-child(1) a { animation-delay: 0.05s; }
.menu.open .menu-list li:nth-child(2) a { animation-delay: 0.11s; }
.menu.open .menu-list li:nth-child(3) a { animation-delay: 0.17s; }
.menu.open .menu-list li:nth-child(4) a { animation-delay: 0.23s; }
.menu.open .menu-list li:nth-child(5) a { animation-delay: 0.29s; }
@keyframes sfMenuIn { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu a:hover, .menu a.active { color: var(--accent-bright); padding-left: 16px; }
.menu .zh { display: flex; align-items: baseline; gap: 14px; }
.menu a i { font-style: normal; font-family: var(--sans); font-size: 10px; letter-spacing: 0.3em; color: var(--dim); font-weight: 400; }
.menu a::after { content: '→'; font-family: var(--sans); font-size: 0.85em; font-weight: 400; color: #f5f5f5; opacity: 0; transform: translateX(-10px); transition: 0.4s; }
.menu a:hover::after, .menu a:active::after { opacity: 1; transform: none; }

/* ===== 门 ===== */
.book { height: 200vh; position: relative; z-index: 1; }
.book-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; perspective: 1800px; overflow: hidden; }
.cover {
  position: absolute; inset: 0; z-index: 100; --w: 0; perspective: 1600px; pointer-events: none;
  opacity: clamp(0, calc((1 - var(--w)) * 4), 1);
}
.shutter {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background: #ffffff;
  backface-visibility: hidden;
  will-change: transform;
}
.seam {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; margin-left: -1px;
  background: linear-gradient(to bottom, transparent 0%, var(--accent) 18%, var(--accent) 82%, transparent 100%);
  opacity: calc(1 - var(--w) * 10);
  pointer-events: none;
}
.s-l { left: 0;  transform-origin: left  center; transform: rotateY(calc(var(--w) *  95deg)); }
.s-r { right: 0; transform-origin: right center; transform: rotateY(calc(var(--w) * -95deg)); }
.cover-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  text-align: center;
  opacity: calc(1 - var(--w) * 2.6);
  pointer-events: none;
}
.cover-kicker { font-size: 10px; letter-spacing: 0.6em; text-indent: 0.3em; color: #6e6e6e; }
.cover-title  { font-family: var(--serif); font-size: clamp(1.9rem, 8vw, 3.2rem); font-weight: 600; color: #2a2a2a; }

.mtn { width: min(72vw, 340px); margin-top: 4px; }
.mtn path { fill: none; stroke: #6e6e6e; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.mtn .snowgrp path { fill: #d8d8d8; stroke: none; }
.snowgrp > g { display: none; }
html[data-snow="winter"] .snow-w { display: block; }
html[data-snow="spring"] .snow-s { display: block; }
html[data-snow="autumn"] .snow-a { display: block; }

.hl { color: var(--accent); }

/* ===== 换季按钮 ===== */
.bloom {
  position: fixed; right: 18px; bottom: 20px; z-index: 115;
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16); background: #161412;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--accent);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s, box-shadow 0.25s;
  animation: breathe 3.6s ease-in-out infinite;
}
.bloom:hover  { transform: scale(1.1);  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6); }
.bloom:active { transform: scale(0.92); }
.bloom:hover .ic { transform: scale(1.18) rotate(-6deg); }
.bloom .ic { width: 26px; height: 26px; transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); display: none; }
.bloom[data-si="0"] .ic-0,
.bloom[data-si="1"] .ic-1,
.bloom[data-si="2"] .ic-2,
.bloom[data-si="3"] .ic-3 { display: block; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.bloom-ripple { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: rip 0.7s ease-out forwards; pointer-events: none; }
@keyframes rip { from { transform: scale(1);   opacity: 0.8; } to { transform: scale(2.1); opacity: 0; } }
.bloom-toast {
  position: fixed; right: 18px; bottom: 86px; z-index: 115;
  font-size: 11px; letter-spacing: 0.3em; color: var(--grey);
  background: #161412; border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 15px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  white-space: nowrap; opacity: 0; transform: translateY(6px);
  transition: opacity 0.4s, transform 0.4s; pointer-events: none;
}
.bloom-toast.show { opacity: 1; transform: none; }

/* ===== 回山房键（内页左上） ===== */
/* ===== 粒子 / 场景 ===== */
#dust { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.scene { min-height: 100vh; min-height: 100svh; position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 26px; }
.rise { opacity: 0; will-change: transform, opacity; }
.scene-left { align-items: flex-start; text-align: left; padding-left: 9vw; }
@media (min-width: 768px) {
  .scene-left { padding-left: 18vw; padding-right: 18vw; max-width: 1200px; margin: 0 auto; align-items: center; text-align: left; }
  .scene-left .stat { min-width: 360px; }
}
.scene-compact { min-height: auto; padding: 14vh 26px 0; }
.scene-end     { min-height: auto; padding: 44px 26px 70px; }

.hero-core { will-change: transform, opacity; }
.hero-kicker { font-size: 10px; color: var(--accent); animation: boot 1.4s 0.2s ease both; }
.hero-line   { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 6vw, 2.5rem); letter-spacing: 0.18em; text-indent: 0.09em; line-height: 2; margin: 26px 0 8px; animation: boot 1.6s 0.55s ease both; }
.hero-line .accent { color: var(--accent); }
.hero-en     { font-size: 11px; letter-spacing: 0.35em; text-indent: 0.175em; color: var(--dim); animation: boot 1.6s 0.9s ease both; }
@keyframes boot { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.stat { display: flex; align-items: baseline; justify-content: flex-start; gap: 16px; margin: 10px 0; }
.stat .num { font-family: var(--serif); font-weight: 700; font-size: clamp(2.1rem, 9vw, 3.6rem); letter-spacing: 0.04em; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 0; text-align: left; }
.stat em { font-style: normal; font-size: 0.8rem; letter-spacing: 0.2em; color: var(--grey); }

.scene-note { margin-top: 34px; font-size: 0.82rem; color: var(--grey); letter-spacing: 0.12em; line-height: 2; }

.creed { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 6.5vw, 2.6rem); letter-spacing: 0.22em; line-height: 2; }

.enter { display: flex; flex-direction: column; width: 100%; max-width: 580px; }
.enter a { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 7.5vw, 2.8rem); letter-spacing: 0.15em; color: #7d7d78; display: flex; justify-content: space-between; align-items: center; padding: 22px 4px; border-bottom: 1px solid var(--line); transition: color 0.35s, padding-left 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.enter a:first-child { border-top: 1px solid var(--line); }
.enter a::after { content: '→'; font-family: var(--sans); color: var(--accent); opacity: 0; transform: translateX(-10px); transition: 0.4s; }
.enter a:hover, .enter a:active { color: var(--accent); padding-left: 16px; }
.enter a:hover::after, .enter a:active::after { opacity: 1; transform: none; }
.enter .zh { display: flex; align-items: baseline; gap: 14px; }
.enter a small { font-family: var(--sans); font-size: 10px; letter-spacing: 0.3em; color: var(--dim); font-weight: 400; }

.end-note { font-size: 10px; letter-spacing: 0.3em; color: var(--dim); line-height: 2.6; text-align: center; width: 100%; display: block; }

/* ===== 内页（文章/列表/页）=====
   注意：类名用 sf-page 而不是 page —— WP 会给 body 输出 "page" class，
   .page 会命中 body，把整站限宽 720px 并让 fixed 失效（2026-10-12 踩坑）。 */
.sf-page { max-width: 720px; margin: 0 auto; padding: 90px 22px 80px; position: relative; z-index: 1; animation: pageIn 0.5s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-head { border-bottom: 1px solid var(--line); padding-bottom: 30px; margin-bottom: 42px; }
.page-title { font-family: var(--serif); font-size: clamp(1.7rem, 5.5vw, 2.4rem); font-weight: 600; letter-spacing: 0.25em; color: var(--ink); margin-bottom: 10px; }
.page-sub { font-size: 0.72rem; color: var(--dim); letter-spacing: 0.2em; }

/* ===== 子页快捷导航（文/影/画 互跳 + 门）=====
   当前页大字最左，另两类目灰色快捷字，门靠最右。
   悬停：字变主题亮色，字下一条细线从中间向两边展开（同站内 0.35s 手感）。 */
.qn-row { display: flex; align-items: baseline; gap: 34px; margin-bottom: 12px; }
.qn-row .page-title { margin-bottom: 0; }
.qn-char {
  position: relative; font-family: var(--serif); font-size: 1.02rem;
  color: var(--grey); padding-bottom: 9px; transition: color 0.35s;
}
.qn-char::after {
  content: ''; position: absolute; left: 50%; bottom: 0;
  width: 0; height: 1px; background: var(--accent);
  transform: translateX(-50%); transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.qn-char:hover, .qn-char:active { color: var(--accent-bright); }
.qn-char:hover::after, .qn-char:active::after { width: 100%; }
.qn-door { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; }
.qn-back-ic { width: 13px; height: 13px; opacity: 0.75; flex: none; }
@media (max-width: 600px) { .qn-row { gap: 24px; } }

.row { display: block; padding: 30px 0 26px; border-bottom: 1px solid var(--line); transition: padding-left 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.row:hover { padding-left: 12px; }
.row .meta { font-size: 10px; letter-spacing: 0.22em; color: var(--dim); margin-bottom: 10px; }
.row h3 { font-family: var(--serif); font-size: 1.28rem; font-weight: 600; letter-spacing: 0.06em; display: flex; justify-content: space-between; align-items: center; gap: 10px; transition: color 0.3s; }
.row:hover h3, .row:active h3 { color: var(--accent); }
.row h3::after { content: '→'; font-family: var(--sans); font-size: 0.85rem; font-weight: 400; color: var(--accent); opacity: 0; transform: translateX(-8px); transition: 0.35s; }
.row:hover h3::after { opacity: 1; transform: none; }
.row p { color: var(--grey); font-size: 0.82rem; line-height: 1.85; margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.back { display: inline-block; margin-bottom: 26px; color: var(--dim); font-size: 0.75rem; letter-spacing: 0.2em; }
.back:hover { color: var(--accent); }

.article-head .meta { font-size: 10px; letter-spacing: 0.25em; color: var(--dim); }
.article-head h1 { font-family: var(--serif); font-size: clamp(1.5rem, 6vw, 2.1rem); font-weight: 700; letter-spacing: 0.05em; line-height: 1.65; margin: 16px 0 12px; }
.article-head .tags { margin-bottom: 10px; }
.article-head .tags span,
.article-head .tags a { display: inline-block; font-size: 10px; letter-spacing: 0.15em; color: var(--grey); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; margin-right: 6px; text-decoration: none; }
.article-head hr { border: none; height: 1px; background: var(--line); margin: 26px 0 8px; }

.article h2 { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; letter-spacing: 0.08em; margin: 2.6em 0 0.9em; line-height: 1.6; }
.article p  { font-family: var(--serif); font-size: 0.92rem; line-height: 1.75; margin-bottom: 0.9em; color: #c9c9c9; letter-spacing: 0.02em; }
.article strong { color: var(--ink); font-weight: 600; }
.article blockquote { margin: 1.6em 0; padding: 4px 0 4px 18px; border-left: 1px solid var(--accent); color: var(--ink); font-family: var(--sans); line-height: 1.85; font-size: 0.92rem; }
.article blockquote p { margin-bottom: 0.6em; color: inherit; font-size: 0.92rem; font-family: var(--sans); line-height: 1.85; }
.article blockquote p:last-child { margin-bottom: 0; }
.article ul, .article ol { margin: 0.9em 0 0.9em 1.6em; color: #c9c9c9; }
.article li { margin-bottom: 0.4em; line-height: 1.75; }
.article pre, .article code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.article pre { background: var(--faint); border: 1px solid var(--line); padding: 1em 1.2em; overflow-x: auto; margin: 1.6em 0; border-radius: 4px; }
.article code { background: var(--faint); padding: 1px 6px; border-radius: 3px; }
.article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(216,216,216,0.4); }
.article a:hover { text-decoration-color: var(--accent); }
.article hr { border: none; height: 1px; background: var(--line); margin: 2.4em 0; }
.article hr + p { font-size: 0.75rem; color: var(--dim); letter-spacing: 0.04em; line-height: 1.8; }
.article .src-note { margin-top: 2.4em; font-size: 0.7rem; color: var(--dim); letter-spacing: 0.1em; border-top: 1px solid var(--line); padding-top: 18px; line-height: 2; }

.v-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.v-card-p { display: block; }
.v-poster { position: relative; aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255,255,255,0.05), transparent 70%), linear-gradient(165deg, #1a1a1a 0%, #141414 55%, #0e0e0e 100%); transition: border-color 0.3s; }
.v-card-p:hover .v-poster { border-color: var(--accent); }
.v-poster .play { width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink); padding-left: 3px; transition: transform 0.3s, border-color 0.3s; }
.v-card-p:hover .play { transform: scale(1.12); border-color: var(--accent); }
.v-poster .pf { position: absolute; top: 10px; left: 10px; font-size: 9px; letter-spacing: 0.18em; color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 3px; padding: 3px 7px; background: rgba(20, 18, 16, 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.v-info-p { padding: 12px 2px 0; }
.v-info-p .meta { font-size: 10px; letter-spacing: 0.22em; color: var(--dim); }
.v-info-p h3   { font-family: var(--serif); font-size: 0.98rem; letter-spacing: 0.06em; margin: 7px 0 4px; }
.v-info-p p    { font-size: 0.75rem; color: var(--grey); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v-space-link { display: inline-block; margin-top: 22px; font-size: 0.72rem; letter-spacing: 0.2em; color: var(--grey); border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; transition: color 0.3s, border-color 0.3s; }
.v-space-link:hover { color: var(--ink); border-color: var(--accent); }

.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ph-frame { aspect-ratio: 4 / 5; border: 1px solid var(--faint); display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 10px; letter-spacing: 0.35em; text-indent: 0.35em; }
.ph-note { margin-top: 22px; font-size: 0.75rem; color: var(--dim); border-left: 1px solid var(--grey); padding-left: 14px; line-height: 2; letter-spacing: 0.05em; }

.about-block { margin-bottom: 48px; }
.about-block h2 { font-family: var(--serif); font-size: 1rem; font-weight: 600; letter-spacing: 0.35em; color: var(--grey); margin-bottom: 16px; }
.about-block p { color: #c9c9c9; line-height: 1.95; margin-bottom: 1.1em; }
.about-block .big { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); line-height: 2; letter-spacing: 0.08em; }

.site-footer { margin-top: 80px; margin-bottom: 70px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 10px; color: var(--dim); letter-spacing: 0.2em; line-height: 2.4; text-align: center; }

/* ===== 响应式 ===== */
@media (min-width: 768px) {
  body { font-size: 16px; }
  .sf-page { padding: 110px 32px 90px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .v-grid       { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .burger       { top: 14px; right: 16px; }
}

/* ===== 减弱动效 ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .rise { opacity: 1 !important; transform: none !important; }
  .cover { display: none; }
  .book { height: auto; }
}
