/* ============================================================
   藏 卷 · 门 户
   ------------------------------------------------------------
   一张深色的纸。纸上有三行字，和三个不怎么轻的东西。
   ============================================================ */

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

[hidden] { display: none !important; }

:root {
  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC",
           "SimSun", "Songti TC", "Times New Roman", serif;
  --mono: "SF Mono", "Consolas", "Menlo", monospace;

  --paper:   #d5cab4;
  --paper-2: #b8ac94;
  --mute:    #9a8f7c;
  --faint:   #6d6454;
  --dim:     #3e3830;

  --hair:    rgba(214, 202, 178, .13);
  --hair-2:  rgba(214, 202, 178, .07);

  --gold:    #b39a6e;
  --seal:    #a83a28;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: #040508;
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 底：墨与纸 ---------- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 92% 54% at 50% -10%, rgba(104, 114, 132, .17), transparent 64%),
    radial-gradient(ellipse 52% 44% at 88% 20%, rgba(154, 124, 74, .06), transparent 70%),
    radial-gradient(ellipse 70% 58% at 6% 94%, rgba(74, 88, 100, .11), transparent 66%),
    linear-gradient(180deg, #06070c 0%, #040508 38%, #05060a 100%);
}

/* 极细的纸纹，压在墨上 */
body::after {
  content: "";
  position: fixed; inset: -60%; z-index: 0; pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  mix-blend-mode: overlay;
}

.page {
  position: relative; z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 44px 72px;
}

/* ---------- 卷首 ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 30px;
  padding: 74px 0 38px;
  border-bottom: 1px solid var(--hair);
}

.seal {
  flex: 0 0 auto;
  width: 50px; height: 50px;
  margin-top: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; line-height: 1; font-weight: 700;
  color: var(--seal);
  border: 2px solid var(--seal);
  border-radius: 2px;
  opacity: .72;
  transform: rotate(-5deg);
  letter-spacing: 0;
  user-select: none;
}

.hero-main { flex: 1 1 auto; min-width: 0; }

.title {
  margin: 0;
  font-size: 54px;
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: .46em;
  text-indent: .46em;
  color: #e4dac5;
}

.latin {
  margin: 15px 0 0;
  font-family: var(--serif);
  font-size: 9.5px;
  letter-spacing: .40em;
  color: var(--faint);
  text-transform: uppercase;
}

.lede {
  margin: 26px 0 0;
  max-width: 30em;
  font-size: 13.5px;
  line-height: 2.2;
  letter-spacing: .05em;
  color: #a1977f;
}

.hero-side {
  position: absolute;
  right: 0; top: 88px;
  writing-mode: vertical-rl;
  font-size: 10.5px;
  letter-spacing: .52em;
  color: rgba(168, 58, 40, .48);
  user-select: none;
}

/* ---------- 筛 ---------- */
.filters {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 26px 0 2px;
}

.f {
  position: relative;
  margin: 0 34px 0 0;
  padding: 6px 0;
  border: 0; background: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .26em;
  color: #7b7161;
  transition: color .35s;
}
.f i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0;
  color: #4a4337;
  margin-left: 7px;
  vertical-align: 2px;
  transition: color .35s;
}
.f:hover { color: #b6a992; }
.f.on { color: #e6dcc8; }
.f.on i { color: var(--gold); }
.f::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--seal);
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}
.f.on::after { width: 100%; }

/* ---------- 面包屑 ---------- */
.crumb {
  display: flex; align-items: baseline; gap: 12px;
  padding: 20px 0 4px;
  font-size: 11px; letter-spacing: .22em;
  color: var(--faint);
}
.crumb a {
  color: var(--faint);
  text-decoration: none;
  border-bottom: 1px solid rgba(91, 83, 70, .4);
  padding-bottom: 2px;
  transition: color .3s, border-color .3s;
}
.crumb a:hover { color: var(--gold); border-color: var(--gold); }
.crumb span { opacity: .45; }
.crumb b { font-weight: 400; color: var(--paper-2); letter-spacing: .16em; }

/* ---------- 卷 ---------- */
.rolls { padding-top: 6px; }

.roll {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  padding: 34px 0 38px;
  border-bottom: 1px solid var(--hair);
  transition: opacity .3s ease, transform .3s ease;
}
.roll.swap { opacity: 0; transform: translateY(10px); }

/* 悬停时纸上洇开一小片 */
.roll::before {
  content: "";
  position: absolute; inset: -1px -34px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(460px 240px at var(--mx, 50%) var(--my, 50%),
              rgba(168, 148, 106, .11), transparent 72%);
  transition: opacity .55s ease;
}
.roll:hover::before { opacity: 1; }
.roll > * { position: relative; z-index: 1; }

