@media (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.63fr);
    gap: 40px;
  }

  .hero h1 {
    font-size: clamp(3.9rem, 7vw, 6.2rem);
  }

  .hero-visual {
    min-height: 500px;
  }

  .ledger {
    grid-template-columns: 0.6fr 0.6fr 1.25fr;
  }

  .ledger-quote {
    display: none;
  }

  .ledger-note {
    border-right: 0;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .import-view-initial {
    grid-template-columns: 1fr 240px;
  }
}

@media (max-width: 980px) {
  .header-note,
  .header-rule {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.56fr);
  }

  .hero h1 {
    font-size: clamp(3.55rem, 7.3vw, 5.4rem);
  }

  .hero-intro br {
    display: none;
  }

  .hero-visual {
    min-height: 440px;
  }

  .cover-object {
    width: clamp(225px, 25vw, 285px);
  }

  .issue-stamp {
    right: -48px;
    width: 69px;
    height: 69px;
    font-size: 7px;
  }

  .hero-visual-label {
    display: none;
  }

  .hero-object::before {
    right: -19px;
  }

  .hero-object::after {
    right: -27px;
  }

  .hero-watermark {
    font-size: 210px;
  }

  .hero-caption {
    left: 10%;
  }

  .empty-shelf {
    grid-template-columns: 1fr 0.92fr;
    padding: 38px;
  }

  .empty-shelf-copy h3 {
    font-size: clamp(34px, 5.2vw, 48px);
  }

  .reader-footer {
    grid-template-columns: 80px minmax(240px, 1.8fr) 80px;
  }

  .reader-keys {
    display: none;
  }

  .reader-thumb-toggle span:last-child {
    display: none;
  }

  .import-view-initial {
    grid-template-columns: 1fr 240px;
  }
}

