:root {
  --ink: #2d261d;
  --paper: #eee1bf;
  --paper-deep: #d7c393;
  --cinnabar: #9b342b;
  --gold: #c79945;
  --green: #263a31;
  --jade: #6b9480;
  --line: rgba(69, 49, 29, 0.18);
  --shadow: 0 30px 90px rgba(22, 16, 10, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 72% 12%, rgba(255, 229, 173, 0.34), transparent 24%),
    radial-gradient(circle at 12% 86%, rgba(151, 52, 43, 0.12), transparent 30%),
    linear-gradient(135deg, #d6c79c 0%, #b8bc94 42%, #e5d7ad 100%);
  color: var(--paper);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  margin: 0;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.workbench {
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(22px, 4vw, 54px);
  position: relative;
}

.workbench::before {
  background:
    linear-gradient(rgba(65, 49, 30, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(65, 49, 30, 0.03) 1px, transparent 1px),
    repeating-linear-gradient(110deg, rgba(80, 59, 32, 0.025) 0 1px, transparent 1px 8px);
  background-size: 54px 54px, 54px 54px, 100% 100%;
  content: "";
  inset: 0;
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 78%);
  pointer-events: none;
  position: absolute;
}

.workbench::after {
  background:
    linear-gradient(90deg, rgba(222, 207, 165, 0.6), rgba(222, 207, 165, 0.02) 44%, rgba(222, 207, 165, 0.32)),
    linear-gradient(180deg, rgba(231, 214, 171, 0), rgba(36, 45, 35, 0.2)),
    url("../assets/zhaoming-prince-desk-bg.png") 64% -42px / min(940px, 74vw) auto no-repeat;
  content: "";
  inset: 0;
  mask-image: radial-gradient(ellipse at 62% -2%, #000 0%, rgba(0, 0, 0, 0.9) 34%, rgba(0, 0, 0, 0.48) 58%, transparent 82%);
  opacity: 0.78;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.lamp-glow::after {
  border: 1px solid rgba(231, 199, 135, 0.16);
  content: "昭明文选";
  color: rgba(231, 199, 135, 0.11);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(3.4rem, 12vw, 12rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  position: fixed;
  right: 28px;
  text-align: right;
  top: 28px;
  writing-mode: vertical-rl;
}

.right-ornaments {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.right-ornaments::before {
  background:
    radial-gradient(ellipse at 74% 28%, rgba(44, 54, 38, 0.22), transparent 0 18%, rgba(44, 54, 38, 0.08) 19%, transparent 44%),
    radial-gradient(ellipse at 92% 56%, rgba(151, 52, 43, 0.18), transparent 0 16%, rgba(151, 52, 43, 0.07) 17%, transparent 38%),
    radial-gradient(ellipse at 64% 72%, rgba(54, 66, 45, 0.15), transparent 0 20%, transparent 48%),
    repeating-linear-gradient(98deg, rgba(58, 44, 27, 0.028) 0 1px, transparent 1px 13px);
  background-size: 100% 100%;
  content: "";
  filter: blur(0.2px);
  height: 650px;
  opacity: 0.82;
  position: absolute;
  right: -10vw;
  top: 48px;
  transform: rotate(-4deg);
  width: min(52vw, 620px);
}

.right-ornaments::after {
  border: 3px solid rgba(151, 52, 43, 0.13);
  box-shadow: inset 0 0 0 2px rgba(151, 52, 43, 0.06);
  color: rgba(151, 52, 43, 0.12);
  content: "昭明";
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.8rem, 7vw, 7.6rem);
  font-weight: 900;
  line-height: 1.1;
  padding: 16px 10px;
  position: absolute;
  right: 7vw;
  top: 338px;
  transform: rotate(-12deg);
  writing-mode: vertical-rl;
}

.right-ornaments i {
  background:
    linear-gradient(90deg, transparent, rgba(48, 36, 22, 0.12), transparent),
    rgba(60, 74, 50, 0.04);
  border-radius: 34% 62% 48% 58%;
  display: block;
  filter: blur(5px);
  height: 210px;
  mix-blend-mode: multiply;
  position: absolute;
  right: 2vw;
  top: 170px;
  transform: rotate(-20deg);
  width: 118px;
}

.right-ornaments i:nth-child(2) {
  background: rgba(151, 52, 43, 0.1);
  border-radius: 48% 38% 57% 42%;
  height: 158px;
  opacity: 0.72;
  right: 12vw;
  top: 454px;
  transform: rotate(18deg);
  width: 150px;
}

.right-ornaments i:nth-child(3) {
  background: rgba(42, 52, 37, 0.11);
  border-radius: 52% 48% 42% 64%;
  height: 110px;
  opacity: 0.58;
  right: 24vw;
  top: 260px;
  transform: rotate(24deg);
  width: 190px;
}

.lamp-glow {
  background:
    radial-gradient(circle, rgba(255, 236, 185, 0.38), rgba(196, 101, 49, 0.11) 28%, transparent 62%);
  filter: blur(18px);
  height: 520px;
  pointer-events: none;
  position: absolute;
  right: -130px;
  top: -190px;
  width: 520px;
}

.paper-motes {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.paper-motes i {
  animation: mote-rise 8s ease-in-out infinite;
  background: rgba(255, 232, 170, 0.62);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 232, 170, 0.25);
  height: 4px;
  left: calc(12% + var(--i, 0) * 12%);
  position: absolute;
  top: 78%;
  width: 4px;
}

.paper-motes i:nth-child(1) { --i: 0; animation-delay: 0s; }
.paper-motes i:nth-child(2) { --i: 1; animation-delay: 1.2s; }
.paper-motes i:nth-child(3) { --i: 2; animation-delay: 2.1s; }
.paper-motes i:nth-child(4) { --i: 3; animation-delay: 0.7s; }
.paper-motes i:nth-child(5) { --i: 4; animation-delay: 2.8s; }
.paper-motes i:nth-child(6) { --i: 5; animation-delay: 1.8s; }

.workbench-head,
.ritual-track,
.desk-grid,
.volume-desk,
.bound-book {
  position: relative;
  z-index: 2;
}

.workbench-head {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin: 0 auto 24px;
  max-width: 1480px;
}

.workbench-head a {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 228, 170, 0.15), transparent 52%),
    rgba(21, 19, 15, 0.82);
  border: 2px solid rgba(151, 47, 38, 0.62);
  color: #fff1c9;
  display: grid;
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
  height: 42px;
  place-items: center;
  text-decoration: none;
  width: 42px;
  writing-mode: vertical-rl;
}

.workbench-head p,
.volume-desk p,
.panel-title span,
.eyebrow,
.memo-card span {
  color: #7cb99a;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.workbench-head h1 {
  color: #fff6d8;
  text-shadow: 0 2px 18px rgba(36, 30, 18, 0.42);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.2rem, 5vw, 5.5rem);
  font-weight: 500;
  line-height: 1;
  margin: 4px 0 0;
}

.workbench-head output {
  background: rgba(24, 31, 25, 0.5);
  border: 1px solid rgba(91, 65, 32, 0.22);
  color: rgba(255, 247, 220, 0.88);
  font-weight: 900;
  min-width: 178px;
  padding: 12px 16px;
  text-align: center;
}

.ritual-track {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 auto 22px;
  max-width: 1480px;
}

.ritual-track article {
  background: rgba(22, 31, 25, 0.58);
  border: 1px solid rgba(91, 65, 32, 0.18);
  color: rgba(255, 242, 210, 0.52);
  display: grid;
  gap: 4px;
  min-height: 66px;
  padding: 12px;
}

.ritual-track article.is-lit {
  background:
    linear-gradient(135deg, rgba(151, 52, 43, 0.36), rgba(199, 153, 69, 0.28)),
    rgba(26, 36, 28, 0.64);
  border-color: rgba(255, 226, 158, 0.32);
  color: #fff0c8;
}

.ritual-track span {
  color: #7cb99a;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 900;
}

.ritual-track strong {
  font-family: "Noto Serif SC", serif;
  font-size: 1.05rem;
}

.desk-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(260px, 0.75fr) minmax(420px, 1.2fr) minmax(280px, 0.85fr);
  margin: 0 auto;
  max-width: 1480px;
}

.candidate-rack,
.criteria-board,
.volume-desk {
  background:
    linear-gradient(90deg, rgba(91, 57, 28, 0.05), transparent 18%, transparent 82%, rgba(91, 57, 28, 0.06)),
    repeating-linear-gradient(0deg, rgba(74, 48, 28, 0.035) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, rgba(241, 226, 187, 0.96), rgba(203, 181, 133, 0.94)),
    radial-gradient(circle at 18% 10%, rgba(159, 52, 43, 0.12), transparent 36%);
  border: 1px solid rgba(255, 239, 184, 0.22);
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 20px;
  position: relative;
}

.candidate-rack::before,
.criteria-board::before,
.volume-desk::before {
  border: 1px solid rgba(128, 77, 38, 0.12);
  content: "";
  inset: 9px;
  pointer-events: none;
  position: absolute;
}

.panel-title h2,
.volume-desk h2 {
  color: var(--ink);
  font-family: "Noto Serif SC", serif;
  font-size: 1.6rem;
  line-height: 1.1;
  margin: 6px 0 0;
}

.genre-switch {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}

.judgement-desk {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.judgement-desk button {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 245, 210, 0.28), transparent 60%),
    #24382f;
  border: 1px solid rgba(255, 238, 182, 0.2);
  color: #fff0c8;
  font-family: "Noto Serif SC", serif;
  font-size: 1.04rem;
  font-weight: 900;
  min-height: 48px;
}

