/* Shared styles for inner pages */

/* 通用隐藏类 — 这个必须存在，否则 JS 的 classList.add('hidden') 没有效果 */
.hidden { display: none !important; }

.nav.scrolled {
    background: rgba(253, 248, 246, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--border);
}

.nav-link.active {
    background: var(--rose-pale);
    color: var(--rose-dark);
    font-weight: 500;
}

.page-main {
    min-height: 100vh;
    padding-top: calc(var(--nav-h) + 60px);
    padding-bottom: 80px;
}

.page-header {
    max-width: 700px;
    margin: 0 auto 64px;
    padding: 0 24px;
    text-align: center;
}

.page-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.page-title {
    font-family: var(--font-serif);
    font-size: clamp(32px, 5vw, 52px);
    color: var(--text);
    margin-bottom: 12px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

/* Coming soon placeholder */
.coming-soon {
    max-width: 440px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.coming-soon-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.coming-soon h2 {
    font-family: var(--font-serif);
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text);
}

.coming-soon p {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 15px;
}

/* ============================================================
   Page Content Container
   ============================================================ */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Form Card ── */
.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
}
.form-card-title {
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--text);
    margin-bottom: 20px;
}
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.form-row .form-input {
    flex: 1;
    min-width: 140px;
}
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text);
    background: var(--cream);
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease);
    resize: vertical;
    min-height: 80px;
}
.form-textarea:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px var(--rose-light);
}

/* ── Grid / List ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; display: block; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* ── Notes ── */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.note-card {
    background: linear-gradient(135deg, #FFFBEE 0%, #FFF0C8 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform var(--ease), box-shadow var(--ease);
    min-height: 120px;
    display: flex;
    flex-direction: column;
}
.note-card:hover {
    transform: translateY(-4px) rotate(-0.5deg);
    box-shadow: var(--shadow-md);
}
.note-card-pin {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: radial-gradient(circle at 35% 35%, #D4878F, #9B5C63);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.note-card-pin::after {
    content: '';
    position: absolute;
    top: 4px; left: 50%;
    transform: translateX(-50%);
    width: 6px; height: 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
}
.note-card-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    flex: 1;
    word-break: break-word;
    white-space: pre-wrap;
    margin-top: 8px;
}
.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(155, 92, 99, 0.15);
}
.note-card-date {
    font-size: 11px;
    color: var(--text-muted);
}
.note-card-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all var(--ease);
}
.note-card-del:hover {
    background: rgba(212, 135, 143, 0.15);
    color: var(--rose-dark);
}

/* ── Diary ── */
.diary-list {}
.diary-entry {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--ease);
}
.diary-entry:hover {
    box-shadow: var(--shadow-md);
}
.diary-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}
.diary-entry-date {
    font-size: 13px;
    color: var(--rose);
    font-weight: 500;
    white-space: nowrap;
}
.diary-entry-title {
    font-family: var(--font-serif);
    font-size: 20px;
    color: var(--text);
    flex: 1;
}
.diary-entry-content {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.4s ease;
    cursor: pointer;
}
.diary-entry-content.expanded {
    max-height: none;
}
.diary-entry-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ── Timeline ── */
.timeline {
    position: relative;
    padding-left: 40px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--rose-light), var(--rose));
    border-radius: 2px;
}
.timeline-item {
    position: relative;
    margin-bottom: 28px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--ease);
}
.timeline-item:hover {
    box-shadow: var(--shadow-md);
}
.timeline-item::before {
    content: '♡';
    position: absolute;
    left: -32px;
    top: 20px;
    width: 32px;
    height: 32px;
    background: var(--white);
    border: 2px solid var(--rose-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--rose);
    box-shadow: 0 0 0 4px var(--cream);
}
.timeline-item-date {
    font-size: 12px;
    color: var(--rose);
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.timeline-item-title {
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
}
.timeline-item-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}
.timeline-item-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ── Photos Gallery — 瀑布流 ── */
.photo-grid {
    columns: 3 160px;
    column-gap: 12px;
}
.photo-card {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 12px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--rose-pale);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.photo-card img {
    width: 100%;
    height: auto;
    display: block;
    min-height: 80px;
    transition: transform 0.4s ease;
}
.photo-card:hover img {
    transform: scale(1.04);
}
.photo-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 28px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    opacity: 0;
    transition: opacity var(--ease);
}
.photo-card:hover .photo-card-overlay { opacity: 1; }
.photo-card-desc {
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ── Toast 提示 ── */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: rgba(44, 26, 26, 0.88);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    backdrop-filter: blur(10px);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
    pointer-events: auto;
    box-shadow: var(--shadow-md);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(20px); }
}