@media (max-width: 800px) {
  :root {
    --header-height: 72px;
  }

  .site-header {
    gap: 16px;
  }

  .privacy-note {
    display: none;
  }

  .shared-note {
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
  }

  .shared-note #sharedButtonLabel {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 55px;
    padding-bottom: 70px;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  .hero-copy {
    padding-left: 0;
  }

  .hero h1 {
    font-size: clamp(3.55rem, 11vw, 5.7rem);
  }

  .hero-visual {
    align-self: center;
    width: min(100%, 500px);
    min-height: 470px;
    margin-top: 12px;
  }

  .cover-object {
    width: min(61vw, 290px);
  }

  .hero-orbit {
    width: min(82vw, 440px);
    height: min(82vw, 440px);
  }

  .hero-caption {
    right: 3%;
    left: 12%;
  }

  .hero-perks {
    gap: 14px 22px;
    margin-top: 31px;
  }

  .ledger {
    grid-template-columns: 1fr 1fr;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .ledger-item {
    padding-right: 20px;
  }

  .ledger-item:nth-child(2) {
    border-right: 0;
  }

  .ledger-note {
    display: none;
  }

  .section-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .shelf-tools {
    justify-content: space-between;
  }

  .search-field {
    width: 100%;
  }

  .sort-field {
    flex: none;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 30px 20px;
  }

  .book-meta {
    padding-top: 13px;
  }

  .book-title {
    font-size: 18px;
  }

  .book-sub {
    font-size: 7px;
  }

  .book-quick {
    display: none;
  }

  .empty-shelf {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: clamp(30px, 6vw, 46px);
  }

  .empty-shelf::before {
    display: none;
  }

  .empty-shelf-copy h3 {
    font-size: clamp(37px, 8vw, 54px);
  }

  .empty-drop {
    min-height: 230px;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    gap: 24px;
  }

  .footer-meta {
    justify-content: flex-end;
  }

  .footer-manifesto {
    display: none;
  }

  .reader-bar {
    flex-basis: 66px;
    padding: 0 12px;
  }

  .reader-bar-left {
    gap: 10px;
  }

  .reader-mini-brand {
    display: none;
  }

  .reader-heading {
    padding-left: 10px;
  }

  .reader-heading h1 {
    max-width: 30vw;
    font-size: 15px;
  }

  .reader-heading p {
    display: none;
  }

  .reader-icon-button {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .reader-bar-tools {
    gap: 0;
  }

  .reader-zoom-group {
    gap: 0;
    margin-right: 2px;
    padding: 2px;
  }

  .reader-zoom-group .reader-icon-button {
    width: 28px;
    height: 28px;
  }

  .reader-zoom-level {
    min-width: 34px;
    font-size: 8px;
  }

  .book-corner {
    width: 52px;
    height: 52px;
  }

  /* 手机上单双页切换意义不大，留出位置给全文搜索 */
  .reader-fullscreen-button,
  .reader-bar-tools [data-reader="view"] {
    display: none;
  }

  .reader-stage {
    padding: 16px 44px 14px;
  }

  .reader-arrow {
    width: 32px;
    height: 64px;
    border-color: transparent;
    background: transparent;
  }

  .reader-arrow-prev {
    left: 4px;
  }

  .reader-arrow-next {
    right: 4px;
  }

  .reader-hint {
    display: none;
  }

  .reader-footer {
    flex-basis: 61px;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 0 16px;
  }

  .reader-footer-left {
    display: none;
  }

  .reader-scrubber {
    grid-column: 1;
    gap: 8px;
  }

  .reader-footer-right {
    grid-column: 2;
    gap: 6px;
  }

  .reader-page-label {
    font-size: 8px;
  }

  .reader-thumb-toggle {
    border: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    font-size: 16px;
  }

  .thumb-panel {
    width: min(330px, 92vw);
  }

  .modal[open] {
    padding: 14px;
    align-items: center;
  }

  .modal-search {
    padding-top: 7vh !important;
  }

  .modal-card,
  .import-card {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
  }

  .modal-head {
    padding: 23px 24px 19px;
  }

  .import-view {
    padding: 25px 24px;
  }

  .import-view-initial {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 260px;
  }

  .import-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 30px;
    padding-top: 0;
  }

  .aside-label {
    grid-column: 1 / -1;
  }

  .import-steps {
    gap: 12px;
  }

  .sample-button {
    margin-top: 0;
    align-self: start;
    padding-top: 2px;
    border-top: 0;
  }

  .import-view-ready {
    grid-template-columns: 150px 1fr;
    gap: 25px;
    min-height: 0;
    align-items: center;
    padding-top: 25px;
    padding-bottom: 28px;
  }

  .ready-cover {
    width: 142px;
  }

  .ready-cover-tape {
    width: 45px;
  }

  .cover-caption {
    font-size: 6px;
  }

  .import-form h3 {
    margin-bottom: 18px;
    font-size: 25px;
  }

  .field input {
    font-size: 21px;
  }

  .file-summary {
    margin-top: 17px;
  }

  .form-note {
    display: none;
  }

  .import-view-processing {
    grid-template-columns: 145px 1fr;
    gap: 26px;
    min-height: 0;
    padding-top: 28px;
    padding-bottom: 30px;
  }

  .processing-cover {
    width: 138px;
  }

  .processing-info h3 {
    font-size: 26px;
  }

  .processing-info > p:nth-of-type(1) {
    margin-bottom: 22px;
  }

  .progress-readout strong {
    font-size: 31px;
  }

  .processing-checklist {
    display: none;
  }

  .modal-footer {
    padding: 14px 24px;
  }

  .modal-footer-note {
    display: none;
  }

  .modal-footer-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .search-dialog-body,
  .modal-simple-body {
    padding: 22px 24px 25px;
  }

  .zoom-bar {
    padding: 12px 16px;
  }

  .zoom-bar h2 {
    font-size: 18px;
  }

  .zoom-tools {
    gap: 4px;
  }

  .zoom-tools > span {
    display: none;
  }

  .zoom-button {
    width: 33px;
    height: 33px;
  }

  .zoom-viewport {
    padding: 16px;
  }

  .zoom-note {
    display: none;
  }
}

@media (max-width: 560px) {
  :root {
    --page-gutter: 20px;
  }

  .site-header {
    gap: 10px;
    padding: 0 18px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-mark {
    width: 33px;
    height: 33px;
  }

  .brand-mark svg {
    width: 22px;
    height: 22px;
  }

  .site-header .btn {
    min-height: 37px;
    padding: 0 14px;
    gap: 7px;
    font-size: 10px;
  }

  .hero {
    padding-top: 44px;
    padding-bottom: 55px;
  }

  .eyebrow {
    margin-bottom: 20px;
    font-size: 8px;
    letter-spacing: 0.15em;
  }

  .eyebrow-rule {
    width: 28px;
  }

  .hero h1 {
    font-size: clamp(3.05rem, 14vw, 4.1rem);
    letter-spacing: -0.055em;
  }

  .hero-intro {
    margin-top: 25px;
    font-size: 12.5px;
    line-height: 1.9;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
  }

  .btn-large {
    width: 100%;
    justify-content: space-between;
    min-height: 52px;
  }

  .text-link {
    font-size: 11px;
  }

  .hero-perks {
    gap: 12px 17px;
    margin-top: 27px;
    padding-top: 18px;
  }

  .hero-perks li {
    font-size: 9px;
  }

  .hero-visual {
    min-height: 400px;
    margin-top: 7px;
  }

  .cover-object {
    width: min(66vw, 245px);
  }

  .hero-orbit {
    width: min(87vw, 370px);
    height: min(87vw, 370px);
  }

  .issue-stamp {
    right: -25px;
    bottom: -6px;
    width: 62px;
    height: 62px;
    font-size: 6.5px;
  }

  .hero-watermark {
    right: -28px;
    bottom: -25px;
    font-size: 170px;
  }

  .hero-caption {
    right: 0;
    bottom: -40px;
    left: 0;
    padding: 12px 14px;
  }

  .hero-caption strong {
    font-size: 16px;
  }

  .ledger-item strong {
    font-size: 27px;
  }

  .ledger-item > span:last-child {
    font-size: 9px;
  }

  .shelf-section {
    padding-top: 55px;
    padding-bottom: 60px;
  }

  .section-title-wrap {
    gap: 13px;
  }

  .section-index {
    padding-top: 5px;
    font-size: 8px;
  }

  .section-title-wrap h2 {
    font-size: 30px;
  }

  .section-title-wrap p {
    margin-top: 5px;
    font-size: 10px;
  }

  .library-content {
    margin-top: 28px;
  }

  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 17px;
  }

  .book-object::before {
    top: 6px;
    right: -5px;
    left: 7px;
  }

  .book-object::after {
    top: 11px;
    right: -9px;
    left: 10px;
  }

  .book-title {
    font-size: 16px;
  }

  .book-sub {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    font-size: 6.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .book-sub span + span::before {
    margin-right: 5px;
  }

  .book-sub span:last-child {
    display: none;
  }

  .book-progress {
    margin-top: 9px;
    font-size: 6px;
  }

  .book-menu {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    opacity: 1;
    transform: none;
    background: rgba(251, 247, 239, 0.78);
  }

  .book-badge {
    top: 8px;
    left: 8px;
  }

  .add-book {
    padding: 12px;
  }

  .add-book-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 11px;
    font-size: 17px;
  }

  .add-book strong {
    font-size: 16px;
  }

  .add-book span:last-child {
    display: none;
  }

  .empty-shelf {
    padding: 27px 22px;
  }

  .empty-shelf-copy h3 {
    font-size: 38px;
  }

  .empty-shelf-copy p {
    margin-top: 15px;
    font-size: 11px;
  }

  .empty-shelf-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-top: 22px;
  }

  .empty-drop {
    min-height: 205px;
    padding: 25px;
  }

  .empty-drop .document-glyph {
    width: 59px;
    height: 76px;
    margin-bottom: 18px;
  }

  .empty-drop strong {
    font-size: 21px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 32px;
  }

  .footer-meta {
    justify-content: flex-start;
  }

  .reader-bar {
    gap: 6px;
  }

  .reader-heading h1 {
    max-width: 26vw;
    font-size: 14px;
  }

  .back-button {
    width: 35px;
    height: 35px;
    margin-left: -2px;
  }

  .reader-icon-button {
    width: 32px;
    height: 32px;
  }

  .reader-stage {
    padding: 12px 34px;
  }

  .reader-arrow {
    width: 26px;
  }

  .reader-arrow-prev {
    left: 2px;
  }

  .reader-arrow-next {
    right: 2px;
  }

  .reader-footer {
    padding: 0 12px;
  }

  .scrubber-button {
    display: none;
  }

  .reader-footer-right {
    gap: 0;
  }

  .thumb-panel {
    width: 100%;
  }

  .thumb-panel-head {
    padding: 21px 21px 17px;
  }

  .thumb-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 13px;
    padding: 20px 21px 25px;
  }

  .thumb-note {
    padding: 14px 21px 18px;
  }

  .modal[open] {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card,
  .import-card {
    width: 100%;
    max-height: 94dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    animation: sheetUp 380ms var(--ease-out) both !important;
  }

  @keyframes sheetUp {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .modal-head {
    padding: 21px 20px 17px;
  }

  .modal-head h2 {
    font-size: 25px;
  }

  .modal-close {
    width: 33px;
    height: 33px;
  }

  .import-view {
    padding: 22px 20px;
  }

  .drop-zone {
    min-height: 225px;
    padding: 24px 16px;
  }

  .drop-icon {
    width: 61px;
    height: 77px;
    margin-bottom: 17px;
    font-size: 27px;
  }

  .drop-zone h3 {
    font-size: 24px;
  }

  .drop-zone small {
    margin-top: 12px;
    font-size: 8px;
  }

  .import-aside {
    display: block;
  }

  .aside-label {
    margin-bottom: 14px;
  }

  .import-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sample-button {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .import-view-ready {
    display: flex;
    flex-direction: column-reverse;
    gap: 24px;
    padding-top: 22px;
    padding-bottom: 24px;
  }

  .ready-cover-wrap {
    flex-direction: row;
    gap: 17px;
  }

  .ready-cover {
    width: 104px;
    flex: none;
  }

  .ready-cover-tape {
    width: 35px;
  }

  .cover-caption {
    margin: 0;
    max-width: 90px;
    line-height: 1.7;
  }

  .import-form {
    width: 100%;
  }

  .import-form h3 {
    font-size: 24px;
  }

  .import-view-processing {
    display: flex;
    flex-direction: column;
    gap: 23px;
    padding: 24px 20px 26px;
  }

  .processing-cover-wrap {
    flex-direction: row;
    gap: 16px;
  }

  .processing-cover {
    width: 97px;
    flex: none;
  }

  .processing-badge {
    right: -8px;
    bottom: 11px;
    padding: 6px 9px;
    font-size: 7px;
  }

  .processing-info {
    width: 100%;
  }

  .processing-info h3 {
    font-size: 25px;
  }

  .processing-info > p:nth-of-type(1) {
    margin-bottom: 19px;
  }

  .modal-footer {
    padding: 12px 20px;
  }

  .modal-footer-actions {
    gap: 7px;
  }

  .modal-footer .btn {
    min-height: 40px;
    padding: 0 16px;
    font-size: 10px;
  }

  .modal-footer.inline {
    padding: 0;
  }

  .shared-account-actions {
    flex-direction: column;
  }

  .shared-body {
    padding: 22px 22px 24px;
  }

  .modal-small .modal-card {
    max-height: 90dvh;
  }

  .modal-search {
    align-items: flex-end !important;
    padding-top: 0 !important;
  }

  /* 键盘弹出时面板高度由脚本收到可见区域内，卡片与结果列表都跟着缩；
     同时留出上方一条暗色区域，点一下就收起 */
  .modal-search .modal-card {
    max-height: 82%;
  }

  .search-dialog-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .search-dialog-field {
    flex: none;
  }

  .search-dialog-field input {
    font-size: 18px;
  }

  .search-results {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin-top: 16px;
    overscroll-behavior: contain;
  }

  /* 手机上一行结果要够高够大，才点得准 */
  .search-result {
    gap: 12px;
    min-height: 52px;
    padding: 14px 2px;
  }

  .search-result-page {
    width: 44px;
    font-size: 10px;
  }

  .search-result-text {
    font-size: 13px;
    line-height: 1.7;
  }

  .search-empty {
    padding: 28px 8px;
    font-size: 12px;
  }

  /* 结果只剩一条缝时优先保住输入框，别让标题把空间吃光 */
  .modal-search.is-keyboard-open .modal-head {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .modal-search.is-keyboard-open .modal-head h2 {
    font-size: 17px;
  }

  .modal-search.is-keyboard-open .modal-kicker {
    display: none;
  }

  .zoom-dialog {
    height: 100dvh;
  }

  .zoom-bar .modal-kicker {
    display: none;
  }

  .zoom-bar h2 {
    font-size: 16px;
  }

  .zoom-tools {
    gap: 2px;
  }

  .zoom-button {
    width: 31px;
    height: 31px;
    font-size: 14px;
  }

  .zoom-button.close {
    margin-left: 2px;
  }

  .zoom-viewport {
    padding: 12px;
  }

  .toast-root {
    bottom: 18px;
    width: calc(100vw - 28px);
  }

  .toast {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .flip-leaf {
    display: none;
  }
}
