@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;700&family=Yuji+Syuku&family=Ma+Shan+Zheng&display=swap');

/* 设计系统变量定义 */
:root {
    --font-main: "Plus Jakarta Sans", "Outfit", "Noto Sans SC", system-ui, -apple-system, sans-serif;
    
    /* 浅色主题色彩 */
    --bg-body: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    --bg-app: rgba(255, 255, 255, 0.75);
    --bg-sidebar: rgba(255, 255, 255, 0.6);
    --bg-main: rgba(248, 250, 252, 0.5);
    --bg-header: rgba(255, 255, 255, 0.65);
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-bubble: #ffffff;
    --bg-hover: rgba(241, 245, 249, 0.6);
    --bg-mask: rgba(255, 255, 255, 0.7);
    --border: rgba(226, 232, 240, 0.8);
    
    --text: #0f172a;
    --text-sub: #475569;
    --text-muted: #94a3b8;
    --text-placeholder: #cbd5e1;
    
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.08);
    --glass-blur: blur(20px);
    
    --border-highlight: rgba(254, 215, 170, 0.5);
    --bg-highlight: rgba(254, 243, 199, 0.4);
    --composer-h: 50px;
    
    /* 主题色默认 (绿) */
    --primary: #10b981;
    --primary-rgb: 16, 185, 129;
    --primary-gradient: linear-gradient(135deg, #10b981, #059669);
    --primary-glow: rgba(16, 185, 129, 0.25);
    --primary-bg-weak: rgba(16, 185, 129, 0.08);
    --primary-bg-strong: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] {
    /* 深色暗黑主题色彩 */
    --bg-body: linear-gradient(135deg, #312e81 0%, #0f172a 100%);
    --bg-app: rgba(15, 23, 42, 0.75);
    --bg-sidebar: rgba(15, 23, 42, 0.65);
    --bg-main: rgba(9, 15, 29, 0.4);
    --bg-header: rgba(15, 23, 42, 0.7);
    --bg-input: rgba(30, 41, 59, 0.6);
    --bg-bubble: rgba(30, 41, 59, 0.8);
    --bg-hover: rgba(30, 41, 59, 0.5);
    --bg-mask: rgba(9, 15, 29, 0.85);
    --border: rgba(51, 65, 85, 0.5);
    
    --text: #f8fafc;
    --text-sub: #cbd5e1;
    --text-muted: #64748b;
    --text-placeholder: #475569;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
    
    --border-highlight: rgba(251, 191, 36, 0.2);
    --bg-highlight: rgba(251, 191, 36, 0.08);
}

/* 调色盘配色方案 */
[data-palette="green"] {
    --primary: #10b981;
    --primary-rgb: 16, 185, 129;
    --primary-gradient: linear-gradient(135deg, #10b981, #059669);
    --primary-glow: rgba(16, 185, 129, 0.3);
    --primary-bg-weak: rgba(16, 185, 129, 0.08);
    --primary-bg-strong: rgba(16, 185, 129, 0.15);
}
[data-palette="blue"] {
    --primary: #3b82f6;
    --primary-rgb: 59, 130, 246;
    --primary-gradient: linear-gradient(135deg, #3b82f6, #1d4ed8);
    --primary-glow: rgba(59, 130, 246, 0.3);
    --primary-bg-weak: rgba(59, 130, 246, 0.08);
    --primary-bg-strong: rgba(59, 130, 246, 0.15);
}
[data-palette="purple"] {
    --primary: #8b5cf6;
    --primary-rgb: 139, 92, 246;
    --primary-gradient: linear-gradient(135deg, #8b5cf6, #6d28d9);
    --primary-glow: rgba(139, 92, 246, 0.3);
    --primary-bg-weak: rgba(139, 92, 246, 0.08);
    --primary-bg-strong: rgba(139, 92, 246, 0.15);
}
[data-palette="orange"] {
    --primary: #f97316;
    --primary-rgb: 249, 115, 22;
    --primary-gradient: linear-gradient(135deg, #f97316, #ea580c);
    --primary-glow: rgba(249, 115, 22, 0.3);
    --primary-bg-weak: rgba(249, 115, 22, 0.08);
    --primary-bg-strong: rgba(249, 115, 22, 0.15);
}
[data-palette="red"] {
    --primary: #ef4444;
    --primary-rgb: 239, 68, 68;
    --primary-gradient: linear-gradient(135deg, #ef4444, #dc2626);
    --primary-glow: rgba(239, 68, 68, 0.3);
    --primary-bg-weak: rgba(239, 68, 68, 0.08);
    --primary-bg-strong: rgba(239, 68, 68, 0.15);
}

/* 基础样式 reset 与美化 */
* {
    box-sizing: border-box;
    outline: none;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 99px;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background: var(--bg-body);
    font-family: var(--font-main);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 整体应用框架容器 */
.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--bg-app);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    border-right: 1px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 侧边栏群组信息卡片 */
.sidebar-info-area {
    padding: 30px 24px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.room-avatar-large {
    width: 85%;
    height: 48px;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.room-avatar-large:hover {
    transform: scale(1.08) rotate(5deg);
}

.room-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.meta-badge {
    background: var(--bg-input);
    color: var(--text-sub);
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 8px;
    font-family: "Outfit", monospace;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
#roomIdContainer:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 4px 10px var(--primary-glow);
}

/* 在线成员与搜索列表 */
.sidebar-list-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
}
.list-header {
    padding: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: transparent;
    z-index: 5;
}
.online-count-badge {
    background: var(--primary-bg-weak);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

/* 列表子项美化 */
.user-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: default;
    margin-bottom: 4px;
    border: 1px solid transparent;
}
.user-list-item:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    transform: translateX(2px);
}
.user-name {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}
.user-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: "Outfit", sans-serif;
}

/* 侧边搜索区域 */
.sidebar-search-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.search-wrapper {
    position: relative;
    width: 100%;
}
.search-wrapper input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    height: 38px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 13px;
    color: var(--text);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-wrapper input:focus {
    background: var(--bg-bubble);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}
.search-wrapper input::placeholder {
    color: var(--text-placeholder);
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
    transition: color 0.2s;
}
.search-wrapper input:focus + .search-icon {
    color: var(--primary);
}

/* 侧边栏底部操作区 */
.sidebar-bottom-bar {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}
.action-btn {
    flex: 1;
    min-width: 0;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-sub);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
}
.action-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    border-color: var(--text-muted);
}
.action-btn:active {
    transform: translateY(0);
}
.action-btn.danger {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}
.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}
.action-btn.primary {
    color: var(--primary);
    background: var(--primary-bg-weak);
    border-color: rgba(var(--primary-rgb), 0.2);
}
.action-btn.primary:hover {
    background: var(--primary-bg-strong);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-label {
    font-size: 12px;
    white-space: nowrap;
}

/* 聊天主界面 */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-main);
    overflow: hidden;
}
.main-header {
    height: 64px;
    background: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}
.conv-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}
.conv-title:hover {
    color: var(--primary);
}
.menu-btn {
    display: none;
    font-size: 20px;
    color: var(--text-sub);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    margin-right: 8px;
    transition: all 0.2s;
}
.menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.top-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    height: 36px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 500;
}
.top-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text);
}
.top-btn:active {
    transform: scale(0.96);
}
.top-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 调色盘浮动面板 */
.palette-menu {
    position: absolute;
    top: 56px;
    right: 24px;
    background: var(--bg-app);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 8px;
    z-index: 20;
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.palette-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.palette-swatch:hover {
    transform: scale(1.2);
    border-color: #ffffff;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* 公告栏公告 */
#announcementBar {
    background: var(--primary-bg-weak);
    padding: 10px 18px;
    font-size: 13px;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border);
    display: none;
    align-items: flex-start;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

/* 消息滚动区域 */
.messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}
.sys-time {
    align-self: center;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    font-size: 11px;
    font-family: "Outfit", sans-serif;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 99px;
    margin: 8px 0;
    letter-spacing: 0.5px;
}

