/* 祈愿 · qiyuan.quest
   色彩取自金属与仿真：铝灰底、墨蓝字、淬火蓝强调；应变色只出现在网格与图例里。 */

:root {
  --paper: #E6E8E7;
  --paper-2: #DDE0DF;
  --ink: #1A1F26;
  --graphite: #56606A;
  --rule: #BEC4C6;
  --mesh: 120, 129, 135;           /* 网格线 rgb */
  --accent: #2B4C8C;               /* 淬火蓝 */
  --hot: #B04A2E;                  /* 高应变 */
  --focus: #2B4C8C;
  --overlay: rgba(26, 31, 38, .42);

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

  --gutter: clamp(16px, 4vw, 56px);
  --pad: max(var(--gutter), calc((100% - 1320px) / 2));
  --measure: 34em;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #13171C;
    --paper-2: #1A1F25;
    --ink: #E2E5E4;
    --graphite: #98A1A8;
    --rule: #2E353C;
    --mesh: 92, 104, 116;
    --accent: #7FA0E0;
    --hot: #E07A5A;
    --focus: #7FA0E0;
    --overlay: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #13171C;
  --paper-2: #1A1F25;
  --ink: #E2E5E4;
  --graphite: #98A1A8;
  --rule: #2E353C;
  --mesh: 92, 104, 116;
  --accent: #7FA0E0;
  --hot: #E07A5A;
  --focus: #7FA0E0;
  --overlay: rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }

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

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 6px 12px; text-decoration: none;
}
.skip:focus { left: 8px; }

