* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
nav {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.brand-logo i {
    margin-right: 8px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

nav ul li a, nav ul li span {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 25px;
    transition: background 0.3s;
    font-weight: 400;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 认证页面 */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a5568;
    font-weight: 600;
}

.auth-card h2 i {
    margin-right: 10px;
    color: #667eea;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.input-group label i {
    margin-right: 8px;
    color: #667eea;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: 'Poppins', sans-serif;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.captcha-group .captcha-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-group input {
    flex: 1;
}

.captcha-img {
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid #e2e8f0;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a1 100%);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-footer {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.center {
    flex: 1;
    text-align: center;
}

/* 提示消息 */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert i {
    font-size: 1.2rem;
}

.alert-success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.alert-info {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    color: #2c5282;
    border-left: 4px solid #4299e1;
}

/* 首页房间列表 */
.room-list {
    list-style: none;
    padding: 0;
}

.room-list li {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.room-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.room-list a {
    text-decoration: none;
    font-weight: 600;
    color: #4a5568;
}

.room-list span {
    color: #718096;
}

.create-room {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.create-room h3 {
    margin-bottom: 15px;
    color: #4a5568;
}

.create-room form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.create-room input, .create-room button {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.create-room input[type="text"], .create-room input[type="password"] {
    flex: 1 1 200px;
}

.create-room button {
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.create-room button:hover {
    background: #5a67d8;
}

/* 房间页面 */
.room-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-height: 600px;
    display: flex;
    flex-direction: column;
}

.room-header {
    padding: 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-bottom: 1px solid #e2e8f0;
}

.room-header h2 {
    margin-bottom: 5px;
    color: #4a5568;
}

.room-header p {
    color: #718096;
}

.chat-area {
    display: flex;
    flex: 1;
    min-height: 500px;
}

.user-list {
    width: 250px;
    background: #f7fafc;
    border-right: 1px solid #e2e8f0;
    padding: 20px;
    overflow-y: auto;
}

.user-list h4 {
    margin-bottom: 15px;
    color: #4a5568;
}

.user-list ul {
    list-style: none;
}

.user-list li {
    padding: 8px 10px;
    margin-bottom: 5px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 500;
}

.message-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: white;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.message .username {
    font-weight: 600;
    color: #667eea;
    margin-right: 10px;
}

.message .timestamp {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-left: 10px;
}

.message .content {
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 12px;
    display: inline-block;
    max-width: 80%;
    word-wrap: break-word;
}

.input-area {
    display: flex;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
}

#message-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#message-input:focus {
    outline: none;
    border-color: #667eea;
}

#send-btn {
    width: 80px;
    margin-left: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
}

#send-btn:hover {
    background: #5a67d8;
}

/* 管理面板表格 */
.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.users-table th, .users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.users-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
}

.users-table tr:hover {
    background: #f7fafc;
}

.btn-small {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-danger {
    background: #f56565;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-success {
    background: #48bb78;
}

.btn-success:hover {
    background: #38a169;
}

.btn-warning {
    background: #ed8936;
}

.btn-warning:hover {
    background: #dd6b20;
}