/* 微信风格 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 认证区域 */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background-color: white;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.auth-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    color: #999;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: #07c160;
    border-bottom-color: #07c160;
}

.form {
    display: none;
}

.form.active {
    display: block;
}

input[type="text"],
input[type="password"],
input[type="url"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #07c160;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background-color: #06ad56;
}

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

.hidden {
    display: none !important;
}

/* 主界面 */
.main-section {
    display: flex;
    height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 300px;
    background-color: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-details {
    flex: 1;
}

.user-details span {
    display: block;
    font-size: 14px;
}

#current-user-nickname {
    font-weight: bold;
    color: #333;
}

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

.logout-btn {
    background-color: #fa5151;
    padding: 5px 10px;
    font-size: 14px;
    width: auto;
}

.settings-section {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.settings-btn {
    width: 100%;
    margin-bottom: 10px;
    background-color: #f0f0f0;
    color: #333;
    font-size: 14px;
}

/* 管理员面板 */
.admin-panel {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.admin-panel h3 {
    color: #333;
    margin-bottom: 15px;
}

.admin-controls {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    margin-bottom: 10px;
}

.search-box input {
    flex: 1;
    margin-right: 5px;
}

.search-box button {
    width: auto;
    padding: 8px 15px;
    margin-left: 5px;
}

.clear-time-section {
    margin-bottom: 10px;
}

.clear-time-section label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.clear-time-section select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.clear-time-section button,
#clear-all-messages-btn {
    width: 100%;
    background-color: #fa5151;
    margin-bottom: 10px;
}

.user-list-container h4 {
    margin-bottom: 10px;
    color: #666;
}

#user-list {
    list-style: none;
}

#user-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.user-actions button {
    padding: 5px 10px;
    font-size: 12px;
    margin-left: 5px;
    border-radius: 3px;
}

.user-actions .mute-btn {
    background-color: #fa5151;
}

.user-actions .unmute-btn {
    background-color: #07c160;
}

.user-actions .remove-btn {
    background-color: #999;
}

/* 聊天区域 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

.chat-header {
    padding: 15px 20px;
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    font-size: 18px;
    font-weight: bold;
}

.messages-container {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 70%;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.message.own {
    align-self: flex-end;
}

.message .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-bottom: 5px;
}

.message.own .avatar {
    align-self: flex-end;
}

.message .content {
    padding: 10px 15px;
    border-radius: 10px;
    word-wrap: break-word;
    font-size: 14px;
}

.message.own .content {
    background-color: #bfe6cf;
    align-self: flex-end;
}

.message:not(.own) .content {
    background-color: white;
    border: 1px solid #e0e0e0;
}

.message .info {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    align-self: flex-end;
}

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

#message-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 14px;
}

#send-btn {
    width: auto;
    padding: 10px 20px;
    border-radius: 20px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.modal-content input {
    margin-bottom: 10px;
}

.modal-content button {
    width: 48%;
    margin: 0 1% 0 1%;
}

.modal-content button:nth-child(3) {
    margin-right: 0;
}

.modal-content button:nth-child(4) {
    margin-left: 0;
}