:root { color-scheme: light; }
/* 惯性滚动在移动端更顺滑；宽屏再启用 smooth，避免与触控滚动「抢轨」 */
html { scroll-behavior: auto; }
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}
body {
    min-height: 100vh;
    background:
        radial-gradient(120% 70% at 8% -15%, rgba(59,130,246,.17), transparent 55%),
        radial-gradient(90% 55% at 98% 5%, rgba(56,189,248,.14), transparent 52%),
        linear-gradient(180deg, #f8fbff 0%, #f4f8ff 50%, #f9fbff 100%);
    overflow-x: hidden;
}
/* 单层粗颗粒替代双层细点阵，减轻合成与缩放时的重绘压力 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .032;
    transform: translateZ(0);
    background-image: radial-gradient(#0f172a 0.55px, transparent 0.6px);
    background-size: 5px 5px;
}
@media (max-width: 639px) {
    body::before { opacity: .024; }
}
.cursor-glow {
    position: fixed;
    width: 340px;
    height: 340px;
    left: -170px;
    top: -170px;
    border-radius: 9999px;
    pointer-events: none;
    z-index: 1;
    opacity: .48;
    background: radial-gradient(circle, rgba(56,189,248,.26) 0%, rgba(96,165,250,.12) 42%, rgba(255,255,255,0) 72%);
    transition: transform .18s ease-out;
}
.glass {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), box-shadow .32s cubic-bezier(.22, 1, .36, 1), border-color .32s ease;
}
/* 触控设备禁用毛玻璃：backdrop-filter 在移动端滚动时极易掉帧，用不透明渐变平替观感 */
@media (hover: none), (pointer: coarse) {
    .glass {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(248,250,252,.88));
        border-color: rgba(255,255,255,.55);
        box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
    }
}
@media (hover: hover) and (pointer: fine) {
    .glass:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 36px rgba(30, 64, 175, .13);
        border-color: rgba(255,255,255,.35);
    }
}
.reveal {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    transition: opacity .38s cubic-bezier(.22, 1, .36, 1), transform .38s cubic-bezier(.22, 1, .36, 1);
    transition-delay: var(--reveal-delay, 0s);
}
.reveal.in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
@media (max-width: 639px) {
    .reveal {
        transform: none;
        transition: opacity .3s ease-out;
    }
    .reveal.in { transform: none; }
}
.btn-gradient {
    background-image: linear-gradient(120deg, #2563eb 0%, #0ea5e9 48%, #3b82f6 100%);
    box-shadow: 0 10px 25px rgba(37, 99, 235, .24);
    transition: transform .24s ease, box-shadow .24s ease, filter .24s ease;
}
.btn-gradient:hover {
    transform: translateY(-2px);
    filter: saturate(1.06);
    box-shadow: 0 16px 32px rgba(37, 99, 235, .30), 0 0 0 1px rgba(255,255,255,.35) inset;
}
.btn-gradient:active { transform: scale(.985); }
.icon-send-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    letter-spacing: .02em;
}
.btn-icon {
    width: 18px;
    height: 18px;
    transition: transform .26s ease, opacity .26s ease;
}
.btn-label { transition: opacity .22s ease; }
.icon-send-btn.is-sending .btn-icon { animation: spin 1s linear infinite; }
.icon-send-btn.is-success {
    background-image: linear-gradient(120deg, #059669 0%, #10b981 48%, #34d399 100%);
    box-shadow: 0 12px 28px rgba(5, 150, 105, .26);
}
.icon-send-btn.is-success .btn-icon { transform: scale(1.08); }
@keyframes spin { to { transform: rotate(360deg); } }
.ripple {
    position: absolute;
    border-radius: 9999px;
    transform: scale(0);
    animation: ripple .58s ease-out forwards;
    background: rgba(255,255,255,.55);
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(7); opacity: 0; }
}
.hero-wrap {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(380px 230px at 84% 12%, rgba(59,130,246,.22), transparent 72%),
        radial-gradient(320px 190px at 18% 88%, rgba(14,165,233,.16), transparent 74%),
        rgba(255,255,255,.58);
}
.hero-wrap::after {
    content: "";
    position: absolute;
    right: -76px;
    top: -80px;
    width: 220px;
    height: 220px;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(255,255,255,.66), rgba(255,255,255,0));
    pointer-events: none;
}
.avatar-glow {
    box-shadow:
        0 0 0 1px rgba(255,255,255,.62),
        0 0 0 5px rgba(14,165,233,.08),
        0 8px 18px rgba(37,99,235,.12);
}
.message-shell {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(255,255,255,.72), rgba(255,255,255,.5));
}
.message-shell::before {
    content: "";
    position: absolute;
    inset: -30% auto auto -20%;
    width: 200px;
    height: 200px;
    border-radius: 9999px;
    filter: blur(2px);
    background: radial-gradient(circle, rgba(14,165,233,.16), rgba(255,255,255,0) 70%);
    pointer-events: none;
}
@media (hover: none), (pointer: coarse), (max-width: 639px) {
    .message-shell::before { filter: none; }
}
.field-soft {
    border: 1px solid rgba(148,163,184,.28);
    background: rgba(255,255,255,.78);
    border-radius: 14px;
    padding: 12px 14px;
    transition: border-color .26s ease, box-shadow .26s ease, transform .26s ease;
}
.field-soft:focus {
    outline: none;
    border-color: rgba(14,165,233,.56);
    box-shadow: 0 0 0 4px rgba(14,165,233,.12), 0 10px 20px rgba(14,165,233,.10);
}
@media (hover: hover) and (pointer: fine) {
    .field-soft:focus { transform: translateY(-1px); }
}
.field-soft::placeholder { color: rgba(100,116,139,.72); }
.dynamic-shell {
    position: relative;
    overflow: hidden;
    background: linear-gradient(175deg, rgba(255,255,255,.72), rgba(255,255,255,.56));
}
.dynamic-shell::before {
    content: "";
    position: absolute;
    inset: auto -40px -70px auto;
    width: 190px;
    height: 190px;
    border-radius: 9999px;
    background: radial-gradient(circle, rgba(59,130,246,.11), rgba(255,255,255,0) 72%);
    pointer-events: none;
}
.feed-card {
    position: relative;
    contain: layout style;
    border: 1px solid rgba(226,232,240,.82);
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,250,252,.86));
    transition: box-shadow .28s ease, border-color .28s ease;
}
@media (hover: hover) and (pointer: fine) {
    .feed-card {
        transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s cubic-bezier(.22, 1, .36, 1), border-color .3s ease;
    }
}
@media (hover: hover) and (pointer: fine) {
    .feed-card:hover {
        transform: translateY(-3px);
        border-color: rgba(186,230,253,.95);
        box-shadow: 0 14px 30px rgba(15,23,42,.08);
    }
}
.message-bubble {
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(226,232,240,.84);
}
/* 留言动态 · 访客头像：轻阴影 + 微圆角（与全圆区分） */
.feed-visitor-avatar {
    border-radius: 11px;
    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.1),
        0 4px 14px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.75) inset;
}
@media (min-width: 640px) {
    .feed-visitor-avatar {
        border-radius: 12px;
    }
}
/* 站长回复：头像 + 气泡横向排列，替代「站长回复」文字 */
.feed-reply-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 0.65rem;
    padding-top: 2px;
}
@media (min-width: 640px) {
    .feed-reply-row {
        gap: 11px;
        margin-top: 0.75rem;
    }
}
.feed-owner-avatar {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.08),
        0 4px 12px rgba(37, 99, 235, 0.14),
        0 0 0 1px rgba(191, 219, 254, 0.55);
}
@media (min-width: 640px) {
    .feed-owner-avatar {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }
}
.feed-reply-bubble {
flex: 1;
    min-width: 0;
    padding: 10px 13px 11px;
    border-radius: 14px 16px 18px 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.55) 0%, transparent 42%), linear-gradient(168deg, rgb(239 246 255 / 92%), rgb(219 234 254 / 0%));
    border: 1px solid rgb(214 214 214 / 41%);
    box-shadow: 0 2px 8px rgb(59 130 246 / 10%), 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}
