:root {
    color-scheme: light;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --wx-bg: #ededed;
    --wx-panel: #f7f7f7;
    --wx-card: #ffffff;
    --wx-text: #1f1f1f;
    --wx-subtext: #8f8f8f;
    --wx-border: #e7e7e7;
    --wx-brand: #07c160;
    --wx-brand-dark: #06ad56;
    --wx-hover: #f2f2f2;
    --wx-radius: 10px;
    --wx-shadow: 0 12px 34px rgba(15, 23, 42, .08);
    background: var(--wx-bg);
    color: var(--wx-text);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--wx-bg); }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
button, input, select, textarea, .friend, .card, .bubble, .conversation-item-menu {
    transition: all .18s ease;
}
input, select { width: 100%; border: 1px solid var(--wx-border); border-radius: var(--wx-radius); padding: 10px 12px; outline: none; background: #fff; color: var(--wx-text); }
input:focus, select:focus, textarea:focus { border-color: var(--wx-brand); box-shadow: 0 0 0 3px rgba(7, 193, 96, .14); }

.shell { width: min(1480px, calc(100vw - 20px)); margin: 10px auto; }
.card { background: var(--wx-card); border: 1px solid var(--wx-border); border-radius: 14px; box-shadow: var(--wx-shadow); }
.auth-card { width: min(420px, 100%); margin: 80px auto; padding: 28px; }
.auth-shell {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    display: grid;
    align-items: center;
    justify-items: end;
    padding: 0 8vw 0 24px;
    border: 0;
    background: #e9edf3;
    z-index: 10;
}
.auth-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: #071326;
    background-image:
        linear-gradient(145deg, rgba(8, 20, 38, .55), rgba(14, 116, 144, .28)),
        url('/%E7%99%BB%E5%BD%95%E7%95%8C%E9%9D%A2%E8%83%8C%E6%99%AF%E5%9B%BE.png'),
        radial-gradient(circle at 8% 68%, rgba(148, 163, 184, .46) 0%, rgba(148, 163, 184, .2) 10%, transparent 28%),
        radial-gradient(circle at 72% 18%, rgba(59, 130, 246, .2) 0%, transparent 24%),
        radial-gradient(circle at 88% 34%, rgba(168, 85, 247, .18) 0%, transparent 26%),
        linear-gradient(145deg, #0f2740, #071326 45%, #15113a);
    background-position: center, center, center, center, center, center;
    background-size: auto, cover, auto, auto, auto, auto;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    filter: saturate(1.03) contrast(1.02);
}
.auth-bg::before,
.auth-bg::after {
    content: "";
    position: absolute;
    top: -18%;
    left: 58%;
    width: 220px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.92), rgba(125,211,252,.7), rgba(255,255,255,0));
    box-shadow: 0 0 12px rgba(125, 211, 252, .72);
    opacity: 0;
    transform: rotate(-32deg) translate3d(0, 0, 0);
    animation: authMeteor 6.8s ease-in-out infinite;
}
.auth-bg::after {
    top: 8%;
    left: 86%;
    width: 150px;
    animation-delay: 3.4s;
    animation-duration: 8.2s;
    opacity: 0;
}
@keyframes authMeteor {
    0%, 58% {
        opacity: 0;
        transform: rotate(-32deg) translate3d(0, 0, 0);
    }
    62% {
        opacity: .95;
    }
    74% {
        opacity: 0;
        transform: rotate(-32deg) translate3d(-720px, 420px, 0);
    }
    100% {
        opacity: 0;
        transform: rotate(-32deg) translate3d(-720px, 420px, 0);
    }
}
@media (prefers-reduced-motion: reduce) {
    .auth-bg::before,
    .auth-bg::after {
        animation: none;
        display: none;
    }
}
.auth-card-modern {
    position: relative;
    z-index: 1;
    width: min(460px, calc(100% - 30px));
    margin: 0;
    padding: 32px 30px 24px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .48);
    box-shadow: 0 28px 60px rgba(2, 8, 23, .28);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, .88);
}
.auth-card-modern h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: 1px; }
.auth-card-modern .muted { margin: 0 0 12px; color: #607089; }
.auth-card-modern .tabs {
    background: rgba(241, 245, 249, .72);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 14px;
}
.auth-card-modern .tab {
    flex: 1;
    border-radius: 10px;
    padding: 9px 8px;
    background: transparent;
    color: #425466;
}
.auth-card-modern .tab.active {
    background: linear-gradient(180deg, #18c26c, #06ad56);
    color: #fff;
    box-shadow: 0 8px 18px rgba(7, 193, 96, .28);
}
.auth-card-modern .form input {
    height: 44px;
    border-radius: 11px;
    border-color: #d6dde6;
    background: rgba(255, 255, 255, .95);
}
.auth-card-modern .form button[type="submit"] {
    height: 44px;
    border-radius: 11px;
    background: linear-gradient(180deg, #18c26c, #06ad56);
    color: #fff;
    font-weight: 600;
}
.auth-card-modern #authMsg {
    margin-top: 6px;
    min-height: 22px;
}
@media (max-width: 760px) {
    .auth-shell {
        justify-items: center;
        padding: 0 16px;
    }
}
.form { display: grid; gap: 12px; }
.hidden { display: none !important; }
.muted { color: var(--wx-subtext); }
.message { min-height: 24px; color: #dc2626; }
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 50;
    max-width: min(560px, calc(100vw - 32px));
    transform: translateX(-50%);
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    padding: 10px 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
}
.toast.ok { background: #16a34a; }
.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tab, .ghost { border-radius: var(--wx-radius); padding: 9px 14px; }
.tab { background: #f1f1f1; color: #4b5563; }
.tab.active { background: var(--wx-brand); color: #fff; }
.ghost { background: #f1f1f1; color: #4b5563; }

.app-window {
    display: grid;
    grid-template-columns: 64px 280px minmax(0, 1fr);
    height: calc(100vh - 20px);
    min-height: 720px;
    overflow: hidden;
    background: var(--wx-panel);
    border: 1px solid #dadada;
    border-radius: 12px;
    box-shadow: 0 12px 42px rgba(15, 23, 42, .16);
}

.rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 18px 10px;
    background: #2e2e2e;
    border-right: 1px solid #272727;
}
.avatar, .profile-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #18b578, #0ea5e9);
    color: #fff;
    font-weight: 700;
    background-size: cover;
    background-position: center;
}
.rail-btn {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    background: transparent;
    color: #64707d;
    font-size: 22px;
}
.rail-btn.active { background: rgba(255, 255, 255, .12); color: #fff; }
.doc-rail-btn svg,
.moments-rail-btn svg,
.ledger-rail-btn svg {
    display: block;
    width: 22px;
    height: 22px;
}
.doc-icon-bg {
    fill: url(#docIconGradient);
    stroke: rgba(255,255,255,.55);
    stroke-width: .8;
    filter: drop-shadow(0 2px 4px rgba(7,193,96,.22));
}
.doc-icon-fold,
.doc-icon-line {
    fill: none;
    stroke: rgba(255,255,255,.92);
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.moments-icon-orbit {
    fill: none;
    stroke: url(#momentsIconGlow);
    stroke-width: 2.2;
    filter: drop-shadow(0 2px 5px rgba(99,102,241,.32));
}
.moments-icon-core {
    fill: url(#momentsIconGlow);
}
.moments-icon-spark {
    fill: #f8fafc;
    stroke: rgba(56,189,248,.7);
    stroke-width: .45;
}
.doc-rail-btn.active svg,
.moments-rail-btn.active svg {
    filter: drop-shadow(0 0 8px rgba(255,255,255,.28));
}
.rail-btn.logout { margin-top: auto; font-size: 18px; }

.middle-panel {
    overflow-y: auto;
    background: #efefef;
    border-right: 1px solid #dfdfdf;
    padding: 12px;
}
.profile { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.profile small { display: block; margin-top: 3px; }
.search-box { position: relative; display: grid; grid-template-columns: 1fr 46px; gap: 10px; margin-bottom: 12px; }
.group-entry { margin-bottom: 12px; }
.quick-action-menu {
    position: absolute;
    top: 52px;
    right: 0;
    z-index: 20;
    display: grid;
    gap: 2px;
    min-width: 156px;
    padding: 8px;
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .16);
}
.quick-action-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    background: transparent;
    color: #111827;
    padding: 10px 12px;
    text-align: left;
}
.quick-action-menu button:hover { background: #f1f5f9; }
.quick-action-icon {
    flex: none;
    width: 23px;
    height: 23px;
    color: #111827;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.search-box button, .primary-action {
    border-radius: 10px;
    background: var(--wx-brand);
    color: #fff;
    padding: 10px 14px;
}
.search-box .quick-action-menu button {
    background: transparent;
    color: #1f2937;
    padding: 10px 12px;
}
.search-box .quick-action-menu button:hover { background: #f1f5f9; }
.panel-section h2 { margin: 18px 4px 10px; font-size: 16px; color: #6b7280; font-weight: 600; }
.list, .search-results, .request-list { display: grid; gap: 8px; }

.friend, .contact-tool, .search-result, .request-item {
    width: 100%;
    text-align: left;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    padding: 10px 10px;
}
.friend {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.friend:hover, .contact-tool:hover, .search-result:hover { background: #f7f7f7; }
.friend.active { background: var(--wx-brand); color: #fff; }
.friend:active { transform: scale(.995); }
.friend-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: linear-gradient(135deg, #18b578, #0ea5e9);
    background-size: cover;
    background-position: center;
    color: #fff;
    font-weight: 700;
    overflow: hidden;
}
.avatar-wrap {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
}
.avatar-wrap .friend-avatar {
    width: 40px;
    height: 40px;
}
.avatar-unread-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ef4444;
    border: 2px solid #f5f5f5;
}
.friend-main { min-width: 0; }
.friend-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.friend-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.25; font-weight: 500; }
.friend-time { flex: none; color: #9aa2ad; font-size: 11px; font-weight: 400; }
.friend.active .friend-time { color: rgba(255, 255, 255, .78); }
.friend-star { margin-left: 6px; color: #f59e0b; font-size: 11px; font-weight: 500; }
.friend-pin { margin-left: 6px; color: #f59e0b; font-size: 11px; font-weight: 500; }
.friend-mute { margin-left: 4px; color: #94a3b8; font-size: 11px; font-weight: 500; }
.friend-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.unread-badge { min-width: 20px; height: 20px; border-radius: 999px; padding: 0 6px; background: #ef4444; color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.unread-dot { width: 10px; height: 10px; border-radius: 999px; background: #ef4444; }
.unread-dot.inline { display: inline-block; }
.unread-dot.muted { background: #b8bec7; }
.friend strong, .search-result strong, .request-item strong { display: block; font-weight: 600; }
.friend small, .search-result small, .request-item small { display: block; color: #8a929f; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.35; }
.friend.active small { color: rgba(255, 255, 255, .78); }
.contact-tool { display: flex; align-items: center; justify-content: space-between; background: #fff; }
.contact-tool strong { min-width: 24px; height: 24px; border-radius: 999px; background: #ef4444; color: #fff; text-align: center; line-height: 24px; font-size: 13px; }
.group-entry strong { background: #18b578; }
.list-title { display: none; }
.empty-card { padding: 18px; border-radius: 12px; background: #fff; }
.search-result { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; background: #fff; }
.search-result button, .request-actions button { border-radius: 8px; padding: 8px 10px; background: #18b578; color: #fff; }
.search-result button:disabled { background: #d1d5db; color: #6b7280; }

.content-panel {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.bookkeeping-editor-panel:not(.hidden) {
    flex: 1;
    min-height: 0;
}
.contact-drawer {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 35;
    width: min(286px, 34vw);
    height: 100%;
    border-left: 1px solid #e5e7eb;
    background: #f8f8f8;
    box-shadow: -10px 0 28px rgba(15, 23, 42, .12);
    animation: drawerIn .18s ease;
}
.contact-drawer-head {
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px 2px;
}
.contact-drawer-body { padding: 6px 14px 14px; }
.contact-mini-top {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 10px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}
.contact-mini-avatar {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    background: #e2e8f0;
    background-size: cover;
    background-position: center;
    border: 0;
}
.contact-mini-name { margin: 0; font-size: 14px; font-weight: 500; }
.contact-mini-sub { margin: 2px 0 0; font-size: 12px; color: #9ca3af; }
.contact-mini-list { margin-top: 8px; }
.contact-mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 11px 0;
    border-bottom: 1px solid #eceff3;
    font-size: 14px;
}
.contact-mini-item span { color: #111827; font-size: 14px; }
.contact-mini-item em { color: #9ca3af; font-style: normal; font-size: 13px; }
.contact-mini-item .wx-switch {
    display: inline-block;
    width: 36px;
    height: 22px;
    border-radius: 999px;
    background: #e5e7eb;
    position: relative;
    transition: all .18s ease;
}
.contact-mini-item .wx-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    transition: all .18s ease;
}
.contact-mini-item .wx-switch.on { background: #07c160; }
.contact-mini-item .wx-switch.on::after { left: 16px; }
.contact-mini-danger {
    width: 100%;
    border: 0;
    background: transparent;
    margin-top: 12px;
    text-align: center;
    color: #ef4444;
    font-size: 15px;
}
.contact-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: rgba(17, 24, 39, .2);
    display: grid;
    place-items: center;
    padding: 20px;
}
.contact-card-modal {
    width: min(430px, calc(100% - 24px));
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f8f8f8;
    box-shadow: 0 24px 52px rgba(15, 23, 42, .2);
    padding: 14px 16px;
}
.contact-card-top {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 10px;
    align-items: center;
}
.contact-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    border: 0;
    background: #e2e8f0;
    background-size: cover;
    background-position: center;
    color: #111827;
    font-size: 20px;
}
.contact-card-title h3 { margin: 0; font-size: 18px; font-weight: 500; }
.contact-card-title p { margin: 2px 0 0; font-size: 12px; }
.contact-card-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}
.contact-card-section h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
}
.contact-card-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
    padding: 4px 0;
}
.contact-card-row span { color: #6b7280; font-size: 13px; }
.contact-card-row strong { font-weight: 500; color: #111827; font-size: 13px; }
.contact-card-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
}
.contact-card-actions button {
    border-radius: 8px;
    background: #07c160;
    color: #fff;
    padding: 8px 20px;
}
.placeholder {
    height: 100%;
    display: grid;
    place-content: center;
    text-align: center;
    color: #64748b;
}
.conversation { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.conversation header, .requests-view header, .settings-view header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    padding: 0 18px;
    border-bottom: 1px solid #e6e9ed;
    background: #f7f7f7;
}
.conversation header h2, .requests-view h2 { margin: 0; font-size: 17px; font-weight: 500; }
.conversation #chatHint { font-size: 12px; color: #8b95a1; }
.chat-title-link { background: transparent; padding: 0; color: inherit; }
.chat-title-link h2 { cursor: pointer; }
.chat-title-link.disabled h2 { cursor: default; }
.group-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.group-toolbar button, .file-action {
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    padding: 6px 10px;
    font-size: 13px;
}
.pinned-messages {
    padding: 10px 24px;
    border-bottom: 1px solid #edf0f4;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
}
.messages {
    overflow-y: auto;
    padding: 18px 18px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f5f5f5;
}
.bubble {
    position: relative;
    width: fit-content;
    max-width: min(70%, 460px);
    padding: 9px 12px;
    border-radius: 4px 10px 10px 10px;
    background: #fff;
    border: 1px solid #eceff3;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    line-height: 1.5;
    font-size: 16px;
}
.bubble::after {
    content: "";
    position: absolute;
    top: 11px;
    left: -6px;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 7px solid #fff;
    filter: drop-shadow(-1px 0 0 #eef1f5);
}
.bubble.mine {
    align-self: flex-end;
    border: 0;
    border-radius: 10px 4px 10px 10px;
    background: #95ec69;
    color: #17211a;
}
.bubble.mine::after {
    left: auto;
    right: -6px;
    border-right: 0;
    border-left: 7px solid #95ec69;
    filter: none;
}
.bubble.recalled {
    align-self: center;
    max-width: 80%;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #94a3b8;
    font-size: 13px;
}
.bubble.recalled::after { display: none; }
.bubble.recalled .sender {
    display: inline;
    margin-right: 4px;
    color: #94a3b8;
}
.message-recalled { font-style: italic; }
.bubble time { display: none; }
.bubble .sender { display: block; margin-bottom: 4px; color: #64748b; font-size: 12px; font-weight: 600; }
.bubble.mine .sender { color: rgba(23, 33, 26, .72); }
.bubble .message-action { display: block; margin-top: 6px; color: #0f766e; font-size: 12px; background: transparent; padding: 0; }
.message-quote {
    display: block;
    max-width: 100%;
    margin: 3px 0 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #8b949e;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.message-quote::after { content: " |"; color: #a3aab3; }
.message-quote:hover { color: #667085; text-decoration: underline; }
.bubble.mine .message-quote { color: #8b949e; }
.bubble.quote-target {
    outline: 2px solid rgba(59, 130, 246, .55);
    outline-offset: 3px;
}
.message-image {
    display: block;
    max-width: min(320px, 62vw);
    max-height: 360px;
    border-radius: 10px;
    margin-top: 6px;
    object-fit: contain;
    cursor: default;
}
.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    box-sizing: border-box;
    background: rgba(12, 14, 18, 0.55);
    backdrop-filter: blur(4px);
}
.image-viewer.image-viewer--pinned {
    z-index: 2147483646;
}
.image-viewer.image-viewer--fullscreen {
    padding: 0;
    background: #0f1114;
}
.image-viewer.image-viewer--fullscreen .image-viewer-panel {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
}
.image-viewer-panel {
    display: flex;
    flex-direction: column;
    width: min(1120px, 96vw);
    height: min(720px, 92vh);
    max-height: 92vh;
    background: #e8eaed;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}
.image-viewer-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 8px 12px;
    background: linear-gradient(180deg, #f5f6f8 0%, #e8eaed 100%);
    border-bottom: 1px solid #c5c9d0;
}
.image-viewer-heading {
    font-size: 14px;
    font-weight: 600;
    color: #1c1e22;
}
.image-viewer-counter {
    font-size: 13px;
    color: #5c6370;
}
.image-viewer-title-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}
.image-viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 6px 10px;
    background: #dfe3e8;
    border-bottom: 1px solid #c5c9d0;
}
.image-viewer-toolsplit {
    width: 1px;
    height: 22px;
    background: #b8bec8;
    margin: 0 4px;
}
.image-viewer-iconbtn,
.image-viewer-textbtn {
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #2b2f36;
    cursor: pointer;
    line-height: 1;
}
.image-viewer-iconbtn {
    width: 34px;
    height: 30px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.image-viewer-textbtn {
    padding: 0 10px;
    height: 30px;
    font-size: 12px;
    font-weight: 600;
}
.image-viewer-iconbtn:hover,
.image-viewer-textbtn:hover {
    background: rgba(255, 255, 255, 0.65);
    border-color: #aeb5bf;
}
.image-viewer-iconbtn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.image-viewer-iconbtn[aria-pressed="true"] {
    background: rgba(59, 130, 246, 0.2);
    border-color: #93c5fd;
}
.image-viewer-body {
    display: flex;
    flex: 1;
    min-height: 0;
    background: #1a1d22;
}
.image-viewer-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.image-viewer-stage {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #14171c;
}
.image-viewer-stage--pannable {
    cursor: grab;
}
.image-viewer-stage--pannable.image-viewer-stage--dragging {
    cursor: grabbing;
}
.image-viewer-pan {
    padding: 16px;
    will-change: transform;
}
.image-viewer-zoom-wrap {
    display: inline-block;
    line-height: 0;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
    will-change: transform;
}
.image-viewer-img {
    display: block;
    max-width: min(100%, calc(100vw - 320px));
    max-height: min(560px, calc(92vh - 140px));
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.image-viewer.image-viewer--fullscreen .image-viewer-img {
    max-width: calc(100vw - 220px);
    max-height: calc(100vh - 120px);
}
.image-viewer--no-sidebar .image-viewer-sidebar {
    display: none;
}
.image-viewer--no-sidebar .image-viewer-img {
    max-width: min(100%, 96vw);
}
.image-viewer-img.image-viewer-img--pixel {
    max-width: none;
    max-height: none;
}
.image-viewer-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #eceef2;
    border-left: 1px solid #c5c9d0;
    min-height: 0;
}
.image-viewer-sidebar-head {
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #3d4450;
    border-bottom: 1px solid #d1d5db;
}
.image-viewer-thumb-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    align-content: start;
}
.image-viewer-thumb {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #d1d5db;
}
.image-viewer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.image-viewer-thumb:hover {
    border-color: #94a3b8;
}
.image-viewer-thumb.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}
.message-video {
    display: block;
    max-width: min(360px, 62vw);
    margin-top: 6px;
    border-radius: 10px;
}
.message-audio {
    display: block;
    margin-top: 6px;
}
.send-box {
    display: grid;
    gap: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid #e6e9ed;
    background: #fafafa;
}
.send-editor {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    min-height: 132px;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.send-editor:focus-within {
    border-color: #bfc7d1;
    box-shadow: 0 0 0 2px rgba(191, 199, 209, .24);
}
.quote-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 8px 10px 0;
    color: #94a3b8;
    font-size: 13px;
}
.quote-preview.hidden { display: none; }
.quote-preview-bar {
    width: 3px;
    align-self: stretch;
    border-radius: 999px;
    background: #cbd5e1;
}
.quote-preview-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.quote-preview button {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    padding: 0;
    line-height: 1;
}
.send-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 10px 8px;
}
.tool-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    color: #6b7280;
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 16px;
}
.tool-btn:hover { background: #eef1f4; color: #4b5563; }
.tool-btn:active { background: #e2e8f0; transform: translateY(0.5px); }
.send-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.send-tip { color: #9aa2ad; font-size: 12px; }
.send-box #messageInput {
    width: 100%;
    min-height: 82px;
    max-height: 210px;
    border: 0;
    border-radius: 0;
    padding: 12px 12px 6px;
    background: transparent;
    box-shadow: none;
    color: #111827;
    font-size: 15px;
    line-height: 1.55;
    outline: none;
    resize: vertical;
}
.send-box #messageInput:focus {
    border-color: transparent;
    box-shadow: none;
}
.send-box button[type="submit"] {
    width: 66px;
    height: 40px;
    border-radius: 8px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    background: var(--wx-brand);
    color: #fff;
}
.send-box button[type="submit"]:hover { background: var(--wx-brand-dark); }
.send-box button[type="submit"]:active {
    background: #069450;
    transform: translateY(0.5px);
}
.send-box button[type="submit"]:disabled {
    background: #d1d5db;
    color: #ffffff;
    opacity: 1;
}
.file-action {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    background: transparent;
    color: #6b7280;
}
.file-action input { display: none; }
.emoji-trigger {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 16px;
    padding: 0;
}
.file-action:hover, .emoji-trigger:hover { background: #eef1f4; color: #4b5563; }
.file-action:active, .emoji-trigger:active {
    background: #e2e8f0;
    transform: translateY(0.5px);
}
.pending-file-preview {
    padding: 0 10px 8px;
}
.pending-image-card, .pending-file-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(360px, 100%);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    padding: 6px 8px;
    color: #334155;
    font-size: 13px;
}
.pending-image-card img {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    background: #e5e7eb;
}
.pending-image-card span, .pending-file-card span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pending-image-card button, .pending-file-card button {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    line-height: 1;
}
.pending-image-card button:hover, .pending-file-card button:hover {
    background: #cbd5e1;
}
.emoji-panel {
    position: absolute;
    left: 56px;
    bottom: 182px;
    z-index: 18;
    width: min(340px, calc(100% - 150px));
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .18);
    padding: 10px;
    animation: panelFadeIn .16s ease;
}
.emoji-panel h4 { margin: 4px 2px 8px; font-size: 13px; color: #64748b; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.emoji-item {
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    text-align: center;
    font-size: 18px;
    line-height: 30px;
    padding: 2px 0;
}
.emoji-item:hover { background: #eef2ff; }
.mention-panel {
    position: absolute;
    right: 16px;
    bottom: 174px;
    z-index: 18;
    width: min(320px, calc(100% - 32px));
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .18);
    animation: panelFadeIn .16s ease;
}
.mention-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
}
.mention-panel-head button {
    border-radius: 8px;
    background: #eef2f7;
    color: #334155;
    padding: 4px 10px;
}
.mention-list { max-height: 260px; overflow-y: auto; padding: 8px; display: grid; gap: 6px; }
.mention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
    padding: 8px 10px;
    text-align: left;
}
.mention-item:hover { background: #eef2ff; }

.profile-view, .requests-view, .settings-view { height: 100%; padding: 52px min(10vw, 120px); overflow-y: auto; }
.profile-view, .requests-view, .settings-view { background: #f5f5f5; }
.profile-card { display: flex; align-items: center; gap: 20px; padding-bottom: 30px; border-bottom: 1px solid #edf0f4; }
.profile-avatar { width: 72px; height: 72px; border-radius: 14px; font-size: 24px; }
.profile-card h2 { margin: 0 0 8px; }
.detail-list { display: grid; grid-template-columns: 92px 1fr; gap: 18px 24px; margin: 28px 0; padding-bottom: 28px; border-bottom: 1px solid #edf0f4; }
.detail-list dt { color: #8a929f; }
.detail-list dd { margin: 0; }
.primary-action { min-width: 140px; }
.request-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: #f8fafc; border: 1px solid #edf0f4; }
.request-actions { display: flex; gap: 8px; }
.request-actions .reject { background: #e5e7eb; color: #374151; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 720px; }
.settings-form label { display: grid; gap: 8px; color: #64748b; }
.settings-form .wide, .settings-form .message, .settings-actions { grid-column: 1 / -1; }
.settings-actions { display: flex; gap: 12px; align-items: center; }
.avatar-settings { display: flex; align-items: center; gap: 18px; padding-bottom: 10px; }
.avatar-preview { width: 96px; height: 96px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, #18b578, #0ea5e9); background-size: cover; background-position: center; color: #fff; font-size: 28px; font-weight: 700; }
.upload-label { display: inline-grid; width: auto; padding: 10px 14px; border-radius: 10px; background: #eef2f7; color: #334155; cursor: pointer; }
.upload-label input { display: none; }
.avatar-crop-panel { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: center; padding: 16px; border: 1px solid #edf0f4; border-radius: 14px; background: #f8fafc; }
.crop-stage { width: 320px; height: 320px; overflow: hidden; border-radius: 18px; background: #111827; }
#avatarCropCanvas { display: block; width: 320px; height: 320px; cursor: move; }
.crop-controls { display: grid; gap: 14px; align-content: center; }
.settings-form select[multiple] { min-height: 180px; }
.group-create-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
#groupManageView.settings-view {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 24;
    width: min(360px, 36%);
    height: 100%;
    padding: 0;
    overflow: hidden;
    border-left: 1px solid #e5e7eb;
    background: #f7f7f7;
    box-shadow: -14px 0 30px rgba(15, 23, 42, .08);
}
#groupManageView.settings-view header {
    min-height: 54px;
    padding: 0 14px;
    background: #fff;
}
#groupManageView.settings-view header h2 {
    font-size: 16px;
    font-weight: 500;
}
#groupManageView .group-manage-head-actions {
    gap: 6px;
}
#groupManageView .group-manage-head-actions .muted {
    display: none;
}
#groupManageView .ghost {
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
}
#groupManageContent {
    height: calc(100% - 54px);
    overflow-y: auto;
    padding: 12px;
}
#groupManageContent.group-manage {
    max-width: none;
    gap: 10px;
}
#groupManageContent .group-card {
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}
#groupManageContent .group-card h3 {
    margin-bottom: 10px;
    font-size: 15px;
}
#groupManageContent .group-row {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    margin: 8px 0;
    font-size: 14px;
}
#groupManageContent .group-row input,
#groupManageContent .group-row select {
    min-width: 0;
    height: 36px;
    border-radius: 8px;
    padding: 6px 9px;
}
#groupManageContent .group-actions {
    gap: 6px;
    margin-top: 8px;
}
#groupManageContent .group-actions button,
#groupManageContent .group-member button {
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 13px;
}
#groupManageContent .group-member {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px 0;
}
#groupManageContent .group-member strong {
    font-size: 14px;
}
#groupManageContent .group-member small {
    font-size: 12px;
}
#groupManageContent .invite-box {
    padding: 10px;
    font-size: 12px;
}
.group-members-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.group-members-card-head h3 {
    margin: 0 !important;
}
.group-members-card-head button {
    border: 0;
    background: transparent;
    color: #8b95a1;
    font-size: 12px;
    padding: 0;
}
.group-members-card-head button:hover {
    color: #07c160;
}
.group-member-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px 10px;
}
.group-member-tile {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: #4b5563;
    padding: 0;
}
.group-member-tile .friend-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}
.group-member-tile small {
    width: 100%;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4b5563;
    font-size: 12px;
}
.group-member-invite-tile {
    cursor: pointer;
}
.group-invite-plus {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f1f3f5;
    color: #9aa2ad;
    font-size: 32px;
    line-height: 1;
}
.group-member-invite-tile:hover .group-invite-plus {
    background: #e5e7eb;
    color: #6b7280;
}
.group-remove-minus {
    font-size: 34px;
    padding-bottom: 4px;
}
.group-member-remove-tile:hover .group-remove-minus {
    background: #fee2e2;
    color: #ef4444;
}
.group-inline-invite {
    margin: 14px 0 0;
}
.group-full-member-list {
    margin-top: 14px;
    border-top: 1px solid #edf0f4;
}
.group-avatar-setting {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf0f4;
}
.group-avatar-setting .friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}
.group-avatar-setting label {
    display: inline-flex;
    align-items: center;
    width: auto;
    border-radius: 8px;
    background: #eef2f7;
    color: #334155;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}
.group-avatar-setting input {
    display: none;
}
.group-announcement-editor {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}
.group-announcement-editor textarea {
    width: 100%;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    padding: 10px;
    resize: vertical;
    outline: none;
}
.group-announcement-editor label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
}
.group-announcement-editor input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #07c160;
}
.group-announcement-list {
    display: grid;
    gap: 10px;
}
.group-announcement-item {
    border-radius: 10px;
    background: #f8fafc;
    padding: 10px;
}
.group-announcement-item strong {
    font-size: 13px;
    color: #0f172a;
}
.group-announcement-item p {
    margin: 6px 0;
    color: #334155;
    line-height: 1.5;
    white-space: pre-wrap;
}
.group-announcement-item small {
    color: #94a3b8;
}
.invite-friend-box {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}
.invite-friend-box > span {
    color: #475569;
    font-size: 14px;
}
.invite-friend-list {
    display: grid;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #edf0f4;
    border-radius: 10px;
    padding: 6px;
    background: #f8fafc;
}
.invite-friend-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    border-radius: 8px;
    background: transparent;
    color: #111827;
    padding: 6px;
    text-align: left;
}
.invite-friend-item:hover {
    background: #eef2f7;
}
.remove-member-item:hover {
    background: #fff1f2;
}
.remove-member-item:hover strong {
    color: #ef4444;
}
.invite-friend-item .friend-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}
.invite-friend-item strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}
.group-launch-view {
    height: 100%;
    background: #f7f7f7;
}
.wechat-group-picker {
    display: grid;
    grid-template-columns: minmax(300px, 40%) minmax(360px, 1fr);
    height: 100%;
    background: #f7f7f7;
}
.group-picker-left {
    min-width: 0;
    padding: 18px 28px 0;
    border-right: 1px solid #ededed;
    background: #f7f7f7;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto 1fr;
}
.group-search-box {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 6px;
    height: 42px;
    border: 1.5px solid #07c160;
    border-radius: 8px;
    background: #fff;
    padding: 0 10px;
}
.group-search-box svg {
    width: 20px;
    height: 20px;
    color: #8b949e;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.group-search-box input {
    height: 38px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 17px;
}
.group-search-box input:focus {
    border-color: transparent;
    box-shadow: none;
}
.group-contact-head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    color: #202124;
    font-size: 18px;
    font-weight: 400;
}
.group-contact-head strong {
    font-weight: 400;
}
.group-contact-arrow {
    color: #9aa2ad;
    font-size: 20px;
    line-height: 1;
}
.group-contact-list {
    overflow-y: auto;
    padding: 0 8px 24px 0;
}
.group-letter {
    padding: 14px 0 10px 36px;
    color: #9aa2ad;
    font-size: 14px;
    line-height: 1;
}
.group-contact-item {
    width: 100%;
    display: grid;
    grid-template-columns: 22px 38px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 8px 0;
    border-radius: 6px;
    background: transparent;
    color: #111827;
    text-align: left;
}
.group-contact-item:hover {
    background: #ededed;
}
.group-contact-item .friend-avatar {
    width: 38px;
    height: 38px;
    border-radius: 5px;
}
.group-check {
    width: 20px;
    height: 20px;
    border: 1.5px solid #b7bcc3;
    border-radius: 50%;
    background: #fff;
    position: relative;
}
.group-contact-item.selected .group-check {
    border-color: #07c160;
    background: #07c160;
}
.group-contact-item.selected .group-check::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.group-contact-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
}
.group-empty {
    padding: 24px 36px;
    color: #9aa2ad;
}
.group-picker-main {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 24px 30px 18px 42px;
    background: #f7f7f7;
}
.group-picker-main h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 400;
    color: #111827;
}
.selected-group-members {
    display: flex;
    align-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 18px 14px;
    padding-top: 36px;
    overflow-y: auto;
}
.selected-group-member {
    width: 64px;
    display: grid;
    justify-items: center;
    gap: 6px;
    background: transparent;
    color: #374151;
    padding: 0;
}
.selected-group-member .friend-avatar {
    width: 42px;
    height: 42px;
    border-radius: 5px;
}
.selected-group-member span:last-child {
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}
.group-create-actions {
    display: grid;
    justify-items: end;
    gap: 12px;
}
.group-create-actions .message {
    min-height: 20px;
    margin: 0;
    justify-self: stretch;
    text-align: right;
}
.group-create-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 78px;
    width: 100%;
}
.group-create-buttons button {
    width: 152px;
    height: 36px;
    border-radius: 7px;
    background: #e9e9e9;
    color: #111827;
    font-size: 15px;
}
.group-create-buttons button[type="submit"] {
    background: #07c160;
    color: #fff;
}
.group-create-buttons button[type="submit"]:disabled {
    background: #e9e9e9;
    color: #b4b4b4;
    opacity: 1;
}
.group-manage { display: grid; gap: 18px; max-width: 860px; }
.group-card { border: 1px solid #edf0f4; border-radius: 14px; background: #f8fafc; padding: 16px; }
.group-card h3 { margin: 0 0 12px; font-size: 16px; }
.group-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; margin: 10px 0; }
.group-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.group-actions button, .group-member button { border-radius: 8px; padding: 8px 10px; background: #18b578; color: #fff; }
.group-actions .danger, .group-member .danger { background: #ef4444; }
.group-card label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.group-toggle-row { border-bottom: 1px solid #f0f0f0; min-height: 44px; }
.group-toggle-row span { color: #374151; font-size: 15px; }
.group-toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--wx-brand); }
.group-member { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #e5eaf3; }
.group-member small { display: block; color: #8a929f; margin-top: 3px; }
.invite-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: #fff; word-break: break-all; }

.admin-shell { width: min(1720px, calc(100vw - 12px)); max-width: none; }
#adminPanel { padding: 24px; }
.admin-header, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { border-bottom: 1px solid #e5eaf3; padding: 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; }
.admin-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 680px; border-radius: 14px; overflow: hidden; border: 1px solid #e2e8f0; }
.admin-sidebar { background: #0f1c3f; color: #e2e8f0; padding: 20px 14px; display: flex; flex-direction: column; gap: 14px; }
.admin-sidebar h2 { margin: 6px 8px 0; font-size: 20px; color: #fff; }
.admin-sidebar .muted { margin: 0 8px; color: #94a3b8; }
.admin-nav { display: grid; gap: 8px; margin-top: 8px; }
.admin-nav-item { border-radius: 10px; padding: 10px 12px; text-align: left; background: transparent; color: #cbd5e1; }
.admin-nav-item:hover { background: rgba(148, 163, 184, .18); }
.admin-nav-item.active { background: var(--wx-brand); color: #fff; }
.admin-logout { margin-top: auto; background: #1e293b; color: #e2e8f0; width: 100%; }
.admin-content { background: #fff; padding: 22px; overflow: auto; }
.admin-content h3 { margin: 4px 0 16px; }
.toolbar { flex-wrap: wrap; justify-content: flex-start; }
.toolbar input { width: 200px; }
.overview-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.overview-card { border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; background: #f8fafc; }
.overview-card h4 { margin: 0 0 8px; font-size: 14px; color: #64748b; }
.overview-card strong { font-size: 28px; color: #0f172a; }
.admin-content .table table { table-layout: auto; }
.admin-content .table th, .admin-content .table td { padding: 8px 10px; font-size: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions button { padding: 6px 8px; border-radius: 8px; background: #eef2f7; color: #1e293b; }
.row-actions .danger-btn { background: #ef4444; color: #fff; }
.cell-stack { display: grid; gap: 4px; color: #475569; }
#messagesPager { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
#messagesPager button { border-radius: 8px; background: #eef2f7; color: #334155; padding: 6px 10px; }
#groupMembersModal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(920px, calc(100vw - 30px)); z-index: 80; padding: 16px; }
#groupChatRecordModal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 81; padding: 16px; }
.group-members-grid { display: grid; gap: 10px; max-height: 62vh; overflow-y: auto; }
.group-member-admin-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; }
.group-member-admin-avatar { width: 42px; height: 42px; border-radius: 10px; background: #e2e8f0; background-size: cover; background-position: center; display: grid; place-items: center; }
.toolbar-sub { margin-top: 8px; }
#adminPermsModal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 30px)); z-index: 82; padding: 16px; }
.admin-perms-grid { display: grid; gap: 10px; max-height: 50vh; overflow-y: auto; margin-bottom: 10px; }
.admin-perm-item { display: flex; align-items: center; justify-content: space-between; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; }
#adminFormModal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 30px)); z-index: 83; padding: 16px; }
#adminFormBody { margin-top: 8px; }
#adminFormBody label { display: grid; gap: 6px; color: #475569; }
.admin-body {
    min-height: 100vh;
    overflow-x: hidden;
    background-color: #050816;
    background-image:
        linear-gradient(135deg, rgba(5, 8, 22, .12), rgba(16, 27, 63, .18)),
        url('/assets/login-bg.svg'),
        radial-gradient(circle at 18% 16%, rgba(80, 202, 255, .32) 0%, transparent 30%),
        radial-gradient(circle at 78% 12%, rgba(168, 85, 247, .26) 0%, transparent 28%),
        radial-gradient(circle at 50% 88%, rgba(7, 193, 96, .2) 0%, transparent 30%),
        linear-gradient(135deg, #050816 0%, #0b1026 46%, #101b3f 100%);
    background-position: center, center, center, center, center, center;
    background-size: auto, cover, auto, auto, auto, auto;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
}
.admin-body::before,
.admin-body::after {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
}
.admin-body::before {
    opacity: .82;
    background-image:
        radial-gradient(circle at 12% 24%, rgba(255,255,255,.9) 0%, rgba(255,255,255,.9) .45%, transparent .75%),
        radial-gradient(circle at 32% 12%, rgba(255,255,255,.7) 0%, rgba(255,255,255,.7) .4%, transparent .72%),
        radial-gradient(circle at 72% 20%, rgba(255,255,255,.8) 0%, rgba(255,255,255,.8) .43%, transparent .74%),
        radial-gradient(circle at 88% 62%, rgba(255,255,255,.6) 0%, rgba(255,255,255,.6) .4%, transparent .7%),
        radial-gradient(circle at 44% 76%, rgba(255,255,255,.7) 0%, rgba(255,255,255,.7) .4%, transparent .72%);
    background-size: 260px 260px;
    animation: adminStars 28s linear infinite;
}
.admin-body::after {
    background-image:
        radial-gradient(ellipse at center, rgba(255,255,255,.22) 0%, rgba(255,255,255,.22) 18%, rgba(255,255,255,.06) 36%, transparent 62%),
        radial-gradient(ellipse at center, rgba(88, 166, 255, .24) 0%, rgba(88, 166, 255, .24) 16%, rgba(7, 193, 96, .08) 38%, transparent 64%);
    width: 360px;
    height: 360px;
    top: auto;
    right: auto;
    bottom: 8%;
    left: 7%;
    border-radius: 44% 56% 62% 38% / 42% 35% 65% 58%;
    filter: blur(.2px);
    animation: adminDroplet 10s ease-in-out infinite;
}
.admin-body .admin-shell {
    position: relative;
    z-index: 1;
    width: min(1720px, calc(100vw - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    align-items: center;
    padding: 18px 0;
}
.admin-body #adminLogin {
    position: relative;
    width: min(520px, calc(100vw - 34px));
    margin: 0 auto;
    padding: 42px 36px 34px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(236, 249, 255, .72));
    box-shadow: 0 30px 90px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .72);
    backdrop-filter: blur(22px);
}
.admin-body #adminLogin::before {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    right: -64px;
    top: -76px;
    border-radius: 45% 55% 62% 38% / 42% 34% 66% 58%;
    background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.92), rgba(93, 219, 255, .38) 36%, rgba(7, 193, 96, .14) 70%);
    animation: adminDroplet 8s ease-in-out infinite reverse;
}
.admin-body #adminLogin h1 {
    position: relative;
    margin: 0 0 28px;
    color: #111827;
    font-size: 38px;
    letter-spacing: 1px;
}
.admin-body #adminLogin input,
.admin-body .toolbar input,
.admin-body .toolbar select,
.admin-body #adminFormBody input,
.admin-body #adminFormBody select {
    height: 44px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 14px;
    background: rgba(255, 255, 255, .86);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.admin-body #adminLogin input:focus,
.admin-body .toolbar input:focus,
.admin-body .toolbar select:focus,
.admin-body #adminFormBody input:focus,
.admin-body #adminFormBody select:focus {
    border-color: rgba(7, 193, 96, .75);
    box-shadow: 0 0 0 4px rgba(7, 193, 96, .16), 0 0 26px rgba(80, 202, 255, .22);
}
.admin-body #adminLogin button,
.admin-body .toolbar button,
.admin-body .settings-tab-head.toolbar button,
.admin-body .row-actions button,
.admin-body .admin-logout,
.admin-body #submitAdminForm,
.admin-body #saveAdminPerms {
    border-radius: 14px;
    background: linear-gradient(135deg, #13d982, #06b6d4 48%, #6366f1);
    color: #fff;
    box-shadow: 0 12px 26px rgba(6, 182, 212, .24);
    font-weight: 600;
}
.admin-body #adminLogin button {
    height: 44px;
}
.admin-body #adminLogin button:hover,
.admin-body .toolbar button:hover,
.admin-body .settings-tab-head.toolbar button:hover,
.admin-body .row-actions button:hover,
.admin-body .admin-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(6, 182, 212, .32);
}
.admin-body #adminPanel {
    width: 100%;
    padding: 0;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 28px;
    background: rgba(255,255,255,.14);
    box-shadow: 0 28px 90px rgba(0,0,0,.28);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

/* 已登录后台：禁止整页随表格变长滚动；仅右侧主区域滚动，左侧菜单固定可视 */
.admin-body:has(#adminPanel:not(.hidden)) {
    height: 100vh;
    overflow: hidden;
}
.admin-body:has(#adminPanel:not(.hidden)) .admin-shell {
    min-height: 0;
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 18px 16px;
    box-sizing: border-box;
}
.admin-body:has(#adminPanel:not(.hidden)) #adminPanel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.admin-body:has(#adminPanel:not(.hidden)) #adminPanel .admin-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    min-height: 0 !important;
}
.admin-body:has(#adminPanel:not(.hidden)) .admin-sidebar {
    min-height: 0;
    overflow-y: auto;
    align-self: stretch;
}
.admin-body:has(#adminPanel:not(.hidden)) .admin-content {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-body .admin-layout {
    min-height: calc(100vh - 32px);
    border: 0;
    border-radius: 28px;
    background: rgba(255,255,255,.1);
}
.admin-body .admin-sidebar {
    border-right: 1px solid rgba(255,255,255,.13);
    background:
        radial-gradient(circle at 20% 10%, rgba(80,202,255,.26), transparent 34%),
        linear-gradient(180deg, rgba(8, 13, 35, .92), rgba(12, 22, 54, .86));
    color: #e5f2ff;
    padding: 26px 18px;
}
.admin-body .admin-sidebar h2 {
    color: #fff;
    font-size: 24px;
}
.admin-body .admin-sidebar .muted {
    color: #9fb3d1;
}
.admin-body .admin-nav-item {
    border: 1px solid transparent;
    border-radius: 14px;
    color: #c7d7ef;
    padding: 12px 14px;
}
.admin-body .admin-nav-item:hover {
    border-color: rgba(255,255,255,.14);
    background: rgba(255,255,255,.09);
}
.admin-body .admin-nav-item.active {
    background: linear-gradient(135deg, rgba(7,193,96,.95), rgba(6,182,212,.95));
    color: #fff;
    box-shadow: 0 12px 30px rgba(7,193,96,.22);
}
.admin-body .admin-content {
    background: linear-gradient(180deg, rgba(248, 252, 255, .94), rgba(239, 247, 255, .9));
    padding: 28px;
}
.admin-body .admin-content h3 {
    color: #111827;
    font-size: 24px;
}
.admin-body .overview-card,
.admin-body .table,
.admin-body #groupMembersModal,
.admin-body #adminPermsModal,
.admin-body #adminFormModal {
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 20px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 18px 46px rgba(15, 23, 42, .08);
    backdrop-filter: blur(12px);
}
.admin-body .overview-card {
    position: relative;
    overflow: hidden;
}
.admin-body .overview-card::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -44px;
    width: 100px;
    height: 100px;
    border-radius: 48% 52% 62% 38% / 42% 35% 65% 58%;
    background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.85), rgba(6,182,212,.2) 48%, transparent 70%);
}
.admin-body .overview-card strong {
    color: #08111f;
}
.admin-body table {
    margin-top: 0;
    overflow: hidden;
}
.admin-body th {
    border-bottom-color: rgba(148,163,184,.18);
    background: rgba(229, 243, 255, .76);
    color: #334155;
}
.admin-body td {
    border-bottom-color: rgba(148,163,184,.14);
}
.admin-body .row-actions .danger-btn {
    background: linear-gradient(135deg, #ff5f6d, #ef4444);
}
.admin-body .settings-tab-head.toolbar {
    margin: 0 0 22px;
    gap: 28px;
    flex-wrap: nowrap;
    justify-content: flex-start;
}
.admin-body .settings-tab-head.toolbar h3 {
    margin: 0;
    flex: 0 1 auto;
}
.admin-body .settings-panel {
    display: grid;
    gap: 18px;
}
.admin-body .settings-card {
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 20px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 18px 46px rgba(15, 23, 42, .08);
    padding: 18px;
}
.admin-body .settings-card h4 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 16px;
}
.admin-body .settings-card .muted {
    margin-top: 0;
}
.admin-body .user-filter-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
}
.admin-body .user-filter-toolbar input {
    width: min(260px, 34%);
}
.admin-body .user-filter-toolbar select {
    width: 160px;
    flex: none;
}
.admin-body .user-filter-toolbar button {
    flex: none;
}
.admin-body .admin-modal {
    padding: 22px;
    max-height: min(720px, calc(100vh - 42px));
    overflow: hidden;
}
.admin-body .admin-modal-head {
    align-items: center;
    margin-bottom: 18px;
}
.admin-body .admin-modal-head h3 {
    margin: 0;
    color: #111827;
    font-size: 22px;
}
.admin-body .admin-modal-head .ghost {
    min-width: 72px;
    height: 44px;
    border-radius: 14px;
    background: rgba(241, 245, 249, .9);
    color: #334155;
}
.admin-body #adminFormBody {
    gap: 14px;
    margin: 0;
}
.admin-body #adminFormBody label {
    gap: 9px;
    color: #475569;
    font-size: 15px;
}
.admin-body #adminFormBody input,
.admin-body #adminFormBody select {
    width: 100%;
}
.admin-body .admin-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}
.admin-body .admin-modal-actions button {
    min-width: 118px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #13d982, #06b6d4 48%, #6366f1);
    color: #fff;
    box-shadow: 0 12px 26px rgba(6, 182, 212, .24);
    font-weight: 600;
}
.admin-body #adminPermsModal {
    width: min(760px, calc(100vw - 32px));
}
.admin-body .admin-perms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-height: min(460px, calc(100vh - 210px));
    margin: 0;
    padding-right: 4px;
}
.admin-body .admin-perm-item {
    min-height: 62px;
    border-color: rgba(148, 163, 184, .24);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    padding: 12px 14px;
    color: #1f2937;
    font-size: 15px;
}
.admin-body .admin-perm-item span {
    max-width: 220px;
    line-height: 1.35;
}
.admin-body .admin-perm-item input {
    width: 18px;
    height: 18px;
    accent-color: #07c160;
}
.admin-body #groupMembersModal {
    width: min(960px, calc(100vw - 32px));
}
.admin-body .group-members-grid {
    max-height: min(560px, calc(100vh - 150px));
}
.admin-body #groupChatRecordModal {
    width: min(520px, calc(100vw - 32px));
}
.admin-group-chat-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.admin-body #groupChatLoadOlder {
    min-width: 100px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, .45);
    background: #fff;
    color: #334155;
    font-size: 14px;
    cursor: pointer;
}
.admin-body #groupChatLoadOlder:hover:not(:disabled) {
    border-color: #07c160;
    color: #047857;
}
.admin-body #groupChatLoadOlder:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.admin-group-chat-list {
    max-height: min(520px, calc(100vh - 220px));
    overflow-y: auto;
    padding: 14px 12px;
    background: #ededed;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}
.admin-gc-item {
    margin-bottom: 16px;
}
.admin-gc-name {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 4px 2px;
}
.admin-gc-bubble {
    display: flex;
    justify-content: flex-start;
}
.admin-gc-bubble-inner {
    max-width: 92%;
    background: #fff;
    border-radius: 4px 12px 12px 12px;
    padding: 8px 11px;
    font-size: 14px;
    color: #111827;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    word-break: break-word;
}
.admin-gc-text {
    line-height: 1.45;
}
.admin-gc-caption {
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
    line-height: 1.4;
}
.admin-gc-media {
    max-width: 240px;
    max-height: 240px;
    border-radius: 8px;
    display: block;
    margin-top: 2px;
}
.admin-gc-video {
    max-width: 280px;
    max-height: 220px;
    border-radius: 8px;
    display: block;
    margin-top: 4px;
}
.admin-gc-audio {
    width: 100%;
    max-width: 280px;
    margin-top: 4px;
}
.admin-gc-file {
    color: #0369a1;
    font-weight: 600;
    text-decoration: none;
}
.admin-gc-file:hover {
    text-decoration: underline;
}
.admin-gc-recalled {
    color: #94a3b8;
    font-size: 13px;
}
.admin-gc-time {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin: 4px 0 0 2px;
}
.admin-gc-item--system .admin-gc-sys {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    padding: 6px 10px;
    line-height: 1.45;
}
.admin-gc-sys-time {
    display: block;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}
.admin-gc-bk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 2px;
}
.admin-gc-bk-table th,
.admin-gc-bk-table td {
    border: 1px solid #e5e7eb;
    padding: 4px 5px;
    text-align: center;
}
.admin-gc-bk-table th {
    background: #f1f5f9;
    font-weight: 600;
}
.admin-gc-bk-more {
    margin: 6px 0 0;
    font-size: 12px;
}
.admin-gc-pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 12px;
    max-height: 180px;
    overflow: auto;
    font-family: ui-monospace, monospace;
}
.admin-body .group-member-admin-item {
    border-color: rgba(148, 163, 184, .22);
    border-radius: 16px;
    background: rgba(255, 255, 255, .74);
    padding: 12px;
}
@keyframes adminStars {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-260px, 180px, 0); }
}
@keyframes adminDroplet {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); border-radius: 44% 56% 62% 38% / 42% 35% 65% 58%; }
    50% { transform: translate3d(24px, -18px, 0) scale(1.08); border-radius: 58% 42% 40% 60% / 54% 62% 38% 46%; }
}
.group-manage-head-actions { display: flex; align-items: center; gap: 10px; }
.conversation-item-menu {
    position: fixed;
    z-index: 90;
    min-width: 126px;
    width: max-content;
    max-width: 180px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .2);
    padding: 6px;
    animation: panelFadeIn .14s ease;
}
.conversation-item-menu button {
    width: 100%;
    text-align: left;
    border-radius: 8px;
    background: transparent;
    color: #1e293b;
    padding: 8px 12px;
    white-space: nowrap;
}
.conversation-item-menu button:hover { background: #f1f5f9; }
.conversation-item-menu .conversation-menu-separator { height: 1px; background: #eef2f7; margin: 5px 0; }
.conversation-item-menu button.danger-btn { color: #ef4444; }
.message-action-menu {
    position: fixed;
    z-index: 95;
    min-width: 180px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .2);
    padding: 6px;
}
.message-action-menu button {
    width: 100%;
    text-align: left;
    border-radius: 8px;
    background: transparent;
    color: #1e293b;
    padding: 10px 12px;
}
.message-action-menu button:hover { background: #f1f5f9; }
.document-list-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #07c160;
}
.document-list-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.document-reader-view {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    background: #f7f7f7;
}
.document-reader-view header {
    padding: 22px 28px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.document-reader-view h2 { margin: 0 0 4px; }
.document-reader-body {
    margin: 0 auto;
    width: min(860px, calc(100% - 48px));
    height: 100%;
    overflow-y: auto;
    background: #fff;
    padding: 34px 42px 80px;
    color: #111827;
    line-height: 1.8;
    box-shadow: 0 12px 36px rgba(15, 23, 42, .08);
    -webkit-user-select: none;
    user-select: none;
    cursor: default;
}
.document-reader-body img {
    max-width: 100%;
    pointer-events: none;
    -webkit-user-drag: none;
}
.document-editor-panel {
    margin-top: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    padding: 14px;
}
.document-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.document-editor-head h4 { margin: 0; }
.document-meta-toolbar {
    grid-template-columns: minmax(220px, 1fr) 110px 120px auto;
}
.document-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: linear-gradient(180deg, #fafbfc 0%, #f3f4f6 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.document-editor-toolbar button,
.document-editor-toolbar select,
.document-editor-toolbar label {
    width: auto;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d0d7de;
    color: #24292f;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all .12s ease;
}
.document-editor-toolbar button:hover,
.document-editor-toolbar select:hover {
    background: #f6f8fa;
    border-color: #8c959f;
}
.document-editor-toolbar button:active {
    background: #edeff2;
    transform: translateY(0.5px);
}
.document-editor-toolbar button:focus,
.document-editor-toolbar select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.document-editor-toolbar .doc-tool-select {
    min-width: 100px;
    padding: 5px 8px;
    font-size: 12px;
}
.document-editor-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.document-editor-toolbar input[type="color"] {
    width: 30px;
    height: 24px;
    padding: 0;
    border: 0;
}
.document-editor-toolbar .toolbar-divider {
    width: 1px;
    height: 22px;
    background: #d0d7de;
    margin: 0 4px;
}
.document-editor-toolbar .toolbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    min-width: 16px;
}
.document-editor-toolbar .toolbar-icon.italic {
    font-style: italic;
}
.document-editor-toolbar .toolbar-icon.underline {
    text-decoration: underline;
}
.document-editor-toolbar .toolbar-icon.strike {
    text-decoration: line-through;
}
.document-editor-toolbar .toolbar-icon.fore-color-icon {
    color: #1f2937;
    font-size: 14px;
}
.document-editor-toolbar .toolbar-icon.back-color-icon {
    width: 16px;
    height: 12px;
    display: block;
    background: #fff59d;
    border: 1px solid #d4a80a;
    border-radius: 2px;
}
.document-editor-toolbar .color-picker-group {
    position: relative;
}
.document-editor-toolbar .color-btn {
    padding: 6px 8px;
}
.document-editor-toolbar .hidden-color-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}
.document-editor-toolbar button[title] {
    position: relative;
}
.document-editor-toolbar button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #24292f;
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
}
.document-editor-toolbar button[title]:hover::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #24292f;
    z-index: 100;
}
.document-content-editor {
    min-height: 460px;
    max-height: 62vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    padding: 26px;
    background: #fff;
    line-height: 1.8;
    outline: none;
}
.chat-search-overlay {
    position: absolute;
    inset: 0;
    z-index: 55;
    background: rgba(17, 24, 39, .28);
    display: grid;
    place-items: center;
    padding: 12px;
}
.chat-search-modal {
    width: min(760px, calc(100% - 8px));
    height: min(88vh, 760px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 24px 52px rgba(15, 23, 42, .22);
    display: grid;
    grid-template-rows: auto auto auto 1fr;
}
.chat-search-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f7;
}
.chat-search-input-row { padding: 12px 16px 8px; }
.chat-search-input-row input {
    height: 44px;
    border-radius: 10px;
    border: 2px solid #18c26c;
    padding: 0 12px;
}
.chat-search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 16px 10px;
    color: #6b7280;
    border-bottom: 1px solid #eef2f7;
}
.chat-search-list { overflow-y: auto; padding: 8px 12px 14px; background: #f9fafb; }
.chat-search-row {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 8px;
    border-bottom: 1px solid #eceff3;
}
.chat-search-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #18b578, #0ea5e9);
    color: #fff;
    display: grid;
    place-items: center;
}
.chat-search-meta { font-size: 12px; color: #94a3b8; margin-bottom: 4px; }
.chat-search-text { font-size: 14px; color: #0f172a; line-height: 1.45; }
.chat-search-empty { padding: 14px 8px; color: #94a3b8; }

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* —— 记账 —— */
.bookkeeping-dates-panel h2 { margin-bottom: 4px; font-size: 17px; }
.bookkeeping-tip-mini { margin: 0 0 10px; font-size: 12px; line-height: 1.45; }
.bookkeeping-date-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    padding-right: 4px;
}
.bookkeeping-date-item {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--wx-border);
    background: #fff;
    color: var(--wx-text);
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
}
.bookkeeping-date-item:hover { background: var(--wx-hover); }
.bookkeeping-date-item.is-active {
    border-color: var(--wx-brand);
    background: rgba(7, 193, 96, .08);
    box-shadow: 0 0 0 1px rgba(7, 193, 96, .2);
}
.bookkeeping-date-label { font-weight: 600; font-size: 14px; }
.bookkeeping-date-item small { font-size: 12px; color: var(--wx-subtext); }

.bookkeeping-editor-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--wx-panel);
    padding: 16px 20px 20px;
    overflow: hidden;
}
.bookkeeping-editor-head h2 { margin: 0 0 6px; font-size: 20px; }
.bookkeeping-target-line { margin: 0; font-size: 13px; }
.bookkeeping-editor-hint { margin: 0 0 12px; font-size: 13px; }
.bookkeeping-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.bookkeeping-toolbar-spacer { flex: 1; min-width: 8px; }
.bookkeeping-editor-toolbar button {
    padding: 8px 14px;
    border-radius: var(--wx-radius);
    background: linear-gradient(135deg, var(--wx-brand), var(--wx-brand-dark));
    color: #fff;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(7, 193, 96, .22);
}
.bookkeeping-editor-toolbar button.bookkeeping-btn-secondary {
    background: #fff;
    color: var(--wx-text);
    border: 1px solid var(--wx-border);
    box-shadow: none;
}
.bookkeeping-editor-toolbar button:active { transform: scale(0.98); }
.bookkeeping-table-wrap {
    overflow: auto;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    background: #fff;
    flex: 1;
    min-height: 200px;
}
.bookkeeping-table-wrap--wide .bookkeeping-table { min-width: 100%; }
.bookkeeping-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.bookkeeping-table th,
.bookkeeping-table td {
    border: 1px solid #cfcfcf;
    padding: 10px 12px;
    text-align: center;
    vertical-align: middle;
}
.bookkeeping-table thead th {
    background: #f3f3f3;
    font-weight: 600;
}
.bookkeeping-table tbody tr.bookkeeping-row--active td {
    background: rgba(7, 193, 96, .07);
}
.bookkeeping-table tbody td input {
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    text-align: center;
    background: transparent;
}
.bookkeeping-table tbody td input:focus {
    border-color: var(--wx-brand);
    background: #fff;
}
.bookkeeping-col-share {
    width: 44px;
    text-align: center;
    vertical-align: middle;
}
.bookkeeping-col-share input[type="checkbox"] {
    width: auto;
    margin: 0 auto;
    cursor: pointer;
}
.bookkeeping-source-cell {
    font-size: 13px;
    color: #475569;
    text-align: center;
    vertical-align: middle;
    max-width: 140px;
    word-break: break-all;
}
.bookkeeping-source-readonly { display: inline-block; line-height: 1.35; }

