/* 全局样式 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}


/* 登录页面动态炫彩背景 */

.login-page-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, #ee7752 0%, #eb6d60 3%, #e8636e 6%, #e5597c 9%, #e24f8a 12%, #df4598 15%, #dc3ba6 18%, #d831b4 21%, #d527c2 24%, #c83cb3 27%, #bb51a4 30%, #ae6695 33%, #a17b86 36%, #949077 39%, #87a568 42%, #7aba59 45%, #6dcf4a 48%, #60e43b 51%, #5dd648 54%, #5ac855 57%, #57ba62 60%, #54ac6f 63%, #519e7c 66%, #4e9089 69%, #4b8296 72%, #4874a3 75%, #5275b5 78%, #5c76c7 81%, #6677d9 84%, #7078eb 87%, #7a79fd 90%, #8d7ef8 93%, #a083f3 96%, #b388ee 100%);
    background-size: 100% 600%;
    animation: gradientShift 25s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

.login-page-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 30%, rgba(238, 119, 82, 0.5) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(231, 60, 126, 0.5) 0%, transparent 50%), radial-gradient(circle at 40% 70%, rgba(35, 166, 213, 0.5) 0%, transparent 50%), radial-gradient(circle at 90% 80%, rgba(167, 139, 250, 0.5) 0%, transparent 50%);
    animation: radialMove 20s ease-in-out infinite;
    filter: blur(60px);
    z-index: 0;
    opacity: 0.8;
}

@keyframes radialMove {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(10%, -10%) scale(1.1);
    }
    50% {
        transform: translate(-10%, 10%) scale(0.9);
    }
    75% {
        transform: translate(10%, 10%) scale(1.05);
    }
}

.login-page-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 30%, rgba(238, 119, 82, 0.4) 0%, transparent 40%), radial-gradient(circle at 80% 20%, rgba(231, 60, 126, 0.4) 0%, transparent 40%), radial-gradient(circle at 40% 70%, rgba(35, 166, 213, 0.4) 0%, transparent 40%), radial-gradient(circle at 90% 80%, rgba(35, 213, 171, 0.4) 0%, transparent 40%), radial-gradient(circle at 60% 50%, rgba(167, 139, 250, 0.4) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: radialMove 15s ease-in-out infinite;
}

@keyframes radialMove {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translate(10%, -10%) rotate(90deg);
        opacity: 0.9;
    }
    50% {
        transform: translate(-10%, 10%) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translate(10%, 10%) rotate(270deg);
        opacity: 0.9;
    }
}


/* 页面布局 */

.page {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* 添加左右间隙 */
    position: relative;
}

.page.hidden {
    display: none;
}


/* 登录/注册页面 */

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

.login-card {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(15px);
    border-radius: 28px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
    padding: 18px 15px 15px 15px !important;
    width: 55% !important;
    max-width: 260px !important;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient( 45deg, rgba(238, 119, 82, 0.3) 0%, rgba(231, 60, 126, 0.3) 16.66%, rgba(35, 166, 213, 0.3) 33.33%, rgba(35, 213, 171, 0.3) 50%, rgba(167, 139, 250, 0.3) 66.66%, rgba(124, 58, 237, 0.3) 83.33%, rgba(238, 119, 82, 0.3) 100%);
    background-size: 400% 400%;
    animation: cardGradientShift 18s ease infinite;
    z-index: -1;
    filter: blur(20px);
    opacity: 0.9;
}

@keyframes cardGradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.login-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(238, 119, 82, 0.2) 0%, transparent 50%), radial-gradient(circle at 80% 70%, rgba(231, 60, 126, 0.2) 0%, transparent 50%), radial-gradient(circle at 50% 50%, rgba(35, 166, 213, 0.2) 0%, transparent 50%), radial-gradient(circle at 60% 20%, rgba(167, 139, 250, 0.2) 0%, transparent 50%);
    background-size: 150% 150%, 150% 150%, 150% 150%, 150% 150%;
    animation: cardRadialMove 12s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes cardRadialMove {
    0%,
    100% {
        background-position: 0% 0%, 100% 100%, 50% 50%, 60% 20%;
        transform: scale(1);
    }
    33% {
        background-position: 100% 0%, 0% 100%, 30% 70%, 40% 60%;
        transform: scale(1.1);
    }
    66% {
        background-position: 50% 100%, 50% 0%, 70% 30%, 80% 80%;
        transform: scale(0.95);
    }
}

