/* ===== 变量 ===== */
:root {
    --bg: #f7f7fb;
    --bg-soft: #eef0f6;
    --text: #222;
    --text-muted: #6b6f80;
    --border: #e0e0e6;

    --bubble-bg: rgba(255, 255, 255, .94);
    --bubble-border: #e6e7ee;
    --bubble-shadow: 0 6px 20px rgba(20, 20, 40, .08);
    --bubble-shadow-hover: 0 12px 30px rgba(20, 20, 40, .16);
    --bubble-nick: #4a6cf7;

    --reply-bg: #f0f3ff;
    --reply-border: #d8def8;

    --accent: #4a6cf7;
    --accent-hover: #3a5be0;
    --danger: #e5484d;
    --success: #2fa463;
    --warn: #cf9300;

    --topbar-bg: rgba(255, 255, 255, .85);
    --modal-backdrop: rgba(15, 18, 30, .4);

    --radius: 12px;
}

[data-theme="dark"] {
    --bg: #12131a;
    --bg-soft: #1a1c26;
    --text: #e8e8ee;
    --text-muted: #8f93a8;
    --border: #2a2d3a;

    --bubble-bg: rgba(35, 38, 50, .94);
    --bubble-border: #2e3140;
    --bubble-shadow: 0 6px 20px rgba(0, 0, 0, .4);
    --bubble-shadow-hover: 0 12px 30px rgba(0, 0, 0, .55);
    --bubble-nick: #8aa2ff;

    --reply-bg: #1e2233;
    --reply-border: #2e3350;

    --accent: #6d8bff;
    --accent-hover: #5a7bff;
    --danger: #ff6b70;
    --success: #4ecb82;
    --warn: #f0bb33;

    --topbar-bg: rgba(18, 19, 26, .85);
    --modal-backdrop: rgba(0, 0, 0, .65);
}

/* ===== 基础 ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background-color .25s ease, color .25s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 顶栏 ===== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}
.brand { font-weight: 600; letter-spacing: .5px; }
.topbar-actions { display: flex; gap: 6px; }

.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    width: 34px; height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color .15s;
}
.btn-icon:hover { background: var(--bg-soft); text-decoration: none; }

/* ===== 气泡墙 ===== */
.page-home { overflow: hidden; }

.bubble-field {
    position: fixed;
    top: 52px; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    isolation: isolate;
}

.bubble-field::before,
.bubble-field::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.bubble-field::before {
    width: 420px; height: 420px;
    top: -120px; left: -120px;
    background: radial-gradient(circle, var(--glow-1, rgba(74, 108, 247, .32)), transparent 70%);
    animation: bg-drift-1 22s ease-in-out infinite;
}

.bubble-field::after {
    width: 520px; height: 520px;
    bottom: -160px; right: -160px;
    background: radial-gradient(circle, var(--glow-2, rgba(255, 107, 180, .26)), transparent 70%);
    animation: bg-drift-2 28s ease-in-out infinite;
}

[data-theme="dark"] .bubble-field::before {
    background: radial-gradient(circle, var(--glow-1, rgba(109, 139, 255, .28)), transparent 70%);
}
[data-theme="dark"] .bubble-field::after {
    background: radial-gradient(circle, var(--glow-2, rgba(255, 107, 180, .18)), transparent 70%);
}

@keyframes bg-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(120px, 90px) scale(1.15); }
}
@keyframes bg-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-100px, -120px) scale(1.2); }
}

.bubble {
    position: absolute;
    top: 0; left: 0;
    max-width: 260px;
    min-width: 150px;
    padding: 10px 12px;
    background: var(--bubble-bg);
    border: 1px solid var(--bubble-border);
    border-radius: var(--radius);
    box-shadow: var(--bubble-shadow);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: box-shadow .3s ease, max-width .2s, outline-color .3s ease, outline-offset .3s ease;
    animation: bubble-float 8s ease-in-out infinite;
    will-change: transform;
    z-index: 1;
}
.bubble.dragging {
    cursor: grabbing;
    animation: none !important;
    box-shadow: var(--bubble-shadow-hover);
    z-index: 50;
}
.bubble:hover { box-shadow: var(--bubble-shadow-hover); }
.bubble.expanded {
    max-width: 360px;
    z-index: 60;
}

