/* ===== Zeinima 留言板 - 暗色特效版 ===== */
:root {
    --primary: #6d8bff;
    --primary-2: #a56bff;
    --accent: #4de3c2;
    --danger: #ff6b6b;
    --bg: #0b1020;
    --card: rgba(255, 255, 255, .055);
    --card-border: rgba(255, 255, 255, .10);
    --text: #e8ecf8;
    --muted: #97a0bd;
    --radius: 14px;
    --glow: 0 0 24px rgba(109, 139, 255, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

.wrap { max-width: 780px; margin: 0 auto; padding: 0 18px; position: relative; z-index: 1; }

/* ===== 背景特效层 ===== */
.aurora {
    position: fixed;
    width: 55vmax; height: 55vmax;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .45;
    z-index: -2;
    pointer-events: none;
    animation: drift 22s ease-in-out infinite alternate;
}
.aurora.a1 { background: #3550c8; top: -18vmax; left: -12vmax; }
.aurora.a2 { background: #7a3fd4; bottom: -20vmax; right: -14vmax; animation-duration: 26s; animation-delay: -8s; }
.aurora.a3 { background: #1a6a8a; top: 30%; left: 45%; width: 38vmax; height: 38vmax; opacity: .3; animation-duration: 30s; animation-delay: -14s; }

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(6vmax, 4vmax) scale(1.12); }
    100% { transform: translate(-5vmax, -3vmax) scale(.94); }
}

#bg-particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* 网格微纹理 */
body::before {
    content: "";
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
    z-index: -1;
    pointer-events: none;
}

/* ===== 顶部横幅 ===== */
.hero {
    text-align: center;
    padding: 32px 0 14px; /* 持续压紧：88→44→32px */
    margin-bottom: 12px;
}
.hero-small { padding: 52px 0 28px; }

.hero h1 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(120deg, #8ba3ff, #c08bff, #4de3c2, #8ba3ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shine 8s linear infinite;
}
@keyframes shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ===== 特效标题「贼你妈」·霓虹灯箱 ===== */
.fancy-title {
    position: relative;
    display: inline-block;
    padding: 8px 30px 14px;
    margin-bottom: 2px;
    border: 1.5px solid rgba(139, 163, 255, .38);
    border-radius: 16px;
    background: linear-gradient(165deg, rgba(109, 139, 255, .10), rgba(165, 107, 255, .04) 60%, rgba(77, 227, 194, .06));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    user-select: none;
    animation: frame-glow 3.4s ease-in-out infinite;
}
@keyframes frame-glow {
    0%, 100% {
        border-color: rgba(139, 163, 255, .35);
        box-shadow:
            inset 0 0 22px rgba(109, 139, 255, .10),
            0 0 18px rgba(109, 139, 255, .16);
    }
    50% {
        border-color: rgba(139, 163, 255, .62);
        box-shadow:
            inset 0 0 34px rgba(109, 139, 255, .16),
            0 0 34px rgba(109, 139, 255, .34),
            0 0 70px rgba(77, 227, 194, .14);
    }
}
.fancy-title .tt-char {
    display: inline-block;
    font-size: 48px;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: 5px;
    color: #fff;
    --c: #6d8bff;
    animation:
        neon-on 1s ease-out both,
        char-float 3.8s ease-in-out infinite,
        neon-breathe 3.2s ease-in-out infinite;
    animation-delay:
        var(--d),
        calc(var(--d) + 1.1s),
        calc(var(--d) + 1.1s);
    cursor: default;
    transition: filter .2s;
}
.fancy-title .tt-char:hover { filter: brightness(1.28); }
/* 灯管通电点亮：闪烁几下再稳定 */
@keyframes neon-on {
    0%   { opacity: .1; transform: translateY(16px) scale(.85); filter: blur(3px); text-shadow: none; }
    30%  { opacity: 1;  transform: translateY(0) scale(1.03);  filter: blur(0);  text-shadow: 0 0 4px rgba(255,255,255,.9), 0 0 16px var(--c), 0 0 34px var(--c); }
    42%  { opacity: .55; transform: translateY(0) scale(1);     filter: blur(0);  text-shadow: 0 0 2px rgba(255,255,255,.5), 0 0 6px var(--c); }
    56%  { opacity: 1;  transform: translateY(0) scale(1.01);  filter: blur(0);  text-shadow: 0 0 5px rgba(255,255,255,.95), 0 0 20px var(--c), 0 0 44px var(--c); }
    70%  { opacity: .75; }
    100% { opacity: 1;  transform: translateY(0) scale(1);     filter: blur(0);  text-shadow: 0 0 4px rgba(255,255,255,.9), 0 0 12px var(--c), 0 0 28px var(--c), 0 0 56px var(--c); }
}
/* 持续呼吸发光 */
@keyframes neon-breathe {
    0%, 100% { text-shadow: 0 0 4px rgba(255,255,255,.85), 0 0 10px var(--c), 0 0 24px var(--c), 0 0 46px var(--c); }
    50%      { text-shadow: 0 0 6px rgba(255,255,255,1), 0 0 18px var(--c), 0 0 40px var(--c), 0 0 92px var(--c); }
}
@keyframes char-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
/* 招牌角灯（金点闪烁） */
.fancy-title .tt-bulb {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ffe08a;
    box-shadow: 0 0 10px #ffe08a, 0 0 22px rgba(255, 214, 120, .8);
    animation: bulb-blink 2.4s ease-in-out infinite;
    pointer-events: none;
}
.fancy-title .tt-bulb.b1 { top: 7px;   left: 11px; }
.fancy-title .tt-bulb.b2 { bottom: 7px; right: 11px; animation-delay: 1.2s; }
@keyframes bulb-blink {
    0%, 100% { opacity: 1;    box-shadow: 0 0 8px #ffe08a, 0 0 18px rgba(255, 214, 120, .8); }
    50%      { opacity: .35;  box-shadow: 0 0 3px rgba(255, 214, 120, .6); }
}

.hero .sub {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
}
.hero .badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 7px 18px;
    font-size: 13px;
    color: #b8c6ff;
    border: 1px solid rgba(139, 163, 255, .3);
    border-radius: 999px;
    background: rgba(109, 139, 255, .08);
    backdrop-filter: blur(6px);
}
.hero .badge .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}
.hero .badge .badge-count { font-weight: 600; color: #dfe6ff; white-space: nowrap; }
.hero .badge .badge-sep { color: rgba(184, 198, 255, .45); }
.hero .badge .quote-text {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    background: linear-gradient(120deg, #ffd479, #ff9a76, #c08bff, #8ba3ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shine 6s linear infinite;
    vertical-align: -1px;
}
.hero .badge .quote-text::after {
    content: "";
    display: inline-block;
    width: 2px; height: 1.05em;
    margin-left: 4px;
    background: var(--accent);
    vertical-align: -2px;
    animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(.75); }
}

/* ===== 卡片（玻璃拟态） ===== */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
    transition: border-color .25s, box-shadow .25s;
}

h2 { font-size: 18px; margin-bottom: 18px; letter-spacing: .5px; }
.count { font-size: 13px; color: var(--muted); font-weight: normal; margin-left: 6px; }

/* ===== 表单 ===== */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .field { flex: 1 1 200px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; margin-bottom: 7px; font-weight: 500; color: #c3cbe6; }
.field label em { color: var(--danger); font-style: normal; }

.field input,
.field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: rgba(0, 0, 0, .25);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder,
.field textarea::placeholder { color: #5f6a8c; }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 139, 255, .18), var(--glow);
    background: rgba(0, 0, 0, .35);
}
.field textarea { resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* 紧凑发布表单 */
.form-compact { padding: 14px 16px 16px; margin-bottom: 26px; }
.form-compact .field { margin-bottom: 10px; }
.form-compact .field input,
.form-compact .field textarea { padding: 9px 13px; font-size: 14px; }
.form-compact .form-foot { display: flex; justify-content: flex-end; }
.form-compact .btn { padding: 8px 26px; }

/* 照片上传 */
.upload-field { margin-bottom: 10px; }
.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px dashed rgba(139, 163, 255, .4);
    border-radius: 10px;
    background: rgba(109, 139, 255, .06);
    color: #aebcff;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
    user-select: none;
}
.upload-btn:hover { border-color: var(--primary); background: rgba(109, 139, 255, .14); color: #dfe6ff; }
.photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-preview .thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--card-border); }
.photo-preview .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-preview .thumb .x {
    position: absolute; top: 2px; right: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(0, 0, 0, .65); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1; cursor: pointer;
    border: 1px solid rgba(255,255,255,.3);
}

/* ===== 留言照片缩略图 ===== */
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photos .thumb {
    display: block;
    width: 92px; height: 92px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, .3);
    transition: transform .18s, box-shadow .2s, border-color .2s;
}
.photos .thumb:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(109, 139, 255, .35);
}
.photos .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===== 灯箱（点击放大） ===== */
.lightbox {
    position: fixed; inset: 0;
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(4, 8, 20, .88);
    backdrop-filter: blur(10px);
    opacity: 0; pointer-events: none;
    transition: opacity .25s;
}
.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox .lb-img {
    max-width: 90vw; max-height: 86vh;
    border-radius: 12px;
    box-shadow: 0 12px 60px rgba(0, 0, 0, .7);
    transform: scale(.94);
    transition: transform .25s cubic-bezier(.2, .8, .3, 1);
    object-fit: contain;
}
.lightbox.show .lb-img { transform: scale(1); }
.lightbox .lb-close {
    position: absolute; top: 18px; right: 22px;
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
    color: #fff; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .2s;
}
.lightbox .lb-close:hover { background: rgba(255, 255, 255, .22); transform: rotate(90deg); }
.lightbox .lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
    color: #fff; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.lightbox .lb-nav:hover { background: rgba(255, 255, 255, .2); }