.login-container.login-card {
    background: rgba(255, 255, 255, 0.85) !important;
    border-radius: 28px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
    padding: 18px 15px 15px 15px !important;
    width: 55% !important;
    max-width: 260px !important;
    overflow: hidden;
}


/* 装饰球 */

.decorative-balls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 0;
}

.balls-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

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

.logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.logo h1 {
    font-size: 24px;
    color: #333;
    font-weight: 500;
}

#login-form,
#register-form {
    width: 100%;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0 auto 0 auto;
    padding-bottom: 0;
}

#login-form .login-btn,
#register-form .login-btn {
    align-self: center;
    width: 100%;
    max-width: 240px;
}

.form-group {
    margin-bottom: 15px;
    display: block;
    width: 100%;
    font-size: 0;
    line-height: 0;
}

.form-group label {
    display: inline-block;
    font-size: 14px !important;
    color: #333;
    font-weight: 500;
    width: 45px;
    text-align: left;
    margin: 0;
    padding: 0;
    line-height: normal;
    vertical-align: middle;
}

.form-group input {
    display: inline-block;
    width: calc(100% - 45px);
    max-width: 195px;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px !important;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
    color: #333;
    margin: 0;
    margin-left: 0;
    vertical-align: middle;
    line-height: normal;
}

.form-group input::placeholder {
    color: #999;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

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

.login-btn {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    color: white;
    font-size: 15px;
    font-weight: 500;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
    margin-top: 5px;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 240px;
    display: block;
    text-align: center;
}

.login-btn:hover {
    background: linear-gradient(135deg, #9d79f8 0%, #6d29e0 100%);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}


/* 🔒 验证码样式 */

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 15px;
    width: 100%;
}

.captcha-row label {
    display: inline-block;
    font-size: 14px !important;
    color: #333;
    font-weight: 500;
    width: 45px;
    text-align: left;
    margin: 0;
    padding: 0;
    line-height: normal;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.captcha-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    width: calc(100% - 45px);
    max-width: 195px;
}

.captcha-question {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0 5px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    min-width: 65px;
    max-width: 110px;
    flex: 1;
    height: 36px;
    line-height: 36px;
    white-space: nowrap;
    letter-spacing: -0.3px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.captcha-question:hover {
    background: linear-gradient(135deg, #5a6fd6, #6a3d96);
    transform: scale(1.02);
}

.captcha-question:active {
    transform: scale(0.98);
}

.captcha-input {
    width: 55px !important;
    flex-shrink: 0;
    height: 36px;
    padding: 0 6px !important;
    text-align: center;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

.captcha-input:focus {
    border-color: #a78bfa;
    outline: none;
}

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

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer a {
    color: #a78bfa;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.form-footer a:hover {
    color: #7c3aed;
    text-decoration: underline;
}

.error-message {
    color: #fa5151;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
    min-height: 0;
    height: auto;
    line-height: 1.4;
    font-size: 14px;
}

.error-message:empty {
    display: none;
}


/* 聊天主界面 */

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(var(--vh, 1vh) * 100);
    /* 🔥 使用实际可视高度 */
    max-width: 430px;
    margin: 0 auto;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: white;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}


/* 侧边栏 */

.sidebar {
    width: 100%;
    background: white;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: auto;
    flex-shrink: 0;
    /* 🔥 防止被压缩 */
}


/* 顶部横条：用户信息和房间标题 */

.top-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ffb66b 0%, #ffa55a 50%, #ff9449 100%);
    background-size: 200% 200%;
    animation: titleGradientMove 3s ease infinite;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.top-header-bar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    animation: titleShine 2s ease-in-out infinite;
    pointer-events: none;
}


/* 内联用户信息 */

.user-info-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
    position: relative;
}

.user-info-inline img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-details-inline {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-details-inline .nickname {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.user-details-inline .status {
    font-size: 12px;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}


/* 在顶部横条中的房间标题（居中，3D立体效果，粉色阴影） */

.top-header-bar .room-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 2px rgba(255, 105, 180, 0.6), 0 3px 4px rgba(255, 105, 180, 0.5), 0 4px 6px rgba(255, 20, 147, 0.4), 0 5px 8px rgba(255, 20, 147, 0.3), 0 6px 10px rgba(219, 112, 147, 0.25), 0 0 20px rgba(255, 182, 193, 0.8), 0 0 40px rgba(255, 105, 180, 0.6), 0 0 60px rgba(255, 20, 147, 0.4), -1px -1px 0 rgba(255, 182, 193, 0.4), -2px -2px 0 rgba(255, 105, 180, 0.3);
    z-index: 2;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    padding: 0;
    background: none;
    animation: none;
    box-shadow: none;
    white-space: nowrap;
    filter: drop-shadow(0 2px 4px rgba(255, 105, 180, 0.5)) drop-shadow(0 4px 8px rgba(255, 20, 147, 0.4)) drop-shadow(0 6px 12px rgba(219, 112, 147, 0.3)) drop-shadow(0 0 15px rgba(255, 182, 193, 0.6));
    -webkit-text-stroke: 0.5px rgba(255, 182, 193, 0.5);
}


/* 使用伪元素创建立体阴影层（粉色阴影）- 动态获取文本内容 */

.top-header-bar .room-title::before {
    content: attr(data-room-name);
    position: absolute;
    top: 3px;
    left: 3px;
    width: 100%;
    height: 100%;
    color: rgba(255, 105, 180, 0.6);
    z-index: -1;
    text-shadow: none;
    filter: blur(2px);
    opacity: 0.8;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    -webkit-text-stroke: 0;
}


/* 使用伪元素创建高光层 - 动态获取文本内容 */

.top-header-bar .room-title::after {
    content: attr(data-room-name);
    position: absolute;
    top: -1px;
    left: -1px;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 1;
    text-shadow: none;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    opacity: 0.7;
    pointer-events: none;
    -webkit-text-stroke: 0;
}


/* 返回大厅按钮 */

.back-to-lobby-btn {
    background: linear-gradient(135deg, #ff4444 0%, #ff3333 50%, #cc0000 100%);
    color: #ffffff;
    border: none;
    border-radius: 18px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    z-index: 2;
    position: relative;
    white-space: nowrap;
    min-width: auto;
    width: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(204, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.back-to-lobby-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    animation: buttonShine 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes buttonShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.back-to-lobby-btn:hover {
    background: linear-gradient(135deg, #ff5555 0%, #ff4444 50%, #dd0000 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(204, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 68, 68, 0.6);
}

.back-to-lobby-btn:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(204, 0, 0, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}


/* 河内房间标题 - 生动样式（在右侧聊天区域顶部） */

.main-content .room-title {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 25%, #ffb66b 50%, #ff8e8e 75%, #ff6b6b 100%);
    background-size: 200% 200%;
    animation: titleGradientMove 3s ease infinite;
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 3px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 255, 255, 0.5), 0 0 30px rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border-bottom: 2px solid rgba(255, 107, 107, 0.3);
}

.main-content .room-title::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: titleShine 2s ease-in-out infinite;
    pointer-events: none;
}

.main-content .room-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 50%), radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    animation: titleGlow 2.5s ease-in-out infinite;
}

@keyframes titleGradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes titleShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes titleGlow {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

.user-info {
    display: flex !important;
    align-items: center;
    padding: 8px 15px;
    /* 🔥 减少padding */
    border-bottom: 1px solid #e0e0e0;
    height: 60px;
    /* 🔥 固定高度60px */
    min-height: 60px;
    max-height: 60px;
    /* 🔥 防止被撑高 */
    flex-shrink: 0;
    background: white;
    overflow: hidden;
    /* 🔥 防止内容溢出 */
}

.user-info img {
    width: 44px;
    /* 🔥 缩小头像 */
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
    /* 🔥 允许文字截断 */
    overflow: hidden;
}

.user-details .nickname {
    font-weight: 500;
    font-size: 15px;
    /* 🔥 稍微缩小字体 */
    color: #333;
    line-height: 1.4;
    white-space: nowrap;
    /* 🔥 防止换行 */
    overflow: hidden;
    text-overflow: ellipsis;
    /* 🔥 超长显示省略号 */
}

.user-details .status {
    font-size: 12px;
    color: #07c160;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    /* 🔥 进一步减小padding */
    height: 28px;
    /* 🔥 固定高度30px */
    min-height: 28px;
    max-height: 28px;
    flex-shrink: 0;
    overflow: hidden;
}

.atus {
    font-size: 11px;
    /* 🔥 缩小字体 */
    color: #f50505;
    line-height: 1.2;
    /* 🔥 减小行高 */
    display: flex;
    align-items: center;
    margin-left: 0;
}

.jatus {
    font-size: 11px;
    /* 🔥 缩小字体 */
    color: #1000f7;
    line-height: 1.2;
    /* 🔥 减小行高 */
    display: flex;
    align-items: center;
    margin-left: 15px;
    /* 🔥 减小间距 */
}

.si {
    font-size: 11px;
    /* 🔥 缩小字体 */
    color: #00f320;
    line-height: 1.2;
    /* 🔥 减小行高 */
    display: flex;
    align-items: center;
    margin-left: 15px;
    /* 🔥 减小间距 */
}

.jie-container {
    display: flex;
    align-items: center;
    margin: 0 auto;
    /* 居中显示 */
}

.balls-container {
    display: flex;
    gap: 4px;
    /* 🔥 减小球之间的间距 */
    margin-left: 4px;
    /* 🔥 与“届:“文字的间距 */
}

.ball {
    width: 16px;
    /* 🔥 缩小球的尺寸 */
    height: 16px;
    border-radius: 40%;
    background-color: #c40c0c;
    border: 1px solid #b10c0c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    /* 🔥 缩小字体 */
    color: #ffffff;
}


/* 全局隐藏好友列表和聊天列表，只保留用户信息和信息栏 */

.friends-list,
.chat-list {
    display: none;
}

.friend-item,
.chat-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.friend-item:hover,
.chat-item:hover {
    background-color: #f5f5f5;
}

.friend-item.active,
.chat-item.active {
    background-color: #e8f4ff;
}

.friend-avatar,
.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.friend-info,
.chat-info {
    flex: 1;
}

.friend-name,
.chat-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.friend-actions {
    display: flex;
    gap: 5px;
}

.friend-actions button {
    width: auto;
    padding: 5px 10px;
    font-size: 12px;
}


/* 去除退出登录按钮样式 */


/* 主内容区 */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 0;
    /* 🔥 关键：让flex正常工作 */
    overflow: hidden;
    min-height: 0;
    /* 🔥 防止flex子项溢出 */
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.chat-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    /* 去除返回按钮样式 */
}


/* 去除返回按钮样式 */

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
    min-height: 0;
    /* 🔥 允许滚动 */
    -webkit-overflow-scrolling: touch;
    /* 🔥 iOS滚动优化 */
    /* 🔥 修复旧版iOS Safari滚动闪白问题 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: scroll-position;
    /* 🔥 确保背景不会闪烁 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.welcome-message {
    text-align: center;
    color: #999;
    margin-top: 50px;
}

.message {
    margin-bottom: 15px;
    display: flex;
    max-width: 85%;
}

.message.own {
    margin-left: auto;
}

.message-avatar {
    width: 30rem;
    height: 30rem;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 10rem;
}

.message-content {
    padding: 10rem 15rem;
    border-radius: 8rem;
    font-size: 14rem;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
    overflow-wrap: break-word;
}

.message.other .message-content {
    background: white;
    border: 1px solid #e0e0e0;
    color: #333;
}

.message.own .message-content {
    background: #07c160;
    color: white;
}

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

.chat-input-area {
    display: flex;
    align-items: flex-end;
    padding: 10px 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
    /* 🔥 防止被压缩 */
    min-height: 60px;
    /* 🔥 确保最小高度 */
}

#message-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    resize: none;
    font-size: 14px;
    height: 36px;
    min-height: 36px;
    max-height: 220px;
    line-height: 20px;
    outline: none;
    /* 🔥 确保文本颜色正常，光标可见 */
    color: #333 !important;
    caret-color: #333 !important;
    /* 🔥 支持多行显示 */
    overflow-y: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#message-input:focus {
    border-color: #07c160;
    /* 🔥 确保焦点时显示光标 */
    caret-color: #333 !important;
    /* 🔥 确保焦点时显示轮廓（可选，用于更好的视觉反馈） */
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
    /* 🔥 确保焦点时文本颜色正常 */
    color: #333 !important;
}


/* 🔥 确保输入框可以交互 */

#message-input:not(:disabled) {
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    cursor: text !important;
    /* 🔥 确保光标颜色可见 */
    caret-color: #333 !important;
    /* 🔥 确保输入框可以显示光标 */
    color: #333 !important;
}