@keyframes bubble-float {
    0%   { transform: translate(0, 0) rotate(0deg); }
    20%  { transform: translate(4px, -12px) rotate(.8deg); }
    40%  { transform: translate(-3px, -18px) rotate(-.6deg); }
    60%  { transform: translate(5px, -10px) rotate(.4deg); }
    80%  { transform: translate(-4px, -14px) rotate(-.8deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.bubble-nick {
    color: var(--bubble-nick);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bubble-nick a { color: inherit; }
.bubble-check {
    color: var(--success);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}

.bubble-content { font-size: 13px; line-height: 1.55; }
.bubble-clip {
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.bubble-full { display: none; }
.bubble.expanded .bubble-clip { display: none; }
.bubble.expanded .bubble-full { display: block; }

/* ===== 公告气泡 ===== */
.bubble-announcement {
    background: linear-gradient(135deg, rgba(255, 237, 213, .96), rgba(255, 228, 230, .96));
    border-color: rgba(251, 146, 60, .55);
    box-shadow: 0 8px 24px rgba(251, 146, 60, .2);
    max-width: 280px;
    z-index: 40;
}
.bubble-announcement:hover {
    box-shadow: 0 12px 32px rgba(251, 146, 60, .32);
}
.bubble-announcement .bubble-nick {
    color: #d97706;
    font-weight: 700;
}
[data-theme="dark"] .bubble-announcement {
    background: linear-gradient(135deg, rgba(80, 50, 30, .96), rgba(80, 40, 50, .96));
    border-color: rgba(251, 146, 60, .4);
    box-shadow: 0 8px 24px rgba(251, 146, 60, .15);
}
[data-theme="dark"] .bubble-announcement:hover {
    box-shadow: 0 12px 32px rgba(251, 146, 60, .28);
}
[data-theme="dark"] .bubble-announcement .bubble-nick {
    color: #fbbf24;
}

.full-text {
    white-space: pre-wrap;
    word-break: break-word;
}
.full-reply {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--reply-bg);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
}
.reply-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: .5px;
}
.reply-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
}
.reply-time, .full-time {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.empty-hint {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 0 20px;
}

/* ===== 悬浮按钮 ===== */
.fab {
    position: fixed;
    right: 24px;
    bottom: 72px;
    width: 56px; height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(74, 108, 247, .4);
    transition: transform .15s, background-color .15s;
    z-index: 80;
}
.fab:hover { transform: translateY(-2px); background: var(--accent-hover); }

/* ===== 模态 ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--modal-backdrop);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.modal-panel {
    position: relative;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: min(520px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.modal-head h2 { margin: 0; font-size: 18px; }

/* ===== 表单 ===== */
.post-form label,
.login-box label {
    display: block;
    margin-bottom: 12px;
}
.post-form label > span,
.login-box label > span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 60px; font-family: inherit; }

.hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
}

.kaomoji-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 12px;
}
.kaomoji {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    line-height: 1.4;
}
.kaomoji:hover { border-color: var(--accent); }

.checkbox {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}
.checkbox input { width: auto; margin: 0; }
.checkbox span { color: var(--text) !important; margin: 0 !important; font-size: 13px !important; }

.form-actions { margin-top: 16px; display: flex; justify-content: flex-end; }

.btn-primary, .btn-danger {
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ===== 提示 ===== */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    border-left: 4px solid;
    line-height: 1.5;
}
.alert-success {
    background: rgba(47, 164, 99, .12);
    border-color: var(--success);
    color: var(--success);
}
.alert-error {
    background: rgba(229, 72, 77, .12);
    border-color: var(--danger);
    color: var(--danger);
}
.alert-info {
    background: rgba(74, 108, 247, .12);
    border-color: var(--accent);
    color: var(--accent);
}
[data-theme="dark"] .alert-success { background: rgba(78, 203, 130, .15); }
[data-theme="dark"] .alert-error   { background: rgba(255, 107, 112, .15); }
[data-theme="dark"] .alert-info    { background: rgba(109, 139, 255, .15); }

/* ===== 登录页 ===== */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 360px;
    background: var(--bubble-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--bubble-shadow);
}
.login-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.login-head h1 { font-size: 18px; margin: 0; }
.login-box button[type="submit"] { width: 100%; margin-top: 8px; }
.login-foot {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== 后台 ===== */
.admin-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 76px 20px 40px;
}
.filter-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 13px;
}
.filter-tab {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
}
.filter-tab:hover { text-decoration: none; border-color: var(--accent); }
.filter-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.filter-count { margin-left: auto; color: var(--text-muted); }