.lightbox .lb-prev { left: 20px; }
.lightbox .lb-next { right: 20px; }
.lightbox .lb-count {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    color: rgba(255, 255, 255, .75); font-size: 13px;
    background: rgba(0, 0, 0, .4); padding: 4px 12px; border-radius: 999px;
}

/* 蜜罐：对人和屏幕阅读器完全隐藏 */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .2s, border-color .2s, background .2s;
}
.btn:hover { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 18px rgba(109, 139, 255, .35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #7d99ff, #b57dff);
    box-shadow: 0 6px 26px rgba(109, 139, 255, .55);
    transform: translateY(-2px);
}

.btn-danger { color: #ff9b9b; }
.btn-danger:hover { border-color: var(--danger); background: rgba(255, 107, 107, .12); box-shadow: 0 0 16px rgba(255, 107, 107, .25); }

/* 点击涟漪 */
.btn-primary { position: relative; overflow: hidden; }
.ripple {
    position: absolute;
    width: 14px; height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    transform: scale(0);
    animation: ripple .6s ease-out forwards;
    pointer-events: none;
}
@keyframes ripple { to { transform: scale(16); opacity: 0; } }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

/* ===== 提示条 ===== */
.alert {
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    backdrop-filter: blur(8px);
    animation: slide-in .45s cubic-bezier(.2, .8, .3, 1);
    border: 1px solid;
}
.alert-ok { background: rgba(52, 211, 153, .1); color: #6ee7b7; border-color: rgba(52, 211, 153, .3); box-shadow: 0 0 20px rgba(52, 211, 153, .12); }
.alert-err { background: rgba(255, 107, 107, .1); color: #ffa1a1; border-color: rgba(255, 107, 107, .3); }

@keyframes slide-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 留言列表 ===== */
.list { margin-bottom: 48px; }

.msg:hover {
    border-color: rgba(139, 163, 255, .35);
    box-shadow: 0 8px 36px rgba(0, 0, 0, .45), 0 0 20px rgba(109, 139, 255, .12);
}

.msg .msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2), var(--accent));
    background-size: 250% 250%;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    animation: shine 6s linear infinite;
    box-shadow: 0 0 10px rgba(109, 139, 255, .3);
    border: 1.5px solid rgba(255, 255, 255, .16);
}
/* 头像渐变变体（随机分配） */
.av-cat    { background: linear-gradient(135deg, #6d8bff, #a56bff); }
.av-dog    { background: linear-gradient(135deg, #ff9a62, #ff5e7e); }
.av-fox    { background: linear-gradient(135deg, #ffb35c, #ff7a59); }
.av-panda  { background: linear-gradient(135deg, #5f7a8a, #3d4f5f); }
.av-frog   { background: linear-gradient(135deg, #4de3c2, #2fae8f); }
.av-lion   { background: linear-gradient(135deg, #f2c94c, #e07b39); }
.av-tiger  { background: linear-gradient(135deg, #ff8a5c, #d94848); }
.av-rabbit { background: linear-gradient(135deg, #ff9ecb, #b57dff); }
.av-bear   { background: linear-gradient(135deg, #b08968, #7d5a44); }
.av-koala  { background: linear-gradient(135deg, #9aa7b8, #6f7d92); }
.av-melon  { background: linear-gradient(135deg, #53d769, #2ea94d); }
.msg-name { font-weight: 600; line-height: 1.25; }
.msg .msg-head time { font-size: 12px; color: var(--muted); line-height: 1.25; display: block; margin-top: 2px; }

/* 昵称后的 IP 归属地标签（小字、低存在感） */
.city {
    display: inline-block;
    margin-left: 5px;
    padding: 0 6px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(151, 160, 189, .8);
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 999px;
    vertical-align: 1px;
    white-space: nowrap;
}
.city::before { content: "📍"; margin-right: 2px; font-size: 9px; opacity: .75; }
.muted { font-size: 12px; color: var(--muted); font-weight: normal; margin-left: 6px; }
.tag {
    display: inline-block; margin-left: 6px; padding: 1px 9px;
    font-size: 12px; border-radius: 10px;
    background: rgba(255, 190, 60, .12); color: #ffd479;
    border: 1px solid rgba(255, 190, 60, .25);
}
.msg-content { white-space: pre-wrap; word-break: break-word; }
.msg-reply {
    margin-top: 14px; padding: 12px 15px;
    background: linear-gradient(135deg, rgba(109, 139, 255, .1), rgba(165, 107, 255, .08));
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
    font-size: 14px;
}
.msg-hidden { opacity: .55; }

.admin-form { margin-top: 16px; padding-top: 16px; border-top: 1px dashed rgba(255, 255, 255, .12); }
.admin-footer { margin: 26px 0 44px; }
.admin-footer form { display: inline; }

/* ===== 分页 ===== */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; }
.pager-info { font-size: 14px; color: var(--muted); }

/* ===== 空状态 ===== */
.empty {
    text-align: center; padding: 56px 16px;
    color: var(--muted); font-size: 15px;
    background: var(--card);
    border: 1px dashed rgba(255, 255, 255, .15);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

/* ===== 登录页 ===== */
.login-wrap { display: flex; justify-content: center; padding-top: 90px; }
.login-wrap .form-card { width: 100%; max-width: 380px; }

/* ===== 页脚 ===== */
footer {
    padding: 28px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, .06);
    position: relative;
    z-index: 1;
}
footer a { color: var(--muted); font-size: 13px; text-decoration: none; transition: color .2s; }
footer a:hover { color: var(--primary); }

/* ===== 入场动画（JS 配合 IntersectionObserver） ===== */
[data-anim] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .6s cubic-bezier(.2, .7, .3, 1), transform .6s cubic-bezier(.2, .7, .3, 1);
}
[data-anim].in { opacity: 1; transform: translateY(0); }

/* ===== 动效减弱偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    .aurora, .hero h1, .avatar, .hero .badge .dot { animation: none; }
    .hero .badge .quote-text { animation: none; }
    .hero .badge .quote-text::after { animation: none; }
    .fancy-title { animation: none; }
    .fancy-title .tt-char { animation: none; text-shadow: 0 0 10px var(--c), 0 0 26px var(--c); }
    .fancy-title .tt-bulb { animation: none; opacity: .85; }
    [data-anim] { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 560px) {
    .hero { padding: 20px 0 10px; }
    .hero h1 { font-size: 28px; }
    .fancy-title { padding: 6px 22px 12px; }
    .fancy-title .tt-char { font-size: 34px; letter-spacing: 2px; }
    .card { padding: 20px; }
    .row { flex-direction: column; gap: 0; }
}
