[v-cloak] { display: none !important; }

:root {
    --books-page-width: 1240px;
    --books-ink: #252421;
    --books-muted: #777167;
    --books-paper: #f7f3ea;
    --books-line: #ded6c8;
    --books-accent: #7a4437;
}

.books-page {
    background: #faf9f6;
    color: #2d2a26;
}

.books-page-width {
    width: min(var(--books-page-width), 90%);
    margin: 0 auto;
}

.books-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #ddd7cc;
    background: linear-gradient(to bottom, #fdfcf9, #f4f0e8);
}

.books-hero-ink {
    position: absolute;
    inset: auto 0 0;
    height: 125px;
    opacity: .10;
    background: url("/images/ink-mountain.webp") center bottom / cover no-repeat;
    pointer-events: none;
}

.books-hero-inner {
    position: relative;
    z-index: 1;
    width: min(1420px, 96%);
    min-height: 300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(480px, 1.45fr) minmax(190px, 1fr);
    align-items: end;
    gap: 20px;
}

.books-hero-art {
    height: 255px;
    display: flex;
    align-items: flex-end;
    opacity: .63;
    filter: grayscale(1);
}

.books-hero-art-left { justify-content: flex-start; }
.books-hero-art-right { justify-content: flex-end; }

.books-hero-art img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.books-hero-copy {
    align-self: center;
    padding: 42px 20px 52px;
    text-align: center;
}

.books-breadcrumb {
    margin-bottom: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
    color: #8a8378;
    font-size: 12px;
}

.books-breadcrumb a { color: inherit; text-decoration: none; }

.books-eyebrow {
    margin: 0 0 7px;
    color: #8a7b6d;
    font-family: Georgia, serif;
    font-size: 11px;
    letter-spacing: .26em;
}

.books-hero-copy h1 {
    margin: 0;
    font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
    font-size: 50px;
    letter-spacing: .18em;
    color: #1f1e1b;
}

.books-title-rule {
    margin: 16px auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #6c655b;
}

.books-title-rule span { width: 62px; height: 1px; background: #9c958a; }
.books-title-rule b { font-size: 13px; font-weight: 500; }

.books-hero-copy > p:last-child {
    max-width: 620px;
    margin: 0 auto;
    color: #59544d;
    font-size: 15px;
    line-height: 1.9;
}

.books-library {
    padding: 64px 0 80px;
    background:
        linear-gradient(rgba(255,255,255,.90), rgba(255,255,255,.90)),
        url("/images/paper-texture.webp");
}

.books-section-heading {
    margin-bottom: 34px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--books-line);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.books-section-heading h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: .09em;
}

.books-section-heading > p {
    margin: 0 0 3px;
    color: var(--books-muted);
    font-size: 13px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 215px));
    justify-content: start;
    align-items: start;
    gap: 34px 30px;
}

.book-card {
    min-width: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: none;
    transition: transform .2s ease;
}

.book-card:hover {
    transform: translateY(-3px);
}

/* 封面即卡片寬度，不再用大面積米色展示框包住封面。 */
.book-cover-wrap {
    position: relative;
    width: 100%;
    padding: 0;
    display: block;
    background: #f3efe7;
    border: 1px solid #ded7cb;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 5px 16px rgba(67, 55, 39, .055);
    transition: box-shadow .2s ease, border-color .2s ease;
}

.book-card:hover .book-cover-wrap {
    border-color: #cfc5b7;
    box-shadow: 0 12px 28px rgba(67, 55, 39, .12);
}

.book-cover {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
    box-shadow: none;
}

