/* ===== 小屋相册 Album（kawaii 暖色，与客厅一致）===== */

#albumPage {
    position: fixed;
    inset: 0;
    z-index: 61;                    /* 高于客厅浮层(60) */
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #fff8ef;            /* 奶油底 */
    color: #4a3b2a;
    box-sizing: border-box;
    overflow: hidden;
}

/* 顶部栏 */
.album-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: #fffdf8;
    border-bottom: 1px solid #f0e2cf;
    flex: 0 0 auto;
}
.album-back, .album-new, .album-detail-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border: none; background: transparent;
    color: #c98a2b; cursor: pointer; border-radius: 12px;
}
.album-back:hover, .album-new:hover, .album-detail-back:hover { background: #fbeed6; }
.album-title {
    flex: 1; margin: 0; font-size: 18px; font-weight: 700;
    color: #4a3b2a; text-align: center;
}
.album-new { color: #d98b2b; }

/* 列表视图 */
.album-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    align-content: start;
}
.album-card {
    display: flex; flex-direction: column;
    border: none; padding: 0; cursor: pointer;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(201, 138, 43, 0.12);
    transition: transform .12s ease, box-shadow .12s ease;
    text-align: left;
}
.album-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(201, 138, 43, 0.18); }
.album-card--default { outline: 2px solid #ffd591; }
.album-card-cover {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
    background: #fbeed6;
}
.album-card-cover--empty {
    width: 100%; aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    background: #fbeed6; color: #e0b878;
}
.album-card-cover--empty svg { width: 42px; height: 42px; }
.album-card-meta {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
}
.album-card-name {
    font-size: 14px; font-weight: 600; color: #4a3b2a;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.album-card-count {
    font-size: 12px; color: #b08a4f; background: #fbeed6;
    border-radius: 999px; padding: 2px 8px; margin-left: 6px; flex: 0 0 auto;
}

/* 详情视图 */
.album-detail {
    flex: 1 1 auto;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.album-detail-back {
    position: absolute; top: 14px; left: 16px; z-index: 2;
}
.album-detail-title {
    margin: 0; padding: 16px; padding-left: 60px;
    font-size: 18px; font-weight: 700; color: #4a3b2a;
    background: #fffdf8; border-bottom: 1px solid #f0e2cf;
}
.album-grid {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    align-content: start;
}
.album-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px; overflow: hidden;
    background: #fbeed6; cursor: pointer;
}
.album-cell-img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.album-cell-del {
    position: absolute; top: 4px; right: 4px;
    width: 26px; height: 26px; border: none; border-radius: 8px;
    background: rgba(74, 59, 42, 0.55); color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: opacity .12s ease;
}
.album-cell:hover .album-cell-del { opacity: 1; }
.album-cell-del svg { width: 15px; height: 15px; }

/* 图片缺失（已删除 / 签名失败 / 过期）占位 */
.album-cell-missing { background: #f3e7d3; cursor: default; }
.album-cell-missing .album-cell-img { display: none; }
.album-cell-missing .album-missing {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; color: #b08a4f; text-align: center; padding: 8px;
}
.album-cell-missing .album-missing svg { width: 26px; height: 26px; }
.album-cell-missing .album-missing span { font-size: 12px; line-height: 1.3; }

/* 上传浮动按钮 */
.album-fab {
    position: absolute; right: 18px; bottom: 18px;
    width: 54px; height: 54px; border: none; border-radius: 50%;
    background: linear-gradient(135deg, #ffcf7a, #f5a623);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(245, 166, 35, 0.4);
    z-index: 3;
}
.album-fab svg { width: 24px; height: 24px; }

/* 空状态 */
.album-empty {
    grid-column: 1 / -1;
    text-align: center; color: #b08a4f;
    padding: 48px 16px; font-size: 14px;
}

/* 新建相册弹窗 */
.album-new-modal { max-width: 320px; }
.album-new-modal .modal-input {
    width: 100%; box-sizing: border-box;
    padding: 10px 12px; border: 1px solid #f0e2cf; border-radius: 12px;
    font-size: 15px; background: #fffdf8; color: #4a3b2a;
}
.album-new-modal .modal-input:focus { outline: none; border-color: #ffd591; }

/* ===== 深色模式 ===== */
body.dark #albumPage,
[data-theme="dark"] #albumPage {
    background: #2a2433; color: #efe3f2;
}
body.dark .album-header,
[data-theme="dark"] .album-header {
    background: #322b3d; border-bottom-color: #453b54;
}
body.dark .album-title,
[data-theme="dark"] .album-title { color: #efe3f2; }
body.dark .album-back, body.dark .album-new, body.dark .album-detail-back,
[data-theme="dark"] .album-back, [data-theme="dark"] .album-new, [data-theme="dark"] .album-detail-back {
    color: #e0a85a;
}
body.dark .album-back:hover, body.dark .album-new:hover, body.dark .album-detail-back:hover,
[data-theme="dark"] .album-back:hover, [data-theme="dark"] .album-new:hover, [data-theme="dark"] .album-detail-back:hover {
    background: #3d3449;
}
body.dark .album-card,
[data-theme="dark"] .album-card { background: #362f44; box-shadow: 0 6px 16px rgba(0,0,0,0.3); }
body.dark .album-card:hover,
[data-theme="dark"] .album-card:hover { box-shadow: 0 10px 22px rgba(0,0,0,0.4); }
body.dark .album-card--default,
[data-theme="dark"] .album-card--default { outline-color: #5a4a2e; }
body.dark .album-card-cover,
[data-theme="dark"] .album-card-cover,
body.dark .album-card-cover--empty,
[data-theme="dark"] .album-card-cover--empty { background: #3d3449; }
body.dark .album-card-cover--empty,
[data-theme="dark"] .album-card-cover--empty { color: #7a6a55; }
body.dark .album-card-name,
[data-theme="dark"] .album-card-name { color: #efe3f2; }
body.dark .album-card-count,
[data-theme="dark"] .album-card-count { color: #c9b48f; background: #3d3449; }
body.dark .album-detail-title,
[data-theme="dark"] .album-detail-title { color: #efe3f2; background: #322b3d; border-bottom-color: #453b54; }
body.dark .album-cell,
[data-theme="dark"] .album-cell { background: #3d3449; }
body.dark .album-empty,
[data-theme="dark"] .album-empty { color: #c9b48f; }
body.dark .album-cell-missing,
[data-theme="dark"] .album-cell-missing { background: #3a3344; }
body.dark .album-cell-missing .album-missing,
[data-theme="dark"] .album-cell-missing .album-missing { color: #9a8aa8; }
body.dark .album-new-modal .modal-input,
[data-theme="dark"] .album-new-modal .modal-input {
    background: #322b3d; color: #efe3f2; border-color: #453b54;
}
