/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0b0b0e;
    --bg-secondary: #131318;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --text-primary: #f0ede8;
    --text-secondary: rgba(240, 237, 232, 0.7);
    --accent: #d4b68a;
    --radius: 0px;
    --transition: 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100dvh;
    overflow: hidden;
}

img {
    display: block;
    width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 0;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.section-title {
    font-family: "Playfair Display", serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.04em;
    margin-bottom: 0.4em;
    color: var(--text-primary);
}

.section-sub {
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.06em;
    max-width: 560px;
}

/* ===== APP 容器 ===== */
#app {
    height: 100dvh;
    overflow: hidden;
    position: relative;
    opacity: 1 !important;
    transition: none;
}

/* ===== 两页滚动容器 ===== */
.page-container {
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.page-container::-webkit-scrollbar {
    display: none;
}

/* ===== 每一页 ===== */
.page-section {
    height: 100dvh;
    scroll-snap-align: start;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
}

.albums-section {
    justify-content: flex-start;
    padding-top: 2rem;
    overflow-y: auto;
}
.albums-masonry {
    padding-bottom: 1rem;
}

/* ===== HERO ===== */
.hero {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212, 182, 138, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 182, 138, 0.04) 0%, transparent 50%),
        var(--bg-primary);
}

.hero-inner {
    max-width: 860px;
    width: 100%;
    padding: 3rem 2.5rem;
    text-align: center;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.hero-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 40%, rgba(212, 182, 138, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--glass-border);
    display: block;
    background: var(--bg-secondary);
}

.hero-name {
    font-family: "Playfair Display", serif;
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.hero-tagline {
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.08em;
    margin-bottom: 1.2rem;
}

.hero-desc {
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 1.8rem;
    font-weight: 300;
    line-height: 1.8;
}

.hero-divider {
    width: 60px;
    height: 1px;
    background: var(--accent);
    margin: 0 auto 1.8rem;
    opacity: 0.4;
}

.hero-scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.5;
    transition: opacity 0.4s;
    cursor: default;
}
.hero-scroll-hint:hover {
    opacity: 0.8;
}
.hero-scroll-hint .arrow {
    display: inline-block;
    animation: bob 2s infinite ease-in-out;
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ===== 相簿页 ===== */
.albums-header {
    padding: 0 0.5rem 2.5rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
}
.albums-header .section-title {
    margin-bottom: 0;
}
.albums-header .section-sub {
    margin-bottom: 0;
    text-align: right;
}

.albums-masonry {
    column-count: 4;
    column-gap: 20px;
    padding: 0 0.5rem;
}

@media (max-width: 1200px) {
    .albums-masonry { column-count: 3; }
}
@media (max-width: 820px) {
    .albums-masonry { column-count: 2; }
}
@media (max-width: 500px) {
    .albums-masonry { column-count: 1; column-gap: 0; }
}

.album-card {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: cardFadeIn 0.7s ease forwards;
}
.album-card:nth-child(1) { animation-delay: 0.05s; }
.album-card:nth-child(2) { animation-delay: 0.10s; }
.album-card:nth-child(3) { animation-delay: 0.15s; }
.album-card:nth-child(4) { animation-delay: 0.20s; }
.album-card:nth-child(5) { animation-delay: 0.25s; }
.album-card:nth-child(6) { animation-delay: 0.30s; }
.album-card:nth-child(7) { animation-delay: 0.35s; }
.album-card:nth-child(8) { animation-delay: 0.40s; }
.album-card:nth-child(9) { animation-delay: 0.45s; }
.album-card:nth-child(10) { animation-delay: 0.50s; }

@keyframes cardFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.album-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    border-color: rgba(212, 182, 138, 0.25);
}

.album-card .cover-wrap {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}
.album-card .cover-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
    will-change: transform;
}
.album-card:hover .cover-wrap img {
    transform: scale(1.03);
}

.album-card .cover-overlay,
.photo-item .photo-label {
    display: none !important;
}

.album-card .info {
    padding: 1rem 1.2rem 1.2rem;
    background: var(--bg-secondary);
}
.album-card .info h3 {
    font-family: "Playfair Display", serif;
    font-weight: 400;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}
.album-card .info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.04em;
    opacity: 0.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 相簿详情（覆盖层） ===== */