/* ── Lightbox ── */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 24px;
}
.lightbox.open {
    opacity: 1;
    pointer-events: auto;
}
.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 22px;
    cursor: pointer;
    transition: background var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ── Albums Page ── */
.albums-content { max-width: 1100px; }

.album-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: 14px;
}
.bc-item { color: var(--text-muted); }
.bc-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--rose);
    padding: 0;
    transition: color var(--ease);
}
.bc-link:hover { color: var(--rose-dark); text-decoration: underline; }
.bc-current { color: var(--text); font-weight: 500; }
.bc-sep { color: var(--border); font-size: 16px; }

.album-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.toolbar-left { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-sm { padding: 9px 18px; font-size: 13px; }
.btn-danger {
    background: #E57373;
    color: #fff;
    box-shadow: 0 4px 12px rgba(229, 115, 115, 0.3);
}
.btn-danger:hover { background: #C62828; transform: translateY(-1px); }
.btn-danger:disabled { opacity: 0.45; pointer-events: none; }

.select-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 18px;
    background: var(--rose-pale);
    border: 1px solid var(--rose-light);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}
.select-count { font-size: 14px; font-weight: 500; color: var(--rose-dark); }

.section-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
    margin-top: 8px;
}

/* ── View Mode Switcher ── */
.photos-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.photos-section-head .section-label { margin-bottom: 0; }
.view-modes { display: flex; gap: 5px; }
.vmb {
    width: 34px; height: 34px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    background: var(--white);
    cursor: pointer;
    font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-muted);
    line-height: 1;
}
.vmb:hover:not(.active) { border-color: var(--rose-light); color: var(--rose); }
.vmb.active { background: var(--rose); border-color: var(--rose); color: #fff; }

/* ── 散落模式（宝丽来） ── */
.photo-grid.mode-scatter {
    columns: unset !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 28px;
    padding: 28px;
    background: #e8ddd0;
    border-radius: var(--radius-lg);
    background-image:
        radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px);
    background-size: 24px 24px;
}
.photo-grid.mode-scatter .photo-card {
    break-inside: unset; margin-bottom: 0;
    background: #fff;
    border-radius: 2px;
    border: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18), 0 1px 4px rgba(0,0,0,0.08);
    padding: 8px 8px 38px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}
.photo-grid.mode-scatter .photo-card img {
    height: 160px; width: 100%; object-fit: cover;
    border-radius: 0; display: block;
}
.photo-grid.mode-scatter .photo-card::after {
    content: '♡';
    position: absolute;
    bottom: 8px; left: 0; right: 0;
    text-align: center;
    font-size: 14px;
    color: var(--rose-light);
}
.photo-grid.mode-scatter .photo-card:nth-child(5n+1) { transform: rotate(-4.5deg); }
.photo-grid.mode-scatter .photo-card:nth-child(5n+2) { transform: rotate(3.2deg); }
.photo-grid.mode-scatter .photo-card:nth-child(5n+3) { transform: rotate(-2.1deg); }
.photo-grid.mode-scatter .photo-card:nth-child(5n+4) { transform: rotate(4.8deg); }
.photo-grid.mode-scatter .photo-card:nth-child(5n+5) { transform: rotate(-1.7deg); }
.photo-grid.mode-scatter .photo-card:hover {
    transform: scale(1.10) rotate(-0.5deg) translateY(-4px) !important;
    box-shadow: 0 24px 60px rgba(0,0,0,0.30), 0 8px 20px rgba(0,0,0,0.15) !important;
    z-index: 10; position: relative;
}

/* ── 胶片模式 ── */
.photo-grid-film-outer {
    background: #111;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    position: relative;
}
.photo-grid-film-outer::before,
.photo-grid-film-outer::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 22px;
    z-index: 3; pointer-events: none;
    background: repeating-linear-gradient(
        to right,
        #111 0, #111 6px,
        transparent 6px, transparent 10px,
        #111 10px, #111 20px
    );
}
.photo-grid-film-outer::before { top: 0; }
.photo-grid-film-outer::after  { bottom: 0; }
.photo-grid.mode-film {
    columns: unset !important;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 3px;
    padding: 22px 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #444 #111;
    align-items: center;
    min-height: 240px;
}
.photo-grid.mode-film .photo-card {
    break-inside: unset; margin-bottom: 0;
    flex-shrink: 0;
    width: 190px; height: 240px;
    border-radius: 0; border: none;
    scroll-snap-align: start;
    box-shadow: none;
    background: #000;
}
.photo-grid.mode-film .photo-card img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 0;
    filter: brightness(0.88) saturate(0.85);
    transition: filter 0.3s;
}
.photo-grid.mode-film .photo-card:hover img { filter: brightness(1) saturate(1.1); }
.photo-grid.mode-film .photo-card:hover { transform: scaleY(1.04); z-index: 5; }