.roll-no {
  font-size: 12px;
  letter-spacing: .3em;
  color: #6d6353;
  padding-top: 12px;
  user-select: none;
  transition: color .4s;
}
.roll:hover .roll-no { color: var(--gold); }

.roll-body { min-width: 0; }

.roll h2 {
  margin: 0;
  font-size: 29px;
  font-weight: 400;
  letter-spacing: .16em;
  line-height: 1.3;
  color: #e8dfcd;
  transition: color .35s;
}
.roll h2 .sub {
  font-size: 15px;
  letter-spacing: .3em;
  color: #7d7160;
  margin-left: 10px;
  white-space: nowrap;
}
.roll:hover h2 { color: #f6ecd8; }

.roll .latin { margin-top: 11px; }

.hook {
  margin: 24px 0 0;
  font-size: 15px;
  letter-spacing: .09em;
  line-height: 1.9;
  color: var(--gold);
}

.brief {
  margin: 14px 0 0;
  max-width: 34em;
  font-size: 13px;
  line-height: 2.2;
  letter-spacing: .04em;
  color: #9b9180;
}

.tags {
  display: flex; flex-wrap: wrap;
  margin: 20px 0 0; padding: 0;
  list-style: none;
}
.tags li {
  font-size: 10.5px;
  letter-spacing: .2em;
  color: #7b7161;
}
.tags li + li::before {
  content: "·";
  margin: 0 11px;
  color: #3d372e;
}

.warnline {
  display: flex; align-items: baseline; gap: 10px;
  margin: 18px 0 0;
  font-size: 11.5px;
  line-height: 1.85;
  letter-spacing: .04em;
  color: #a37e60;
}
.warnline b {
  flex: 0 0 auto;
  font-weight: 400;
  font-size: 9.5px;
  letter-spacing: .06em;
  color: #c26a50;
  border: 1px solid rgba(168, 58, 40, .46);
  padding: 1px 5px 0;
  line-height: 1.5;
}

/* ---------- 动作 ---------- */
.acts {
  display: flex; align-items: center;
  gap: 26px;
  margin-top: 30px;
}

.enter {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 11px 20px 11px 26px;
  font-size: 12px;
  letter-spacing: .34em;
  text-indent: .34em;
  color: #e0d6c1;
  text-decoration: none;
  border: 1px solid rgba(214, 202, 178, .24);
  background: linear-gradient(180deg, rgba(214, 202, 178, .05), rgba(214, 202, 178, 0));
  transition: color .35s, border-color .35s, background .35s;
}
.enter::after {
  content: "";
  width: 20px; height: 1px;
  background: currentColor;
  opacity: .45;
  transition: width .4s cubic-bezier(.2, .8, .2, 1), opacity .35s;
}
.enter:hover {
  color: #f6ecd8;
  border-color: rgba(168, 58, 40, .62);
  background: rgba(168, 58, 40, .12);
}
.enter:hover::after { width: 34px; opacity: .8; }

.expand {
  padding: 8px 2px;
  border: 0; background: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .26em;
  color: #6b6153;
  border-bottom: 1px solid rgba(107, 97, 83, .3);
  transition: color .3s, border-color .3s;
}
.expand:hover { color: var(--gold); border-color: rgba(179, 154, 110, .5); }

/* ---------- 展 开（单卷） ---------- */
.more { display: none; }

.solo {
  grid-template-columns: 1fr;
  padding-top: 30px;
  border-bottom: 0;
}
.solo .roll-no { padding: 0 0 16px; }
.solo .more { display: block; animation: unveil .7s cubic-bezier(.2, .8, .2, 1) both; }
.solo .warnline { display: none; }
.solo h2 { font-size: 33px; }
.solo .expand { display: none; }
.solo .acts { display: none; }

/* ---------- 门：展卷之后，底下常留一条 ---------- */
.door {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  background: rgba(5, 6, 10, .93);
  -webkit-backdrop-filter: blur(14px) saturate(.8);
  backdrop-filter: blur(14px) saturate(.8);
  border-top: 1px solid rgba(214, 202, 178, .16);
  box-shadow: 0 -22px 46px -30px rgba(0, 0, 0, .95);
  animation: door-in .55s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes door-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.door-in {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 13px 44px;
}

.door-k {
  flex: 0 0 auto;
  margin: 0;
  font-size: 10px;
  letter-spacing: .34em;
  color: #6d6454;
}

.door-u {
  flex: 0 1 auto;
  margin-right: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .02em;
  color: #8d8270;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(141, 130, 112, .22);
  transition: color .3s, border-color .3s;
}
.door-u:hover { color: var(--gold); border-color: rgba(179, 154, 110, .5); }

.door .enter {
  flex: 0 0 auto;
  padding: 9px 16px 9px 20px;
  font-size: 11px;
  letter-spacing: .3em;
  text-indent: .3em;
}
.door .enter::after { width: 16px; }
.door .enter:hover::after { width: 26px; }

.door-x {
  flex: 0 0 auto;
  padding: 6px 0;
  border: 0; background: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: #5f574a;
  transition: color .3s;
}
.door-x:hover { color: #a1977f; }
.door-x kbd {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .06em;
  margin-left: 9px;
  padding: 1px 4px;
  border: 1px solid rgba(214, 202, 178, .16);
  border-radius: 2px;
  color: #4e473b;
}

body.is-solo { padding-bottom: 76px; }

@keyframes unveil {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.coverfig {
  margin: 34px 0 0;
  display: flex;
  justify-content: center;
}
.coverfig img {
  display: block;
  width: min(260px, 62vw);
  height: auto;
  border: 1px solid var(--hair);
  border-radius: 1px;
}

.m-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 36px;
}

.m-sec { min-width: 0; }

.m-sec h3 {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .36em;
  color: #82704f;
}
.m-sec h3::before {
  content: "";
  display: inline-block;
  width: 16px; height: 1px;
  background: #82704f;
  vertical-align: middle;
  margin-right: 11px;
  opacity: .7;
}

.m-sec p {
  margin: 0 0 10px;
  font-size: 12.8px;
  line-height: 2.3;
  letter-spacing: .045em;
  color: #9e9483;
}

/* 忌 */
.m-warn {
  margin-top: 34px;
  padding: 24px 26px 22px;
  border: 1px solid rgba(168, 58, 40, .22);
  background: rgba(168, 58, 40, .042);
}
.m-warn h3 { color: #a3624c; }
.m-warn h3::before { background: #a3624c; }
.m-warn ul {
  margin: 0; padding: 0;
  list-style: none;
  display: grid; gap: 7px;
}
.m-warn li {
  position: relative;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 2;
  letter-spacing: .04em;
  color: #a58d7c;
}
.m-warn li::before {
  content: "";
  position: absolute; left: 0; top: 1.05em;
  width: 9px; height: 1px;
  background: rgba(168, 58, 40, .62);
}
.m-warn[data-quiet] { border-color: rgba(214, 202, 178, .14); background: rgba(214, 202, 178, .026); }
.m-warn[data-quiet] h3 { color: #82704f; }
.m-warn[data-quiet] h3::before { background: #82704f; }
.m-warn[data-quiet] li::before { background: rgba(179, 154, 110, .5); }

.notfor {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(168, 58, 40, .18);
  font-size: 12.5px;
  line-height: 2.1;
  letter-spacing: .04em;
  color: #ab8168;
}
.notfor b {
  font-weight: 400;
  letter-spacing: .2em;
  color: #c46a50;
  margin-right: 10px;
}
.m-warn[data-quiet] .notfor { border-top-color: rgba(214, 202, 178, .14); color: #8f8574; }
.m-warn[data-quiet] .notfor b { color: #82704f; }

/* 数据行 */
.m-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 36px 0 0;
  padding: 0;
  border-top: 1px solid var(--hair);
}
.m-meta > div { padding: 18px 20px 0 0; }
.m-meta > div + div {
  padding-left: 22px;
  border-left: 1px solid var(--hair-2);
}
.m-meta dt {
  margin-bottom: 9px;
  font-size: 9px;
  letter-spacing: .3em;
  color: #5a5245;
}
.m-meta dd {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: .06em;
  color: #b5a992;
}

/* ---------- 空 ---------- */
.void {
  padding: 88px 0 60px;
  text-align: center;
}
.void-t {
  margin: 0;
  font-size: 22px;
  letter-spacing: .5em;
  text-indent: .5em;
  color: #a99d87;
}
.void-s {
  margin: 20px 0 0;
  font-size: 12.5px;
  line-height: 2;
  letter-spacing: .06em;
  color: #6b6153;
}
.void-a {
  display: inline-block;
  margin-top: 34px;
  padding-bottom: 3px;
  font-size: 11px;
  letter-spacing: .28em;
  color: #8a7f6b;
  text-decoration: none;
  border-bottom: 1px solid rgba(138, 127, 107, .34);
  transition: color .3s, border-color .3s;
}
.void-a:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 76px;
  padding-top: 26px;
  border-top: 1px solid var(--hair);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: #4c4639;
}
.foot-mid { color: #3f3a30; letter-spacing: .1em; }
.foot a {
  color: #6a5f4b;
  text-decoration: none;
  border-bottom: 1px solid rgba(106, 95, 75, .3);
  padding-bottom: 2px;
  transition: color .3s, border-color .3s;
}
.foot a:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- 窄屏 ---------- */
@media (max-width: 820px) {
  .page { padding: 0 22px 56px; }
  .hero { padding: 52px 0 34px; gap: 18px; }
  .seal { width: 40px; height: 40px; font-size: 21px; margin-top: 4px; border-width: 1.5px; }
  .title { font-size: 34px; letter-spacing: .36em; text-indent: .36em; }
  .latin { font-size: 8.5px; letter-spacing: .3em; margin-top: 12px; }
  .lede { margin-top: 18px; font-size: 12.5px; line-height: 2.05; }
  .hero-side { display: none; }

  .filters { padding: 20px 0 2px; }
  .f { margin-right: 22px; font-size: 12px; letter-spacing: .2em; }

  .roll { grid-template-columns: 1fr; padding: 32px 0 30px; }
  .roll-no { padding: 0 0 12px; font-size: 11px; }
  .roll h2 { font-size: 23px; letter-spacing: .12em; }
  .roll h2 .sub { font-size: 13px; display: block; margin: 8px 0 0; }
  .hook { margin-top: 18px; font-size: 13.5px; }
  .brief { font-size: 12.5px; line-height: 2.1; }
  .warnline { font-size: 11px; }
  .acts { gap: 18px; margin-top: 24px; flex-wrap: wrap; }

  .solo h2 { font-size: 26px; }
  .m-grid { grid-template-columns: 1fr; gap: 26px; margin-top: 28px; }
  .m-meta { grid-template-columns: 1fr 1fr; }
  .m-meta > div { padding: 16px 14px 0 0; }
  .m-meta > div + div { padding-left: 0; border-left: 0; }
  .m-meta > div:nth-child(2n) { padding-left: 16px; border-left: 1px solid var(--hair-2); }
  .m-meta > div:nth-child(n+3) { margin-top: 16px; border-top: 1px solid var(--hair-2); padding-top: 16px; }
  .m-warn { padding: 20px 18px 18px; }

  .foot { margin-top: 52px; }
  .foot-mid { display: none; }

  .door-in { flex-wrap: wrap; padding: 10px 22px 12px; gap: 9px 12px; }
  .door-k { display: none; }
  .door-u { flex: 1 1 100%; margin-right: 0; font-size: 10px; }
  .door .enter { margin-left: auto; padding: 9px 12px 9px 15px; letter-spacing: .2em; text-indent: .2em; }
  .door-x { font-size: 10px; letter-spacing: .12em; }
  .door-x kbd { display: none; }
  body.is-solo { padding-bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 显隐与入场 ---------- */
.roll.off { display: none; }

.rolls.in .roll {
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) both;
}
.rolls.in .roll:nth-of-type(2) { animation-delay: .10s; }
.rolls.in .roll:nth-of-type(3) { animation-delay: .20s; }
.rolls.in .roll:nth-of-type(4) { animation-delay: .30s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 宽屏：右栏做边注 ---------- */
@media (min-width: 1000px) {
  .roll-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    grid-template-areas:
      "title warn"
      "latin warn"
      "hook  warn"
      "brief warn"
      "tags  acts";
    column-gap: 52px;
    align-content: start;
  }
  .roll-body > h2      { grid-area: title; }
  .roll-body > .latin  { grid-area: latin; }
  .roll-body > .hook   { grid-area: hook; }
  .roll-body > .brief  { grid-area: brief; }
  .roll-body > .tags   { grid-area: tags; }
  .roll-body > .more   { grid-column: 1 / -1; }

  .roll-body > .warnline {
    grid-area: warn;
    align-self: start;
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
    margin-top: 6px;
    padding-left: 15px;
    border-left: 1px solid rgba(168, 58, 40, .26);
    font-size: 11px;
    line-height: 2;
  }
  .roll-body > .acts {
    grid-area: acts;
    justify-self: end;
    align-self: end;
    margin-top: 22px;
  }

  /* 单卷时右栏收起，正文通栏 */
  .solo .roll-body { grid-template-areas: none; grid-template-columns: 1fr; }
  .solo .roll-body > * { grid-area: auto; }
  .solo .roll-body > .warnline { display: none; }
  .solo .roll-body > .acts { justify-self: start; margin-top: 36px; }
}

/* ---------- 键盘焦点 ---------- */
.f:focus-visible,
.enter:focus-visible,
.expand:focus-visible,
.crumb a:focus-visible,
.void-a:focus-visible,
.foot a:focus-visible {
  outline: 1px solid rgba(179, 154, 110, .7);
  outline-offset: 5px;
}

/* 详情里那行「另附」 */
.m-sec p.m-side {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(179, 154, 110, .22);
  font-size: 12px;
  line-height: 2.1;
  color: #8a7f6b;
}
