:root {
    --blue: #111827;
    --text: #111827;
    --sub: #6b7280;
    --bg: #f5f5f5;
    --card: #ffffff;
    --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    background: #111827;
    color: rgba(0, 0, 0, .88);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    overflow-x: hidden;
}

body::before { content: none; }

.desktop-header,
.desktop-sidebar { display: none; }
.desktop-layout { display: block; }
.mobile-header { display: none; }

.bg {
    position: fixed;
    background: #111827;
    z-index: -1;
    border-radius: 999px;
    opacity: .88;
.message-item em { margin-left: 6px; padding: 2px 6px; border-radius: 999px; color: #111827; background: #f5f5f5; font-size: 11px; font-style: normal; }
    animation: none;
}
.bg-one { width: 305px; height: 303px; left: calc(50% - 535px); top: 494px; background: radial-gradient(circle, rgba(255,216,230,.8), transparent 70%); }
.bg-two { width: 305px; height: 303px; right: calc(50% - 645px); top: 662px; background: radial-gradient(circle, rgba(218,219,255,.85), transparent 70%); }
.bg-three { width: 331px; height: 186px; left: 0; bottom: 0; background: radial-gradient(ellipse, rgba(255,229,188,.86), transparent 72%); }

@keyframes floaty {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(10px, -16px, 0) scale(1.04); }
}

.love-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    color: #111827;
    text-align: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 238, 246, .92), transparent 24%),
        linear-gradient(180deg, #fff, #fff7fb 55%, #f8fafc);
    transition: opacity .45s ease, visibility .45s ease;
}
.love-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-card {
    width: min(320px, calc(100vw - 48px));
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 28px 26px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .08);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}
.loader-heart {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: #ff6fa8;
    background: #fff0f6;
    font-size: 34px;
    line-height: 1;
    animation: heartBeat 1.05s ease-in-out infinite;
}
.loader-heart img {
    width: 72%;
    height: 72%;
    display: block;
    object-fit: contain;
}
.love-loader span { font-size: 17px; font-weight: 700; }
.love-loader small { font-size: 13px; color: #6b7280; }
.loader-progress {
    width: 100%;
    height: 7px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}
.loader-progress i {
    width: 0%;
    height: 100%;
    display: block;
    border-radius: inherit;
    background: linear-gradient(90deg, #1677ff, #8b5cf6, #ff6fa8);
    transition: width .18s ease;
}
.love-loader em { color: #94a3b8; font-size: 12px; font-style: normal; }

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.08); }
}

@keyframes loaderHide {
    to { opacity: 0; transform: translate(-50%, -16px); pointer-events: none; }
}

.shell {
    width: 460px;
    min-height: 100vh;
    margin: 0 auto;
    display: block;
    background: #fff;
    border-radius: 18px 18px 0 0;
}

.feed-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    padding: 12px 0px 60px 0px;
}

.topic-filter-bar {
    width: 436px;
    margin: 0 auto 10px;
    padding: 10px 12px;
    display: none;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
}
.search-bar {
    width: 436px;
    margin: 0 auto 10px;
    display: flex;
    gap: 8px;
}
.search-bar input { flex: 1; border: 0; border-radius: 14px; background: #f8fafc; }
.search-bar button { width: auto; height: 40px; padding: 0 14px; border-radius: 14px; background: #000; color: #fff; }
.topic-filter-bar.is-active { display: flex; }
.topic-filter-bar strong { color: #111827; }
.topic-filter-bar button {
    padding: 6px 10px;
    color: #111827;
    background: #fff;
    border: 1px solid #111827;
    box-shadow: none;
    font-size: 12px;
}

.page-view { display: none; }
.page-view.active { display: block; }
.explore-page,
.publish-page,
.message-page,
.user-page {
    min-height: 100vh;
    padding: 16px 12px 82px;
    background: #f8fafc;
}

.page-title { margin-bottom: 14px; }
.page-title h1 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    line-height: 36px;
    font-weight: 800;
}
.page-title p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}
.pet-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .86);
}
.pet-card {
    height: 86px;
    padding: 10px 6px 8px;
    display: grid;
    place-items: center;
    gap: 7px;
    border: 0;
    border-radius: 14px;
    color: rgba(0,0,0,.88);
    background: #fff;
    box-shadow: none;
    font-weight: 400;
}
.pet-card img { width: 42px; height: 42px; display: block; }
.pet-card span { font-size: 14px; line-height: 18px; }
.pet-card:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15, 23, 42, .06); }

.topic-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .86);
}
.topic-card {
    width: 100%;
    min-height: 68px;
    padding: 12px;
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-areas: "rank name" "rank meta";
    gap: 4px 10px;
    align-items: center;
    border-radius: 14px;
    color: #111827;
    background: #fff;
    box-shadow: none;
    text-align: left;
}
.topic-card i {
    grid-area: rank;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: #111827;
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}
.topic-card span { grid-area: name; color: #0f172a; font-size: 15px; font-weight: 700; }
.topic-card small { grid-area: meta; color: #64748b; font-size: 12px; }
.topic-card:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15, 23, 42, .06); }