/* ---------- 顶栏 ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background-color .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.bar.scrolled {
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  border-bottom-color: var(--rule);
}
/* 毛玻璃只给桌面端，手机上滚动时太费 GPU */
@media (hover: hover) and (pointer: fine) {
  .bar.scrolled {
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
.mark {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font-family: var(--serif); font-weight: 900; font-size: 22px; letter-spacing: .12em;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.nav { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav a {
  text-decoration: none; font-size: 15px; color: var(--graphite);
  padding: 4px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color .2s, background-size .3s;
}
.nav a:hover { color: var(--ink); background-size: 100% 1px; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding: 104px var(--pad) clamp(22px, 3.5vh, 36px);
  overflow: hidden;
  isolation: isolate;
}
.mesh {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -1; cursor: crosshair; touch-action: pan-y;
  /* 底部渐隐交给 GPU，一次设置，不用每帧重画 */
  -webkit-mask-image: linear-gradient(#000 68%, transparent);
          mask-image: linear-gradient(#000 68%, transparent);
}
.hero-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-areas: "name copy";
  margin: auto 0;
  column-gap: clamp(24px, 5vw, 96px);
  align-items: end;
  pointer-events: none;
}
.hero-inner > * { pointer-events: auto; }

.hero-name {
  grid-area: name;
  display: flex; flex-direction: column;
  font-family: var(--serif);
  line-height: .9;
  cursor: default;
  user-select: none; -webkit-user-select: none;
  justify-self: start;
}
.hero-name { position: relative; }
.glyph { position: absolute; pointer-events: none; }
.glyph-ready .hero-cjk { color: transparent; }
.hero-cjk {
  font-size: clamp(110px, 22vw, 316px);
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: -.02em;
  margin-left: -.04em;
}
.hero-latin {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 400;
  letter-spacing: .32em;
  color: var(--graphite);
  margin-top: 1.4em;
  padding-left: .15em;
}
.hero-copy { grid-area: copy; max-width: 26em; padding-bottom: 8px; }
.hero-copy p { text-shadow: 0 0 12px var(--paper), 0 0 3px var(--paper); }
.statement {
  font-family: var(--serif);
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.5;
  font-weight: 600;
  text-wrap: balance;
}
.intro { margin-top: 20px; color: var(--graphite); max-width: 24em; }

.hero-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 48px; flex-wrap: wrap;
  margin-top: clamp(32px, 6vh, 64px); padding-top: 18px;
  border-top: 1px solid rgba(var(--mesh), .35);
  position: relative;
}
.now {
  display: grid; grid-template-columns: auto auto; column-gap: 14px; row-gap: 2px;
  align-items: baseline; text-decoration: none; max-width: 52em;
}
.now[hidden] { display: none; }
.now-label {
  font-size: 13px; color: var(--accent); display: inline-flex; align-items: center; gap: 8px;
  grid-row: 1 / span 2;
}
.now-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2.4s ease-in-out infinite; }
.now-title { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.now-text { grid-column: 2; font-size: 14px; color: var(--graphite); text-wrap: pretty; }
.now:hover .now-title { color: var(--accent); }
.legend {
  margin: 0; max-width: 300px; width: 300px;
  font-size: 13px; color: var(--graphite); line-height: 1.5;
}
.legend-bar {
  height: 6px; margin: 10px 0 6px; position: relative;
  background: linear-gradient(90deg, rgba(var(--mesh), .5), var(--accent) 55%, var(--hot));
}
.legend-bar i {
  position: absolute; inset: -4px 0; will-change: transform;
}
.legend-bar i::after {
  content: ""; position: absolute; left: -1px; top: 0; width: 2px; height: 14px; background: var(--ink);
}
.legend-scale { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.legend output { color: var(--ink); }

/* 首屏入场：只有这一处编排动画 */
.hero-latin, .statement, .intro, .hero-foot { opacity: 0; transform: translateY(18px); }
.ready .hero-latin, .ready .statement, .ready .intro, .ready .hero-foot {
  opacity: 1; transform: none;
  transition: opacity 1.1s cubic-bezier(.2,.7,.1,1), transform 1.1s cubic-bezier(.2,.7,.1,1);
}
.ready .hero-latin { transition-delay: 1.5s; }
.ready .statement { transition-delay: 1.65s; }
.ready .intro { transition-delay: 1.8s; }
.ready .hero-foot { transition-delay: 2.2s; }
@media (prefers-reduced-motion: reduce) {
  .hero-latin, .statement, .intro, .hero-foot { opacity: 1; transform: none; transition: none !important; }
}

/* ---------- 通用区块 ---------- */
.section { padding: clamp(88px, 11vw, 152px) var(--pad) 0; scroll-margin-top: 24px; }
.section > h2, .section-head h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: .04em;
}

/* ---------- 项目 ---------- */
.section-head {
  display: flex; flex-wrap: wrap; gap: 16px 32px;
  align-items: baseline; justify-content: space-between;
  padding-bottom: clamp(20px, 2.4vw, 28px);
  border-bottom: 1px solid var(--ink);
}
.filters { display: flex; gap: 6px; }
.filters button {
  background: none; border: 1px solid transparent; border-radius: 999px;
  padding: 4px 14px; cursor: pointer; color: var(--graphite); font-size: 15px;
}
.filters button span { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 2px; }
.filters button:hover { color: var(--ink); }
.filters button[aria-selected="true"] { border-color: var(--ink); color: var(--ink); }

.plist { list-style: none; margin: 0; padding: 0; }
.pitem { border-bottom: 1px solid var(--rule); position: relative; }
/* 可弯曲的分隔线（bend.js 接管后隐藏原边框） */
.section-head, .focus > div { position: relative; }
.bend-on { border-bottom-color: transparent !important; }
.bend {
  position: absolute; left: 0; right: 0; bottom: -36px; width: 100%; height: 72px;
  pointer-events: none; z-index: 1;
}
.prow {
  width: 100%; background: none; border: 0; text-align: left; cursor: pointer;
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr) auto 28px;
  gap: 8px clamp(16px, 3vw, 48px);
  align-items: baseline;
  padding: clamp(24px, 3vw, 36px) 0;
}
.status { font-size: 14px; color: var(--graphite); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; transform: translateY(-1px); }
.status[data-s="进行中"] { color: var(--accent); }
.status[data-s="进行中"]::before { animation: pulse 2.4s ease-in-out infinite; }
.status[data-s="暂停"]::before { background: none; border: 1px solid currentColor; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .status::before { animation: none !important; } }

.ptitle {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.3; font-weight: 600;
  transition: transform .5s cubic-bezier(.2,.7,.1,1);
}
.ptitle, .psum { display: block; }
.psum { color: var(--graphite); margin-top: 10px; max-width: var(--measure); }
.ptags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--graphite); }
.ptags span { border-bottom: 1px solid var(--rule); }
.pperiod { font-size: 14px; color: var(--graphite); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pplus { position: relative; width: 18px; height: 18px; align-self: start; justify-self: end; margin-top: .35em; }
.pplus::before, .pplus::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: var(--ink);
  transition: transform .4s cubic-bezier(.2,.7,.1,1);
}
.pplus::after { transform: rotate(90deg); }
.prow[aria-expanded="true"] .pplus::after { transform: rotate(0); }
@media (hover: hover) { .prow:hover .ptitle { transform: translateX(10px); } }

.pdetail {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .55s cubic-bezier(.2,.7,.1,1);
}
.pdetail.open { grid-template-rows: 1fr; }
.pdetail > div { overflow: hidden; }
.pdetail-inner {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px clamp(16px, 3vw, 48px);
  padding: 0 0 clamp(32px, 4vw, 56px);
}
.pdetail-inner > .meta { font-size: 14px; color: var(--graphite); line-height: 1.6; }
.pbody p + p { margin-top: 1em; }
.pbody { max-width: var(--measure); }
.pside { display: flex; flex-direction: column; gap: 20px; }
.pside img { width: 100%; height: auto; border: 1px solid var(--rule); }
/* 项目配图：工程剖面示意 */
.figs { display: grid; gap: 16px; }
.figs-2 { grid-template-columns: 1fr 1fr; }
.figs:not(.figs-2) .fig { max-width: 400px; }
.fig { margin: 0; }
.fig svg { width: 100%; height: auto; display: block; overflow: visible; }
.fig figcaption { font-size: 12px; color: var(--graphite); margin-top: 6px; }
.f-hatch { stroke: rgba(var(--mesh), .75); stroke-width: 1; }
.f-solid { stroke: var(--ink); stroke-width: 1.1; }
.f-sheet { fill: var(--accent); }
.f-cavity { fill: var(--paper); stroke: var(--ink); stroke-width: 1.1; }
.f-melt { fill: var(--hot); }
.f-cooled { fill: var(--accent); }
.f-parting { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 6 3 1.5 3; }
.f-shear { stroke: var(--hot); stroke-width: 2.4; }
.f-el { stroke: rgba(var(--mesh), .9); stroke-width: .6; }
.f-grid { fill: none; stroke: rgba(var(--mesh), .55); stroke-width: 1; }
.f-ring { fill: none; stroke: var(--accent); stroke-width: 1; }
.f-lead { stroke: var(--graphite); stroke-width: .7; }
.f-label { font-size: 11px; fill: var(--graphite); font-family: var(--sans); }

/* 示意图的时间轴：可拖动 */
.fig > svg { cursor: ew-resize; touch-action: pan-y; }
.figs-2 .f-label { font-size: 15px; }
.scrub { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.scrub-play {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rule);
  background: none; display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: border-color .25s, transform .25s;
}
.scrub-play svg { width: 10px; height: 10px; fill: var(--ink); margin-left: 2px; }
.scrub-play:hover { border-color: var(--accent); transform: scale(1.06); }
.fig.playing .scrub-play svg { fill: var(--accent); }
.scrub-track {
  position: relative; flex: 1; height: 22px; cursor: pointer; touch-action: none;
}
.scrub-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule);
}
.scrub-fill {
  position: absolute; left: 0; top: 50%; height: 1px; width: 100%; margin-top: 0;
  background: linear-gradient(90deg, var(--accent), var(--hot));
  transform-origin: 0 50%; transform: scaleX(var(--t, 1));
}
.scrub-knob {
  position: absolute; top: 50%; left: calc(var(--t, 1) * 100%);
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--ink);
  transition: transform .2s;
}
.scrub-track:hover .scrub-knob, .fig.scrubbing .scrub-knob { transform: scale(1.5); border-color: var(--accent); }
.scrub-stage {
  flex: none; min-width: 5.5em; font-size: 12px; color: var(--accent); text-align: right;
  font-variant-numeric: tabular-nums;
}
.fig figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fig-hint { color: var(--graphite); opacity: 0; transition: opacity .4s; }
.fig:hover .fig-hint { opacity: .8; }
@media (hover: none) { .fig-hint { opacity: .8; } }