.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg-card {
    background: var(--bubble-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--bubble-shadow);
}
.msg-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}
.msg-meta .muted { color: var(--text-muted); }
.msg-time { font-size: 12px; color: var(--text-muted); }
.msg-content {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 10px 12px;
    background: var(--bg-soft);
    border-radius: 8px;
    margin-bottom: 10px;
}
.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.6;
}
.tag-private { background: rgba(207, 147, 0, .16);  color: var(--warn); }
.tag-replied { background: rgba(47, 164, 99, .16);  color: var(--success); }
.tag-pending { background: rgba(107, 111, 128, .16); color: var(--text-muted); }
[data-theme="dark"] .tag-private { background: rgba(240, 187, 51, .18); }
[data-theme="dark"] .tag-replied { background: rgba(78, 203, 130, .18); }

.reply-form textarea { font-size: 13px; min-height: 50px; }
.reply-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.delete-form { margin-top: 8px; display: flex; justify-content: flex-end; }

@media (max-width: 600px) {
    .bubble { max-width: 200px; }
    .msg-head { flex-direction: column; }
    .admin-main { padding-top: 66px; }
}

.admin-narrow { max-width: 640px; }

.settings-form { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }

.settings-section {
    background: var(--bubble-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--bubble-shadow);
}
.settings-section h2 {
    font-size: 15px;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
}
.settings-section label { display: block; margin-bottom: 12px; }
.settings-section label > span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.settings-section select {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    outline: none;
}
.settings-section select:focus { border-color: var(--accent); }
.settings-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: -6px 0 10px;
}
.icon-preview {
    font-size: 20px;
    vertical-align: middle;
    margin-left: 4px;
}

/* ===== 页脚 ===== */
.page-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 88px 8px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    z-index: 70;
    line-height: 1.6;
    word-break: break-word;
}
.page-footer a {
    color: var(--accent);
    text-decoration: none;
	pointer-events: auto;   /* 链接仍然可点 */
}
.page-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .page-footer {
        padding: 6px 76px 6px 12px;
        font-size: 11px;
    }
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 8px;
    font-size: 13px;
}
.pagination a,
.pagination .disabled {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, background-color .15s;
}
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.pagination .disabled {
    color: var(--text-muted);
    opacity: .5;
    cursor: not-allowed;
}
.pagination .page-info {
    color: var(--text-muted);
}

/* ===== 加载更多 ===== */
.load-more-wrap {
    position: fixed;
    left: 50%;
    bottom: 70px;
    transform: translateX(-50%);
    z-index: 75;
}
.load-more-btn {
    padding: 8px 22px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 108, 247, .35);
    transition: transform .15s, background-color .15s, opacity .15s;
    white-space: nowrap;
}
.load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    background: var(--accent-hover);
}
.load-more-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ===== 列表视图 ===== */
.list-view {
    position: fixed;
    top: 52px; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    padding: 20px 16px 80px;
    background: var(--bg);
    display: none;
    z-index: 30;
    -webkit-overflow-scrolling: touch;
}

body.view-list .list-view { display: block; }
body.view-list .bubble-field,
body.view-list .load-more-wrap {
    display: none !important;
}

.list-view-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-loading,
.list-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 60px 20px;
}

.list-card {
    background: var(--bubble-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--bubble-shadow);
}

