/* ================== 登录/注册弹窗 ================== */
/* 2026-10-25 配色统一到游戏房间：面板 #252b38 / 底 #1a1f2b / 描边 #3d465a / 金 #d9a441 */
.auth-modal-mask {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.auth-modal-mask.open {
    display: flex;
}

.auth-modal {
    width: 360px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    background: #252b38;
    border: 1px solid #3d465a;
    border-radius: 14px;
    padding: 32px 30px 28px;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.65);
    position: relative;
    animation: authModalIn 0.22s ease;
}
@keyframes authModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #9aa4b8;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e6eaf2;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-modal-header img {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(217, 164, 65, 0.45);
    box-shadow: 0 0 10px rgba(217, 164, 65, 0.2);
}
.auth-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #f2f4f8;
    margin-top: 10px;
}
.auth-modal-header p {
    font-size: 13px;
    color: #9aa4b8;
    margin-top: 4px;
}

.auth-modal-tabs {
    display: flex;
    margin-bottom: 22px;
    background: #1a1f2b;
    border: 1px solid #3d465a;
    border-radius: 8px;
    padding: 3px;
}
.auth-modal-tab {
    flex: 1;
    text-align: center;
    padding: 9px;
    font-size: 14px;
    font-weight: 500;
    color: #9aa4b8;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.25s;
    user-select: none;
}
.auth-modal-tab:hover { color: #cfd6e4; }
.auth-modal-tab.active {
    background: #3d465a;
    color: #e8c069;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.auth-modal-form { display: none; }
.auth-modal-form.active { display: block; }

.auth-modal-field {
    margin-bottom: 16px;
}
.auth-modal-field label {
    display: block;
    font-size: 13px;
    color: #b6bfd0;
    margin-bottom: 6px;
    font-weight: 500;
}
.auth-modal-field input {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    border: 1px solid #3d465a;
    border-radius: 8px;
    background: #1a1f2b;
    color: #e6eaf2;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}
.auth-modal-field input:focus {
    border-color: rgba(217, 164, 65, 0.7);
    background: #1a1f2b;
    box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.16);
}
.auth-modal-field input::placeholder { color: #6b7488; }

.auth-modal-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1f2b;
    background: linear-gradient(135deg, #d9a441, #e8c069);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(217, 164, 65, 0.26);
}
.auth-modal-submit:hover { background: linear-gradient(135deg, #e8c069, #f0d089); }
.auth-modal-submit:active { transform: scale(0.98); }
.auth-modal-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-modal-hint {
    text-align: center;
    font-size: 13px;
    color: #9aa4b8;
    margin-top: 16px;
}
.auth-modal-hint a {
    color: #d9a441;
    cursor: pointer;
    font-weight: 500;
}
.auth-modal-hint a:hover { text-decoration: underline; }

.auth-modal-alert {
    display: none;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: center;
}
.auth-modal-alert.error {
    display: block;
    background: rgba(244, 67, 54, 0.14);
    border: 1px solid rgba(244, 67, 54, 0.45);
    color: #ff8a7e;
}
.auth-modal-alert.success {
    display: block;
    background: rgba(76, 175, 80, 0.14);
    border: 1px solid rgba(76, 175, 80, 0.45);
    color: #6fdb84;
}

/* ================== 导航栏已登录状态 ================== */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}
.nav-user:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(217, 164, 65, 0.45);
}
.nav-user-avatar {
    font-size: 18px;
}
.nav-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #e6eaf2;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 已登录下拉菜单 */
.nav-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 150px;
    background: rgba(20, 24, 35, 0.97);
    border: 1px solid rgba(217, 164, 65, 0.24);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    display: none;
    z-index: 10001;
}
.nav-user:hover .nav-user-menu { display: block; }
.nav-user-menu-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #e6eaf2;
    cursor: pointer;
    transition: background 0.2s;
}
.nav-user-menu-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-user-menu-item.danger { color: #ff8a7e; }

/* 移动端：用户菜单改为点击触发 */
@media (max-width: 768px) {
    .nav-user-menu { position: static; margin-top: 0; min-width: auto; }
    .nav-user:hover .nav-user-menu { display: none; }
    .nav-user-menu.show { display: block; }
}

/* ================== 我的信息弹窗 ================== */
.nav-profile-mask {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.nav-profile-mask.open { display: flex; }

.nav-profile-modal {
    width: 340px;
    max-width: 90vw;
    background: #252b38;
    border: 1px solid #3d465a;
    border-radius: 14px;
    padding: 30px 28px 24px;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.65);
    position: relative;
    animation: authModalIn 0.22s ease;
}
.nav-profile-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #9aa4b8;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-profile-close:hover { background: rgba(255, 255, 255, 0.08); color: #e6eaf2; }

.nav-profile-title {
    font-size: 18px;
    font-weight: 600;
    color: #f2f4f8;
    text-align: center;
    margin-bottom: 22px;
}
.nav-profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #1a1f2b;
    border: 1px solid #3d465a;
    border-radius: 10px;
    margin-bottom: 18px;
}
.nav-profile-avatar {
    font-size: 36px;
}
.nav-profile-nickname {
    font-size: 17px;
    font-weight: 600;
    color: #f2f4f8;
}
.nav-profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.nav-profile-stat {
    background: #1a1f2b;
    border: 1px solid #3d465a;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.nav-profile-stat-label {
    font-size: 12px;
    color: #9aa4b8;
    margin-bottom: 6px;
}
.nav-profile-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #d9a441;
}
.nav-profile-btn {
    width: 100%;
    padding: 11px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1f2b;
    background: linear-gradient(135deg, #d9a441, #e8c069);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}
.nav-profile-btn:hover { background: linear-gradient(135deg, #e8c069, #f0d089); }