.message-bookkeeping-wrap {
    margin-top: 4px;
    overflow-x: auto;
    max-width: 100%;
}
.bubble.bubble-bookkeeping {
    max-width: min(96%, 720px);
    padding: 10px 12px;
}
.bookkeeping-inline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 420px;
    background: #fff;
    color: #111;
}
.bookkeeping-inline-table th,
.bookkeeping-inline-table td {
    border: 1px solid #cfcfcf;
    padding: 8px 8px;
    text-align: center;
    vertical-align: middle;
}
.bookkeeping-inline-table thead th {
    background: #f3f3f3;
    font-weight: 600;
}
.bubble.mine .bookkeeping-inline-table { background: #fff; }
.bookkeeping-import-wrap { margin-top: 10px; }
.bookkeeping-import-btn {
    padding: 6px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    color: var(--wx-brand-dark);
    font-size: 13px;
}
.bookkeeping-import-btn:hover {
    border-color: var(--wx-brand);
    background: rgba(7, 193, 96, .06);
}
.bookkeeping-share-overlay {
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(17, 24, 39, .38);
    display: grid;
    place-items: center;
    padding: 16px;
    box-sizing: border-box;
}
.bookkeeping-share-modal {
    width: min(440px, 100%);
    max-height: min(82vh, 560px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, .2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.bookkeeping-share-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}
.bookkeeping-share-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.bookkeeping-share-lead {
    margin: 0;
    padding: 10px 16px;
    font-size: 13px;
    line-height: 1.55;
    flex-shrink: 0;
}
.bookkeeping-share-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 16px 12px;
}
.bookkeeping-share-section h4 {
    margin: 12px 0 8px;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}
.bookkeeping-share-section:first-child h4 { margin-top: 6px; }
.bookkeeping-share-list { display: flex; flex-direction: column; gap: 6px; }
.bookkeeping-share-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    cursor: pointer;
}
.bookkeeping-share-item:hover { background: #f8fafc; }
.bookkeeping-share-item input[type="checkbox"] {
    width: auto;
    margin: 3px 0 0;
    flex-shrink: 0;
    cursor: pointer;
}
.bookkeeping-share-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.bookkeeping-share-item-main { font-size: 14px; line-height: 1.35; word-break: break-all; }
.bookkeeping-share-item-sub { font-size: 12px; color: #94a3b8; }
.bookkeeping-share-empty { margin: 8px 0; font-size: 13px; }
.bookkeeping-share-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 14px;
    border-top: 1px solid #eef2f7;
    background: #fafafa;
    flex-shrink: 0;
}
.bookkeeping-share-actions #bookkeepingShareSend {
    padding: 8px 16px;
    border-radius: var(--wx-radius);
    background: linear-gradient(135deg, var(--wx-brand), var(--wx-brand-dark));
    color: #fff;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(7, 193, 96, .22);
}