.topbar {
    position: relative;
    height: 45px;
    display: grid;
    place-items: center;
    margin: -16px -12px 11px;
    background: rgba(255, 255, 255, .92);
}
.topbar strong { color: #111827; font-size: 17px; font-weight: 700; }
.back-home {
    position: absolute;
    left: 12px;
    top: 4px;
    width: 38px;
    height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #111827;
    background: transparent;
    box-shadow: none;
    font-size: 34px;
    font-weight: 300;
}
.publish-page {
    background: #f8fafc;
}
.publish-form {
    display: block;
    margin: 0 4px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.publish-field {
    display: block;
    margin-top: 16px;
    color: #111827;
    font-size: 14px;
    font-weight: 400;
}
.publish-field:first-child { margin-top: 0; }
.publish-field > span {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}
.publish-form input,
.publish-form textarea,
.publish-form select {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #333;
    font-size: 17px;
    line-height: 1.5;
    padding: 0;
}
.publish-form input::placeholder,
.publish-form textarea::placeholder { color: #94a3b8; }
.publish-form select {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    background: #f8fafc;
    font-size: 14px;
}
.publish-textarea-wrap {
    position: relative;
}
.publish-form textarea { min-height: 128px; resize: vertical; }
.publish-form em {
    position: absolute;
    right: 0;
    bottom: 0;
    color: #94a3b8;
    font-size: 12px;
    font-style: normal;
    pointer-events: none;
}
.mention-btn,
.topic-add-btn {
    width: auto;
    min-height: 34px;
    padding: 6px 14px;
    color: #111827;
    background: #fff;
    border: 1px solid #111827;
    box-shadow: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}
.topic-add-btn { margin-top: 8px; }
.mention-picker { display: grid; gap: 8px; }
.mention-picker input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-size: 14px;
}
.mention-selected { display: flex; flex-wrap: wrap; gap: 8px; }
.mention-selected button {
    width: auto;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #111827;
    border-radius: 999px;
    color: #111827;
    background: #fff;
    box-shadow: none;
    font-size: 13px;
}
.mention-results {
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    background: #fafafa;
}
.mention-empty { padding: 10px; color: #94a3b8; text-align: center; font-size: 13px; }
.mention-result-item {
    width: 100%;
    min-height: 46px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    color: #111827;
    background: #fff;
    box-shadow: none;
    text-align: left;
}
.mention-result-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.mention-result-item span { display: grid; gap: 2px; flex: 1; min-width: 0; }
.mention-result-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mention-result-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #94a3b8; font-size: 12px; }
.mention-result-item em { color: #111827; font-size: 12px; font-style: normal; }
.publish-image-field { min-height: 108px; }
.image-preview-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.upload-btn {
    width: 86px;
    height: 86px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #111827;
    background: #fff;
    border: 1px dashed #111827;
    border-radius: 14px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 600;
}
.publish-actions {
    display: block;
    margin-top: 16px;
}
.submit-post {
    width: 100%;
    height: 46px;
    margin: 0;
    border-radius: 14px;
    box-shadow: none;
    font-size: 16px;
    font-weight: 700;
}
.submit-post {
    color: #fff;
    background: #000;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .16);
}
.mention-btn:hover,
.topic-add-btn:hover,
.upload-btn:hover { background: #f5f5f5; }
.submit-post:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(0, 0, 0, .22); }

.message-list { display: grid; gap: 10px; }
.message-empty {
    min-height: 220px;
    padding: 34px 24px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    border-radius: 22px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    color: #111827;
    text-align: center;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .06);
}
.message-empty span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: #f3f4f6;
    font-size: 28px;
}
.message-empty strong { font-size: 17px; font-weight: 800; }
.message-empty small { max-width: 240px; color: #6b7280; font-size: 13px; line-height: 1.6; }
.message-page { position: relative; }
.message-item {
    width: 100%;
    min-height: 74px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 16px;
    background: #fff;
    box-shadow: none;
    color: #111827;
    text-align: left;
}
.message-item b {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #111827;
    font-size: 18px;
}
.message-item span { display: grid; gap: 5px; }
.message-item strong { font-size: 15px; font-weight: 700; }
.message-item em { margin-left: 6px; padding: 2px 6px; border-radius: 999px; color: #111827; background: #f5f5f5; font-size: 11px; font-style: normal; }
.message-item small { color: #6b7280; font-size: 13px; }

.message-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.message-toolbar h2 { margin: 0; font-size: 18px; }
.message-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #ff4d4f; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.message-badge[hidden] { display: none; }
.mobile-tab .message-badge { position: absolute; top: -8px; right: 0px; z-index: 2; }

.notif-item {
    width: 100%;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
    color: #111827;
    text-align: left;
    cursor: pointer;
    transition: background .15s;
}
.notif-item:hover { background: #f9fafb; }
.notif-item.unread { border-left: 3px solid #1677ff; }
.notif-icon { font-size: 24px; flex-shrink: 0; width: 40px; text-align: center; }
.notif-body { display: grid; gap: 4px; flex: 1; min-width: 0; }
.notif-body strong { font-size: 15px; }
.notif-body small { color: #6b7280; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

[data-user-id], [data-user-id] .name, [data-user-id] strong, [data-user-id] img { cursor: pointer; }
.user-profile-dialog { min-width: 280px; }
.login-empty {
    margin: 26px 0 0;
    padding: 28px 26px;
    display: grid;
    justify-items: center;
    text-align: center;
    border-radius: 18px;
    background: #fff;
}
#messageLoginEmpty {
    position: absolute;
    inset: 0;
    z-index: 20;
    margin: 0;
    padding: 0 24px 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: rgba(255, 255, 255, .88);
    box-shadow: none;
}
.login-empty[hidden] { display: none!important; }
.login-empty-card {
    width: min(320px, 100%);
    padding: 24px 18px 18px;
    text-align: center;
    border-radius: 16px;
    background: #fff;
}
.login-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #f3f7ff;
    font-size: 30px;
}
.login-empty img { width: 96px; height: 96px; margin-bottom: 10px; }
.login-empty h2 { margin: 0 0 8px; color: #111827; font-size: 18px; }
.login-empty p { margin: 0 0 18px; color: #6b7280; line-height: 1.6; }
.login-empty a{
    width: 100%;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: #000;
    text-decoration: none;
    font-weight: 700;
}

.user-page { background: #f1f5f9; }
.user-profile-head {
    padding: 32px 12px 26px;
    background: #f1f5f9;
}

.profile-card {
    width: 100%;
    min-height: 64px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 0;
    color: #111827;
    background: transparent;
    box-shadow: none;
    text-align: left;
}
.profile-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.profile-card span { display: grid; gap: 4px; }
.profile-card strong { color: #0f172a; font-size: 20px; font-weight: 700; line-height: 28px; }
.profile-card small { color: #8c8c8c; font-size: 14px; line-height: 20px; }
.user-content-panel {
    padding: 0 16px 16px;
}
.unlock-card {
    margin-top: 0;
    padding: 20px 16px;
    border-radius: 16px;
    background: #fff;
}
.unlock-card h2,
.unlock-card p,
.unlock-actions { padding: 0; }
.unlock-card h2 { margin: 0 0 8px; color: #111827; font-size: 17px; font-weight: 600; line-height: 24px; }
.unlock-card p { margin: 0 0 16px; color: #8c8c8c; font-size: 14px; line-height: 20px; }
.unlock-card a {
    width: 100%;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: #000;
    text-decoration: none;
    font-weight: 600;
}
.user-menu { margin-top: 12px; overflow: hidden; border-radius: 16px; background: #fff; }
.user-menu button {
    width: 100%;
    height: 60px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
    color: #111827;
    background: #fff;
    box-shadow: none;
    font-weight: 500;
}
.user-menu button + button { border-top: 1px solid #f5f5f5; }
.user-menu span { display: flex; align-items: center; gap: 12px; color: #111827; font-size: 15px; }
.user-menu img { width: 22px; height: 22px; filter: brightness(0) saturate(100%) invert(7%) sepia(10%) saturate(1467%) hue-rotate(182deg) brightness(95%) contrast(89%); }
.user-menu i { color: #bfbfbf; font-size: 24px; font-style: normal; }

.profile-editor {
    margin-top: 12px;
    padding: 18px;
    display: grid;
    gap: 16px;
    border-radius: 18px;
    background: #fff;
}
.profile-editor[hidden] { display: none; }
.profile-editor h2 { margin: 0; color: #111827; font-size: 17px; }
.profile-editor form { display: grid; gap: 12px; }
.profile-editor label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 600; }
.profile-editor input {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: #f8fafc;
    color: #111827;
}
.profile-editor button {
    height: 42px;
    border-radius: 14px;
    color: #fff;
    background: #000;
    box-shadow: none;
}

.post-detail-page {
    min-height: 100vh;
    padding: 0 0 160px;
    background: #fff;
}
.detail-header {
    position: sticky;
    top: 0;
    z-index: 8;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 50px;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.detail-header .back-home { left: 8px; top: 9px; }
.detail-avatar { width: 32px; height: 32px; border-radius: 50%; }
.detail-header strong { display: block; color: #111827; font-size: 14px; line-height: 15px; }
.detail-header small { display: block; margin-top: 4px; color: #94a3b8; font-size: 11px; }
.detail-body { padding-bottom: 20px; }
.detail-body h1 {
    margin: 0;
    padding: 16px 12px;
    color: #0f172a;
    font-size: 15px;
    line-height: 24px;
    font-weight: 600;
}
.detail-body p#detailContent {
    margin: 0;
    padding: 0 12px;
    color: #1e293b;
    font-size: 15px;
    line-height: 32px;
    white-space: pre-wrap;
}
.detail-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 12px;
}
.detail-gallery .image-tile,
.detail-gallery img { width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; background: #f8fafc; }
.detail-gallery img { object-fit: cover; }
.topic-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    color: #64748b;
    font-size: 12px;
}
.topic-row span { cursor: pointer; }
.topic-row-mentions {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.topic-row-mentions b { color: #94a3b8; font-size: 12px; font-weight: 500; }
.topic-row-mentions button {
    width: auto;
    min-height: 26px;
    padding: 3px 9px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #111827;
    background: #fff;
    box-shadow: none;
    font-size: 12px;
}
.detail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 12px;
    color: #64748b;
}
.detail-actions button {
    width: fit-content;
    height: 40px;
    display: grid;
    place-items: center;
    color: #64748b;
    background: #f8fafc;
    box-shadow: none;
    font-weight: 500;
}
.detail-actions .icon { width: 18px; height: 18px; filter: brightness(0) saturate(100%) invert(42%) sepia(13%) saturate(711%) hue-rotate(176deg) brightness(91%) contrast(89%); }
.detail-actions .liked .icon { filter: none; }
.detail-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    font-size: 13px;
    margin-left: auto;
}
.detail-views em { font-style: normal; }
.comment-section {
    border-top: 1px solid #f1f5f9;
    padding: 16px 12px;
}
.comment-section > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}
.comment-section strong { display: block; color: #334155; font-size: 14px; line-height: 20px; }
.comment-section small { display: block; margin-top: 4px; color: #64748b; font-size: 12px; }
.comment-section header em { padding: 4px 8px; border-radius: 999px; color: #64748b; background: #f8fafc; font-size: 11px; font-style: normal; }
.comment-list { display: grid; gap: 12px; }
.comment-empty, .comment-more {
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 32px 16px;
    border-radius: 16px;
    color: #94a3b8;
    background: #f8fafc;
    font-size: 14px;
}
.comment-more { cursor: pointer; padding: 14px; font-weight: 600; color: #111827; background: #fff; border: 1px solid #111827; }
.comment-more:hover { background: #f5f5f5; }
.comment-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
}
.comment-card > div { flex: 1; }
.comment-meta { display: flex; justify-content: space-between; gap: 10px; }
.comment-meta strong { color: #334155; }
.comment-author-badge {
    display: inline-grid;
    place-items: center;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 999px;
    color: #fff;
    background: #111827;
    font-size: 10px;
}
.comment-meta small { color: #94a3b8; font-size: 11px; }
.comment-meta em { color: #94a3b8; font-size: 12px; font-style: normal; }
.comment-card p { margin: 8px 0 6px; color: #334155; line-height: 24px; }
.comment-card button { padding: 0; color: #64748b; background: transparent; box-shadow: none; font-size: 13px; font-weight: 400; }
.comment-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.comment-tools .liked { color: #111827; font-weight: 700; }
.comment-tools .delete-comment { color: #ef4444; }
.comment-tools .report-btn { color: #94a3b8; }
.comment-composer {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 22;
    width: 70vw;
    max-width: 800px;
    min-height: 91px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 18px 18px 0 0;
    background: rgba(255,255,255,.95);
    transform: translateX(-50%);
}
.comment-composer .composer-row {
    display: flex;
    gap: 8px;
}
.reply-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    border-radius: 10px;
    background: #f5f5f5;
    font-size: 13px;
    color: #111827;
}
.reply-hint strong { font-weight: 700; }
.reply-hint button {
    all: unset;
    cursor: pointer;
    font-size: 18px;
    color: #94a3b8;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
}
.reply-hint button:hover { color: #ef4444; }
.reply-hint[hidden] { display: none; }
.comment-composer .composer-row textarea {
    flex: 1;
    min-height: 65px;
    border: 0;
    border-radius: 16px;
    padding: 10px 12px;
    background: #f8fafc;
    resize: none;
}
.comment-composer .composer-row button {
    align-self: flex-end;
    height: 40px;
    padding: 7px 12px;
    border-radius: 8px;
    color: #111827;
    background: #fff;
    box-shadow: none;
    font-size: 14px;
    font-weight: 500;
}
.comment-composer .composer-row button:not(:disabled) { color: #fff; background: #000; }
.comment-composer .composer-row button:disabled { opacity: .55; cursor: not-allowed; }

.auth-page {
    min-height: 100vh;
    padding: 0 20px 24px;
    background: #fff;
}
.auth-wrap {
    width: 308px;
    margin: 0 auto;
    padding: 88px 20px 24px;
}
.register-wrap { padding-top: 96px; }
.auth-title { text-align: center; margin-bottom: 20px; }
.auth-title h1 {
    margin: 0;
    color: #1f2937;
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
}
.auth-title p {
    margin: 10px auto 0;
    color: #9ca3af;
    font-size: 14px;
    line-height: 1.5;
}
.auth-form { display: grid; gap: 12px; }
.register-wrap .auth-form { gap: 10px; }
.auth-field {
    height: 51px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-radius: 999px;
    background: #f3f4f6;
}
.auth-field span { width: 26px; text-align: center; font-size: 17px; filter: grayscale(1); opacity: .75; }
.auth-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: 15px;
}
.code-field { padding-right: 6px; }
.code-field button {
    height: 38px;
    padding: 0 12px;
    color: #111827;
    background: #fff;
    box-shadow: none;
    font-size: 13px;
    font-weight: 600;
}
.remember-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: -2px 0 0 4px;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.remember-login input {
    width: 16px;
    height: 16px;
    accent-color: #111827;
}
.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0 8px;
    color: #9ca3af;
    font-size: 14px;
}
.auth-links a { color: #111827; text-decoration: none; }
.auth-links a:first-child { color: #9ca3af; }
.auth-links.single { justify-content: flex-end; gap: 2px; }
.auth-submit,
.auth-home {
    width: 244px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 8px auto 0;
    border-radius: 999px;
    color: #fff;
    background: #000;
    box-shadow: none;
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
}
.auth-home { margin-top: 24px; }
.auth-back { left: calc(50% - 220px); top: 14px; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 18, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.lightbox.active { display: flex; }
.lightbox img {
    max-width: min(92vw, 920px);
    max-height: 86vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .36);
}
.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    box-shadow: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.lightbox-close {
    top: 22px;
    right: 22px;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 30px;
    font-weight: 300;
}
.lightbox-nav {
    top: 50%;
    width: 48px;
    height: 64px;
    padding: 0;
    border-radius: 18px;
    font-size: 46px;
    font-weight: 200;
    transform: translateY(-50%);
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-count {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    font-size: 13px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.gallery img,
.detail-gallery img { cursor: zoom-in; }

.brandbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    backdrop-filter: blur(18px) saturate(1.25);
    border-bottom: 1px solid var(--line);
}
.brandbar strong { font-size: 18px; letter-spacing: .06em; }
.logo-dot {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hot), #ffc0d8);
    box-shadow: 0 0 0 6px rgba(255, 93, 158, .13);
    vertical-align: -1px;
}
.admin-link, .brandbar a { color: var(--hot); text-decoration: none; font-weight: 700; }

.composer {
    margin: 18px;
    padding: 15px;
    border: 1px solid rgba(255, 171, 207, .46);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,244,250,.9)),
        radial-gradient(circle at 100% 0, rgba(255, 119, 174, .2), transparent 34%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 12px 34px rgba(255, 105, 170, .1);
}
.composer-top { display: flex; gap: 11px; align-items: center; margin-bottom: 12px; }
.composer-title { font-weight: 900; }
.composer p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.avatar.small { width: 38px; height: 38px; }
.composer-bottom { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
textarea, input, select {
    width: 100%;
    border: 1px solid #f2d7e8;
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 0;
    color: var(--text);
    background: rgba(255,255,255,.92);
    outline: none;
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
textarea { min-height: 86px; resize: vertical; }
button {
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    color: var(--text);
    background: linear-gradient(135deg, var(--hot), #ff9dc6);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(255, 93, 158, .22);
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
button:hover { box-shadow: 0 14px 26px rgba(255, 93, 158, .28); }
button:active { transform: translateY(0) scale(.98); }

.post {
    position: relative;
    width: 436px;
    margin: 0 auto 12px;
    padding: 14px 14px 16px;
    border-bottom: 0;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}
.post::before { content: none; }
.post:hover { background: #fff; transform: none; }
.post-head { display: flex; align-items: center; gap: 10px; height: 40px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #f3f4f6; border: 0; box-shadow: none; }
.name-row { display: flex; align-items: center; gap: 7px; }
.name { font-size: 15px; line-height: 18px; color: #111827; font-weight: 500; letter-spacing: 0; }
.badge { padding: 1px 5px; border-radius: 4px; font-size: 11px; color: #fff; background: #ff7aa8; box-shadow: none; }
time { display: block; margin-top: 4px; color: #9ca3af; font-size: 11px; line-height: 11px; }
.post-title {
    margin: 12px 0 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 24px;
    font-weight: 800;
    cursor: pointer;
}
.pin-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    margin-right: 7px;
    padding: 0 7px;
    border-radius: 999px;
    color: #fff;
    background: #111827;
    font-size: 11px;
    font-weight: 800;
    vertical-align: 1px;
}
.content { margin: 10px 0 0; min-height:23px; max-height: 100px; line-height: 23px; overflow: hidden; white-space: pre-wrap; font-size: 15px; color: #1f2937; cursor: pointer; }
.post-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}
.post-topics button {
    padding: 3px 8px;
    border-radius: 999px;
    color: #111827;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
}
.gallery { margin-top: 12px; display: grid; gap: 6px; max-width: 408px; }
.image-tile { position: relative; display: block; overflow: hidden; }
.gallery .image-tile,
.gallery img { width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; background: #f8fafc; }
.gallery img { display: block; object-fit: cover; box-shadow: none; transition: none; }
.gallery img:hover { transform: none; filter: none; }
.gallery.count-1 { grid-template-columns: 150px; }
.gallery.count-1 .image-tile,
.gallery.count-1 img { width: 150px; aspect-ratio: auto; max-height: 520px; }
.gallery:not(.count-1) { grid-template-columns: repeat(3, 1fr); }
.illegal-ribbon { position: absolute; top: 8px; right: -26px; z-index: 2; width: 88px; padding: 3px 0; color: #fff; background: #ef4444; box-shadow: 0 6px 14px rgba(239,68,68,.28); font-size: 12px; font-weight: 900; line-height: 1; text-align: center; transform: rotate(45deg); pointer-events: none; }
.actions { display: flex; justify-content: flex-end; gap: 12px; height: 16px; margin-top: 14px; color: #6b7280; }
.actions button {
    min-width: 36px;
    height: 16px;
    padding: 0;
    color: #6b7280;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 13px;
    font-weight: 400;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.post-manage-actions {
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
}
.post-manage-actions button {
    width: auto;
    min-width: 52px;
    padding: 0 12px;
    color: #111827;
    background: #fff;
    border: 1px solid #111827;
}
.actions button:hover { color: #111827; background: transparent; box-shadow: none; transform: none; }
.actions button.liked { color: #111827; background: transparent; border-color: transparent; }
.actions .report-btn { width: auto; color: #94a3b8; font-size: 12px; }
.actions svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.actions .icon {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0) saturate(100%) invert(43%) sepia(10%) saturate(696%) hue-rotate(179deg) brightness(94%) contrast(87%);
}
.actions button:hover .icon,
.actions button.liked .icon {
    filter: brightness(0) saturate(100%) invert(7%) sepia(10%) saturate(1467%) hue-rotate(182deg) brightness(95%) contrast(89%);
}

.pager { display: flex; justify-content: center; gap: 8px; padding: 8px 0 20px; background: transparent; }
.pager a {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #6b7280;
    text-decoration: none;
    background: rgba(255,255,255,.86);
    box-shadow: none;
}
.pager a.active { color: #fff; background: #000; }
.pager a.disabled { pointer-events: none; opacity: .4; }

.friend-links {
    width: 436px;
    margin: 0 auto;
    padding: 14px;
    border-radius: 20px;
    background: #fff;
}
.friend-links header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.friend-links h2 { margin: 0; color: #111827; font-size: 16px; }
.friend-links header span { color: #94a3b8; font-size: 12px; }
.friend-link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.friend-link-list a {
    max-width: 100%;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: #111827;
    background: #f8fafc;
    text-decoration: none;
}
.friend-link-list a:hover { background: #f3f4f6; }
.friend-link-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

.side-nav { display: none; }

@media (min-width: 821px) {
    body {
        --bg: #f3f4f6;
        background: var(--bg);
        color: #111827;
    }
    body.dark-mode {
        --bg: #0b1120;
        --card: #111827;
        --text: #e5e7eb;
        --sub: #94a3b8;
        color: #e5e7eb;
    }
    body.dark-mode .desktop-header,
    body.dark-mode .desktop-sidebar,
    body.dark-mode .shell,
    body.dark-mode .post,
    body.dark-mode .search-bar input,
    body.dark-mode .topic-filter-bar,
    body.dark-mode .side-card,
    body.dark-mode .page-view,
    body.dark-mode .explore-page,
    body.dark-mode .publish-page,
    body.dark-mode .message-page,
    body.dark-mode .user-page { background: #111827; color: #e5e7eb; }
    body.dark-mode .desktop-header,
    body.dark-mode .desktop-sidebar,
    body.dark-mode .post,
    body.dark-mode .side-card,
    body.dark-mode .shell { border-color: #1f2937; }
    body.dark-mode .site-brand,
    body.dark-mode .desktop-nav a,
    body.dark-mode .side-card h2,
    body.dark-mode .side-card strong,
    body.dark-mode .post-title,
    body.dark-mode .name,
    body.dark-mode .content,
    body.dark-mode .friend-links h2,
    body.dark-mode .friend-link-list a,
    body.dark-mode .topic-card span,
    body.dark-mode .page-title h1 { color: #f8fafc; }
    body.dark-mode time,
    body.dark-mode .friend-links header span,
    body.dark-mode .latest-users small,
    body.dark-mode .side-empty,
    body.dark-mode .page-title p { color: #94a3b8; }
    body.dark-mode .desktop-nav a.active,
    body.dark-mode .desktop-nav a[data-following-filter].filter-active,
    body.dark-mode .desktop-nav a:hover,
    body.dark-mode .hot-tags button,
    body.dark-mode .theme-toggle,
    body.dark-mode .friend-links,
    body.dark-mode .friend-link-list a,
    body.dark-mode .latest-users button { background: #1f2937; color: #f8fafc; }
    body.dark-mode .desktop-nav .nav-icon { filter: brightness(0) saturate(100%) invert(99%) sepia(2%) saturate(205%) hue-rotate(184deg) brightness(98%) contrast(99%); }
    body.dark-mode .desktop-auth a,
    body.dark-mode .side-publish-btn,
    body.dark-mode .search-bar button { background: #f8fafc; color: #111827; }
    .desktop-header {
        position: sticky;
        top: 0;
        z-index: 30;
        height: 64px;
        padding: 0 max(24px, calc((100vw - 1180px) / 2));
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #e5e7eb;
        background: rgba(255,255,255,.96);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
    }
    .site-brand { display: flex; align-items: center; gap: 10px; color: #111827; text-decoration: none; }
    .site-brand img { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; }
    .site-brand strong { font-size: 20px; letter-spacing: .04em; }
    .desktop-auth { display: flex; align-items: center; gap: 10px; }
    .desktop-auth a {
        min-width: 72px;
        height: 36px;
        display: inline-grid;
        place-items: center;
        border-radius: 999px;
        color: #111827;
        background: #f3f4f6;
        text-decoration: none;
        font-weight: 800;
    }
    .desktop-auth .register-link { color: #fff; background: #111827; }
    .desktop-auth .desktop-user-link { min-width: 36px; width: 36px; padding: 0; }
    .desktop-user-link img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
    .desktop-layout {
        width: min(1180px, calc(100vw - 48px));
        margin: 18px auto 48px;
        display: grid;
        grid-template-columns: 190px minmax(0, 1fr) 260px;
        gap: 18px;
        align-items: start;
    }
    .desktop-sidebar {
        position: sticky;
        top: 82px;
        display: block;
        border: 1px solid #e5e7eb;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
    }
    .left-sidebar { padding: 10px; }
    .desktop-nav { display: grid; gap: 6px; }
    .desktop-nav a {
        position: relative;
        min-height: 44px;
        padding: 0 14px;
        display: flex;
        align-items: center;
        gap: 10px;
        border-radius: 12px;
        color: #374151;
        text-decoration: none;
        font-weight: 800;
    }
    .desktop-nav .nav-icon {
        width: 22px;
        height: 22px;
        display: block;
        object-fit: contain;
        filter: brightness(0) saturate(100%) invert(22%) sepia(14%) saturate(828%) hue-rotate(176deg) brightness(93%) contrast(88%);
    }
    .desktop-nav a.active,
    .desktop-nav a[data-following-filter].filter-active,
    .desktop-nav a:hover { color: #111827; background: #f3f4f6; }
    .desktop-nav a.active .nav-icon,
    .desktop-nav a[data-following-filter].filter-active .nav-icon,
    .desktop-nav a:hover .nav-icon { filter: brightness(0) saturate(100%) invert(7%) sepia(10%) saturate(1467%) hue-rotate(182deg) brightness(95%) contrast(89%); }
    .desktop-nav .message-badge { margin-left: auto; }
    .right-sidebar { padding: 12px; display: grid; gap: 12px; }
    .side-publish-btn {
        height: 44px;
        display: grid;
        place-items: center;
        border-radius: 14px;
        color: #fff;
        background: #111827;
        text-decoration: none;
        font-size: 15px;
        font-weight: 900;
    }
    .side-card { padding: 14px; border: 1px solid #f1f5f9; border-radius: 16px; background: #fff; }
    .side-card h2 { margin: 0 0 12px; color: #111827; font-size: 15px; }
    .latest-users { display: grid; gap: 8px; }
    .latest-users button {
        width: 100%;
        padding: 7px;
        display: flex;
        align-items: center;
        gap: 9px;
        border-radius: 12px;
        color: #111827;
        background: #f8fafc;
        box-shadow: none;
        text-align: left;
    }
    .latest-users img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
    .latest-users span { min-width: 0; display: grid; gap: 2px; }
    .latest-users strong,
    .latest-users small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .latest-users strong { font-size: 13px; }
    .latest-users small,
    .side-empty { color: #6b7280; font-size: 12px; }
    .hot-tags { display: flex; flex-wrap: wrap; gap: 8px; }
    .hot-tags button {
        width: auto;
        padding: 6px 10px;
        border-radius: 999px;
        color: #374151;
        background: #f3f4f6;
        box-shadow: none;
        font-size: 12px;
    }
    .theme-toggle {
        width: 100%;
        height: 42px;
        border-radius: 14px;
        color: #111827;
        background: #f3f4f6;
        box-shadow: none;
        font-size: 14px;
    }
    .shell {
        width: 100%;
        min-height: calc(100vh - 130px);
        border: 1px solid #e5e7eb;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
    }
    .feed-card { padding: 10px 0;}
    .post,
    .search-bar,
    .topic-filter-bar,
    .friend-links { width: calc(100% - 24px); }
    .mobile-tab { display: none !important; }
    .mobile-header { display: none !important; }
}

.mobile-tab {
    position: fixed;
    left: 50%;
    bottom: 10px;
    z-index: 20;
    width: 360px;
    height: 48px;
    padding: 4px 6px;
    display: none;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .10), 0 12px 24px rgba(15, 23, 42, .14);
    transform: translateX(-50%);
    pointer-events: auto;
}
.mobile-tab a {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    width: auto;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    color: #666;
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
    pointer-events: auto;
    transition: color .18s ease, transform .18s ease;
}
.mobile-tab a:hover { color: #111827; transform: translateY(-1px); }
.mobile-tab a.active { color: var(--blue); }
.mobile-tab a[data-following-filter].filter-active { color: var(--blue); }
.mobile-tab span { width: 22px; height: 24px; display: grid; place-items: center; }
.mobile-tab svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.mobile-tab a.active svg { stroke-width: 2; }
.mobile-tab #quickPublish svg { stroke-width: 2.2; }
.mobile-tab .icon {
    width: 22px;
    height: 22px;
    display: block;
    filter: brightness(0) saturate(100%) invert(39%) sepia(0%) saturate(1330%) hue-rotate(186deg) brightness(96%) contrast(88%);
}
.mobile-tab a:hover .icon {
    filter: brightness(0) saturate(100%) invert(7%) sepia(11%) saturate(1977%) hue-rotate(176deg) brightness(94%) contrast(94%);
}
.mobile-tab a.active .icon {
    filter: brightness(0) saturate(100%) invert(37%) sepia(97%) saturate(2720%) hue-rotate(204deg) brightness(101%) contrast(101%);
}
.mobile-tab a[data-following-filter].filter-active .icon {
    filter: brightness(0) saturate(100%) invert(37%) sepia(97%) saturate(2720%) hue-rotate(204deg) brightness(101%) contrast(101%);
}
.mobile-tab .mine i {
    position: absolute;
    left: 50%;
    top: -14px;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 2px 7px;
    border-radius: 999px;
    color: #fff;
    background: #ff8db6;
    font-size: 10px;
    font-style: normal;
    line-height: 14px;
}

.admin-body { background: #f6f7fb; padding: 24px; }
.login-panel { width: min(1100px, 100%); margin: 0 auto; }
.admin-shell { width: min(1280px, 100%); margin: 0 auto; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.login-panel {
    margin-top: 10vh;
    max-width: 420px;
    padding: 30px;
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow);
}
.login-panel h1 { margin-top: 0; }
.login-panel a { display: block; margin-top: 14px; color: #ff4f98; text-align: center; }
.error { margin-bottom: 12px; color: #d9365f; font-weight: 700; }
.admin-sidebar { position: sticky; top: 24px; min-height: calc(100vh - 48px); padding: 22px; border-radius: 28px; background: #111827; color: #fff; box-shadow: 0 18px 50px rgba(15, 23, 42, .16); }
.admin-sidebar h1 { margin: 0 0 6px; font-size: 24px; }
.admin-sidebar p { margin: 0 0 20px; color: rgba(255,255,255,.68); line-height: 1.6; }
.admin-nav { display: grid; gap: 8px; }
.admin-nav a { display: flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: 14px; color: rgba(255,255,255,.88); background: rgba(255,255,255,.06); font-weight: 800; text-decoration: none; }
.admin-nav a:hover { color: #111827; background: #fff; }
.admin-main { min-width: 0; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 20px 22px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.admin-header h1 { margin-bottom: 4px; }
.admin-header p { margin: 0; color: var(--muted); }
.admin-header a { color: #111827; font-weight: 800; text-decoration: none; }
.admin-card { max-height: 640px; margin-bottom: 18px; padding: 22px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); overflow: auto; }
.admin-form { display: grid; gap: 10px; }
.admin-form button { justify-self: start; }
.table-wrap { max-height: 430px; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #7f7189; }
.state { padding: 4px 9px; border-radius: 999px; background: #e8fff2; color: #12864d; font-weight: 800; font-size: 12px; }
.state.hidden { background: #fff0f2; color: #c42e4b; }
.state.role-moderator { background: #eef2ff; color: #4f46e5; }
.state.role-admin { background: #fff7ed; color: #c2410c; }
.state.role-security_admin { background: #fef2f2; color: #b91c1c; }
.inline-form { display: inline; }
.edit-open, .danger { padding: 7px 12px; font-size: 13px; }
.danger { background: #ff5470; }
.admin-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; background: #f3f4f6; }
.admin-thumb-wrap { position: relative; display: inline-block; width: 54px; height: 54px; overflow: hidden; border-radius: 10px; vertical-align: middle; }
.admin-thumb-wrap .admin-thumb { display: block; border-radius: 10px; }
.admin-thumb-wrap.is-illegal .admin-thumb { filter: saturate(.55) brightness(.8); }
.admin-thumb-wrap .illegal-ribbon { top: 6px; right: -28px; width: 82px; font-size: 11px; }
.admin-table-pager { position: sticky; bottom: -22px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 14px -22px -22px; padding: 12px 22px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }
.admin-table-pager button { width: auto; min-width: 74px; height: 34px; padding: 0 12px; border-radius: 999px; color: #fff; background: #111827; box-shadow: none; font-size: 13px; }
.admin-table-pager button:disabled { cursor: not-allowed; opacity: .38; }
.admin-table-pager span { color: #64748b; font-size: 13px; font-weight: 800; }
.friend-link-table-wrap input,
.friend-link-table-wrap select { min-width: 130px; padding: 8px 10px; border-radius: 10px; }
dialog { border: 0; border-radius: 24px; padding: 0; width: min(560px, calc(100% - 30px)); }
dialog::backdrop { background: rgba(43, 29, 52, .34); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog-form { position: relative; padding: 24px; }
.profile-dialog-form { max-height: none; padding-top: 28px; }
#profileDialog,
#profileDialog .profile-dialog-form {
    -ms-overflow-style: none;
}
#profileDialog::-webkit-scrollbar,
#profileDialog .profile-dialog-form::-webkit-scrollbar { display: none; }
.dialog-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #111827;
    background: #f5f5f5;
    box-shadow: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.dialog-close-btn:hover { background: #e5e7eb; }
.dialog-form h2 { margin: 0 0 16px; color: #111827; font-size: 17px; }
.dialog-form form { display: grid; gap: 12px; }
.dialog-form label { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 600; }
.dialog-form input,
.dialog-form textarea {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: #f8fafc;
    color: #111827;
}
.dialog-form textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.dialog-form button[type="submit"] {
    height: 42px;
    border-radius: 14px;
    color: #fff;
    background: #000;
    box-shadow: none;
}
.inline-code { display: flex; gap: 8px; }
.inline-code input { flex: 1; }
.inline-code button { white-space: nowrap; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.unlock-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.input-dialog-form { display: grid; gap: 12px; }
.input-dialog-title-field input { width: 100%; }
.input-dialog-content-field textarea { min-height: 160px; }
.input-dialog-desc { margin: -6px 0 2px; color: #64748b; font-size: 13px; line-height: 1.6; }
.input-dialog-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.input-dialog-quick button { padding: 7px 10px; border: 1px solid #ffd6e5; border-radius: 999px; background: #fff5f8; color: #d93670; font-size: 12px; cursor: pointer; }
.input-dialog-quick button:hover { background: #ffe8f0; }

.preview-thumb { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: #f3f4f6; cursor: grab; transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease; }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
.preview-thumb.dragging { opacity: .55; cursor: grabbing; transform: scale(.96); }
.preview-thumb.drag-over { box-shadow: 0 0 0 2px #ff4f8b inset; transform: translateY(-2px); }

@media (max-width: 820px) {
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 28;
        height: 54px;
        padding: 0 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,.96);
        border-bottom: 1px solid #f1f5f9;
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }
    .mobile-brand {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        color: #111827;
        text-decoration: none;
    }
    .mobile-brand img { width: 32px; height: 32px; border-radius: 9px; object-fit: contain; }
    .mobile-brand strong { font-size: 18px; letter-spacing: .03em; }
    .shell { width: 100%; border-radius: 0; }
    .post { width: calc(100% - 24px); }
    .friend-links { width: calc(100% - 24px); }
    .topic-filter-bar { width: calc(100% - 24px); }
    .search-bar { width: calc(100% - 24px); }
    .desktop-header,
    .desktop-sidebar { display: none; }
    .desktop-layout { display: block; }
    .mobile-tab { left: 50%; width: min(360px, calc(100% - 100px)); display: flex; transform: translateX(-50%); }
    .mobile-tab a { width: auto; }
    .comment-composer { left: 0; width: 100%; transform: none; }
    .lightbox img { max-width: 100vw; max-height: 84vh; border-radius: 0; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close { top: 14px; right: 14px; }
    .gallery:not(.count-1) { grid-template-columns: repeat(3, 1fr); }
    .admin-body { padding: 14px; }
    .admin-shell { display: block; }
    .admin-sidebar { position: static; min-height: 0; margin-bottom: 14px; }
    .admin-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-header { align-items: flex-start; gap: 10px; }
}

/* ---- Toast 通知 ---- */
.toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.toast-item {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    border-radius: 12px;
    background: #1f2937;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    animation: toast-in .28s ease-out;
    white-space: nowrap;
    max-width: 100%;
}
.toast-item .toast-icon { font-size: 17px; flex-shrink: 0; }
.toast-item.toast-success { background: #059669; }
.toast-item.toast-error   { background: #dc2626; }
.toast-item.toast-warn    { background: #d97706; }
.toast-item.toast-info    { background: #2563eb; }
.toast-item.toast-removing {
    animation: toast-out .22s ease-in forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-12px); }
}