/* 展开动画：面板高度展开的同时，内容依次浮现 */
.pdetail-inner > * {
  opacity: 0; transform: translateY(14px);
  transition: opacity .35s ease, transform .35s ease;
}
.pdetail.open .pdetail-inner > * {
  opacity: 1; transform: none;
  transition: opacity .6s cubic-bezier(.2,.7,.1,1), transform .7s cubic-bezier(.2,.7,.1,1);
}
.pdetail.open .pdetail-inner > :nth-child(1) { transition-delay: .08s; }
.pdetail.open .pdetail-inner > :nth-child(2) { transition-delay: .16s; }
.pdetail.open .pdetail-inner > :nth-child(3) { transition-delay: .26s; }
.pitem.is-open .ptitle { color: var(--accent); }
.pitem.is-open .prow:hover .ptitle { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .pdetail, .pdetail-inner > * { transition: none !important; }
}

/* 筛选的滑动选中框 */
.filters { position: relative; }
.filters button { position: relative; z-index: 1; }
.filters button[aria-selected="true"] { border-color: transparent; }
.filter-ind {
  position: absolute; left: 0; top: 0; bottom: 0; border: 1px solid var(--ink); border-radius: 999px;
  transition: transform .45s cubic-bezier(.3,1.4,.5,1), width .45s cubic-bezier(.3,1.4,.5,1);
  pointer-events: none;
}