.album-detail {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--bg-primary);
    overflow-y: auto;
    padding: 2rem 1.5rem 2rem;
}
.album-detail.active {
    display: block;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0 0.5rem 2rem 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Inter", sans-serif;
    letter-spacing: 0.04em;
}
.detail-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.detail-title {
    font-family: "Playfair Display", serif;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: 400;
    flex: 1;
    min-width: 200px;
}
.detail-desc {
    color: var(--text-secondary);
    font-weight: 300;
    font-size: 0.95rem;
    width: 100%;
    padding-top: 0.5rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 0 0.5rem;
}

@media (max-width: 600px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

.photo-item {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}
.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(212, 182, 138, 0.2);
}
.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}
.photo-item:hover img {
    transform: scale(1.02);
}

/* ===== 模态框（优化尺寸和间距） ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(11, 11, 14, 0.88);
    backdrop-filter: blur(32px) saturate(1.2);
    -webkit-backdrop-filter: blur(32px) saturate(1.2);
    padding: 1.2rem;           /* 与屏幕边缘保持间距 */
    overflow-y: auto;
    animation: modalFade 0.4s ease;
}
.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes modalFade {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(32px); }
}

.modal-content {
    max-width: 900px;
    width: 100%;
    max-height: 90dvh;         /* 整体高度限制，留出上下边距 */
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-image-wrap {
    position: relative;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;           /* 不伸缩，由图片撑开 */
    width: 100%;
    min-height: 0;
}
.modal-image-wrap img {
    max-height: 70dvh;        /* 图片最大高度，避免过大 */
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.modal-body {
    padding: 1.5rem 2rem 2rem;
    overflow-y: auto;
    flex: 1 1 auto;           /* 占据剩余空间，但可收缩 */
    background: var(--bg-secondary);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-family: "Inter", sans-serif;
    border-radius: 50%;
    backdrop-filter: blur(4px);
}
.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: rotate(90deg);
}

.modal-body .photo-title {
    font-family: "Playfair Display", serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}
.modal-body .photo-desc {
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.8;
    font-size: 0.95rem;
}
.modal-body .photo-desc p { margin-bottom: 0.6rem; }
.modal-body .photo-desc p:last-child { margin-bottom: 0; }
.modal-body .photo-desc strong,
.modal-body .photo-desc b { color: var(--text-primary); font-weight: 500; }
.modal-body .photo-desc em,
.modal-body .photo-desc i { color: var(--accent); font-style: italic; }
.modal-body .photo-desc code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.5rem;
    font-size: 0.85rem;
    border: 1px solid var(--glass-border);
    font-family: "Inter", monospace;
}
.modal-body .photo-desc blockquote {
    border-left: 2px solid var(--accent);
    padding-left: 1rem;
    margin: 0.8rem 0;
    opacity: 0.7;
    font-style: italic;
}
.modal-body .photo-desc ul,
.modal-body .photo-desc ol {
    padding-left: 1.4rem;
    margin: 0.4rem 0;
}
.modal-body .photo-desc a {
    color: var(--accent);
    border-bottom: 1px dotted var(--accent);
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    padding: 1.5rem 0.5rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    opacity: 0.3;
    font-weight: 300;
    margin-top: auto;
    width: 100%;
}
.album-detail .site-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
    font-weight: 300;
}
.empty-state span {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ===== 移动端微调 ===== */
@media (max-width: 768px) {
    .hero-inner { padding: 2rem 1.5rem; }
    .hero-avatar { width: 72px; height: 72px; }
    .albums-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .albums-header .section-sub { text-align: left; }
    .modal-content { max-height: 95dvh; }
    .modal-body { padding: 1.2rem 1.2rem 1.5rem; }
    .modal-image-wrap img { max-height: 60dvh; }
    .modal-close { top: 8px; right: 10px; width: 34px; height: 34px; font-size: 0.8rem; }
    .modal-overlay { padding: 0.8rem; }
}

@media (max-width: 480px) {
    .hero { min-height: 100dvh; padding: 1rem; }
    .hero-inner { padding: 1.5rem 1rem; }
    .albums-section { padding: 1rem 0.5rem 1rem; }
    .album-card .info { padding: 0.7rem 0.8rem 0.9rem; }
    .album-card .info h3 { font-size: 1rem; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
    .detail-header { padding: 0 0 1rem 0; }
    .modal-body .photo-title { font-size: 1.1rem; }
    .modal-overlay { padding: 0.6rem; }
    .modal-image-wrap img { max-height: 55dvh; }
}
