/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* 登录界面 */
.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.login-box p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

#passwordInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

#passwordInput:focus {
    outline: none;
    border-color: #667eea;
}

#loginBtn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
    -webkit-appearance: none;
}

#loginBtn:hover {
    transform: translateY(-2px);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    min-height: 20px;
}

/* 房间选择界面 */
.room-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 500px;
    max-width: 100%;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
}

.room-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.room-header-bar h2 {
    color: #333;
    font-size: 24px;
}

.room-box h2 {
    color: #333;
    font-size: 24px;
    text-align: center;
}

.room-section {
    margin-bottom: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.room-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.room-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-section h3::before {
    content: '🏠';
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    flex: 1;
    justify-content: center;
}

.input-group input {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.primary-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
    -webkit-appearance: none;
}

.primary-btn:hover {
    transform: translateY(-1px);
}

.secondary-btn {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    -webkit-appearance: none;
}

.secondary-btn:hover {
    background: #218838;
}

.result-message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    min-height: 30px;
    transition: all 0.3s ease;
}

.result-message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.result-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.result-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #bee5eb;
}

.room-list {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    padding: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.room-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.room-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.room-item:hover::before {
    opacity: 1;
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-id {
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-id::before {
    content: '🏠';
    font-size: 14px;
}

.room-users {
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

.room-users::before {
    content: '👥';
    font-size: 12px;
}

.room-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #6c757d;
    flex-wrap: wrap;
}

.room-stat {
    display: flex;
    align-items: center;
    gap: 3px;
}

.join-room-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    -webkit-appearance: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 90px;
    position: relative;
    overflow: hidden;
}

.join-room-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    transition: left 0.5s ease;
}

.join-room-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.join-room-btn:hover::before {
    left: 100%;
}

.join-room-btn:active {
    transform: translateY(0);
}

.small-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    -webkit-appearance: none;
}

.small-btn:hover {
    background: #545b62;
}

/* 空状态样式 */
.room-list-empty {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
    font-style: italic;
    font-size: 16px;
}

.room-list-empty::before {
    content: '🚪';
    display: block;
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

/* 刷新按钮样式 */
#refreshRoomsBtn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    -webkit-appearance: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

#refreshRoomsBtn::before {
    content: '🔄';
    font-size: 18px;
    animation: spin 2s linear infinite;
    animation-play-state: paused;
}

#refreshRoomsBtn:hover {
    background: linear-gradient(135deg, #218838 0%, #17a2b8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

#refreshRoomsBtn:hover::before {
    animation-play-state: running;
}

#refreshRoomsBtn:active {
    transform: translateY(0);
}

#refreshRoomsBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 昵称提示样式 */
.username-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

.username-hint::before {
    content: '💡 ';
    font-style: normal;
}

.back-btn {
    width: 100%;
    padding: 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    -webkit-appearance: none;
}

.back-btn:hover {
    background: #c82333;
}

/* 聊天界面 */
.chat-container {
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 聊天头部 */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.room-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.encryption-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.shortcut-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
    -webkit-appearance: none;
}

.shortcut-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.leave-btn {
    background: rgba(255, 193, 7, 0.8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    -webkit-appearance: none;
}

.leave-btn:hover {
    background: rgba(255, 193, 7, 1);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    -webkit-appearance: none;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 消息样式 */
.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: slideIn 0.3s ease;
}

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

.message.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.message.received {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.received .message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 5px;
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.message-image:hover {
    transform: scale(1.05);
}

.message-time {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    opacity: 0.8;
}

.message.sent .message-time {
    text-align: right;
}

.system-message {
    align-self: center !important;
    max-width: 90% !important;
}

.system-message .message-bubble {
    background: #e9ecef !important;
    color: #666 !important;
    text-align: center;
    font-style: italic;
}

.system-timestamp {
    font-size: 0.8em;
    color: #999;
    margin-left: 8px;
    font-weight: normal;
}

.version-timestamp {
    font-size: 0.7em;
    color: #bbb;
    text-align: center;
    margin-top: 8px;
    font-family: monospace;
}

/* 输入区域 */
.input-container {
    background: white;
    border-top: 1px solid #e1e5e9;
    padding: 15px 20px;
}

.input-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: #667eea;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
}

.control-btn:hover {
    background: #e9ecef;
}

.send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s ease;
    -webkit-appearance: none;
}

