/* ==========================================================================
   拾卷 · 四大名著阅读空间
   responsive.css — 电脑、平板与手机端适配
   ========================================================================== */

/* ---------- 大屏微调 ---------- */
@media (min-width: 1440px) {
  .container {
    width: min(1240px, calc(100% - 80px));
  }

  .container--narrow {
    width: min(980px, calc(100% - 80px));
  }
}

/* ---------- 小桌面 / 横屏平板 ---------- */
@media (max-width: 1180px) {
  .hero-inner {
    grid-template-columns: 1fr 0.92fr;
    gap: 40px;
  }

  .hero-stat {
    padding: 0 22px;
  }

  .book-grid {
    gap: 20px;
  }

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

@media (max-width: 980px) {
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .book-grid .book-card {
    padding: 16px;
  }

  .book-grid .book-excerpt {
    -webkit-line-clamp: 2;
  }

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

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

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  :root {
    --header-h: 72px;
  }

  .container,
  .container--narrow {
    width: min(100% - 48px, 1180px);
  }

  .hero {
    padding: 58px 0 80px;
  }

  .hero-stat {
    padding: 0 20px;
  }

  .hero-name {
    font-size: clamp(62px, 8.6vw, 88px);
  }

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

  .cover-stage {
    width: min(390px, 94%);
    gap: 14px;
  }

  .hero-seal {
    width: 94px;
    height: 94px;
  }

  .section {
    padding: 78px 0;
  }

  .page-hero {
    padding: 48px 0 46px;
  }

  .footer-grid {
    gap: 36px;
    padding: 62px 0 46px;
  }

  .book-modal-grid {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 32px;
    padding: 0 34px 42px;
  }

  .philosophy-grid {
    gap: 20px;
  }
}

/* ---------- 平板 / 导航折叠 ---------- */
@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 96;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 10px 24px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
      visibility 0.3s;
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .nav-link {
    justify-content: flex-start;
    padding: 15px 8px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 15.5px;
  }

  .nav-link:last-child {
    border-bottom: 0;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.is-active {
    color: var(--accent-2);
  }

  .nav-link.is-active::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--accent);
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero {
    padding-bottom: 64px;
  }

  .hero-copy {
    max-width: 640px;
  }

  .hero-visual {
    min-height: 0;
    padding: 22px 0 30px;
  }

  .hero-visual::before {
    width: min(420px, 78%);
  }

  .hero-visual::after {
    width: min(330px, 62%);
  }

  .cover-stage {
    width: min(400px, 86%);
  }

  .hero-seal {
    right: max(4%, calc(50% - 250px));
    bottom: 4%;
  }

  .hero-note {
    left: max(2%, calc(50% - 245px));
  }

  .hero-scroll {
    display: none;
  }

  .hero-stats {
    max-width: 560px;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 36px 48px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-desc {
    max-width: 46ch;
  }

  .about-intro {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-visual {
    order: 2;
    max-width: 460px;
    margin: 0 auto;
  }

  .about-copy {
    order: 1;
  }

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

  .feature-card:last-child {
    grid-column: 1 / -1;
  }

  .page-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .page-hero-aside {
    align-items: flex-start;
    gap: 32px;
    padding-bottom: 0;
  }

  .page-hero-stat {
    text-align: left;
  }

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

  .impression {
    border-left: 1px solid rgba(246, 243, 236, 0.1);
  }

  .impression:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }

  .impression:nth-child(n + 3) {
    border-top: 1px solid rgba(246, 243, 236, 0.1);
  }

  .impression:first-child {
    padding-left: 0;
  }
}

/* ---------- 竖屏平板 ---------- */
@media (max-width: 860px) {
  .section-head {
    align-items: flex-start;
    gap: 18px;
  }

  .section-head .link-arrow {
    padding-top: 4px;
  }

  .essay-body {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .essay-band {
    padding: 78px 0 72px;
  }

  .book-modal-grid {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    padding: 0 28px 38px;
  }

  .char-grid {
    grid-template-columns: 1fr;
  }

  .quote-spotlight {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .spotlight-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .spotlight-actions .btn {
    min-width: 120px;
  }

  .about-facts {
    max-width: 560px;
  }

  .philosophy-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 平板 / 大手机 ---------- */
@media (max-width: 760px) {
  .container,
  .container--narrow {
    width: calc(100% - 40px);
  }

  .section {
    padding: 62px 0;
  }

  .section--tight {
    padding: 48px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
  }

  .section-head .link-arrow {
    padding-top: 0;
  }

  .section-title {
    font-size: clamp(27px, 6vw, 34px);
  }

  .hero {
    padding: 44px 0 52px;
  }

  .hero-eyebrow {
    margin-bottom: 20px;
    font-size: 10.5px;
  }

  .hero-name {
    font-size: clamp(58px, 14vw, 80px);
  }

  .hero-slogan {
    margin-top: 16px;
    font-size: 19px;
    letter-spacing: 0.1em;
  }

  .hero-lead {
    margin-top: 18px;
    font-size: 14.5px;
    line-height: 1.95;
  }

  .hero-actions {
    margin-top: 28px;
    gap: 10px;
  }

  .hero-actions .btn {
    flex: 1 1 150px;
  }

  .hero-stats {
    margin-top: 32px;
    padding-top: 22px;
  }

  .hero-stat {
    padding: 0 16px;
  }

  .hero-stat strong {
    font-size: 26px;
  }

  .hero-visual {
    padding: 12px 0 24px;
  }

  .hero-note {
    display: none;
  }

  .hero-seal {
    width: 82px;
    height: 82px;
    right: 2%;
    bottom: 1%;
  }

  .hero-seal-main {
    font-size: 17px;
  }

  .hero-seal-small {
    font-size: 7.5px;
  }

  .cover-stage {
    width: min(350px, 88%);
  }

  .note-grid,
  .note-grid--list {
    grid-template-columns: 1fr;
  }

  .quote-grid,
  .quote-grid--home {
    grid-template-columns: 1fr;
  }

  .quote-card {
    padding: 28px 24px 22px;
  }

  .quote-text {
    font-size: 19px;
  }

  .note-card {
    padding: 24px;
  }

  .note-card::before {
    left: 24px;
    right: 24px;
  }

  .page-hero {
    padding: 40px 0 38px;
  }

  .page-hero h1 {
    margin: 16px 0 12px;
    font-size: clamp(38px, 9vw, 50px);
  }

  .page-hero-aside {
    width: 100%;
    justify-content: flex-start;
    gap: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  .page-hero-stat strong {
    font-size: 28px;
  }

  .page-hero-mark {
    right: 2%;
    opacity: 0.04;
  }

  .toolbar {
    padding: 16px;
  }

  .toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .toolbar-group {
    justify-content: flex-start;
  }

  .toolbar-count {
    margin-left: 0;
    text-align: left;
  }

  .search-box {
    width: 100%;
    min-width: 0;
    flex-basis: 100%;
  }

  .toolbar-reset {
    margin-left: auto;
  }

  .book-modal-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 0 22px 32px;
  }

  .book-modal-cover {
    max-width: 196px;
    margin: 0 auto;
  }

  .book-modal-side-card {
    display: none;
  }

  .book-modal-main {
    padding-top: 0;
  }

  .book-modal-meta {
    justify-content: center;
  }

  .book-modal-title {
    text-align: center;
  }

  .book-modal-sub,
  .book-modal-author {
    justify-content: center;
    text-align: center;
  }

  .book-modal-author {
    gap: 6px 14px;
  }

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

  .note-reader {
    padding: 30px 0 10px;
  }

  .reader-top {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
  }

  .reader-title {
    font-size: clamp(29px, 7.5vw, 38px);
  }

  .reader-summary {
    margin-bottom: 30px;
    font-size: 14.5px;
  }

  .reader-content p {
    font-size: 15.5px;
    line-height: 2;
    margin-bottom: 20px;
  }

  .reader-insight {
    padding: 24px 22px;
    margin: 32px 0;
  }

  .reader-foot {
    margin-top: 34px;
    padding-top: 22px;
  }

  .reader-pager {
    flex-direction: column;
  }

  .pager-link {
    max-width: 100%;
  }

  .pager-link--next {
    text-align: left;
    margin-left: 0;
  }

  .note-form {
    padding: 0 22px 30px;
  }

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

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .quote-detail {
    padding: 0 24px 34px;
  }

  .quote-detail-text {
    font-size: clamp(23px, 6.2vw, 30px);
  }

  .quote-spotlight {
    padding: 28px 24px;
    border-radius: var(--radius);
  }

  .spotlight-text {
    font-size: clamp(21px, 5.6vw, 27px);
    margin: 16px 0 14px;
  }

  .spotlight-note {
    font-size: 12.5px;
  }

  .spotlight-actions {
    gap: 8px;
  }

  .spotlight-actions .btn {
    min-width: 0;
    flex: 1 1 120px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature-card:last-child {
    grid-column: auto;
  }

  .about-facts {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-fact {
    padding: 14px 14px 0;
  }

  .about-fact strong {
    font-size: 19px;
  }

  .about-copy .about-lead {
    font-size: 20px;
  }

  .philosophy-card {
    padding: 28px 24px;
  }

  .info-panel {
    padding: 28px 24px;
  }

  .about-cta {
    padding: 32px 26px;
  }

  .avatar-caption {
    right: 0;
    bottom: 2%;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 32px;
    padding: 52px 0 38px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 0 24px;
  }

  .essay-band {
    padding: 64px 0 56px;
  }

  .essay-body {
    margin-top: 34px;
  }

  .impression-grid {
    margin-top: 44px;
  }

  .quote-actions .icon-btn:last-child {
    margin-left: 0;
  }
}

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
  :root {
    --header-h: 64px;
  }

  .container,
  .container--narrow {
    width: calc(100% - 32px);
  }

  .brand {
    gap: 10px;
  }

  .brand-seal {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }

  .brand-name {
    font-size: 19px;
  }

  .brand-sub {
    font-size: 8.5px;
    letter-spacing: 0.13em;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .nav-toggle-line {
    width: 16px;
    margin-left: -8px;
  }

  .nav-toggle-line:nth-child(1) {
    top: 16px;
  }

  .nav-toggle-line:nth-child(2) {
    top: 22px;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1),
  .nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
    top: 19px;
  }

  .site-nav {
    padding: 8px 16px 20px;
  }

  .book-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .book-grid .book-card {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 16px;
    padding: 12px;
  }

  .book-grid .book-cover-wrap {
    height: 100%;
    aspect-ratio: auto;
  }

  .book-grid .book-cover img {
    object-position: center;
  }

  .book-grid .book-body {
    padding: 2px 0 0;
  }

  .book-grid .book-title {
    font-size: 21px;
  }

  .book-grid .book-excerpt {
    margin-top: 8px;
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .book-grid .book-progress {
    display: none;
  }

  .book-grid .book-foot {
    padding-top: 10px;
    border-top: 0;
  }

  .book-grid .book-foot .link-arrow {
    font-size: 12.5px;
  }

  .book-grid .book-card > .status-badge {
    top: 19px;
    left: 19px;
    padding: 3px 9px;
    font-size: 11px;
  }

  .hero-stats {
    gap: 0;
  }

  .hero-stat {
    padding: 0 14px;
    flex: 1;
  }

  .hero-stat:first-child {
    flex: 0 0 auto;
  }

  .hero-stat strong {
    font-size: 24px;
  }

  .hero-stat span {
    font-size: 9.5px;
    letter-spacing: 0.08em;
  }

  .hero-seal {
    width: 72px;
    height: 72px;
    right: 0;
  }

  .cover-stage {
    width: min(320px, 92%);
    gap: 11px;
  }

  .section {
    padding: 54px 0;
  }

  .section-title {
    font-size: 27px;
  }

  .section-desc {
    font-size: 13.5px;
  }

  .modal {
    padding: 0;
  }

  .modal-panel {
    width: 100%;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }

  .modal-bar {
    padding: 12px 12px 0;
  }

  .modal-panel--narrow {
    width: 100%;
  }

  .book-modal-grid {
    padding: 0 20px 30px;
  }

  .char-grid {
    grid-template-columns: 1fr;
  }

  .note-form {
    padding: 0 20px 26px;
  }

  .quote-detail {
    padding: 0 20px 28px;
  }

  .about-facts {
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 0;
  }

  .about-fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-left: 0 !important;
  }

  .about-fact:first-child {
    padding-left: 0;
  }

  .about-fact span {
    margin-top: 0;
  }

  .page-hero-aside {
    gap: 24px;
  }

  .page-hero-stat strong {
    font-size: 25px;
  }

  .toolbar {
    padding: 14px;
  }

  .chip-row {
    gap: 6px;
  }

  .chip {
    min-height: 33px;
    padding: 0 12px;
    font-size: 12px;
  }

  .quote-card {
    padding: 26px 20px 20px;
  }

  .quote-text {
    font-size: 18.5px;
  }

  .essay-quote {
    padding-left: 20px;
  }

  .essay-quote p {
    font-size: 21px;
  }

  .impression-grid {
    grid-template-columns: 1fr;
  }

  .impression {
    border-left: 0 !important;
    border-top: 1px solid rgba(246, 243, 236, 0.1);
    padding: 22px 0;
  }

  .impression:first-child {
    border-top: 0;
  }

  .impression p {
    -webkit-line-clamp: 3;
  }

  .impression-arrow {
    margin-top: 2px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 44px 0 32px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-col h4 {
    margin-bottom: 10px;
  }

  .footer-col a {
    padding: 4px 0;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }

  .toast {
    bottom: 20px;
    padding: 10px 18px;
    font-size: 12.5px;
  }

  .note-card {
    padding: 22px 20px;
  }

  .note-card::before {
    left: 20px;
    right: 20px;
  }

  .note-card h3 {
    font-size: 19px;
  }

  .note-card-tools {
    opacity: 1;
  }

  .note-card--custom .note-card-top {
    padding-right: 62px;
  }

  .quote-detail-text {
    margin: 20px 0;
  }

  .quote-detail-note {
    padding: 20px;
  }

  .reader-insight {
    padding: 22px 18px;
  }

  .reader-foot {
    align-items: flex-start;
  }

  .about-cta {
    padding: 28px 22px;
  }

  .about-cta .btn-row {
    width: 100%;
  }

  .about-cta .btn {
    flex: 1 1 140px;
  }
}

@media (max-width: 480px) {
  .hero-seal {
    display: none;
  }
}

@media (max-width: 420px) {
  .hero-name {
    font-size: 58px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    flex-basis: auto;
    width: 100%;
  }

  .hero-stat {
    padding: 0 10px;
  }

  .hero-stat strong {
    font-size: 22px;
  }

  .hero-stat span {
    font-size: 8.5px;
  }

  .cover-stage {
    width: 96%;
  }

  .hero-seal {
    width: 64px;
    height: 64px;
  }

  .hero-seal-main {
    font-size: 15px;
  }

  .hero-seal-small {
    font-size: 6.5px;
    letter-spacing: 0.1em;
  }

  .book-grid .book-card {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 13px;
  }

  .book-grid .book-title {
    font-size: 19px;
  }

  .book-grid .book-cat {
    font-size: 9.5px;
  }

  .note-card-top {
    flex-wrap: wrap;
  }

  .note-card-tools {
    top: 14px;
    right: 14px;
  }

  .page-hero h1 {
    font-size: 36px;
  }

  .page-hero-aside {
    gap: 18px;
  }

  .quote-spotlight {
    padding: 24px 18px;
  }

  .spotlight-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .spotlight-actions .btn {
    flex-basis: auto;
    width: 100%;
  }

  .about-facts {
    margin-top: 24px;
  }

  .footer-grid {
    gap: 24px;
  }

  .reader-meta {
    gap: 8px 12px;
    font-size: 11.5px;
  }

  .reader-title {
    font-size: 27px;
  }

  .reader-actions {
    width: 100%;
  }
}
