/* 原交付样式：reflow-v024/flow.css */
/* 十章共用同一翻章轨道；通览与四季各自在本章内自然阅读。 */
#exhibition-flow {
  touch-action: pan-y;
}

.flow-chapter:not(.scroll-chapter) {
  touch-action: none;
}

.flow-chapter.scroll-chapter {
  touch-action: pan-y;
}

.chapter-scroll {
  height: 100%;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: none;
  transform: scale(var(--page-scale, 1));
  opacity: var(--page-opacity, 1);
  transform-origin: center;
  backface-visibility: hidden;
}

.chapter-scroll::-webkit-scrollbar {
  display: none;
}

.chapter-scroll:focus {
  outline: none;
}

.chapter-scroll > .page {
  height: auto;
  min-height: var(--screen-height);
  max-height: none;
  overflow: visible;
  position: relative;
  padding-top: 4px;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
  animation: none;
}

.chapter-scroll .page-top {
  padding-top: 18px;
}

.chapter-scroll .page-top > span {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 2px;
}

.chapter-scroll .branch-return {
  padding: 16px 0 13px;
  margin-top: 0;
}

.flow-chapter .page-guide[data-direction="backward"] .swipe-mark {
  rotate: 180deg;
}

.flow-chapter .chapter-scroll .overview-page {
  padding-inline: 20px;
}