.send-btn:hover {
    transform: translateY(-1px);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 正在输入指示器 */
.typing-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #1976d2;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    text-align: center;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid #e1f5fe;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
    z-index: 1000;
    pointer-events: none;
    overflow: hidden;
    font-style: normal;
    font-weight: 500;
}

.typing-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 表情面板 */
.emoji-panel {
    position: absolute;
    bottom: 120px;
    right: 20px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 1000;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji {
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.2s ease;
    text-align: center;
}

.emoji:hover {
    background: #f8f9fa;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==================== 自动删除面板 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.auto-delete-panel {
    background: #f4f5f0;
    width: 90%;
    max-width: 350px;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    margin: 0;
    text-align: center;
    flex: 1;
}

.text-btn {
    background: none;
    border: none;
    color: #28a745;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    text-align: left;
}

.time-selector-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    margin: 10px 0 30px;
    mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
}

.selector-highlight {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 40px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
}

.time-selector {
    list-style: none;
    padding: 80px 0;
    margin: 0;
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.time-selector::-webkit-scrollbar {
    display: none;
}

.time-selector li {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999;
    scroll-snap-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.time-selector li.selected {
    color: #333;
    font-weight: 500;
    font-size: 22px;
}

.panel-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.confirm-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.confirm-btn:hover {
    background: #218838;
}

.disable-btn {
    background: transparent;
    color: #28a745;
    border: none;
    padding: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ==================== 信箱系统 ==================== */
.mailbox-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.mailbox-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    -webkit-appearance: none;
}

.mailbox-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

.mailbox-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
}

.pulse-animation {
    animation: badgePulse 1.5s infinite;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.mail-action-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    -webkit-appearance: none;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.mail-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

/* 信箱弹窗 */
.mailbox-panel {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.mailbox-read-panel {
    max-width: 450px;
}

.mailbox-setup-content,
.send-mail-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mailbox-setup-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.mailbox-setup-content input,
.mailbox-password-gate input,
.send-mail-content input,
.send-mail-content textarea,
.send-mail-content select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    width: 100%;
}

.send-mail-content textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.send-mail-content input:focus,
.send-mail-content textarea:focus,
.mailbox-setup-content input:focus,
.mailbox-password-gate input:focus {
    outline: none;
    border-color: #667eea;
}

.mail-expire-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mail-expire-group label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.mail-expire-group select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.mailbox-password-gate {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 0;
}

.mailbox-messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}

.mailbox-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

.mail-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e1e5e9;
    transition: all 0.2s ease;
}

