:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --ink: #1c2330;
    --ink-soft: #6b7688;
    --line: #e6e9ef;
    --brand: #2f6feb;
    --brand-dark: #1f57c3;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(24, 39, 75, .06), 0 10px 30px rgba(24, 39, 75, .05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ---------- 登录页 ---------- */
.page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(1200px 600px at 50% -10%, #e8f0ff 0%, #f5f6f8 55%);
}

.login-wrap { width: 100%; max-width: 400px; }

.login-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 36px 32px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.login-brand { text-align: center; margin-bottom: 26px; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4b8bff, #2f6feb);
    color: #fff;
    font-size: 15px;
    letter-spacing: 1px;
    margin-bottom: 14px;
    box-shadow: 0 6px 16px rgba(47, 111, 235, .3);
}

.login-brand h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: .5px; }
.login-brand p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }

.field { display: block; margin-bottom: 16px; }

.field span {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 7px;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--ink);
    background: #fbfcfe;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    font-family: inherit;
}

.field input:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 111, 235, .12);
}

.field input:disabled { background: #f2f3f6; color: #a2abb9; }

.btn-primary {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, transform .05s;
    font-family: inherit;
}

.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #b9c4d6; cursor: not-allowed; }

.alert {
    background: #fff2f0;
    border: 1px solid #ffd6d1;
    color: #c0392b;
    font-size: 13.5px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.login-tip {
    text-align: center;
    font-size: 12px;
    color: #9aa3b2;
    margin: 20px 0 0;
}

/* ---------- 顶栏 ---------- */
.topbar {
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-title h1 {
    font-size: 18px;
    margin: 0;
    letter-spacing: .3px;
}

.topbar-title p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.back-link {
    display: inline-block;
    font-size: 12.5px;
    color: var(--brand);
    margin-bottom: 6px;
}

.btn-ghost {
    font-size: 13px;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    background: #fff;
    padding: 7px 14px;
    border-radius: 8px;
    transition: color .15s, border-color .15s;
    flex: none;
}

.btn-ghost:hover { color: var(--ink); border-color: #cfd6e2; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* ---------- 相册列表 ---------- */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.album-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}

.album-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(24, 39, 75, .09), 0 16px 40px rgba(24, 39, 75, .1);
}

.album-cover {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #eef1f6;
    overflow: hidden;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.album-card:hover .album-cover img { transform: scale(1.04); }

.album-cover-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a9b2c1;
    font-size: 13px;
}

.album-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(18, 24, 36, .62);
    color: #fff;
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.album-meta { padding: 12px 14px 14px; }

.album-meta h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 照片网格 ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.photo-item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #eef1f6;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease, opacity .3s ease;
    opacity: 0;
}

.photo-item img.loaded { opacity: 1; }

.photo-item:hover img { transform: scale(1.05); }

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
    font-size: 14px;
}

.pager a {
    padding: 8px 18px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .disabled { color: #b7bfcc; padding: 8px 18px; }
.pager-info { color: var(--ink-soft); font-size: 13px; }

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 90px 20px;
    color: var(--ink-soft);
}

.empty-state h2 { font-size: 17px; color: var(--ink); margin: 0 0 8px; }
.empty-state p { margin: 0; font-size: 13.5px; }

/* ---------- 灯箱 ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(9, 12, 18, .94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.lightbox[hidden] { display: none; }

.lb-stage {
    margin: 0;
    max-width: min(1200px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lb-stage img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    background: #14181f;
}

.lb-stage figcaption {
    color: #c8d0dd;
    font-size: 13px;
    text-align: center;
    word-break: break-all;
}

.lb-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}

.lb-close:hover { background: rgba(255, 255, 255, .22); }

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 76px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}

.lb-nav:hover { background: rgba(255, 255, 255, .2); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-nav[disabled] { opacity: .25; cursor: default; }

.lb-download {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: #dbe3ef;
    background: rgba(255, 255, 255, .1);
    padding: 8px 18px;
    border-radius: 20px;
}

.lb-download:hover { background: rgba(255, 255, 255, .2); }

@media (max-width: 640px) {
    .container { padding: 16px 14px 48px; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
    .login-card { padding: 28px 22px 22px; }
    .lb-nav { width: 38px; height: 60px; font-size: 26px; }
    .lb-prev { left: 4px; }
    .lb-next { right: 4px; }
}
