:root {
  --siv-zh-serif: "SivSerif", "Songti SC", "STSongti-SC-Regular", STSong, "Noto Serif CJK SC", "Source Han Serif SC", serif;
}
:lang(zh), [lang^="zh"] { font-synthesis: none; }
html[lang^="zh"] body { font-family: var(--siv-zh-serif); }
button, a, [role="button"] { -webkit-tap-highlight-color: transparent; }
.siv-offscreen, .siv-offscreen * { animation-play-state: paused !important; }
html.siv-page-hidden *, html.siv-page-hidden *::before, html.siv-page-hidden *::after { animation-play-state: paused !important; }

body[data-siv-site="weddings"] .play-button,
body[data-siv-site="weddings"] .case-film-play > span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  line-height: 0;
}
body[data-siv-site="weddings"] .play-button .siv-ui-icon,
body[data-siv-site="weddings"] .case-film-play > span .siv-ui-icon {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  vertical-align: 0;
}

body[data-siv-site="photography"] .book-controls > button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  line-height: 0;
}
body[data-siv-site="photography"] .book-controls > button .siv-ui-icon {
  display: block;
  margin: 0;
}

@media (min-width: 701px) {
  body[data-siv-site="legless-birds"] .reader-stage {
    inset: 68px 0 48px;
  }
  /* PageFlip derives height from spread width. Cap that width so the scaled
     1040:738 spread also fits between the stage's vertical padding. */
  body[data-siv-site="legless-birds"] .flipbook-shell {
    max-width: calc(154.4dvh - 195px);
  }
}

@media (hover: none) and (pointer: coarse) {
  button:focus:not(:focus-visible), a:focus:not(:focus-visible), [role="button"]:focus:not(:focus-visible) {
    outline: 0 !important;
    box-shadow: none !important;
  }
}