/* 消息行结构 */
.msg-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    max-width: 85%;
    animation: fadeInMsg 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInMsg {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.msg-row.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.msg-row.match {
    background: var(--bg-highlight);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 6px;
}
.msg-row.pending .bubble {
    opacity: 0.65;
}
.msg-row.pending .bubble::after {
    content: '';
    position: absolute;
    right: -24px;
    bottom: 10px;
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary-bg-strong);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 头像组件 */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
    overflow: hidden;
    text-align: center;
    padding: 2px;
    line-height: 1.2;
    word-break: break-all;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    user-select: none;
}
.avatar:hover {
    transform: scale(1.06) rotate(3deg);
    box-shadow: var(--shadow-md);
}

/* 气泡样式重构 */
.bubble {
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.55;
    background: var(--bg-bubble);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--text);
    transition: transform 0.2s ease;
}
.msg-row.mine .bubble {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--primary-glow);
    border-top-right-radius: 4px;
}
.msg-row:not(.mine) .bubble {
    border-top-left-radius: 4px;
}
.bubble.has-img {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}
.msg-img {
    max-width: min(280px, 75vw);
    max-height: 40vh;
    border-radius: 14px;
    display: block;
    cursor: zoom-in;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.msg-img:hover {
    transform: scale(1.015);
    box-shadow: var(--shadow-md);
}

/* 气泡悬浮操作面板 */
.msg-actions {
    position: absolute;
    top: -24px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 5;
}
.msg-row.mine .msg-actions {
    left: 12px;
    right: auto;
}
.msg-row:hover .msg-actions {
    opacity: 1;
    transform: translateY(0);
}
.msg-action {
    background: var(--bg-app);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    color: var(--text-sub);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
}
.msg-action:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* 气泡内文件卡片设计 */
.msg-file {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 8px 10px;
    min-width: 220px;
    border-radius: 12px;
    transition: background-color 0.2s;
}
.file-icon {
    width: 42px;
    height: 42px;
    background: rgba(148, 163, 184, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-sub);
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.file-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}
.file-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-size {
    font-size: 11px;
    color: var(--text-muted);
    font-family: "Outfit", sans-serif;
}
.msg-row.mine .file-name {
    color: #ffffff;
}
.msg-row.mine .file-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}
.msg-row.mine .file-size {
    color: rgba(255, 255, 255, 0.8);
}