@media (min-width: 640px) {
    .feed-reply-bubble {
        padding: 11px 14px 12px;
        border-radius: 15px 17px 18px 15px;
    }
}
/*
 * 新追加的留言卡片：起始略带透明 + 微位移，避免 opacity:0 造成「空位闪一下」；
 * .feed-append-ready 由 JS 在双 requestAnimationFrame 后添加以触发过渡。
 */
.feed-card.feed-append {
    opacity: 0.91;
    transform: translate3d(0, 5px, 0);
}
.feed-card.feed-append.feed-append-ready {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    transition:
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--feed-dly, 0ms);
}
@media (hover: hover) and (pointer: fine) and (min-width: 640px) {
    .feed-card.feed-append {
        transform: translate3d(0, 8px, 0);
    }
    .feed-card.feed-append.feed-append-ready {
        transition-duration: 0.46s, 0.46s;
    }
}
@media (max-width: 639px) {
    .feed-card.feed-append.feed-append-ready {
        transition-duration: 0.34s, 0.34s;
    }
}

/* 留言列表 · 加载更多：紧凑胶囊按钮；加载层 absolute 不占文档流，避免 SVG 隐形仍占位 */
.feed-load-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 220px;
    padding: 6px 16px;
    border-radius: 9999px;
    border: 1px solid rgba(226, 232, 240, 0.98);
    background: rgba(255, 255, 255, 0.72);
    color: #64748b;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease,
        background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.feed-load-more-btn:hover:not(:disabled) {
    border-color: rgba(125, 211, 252, 0.55);
    color: #0e7490;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.09);
}
.feed-load-more-btn:active:not(:disabled) {
    transform: scale(0.985);
}
.feed-load-more-btn:disabled {
    cursor: not-allowed;
}
.feed-load-more-btn.is-loading {
    min-height: 32px;
}
.feed-load-more-btn__shimmer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}
.feed-load-more-btn__shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.45) 50%, transparent 62%);
    transform: translate3d(-130%, 0, 0);
    opacity: 0;
}
.feed-load-more-btn.is-loading .feed-load-more-btn__shimmer::after {
    opacity: 1;
    animation: feedLoadMoreShimmer 1.15s ease-in-out infinite;
}
@keyframes feedLoadMoreShimmer {
    to {
        transform: translate3d(130%, 0, 0);
    }
}
.feed-load-more-btn__inner {
    position: relative;
    display: block;
    width: 100%;
    text-align: center;
    line-height: 1.35;
}
.feed-load-more-btn__idle {
    display: inline-block;
    transition: opacity 0.2s ease;
}
.feed-load-more-btn.is-loading .feed-load-more-btn__idle {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
.feed-load-more-btn__loading {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.22s;
}
.feed-load-more-btn.is-loading .feed-load-more-btn__loading {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}
.feed-load-more-btn__loader {
    width: 22px;
    height: 22px;
    display: block;
}
.feed-load-more-btn__loader-arc {
    transform-origin: 28px 28px;
    animation: feedLoadMoreSpin 0.78s linear infinite;
}
@keyframes feedLoadMoreSpin {
    to {
        transform: rotate(360deg);
    }
}

.toast-layer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}
.toast-layer.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.toast-mask {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.28);
    backdrop-filter: blur(4px);
}
@media (max-width: 639px), (hover: none), (pointer: coarse) {
    .toast-mask {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: rgba(15, 23, 42, 0.34);
    }
}
.toast-card {
    position: relative;
    width: min(360px, calc(100vw - 32px));
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.5);
    background: linear-gradient(160deg, rgba(255,255,255,.96), rgba(248,250,252,.9));
    box-shadow: 0 28px 50px rgba(15,23,42,.2);
    padding: 18px 18px 16px;
    transform: translate3d(0, 12px, 0);
    opacity: 0;
    transition: transform .32s cubic-bezier(.2,.7,.2,1), opacity .32s cubic-bezier(.2,.7,.2,1);
}
.toast-layer.show .toast-card {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
    .toast-card {
        transform: translate3d(0, 12px, 0) scale(.96);
        transition: transform .34s cubic-bezier(.2,.7,.2,1), opacity .34s cubic-bezier(.2,.7,.2,1);
    }
    .toast-layer.show .toast-card {
        transform: translate3d(0, 0, 0) scale(1);
    }
}
.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.toast-card.success .toast-icon { background: rgba(16,185,129,.18); color: #047857; }
.toast-card.error .toast-icon { background: rgba(244,63,94,.14); color: #be123c; }
.tag-soft {
    border: 1px solid rgba(148,163,184,.26);
    background: rgba(255,255,255,.72);
    color: #334155;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal, .glass, .btn-gradient, .feed-card, .cursor-glow, .toast-layer, .toast-card, .btn-icon, .btn-label { transition: none !important; }
    .feed-card.feed-append,
    .feed-card.feed-append.feed-append-ready {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .icon-send-btn.is-sending .btn-icon { animation: none; }
    .feed-load-more-btn__shimmer::after,
    .feed-load-more-btn__loader-arc {
        animation: none !important;
    }
    .feed-load-more-btn.is-loading .feed-load-more-btn__loading {
        transform: none;
    }
}

/* 欢迎层：触控设备去掉 backdrop-blur，避免遮罩与页面同时合成时掉帧 */
@media (hover: none), (pointer: coarse) {
    #welcomeModal > .absolute.inset-0 {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: rgba(15, 23, 42, 0.42);
    }
}

main { isolation: isolate; }

/* ========== 后台 admin.php（与首页同系浅色玻璃风） ========== */
.admin-page .glass {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
@media (hover: none), (pointer: coarse) {
    .admin-page .glass {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.9));
    }
}
.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: rgba(255, 255, 255, 0.45);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}
.admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 12px;
    font-weight: 600;
    color: #334155;
    background: rgba(248, 250, 252, 0.95);
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    white-space: nowrap;
}
.admin-table tbody td {
    padding: 10px 12px;
    vertical-align: top;
    border-bottom: 1px solid rgba(241, 245, 249, 0.98);
    color: #475569;
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}
.admin-table tbody tr.is-hidden-row {
    opacity: 0.72;
}
.admin-table .cell-muted {
    color: #94a3b8;
    font-size: 12px;
}
.admin-table .cell-clip {
    max-width: 20rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
@media (min-width: 1024px) {
    .admin-table .cell-clip {
        max-width: 28rem;
    }
}
@media (min-width: 1440px) {
    .admin-table .cell-clip {
        max-width: 34rem;
    }
}
.admin-op {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.admin-btn--ghost {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(203, 213, 225, 0.95);
    color: #475569;
}
.admin-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(148, 163, 184, 0.7);
    color: #0f172a;
}
.admin-btn--sky {
    background: rgba(224, 242, 254, 0.85);
    border-color: rgba(125, 211, 252, 0.55);
    color: #0369a1;
}
.admin-btn--sky:hover {
    background: rgba(186, 230, 253, 0.95);
}
.admin-btn--rose {
    background: rgba(255, 241, 242, 0.9);
    border-color: rgba(251, 207, 232, 0.85);
    color: #be123c;
}
.admin-btn--rose:hover {
    background: rgba(254, 205, 211, 0.55);
}
.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
}
.admin-badge--ok {
    background: rgba(220, 252, 231, 0.95);
    color: #166534;
}
.admin-badge--muted {
    background: rgba(241, 245, 249, 0.95);
    color: #64748b;
}
#adminReplyDialog {
    border: none;
    border-radius: 18px;
    padding: 0;
    max-width: min(420px, calc(100vw - 32px));
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}
#adminReplyDialog::backdrop {
    background: rgba(15, 23, 42, 0.35);
}
#adminProfileDialog {
    border: none;
    border-radius: 20px;
    padding: 0;
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}
#adminProfileDialog::backdrop {
    background: rgba(15, 23, 42, 0.35);
}
.admin-guest-center {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.admin-dialog-inner {
    padding: 20px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
}
.admin-field {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    color: #334155;
}
.admin-field:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
