* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 简洁的顶部信息栏 */
.top-bar {
    position: fixed;
    top: 10px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 1000;
}

.top-bar .user-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.media-toggle-btn-small {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.media-toggle-btn-small:hover {
    transform: scale(1.1);
    background: white;
}

.logout-link {
    background: rgba(255, 255, 255, 0.95);
    color: #e74c3c;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.logout-link:hover {
    background: #e74c3c;
    color: white;
}

.lock-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.lock-btn:hover {
    transform: scale(1.1);
    background: white;
}

/* 锁定界面 */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lock-box {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.lock-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.lock-box h2 {
    color: #1a1a2e;
    margin-bottom: 10px;
    font-size: 24px;
}

.lock-box p {
    color: #4a4a6a;
    margin-bottom: 30px;
}

.unlock-form {
    display: flex;
    gap: 10px;
}

.unlock-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

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

.unlock-form button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.unlock-form button:hover {
    opacity: 0.9;
}

.error-text {
    color: #e74c3c;
    margin-top: 15px;
    font-size: 14px;
}

.media-panel {
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.media-section {
    width: 100%;
}

.media-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.media-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f0f0f0;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item:hover {
    transform: scale(1.05);
    transition: transform 0.2s;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 18px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

.username-setup {
    padding: 40px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.username-setup input {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.3s;
}

.username-setup input:focus {
    border-color: #667eea;
}

.username-setup button {
    padding: 12px 40px;
    font-size: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.username-setup button:hover {
    transform: translateY(-2px);
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
}

.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

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

.message.own-message {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 5px;
}

.message-username {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.message.own-message .message-username {
    color: #764ba2;
}

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

.message-content {
    background: #f0f0f0;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
    word-wrap: break-word;
}

.message.own-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.input-area {
    border-top: 1px solid #e0e0e0;
    padding: 15px;
    flex-shrink: 0;
    background: white;
}

.file-preview {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
}

.file-preview img {
    max-height: 100px;
    border-radius: 4px;
}

.remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

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

/* 确保表情面板相对于input-controls定位 */
.input-controls .emoji-panel {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
}

.tools-toggle-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: transform 0.2s;
}

.tools-toggle-btn:hover {
    transform: scale(1.1);
}

.tools-panel {
    display: flex;
    gap: 10px;
    align-items: center;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 12px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
}



.sound-btn {
    background: #f0f0f0;
    transition: all 0.2s;
}

.sound-btn:hover {
    background: #e0e0e0;
}

.sound-btn.muted {
    opacity: 0.5;
}

.emoji-btn {
    background: #f0f0f0;
}

.emoji-btn:hover {
    background: #e0e0e0;
}

.emoji-panel {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

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

.emoji {
    font-size: 32px;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
}



.emoji:hover {
    background: #f0f0f0;
    transform: scale(1.25);
}

.input-controls button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.attach-btn {
    background: #f0f0f0;
}

.attach-btn:hover {
    background: #e0e0e0;
}

.voice-btn {
    background: #f0f0f0;
}

.voice-btn:hover {
    background: #e0e0e0;
}

.voice-btn.recording {
    background: #ff4757;
    color: white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.input-controls textarea {
    flex: 1;
    padding: 12px 20px;
    min-height: 56px;
    max-height: 120px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-size: 18px;
    outline: none;
    transition: border-color 0.3s;
    resize: none;
    overflow-y: auto;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.input-controls textarea:focus {
    border-color: #667eea;
}

.input-controls textarea:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

#sendBtn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

#sendBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

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

.login-header p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

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

.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.login-hint strong {
    color: #333;
}

/* 新消息气泡 */
.new-message-badge {
    position: absolute;
    top: 80px;
    right: 5%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    animation: bounceIn 0.5s ease;
    z-index: 1000;
}



@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.new-message-badge .unread-count {
    font-size: 20px;
    font-weight: 700;
    margin-right: 5px;
}

/* 整体聊天界面响应式优化 */
@media (max-width: 768px) {
    .chat-section {
        height: calc(100vh - 20px);
        border-radius: 16px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message .message-content {
        padding: 8px 12px;
        font-size: 16px;
        line-height: 1.6;
    }
    
    .message-username {
        font-size: 16px;
    }
    
    .message-time {
        font-size: 14px;
    }
    
    .input-controls textarea {
        padding: 14px 18px;
        font-size: 18px;
    }
    
    .top-bar {
        padding: 8px 15px;
    }
}

@media (max-width: 576px) {
    .chat-section {
        height: 100vh;
        border-radius: 16px;
    }
    
    .container {
        padding: 8px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message .message-content {
        padding: 14px 18px;
        font-size: 17px;
        line-height: 1.6;
    }
    
    .message-username {
        font-size: 15px;
    }
    
    .message-time {
        font-size: 13px;
    }
    
    .input-controls textarea {
        padding: 14px 18px;
        font-size: 17px;
    }
    
    .input-controls button {
        padding: 10px 14px;
        font-size: 18px;
    }
    
    .top-bar {
        padding: 6px 12px;
        font-size: 15px;
    }
    
    .lock-box {
        max-width: 90%;
        padding: 30px 20px;
    }
    
    .lock-box h2 {
        font-size: 22px;
    }
    
    .lock-box input {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .lock-box button {
        padding: 12px 24px;
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .message-content {
        max-width: 90%;
    }
    
    .message .message-content {
        padding: 12px 16px;
        font-size: 16px;
        line-height: 1.6;
    }
    
    .message-username {
        font-size: 14px;
    }
    
    .message-time {
        font-size: 12px;
    }
    
    .input-controls textarea {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* 时间线按钮样式 */
.timeline-btn {
    background: #f0f0f0;
}

.timeline-btn:hover {
    background: #e0e0e0;
}

/* 退出按钮样式 */
.logout-btn {
    background: #f0f0f0;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.logout-btn:hover {
    background: #e0e0e0;
}

/* 时间线面板样式 */
.timeline-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    z-index: 1000;
    border: 1px solid #e0e0e0;
    overflow-y: auto;
    overflow-x: hidden;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.timeline-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.close-timeline-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-timeline-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.add-timeline-btn-container {
    padding: 15px 20px;
}

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

.add-timeline-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.timeline-form {
    padding: 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

.timeline-form .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.timeline-form .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.timeline-form .form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.image-preview {
    margin-top: 10px;
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.timeline-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.save-timeline-btn,
.cancel-timeline-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.save-timeline-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.save-timeline-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cancel-timeline-btn {
    background: #f0f0f0;
    color: #333;
}

.cancel-timeline-btn:hover {
    background: #e0e0e0;
}

.timeline-list {
    padding: 20px;
}

.timeline-item {
    position: relative;
    padding-left: 30px;
    padding-bottom: 25px;
    border-left: 2px solid #e0e0e0;
}

.timeline-item:last-child {
    border-left: 2px solid transparent;
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.timeline-item-time {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.timeline-item-actions {
    display: flex;
    gap: 8px;
}

.timeline-edit-btn,
.timeline-delete-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.timeline-edit-btn {
    color: #667eea;
}

.timeline-edit-btn:hover {
    background: #f0f0f0;
}

.timeline-delete-btn {
    color: #ff4757;
}

.timeline-delete-btn:hover {
    background: #ffebee;
}

.timeline-item-content {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.timeline-item-image {
    margin-top: 10px;
}

.timeline-item-image img {
    max-width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.timeline-item-image img:hover {
    transform: scale(1.02);
}

.timeline-item-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.timeline-item-creator {
    color: #999;
    font-size: 12px;
}

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

/* ==================== 响应式样式统一区域 ==================== */

/* 平板和大屏手机 (≤768px) */
@media (max-width: 768px) {
    /* 工具面板 */
    .tools-panel {
        padding: 10px 14px;
        gap: 10px;
        width: 98%;
        max-width: 440px;
    }
    
    .tools-panel button,
    .tools-panel .logout-btn {
        padding: 10px 14px;
        font-size: 18px;
    }
    
    .input-controls .emoji-panel {
        width: 90%;
        max-width: 360px;
    }
    
    /* 表情面板 */
    .emoji-panel {
        width: 90%;
        max-width: 360px;
        padding: 12px;
        border-radius: 8px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }
    
    .emoji {
        font-size: 28px;
        padding: 10px;
    }
    
    /* 新消息气泡 */
    .new-message-badge {
        right: 10%;
        top: 60px;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    /* 聊天界面 */
    .chat-section {
        height: calc(100vh - 20px);
        border-radius: 16px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message .message-content {
        padding: 12px 16px;
        font-size: 18px;
        line-height: 1.6;
    }
    
    .message-username {
        font-size: 16px;
    }
    
    .message-time {
        font-size: 14px;
    }
    
    .input-controls textarea {
        padding: 14px 18px;
        font-size: 18px;
    }
    
    .top-bar {
        padding: 8px 15px;
    }
    
    /* 时间线 */
    .timeline-panel {
        width: 95%;
        max-height: 85vh;
    }
    
    .timeline-header {
        padding: 15px;
    }
    
    .timeline-header h3 {
        font-size: 18px;
    }
    
    .timeline-form {
        padding: 15px;
    }
    
    .timeline-list {
        padding: 15px;
    }
}

/* 中等屏幕手机 (≤576px) */
@media (max-width: 576px) {
    /* 工具面板 */
    .tools-panel {
        padding: 8px 12px;
        gap: 8px;
        width: 98%;
        max-width: 420px;
    }
    
    .tools-panel button,
    .tools-panel .logout-btn {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .input-controls .emoji-panel {
        width: 92%;
        max-width: 320px;
    }
    
    /* 表情面板 */
    .emoji-panel {
        width: 92%;
        max-width: 320px;
        padding: 10px;
        border-radius: 6px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .emoji {
        font-size: 26px;
        padding: 10px;
    }
    
    /* 聊天界面 */
    .chat-section {
        height: 100vh;
        border-radius: 16px;
    }
    
    .container {
        padding: 8px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message .message-content {
        padding: 14px 18px;
        font-size: 17px;
        line-height: 1.6;
    }
    
    .message-username {
        font-size: 15px;
    }
    
    .message-time {
        font-size: 13px;
    }
    
    .input-controls textarea {
        padding: 14px 18px;
        font-size: 17px;
    }
    
    .input-controls button {
        padding: 10px 14px;
        font-size: 18px;
    }
    
    .top-bar {
        padding: 6px 12px;
        font-size: 15px;
    }
    
    .lock-box {
        max-width: 90%;
        padding: 30px 20px;
    }
    
    .lock-box h2 {
        font-size: 22px;
    }
    
    .lock-box input {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .lock-box button {
        padding: 12px 24px;
        font-size: 16px;
    }
}

/* 小屏手机 (≤480px) */
@media (max-width: 480px) {
    /* 新消息气泡 */
    .new-message-badge {
        right: 50%;
        transform: translateX(50%);
        top: 50px;
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .new-message-badge .unread-count {
        font-size: 18px;
    }
}

/* 超小屏手机 (≤400px) */
@media (max-width: 400px) {
    /* 工具面板 */
    .tools-panel {
        padding: 7px 10px;
        gap: 7px;
        width: 98%;
        max-width: 380px;
    }
    
    .tools-panel button,
    .tools-panel .logout-btn {
        padding: 7px 10px;
        font-size: 15px;
    }
    
    .input-controls .emoji-panel {
        width: 95%;
        max-width: 300px;
    }
    
    /* 表情面板 */
    .emoji-panel {
        width: 95%;
        max-width: 300px;
        padding: 8px;
        border-radius: 4px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .emoji {
        font-size: 24px;
        padding: 8px;
    }
    
    /* 聊天界面 */
    .message-content {
        max-width: 90%;
    }
    
    .message .message-content {
        padding: 12px 16px;
        font-size: 16px;
        line-height: 1.6;
    }
    
    .message-username {
        font-size: 14px;
    }
    
    .message-time {
        font-size: 12px;
    }
    
    .input-controls textarea {
        padding: 12px 16px;
        font-size: 16px;
    }
}