@media (max-width: 350px) {
  .flow-chapter .chapter-scroll .overview-page {
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-scroll {
    transform: none;
    opacity: 1;
  }
}

/* 长章的首屏在吸附落稳后展开，余下内容在本章滚动进入视口时展开。 */
.scroll-chapter .reveal-item {
  animation: none;
}

.scroll-chapter .chapter-item-pending {
  opacity: 0;
  pointer-events: none;
}

.scroll-chapter .chapter-item-shown {
  opacity: 1;
}

.scroll-chapter .chapter-item-revealing.reveal-text {
  animation: page-unfold-text 720ms cubic-bezier(.18,.8,.24,1) var(--reveal-delay,0ms) both;
}

.scroll-chapter .chapter-item-revealing.reveal-picture {
  animation: page-unfold-picture 1000ms cubic-bezier(.16,1,.3,1) var(--reveal-delay,0ms) both;
}

.scroll-chapter .chapter-item-revealing.reveal-ink {
  animation: page-unfold-ink 720ms ease-out var(--reveal-delay,0ms) both;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-chapter .chapter-item-pending {
    opacity: 1;
    pointer-events: auto;
  }
  .scroll-chapter .chapter-item-revealing {
    animation: none !important;
  }
}

/* 原交付样式：reflow-v024/visual.css */
/* V024：局部放大字级，延续纸色、书法与印章的既有视觉。 */
.cover .site-brand {
  width: min(50%, 190px);
  min-width: 0;
}

.cover .library-logo {
  width: 100%;
  height: auto;
}

.cover .cover-content .cover-edition {
  display: block;
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
}

.cover .cover-content .cover-edition::before,
.cover .cover-content .cover-edition::after,
.cover .cover-content .cover-edition p::before,
.cover .cover-content .cover-edition p::after {
  content: none;
  display: none;
}

.cover .cover-content .cover-edition p {
  max-width: none;
  margin: 17px 0 0;
  color: #3d624b;
  font-family: 'ExhibitTitleBrush', var(--serif);
  font-size: clamp(19px, 5.1vw, 22px);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: .7px;
  line-height: 1.65;
  white-space: nowrap;
  text-shadow: 0 1px 8px #f8f5e9;
}

/* 所有主线章节共用同一翻页签；箭头沿用同一图形和节奏。 */
.flow-chapter .page-guide {
  position: absolute;
  inset: auto 17px max(8px, env(safe-area-inset-bottom));
  min-height: 40px;
  margin: 0;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-top: 1px solid #a9bfa3;
  background: linear-gradient(90deg, transparent, #f9f7efe9 18%, #f9f7efe9 82%, transparent);
  color: #345943;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.flow-chapter .page-guide .swipe-mark {
  width: 17px;
  height: 23px;
  flex: 0 0 17px;
}

.flow-chapter .page-guide .swipe-mark i {
  width: 8px;
  height: 8px;
  border-width: 1.5px;
}

/* 增大整盘与可读字级；只覆盖罗盘中的夏季印色。 */
.flow-chapter .compass-page {
  padding-inline: 8px;
  /* 翻页时保持罗盘尺寸固定，排查移动端 SVG 文字错位。 */
  transform: none;
}

.compass-page .section-heading {
  padding-bottom: 4px;
}

.compass-page .section-heading h1 {
  margin-bottom: 5px;
}

.compass-page .wheel-wrap {
  --picture-enter-scale: 1;
  flex: 0 0 auto;
  width: min(100%, 480px);
  max-width: 480px;
  margin: 2px auto 4px;
}

.compass-page .wheel {
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
}

.compass-page .wheel .term-node text {
  font-size: 27px;
  font-weight: 500;
  fill: #425e44;
  letter-spacing: 0;
}

.compass-page .wheel .season-name {
  font-size: 48px;
  font-weight: 500;
}

.compass-page .wheel .season-sector[data-season="1"] {
  --season-ink: #b5677f !important;
  --entry-ink: #b5677f;
}

.compass-page .wheel .season-sector[data-season="1"] .season-name {
  fill: #b5677f;
}

.compass-page .wheel .season-sector[data-season="1"] .season-disc {
  stroke: #c78da0;
}

.compass-page .wheel .season-sector[data-season="1"] .season-seal > circle:not(.season-disc):not(.season-beacon) {
  stroke: #c78da0;
}

/* V0.24.5：按已确认原型，三行整体居中、行首左齐，单线书笺承载分色书法。 */
.flow-chapter .compass-page .compass-description {
  position: relative;
  width: max-content;
  max-width: calc(100% - 16px);
  margin: 10px auto 0;
  padding: 9px 16px 12px;
  border: 0;
  border-radius: 0;
  background: none;
  color: #536e54;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 27px;
  text-align: left;
}

.compass-page .compass-description::before,
.compass-page .compass-description::after {
  content: none;
  display: none;
}

.compass-description > .compass-guide-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.compass-description > .compass-guide-frame path {
  fill: #f7f5eb;
  fill-opacity: .30;
  stroke: #91a185;
  stroke-opacity: .7;
  stroke-width: .65;
  vector-effect: non-scaling-stroke;
}

.compass-page .compass-description p {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 2px;
  height: 27px;
  margin: 0;
  line-height: 27px;
  white-space: nowrap;
}

.compass-page .compass-description p + p {
  margin-top: 0;
}

.compass-description p > span {
  flex: 0 0 auto;
}

.compass-description .guide-brush {
  font-family: 'ExhibitCompassBrush', var(--serif);
  font-size: 18px;
  font-weight: 400;
  font-synthesis: none;
  color: #405e43;
}

.compass-description .guide-term {
  font-family: 'ExhibitTitleBrush', var(--serif);
}

.compass-description .guide-spring {
  color: #287042;
}

.compass-description .guide-summer {
  color: #b5677f;
}

.compass-description .guide-autumn {
  color: #996113;
}

.compass-description .guide-winter {
  color: #315e91;
}

/* 提示独占一行；素材和操作按钮按实际高度排版，画布收缩到余下空间。 */
.flow-chapter:not(:first-child) > .editor-shell {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.flow-chapter .editor-shell > .page-guide {
  position: static;
  flex: 0 0 auto;
  margin-top: 6px;
}

.editor-layout .canvas-wrap {
  flex: 0 1 auto;
  box-sizing: content-box;
  width: min(calc(100% - 10px), 330px);
  min-height: 0;
  aspect-ratio: 720 / 1040;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: 5px;
  border: 0;
  background: none;
}

.editor-layout .canvas-wrap > .poster-canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 0 0 4px #e7eade, 0 0 0 5px #afc0a9;
}

.editor-layout .editor-tools {
  margin-top: 5px;
  padding-bottom: 0;
}

.palette-drawer > summary {
  display: none;
}

.editor-shell .editor-instruction {
  margin-bottom: 3px;
}

.editor-shell .creation-gestures {
  margin: 3px 0 0;
}

.editor-tools .palette-hint {
  margin-bottom: 3px;
}

@media (max-width: 359px) {
  .cover .cover-content .cover-edition p {
    font-size: 19px;
    letter-spacing: .2px;
  }
  .flow-chapter .page-guide {
    font-size: 13px;
    letter-spacing: .6px;
  }
  .flow-chapter .compass-page .compass-description {
    padding-inline: 14px;
    font-size: 13px;
  }
  .compass-description .guide-brush {
    font-size: 17px;
  }
}

/* 短屏让素材在需要时展开，画布与操作按钮保持在同一屏。 */
@media (max-height: 680px) {
  .editor-shell .editor-instruction {
    display: none;
  }
  .editor-shell .creation-gestures {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.2;
  }
  .editor-layout .editor-tools {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px 8px;
    margin-top: 3px;
  }
  .editor-tools .palette-drawer {
    min-width: 0;
  }
  .palette-drawer > summary {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 7px 10px;
    border: 1px solid #b6c5aa;
    border-radius: 3px;
    background: #f0f2e6;
    color: #3b5f46;
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.4;
    list-style: none;
    cursor: pointer;
  }
  .palette-drawer > summary::-webkit-details-marker {
    display: none;
  }
  .palette-drawer > summary span {
    font-size: 24px;
  }
  .palette-drawer[open] > summary span {
    transform: rotate(45deg);
  }
  .palette-drawer > summary:focus-visible {
    outline: 2px solid #8b9f77;
    outline-offset: 2px;
  }
  .palette-drawer-content {
    position: absolute;
    z-index: 8;
    left: 0;
    right: 0;
    bottom: calc(100% + 5px);
    padding: 10px 8px 8px;
    border: 1px solid #b6c5aa;
    border-radius: 3px;
    background: #f7f5ed;
    box-shadow: 0 -5px 20px #34524420;
  }
  .editor-tools .editor-actions {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 0;
  }
}

@keyframes season-entry-breathe {
  0%, 62%, 100% {
    r: 57px;
    opacity: .25;
    stroke-width: 1.6;
  }
  28% {
    r: 65px;
    opacity: .65;
    stroke-width: 2.5;
  }
}

/* 编辑区三处提示共用同一排版，置于末尾以覆盖窄屏短屏字号。 */
.editor-shell .editor-instruction,
.editor-shell .creation-gestures,
.editor-shell .palette-hint {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 400;
  color: #567459;
  line-height: 1.4;
  letter-spacing: 0;
}

.gesture-list .poster-desktop-hint {
  display: none;
}

.poster-canvas:focus-visible {
  outline: 2px solid #42614b;
  outline-offset: 2px;
}

@media (any-pointer: fine) {
  .poster-touch-hint,
  .gesture-list .poster-touch-hint {
    display: none;
  }

  .gesture-list .poster-desktop-hint {
    display: block;
  }

  .poster-canvas.can-grab {
    cursor: grab;
  }

  .poster-canvas.is-dragging {
    cursor: grabbing;
  }
}