.judgement-desk button[data-judge="rough"] {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 245, 210, 0.18), transparent 60%),
    #4a302a;
}

.judgement-desk button.is-active {
  box-shadow:
    inset 0 0 0 2px rgba(255, 238, 182, 0.28),
    0 12px 24px rgba(80, 45, 22, 0.16);
}

.judgement-result {
  color: rgba(47, 38, 29, 0.72);
  display: block;
  font-family: "Noto Serif SC", serif;
  font-size: 0.88rem;
  line-height: 1.55;
  margin-top: 10px;
}

.workbench-search {
  background:
    linear-gradient(90deg, rgba(151, 47, 38, 0.08), transparent 28%),
    rgba(255, 252, 236, 0.36);
  border: 1px solid rgba(80, 58, 35, 0.13);
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
}

.workbench-search label {
  color: #873027;
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
}

.workbench-search div {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.workbench-search input {
  background: rgba(255, 250, 228, 0.7);
  border: 1px solid rgba(80, 58, 35, 0.18);
  color: var(--ink);
  min-height: 40px;
  min-width: 0;
  padding: 0 11px;
}

.workbench-search input:focus {
  border-color: rgba(151, 47, 38, 0.46);
  outline: 2px solid rgba(151, 47, 38, 0.16);
}

.workbench-search button {
  background: #263a31;
  border: 1px solid rgba(255, 238, 182, 0.2);
  color: #fff0c8;
  font-weight: 900;
}

.workbench-search output {
  color: rgba(47, 38, 29, 0.56);
  font-size: 0.78rem;
  font-weight: 900;
}

.genre-switch button {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(70, 49, 29, 0.16);
  color: #4a3827;
  font-weight: 900;
  min-height: 36px;
}

.genre-switch button.is-active {
  background: #263a31;
  color: #fff0c8;
}

.slip-stack {
  display: grid;
  gap: 12px;
  max-height: 600px;
  overflow: auto;
  padding-right: 4px;
}

.work-slip {
  background:
    linear-gradient(90deg, rgba(152, 58, 47, 0.1), transparent 18%),
    repeating-linear-gradient(0deg, rgba(101, 65, 35, 0.035) 0 1px, transparent 1px 7px),
    rgba(255, 251, 231, 0.62);
  border: 1px solid rgba(80, 58, 35, 0.14);
  color: var(--ink);
  display: grid;
  gap: 7px;
  padding: 14px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  user-select: none;
}

.work-slip:hover,
.work-slip.is-active {
  border-color: rgba(155, 52, 43, 0.42);
  box-shadow: 0 14px 30px rgba(68, 43, 20, 0.12);
  transform: translateY(-2px);
}

.work-slip strong {
  color: #832e26;
  font-family: "Noto Serif SC", serif;
  font-size: 1.16rem;
}

.work-slip small {
  color: rgba(47, 38, 29, 0.62);
  font-weight: 800;
}

.work-slip span {
  color: rgba(47, 38, 29, 0.72);
  font-family: "Noto Serif SC", serif;
  font-size: 0.86rem;
  line-height: 1.55;
}

.central-scroll {
  align-self: stretch;
  display: grid;
  grid-template-rows: 24px minmax(560px, 1fr) 24px;
}

.scroll-rod {
  background:
    linear-gradient(90deg, #6a331e, #d0a25a 18%, #6f381f 50%, #d0a25a 82%, #5b2d1b);
  border: 1px solid rgba(255, 231, 168, 0.22);
  box-shadow: 0 12px 26px rgba(25, 12, 4, 0.22);
}

.scroll-rod.top {
  border-radius: 999px 999px 8px 8px;
}

.scroll-rod.bottom {
  border-radius: 8px 8px 999px 999px;
}

.imperial-scroll {
  background:
    linear-gradient(90deg, rgba(95, 64, 30, 0.11), transparent 12%, transparent 88%, rgba(95, 64, 30, 0.11)),
    repeating-linear-gradient(0deg, rgba(110, 73, 38, 0.045) 0 1px, transparent 1px 10px),
    radial-gradient(circle at 78% 18%, rgba(169, 55, 45, 0.11), transparent 30%),
    linear-gradient(180deg, #f5e8c3, #dfc58b);
  border-left: 1px solid rgba(82, 55, 28, 0.22);
  border-right: 1px solid rgba(82, 55, 28, 0.22);
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  min-height: 560px;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  position: relative;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.imperial-scroll.is-receiving {
  box-shadow:
    var(--shadow),
    inset 0 0 0 3px rgba(151, 47, 38, 0.42),
    inset 0 0 80px rgba(199, 153, 69, 0.22);
  transform: translateY(-2px);
}

.scroll-mark {
  border: 2px solid rgba(151, 47, 38, 0.72);
  color: rgba(151, 47, 38, 0.72);
  font-family: "Noto Serif SC", serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  padding: 10px 8px;
  pointer-events: none;
  position: absolute;
  right: 36px;
  top: 36px;
  writing-mode: vertical-rl;
}

.scroll-title-row {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
  z-index: 1;
}

.imperial-scroll h2 {
  color: #7f2d26;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 500;
  line-height: 1;
  margin: 14px 0 0;
  max-width: 100%;
  min-width: 0;
}

.scroll-meta {
  color: rgba(47, 38, 29, 0.62);
  font-weight: 900;
  margin: 10px 0 34px;
}

.imperial-scroll blockquote {
  border-left: 4px solid rgba(151, 47, 38, 0.46);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.35rem, 2.7vw, 2.3rem);
  line-height: 1.75;
  margin: 0;
  padding-left: 18px;
}

.comment-stack {
  align-self: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 30px 0 0;
}

.comment-stack article {
  background:
    linear-gradient(90deg, rgba(151, 47, 38, 0.08), transparent 20%),
    rgba(255, 252, 236, 0.42);
  border: 1px solid rgba(90, 61, 32, 0.16);
  color: rgba(47, 38, 29, 0.78);
  min-width: 0;
  padding: 12px;
  position: relative;
}

.comment-stack article::before {
  background: rgba(151, 47, 38, 0.46);
  content: "";
  height: calc(100% - 20px);
  left: 0;
  position: absolute;
  top: 10px;
  width: 3px;
}

.comment-stack span {
  color: #873027;
  display: block;
  font-size: 0.75rem;
  font-weight: 900;
  margin-bottom: 5px;
}

.comment-stack p {
  font-family: "Noto Serif SC", serif;
  font-size: 0.94rem;
  line-height: 1.78;
  margin: 0;
}

.selection-note {
  background:
    linear-gradient(90deg, rgba(142, 48, 38, 0.11), transparent 34%),
    repeating-linear-gradient(0deg, rgba(101, 65, 35, 0.035) 0 1px, transparent 1px 8px),
    rgba(255, 252, 236, 0.72);
  border: 1px solid rgba(128, 77, 38, 0.18);
  box-shadow: 0 18px 40px rgba(64, 37, 15, 0.12);
  color: rgba(47, 38, 29, 0.82);
  margin-top: 18px;
  max-width: 560px;
  padding: 14px 16px;
  position: relative;
}

.selection-note[hidden] {
  display: none;
}

.selection-note::after {
  border: 2px solid rgba(151, 47, 38, 0.56);
  color: rgba(151, 47, 38, 0.68);
  content: "批";
  display: grid;
  font-family: "Noto Serif SC", serif;
  font-size: 1.08rem;
  font-weight: 900;
  height: 34px;
  place-items: center;
  position: absolute;
  right: 14px;
  top: 14px;
  transform: rotate(-12deg);
  width: 34px;
}

.selection-note[data-kind="rough"]::after {
  content: "校";
}

.selection-note.is-revealed {
  animation: note-reveal 460ms ease both;
}

.selection-note span,
.selection-note em {
  color: rgba(47, 38, 29, 0.54);
  display: block;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.selection-note strong {
  color: #873027;
  display: block;
  font-family: "Noto Serif SC", serif;
  font-size: 1.38rem;
  margin-top: 5px;
  padding-right: 52px;
}

.selection-note p {
  font-family: "Noto Serif SC", serif;
  font-size: 1.02rem;
  line-height: 1.86;
  margin: 8px 0;
}

.flight-slip {
  animation: slip-to-scroll 860ms cubic-bezier(0.22, 0.88, 0.22, 1) forwards;
  background:
    linear-gradient(90deg, rgba(152, 58, 47, 0.11), transparent 28%),
    #fff1c7;
  border: 1px solid rgba(151, 47, 38, 0.28);
  box-shadow: 0 18px 48px rgba(43, 24, 10, 0.25);
  color: var(--ink);
  left: 0;
  min-width: 190px;
  padding: 12px 14px;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translate(var(--start-x), var(--start-y)) rotate(-5deg);
  z-index: 40;
}

.flight-slip strong,
.flight-slip small {
  display: block;
}

.flight-slip strong {
  color: #873027;
  font-family: "Noto Serif SC", serif;
  font-size: 1.08rem;
}

.flight-slip small {
  color: rgba(47, 38, 29, 0.58);
  font-size: 0.74rem;
  font-weight: 900;
  margin-top: 4px;
}

.scroll-actions {
  display: flex;
  gap: 12px;
  justify-content: end;
  margin-bottom: 6px;
  position: relative;
  z-index: 2;
}

.scroll-actions button {
  background: #263a31;
  border: 1px solid rgba(255, 238, 182, 0.24);
  color: #fff0c8;
  font-weight: 900;
  min-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
}

.scroll-actions button:first-child {
  background: linear-gradient(135deg, #9b342b, #c79945);
}

.seal-burst {
  align-items: center;
  border: 5px solid rgba(151, 47, 38, 0.82);
  color: rgba(151, 47, 38, 0.86);
  display: grid;
  font-family: "Noto Serif SC", serif;
  font-size: 2.4rem;
  font-weight: 900;
  height: 118px;
  opacity: 0;
  place-items: center;
  position: absolute;
  right: 112px;
  top: 48%;
  transform: rotate(-14deg) scale(1.35);
  width: 118px;
}

.seal-burst.is-stamped {
  animation: stamp-in 740ms cubic-bezier(0.18, 0.9, 0.2, 1.18);
}

.score-board {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.score-row {
  display: grid;
  gap: 7px;
}

.score-row div {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.score-row span {
  color: #823027;
  font-weight: 900;
}

.score-row small {
  color: rgba(47, 38, 29, 0.58);
  font-weight: 800;
}

.score-row i {
  background:
    linear-gradient(90deg, rgba(83, 57, 31, 0.18), rgba(255, 250, 226, 0.26));
  border: 1px solid rgba(83, 57, 31, 0.08);
  height: 9px;
  overflow: hidden;
  position: relative;
}

.score-row i::after {
  background:
    repeating-linear-gradient(90deg, rgba(255, 245, 200, 0.18) 0 4px, transparent 4px 8px),
    linear-gradient(90deg, #8f322a, #c79945);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: var(--score, 0%);
}

.memo-card {
  background:
    linear-gradient(90deg, rgba(151, 47, 38, 0.08), transparent 24%),
    rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(79, 56, 32, 0.14);
  margin: 20px 0;
  padding: 14px;
}

.memo-card p {
  color: rgba(47, 38, 29, 0.76);
  font-family: "Noto Serif SC", serif;
  line-height: 1.72;
  margin: 8px 0 0;
}

.bind-scroll {
  background: linear-gradient(135deg, #8f322a, #c79945);
  border: 1px solid rgba(255, 238, 182, 0.26);
  color: #fff0c8;
  font-weight: 900;
  margin-bottom: 14px;
  min-height: 44px;
  width: 100%;
}

.selected-roll {
  display: grid;
  gap: 10px;
}

.selected-roll.is-updated .selected-item:first-child {
  animation: roll-receive 560ms ease both;
}

.selected-item {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(151, 47, 38, 0.08), transparent 22%),
    rgba(255, 250, 228, 0.48);
  border: 1px solid rgba(80, 58, 35, 0.14);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.selected-item strong {
  color: var(--ink);
  display: block;
  font-family: "Noto Serif SC", serif;
}

.selected-item small {
  color: rgba(47, 38, 29, 0.58);
  font-weight: 800;
}

.selected-item button {
  background: rgba(151, 47, 38, 0.1);
  border: 1px solid rgba(151, 47, 38, 0.18);
  color: #873027;
  font-weight: 900;
  height: 32px;
  width: 32px;
}

.volume-desk {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr) minmax(260px, 360px);
  margin: 24px auto 0;
  max-width: 1480px;
}

.volume-shelf {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(30, minmax(10px, 1fr));
}

.volume-scroll {
  background: linear-gradient(180deg, #6d3823, #c99f55 42%, #5f301f);
  border: 1px solid rgba(74, 45, 24, 0.36);
  height: 78px;
  min-width: 10px;
  padding: 0;
  position: relative;
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.volume-scroll.is-filled,
.volume-scroll.is-active {
  background: linear-gradient(180deg, #8d3028, #d6ad58 42%, #723020);
  box-shadow: 0 0 0 2px rgba(151, 47, 38, 0.12);
}

.volume-scroll.is-active {
  box-shadow:
    0 0 0 2px rgba(151, 47, 38, 0.38),
    0 0 26px rgba(151, 47, 38, 0.18);
  transform: translateY(-4px);
}

.volume-scroll:hover::after {
  background: rgba(26, 21, 15, 0.9);
  color: #fff0c8;
  content: attr(data-label);
  left: 50%;
  padding: 6px 8px;
  position: absolute;
  top: -34px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.volume-inspector {
  background:
    repeating-linear-gradient(0deg, rgba(101, 65, 35, 0.035) 0 1px, transparent 1px 8px),
    linear-gradient(180deg, rgba(255, 250, 228, 0.48), rgba(255, 255, 255, 0.2));
  border: 1px solid rgba(80, 58, 35, 0.14);
  display: grid;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
  padding: 14px;
}

.volume-inspector > span {
  color: #873027;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 900;
}

.volume-inspector > strong {
  font-family: "Noto Serif SC", serif;
  font-size: 1.1rem;
}

.bound-book {
  margin: 24px auto 0;
  max-width: 1480px;
}

.bound-book[hidden] {
  display: none;
}

.bound-cover {
  background:
    repeating-linear-gradient(0deg, rgba(73, 44, 24, 0.04) 0 1px, transparent 1px 10px),
    radial-gradient(circle at 82% 18%, rgba(158, 51, 43, 0.18), transparent 26%),
    linear-gradient(135deg, #ead7a2, #c59d5e 54%, #7d3228);
  border: 1px solid rgba(255, 239, 184, 0.34);
  box-shadow: var(--shadow);
  color: var(--ink);
  display: grid;
  gap: 14px;
  min-height: 320px;
  overflow: hidden;
  padding: clamp(24px, 5vw, 54px);
  position: relative;
}

.bound-cover > span {
  color: #2b5f50;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bound-cover h2 {
  color: #7f2d26;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  font-weight: 500;
  line-height: 1;
  margin: 0;
}

.bound-cover p {
  font-family: "Noto Serif SC", serif;
  font-size: 1.08rem;
  line-height: 1.8;
  margin: 0;
  max-width: 760px;
}

.bound-cover div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 780px;
}

.bound-cover em {
  background: rgba(255, 250, 226, 0.36);
  border: 1px solid rgba(80, 58, 35, 0.14);
  font-style: normal;
  font-weight: 900;
  padding: 8px 10px;
}

.bound-cover strong {
  border: 4px solid rgba(151, 47, 38, 0.72);
  color: rgba(151, 47, 38, 0.78);
  font-family: "Noto Serif SC", serif;
  font-size: 2.3rem;
  line-height: 1.1;
  padding: 14px 10px;
  position: absolute;
  right: 44px;
  top: 44px;
  transform: rotate(-10deg);
  writing-mode: vertical-rl;
}

.volume-detail-block {
  border-top: 1px solid rgba(80, 58, 35, 0.13);
  display: grid;
  gap: 7px;
  padding-top: 9px;
}

.volume-detail-block em {
  color: rgba(47, 38, 29, 0.56);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.volume-detail-block p {
  color: var(--ink);
  font-family: "Noto Serif SC", serif;
  line-height: 1.35;
  margin: 0;
}

.volume-detail-block small {
  color: rgba(47, 38, 29, 0.55);
  display: block;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  margin-top: 2px;
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: rotate(-18deg) scale(2.2);
  }

  44% {
    opacity: 1;
    transform: rotate(-14deg) scale(0.82);
  }

  100% {
    opacity: 0.9;
    transform: rotate(-14deg) scale(1);
  }
}

@keyframes note-reveal {
  0% {
    opacity: 0;
    transform: translateY(10px) rotate(0.6deg);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes roll-receive {
  0% {
    box-shadow: 0 0 0 rgba(151, 47, 38, 0);
    transform: translateY(-8px);
  }

  48% {
    box-shadow: 0 12px 28px rgba(151, 47, 38, 0.16);
    transform: translateY(2px);
  }

  100% {
    box-shadow: 0 0 0 rgba(151, 47, 38, 0);
    transform: translateY(0);
  }
}

@keyframes slip-to-scroll {
  0% {
    opacity: 0;
    transform: translate(var(--start-x), var(--start-y)) rotate(-5deg) scale(0.95);
  }

  18% {
    opacity: 1;
  }

  68% {
    opacity: 1;
    transform: translate(var(--end-x), var(--end-y)) rotate(2deg) scale(0.82);
  }

  100% {
    opacity: 0;
    transform: translate(var(--end-x), var(--end-y)) rotate(0deg) scale(0.38);
  }
}

@keyframes mote-rise {
  0%,
  100% {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
  }

  46% {
    opacity: 0.9;
  }

  78% {
    opacity: 0.22;
    transform: translateY(-120px) scale(1.2);
  }
}

@media (max-width: 1120px) {
  .desk-grid {
    grid-template-columns: 1fr;
  }

  .central-scroll {
    grid-row: 1;
  }

  .volume-desk {
    grid-template-columns: 1fr;
  }

  .comment-stack {
    grid-template-columns: 1fr;
  }

  .ritual-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .workbench {
    padding: 18px;
  }

  .workbench-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .workbench-head output {
    grid-column: 1 / -1;
  }

  .genre-switch {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .imperial-scroll {
    padding: 26px 20px;
  }

  .imperial-scroll h2 {
    max-width: 100%;
  }

  .scroll-mark {
    opacity: 0.18;
  }

  .scroll-actions {
    display: grid;
  }

  .volume-shelf {
    grid-template-columns: repeat(15, minmax(10px, 1fr));
  }

  .ritual-track {
    grid-template-columns: 1fr;
  }

  .bound-cover strong {
    opacity: 0.16;
  }
}