.mail-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mail-from {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.mail-time {
    font-size: 12px;
    color: #999;
}

.mail-body {
    color: #333;
    font-size: 15px;
    line-height: 1.5;
    padding: 10px 0;
    word-wrap: break-word;
}

.mail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.mail-expire {
    font-size: 12px;
    color: #999;
}

.mail-delete-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.mail-delete-btn:hover {
    opacity: 1;
}

/* ==================== 快捷方式弹窗 ==================== */
.shortcut-panel {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.shortcut-content {
    text-align: center;
}

.shortcut-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.shortcut-icon-preview {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.shortcut-room-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.shortcut-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.shortcut-instructions {
    text-align: left;
    margin-bottom: 20px;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.step-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.instruction-step > div {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    padding-top: 3px;
}

.shortcut-note {
    font-size: 13px;
    color: #e67e22;
    font-style: italic;
    margin-top: 10px;
}

.shortcut-url-display {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    word-break: break-all;
}

.shortcut-url-display code {
    font-size: 13px;
    color: #667eea;
}

.shortcut-actions {
    margin-top: 10px;
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    .chat-container {
        height: 100vh;
        border-radius: 0;
    }

    .login-container,
    .room-container {
        width: 100%;
        margin: 10px;
        padding: 20px;
        border-radius: 10px;
    }

    .login-box h2,
    .room-box h2 {
        font-size: 24px;
    }

    .message {
        max-width: 85%;
    }

    .input-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    #messageInput {
        flex: 1 1 100%;
        order: 1;
    }

    .control-btn,
    .send-btn {
        order: 2;
    }

    .emoji-panel {
        right: 10px;
        left: 10px;
        bottom: 140px;
    }

    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .chat-header {
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .status-info {
        justify-content: space-between;
    }

    .header-buttons {
        justify-content: center;
    }

    .room-section {
        padding: 15px;
    }

    .input-group input {
        padding: 10px;
        font-size: 16px;
    }

    .primary-btn,
    .secondary-btn,
    .back-btn {
        padding: 10px;
        font-size: 16px;
    }

    .room-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .join-room-btn {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .input-controls {
        gap: 5px;
    }

    .control-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .send-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .chat-container {
        height: 100vh;
    }

    .messages-container {
        padding: 10px;
    }

    .input-container {
        padding: 10px 15px;
    }

    .emoji-panel {
        bottom: 100px;
    }
}
/* Lobby Optimization Styles */
.global-user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #e1e5e9;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.profile-avatar {
    font-size: 30px;
    background: white;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-input {
    flex: 1;
}

.profile-input input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s;
}

.profile-input input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.lobby-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: #e2e6ea; /* 加深底色使其与纯白容器形成对比 */
    padding: 6px;
    border-radius: 12px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); /* 内阴影增加凹陷感 */
}

.lobby-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #495057; /* 稍加深未选中字体 */
    cursor: pointer;
    transition: all 0.3s ease;
}

.lobby-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* 增强活动标签的浮出感 */
    transform: scale(1.02);
}

.lobby-tab-content {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.lobby-tab-content.active {
    opacity: 1;
    transform: translateY(0);
}

.lobby-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #333;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#sendMailBtn.glass-btn {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}
#sendMailBtn.glass-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Lock tab content height to prevent bouncing */
.lobby-tab-content {
    min-height: 330px; /* 改回最小伸展高度，允许包含大数据块 */
    display: flex;
    flex-direction: column;
}

#roomList {
    flex: 1;
    min-height: 0;
    max-height: 260px; /* 限制列表的极限高度，不再无限撑大 */
    margin-bottom: 15px;
}

/* ==================== 自动删除时间提示 ==================== */
.auto-delete-tip {
    background: rgba(166, 166, 166, 0.15); /* 浅红色背景 */
    color: #a0a0a0; /* 浅红色文字 */
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
    display: inline-block;
    animation: fadeInSlideUp 1s ease-out;
    border: 1px solid rgba(214, 48, 49, 0.2);
    backdrop-filter: blur(10px);
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== 系统公告跑马灯 ==================== */
.announcement-wrapper {
    background: linear-gradient(135deg, #fff9c4, #ffe082);
    border: 1px solid #ffd54f;
    border-radius: 10px;
    padding: 8px 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.15);
    overflow: hidden;
    position: relative;
    color: #e65100;
}

.announcement-icon {
    font-size: 18px;
    margin-left: 10px;
    flex-shrink: 0;
    animation: bellShake 2s infinite ease-in-out;
}

.announcement-marquee {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    height: 24px;
}

.announcement-marquee span {
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    line-height: 24px;
    padding-left: 100%;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    10%, 30%, 50% { transform: rotate(-15deg); }
    20%, 40% { transform: rotate(15deg); }
    60% { transform: rotate(0); }
}