@media (max-width: 700px) {
  body[data-siv-site="travel-proposal"] .hero-copy h1 {
    max-width: 9em;
    font-family: var(--siv-zh-serif);
    font-size: clamp(46px, 15vw, 68px);
    letter-spacing: -.055em;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  body[data-siv-site="legless-birds"] .arrival { min-height: 100svh; }
  body[data-siv-site="legless-birds"] .arrival-copy {
    min-height: 36svh;
    padding-bottom: 8px;
  }
  body[data-siv-site="legless-birds"] .arrival h1 span { font-size: clamp(48px,15vw,62px); }
  body[data-siv-site="legless-birds"] .book-stage { min-height: 64svh; margin-top: 0; }
  body[data-siv-site="legless-birds"] .arrival-actions {
    top: auto;
    bottom: max(16px,env(safe-area-inset-bottom));
  }
  body[data-siv-site="legless-birds"] .stage-hint {
    right: 18px;
    left: 18px;
    bottom: 52px;
    text-align: center;
    white-space: nowrap;
  }
  body[data-siv-site="legless-birds"] .design-note { content-visibility: visible; }
  body[data-siv-site="legless-birds"] .design-note-book,
  body[data-siv-site="legless-birds"] .design-note-image,
  body[data-siv-site="legless-birds"] .design-note-image img {
    display: block;
    visibility: visible;
    content-visibility: visible;
  }
  body[data-siv-site="legless-birds"] .reader-header,
  body[data-siv-site="legless-birds"] .reader-footer { background: rgba(22,24,18,.82); }
  body[data-siv-site="legless-birds"] .reader-stage {
    inset: 60px 0 50px;
    padding: 4px 8px 52px;
    overflow: visible;
  }
  body[data-siv-site="legless-birds"] .flipbook-shell {
    width: 100%;
    height: 100%;
    transform: scale(.74);
  }
  body[data-siv-site="legless-birds"] .page-flip-book { max-width: 100%; max-height: 100%; }
  body[data-siv-site="legless-birds"] .page-arrow {
    z-index: 40;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  body[data-siv-site="legless-birds"] .stf__parent,
  body[data-siv-site="legless-birds"] .stf__block,
  body[data-siv-site="legless-birds"] .stf__item,
  body[data-siv-site="legless-birds"] .flip-page {
    backface-visibility: hidden;
    transform-style: preserve-3d;
    will-change: transform;
  }
  body[data-siv-site="legless-birds"] .flip-page img { transform: translateZ(0); }

  body[data-siv-site="wanqian"] .object-shadow,
  body[data-siv-site="wanqian"] .object-halo { display: none; }
  body[data-siv-site="wanqian"] #calendarCanvas { filter: none; }
  body[data-siv-site="wanqian"] .callout { box-shadow: none; backdrop-filter: none; }
  html.mobile-calendar-2d body[data-siv-site="wanqian"] #calendarCanvas,
  body[data-siv-site="wanqian"] .drag-hint { display: none !important; }
  html:not(.mobile-calendar-2d) body[data-siv-site="wanqian"] .mobile-calendar-viewport { display: none !important; }
  body[data-siv-site="wanqian"] .mobile-calendar-viewport {
    position: absolute;
    inset: 12svh 0 8svh;
    overflow: hidden;
    pointer-events: auto;
    touch-action: pan-y;
    outline: none;
  }
  body[data-siv-site="wanqian"] .mobile-calendar-rail {
    position: absolute;
    inset: 0 0 58px;
    overflow: hidden;
  }
  body[data-siv-site="wanqian"] .mobile-calendar-sheet {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(74vw, 304px);
    aspect-ratio: 919 / 1024;
    margin: 0;
    overflow: hidden;
    background: #e8e6df;
    border: 1px solid rgba(207,182,106,.28);
    box-shadow: 0 14px 24px rgba(0,0,0,.22);
    opacity: .38;
    transition: transform .3s cubic-bezier(.22,.75,.25,1),opacity .3s ease;
    will-change: transform;
  }
  body[data-siv-site="wanqian"] .mobile-calendar-sheet.is-current { opacity: 1; }
  body[data-siv-site="wanqian"] .mobile-calendar-sheet img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .16s ease;
  }
  body[data-siv-site="wanqian"] .mobile-calendar-sheet.is-loaded img { opacity: 1; }
  body[data-siv-site="wanqian"] .mobile-calendar-sheet > span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    color: #6d706f;
    font: 600 8px/1 var(--integration-mono,"Courier New",monospace);
    letter-spacing: .14em;
  }
  body[data-siv-site="wanqian"] .mobile-calendar-sheet.is-loaded > span { display: none; }
  body[data-siv-site="wanqian"] .mobile-calendar-controls {
    position: absolute;
    z-index: 3;
    left: 18px;
    right: 18px;
    bottom: 2px;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 14px;
  }
  body[data-siv-site="wanqian"] .mobile-calendar-controls button {
    width: 42px;
    height: 42px;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: inherit;
    background: rgba(243,241,235,.1);
    font: 18px/1 var(--siv-zh-serif,serif);
    touch-action: manipulation;
  }
  body[data-siv-site="wanqian"] .mobile-calendar-controls button:disabled { opacity: .24; }
  body[data-siv-site="wanqian"] .mobile-calendar-controls p {
    margin: 0;
    text-align: center;
    font: 600 8px/1.4 var(--integration-mono,"Courier New",monospace);
    letter-spacing: .12em;
  }

  body[data-siv-site="zhiyuan"] .hero h1 {
    width: 100%;
    max-width: 100%;
    font-family: var(--siv-zh-serif);
    font-size: clamp(34px, 8.6vw, 42px);
    line-height: 1.34;
    overflow-wrap: anywhere;
  }
  body[data-siv-site="zhiyuan"] .hero h1 em {
    display: block;
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
  }
  body[data-siv-site="zhiyuan"] .dn-model { display: block !important; }
  body[data-siv-site="zhiyuan"] .process-dieline img,
  body[data-siv-site="zhiyuan"] .process-views img,
  body[data-siv-site="zhiyuan"] .form-study img {
    width: 100%;
    height: auto;
    object-fit: contain !important;
  }

  body[data-siv-site="weddings"] .close-detail,
  body[data-siv-site="weddings"] #closeLightbox,
  body[data-siv-site="weddings"] #closeExplore {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    border: 0 !important;
    outline: 0;
    box-shadow: none !important;
  }
  body[data-siv-site="weddings"] .case-image { background: #eceae4; }
  body[data-siv-site="weddings"] .case-image img { content-visibility: auto; }
  body[data-siv-site="weddings"] .film-tag,
  body[data-siv-site="weddings"] .case-film-play > span { font-family: Arial, sans-serif !important; }
  body[data-siv-site="weddings"] .play-button .siv-ui-icon,
  body[data-siv-site="weddings"] .case-film-play > span .siv-ui-icon {
    transform: translate(-1.5px, 1px);
  }
  body[data-siv-site="photography"] .camera-prop {
    left: 50% !important;
    width: min(100vw, 430px) !important;
    max-width: 100vw;
    transform: translateX(-50%) !important;
    overflow: visible;
  }
  body[data-siv-site="photography"] #cameraCanvas { width: 100% !important; max-width: 100vw; }
  body[data-siv-site="photography"] .preview-stage { aspect-ratio: auto; min-height: 0; }
  body[data-siv-site="photography"] .preview-stage img { object-fit: contain; max-height: calc(100svh - 150px); }
  body[data-siv-site="photography"] .album-skill-frame { max-width: 100%; max-height: 100%; }
  body[data-siv-site="photography"] .story-nav [data-story-close] {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 13px;
    border: 1px solid currentColor !important;
    border-radius: 999px;
    box-shadow: none !important;
    outline: 0 !important;
  }
  body[data-siv-site="photography"] .book-dialog button:focus:not(:focus-visible),
  body[data-siv-site="photography"] .image-dialog button:focus:not(:focus-visible) { outline: 0 !important; }
  body[data-siv-site="photography"] #closeBook {
    padding: 10px 14px;
    border: 1px solid #5b6255;
    border-radius: 999px;
    background: #5b6255;
    color: #f2eee3;
    opacity: 1;
    outline: 0 !important;
    box-shadow: none !important;
  }

  dialog::backdrop,
  .chapter-panel,
  .callout,
  .siv-return,
  .viewer-toolbar,
  .viewer-status,
  .book-controls { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  img { content-visibility: auto; }
}