/* 阅读进度：沿用应变云图的配色 */
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, rgba(var(--mesh), .6), var(--accent) 60%, var(--hot));
  transform: scaleX(0); transform-origin: 0 50%; opacity: 0; transition: opacity .3s;
}
.bar.scrolled .progress { opacity: 1; }
.pprogress { border-left: 2px solid var(--accent); padding-left: 16px; }
.pprogress h3 { font-size: 14px; color: var(--accent); font-weight: 500; margin-bottom: 4px; }
.plinks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.plinks a { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.empty { padding: 48px 0; color: var(--graphite); }

/* 悬停跟随的封面图 */
.cursor-img {
  position: fixed; left: 0; top: 0; z-index: 15; pointer-events: none;
  width: 300px; aspect-ratio: 4 / 3; overflow: hidden;
  opacity: 0; transform: translate3d(-50%, -50%, 0) scale(.9);
  transition: opacity .25s, transform .35s cubic-bezier(.2,.7,.1,1);
}
.cursor-img.show { opacity: 1; }
.cursor-img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 关于 ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 112px); padding-top: clamp(28px, 3.5vw, 48px);
}
.about-text { font-family: var(--serif); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.95; max-width: 30em; }
.about-text p + p { margin-top: 1.2em; }
.focus { margin: 0; }
.focus div { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--rule); }
.focus div:last-child { border-bottom: 0; margin-bottom: 0; }
.focus dt { font-weight: 700; font-size: 17px; }
.focus dd { margin: 4px 0 0; color: var(--graphite); font-size: 15px; }

/* ---------- 联系 ---------- */
.contact { padding-bottom: clamp(40px, 6vw, 88px); }
.contact-lead {
  font-family: var(--serif); font-size: clamp(22px, 2.6vw, 34px); line-height: 1.55; font-weight: 600;
  max-width: 24em; padding-top: clamp(28px, 3.5vw, 48px); word-break: keep-all;
}
.contact-body { margin-top: clamp(20px, 3vw, 36px); }
.contact-mail {
  font-family: var(--serif); font-size: clamp(26px, 5vw, 64px); font-weight: 600;
  text-decoration: none; word-break: break-all;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat;
  padding-bottom: 4px; transition: color .25s;
}
.contact-mail:hover { color: var(--accent); }
.contact-note { color: var(--graphite); max-width: var(--measure); }
.contact-links { display: flex; gap: 24px; margin-top: 20px; }

.foot-band {
  position: relative; height: clamp(150px, 18vw, 240px);
  display: grid; place-items: center; overflow: hidden; isolation: isolate;
}
.foot-mesh {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  cursor: crosshair; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 70%, transparent);
          mask-image: linear-gradient(transparent, #000 35%, #000 70%, transparent);
}
.foot-hint {
  font-size: 13px; color: var(--graphite); pointer-events: none;
  background: var(--paper); padding: 2px 10px;
}
.foot-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 28px var(--pad); border-top: 1px solid var(--rule);
  font-size: 13px; color: var(--graphite);
}