#send-btn {
    width: 60px;
    min-width: 60px;
    margin-left: 10px;
    padding: 0;
    font-size: 14px;
    height: 36px;
    min-height: 36px;
    flex-shrink: 0;
    align-self: flex-end;
}


/* 响应式设计 */

@media (max-width: 768px) {
    .page {
        padding: 0;
    }
    .login-container {
        border-radius: 0;
        box-shadow: none;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .login-card {
        border-radius: 0;
        max-width: 100%;
        height: auto;
        min-height: auto;
    }
}

/* 小屏幕验证码字体适配 */
@media (max-width: 390px) {
    .captcha-question {
        font-size: 12px !important;
        padding: 0 4px !important;
        letter-spacing: -0.5px;
    }
}


/* 🎲 开奖动画效果 */

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes bounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}


/* 倒计时闪烁效果（最后3秒） */

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}


/* 🔥 自定义键盘样式 */

.custom-keyboard {
    background: #e8e8e8;
    border-top: 1px solid #ccc;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.custom-keyboard.hidden {
    display: none;
}

.keyboard-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    justify-items: center;
}

.kb-btn {
    width: 100%;
    height: 36px;
    border: 1px solid #4a90d9;
    border-radius: 4px;
    background: linear-gradient(180deg, #f0f8ff 0%, #d4e8f9 100%);
    color: #1a4a7a;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    padding: 0 2px;
    /* 🔥 触屏优化：禁用双击缩放延迟 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.kb-btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e0f0ff 100%);
    border-color: #3080d0;
}

.kb-btn:active,
.kb-btn.pressed {
    background: linear-gradient(180deg, #c0d8f0 0%, #a0c0e0 100%) !important;
    transform: scale(0.95);
    box-shadow: none;
}

.kb-btn.kb-backspace:hover {
    background: linear-gradient(180deg, #fff8f8 0%, #ffe0e0 100%);
}

.kb-btn.kb-backspace:active {
    background: linear-gradient(180deg, #f0c0c0 0%, #e0a0a0 100%);
}

.kb-btn.kb-enter {
    background: linear-gradient(180deg, #f0fff0 0%, #d0f0d0 100%);
    border-color: #40a040;
    color: #208020;
}

.kb-btn.kb-enter:hover {
    background: linear-gradient(180deg, #f8fff8 0%, #e0ffe0 100%);
}

.kb-btn.kb-enter:active {
    background: linear-gradient(180deg, #c0e0c0 0%, #a0d0a0 100%);
}

.kb-btn.kb-empty {
    visibility: hidden;
}


/* 删除按钮占两列 */

.kb-btn.kb-backspace {
    grid-column: span 2;
    background: linear-gradient(180deg, #fff0f0 0%, #ffd0d0 100%);
    border-color: #d04040;
    color: #a03030;
}


/* 总按钮占两行（加拿大房间） */

.kb-btn.kb-total {
    grid-row: span 2;
}


/* 加拿大房间最后两行合并布局 */

.keyboard-last-rows {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(2, 36px);
    gap: 4px;
    justify-items: center;
}

.keyboard-last-rows .kb-btn {
    width: 100%;
    height: 100%;
}

.keyboard-last-rows .kb-total {
    grid-column: 1;
    grid-row: 1 / 3;
}


/* 键盘切换按钮 */

.keyboard-toggle-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.keyboard-toggle-btn:hover {
    background: rgba(245, 166, 35, 0.1);
}

.keyboard-toggle-btn:active {
    background: rgba(245, 166, 35, 0.2);
    transform: scale(0.95);
}

.keyboard-toggle-btn.active {
    background: rgba(245, 166, 35, 0.15);
}

.keyboard-toggle-btn svg {
    transition: transform 0.2s ease;
}

.keyboard-toggle-btn.active svg {
    transform: scale(1.1);
}


/* 📷 媒体选择按钮和面板样式（客服中心图片发送） */

.media-toggle-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin-left: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.media-toggle-btn:hover {
    background: #e8e8e8;
}

.media-toggle-btn:active {
    background: #ddd;
    transform: scale(0.95);
}

.media-toggle-btn.active {
    background: #07c160;
}

.media-toggle-btn.active svg {
    fill: white;
}

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

.media-panel.hidden {
    display: none;
}

.media-options {
    display: flex;
    justify-content: center;
    gap: 50px;
}

.media-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.media-option:hover {
    background: #f5f5f5;
}

.media-option:active {
    background: #e8e8e8;
}

.media-option-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.media-option-text {
    font-size: 14px;
    color: #333;
}


/* 图片消息样式 */

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: contain;
}

.message-image:hover {
    opacity: 0.9;
}


/* 图片预览弹窗 */

.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
}

.image-preview-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}