/* ============================================================
   相册系统 前台样式（手机优先 / 微信 / Chrome Mobile / Safari）
   轻量、低依赖、无第三方框架 —— 精致 / 丝滑 / 高端
   ============================================================ */

:root {
    --primary: #ff5e8a;
    --primary-d: #e8436e;
    --grad: linear-gradient(135deg, #6a5cff 0%, #ff6fae 100%);
    --grad-soft: linear-gradient(135deg, rgba(106,92,255,.12) 0%, rgba(255,111,174,.12) 100%);
    --bg: #f4f5fb;
    --card-bg: #ffffff;
    --text: #1f2330;
    --muted: #9aa1b1;
    --line: #eceef4;
    --radius: 16px;
    --shadow-sm: 0 2px 10px rgba(31,35,48,.06);
    --shadow-md: 0 10px 30px rgba(31,35,48,.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #fbfbfe 0%, #eef0f7 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.app { min-height: 100vh; padding-bottom: 24px; }

/* ---------- 顶部导航（玻璃拟态 + 横向滚动） ---------- */
.topnav {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    background: rgba(255,255,255,.78);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-shadow: 0 2px 14px rgba(31,35,48,.05);
}
.topnav::-webkit-scrollbar { display: none; }
.topnav__item {
    flex: 0 0 auto;
    padding: 15px 16px;
    font-size: 15px;
    color: #5b6172;
    position: relative;
    transition: color .25s ease;
}
.topnav__item:active { transform: scale(.96); }
.topnav__item.is-active { color: var(--primary); font-weight: 700; }
.topnav__item.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 7px;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 3px;
    background: var(--grad);
}

/* ---------- 搜索框 ---------- */
.searchbar {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(255,255,255,.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.searchbar input {
    flex: 1;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 11px 16px;
    font-size: 15px;
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
    transition: box-shadow .25s ease;
}
.searchbar input:focus { box-shadow: inset 0 0 0 1px rgba(106,92,255,.5), 0 4px 14px rgba(106,92,255,.12); }
.searchbar button {
    border: none;
    background: var(--grad);
    color: #fff;
    border-radius: 999px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(255,111,174,.32);
    transition: transform .2s ease, box-shadow .2s ease;
}
.searchbar button:active { transform: scale(.95); box-shadow: 0 2px 8px rgba(255,111,174,.3); }

/* ---------- 公告 ---------- */
.announcement {
    background: linear-gradient(90deg, rgba(255,221,148,.22), rgba(255,170,130,.18));
    color: #a96a16;
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,210,150,.5);
}

/* ---------- 容器 ---------- */
.container { padding: 12px 10px; }
.section-title {
    font-size: 18px;
    margin: 10px 6px 12px;
    font-weight: 800;
    letter-spacing: .3px;
    position: relative;
    padding-left: 12px;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 18px;
    border-radius: 3px;
    background: var(--grad);
}

/* ---------- 双列瀑布流 ---------- */
.waterfall {
    column-count: 2;
    column-gap: 10px;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card {
    display: inline-block;
    width: 100%;
    margin: 0 0 10px;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    break-inside: avoid;
    transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease;
    animation: fadeUp .5s ease both;
    will-change: transform;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.card__img {
    width: 100%;
    height: auto;
    background: linear-gradient(100deg, #eef0f6 30%, #f7f8fc 50%, #eef0f6 70%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
.card__img.loaded { animation: none; background: #f0f1f6; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.card:hover .card__img { transform: scale(1.07); }
.card__img { transition: transform .6s cubic-bezier(.2,.7,.3,1); }
.card__body { padding: 9px 11px 12px; }
.card__title {
    font-size: 14px;
    font-weight: 700;
    color: #2a2f3d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: .2px;
}
.card__tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
    font-size: 11px;
    color: var(--primary);
    background: rgba(255,94,138,.1);
    border-radius: 6px;
    padding: 2px 7px;
    font-weight: 600;
}

/* ---------- 加载更多 / 没有更多 ---------- */
.loadmore { text-align: center; padding: 18px 0; }
.btn-more {
    border: none;
    background: var(--grad);
    color: #fff;
    border-radius: 999px;
    padding: 11px 34px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(106,92,255,.28);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn-more:active { transform: scale(.96); }
.btn-more.loading { opacity: .6; pointer-events: none; }
.nomore { text-align: center; color: var(--muted); font-size: 13px; padding: 16px 0; letter-spacing: .5px; }
.empty { text-align: center; color: var(--muted); padding: 56px 0; font-size: 15px; }
.empty::before { content: "🖼️"; display: block; font-size: 38px; margin-bottom: 10px; opacity: .7; }

/* ---------- 内容页 ---------- */
.detail { padding: 14px 12px; }
.back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    margin: 4px 0 10px;
    font-size: 15px;
    font-weight: 600;
}
.back::before { content: "‹"; font-size: 20px; line-height: 1; }
.detail__title { font-size: 22px; margin: 4px 0 8px; font-weight: 800; letter-spacing: .3px; }
.detail__cat {
    display: inline-block;
    color: #6a5cff;
    font-size: 12px;
    font-weight: 600;
    background: rgba(106,92,255,.1);
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.detail__content { color: #54596a; font-size: 15px; margin: 10px 0; }
.detail__content img { border-radius: 12px; max-width: 100%; }
.gallery { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.gallery__img {
    width: 100%;
    border-radius: 14px;
    background: linear-gradient(100deg, #eef0f6 30%, #f7f8fc 50%, #eef0f6 70%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    box-shadow: var(--shadow-sm);
}
.gallery__img.loaded { animation: none; background: #f0f1f6; }
.btn-share {
    position: fixed;
    right: 16px;
    bottom: 24px;
    background: var(--grad);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(255,111,174,.45);
    z-index: 30;
    animation: sharePulse 2.6s ease-in-out infinite;
}
@keyframes sharePulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(255,111,174,.45); }
    50%      { box-shadow: 0 8px 32px rgba(106,92,255,.55); }
}
.btn-share:active { transform: scale(.94); }

/* ---------- 分享弹层 ---------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(20,22,33,.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: fadeIn .25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal__box {
    background: #fff;
    border-radius: 20px;
    padding: 24px 22px;
    width: 80%;
    max-width: 330px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(20,22,33,.3);
    animation: popIn .3s cubic-bezier(.2,.8,.3,1.2) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal__close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 26px;
    color: #b6bccb;
    cursor: pointer;
    line-height: 1;
}
.modal__title { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.modal__qr { display: flex; justify-content: center; }
.modal__qr img, .modal__qr svg { width: 200px; height: 200px; border-radius: 8px; }
.modal__url { margin-top: 12px; font-size: 12px; color: #9aa1b1; word-break: break-all; }

/* ---------- 底部 ---------- */
.site-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 20px 12px;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.5);
}
.site-footer__icp { margin-top: 5px; }

/* ---------- 访问密码页 ---------- */
.password-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, #f3f1ff 0%, #ffeef6 100%);
}
.password-card {
    width: 100%;
    max-width: 350px;
    background: #fff;
    border-radius: 22px;
    padding: 32px 24px;
    box-shadow: 0 18px 50px rgba(106,92,255,.18);
    text-align: center;
}
.password-card__title {
    font-size: 20px;
    margin: 0 0 24px;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.password-form { display: flex; flex-direction: column; gap: 14px; }
.password-input {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 15px 16px;
    font-size: 17px;
    text-align: center;
    outline: none;
    transition: box-shadow .25s ease, border-color .25s ease;
}
.password-input:focus { border-color: rgba(106,92,255,.5); box-shadow: 0 4px 16px rgba(106,92,255,.15); }
.password-btn {
    border: none;
    background: var(--grad);
    color: #fff;
    border-radius: 12px;
    padding: 15px;
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(255,111,174,.35);
    transition: transform .2s ease;
}
.password-btn:active { transform: scale(.97); }
.password-msg { color: var(--primary-d); font-size: 13px; margin-top: 12px; min-height: 18px; }