/* ── 爱心模式 ── */
.photo-grid.mode-heart {
    columns: unset !important;
    position: relative;
    background: radial-gradient(ellipse at 50% 40%, #fce8eb 0%, #fdf0f1 40%, #f9e0e3 100%);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 200px;
}

/* 呼吸感的 ♡ 水印 */
.photo-grid.mode-heart::before {
    content: '♡';
    position: absolute;
    font-size: 340px;
    color: rgba(212,135,143,0.12);
    top: 50%; left: 50%;
    transform: translate(-50%, -52%);
    pointer-events: none;
    line-height: 1;
    z-index: 0;
    animation: heartWatermarkBreath 5s ease-in-out infinite;
}
@keyframes heartWatermarkBreath {
    0%, 100% { opacity: 0.7; transform: translate(-50%, -52%) scale(1); }
    50%       { opacity: 1;   transform: translate(-50%, -52%) scale(1.06); }
}

/* 照片卡：倾斜角由 JS 通过 --rot 变量 + inline style 控制 */
.photo-grid.mode-heart .photo-card {
    break-inside: unset; margin: 0;
    position: absolute;
    border-radius: 6px;
    border: 3px solid #fff;
    box-shadow: 2px 4px 18px rgba(0,0,0,0.20), 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 1;
    will-change: transform;
}

.photo-grid.mode-heart .photo-card img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 0;
    transition: none;
}

/* 悬停：放大 + 玫瑰光晕（transform 由 JS 动态处理以保留倾斜角） */
.photo-grid.mode-heart .photo-card:hover {
    box-shadow: 0 14px 40px rgba(212,135,143,0.60),
                0 0 0 3px rgba(255, 255, 255, 0.95);
    z-index: 10;
    opacity: 1 !important;
}

/* 聚光灯：有照片被悬停时，其他照片轻微淡出 */
.photo-grid.mode-heart:has(.photo-card:hover) .photo-card:not(:hover) {
    opacity: 0.60;
}

.photo-grid.mode-heart .photo-card-overlay { display: none; }

/* ── 瀑布流/默认模式 — 悬停时角落显示 ♡ ── */
.photo-grid:not(.mode-scatter):not(.mode-film):not(.mode-heart) .photo-card::after {
    content: '♡';
    position: absolute;
    bottom: 7px; right: 9px;
    font-size: 15px;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 4;
}
.photo-grid:not(.mode-scatter):not(.mode-film):not(.mode-heart) .photo-card:hover::after {
    opacity: 1;
}

/* ── Loading & Error States ── */
.loading-state {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
}
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--rose);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.load-error {
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ── Album Context Header（进入相册时显示） ── */
.album-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 180px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, var(--rose-dark), #4A1A20);
}
.album-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(12px) brightness(0.55);
    transform: scale(1.12);
    transition: background-image 0.4s ease;
}
.album-hero-body {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 28px;
}
.album-hero-name {
    font-family: var(--font-serif);
    font-size: 28px;
    color: #fff;
    margin-bottom: 6px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.album-hero-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
}

/* ── Album Cards ── */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.album-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(180,100,110,0.10);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
}
.album-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(180,100,110,0.20);
}
.album-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #F5C5CA 0%, #EDD5D8 100%);
    cursor: pointer;
    position: relative;
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.album-card:hover .album-cover img { transform: scale(1.08); }
.album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    background: linear-gradient(135deg, var(--rose-pale), var(--rose-light));
}
.album-cover-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}
.album-info { padding: 14px 16px 12px; }
.album-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.album-meta { font-size: 12px; color: var(--text-muted); }
.album-del-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 2;
    backdrop-filter: blur(4px);
}
.album-card:hover .album-del-btn { opacity: 1; }
.album-del-btn:hover { background: rgba(200, 40, 40, 0.82); }

/* ── Photo Cards (updated) ── */
.photo-del-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 5;
}
.photo-card:hover .photo-del-btn { opacity: 1; }
.photo-del-btn:hover { background: rgba(200, 40, 40, 0.8); }
@media (hover: none) {
    .photo-del-btn { opacity: 0.7; }
}

.photo-check {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, border-color 0.2s;
    z-index: 5;
    pointer-events: none;
}
.photo-card.selectable .photo-check { opacity: 1; }
.photo-card.selected .photo-check {
    background: var(--rose);
    border-color: var(--rose);
}
.photo-card.selected { outline: 3px solid var(--rose); outline-offset: -3px; }
.photo-card.selectable { cursor: default; }

