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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页样式 */
#home-page.active {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#home-page {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hero-section {
    text-align: center;
    color: white;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.title-main {
    background: linear-gradient(135deg, #4fd1c7 0%, #81e6d9 50%, #bee3f8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 12px rgba(129, 230, 217, 0.3));
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #a0aec0;
    margin-bottom: 50px;
    line-height: 1.6;
    font-style: italic;
    transition: opacity 0.3s ease-in-out;
    min-height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
}



.join-form {
    margin-top: 40px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.input-container {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.input-container input {
    width: 100%;
    padding: 16px 50px 16px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-container input::placeholder {
    color: #a0aec0;
}

.input-container input:focus {
    outline: none;
    border-color: #4fd1c7;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(79, 209, 199, 0.3);
}

.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.6;
}

.go-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, #ed64a6 0%, #f56565 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(237, 100, 166, 0.4);
}

.go-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 100, 166, 0.6);
}

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

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

/* 聊天页面样式 */
#chat-page.active {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

#chat-page {
    height: 100vh;
    flex-direction: column;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

/* 顶部头部 */
.chat-header {
    padding: 12px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.room-title {
    display: flex;
    align-items: center;
}

.hashtag {
    color: #4fd1c7;
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 5px;
}

#current-room {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

#leave-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

#global-mute-btn.muted {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

#global-mute-btn.muted .mute-slash {
    opacity: 1;
}

/* 用户列表 */
.users-container {
    overflow-x: auto;
    padding-bottom: 5px;
}

.users-list {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    margin: 0;
    flex-wrap: nowrap;
}

.user-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    position: relative;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.user-card:hover .user-action-btn {
    opacity: 1;
}

.user-card.current-user {
    background: rgba(79, 209, 199, 0.15);
    border: 1px solid rgba(79, 209, 199, 0.3);
    box-shadow: 0 0 10px rgba(79, 209, 199, 0.2);
}

.user-card.current-user:hover {
    background: rgba(79, 209, 199, 0.25);
    border-color: rgba(79, 209, 199, 0.4);
}

.user-card.muted-user {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    opacity: 0.7;
}

.user-card.muted-user:hover {
    background: rgba(255, 107, 107, 0.25);
    border-color: rgba(255, 107, 107, 0.4);
    opacity: 0.8;
}

.user-card.current-user.muted-user {
    background: rgba(255, 140, 0, 0.15);
    border: 1px solid rgba(255, 140, 0, 0.3);
}

.user-card.current-user.muted-user:hover {
    background: rgba(255, 140, 0, 0.25);
    border-color: rgba(255, 140, 0, 0.4);
}

.user-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar {
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(79, 209, 199, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(79, 209, 199, 0.3);
}

.user-action-btn {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: all 0.2s;
    z-index: 2;
}

.user-mute-btn {
    left: -8px;
    background: rgba(255, 193, 7, 0.9);
    color: #333;
}

.user-mute-btn:hover {
    background: rgba(255, 193, 7, 1);
    transform: scale(1.1);
}

.user-mute-btn.muted {
    background: rgba(255, 107, 107, 0.9);
    color: white;
}

.user-kick-btn {
    right: -8px;
    background: rgba(255, 107, 107, 0.9);
    color: white;
}

.user-kick-btn:hover {
    background: rgba(255, 107, 107, 1);
    transform: scale(1.1);
}

.user-info {
    text-align: center;
    min-width: 0;
    flex: 1;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.user-label {
    color: #4fd1c7;
    font-size: 0.6rem;
    font-weight: 500;
    opacity: 0.8;
}





/* 聊天主体 */
.chat-main {
    flex: 1;
    overflow: hidden;
    padding: 0 30px;
}

.messages {
    height: 100%;
    overflow-y: auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    display: flex;
    gap: 12px;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(79, 209, 199, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    border: 2px solid rgba(79, 209, 199, 0.3);
}

.message-body {
    flex: 1;
    min-width: 0;
}

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

.message-username {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.message-username.current-user {
    color: #4fd1c7;
}

.message-time {
    color: #a0aec0;
    font-size: 0.8rem;
    opacity: 0.7;
}

.copy-message-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    margin-left: 8px;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-message-btn:hover {
    color: #333;
    background-color: #f5f5f5;
}

.message-header:hover .copy-message-btn {
    opacity: 1;
}

.copy-message-btn svg {
    width: 14px;
    height: 14px;
}

.message-content {
    color: #e2e8f0;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 消息内链接样式 */
.message-content a {
    color: #63b3ed;
    text-decoration: underline;
}

.message-content a:hover {
    color: #90cdf4;
}

.own-message .message-content {
    color: #f7fafc;
}

/* 简化的代码格式样式 */
.inline-code {
    background: rgba(255, 255, 255, 0.1);
    color: #ffd43b;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.code-block {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin: 6px 0;
    padding: 8px 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 底部输入框 */
.chat-input-container {
    padding: 12px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.message-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 0;
    backdrop-filter: blur(20px);
}

#message-input {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 16px;
    border-radius: 25px;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    min-height: 20px;
    max-height: 120px;
    overflow-y: auto;
}

#message-input::placeholder {
    color: #a0aec0;
    opacity: 0.7;
}

#message-input:focus {
    outline: none;
}

.message-input:focus-within {
    border-color: #4fd1c7;
    box-shadow: 0 0 0 2px rgba(79, 209, 199, 0.2);
}

/* 系统消息 */
.system-message {
    background: rgba(79, 209, 199, 0.1);
    color: #4fd1c7;
    text-align: center;
    font-style: italic;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    align-self: center;
}

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

.messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.users-container::-webkit-scrollbar {
    height: 6px;
}

.users-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.users-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.users-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 管理员控制 */
.admin-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 2px;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.global-mute-btn {
    font-size: 0.9rem;
    padding: 6px 12px;
    margin-left: 15px;
}

.global-mute-btn.active {
    background: rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.admin-controls {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

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

.kick-btn:hover {
    background: rgba(255, 107, 107, 0.5);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    max-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.notification.info {
    background: rgba(79, 209, 199, 0.9);
    border: 1px solid #4fd1c7;
}

.notification.warning {
    background: rgba(255, 193, 7, 0.9);
    border: 1px solid #ffc107;
}

.notification.error {
    background: rgba(255, 107, 107, 0.9);
    border: 1px solid #ff6b6b;
}

@keyframes slideIn {
    from {
        top: 10px;
        opacity: 0;
    }
    to {
        top: 20px;
        opacity: 1;
    }
}

/* 用户状态图标 */
.user-name {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-icon {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 12px;
        max-width: 350px;
    }
    
    .input-container {
        min-width: auto;
    }
    
    .go-btn {
        width: 100%;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .room-title {
        margin-bottom: 15px;
    }
    
    .hashtag,
    #current-room {
        font-size: 1.2rem;
    }
    
    .user-card {
        min-width: 70px;
        padding: 8px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    .user-name {
        font-size: 0.7rem;
        max-width: 60px;
    }
    
    .chat-main {
        padding: 0 20px;
    }
    
    .chat-input-container {
        padding: 10px 20px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    #message-input {
        font-size: 16px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-section {
        padding: 20px 10px;
    }
    
    .form-row {
        max-width: 280px;
    }
}