.list-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 13px;
}
.list-card-head strong {
    color: var(--bubble-nick);
    font-weight: 600;
}
.list-card-head strong a {
    color: inherit;
}
.list-card-check {
    color: var(--success);
    font-size: 12px;
    padding: 1px 8px;
    background: rgba(47, 164, 99, .12);
    border-radius: 999px;
}
[data-theme="dark"] .list-card-check {
    background: rgba(78, 203, 130, .16);
}
.list-card-time {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.list-card-content {
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.list-card-reply {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--reply-bg);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 600px) {
    .list-card-time { margin-left: 0; width: 100%; }
}

.list-sentinel {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 20px 10px 32px;
    user-select: none;
}

/* ===== 新留言高亮 ===== */
.bubble.highlight,
.list-card.highlight {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow:
        0 0 0 10px rgba(74, 108, 247, .15),
        0 12px 36px rgba(74, 108, 247, .4);
    z-index: 55;
}
[data-theme="dark"] .bubble.highlight,
[data-theme="dark"] .list-card.highlight {
    box-shadow:
        0 0 0 10px rgba(109, 139, 255, .2),
        0 12px 36px rgba(109, 139, 255, .5);
}
.list-card.highlight {
    outline-offset: 2px;
}

/* ===== 留言编辑 ===== */
.msg-view-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.msg-edit {
    margin-bottom: 10px;
    padding: 14px;
    background: var(--bg-soft);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.edit-form label {
    display: block;
    margin-bottom: 10px;
}
.edit-form label > span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.edit-form input[type="text"],
.edit-form input[type="email"],
.edit-form textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bubble-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .15s;
}
.edit-form input:focus,
.edit-form textarea:focus {
    border-color: var(--accent);
}
.edit-form textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}
.edit-form .checkbox {
    display: flex !important;
    align-items: center;
    gap: 6px;
}
.edit-form .checkbox input {
    width: auto;
    margin: 0;
}
.edit-form .checkbox span {
    color: var(--text) !important;
    margin: 0 !important;
    font-size: 13px !important;
}

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 600px) {
    .edit-grid { grid-template-columns: 1fr; }
}

.msg-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

/* ============================================================
 * 风格主题
 * 明暗由 [data-theme] 管，风格由 [data-style] 管，两者正交
 * ============================================================ */

/* ===== 可爱风 ===== */
[data-style="cute"] {
    --bg: #fff5f8;
    --bg-soft: #ffe9f0;
    --text: #4a2c3a;
    --text-muted: #a87890;
    --border: #ffd9e5;
    --bubble-bg: rgba(255, 246, 250, .96);
    --bubble-border: #ffd0e0;
    --bubble-shadow: 0 6px 20px rgba(255, 130, 180, .18);
    --bubble-shadow-hover: 0 12px 32px rgba(255, 130, 180, .32);
    --bubble-nick: #ff5c94;
    --reply-bg: #fff0f6;
    --reply-border: #ffc9dc;
    --accent: #ff7aab;
    --accent-hover: #ff5c94;
    --success: #5fc98c;
    --danger: #ff5c7a;
    --warn: #ffa94d;
    --topbar-bg: rgba(255, 245, 250, .9);
    --modal-backdrop: rgba(80, 30, 60, .4);
    --radius: 22px;
    --glow-1: rgba(255, 130, 180, .35);
    --glow-2: rgba(180, 150, 255, .28);
}
[data-style="cute"][data-theme="dark"] {
    --bg: #2b1a22;
    --bg-soft: #3a2230;
    --text: #ffe6ee;
    --text-muted: #c89aae;
    --border: #4a2c3c;
    --bubble-bg: rgba(58, 34, 48, .95);
    --bubble-border: #5a3448;
    --bubble-shadow: 0 6px 20px rgba(0, 0, 0, .4);
    --bubble-shadow-hover: 0 12px 32px rgba(255, 100, 160, .32);
    --bubble-nick: #ff8cb5;
    --reply-bg: #3a2230;
    --reply-border: #5a3448;
    --accent: #ff8cb5;
    --accent-hover: #ff7aab;
    --success: #7ddca0;
    --danger: #ff7a90;
    --warn: #ffb866;
    --topbar-bg: rgba(43, 26, 34, .9);
    --modal-backdrop: rgba(0, 0, 0, .7);
    --glow-1: rgba(255, 120, 170, .3);
    --glow-2: rgba(150, 120, 220, .22);
}