/* ── Upload Modal ── */
.upload-modal { max-width: 520px; }
.upload-drop-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    background: var(--cream);
    cursor: pointer;
    transition: border-color var(--ease), background var(--ease);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.native-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}
.upload-drop-zone:hover, .upload-drop-zone.drag-over {
    border-color: var(--rose);
    background: var(--rose-pale);
}
.upload-placeholder { text-align: center; padding: 20px; }
.upload-queue {
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}
.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13px;
}
.upload-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-size { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.upload-item-status { font-size: 12px; white-space: nowrap; color: var(--text-muted); }
.upload-item.uploading .upload-item-status { color: var(--rose); }
.upload-item.done .upload-item-status { color: #4CAF50; }
.upload-item.error .upload-item-status { color: #E53935; }
.upload-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rose-light), var(--rose));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ── Lightbox (updated) ── */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 28px;
    cursor: pointer;
    transition: background var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    text-align: center;
    max-width: 80%;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* responsive */
@media (max-width: 640px) {
    .page-main {
        padding-top: calc(var(--nav-h) + 28px);
        padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    }
    .page-header { margin-bottom: 30px; padding: 0 18px; }
    .page-icon { font-size: 38px; margin-bottom: 8px; }
    .page-title { font-size: 30px; margin-bottom: 6px; }
    .page-subtitle { font-size: 14px; line-height: 1.55; }
    .page-content { padding: 0 14px; }
    .form-card { padding: 18px 14px; margin-bottom: 24px; border-radius: 16px; }
    .form-card-title { font-size: 17px; margin-bottom: 16px; }
    .form-row { width: 100%; gap: 10px; }
    .form-row > * { width: 100%; min-width: 0 !important; }
    .timeline-item { padding: 18px 14px 18px 22px; }
    .timeline-item-actions { position: static; margin-top: 12px; opacity: 1; }
    .album-toolbar { gap: 10px; align-items: stretch; }
    .album-toolbar > * { max-width: 100%; }
    .notes-grid { grid-template-columns: 1fr 1fr; }
    .photo-grid { columns: 2; }
    .albums-grid { grid-template-columns: repeat(2, 1fr); }
    .album-hero { height: 140px; }
    .album-hero-name { font-size: 22px; }
    .form-row { flex-direction: column; }
    .lightbox-nav { width: 36px; height: 36px; font-size: 22px; }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

@media (max-width: 390px) {
    .page-main { padding-top: calc(var(--nav-h) + 20px); }
    .page-header { margin-bottom: 22px; padding: 0 14px; }
    .page-title { font-size: 27px; }
    .page-content { padding: 0 10px; }
    .form-card { padding: 16px 12px; }
    .notes-grid { grid-template-columns: 1fr; }
    .albums-grid { grid-template-columns: 1fr; }
    .photo-grid { columns: 2; column-gap: 8px; }
}

/* Mobile content density and app-like cards */
@media (max-width: 640px) {
    .page-main {
        padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px) + 20px);
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }
    .page-header {
        margin-bottom: 20px;
        padding: 0 16px;
    }
    .page-icon { font-size: 30px; margin-bottom: 5px; line-height: 1; }
    .page-title { font-size: clamp(25px, 7.2vw, 29px); line-height: 1.2; margin-bottom: 5px; }
    .page-subtitle { font-size: 13px; line-height: 1.45; }
    .page-content { width: 100%; padding: 0 12px; }

    .form-card {
        padding: 16px 14px;
        margin-bottom: 16px;
        border-radius: 18px;
        border-color: rgba(212, 135, 143, .18);
        box-shadow: 0 5px 18px rgba(117, 71, 77, .055);
    }
    .form-card-title { font-size: 16px; margin-bottom: 13px; }
    .form-row { gap: 9px; }
    .empty-state { padding: 34px 16px; border-radius: 18px; }
    .empty-state-icon { font-size: 40px; margin-bottom: 10px; }

    .timeline-item, .diary-entry, .note-card, .bucket-item {
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(117, 71, 77, .05);
    }
    .timeline-item { padding: 15px 13px 15px 20px; }
    .timeline-item-actions, .diary-entry-actions { gap: 7px; }
    .timeline-item-actions .btn, .diary-entry-actions .btn { min-height: 38px; }

    .notes-grid { gap: 10px; }
    .note-card { padding: 14px; min-height: 150px; }
    .albums-grid { gap: 10px; }
    .photo-grid { column-gap: 8px; }
    .photo-item { margin-bottom: 8px; border-radius: 12px; }
    .album-toolbar { margin-bottom: 14px; }
}

@media (max-width: 370px) {
    .page-content { padding: 0 9px; }
    .form-card { padding: 14px 12px; }
    .notes-grid, .albums-grid { grid-template-columns: 1fr; }
}