.book-cover-placeholder {
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 2 / 3;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: linear-gradient(135deg, #ede2cf, #f8f3e9);
    color: #3e352c;
    text-align: center;
}

.book-cover-placeholder span {
    font-size: 10px;
    letter-spacing: .2em;
    color: #7d6f60;
}

.book-cover-placeholder strong {
    margin: 14px 0;
    font-size: 18px;
    line-height: 1.55;
    letter-spacing: .08em;
}

.book-cover-placeholder small { color: #7d7165; }

.book-access-badge {
    position: absolute;
    top: 10px;
    right: 9px;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 999px;
    background: rgba(42, 39, 35, .84);
    color: #fff;
    font-size: 10px;
    letter-spacing: .02em;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.book-access-public { background: rgba(94, 104, 76, .88); }

/* 已具完整閱讀資格時，不再顯示試讀或會員門檻，統一標示為已解鎖。 */
.book-access-unlocked {
    background: rgba(74, 104, 76, .92);
    border-color: rgba(255, 255, 255, .72);
}

.book-preview-badge {
    position: absolute;
    top: 10px;
    left: 9px;
    z-index: 2;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.68);
    border-radius: 999px;
    background: rgba(153, 79, 60, .92);
    color: #fff;
    font-size: 10px;
    letter-spacing: .08em;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.book-card-body {
    padding: 10px 12px 11px;
    border-top: 0;
    background: transparent;
}

.book-card-type {
    margin-bottom: 4px;
    color: #8a725e;
    font-size: 9px;
    letter-spacing: .12em;
}

.book-card h3 {
    margin: 0 0 3px;
    color: #26231f;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: .01em;
}

.book-subtitle {
    margin: 0 0 5px;
    color: #6b6258;
    font-size: 11px;
    line-height: 1.45;
}

/* 保留介紹，但只露出少量文字，避免書目變成資訊卡。 */
.book-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    min-height: 0;
    margin: 0;
    color: #766e64;
    font-size: 10px;
    line-height: 1.5;
}

.book-meta {
    margin-top: 7px;
    padding-top: 6px;
    border-top: 1px solid #eee7dc;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #91887d;
    font-size: 9px;
}

.book-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
}

.book-card-actions.single {
    grid-template-columns: 1fr;
}

.book-open-button,
.book-read-button {
    width: 100%;
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid #766d63;
    font-family: inherit;
    font-size: 10px;
    letter-spacing: .04em;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.book-open-button {
    background: transparent;
    color: #49423a;
}

.book-open-button:hover {
    border-color: #332f2a;
    background: #332f2a;
    color: #fff;
}

.book-read-button {
    border-color: #735044;
    background: #735044;
    color: #fff;
}

.book-read-button:hover {
    border-color: #4f362e;
    background: #4f362e;
}

.book-open-button span,
.book-read-button span {
    margin-left: 3px;
    font-size: 12px;
}

.books-state,
.books-empty {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #7d756a;
}

.books-loading-mark,
.books-empty-mark {
    width: 54px;
    height: 54px;
    margin-bottom: 17px;
    border: 1px solid #90867b;
    display: grid;
    place-items: center;
    color: #5f574f;
    font-size: 18px;
    transform: rotate(-2deg);
}

.books-empty h2 { margin: 0 0 12px; color: #403a33; font-size: 27px; }
.books-empty p { max-width: 620px; margin: 0; line-height: 1.9; }
.books-empty code { padding: 2px 5px; background: #eee8de; }
.books-state-error { color: #944738; }

.books-note-section {
    padding: 46px 0;
    border-top: 1px solid #e0d8cb;
    background: #f0ebe2;
}

.books-note-inner {
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 45px;
}

.books-note-inner h2 { margin: 0; font-size: 24px; line-height: 1.6; }
.books-note-inner > p { margin: 0; color: #6f675e; line-height: 1.9; font-size: 14px; }

.books-toast {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    max-width: min(520px, 88vw);
    padding: 12px 18px;
    background: rgba(37, 34, 30, .94);
    color: #fff;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(185px, 205px));
        gap: 28px 24px;
    }
    .books-hero-inner { grid-template-columns: 190px minmax(0,1fr) 190px; }
    .books-hero-art { height: 210px; }
}

@media (max-width: 760px) {
    .books-hero-inner { grid-template-columns: 1fr; min-height: 260px; }
    .books-hero-art { display: none; }
    .books-hero-copy { padding: 45px 18px 55px; }
    .books-hero-copy h1 { font-size: 38px; }
    .books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        gap: 24px 16px;
    }
    .books-section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .books-note-inner { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: minmax(0, 230px);
        justify-content: center;
    }
}