/* 输入区（控制台风格包装） */
.composer {
    border-top: 1px solid var(--border);
    background: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 16px 24px;
}
.composer-inner {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}
.input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.input {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg-input);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    min-height: 38px;
    height: 38px;
    max-height: 120px;
    overflow-y: auto;
    font-family: inherit;
    color: var(--text);
    line-height: 1.5;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.input:focus {
    background: var(--bg-bubble);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 22px;
    flex-shrink: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
}
.tool-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}
.send-btn {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0 16px;
    height: 36px;
    font-size: 13.5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.send-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}
.send-btn:active {
    transform: translateY(1px);
}

/* 艾特列表弹出框 */
.mention-list {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: min(260px, calc(100vw - 48px));
    background: var(--bg-app);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 30;
    margin-bottom: 8px;
    animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.mention-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mention-item:hover, .mention-item.active {
    background: var(--bg-hover);
}
.mention-item .avatar-small {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 10px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* 底部功能与表情展开面板 */
.action-panel {
    display: none;
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    background: var(--bg-sidebar);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.action-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.action-tab {
    padding: 0 4px 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
}
.action-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* 表情网格 */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}
.emoji-cell {
    font-size: 22px;
    text-align: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.15s;
}
.emoji-cell:hover {
    background: var(--bg-hover);
    transform: scale(1.15);
}

/* 功能网格 */
.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-sub);
}
.action-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
}
.action-item:hover .action-icon {
    background: var(--bg-hover);
    transform: translateY(-3px) scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 6px 16px var(--primary-glow);
}
.action-label {
    font-size: 12px;
    font-weight: 500;
}