/* ---------- 按钮与表单（登录、后台共用） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  padding: 9px 20px; border-radius: 4px; cursor: pointer; font-size: 15px; line-height: 1.4;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.ghost { background: none; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--ink); background: none; }
.btn.danger { background: none; color: var(--hot); border-color: currentColor; }
.btn.small { padding: 4px 10px; font-size: 13px; }

label { display: block; font-size: 14px; color: var(--graphite); }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 4px;
  padding: 9px 12px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }

.login {
  border: 1px solid var(--rule); border-radius: 8px; padding: 0;
  background: var(--paper); color: var(--ink);
  width: min(380px, calc(100vw - 32px));
}
.login::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
.login form { padding: 28px; display: grid; gap: 16px; }
.login h2 { font-family: var(--serif); font-size: 22px; }
.login[open] { animation: rise .35s cubic-bezier(.2,.7,.1,1); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.form-msg { color: var(--hot); font-size: 14px; min-height: 1.4em; }
.row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .figs-2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-inner { grid-template-columns: 1fr; grid-template-areas: "name" "copy"; row-gap: 28px; }
  .prow { grid-template-columns: minmax(0, 1fr) 24px; }
  .prow .status { grid-column: 1; grid-row: 1; }
  .prow .pmain { grid-column: 1; grid-row: 2; }
  .prow .pperiod { grid-column: 1; grid-row: 3; }
  .prow .pplus { grid-column: 2; grid-row: 1 / span 3; }
  .pdetail-inner { grid-template-columns: 1fr; }
  .pdetail-inner > .meta { display: none; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .figs-2 { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero { padding-top: 96px; }
  .hero-cjk { font-size: 40vw; }
  .hero-latin { font-size: 15px; }
  .statement { font-size: 21px; }
  .intro { font-size: 15px; margin-top: 14px; }
  .prow { padding: 22px 0; }
  .filters button { padding: 4px 10px; }
  .nav { gap: 16px; }
  .legend { display: none; }
}

/* ---------- 管理后台 ---------- */
.admin {
  position: fixed; inset: 0; z-index: 40;
  background: var(--paper); color: var(--ink);
  display: grid; grid-template-rows: auto 1fr auto;
  animation: rise .35s cubic-bezier(.2,.7,.1,1);
}
.admin[hidden] { display: none; }
.adm-top {
  display: flex; align-items: center; gap: 16px 28px; flex-wrap: wrap;
  padding: 14px var(--gutter); border-bottom: 1px solid var(--rule);
}
.adm-title { font-family: var(--serif); font-size: 18px; }
.adm-tabs { display: flex; gap: 4px; }
.adm-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 4px 10px; cursor: pointer; color: var(--graphite); }
.adm-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.adm-actions { margin-left: auto; display: flex; gap: 8px; }
.adm-main { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 0; }
.adm-main:has(.adm-wide) { grid-template-columns: 1fr; }
.adm-list { border-right: 1px solid var(--rule); padding: 20px; overflow: auto; }
.adm-list .adm-new { width: 100%; }
.adm-list ol { list-style: none; margin: 16px 0 0; padding: 0; }
.adm-list li { display: flex; align-items: stretch; border-radius: 4px; }
.adm-list li.sel { background: var(--paper-2); box-shadow: inset 2px 0 0 var(--accent); }
.adm-pick { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 10px 12px; cursor: pointer; }
.adm-pick-title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-pick-meta { display: block; font-size: 13px; color: var(--graphite); }
.adm-order { display: flex; flex-direction: column; justify-content: center; }
.adm-order button { background: none; border: 0; cursor: pointer; color: var(--graphite); padding: 0 8px; line-height: 1.3; }
.adm-order button:hover:not(:disabled) { color: var(--ink); }
.adm-order button:disabled { opacity: .25; cursor: default; }
.adm-edit { overflow: auto; padding: 28px var(--gutter) 48px; }
.adm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; max-width: 860px; }
.adm-form .full { grid-column: 1 / -1; }
.adm-label { font-size: 14px; color: var(--graphite); }
.adm-cover-row { display: flex; gap: 16px; align-items: flex-start; margin-top: 6px; flex-wrap: wrap; }
.adm-cover-row img, .adm-cover-empty { width: 200px; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule); border-radius: 4px; }
.adm-cover-empty { display: grid; place-items: center; color: var(--graphite); font-size: 14px; border-style: dashed; }
.adm-cover-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 340px; }
.adm-file { color: var(--ink); }
.adm-hint { font-size: 13px; color: var(--graphite); }
.adm-list .adm-hint { margin-top: 16px; }
.adm-check { display: flex; align-items: center; gap: 8px; color: var(--ink); grid-column: 1 / -1; }
.adm-check input { width: auto; margin: 0; }
.adm-danger { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--rule); }
.adm-save {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 12px var(--gutter); border-top: 1px solid var(--rule); background: var(--paper-2);
}
.adm-save-msg { font-size: 14px; color: var(--graphite); }
.adm-save.on .adm-save-msg { color: var(--accent); }
.adm-save.warn .adm-save-msg { color: var(--hot); }
@media (max-width: 760px) {
  .adm-main { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow: auto; }
  .adm-list { border-right: 0; border-bottom: 1px solid var(--rule); max-height: 40vh; }
  .adm-edit { overflow: visible; }
  .adm-form { grid-template-columns: 1fr; }
  .adm-actions { margin-left: 0; }
}