@keyframes drawerIn {
    from { transform: translateX(100%); opacity: .35; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 900px) {
    .shell { width: 100%; margin: 0; }
    .app-window { grid-template-columns: 58px 240px minmax(320px, 1fr); height: 100vh; min-height: 620px; border-radius: 0; }
    .profile-view, .requests-view, .settings-view { padding: 36px 32px; }
    .settings-form { grid-template-columns: 1fr; }
    .avatar-crop-panel { grid-template-columns: 1fr; }
    .group-create-layout { grid-template-columns: 1fr; }
    .wechat-group-picker { grid-template-columns: minmax(250px, 45%) minmax(280px, 1fr); }
    .group-picker-left { padding: 18px 18px 0; }
    .group-picker-main { padding: 24px 18px 18px 28px; }
    .group-create-buttons { gap: 18px; }
    .group-row { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { border-bottom: 1px solid rgba(148, 163, 184, .22); }
    .admin-body:has(#adminPanel:not(.hidden)) #adminPanel .admin-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }
    .admin-body:has(#adminPanel:not(.hidden)) .admin-sidebar {
        max-height: min(44vh, 320px);
    }
    .overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .toolbar input { width: 100%; }
}

@media (min-width: 1366px) and (max-width: 1535px) {
    .app-window { grid-template-columns: 64px 274px minmax(0, 1fr); }
    .messages { padding: 14px 18px; }
    .bubble { max-width: min(72%, 520px); }
}

@media (min-width: 1536px) and (max-width: 1919px) {
    .app-window { grid-template-columns: 64px 286px minmax(0, 1fr); }
    .messages { padding: 16px 22px; }
    .bubble { max-width: min(70%, 560px); }
}

@media (min-width: 1920px) {
    .shell { width: min(1660px, calc(100vw - 36px)); }
    .app-window { grid-template-columns: 64px 300px minmax(0, 1fr); }
    .messages { padding: 18px 24px; }
    .bubble { max-width: min(66%, 620px); }
}
