/* 비밀노트 서재 메인 컨테이너(Main Container) */
.aqm-library-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 헤더 영역(Header Section) */
.aqm-library-header {
    text-align: center;
    margin-bottom: 50px;
}
.aqm-library-title {
    font-size: 2.25rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}
.aqm-library-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    font-weight: 500;
}

/* 카드 그리드(Card Grid) */
.aqm-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

/* 등록된 도서가 없을 경우(Fallback Style) */
.aqm-no-books {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background-color: #f8fafc;
    border-radius: 24px;
    color: #94a3b8;
    font-weight: 600;
    border: 2px dashed #e2e8f0;
}

/* 도서 카드 스타일(Book Card Style) */
.aqm-book-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.aqm-book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
}

/* 도서 표지 영역(Book Cover Wrap) */
.aqm-book-cover-wrap {
    position: relative;
    width: 100%;
    padding-top: 62%; /* 16:10 비율(Ratio) 설정 */
    background: #f1f5f9;
    overflow: hidden;
}
.aqm-book-cover-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.aqm-book-card:hover .aqm-book-cover-img {
    transform: scale(1.05);
}

/* 기본 그라데이션 커버 스타일(Gradient Cover Style) */
.aqm-book-cover-default {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    box-sizing: border-box;
    color: #ffffff;
}
.aqm-book-cover-decor {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 16px;
    background: linear-gradient(to right, rgba(0,0,0,0.3) 0%, rgba(255,255,255,0.05) 50%, rgba(0,0,0,0.15) 100%);
    box-shadow: 1px 0 5px rgba(0,0,0,0.2);
}
.aqm-book-cover-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: #facc15;
    letter-spacing: 0.15em;
    border: 1px solid rgba(250, 204, 21, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    width: fit-content;
    background: rgba(0,0,0,0.2);
}
.aqm-book-cover-title {
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: -0.02em;
    word-break: keep-all;
    margin-top: 10px;
    margin-bottom: auto;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.aqm-book-cover-author {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

/* 카드 상세 정보 영역(Info Area) */
.aqm-book-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.aqm-book-meta {
    margin-bottom: 12px;
}
.aqm-chapter-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.aqm-book-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0 0 10px 0;
    line-height: 1.4;
}
.aqm-book-desc {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 24px 0;
    flex-grow: 1;
    word-break: keep-all;
}

/* 하단 액션 로우(Action Row) */
.aqm-book-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 18px;
    margin-top: auto;
}

.aqm-price-box {
    display: flex;
    flex-direction: column;
}
.aqm-price-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 2px;
}
.aqm-price-val {
    font-size: 1.15rem;
    font-weight: 900;
    color: #2563eb;
}
.aqm-status-owned {
    font-size: 0.85rem;
    font-weight: 800;
    color: #10b981;
    background-color: #ecfdf5;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
}

/* 버튼 공통 스타일(Button Common Style) */
.aqm-btn-read, .aqm-btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
}

/* 열기 버튼(Owned State) */
.aqm-btn-read {
    background-color: #10b981;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}
.aqm-btn-read:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3);
}

/* 구매 버튼(Not Owned State) */
.aqm-btn-buy {
    background-color: #0f172a;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}
.aqm-btn-buy:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
}

/* 미리보기 버튼 스타일(Preview Button Style) */
.aqm-btn-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.aqm-btn-preview:hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

/* 모바일 반응형(Mobile Responsive Grid) */
@media (max-width: 480px) {
    .aqm-book-grid {
        grid-template-columns: 1fr;
    }
    .aqm-library-title {
        font-size: 1.75rem;
    }
    .aqm-library-subtitle {
        font-size: 0.9rem;
    }
    .aqm-book-action-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .aqm-btn-group {
        width: 100%;
    }
    .aqm-btn-preview, .aqm-btn-buy, .aqm-btn-read {
        flex: 1;
        width: 100%;
    }
}