/* ---------- 质感层 ---------- */
html.is-wheeling { scroll-behavior: auto; }

/* 极淡的颗粒纹理，让屏幕有材质感 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none;
  opacity: .045;
  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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { opacity: .07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { opacity: .07; } }

/* 波动：柔光与涟漪都在内容后面，没有硬边 */
.glow {
  position: fixed; left: 0; top: 0; z-index: -1; pointer-events: none;
  width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 6%, transparent) 45%, transparent);
  opacity: 0; transition: opacity .8s ease;
  will-change: transform;
}
.glow.on { opacity: 1; }
.ripple {
  position: fixed; z-index: -1; pointer-events: none;
  width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(closest-side, transparent 52%, color-mix(in srgb, var(--accent) 20%, transparent) 70%, transparent 100%);
  filter: blur(6px);
  animation: ripple 1.6s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes ripple {
  from { transform: scale(.08); opacity: .9; }
  to { transform: scale(1); opacity: 0; }
}

/* 区块入场：标题从遮罩里升起，线条从左往右画出 */
.mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.mask-in { display: inline-block; }
.reveal-ready .section-head:not(.in) .mask-in { transform: translateY(105%); }
.reveal-ready .section-head .mask-in { transition: transform 1.1s cubic-bezier(.16,1,.3,1); }
.reveal-ready .section-head .bend,
.reveal-ready .plist .bend,
.reveal-ready .focus .bend { transition: clip-path 1.4s cubic-bezier(.65,0,.35,1); clip-path: inset(0 0 0 0); }
.reveal-ready .section-head:not(.in) .bend { clip-path: inset(0 100% 0 0); }
.reveal-ready .section-head.in .bend { transition-delay: .15s; }
.reveal-ready .plist:not(.in) .bend { clip-path: inset(0 100% 0 0); }
.reveal-ready .plist .bend { transition-delay: calc(var(--i, 0) * .12s + .2s); }
.reveal-ready .focus:not(.in) .bend { clip-path: inset(0 100% 0 0); }
.reveal-ready .plist:not(.in) .prow > * { opacity: 0; transform: translateY(16px); }
.reveal-ready .plist .prow > * { transition: opacity .9s ease, transform 1s cubic-bezier(.16,1,.3,1); }
.reveal-ready .plist.in .prow > * { transition-delay: calc(var(--i, 0) * .12s + .1s); }
.reveal-ready .plist.in .pitem.ready .prow > * { transition-delay: 0s; }
.reveal-ready .contact-lead:not(.in) { opacity: 0; transform: translateY(20px); }
.reveal-ready .contact-lead { transition: opacity 1s ease, transform 1.1s cubic-bezier(.16,1,.3,1); }
.reveal-ready .focus:not(.in) > div { opacity: 0; transform: translateY(14px); }
.reveal-ready .focus > div { transition: opacity .9s ease, transform 1s cubic-bezier(.16,1,.3,1); }
.reveal-ready .focus.in > div:nth-child(2) { transition-delay: .1s; }
.reveal-ready .focus.in > div:nth-child(3) { transition-delay: .2s; }
.reveal-ready .focus.in > div:nth-child(4) { transition-delay: .3s; }

/* 「关于」逐字点亮 */
.about-text.lit-ready .ch { color: color-mix(in srgb, var(--ink) 22%, var(--paper)); transition: color .5s ease; }
.about-text.lit-ready .ch.on { color: var(--ink); }

/* 项目列表：聚焦当前，其余退后 */
@media (hover: hover) and (pointer: fine) {
  .pitem { transition: opacity .45s ease; }
  .plist:hover .pitem:not(:hover):not(.is-open) { opacity: .38; }
}
