:root { 
    --book:    #7a9ab5;
    --book-dk: #4f6587;
    --book-lt: #e8f0ff;
    --cream:   #f7f4ef; 
    --danger:  #f77b6e;
}

body { background-color: #f7f4ef; margin: 0; padding: 0; font-family: sans-serif; }

.margin-container { margin: 0 12px; }


/* ── 頁首圖片 ── */
.mybook-img-wrap {
    margin: 12px 0px 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}
.mybook-img-wrap img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

/* ── 說明卡片 ── */
.mybook-info-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #dcd0c5;
    padding: 16px;
    margin: 16px 0px 0px;
}
.hero-desc-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #374964;
    margin: 0 0 6px;
}

.hero-desc-title span {
    font-size: 1.1rem;
    color: #6f8bb3;
}

.hero-desc-text {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    padding-bottom: 6px;
}




/* ── 卡片容器 ── */
.library-shelf {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 0 36px;
}
.book-img-wrap + .library-shelf { padding-top: 16px; }

/* ── 新增單字本卡片 ── */

.add-book-card {
   background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(122,154,181,0.13);
    border: 1px solid #c8d4e0;
    overflow: hidden;
    padding: 16px 12px;
}

.add-book-inner {
    display: flex;
    align-items: center;
    gap: 16px;
   
}
.add-book-img {
    flex: 0 0 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
}
.add-book-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;  /* 加這行 */
}
.add-book-desc {
    font-size: 1.05rem;
    color: #777;
    line-height: 1.6;
}
.action-btn-row {
    display: flex;
    gap: 8px;
    align-items: center;
   
}
.add-book-btn {
    flex: 1.3;
    padding: 10px 0;
    border-radius: 14px;
    border: 1px solid #7a9ab5;
    background: var(--book);
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, transform 0.1s ease;
}
.add-book-btn:active { background: var(--book-dk); transform: scale(0.99); }
.secondary-btn {
    flex: 0.7;
    padding: 10px 0;
    border-radius: 12px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    color: #999;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, transform 0.1s ease;
}
.secondary-btn:active { background: #e8f0ff; transform: scale(0.99); }

/* ── 分頁列 ── */
.pagination-row {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px; padding: 4px 0;
}
.page-indicator { font-size: 0.95rem; font-weight: 700; color: #aaa; white-space: nowrap; }
.page-nav-btn {
    height: 40px; border-radius: 10px; border: 1.5px solid #c8d4e0;
    background: white; color: #376899; font-weight: 600; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0 14px;
    transition: background 0.15s ease, transform 0.1s ease;
}
.page-nav-btn:active { background: var(--book-lt); transform: scale(0.98); }

/* ── Modals ── */
.modal-overlay,
.mini-confirm-overlay,
.rename-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center; z-index: 9999;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}
.modal-overlay        { background: rgba(0,0,0,0.3); }
.mini-confirm-overlay { background: rgba(0,0,0,0.2); }
.rename-modal-overlay { background: rgba(0,0,0,0.3); }
.modal-overlay.open,
.mini-confirm-overlay.open,
.rename-modal-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

@keyframes popUp { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.modal-box {
    background: white; padding: 30px 25px; border-radius: 20px;
    width: 85%; max-width: 320px; text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); animation: popUp 0.2s ease-out;
}
.modal-box .lock-icon { font-size: 2.5rem; margin-bottom: 12px; }
.modal-box h3 { color: var(--book-dk); font-size: 1.3rem; margin: 0 0 10px; }
.modal-box p  { color: #666; font-size: 1rem; line-height: 1.6; margin: 0 0 20px; }
.modal-btns   { display: flex; gap: 10px; }
.btn-join  { flex: 1; padding: 12px; border-radius: 10px; border: none; background: var(--book); color: white; font-weight: bold; font-size: 1rem; cursor: pointer; transition: background 0.15s ease, transform 0.1s ease; }
.btn-close { flex: 1; padding: 12px; border-radius: 10px; border: none; background: #eee; color: #666; font-weight: bold; font-size: 1rem; cursor: pointer; transition: background 0.15s ease, transform 0.1s ease; }
.btn-join:active  { background: var(--book-dk); transform: scale(0.99); }
.btn-close:active { background: #e9e9e9; transform: scale(0.99); }

.mini-confirm-box {
    background: white; padding: 25px; border-radius: 15px;
    width: 80%; max-width: 280px; text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); border: 1px solid #f0f0f0;
    animation: popUp 0.2s ease-out;
}
.mini-confirm-box p  { font-size: 1.2rem; color: #333; margin: 0 0 25px; font-weight: bold; }
.mini-confirm-btns   { display: flex; gap: 12px; }
.mini-btn    { flex: 1; padding: 12px; border-radius: 10px; border: none; font-weight: bold; font-size: 1rem; cursor: pointer; transition: background 0.15s ease, transform 0.1s ease; }
.btn-cancel  { background: #eee; color: #666; }
.btn-confirm { background: var(--danger); color: white; }
.btn-cancel:active  { background: #e9e9e9; transform: scale(0.99); }
.btn-confirm:active { background: #fb887b; transform: scale(0.99); }

.rename-modal-box {
    background: white; padding: 28px 24px; border-radius: 20px;
    width: 85%; max-width: 320px; text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); animation: popUp 0.2s ease-out;
}
.rename-modal-box h3 { color: var(--book-dk); font-size: 1.3rem; margin: 0 0 16px; }
.rename-input {
    width: 100%; padding: 14px; border: 2px solid #eee; border-radius: 12px;
    font-size: 1.1rem; color: #444; outline: none; box-sizing: border-box;
    font-family: sans-serif; background: #fafafa; margin-bottom: 18px;
}
.rename-input:focus { border-color: var(--book); }
.rename-btns { display: flex; gap: 10px; }
.btn-rename-cancel  { flex: 1; padding: 12px; border-radius: 10px; border: none; background: #eee; color: #666; font-weight: bold; font-size: 1rem; cursor: pointer; transition: background 0.15s ease, transform 0.1s ease; }
.btn-rename-confirm { flex: 1; padding: 12px; border-radius: 10px; border: none; background: var(--book); color: white; font-weight: bold; font-size: 1rem; cursor: pointer; transition: background 0.15s ease, transform 0.1s ease; }
.btn-rename-cancel:active  { background: #e9e9e9; transform: scale(0.99); }
.btn-rename-confirm:active { background: var(--book-dk); transform: scale(0.99); }

/* ── 說明卡片 ── */
.info-card {
    background: #f6fbfe; border-radius: 14px;
    border: 2px solid #dce1ee; padding: 16px 20px;
    font-size: 1.15rem; color: #707c89; line-height: 30px;
    position: relative;
}
.info-card-title { font-size: 1.2rem; color: #526e8b; font-weight: 600; padding-bottom: 6px; }
.info-card-hide {
    position: absolute; top: 12px; right: 14px;
    font-size: 0.9rem; color: #aaa; cursor: pointer;
    border: 1px solid #ccc; border-radius: 14px;
    padding: 2px 10px; background: white;
}

/* ── 新版卡片內部結構 ── */
.book-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(122,154,181,0.13);
    border: 1px solid #c8d4e0;
    overflow: hidden;
    padding: 16px 12px;
}
.card-top-row {
    padding: 0 0 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.card-title-row {
    padding: 0px 30px 10px 0px;
}
.card-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374964;
    line-height: 1.5;
    word-break: break-word;
}
.card-msg {
    padding: 10px 0 4px;
    font-size: 1rem;
    color: #7b8e9e;
    line-height: 1.5;
}
.divider {
    height: 1px;
    background-color: #eee;
    width: 100%;
    margin: 0;
}
.card-actions-row {
    padding: 13px 0 0;
    display: flex;
    gap: 10px;
}
.btn-card {
    flex: 1; border: none; padding: 10px; border-radius: 12px;
    font-size: 1.05rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background 0.15s ease, transform 0.1s ease;
}
.btn-delete { background: #f9f9f9; color: #999; border: 1px solid #ccc; flex: 0.6; }
.btn-rename { background: #f9f9f9; color: #999; border: 1px solid #ccc; flex: 1; }
.btn-enter  { background: #e8f0ff; color: #4f6587; border: 1px solid #c8d8f0; flex: 1.4; }
.btn-delete:active { background: #e9e9e9; transform: scale(0.99); }
.btn-rename:active { background: #e9e9e9; transform: scale(0.99); }
.btn-enter:active  { background: #c8d8f0; transform: scale(0.99); }
.book-tag {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #6f82a1;
    flex-shrink: 0;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
}
.status-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 99px;
    white-space: nowrap;
}
.status-none  { background: #f0f0f0; color: #aaa; }
.status-doing { background: #fffcd5; color: #7c6b5b; border: 1px solid #c0b1a4; }
.status-done  { background: #d0e8e0; color: #3a7060; border: 1px solid #b0d4c8; }
.card-meta-count {
    font-size: 1rem;
    color: #777;
    font-weight: 600;
    white-space: nowrap;
}

.card-last-time {
    font-size: 0.85rem;
    color: #999;
    font-weight: 500;
    white-space: nowrap;
}