/* ===== 科技风 ===== */
[data-style="tech"] {
    --bg: #eef3fb;
    --bg-soft: #dde7f5;
    --text: #0f1a2e;
    --text-muted: #5a6c8a;
    --border: #b9cae2;
    --bubble-bg: rgba(245, 250, 255, .95);
    --bubble-border: #8fb8e0;
    --bubble-shadow: 0 0 14px rgba(0, 160, 220, .18);
    --bubble-shadow-hover: 0 0 28px rgba(0, 180, 240, .4);
    --bubble-nick: #0078b8;
    --reply-bg: #e0f0fc;
    --reply-border: #a8d4ee;
    --accent: #0090d0;
    --accent-hover: #0078b8;
    --success: #17a673;
    --danger: #e0356a;
    --warn: #e08a00;
    --topbar-bg: rgba(238, 243, 251, .9);
    --modal-backdrop: rgba(10, 20, 40, .55);
    --radius: 6px;
    --glow-1: rgba(0, 160, 220, .22);
    --glow-2: rgba(120, 80, 255, .18);
}
[data-style="tech"][data-theme="dark"] {
    --bg: #070d18;
    --bg-soft: #0f1727;
    --text: #d0e0f5;
    --text-muted: #5a6c8a;
    --border: #1c2a44;
    --bubble-bg: rgba(13, 20, 35, .92);
    --bubble-border: #1e3a5f;
    --bubble-shadow: 0 0 14px rgba(0, 200, 255, .15);
    --bubble-shadow-hover: 0 0 28px rgba(0, 220, 255, .38);
    --bubble-nick: #3ec8ff;
    --reply-bg: #0c1a2c;
    --reply-border: #1e3a5f;
    --accent: #00d4ff;
    --accent-hover: #33e0ff;
    --success: #2bd68d;
    --danger: #ff5c88;
    --warn: #ffb133;
    --topbar-bg: rgba(7, 13, 24, .88);
    --modal-backdrop: rgba(0, 0, 0, .78);
    --glow-1: rgba(0, 200, 255, .28);
    --glow-2: rgba(120, 80, 255, .22);
}

/* ===== 护眼绿 ===== */
[data-style="green"] {
    --bg: #eef6ec;
    --bg-soft: #e0efdd;
    --text: #2a3a2a;
    --text-muted: #6b7d6b;
    --border: #cfe3cb;
    --bubble-bg: rgba(250, 255, 248, .95);
    --bubble-border: #c8dfc4;
    --bubble-shadow: 0 6px 20px rgba(60, 120, 60, .12);
    --bubble-shadow-hover: 0 12px 30px rgba(60, 120, 60, .22);
    --bubble-nick: #3e8c50;
    --reply-bg: #e6f3e3;
    --reply-border: #bcd9b8;
    --accent: #4a9c5c;
    --accent-hover: #3e8c50;
    --success: #3e8c50;
    --danger: #c96a5c;
    --warn: #b8892e;
    --topbar-bg: rgba(238, 246, 236, .9);
    --modal-backdrop: rgba(30, 50, 30, .42);
    --radius: 14px;
    --glow-1: rgba(80, 160, 90, .22);
    --glow-2: rgba(140, 200, 130, .2);
}
[data-style="green"][data-theme="dark"] {
    --bg: #162116;
    --bg-soft: #1f2d1f;
    --text: #d5e2d3;
    --text-muted: #8fa38d;
    --border: #2e3e2e;
    --bubble-bg: rgba(31, 45, 31, .94);
    --bubble-border: #384a38;
    --bubble-shadow: 0 6px 20px rgba(0, 0, 0, .35);
    --bubble-shadow-hover: 0 12px 30px rgba(80, 180, 100, .22);
    --bubble-nick: #7bd48d;
    --reply-bg: #1c2a1c;
    --reply-border: #384a38;
    --accent: #6bc47e;
    --accent-hover: #7bd48d;
    --success: #6bc47e;
    --danger: #e08573;
    --warn: #d4a24a;
    --topbar-bg: rgba(22, 33, 22, .9);
    --modal-backdrop: rgba(0, 0, 0, .7);
    --glow-1: rgba(80, 180, 100, .22);
    --glow-2: rgba(140, 220, 140, .16);
}

/* ===== 风格选择器 UI ===== */
.style-picker {
    position: relative;
    display: inline-block;
}
.style-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    background: var(--bubble-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--bubble-shadow-hover);
    padding: 6px;
    z-index: 150;
    animation: menu-in .15s ease-out;
}
.style-menu[hidden] { display: none; }

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

.style-menu-title {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 8px 6px;
    letter-spacing: .5px;
}
.style-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color .12s;
}
.style-item:hover { background: var(--bg-soft); }
.style-item.active {
    background: var(--accent);
    color: #fff;
}
.style-item.active .style-dot {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .6);
}
.style-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, .08);
}
.style-dot-default { background: linear-gradient(135deg, #4a6cf7, #f7f7fb); }
.style-dot-cute    { background: linear-gradient(135deg, #ff7aab, #fff5f8); }
.style-dot-tech    { background: linear-gradient(135deg, #00d4ff, #0a0e1a); }
.style-dot-green   { background: linear-gradient(135deg, #4a9c5c, #eef6ec); }