/* 微信/回到最新消息提示 */
.back-to-latest-btn {
    position: absolute;
    bottom: 86px;
    right: 24px;
    background: var(--bg-app);
    backdrop-filter: var(--glass-blur);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 700;
    border: 1px solid var(--border);
    z-index: 15;
    transition: all 0.2s;
}
.back-to-latest-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Landing 登录页面重构 */
.landing-page {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    position: relative;
    overflow-y: auto;
    padding: 24px;
}

#landingLogin, #landingActions {
    width: 100%;
    max-width: 380px;
    background: var(--bg-app);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 36px 30px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 登录品牌LOGO */
.brand-logo {
    width: 68px;
    height: 68px;
    border-radius: 20px !important;
    background: var(--bg-sidebar) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid var(--border) !important;
    box-shadow: 0 8px 24px var(--primary-glow) !important;
    animation: pulseGlow 2.5s infinite ease-in-out;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 20px var(--primary-glow); transform: scale(1); }
    50% { box-shadow: 0 12px 30px var(--primary-glow); transform: scale(1.04); }
}

/* 现代输入框组件 */
.modern-input-group {
    position: relative;
    width: 100%;
    margin-bottom: 18px;
}
.modern-input {
    width: 100%;
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    padding: 22px 16px 8px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    color: var(--text) !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.25s ease !important;
}
.modern-input:focus {
    border-color: var(--primary) !important;
    background: var(--bg-bubble) !important;
    box-shadow: 0 0 10px var(--primary-glow) !important;
}
.modern-label {
    position: absolute;
    left: 16px;
    top: 16px;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13.5px;
}
.modern-input:focus ~ .modern-label,
.modern-input:not(:placeholder-shown) ~ .modern-label,
.modern-input:-webkit-autofill ~ .modern-label {
    top: 6px !important;
    font-size: 10px !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.modern-btn {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
    font-size: 15.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.modern-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--primary-glow);
}
.modern-btn:active {
    transform: translateY(1px);
}

/* 登录免责声明卡片 */
.disclaimer-card {
    width: 100%;
    padding: 12px 14px;
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 14px;
    margin-bottom: 20px;
}
.disclaimer-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 11.5px;
    color: var(--text-sub);
    font-weight: 500;
}

/* 弹窗遮罩 */
.login-mask {
    position: fixed;
    inset: 0;
    background: var(--bg-mask);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.login-card {
    width: 90%;
    max-width: 340px;
    background: var(--bg-app);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-card h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.login-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
    background: var(--bg-input);
    color: var(--text);
    transition: all 0.2s;
}
.login-input:focus {
    border-color: var(--primary);
    background: var(--bg-bubble);
    box-shadow: 0 0 10px var(--primary-glow);
}
.login-btn {
    width: 100%;
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
    border: none;
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: all 0.2s;
}
.login-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}
.login-btn:active {
    transform: translateY(1px);
}

/* 放大图片 lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.lightbox.show {
    opacity: 1;
}
.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.show img {
    transform: scale(1);
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}
.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* 移动端与响应式排版适配 */
@media (max-width: 640px) {
    .app {
        border: none;
    }
    .sidebar {
        position: absolute;
        inset: 0;
        width: 260px;
        z-index: 50;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-header {
        padding: 0 16px;
        height: 52px;
    }
    .menu-btn {
        display: block;
    }
    .bubble {
        max-width: 90%;
    }
    .top-btn span {
        display: none !important;
    }
    .messages {
        padding: 16px;
        gap: 12px;
    }
    .composer {
        padding: 10px 16px;
    }
    .composer-inner {
        gap: 8px;
    }
    .input {
        font-size: 15px;
    }
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .sidebar {
        background: var(--bg-sidebar);
    }
    .action-panel {
        padding: 16px;
    }
}

@media (min-width: 641px) {
    .sidebar {
        transform: none !important;
    }
}

/* 历史房间列表项 */
.room-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.room-history-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--primary-glow);
}
.room-history-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}
.room-history-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: "Outfit", sans-serif;
}

