/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --primary-hover: #ff5252;
    --secondary-color: #4ecdc4;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #2c3e50;
    --border-color: #e1e8ed;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: #1d1d1f;
    background-color: #ffffff;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-weight: 400;
}

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

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-block;
}

.nav-brand:hover {
    opacity: 0.8;
    text-decoration: none !important;
    border: none !important;
}

.nav-brand:focus {
    outline: none !important;
    text-decoration: none !important;
}

.nav-brand:visited {
    text-decoration: none !important;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.5px;
    margin: 0;
    pointer-events: none;
    text-decoration: none !important;
    border: none !important;
}

.nav-brand .site-subtitle {
    font-size: 0.75rem;
    color: #86868b;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.5px;
    pointer-events: none;
    text-decoration: none !important;
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    z-index: 10;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #1d1d1f;
    padding: 0.5rem 1rem;
    border-radius: 980px;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.user-profile:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-avatar,
.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    background: #86868b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.user-name {
    font-weight: 400;
    font-size: 0.95rem;
    color: #1d1d1f;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
}

.user-dropdown-item:hover {
    background-color: var(--bg-light);
}

.user-dropdown-item:first-child {
    border-top: none;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item.sound-item {
    justify-content: space-between;
    cursor: pointer;
}

.user-dropdown-item.logout {
    color: var(--error-color);
    border-top: 1px solid var(--border-color);
}

.user-dropdown-item.logout:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

.user-dropdown-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* 音效开关Toggle样式 */
.sound-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.sound-toggle-switch.enabled {
    background-color: var(--primary-color);
}

.sound-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sound-toggle-switch.enabled .sound-toggle-slider {
    transform: translateX(20px);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 1rem;
    font-family: inherit;
    position: relative;
    z-index: 1;
}

/* 确保链接按钮可以点击 */
a.btn {
    pointer-events: auto;
    user-select: none;
}

.btn-primary {
    background: #0071e3;
    color: white;
    box-shadow: none;
    font-weight: 400;
    border-radius: 980px;
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #0077ed;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled,
.btn:disabled {
    background: #d2d2d7;
    color: #86868b;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
    box-shadow: none;
    font-weight: 400;
}

.btn-primary:disabled:hover {
    background: #d2d2d7;
    transform: none;
    box-shadow: none;
}

/* 添加中状态的加载动画 */
.btn-primary.loading {
    animation: pulse-loading 1.5s ease-in-out infinite;
    background: #ff6b6b !important;
    opacity: 0.8 !important;
    cursor: wait !important;
}

.btn-primary.loading:disabled {
    background: #ff6b6b !important;
    opacity: 0.8 !important;
}

@keyframes pulse-loading {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.btn-outline {
    background-color: transparent;
    color: #0071e3;
    border: 1px solid #0071e3;
    border-radius: 980px;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background-color: rgba(0, 113, 227, 0.1);
    color: #0071e3;
}

.btn-dissolve {
    background-color: transparent;
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.btn-dissolve:hover {
    background-color: var(--error-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* 首页样式 */
.home-main {
    flex: 1;
    background-color: var(--bg-color);
}

/* Hero 区域 */
.hero-section {
    position: relative;
    padding: 6rem 0 8rem;
    text-align: center;
    color: #1d1d1f;
    overflow: hidden;
    min-height: 60vh;
    max-height: 75vh;
    display: flex;
    align-items: center;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: grayscale(100%) brightness(0.98) contrast(1.2);
    transform: scale(1.01);
    transition: transform 0.6s ease-out;
    will-change: transform;
    z-index: 0;
    opacity: 1;
    display: block;
}

/* 如果图片不存在，使用渐变背景作为fallback */
.hero-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 50%, #f5f5f7 100%);
    z-index: -1;
    opacity: 0;
}

/* 确保图片元素有内容 */
.hero-image:empty::before {
    opacity: 1;
}

.hero-section:hover .hero-image {
    transform: scale(1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.12) 30%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0.2) 100%
    );
    backdrop-filter: blur(0.2px) saturate(102%);
    -webkit-backdrop-filter: blur(0.2px) saturate(102%);
    z-index: 1;
}

.hero-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: radial-gradient(
        ellipse 120% 80% at center top,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 255, 255, 0.1) 40%,
        transparent 70%
    );
    pointer-events: none;
    animation: lightPulse 8s ease-in-out infinite;
}

.hero-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.4) 30%,
        rgba(255, 255, 255, 0.2) 60%,
        transparent 100%
    );
    pointer-events: none;
}

@keyframes lightPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(12px);
    animation: heroFadeIn 0.3s ease-out forwards;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 5.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #1d1d1f;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.8),
                 0 1px 10px rgba(255, 255, 255, 0.6);
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    color: #1d1d1f;
    margin-bottom: 2.5rem;
    letter-spacing: 0.01em;
    line-height: 1.5;
    text-shadow: 0 1px 10px rgba(255, 255, 255, 0.8);
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 游戏展示区域 */
.games-section {
    padding: 5rem 0;
    background-color: var(--bg-light);
}

.games-section .section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-color);
}

/* 游戏大厅区域 */
.games-lobby-section {
    padding: 5rem 0;
    background-color: #ffffff;
}

.games-lobby-section .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.games-lobby-section .section-title {
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 0;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background-color: var(--bg-color);
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.game-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
}

.game-card h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.game-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 1rem;
}

.game-image {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background-color: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-image-placeholder {
    font-size: 4rem;
    color: #86868b;
    opacity: 0.6;
}

.game-info {
    text-align: left;
}

.game-card-large {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.game-card-large:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.game-card-large .game-image {
    width: 100%;
    height: 0;
    padding-bottom: 50%;
    flex-shrink: 0;
    margin-bottom: 0;
    border-radius: 0;
    overflow: hidden;
    background-color: #f5f5f7;
    position: relative;
}

.game-card-large .game-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card-large .game-image .game-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.game-card-large .game-info {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-card-large .game-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.2;
}

.game-card-large .game-info p {
    font-size: 0.9375rem;
    font-weight: 400;
    color: #86868b;
    margin: 0;
    line-height: 1.4;
}

.game-card-large .game-info .btn {
    align-self: flex-start;
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    padding: 0.5rem 1.25rem;
}

/* 特色功能区域 */
.features-section {
    padding: 6rem 0;
    background-color: #f5f5f7;
}

.features-section .section-title {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 4rem;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1d1d1f;
    font-weight: 600;
    line-height: 1.3;
}

.feature-card p {
    color: #86868b;
    line-height: 1.5;
    font-weight: 400;
    font-size: 1rem;
}

/* CTA 区域 */
.cta-section {
    background: #f5f5f7;
    padding: 6rem 0;
    text-align: center;
    color: #1d1d1f;
}

.cta-content h2 {
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #1d1d1f;
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #86868b;
    font-weight: 400;
    line-height: 1.5;
}


/* 认证页面 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 50%, #f5f5f7 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse 80% 60% at center center,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 40%,
        transparent 70%
    );
    pointer-events: none;
    animation: lightPulse 8s ease-in-out infinite;
}

.auth-container::after {
    content: '';
    position: absolute;
    top: 20%;
    right: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.12) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
    filter: blur(40px);
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06),
                0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 3.5rem 3rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(12px);
    animation: authCardFadeIn 0.3s ease-out forwards;
}

@keyframes authCardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

.auth-header h2 {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

.auth-header p {
    color: #86868b;
    font-size: 0.95rem;
    font-weight: 400;
    margin: 0;
}

.auth-form {
    margin-bottom: 2rem;
}

.error-message {
    background-color: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 12px;
    color: #c0392b;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 400;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 400;
    color: #1d1d1f;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
    background-color: rgba(255, 255, 255, 0.8);
    color: #1d1d1f;
}

.form-group input:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 107, 107, 0.5);
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.08);
}

.form-group input:disabled {
    background-color: #f5f5f5;
    color: #999999;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    color: #86868b;
    font-size: 0.8125rem;
    font-weight: 400;
}

.auth-footer {
    text-align: center;
    color: #86868b;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #1d1d1f;
    text-decoration: none;
    font-weight: 400;
    transition: opacity 0.2s ease;
}

.auth-footer a:hover {
    opacity: 0.7;
    text-decoration: none;
}

.auth-footer p {
    margin-bottom: 0.75rem;
}

.auth-footer p:last-child {
    margin-bottom: 0;
}

/* 认证页面按钮样式 */
.auth-card .btn-primary {
    background: rgba(255, 107, 107, 0.9);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    border-radius: 980px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.15);
}

.auth-card .btn-primary:hover:not(:disabled) {
    background: rgba(255, 107, 107, 1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    transform: none;
}

.auth-card .btn-primary:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(255, 107, 107, 0.15);
}

/* 个人信息页面 */
.profile-main {
    flex: 1;
    padding: 3rem 0;
    background-color: var(--bg-light);
    min-height: calc(100vh - 80px);
}

.profile-card {
    background-color: var(--bg-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    max-width: 600px;
    margin: 0 auto;
}

.profile-card h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.profile-form {
    margin-top: 2rem;
}

/* 头像上传 */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.avatar-preview.placeholder {
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2.5rem;
    text-transform: uppercase;
}

.avatar-upload input[type="file"] {
    display: none;
}

/* 头像裁剪模态框 */
.crop-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.crop-modal-content {
    background-color: var(--bg-color);
    border-radius: 16px;
    padding: 0;
    max-width: 90%;
    width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background-color: var(--bg-light);
}

.crop-modal-header h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

.crop-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.crop-modal-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.crop-modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.crop-container {
    width: 100%;
    max-width: 500px;
    max-height: 500px;
}

.crop-container img {
    max-width: 100%;
    max-height: 500px;
    display: block;
}

.crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 2px solid var(--border-color);
    background-color: var(--bg-light);
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.toast-error {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
}

.toast-info {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
}

/* Cropper.js 样式覆盖 */
.cropper-container {
    direction: ltr;
}

.cropper-view-box {
    outline: 2px solid var(--primary-color);
    outline-color: rgba(255, 107, 107, 0.75);
}

.cropper-face {
    background-color: transparent;
}

.cropper-line {
    background-color: var(--primary-color);
}

.cropper-point {
    background-color: var(--primary-color);
    width: 8px;
    height: 8px;
}

.cropper-point.point-se {
    cursor: se-resize;
}

.cropper-point.point-sw {
    cursor: sw-resize;
}

.cropper-point.point-nw {
    cursor: nw-resize;
}

.cropper-point.point-ne {
    cursor: ne-resize;
}

.cropper-point.point-n,
.cropper-point.point-s {
    cursor: ns-resize;
}

.cropper-point.point-e,
.cropper-point.point-w {
    cursor: ew-resize;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    flex: 1;
}

/* 仪表板 */
.dashboard {
    padding: 3rem 0;
    min-height: calc(100vh - 80px);
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: var(--text-light);
    font-size: 1.125rem;
}

/* 游戏大厅 */
.lobby-main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.lobby-main > .container {
    position: relative;
    z-index: 1;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 107, 107, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.1);
    backdrop-filter: blur(10px);
}

.lobby-header h1 {
    font-size: 2.75rem;
    color: #ff6b6b;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
}

/* 大厅页面按钮样式优化 */
.lobby-header .btn-primary {
    background: rgba(255, 107, 107, 0.9);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    border-radius: 980px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.15);
}

.lobby-header .btn-primary:hover:not(:disabled) {
    background: rgba(255, 107, 107, 1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    transform: none;
}

.lobby-header .btn-primary:active:not(:disabled) {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(255, 107, 107, 0.15);
}

.rooms-section {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

.rooms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.rooms-header h2 {
    font-size: 2rem;
    color: var(--text-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rooms-header h2::before {
    content: '🎮';
    font-size: 1.5rem;
}

.room-count {
    background: #4ecdc4;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.room-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.room-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #4ecdc4;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.room-card:hover::before {
    transform: scaleX(1);
}

.room-card:hover {
    box-shadow: 0 12px 40px rgba(78, 205, 196, 0.2);
    border-color: #4ecdc4;
    transform: translateY(-8px) scale(1.02);
    background: #ffffff;
}

.room-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.room-info h3::before {
    content: '🏠';
    font-size: 1.25rem;
}

.room-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(78, 205, 196, 0.08);
    border-radius: 12px;
}

.room-players {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.room-players::before {
    content: '👥';
    font-size: 1rem;
}

.room-status {
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.room-status:hover {
    transform: scale(1.05);
}

.status-waiting {
    background: #4ecdc4;
    color: white;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.status-playing {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.status-finished {
    background: #95a5a6;
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

/* 游戏中房间卡片样式 */
.room-card.room-playing {
    opacity: 0.85;
    border: 2px solid #ff6b6b;
}

.room-card.room-playing::before {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

.room-playing-tag {
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.room-creator {
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.room-creator::before {
    content: '⏰';
    font-size: 0.9rem;
}

.room-creator:last-of-type::before {
    content: '👑';
}

.room-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    flex-basis: 100%;
}

.room-actions form {
    display: inline-block;
    margin: 0;
}

.room-owner {
    background: #ffe0e0;
    color: #ff6b6b;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.room-full {
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    font-weight: 500;
}

.no-rooms {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.no-rooms p {
    font-size: 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.no-rooms p::before {
    content: '🎲';
    font-size: 2rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pagination-btn:hover {
    border-color: #4ecdc4;
    color: #4ecdc4;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
    background: rgba(255, 255, 255, 1);
}

.pagination-btn.active {
    background: #ff6b6b;
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

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

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px 24px 0 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 107, 107, 0.1);
}

.modal-header h2 {
    font-size: 2rem;
    color: #ff6b6b;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h2::before {
    content: '✨';
    font-size: 1.5rem;
}

.modal-body {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.modal-body p {
    font-size: 1rem;
    line-height: 1.6;
}

.game-rules-content {
    line-height: 1.8;
}

.game-rules-content h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.game-rules-content h3:first-child {
    margin-top: 0;
}

.game-rules-content p {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.game-rules-content ol,
.game-rules-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.game-rules-content li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.game-rules-content ul {
    list-style-type: disc;
}

.game-rules-content strong {
    color: var(--text-color);
    font-weight: 600;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.modal-close {
    background: rgba(78, 205, 196, 0.1);
    border: none;
    font-size: 1.5rem;
    color: #4ecdc4;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 300;
}

.modal-close:hover {
    background: #4ecdc4;
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    padding: 0.875rem 1.25rem;
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.1);
    background: #ffffff;
    transform: translateY(-2px);
}

.form-group small {
    color: var(--text-light);
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.form-actions .btn {
    flex: 1;
}

/* 页脚 */
.footer {
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-light);
    margin-top: auto;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .cta-content h2 {
        font-size: 2.5rem;
    }
    
    .cta-content p {
        font-size: 1.125rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .games-lobby-section .section-title {
        font-size: 2.5rem;
    }

    .features-section .section-title {
        font-size: 2.5rem;
    }

    .nav-menu {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .auth-container {
        padding: 1.5rem 1rem;
    }

    .auth-card {
        padding: 2.5rem 2rem;
        border-radius: 18px;
    }

    .auth-logo {
        font-size: 2rem;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .auth-header p {
        font-size: 0.875rem;
    }

    .user-name {
        display: none;
    }
    
    .user-dropdown {
        right: 0;
        min-width: 160px;
    }

    .auth-card,
    .profile-card {
        padding: 2rem;
    }

    .features-grid,
    .games-grid {
        grid-template-columns: 1fr;
    }

    .avatar-upload {
        flex-direction: column;
        align-items: flex-start;
    }

    .lobby-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .lobby-header h1 {
        font-size: 2rem;
    }

    .rooms-grid {
        grid-template-columns: 1fr;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-card-large {
        flex-direction: column;
    }

    .game-card-large .game-image {
        width: 100%;
        padding-bottom: 50%;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .games-lobby-section .section-title,
    .features-section .section-title,
    .cta-content h2 {
        font-size: 2rem;
    }
}

/* 个人简介推荐样式 */
.bio-input-wrapper {
    position: relative;
}

.bio-recommendation {
    margin-top: 1rem;
    padding: 1rem;
    background: #4ecdc4;
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.recommendation-icon {
    font-size: 1.2rem;
}

.recommendation-content {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    min-height: 60px;
}

.recommendation-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.recommendation-actions .btn {
    flex: 1;
    min-width: 100px;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

#generateRecommendationBtn {
    width: 100%;
    margin-top: 0.5rem;
}

#generateRecommendationBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 游戏房间页面样式 */
.room-main {
    flex: 1;
    padding: 1rem 0;
    background-color: var(--bg-light);
    min-height: calc(100vh - 60px);
}

.room-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 100px);
}

/* 左侧主内容区 */
.room-content {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    height: 100%;
}

/* 房间信息区域 */
.room-info-section {
    background-color: var(--bg-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    padding-right: 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.room-info-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.room-info-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
}

.room-info-divider {
    color: var(--border-color);
    font-size: 0.9rem;
    opacity: 0.5;
}

.room-detail-compact {
    color: var(--text-light);
    font-size: 0.875rem;
    white-space: nowrap;
}

.room-info-compact .room-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    border: none;
    flex-shrink: 0;
}

.room-info-compact .room-actions form {
    margin: 0;
}

.room-info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.room-title-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.room-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    white-space: nowrap;
}

.room-meta-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
}

.room-title-section .room-status-badge {
    flex-shrink: 0;
}

.room-game-type {
    color: var(--text-light);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.game-rules-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.game-rules-icon:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.game-rules-icon:active {
    transform: scale(0.95);
}

.room-status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.room-info-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.room-detail-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.detail-label {
    color: var(--text-light);
    font-size: 0.85rem;
}

.detail-value {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.85rem;
}

/* 玩家列表区域 */
.room-players-section {
    background-color: var(--bg-color);
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.375rem;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem;
    border-radius: 6px;
    background-color: var(--bg-light);
    transition: all 0.2s;
    border: 2px solid transparent;
    position: relative;
}

.player-card:hover:not(.empty) {
    background-color: var(--bg-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.player-card.empty {
    opacity: 0.5;
    border-style: dashed;
}

.player-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.player-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.player-avatar.placeholder {
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    width: 24px;
    height: 24px;
}

.player-status-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-color);
    font-size: 0;
    display: block;
    z-index: 1;
}

.player-status-icon.online {
    background-color: #4caf50;
    box-shadow: 0 0 0 2px var(--bg-color);
}

.player-status-icon.offline {
    background-color: #9e9e9e;
    box-shadow: 0 0 0 2px var(--bg-color);
}

.player-avatar.placeholder.empty {
    background: var(--bg-light);
    color: var(--text-light);
    border: 2px dashed var(--border-color);
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.1rem;
    word-break: break-word;
    font-size: 0.75rem;
    line-height: 1.2;
}

.player-name.empty {
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.75rem;
}

.player-badge {
    display: inline-block;
    padding: 0.05rem 0.3rem;
    border-radius: 8px;
    font-size: 0.55rem;
    font-weight: 500;
    margin-bottom: 0.05rem;
}

.player-badge.creator {
    background-color: #fff3e0;
    color: #f57c00;
}

/* 玩家身份标志（左上角） */
.player-role-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    padding: 0.05rem 0.3rem;
    border-radius: 8px;
    font-size: 0.55rem;
    font-weight: 500;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.player-role-badge.role-creator {
    background-color: #fff3e0;
    color: #f57c00;
}

.player-role-badge.role-ai {
    background-color: #fce4ec;
    color: #c2185b;
}

.player-role-badge.role-player {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* AI玩家删除按钮 */
.player-remove-btn {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #9e9e9e;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.2s;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.player-remove-btn:hover {
    background-color: #757575;
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.player-remove-btn:active {
    transform: scale(0.95);
}

.player-joined-time {
    font-size: 0.55rem;
    color: var(--text-light);
}

/* 游戏区域 */
.room-game-area {
    flex: 1;
    background-color: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 欢乐搜打撤游戏时，移除游戏区域的 padding 和 border */
.room-game-area:has(#happySearchGame[style*="block"]),
.room-game-area:has(#happySearchGame[style*="flex"]) {
    padding: 0.5rem;
    overflow: hidden;
}

.room-game-area #happySearchGame {
    height: 100%;
    width: 100%;
}

/* 当游戏内容显示时，移除游戏区域的 padding */
.room-game-area:has(#gameContent[style*="block"]) {
    padding: 0;
    overflow-y: auto;
}

/* 更兼容的方式：通过 JavaScript 添加 class */
.room-game-area.game-fullscreen {
    padding: 0;
    overflow-y: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

/* 游戏阶段徽章 */
.game-phase-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4ecdc4;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* 右上角按钮组 */
.top-right-button-group {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* 我的身份徽章（在按钮组中） */
.my-role-badge {
    cursor: pointer;
    position: relative;
}

.my-role-name {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.my-role-name.faction-good {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.my-role-name.faction-evil {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.my-role-name:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 身份信息悬停卡片 */
.my-role-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.my-role-badge:hover .my-role-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tooltip-role-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 12px;
}

.tooltip-role-name.faction-good {
    color: #27ae60;
}

.tooltip-role-name.faction-evil {
    color: #e74c3c;
}

.tooltip-role-faction {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding: 6px 12px;
    border-radius: 16px;
    display: inline-block;
}

.tooltip-role-faction.faction-good {
    background: #d5f4e6;
    color: #27ae60;
}

.tooltip-role-faction.faction-evil {
    background: #fadbd8;
    color: #e74c3c;
}

.tooltip-role-description {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    margin-top: 10px;
}

/* 通用游戏阶段容器样式 - 居中显示 */
.role-assignment-container,
.night-info-container,
.assassination-container,
.game-ended-container {
    text-align: center;
    padding: 1rem;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* 身份认领阶段特定样式 */
.role-assignment-container {
    max-width: 500px;
}

/* 通用阶段容器 h2 样式 */
.role-assignment-container h2,
.assassination-container h2,
.game-ended-container h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

/* 夜晚阶段标题特殊样式 */
.night-info-container h2 {
    font-size: 24px;
    margin-bottom: 24px;
    color: #5a4a7a;
    text-shadow: 0 1px 2px rgba(147, 112, 219, 0.1);
}

/* 夜晚阶段消息样式 - 柔和的紫色调 */
.night-info-message {
    background: linear-gradient(135deg, #faf8ff 0%, #f5f0ff 100%);
    border: 1px solid rgba(147, 112, 219, 0.3);
    border-radius: 12px;
    padding: 24px 32px;
    margin: 20px auto;
    box-shadow: 0 4px 20px rgba(147, 112, 219, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    line-height: 1.6;
    color: #4a4a6a;
    position: relative;
    overflow: hidden;
}

.night-info-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(147, 112, 219, 0.4),
        rgba(186, 156, 245, 0.6),
        rgba(147, 112, 219, 0.4));
}

.night-info-text {
    position: relative;
    z-index: 1;
}

/* 夜晚阶段玩家卡片高亮动画 - 柔和的紫色调呼吸灯 */
.player-card.night-visible {
    position: relative;
    animation: nightCardBreath 2s ease-in-out infinite;
    z-index: 1;
    border-color: rgba(147, 112, 219, 0.5) !important;
}

.player-card.night-visible::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(147, 112, 219, 0.08);
    pointer-events: none;
    animation: nightInnerBreath 2s ease-in-out infinite;
}

/* 呼吸灯效果 - 阴影和背景同步呼吸 */
@keyframes nightCardBreath {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(147, 112, 219, 0.2),
                    0 0 0 1px rgba(147, 112, 219, 0.25);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(147, 112, 219, 0.45),
                    0 0 0 2px rgba(147, 112, 219, 0.4);
        transform: scale(1.02);
    }
}

@keyframes nightInnerBreath {
    0%, 100% {
        background: rgba(147, 112, 219, 0.05);
        box-shadow: inset 0 0 8px rgba(147, 112, 219, 0.08);
    }
    50% {
        background: rgba(147, 112, 219, 0.12);
        box-shadow: inset 0 0 16px rgba(147, 112, 219, 0.15);
    }
}

/* 高亮取消时的淡出过渡 */
.player-card.night-visible-fade-out {
    animation: nightFadeOut 0.5s ease-out forwards;
    border-color: var(--border-color) !important;
}

.player-card.night-visible-fade-out::after {
    animation: nightInnerFadeOut 0.5s ease-out forwards;
}

@keyframes nightFadeOut {
    from {
        box-shadow: 0 4px 20px rgba(147, 112, 219, 0.45),
                    0 0 0 2px rgba(147, 112, 219, 0.4);
        transform: scale(1.02);
    }
    to {
        box-shadow: var(--shadow-sm);
        transform: scale(1);
    }
}

@keyframes nightInnerFadeOut {
    from {
        background: rgba(147, 112, 219, 0.12);
        box-shadow: inset 0 0 16px rgba(147, 112, 219, 0.15);
    }
    to {
        background: transparent;
        box-shadow: none;
    }
}

/* 刺杀阶段样式 */
.assassination-section {
    margin-top: 20px;
}

/* 游戏结束阶段样式 */
.game-ended-result {
    background: white;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 0.5rem auto;
    box-shadow: var(--shadow);
}

.game-ended-result h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
}

.game-ended-result p {
    font-size: 0.875rem;
    margin: 0.25rem 0;
    line-height: 1.4;
}

.all-players-roles {
    margin-top: 0.75rem;
}

.players-roles-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.role-info-card {
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin: 20px auto;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.role-name {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
}

.role-name.faction-good {
    color: #27ae60;
}

.role-name.faction-evil {
    color: #e74c3c;
}

.role-faction {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
}

.role-faction.faction-good {
    background: #d5f4e6;
    color: #27ae60;
}

.role-faction.faction-evil {
    background: #fadbd8;
    color: #e74c3c;
}

.role-description {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.8;
    margin-top: 20px;
}

.phase-hint {
    margin-top: 20px;
    color: var(--text-light);
    font-size: 14px;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

/* 撤离按钮就绪状态 - 闪烁动画 */
.btn-evacuate-ready {
    animation: evacuateReady 1s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

@keyframes evacuateReady {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(46, 204, 113, 0.8);
    }
}

#roleConfirmSection {
    text-align: center;
}

#confirmRoleBtn {
    min-width: 200px;
    padding: 12px 24px;
    font-size: 16px;
}

.game-phase-info {
    text-align: center;
    padding: 40px 20px;
}

.phase-info-text {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.8;
}

.game-phase-content {
    padding: 20px;
    margin: 0;
    width: 100%;
    min-height: 0;
    overflow: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 针对欢乐搜打撤游戏的特殊样式 */
#happySearchGame.game-phase-content {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

.game-area-content {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}

/* 游戏内容区域需要占满宽度 */
#gameContent {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    overflow-y: auto;
}

.game-placeholder {
    text-align: center;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-placeholder .game-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.game-placeholder h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.game-placeholder p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.waiting-hint {
    color: var(--text-light);
    font-style: italic;
}

.game-status {
    color: var(--primary-color);
    font-weight: 500;
}

/* 右侧聊天区 */
.room-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    min-width: 300px;
    max-width: 400px;
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-light);
    border-radius: 12px 12px 0 0;
}

.chat-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.chat-online-count {
    font-size: 0.875rem;
    color: var(--text-light);
    background-color: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.online-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #27ae60; /* 绿色 */
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.2); /* 柔和的绿色光晕 */
    animation: pulse-online 2s ease-in-out infinite;
}

@keyframes pulse-online {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.online-count-text {
    white-space: nowrap;
}

.load-more-messages {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.load-more-messages button {
    width: 100%;
    padding: 8px 16px;
    font-size: 14px;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    background-color: #F5F7FA; /* 浅灰/微蓝底，降低对比度 */
}

.chat-message {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem;
    border-radius: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease-in;
}

/* 聊天头像样式 */
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chat-avatar.placeholder {
    background: linear-gradient(135deg, var(--secondary-color), #3dbdb5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.chat-message.own .chat-avatar.placeholder {
    background: linear-gradient(135deg, #fff, #f8f8f8);
    color: var(--primary-color);
}

/* 消息内容区域 */
.message-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

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

.chat-message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
    background: linear-gradient(135deg, var(--primary-color), #ee5a5a);
    color: white;
}

.chat-message.other {
    align-self: flex-start;
    background-color: #F7F9FC; /* 优化后的气泡背景色 */
    color: var(--text-color);
    border: 1px solid rgba(225, 232, 237, 0.3); /* 极浅边框，降低对比度 */
}

.chat-message.system {
    align-self: center;
    background-color: transparent;
    color: #999999;
    font-size: 0.875rem;
    max-width: 100%;
    text-align: center;
    padding: 0.5rem 0.75rem;
}

/* 系统消息不显示头像 */
.chat-message.system .chat-avatar {
    display: none;
}

.message-content.system-content {
    color: #999999;
    text-align: center;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.chat-message.own .message-sender {
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
}

.chat-message.other .message-sender {
    color: var(--primary-color);
}

.chat-message.own .message-time {
    text-align: right;
}

.message-content {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    white-space: pre-wrap; /* 允许换行，保留空格 */
}

.message-time {
    font-size: 0.7rem;
    margin-top: 0.4rem;
    opacity: 0.85;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* 优化其他用户消息的时间戳对比度 */
.chat-message.other .message-time {
    color: #6B7280; /* 更深的灰色，提高对比度 */
    opacity: 0.9;
}

/* 优化自己消息的时间戳（红色背景上的白色文字） */
.chat-message.own .message-time {
    color: rgba(255, 255, 255, 0.85); /* 白色文字，稍微提高不透明度 */
    opacity: 0.9;
}

/* 跳到最新消息按钮 */
.scroll-to-bottom-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    border-radius: 0;
    margin: 0;
}

.scroll-to-bottom-btn:hover {
    background: linear-gradient(135deg, #ee5a5a, #ff6b6b);
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.2);
}

.scroll-to-bottom-btn .new-message-indicator {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    animation: pulse-gentle 2s infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes pulse-gentle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.chat-input-area {
    padding: 1rem;
    border-top: 2px solid var(--border-color);
    background-color: var(--bg-light);
    border-radius: 0 0 12px 12px;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.chat-char-count {
    text-align: right;
    font-size: 0.75rem;
    color: #999999;
    margin-top: 0.25rem;
    padding-right: 0.25rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-send-btn {
    white-space: nowrap;
    padding: 0.75rem 1.5rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .room-container {
        flex-direction: column;
        height: auto;
    }
    
    .room-chat {
        max-width: 100%;
        height: 400px;
    }
    
    .players-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 768px) {
    .room-container {
        padding: 0 10px;
    }
    
    .room-info-compact {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .room-info-left {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
    
    .room-info-divider {
        display: none;
    }
    
    .room-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .room-title-section {
        flex-wrap: wrap;
    }
    
    .room-meta-info {
        align-items: flex-start;
    }
    
    .room-info-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .players-list {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    
    .chat-message {
        max-width: 90%;
        gap: 0.4rem;
        padding: 0.6rem;
    }
    
    .chat-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .message-sender {
        font-size: 0.7rem;
    }
}

/* 游戏进行中阶段样式 */
.mission-score-board {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.score-label {
    color: var(--text-light);
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.score-good .score-value {
    color: var(--success-color);
}

/* 轮次信息显示板（只显示当前队长，居中） */
/* 队长徽章样式 */
.leader-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    margin: 10px 0;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 2px solid #ffb300;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.3);
    font-weight: bold;
    color: #8b6914;
    animation: pulse 2s ease-in-out infinite;
}

.leader-badge-icon {
    font-size: 1.5em;
    animation: rotate 3s linear infinite;
}

.leader-badge-text {
    font-size: 1.1em;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 179, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(255, 179, 0, 0.5);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    50% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(10deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.round-info-board {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.625rem 1.5rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    margin: 50px auto 1rem auto; /* 顶部留出空间避免与左上角徽章重叠 */
    justify-content: center;
    align-items: center;
    max-width: 800px;
    box-sizing: border-box;
}

.round-info-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.95rem;
}

.round-info-label {
    color: var(--text-light);
    font-weight: 500;
}

.round-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* 提名上车玩家样式 */
.round-info-value.nominated-team {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.05));
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    font-size: 0.9rem;
}

/* 提名上车玩家列表样式（优化版） */
.round-info-item-nominated {
    flex-wrap: wrap;
    align-items: flex-start;
}

.nominated-team-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
}

.nominated-player-tag {
    display: inline-block;
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.08));
    padding: 0.35rem 0.85rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 107, 107, 0.35);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.nominated-player-tag:hover {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.25), rgba(255, 107, 107, 0.15));
    border-color: rgba(255, 107, 107, 0.5);
    transform: translateY(-1px);
}

/* 分数按钮样式 */
.btn-score {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: default;
    min-width: 80px;
    transition: all 0.3s ease;
}

.btn-score:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-score-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.btn-score-value {
    font-size: 18px;
    font-weight: 700;
}

.btn-score.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-score.btn-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-score.btn-primary {
    background: #ff6b6b;
    color: white;
}

/* 游戏进度条样式 */
.game-progress-bar {
    display: inline-block;
    padding: 10px 24px;
    background: #4ecdc4;
    color: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.game-progress-bar {
    position: relative;
    cursor: pointer;
}

.game-progress-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-progress-bar span {
    display: inline-block;
}

/* 车队记录悬浮窗口样式 */
.rounds-history-tooltip {
    display: none;
    position: fixed;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    min-width: 400px;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #e1e8ed;
}

.rounds-history-tooltip .tooltip-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e8ed;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    border-radius: 12px 12px 0 0;
}

.rounds-history-tooltip .tooltip-header h3 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.rounds-history-tooltip .tooltip-content {
    padding: 16px 20px;
    max-height: calc(70vh - 60px);
    overflow-y: auto;
}

.rounds-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.round-history-item {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
    background: #f8f9fa;
    transition: all 0.2s;
}

.round-history-item.success {
    border-left: 4px solid #27ae60;
    background: #f0f9f4;
}

.round-history-item.failure {
    border-left: 4px solid #e74c3c;
    background: #fef0f0;
}

.round-history-item.pending {
    border-left: 4px solid #f39c12;
    background: #fffbf0;
}

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

.round-number {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

.round-result {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.success-badge {
    background: #27ae60;
    color: white;
}

.failure-badge {
    background: #e74c3c;
    color: white;
}

.pending-badge {
    background: #f39c12;
    color: white;
}

.round-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
}

.detail-label {
    color: #7f8c8d;
    min-width: 80px;
    flex-shrink: 0;
}

.detail-value {
    color: #2c3e50;
    flex: 1;
    word-break: break-word;
}

.success-text {
    color: #27ae60;
    font-weight: 500;
}

.failure-text {
    color: #e74c3c;
    font-weight: 500;
}

.vote-status {
    margin-left: 8px;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
}

/* 滚动条样式 */
.rounds-history-tooltip .tooltip-content::-webkit-scrollbar {
    width: 6px;
}

.rounds-history-tooltip .tooltip-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.rounds-history-tooltip .tooltip-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.rounds-history-tooltip .tooltip-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.score-evil .score-value {
    color: var(--error-color);
}

.round-phase-content {
    padding: 1rem;
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    align-self: center; /* 在父级flex容器中居中 */
}

.round-phase-content h3 {
    text-align: center;
    width: 100%;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.round-phase-content p,
.round-phase-content .phase-hint {
    text-align: center;
    width: 100%;
    margin: 0.25rem 0;
}

.current-leader-info {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.nomination-section {
    margin-top: 1rem;
}

.player-selection-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.player-selection-item {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
}

.player-selection-item:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-light);
}

.player-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.player-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.nomination-waiting,
.voting-waiting,
.mission-waiting {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.nomination-display {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    margin: 0.75rem 0;
}

.nomination-display p {
    margin: 0;
    font-size: 0.95rem;
}

.voting-buttons,
.mission-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.discussion-leader-section {
    text-align: center;
    margin: 1rem auto;
    width: 100%;
}

.discussion-leader-section .btn {
    display: inline-block;
    margin: 0 auto;
}

.settlement-result {
    text-align: center;
    margin: 2rem 0;
}

.settlement-result-item {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.result-success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.result-failure {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

/* 游戏结束 - 所有玩家身份展示样式 */
.all-players-roles {
    margin-top: 0.75rem;
}

.all-players-roles h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.players-roles-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faction-section {
    margin-bottom: 0.25rem;
}

.faction-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.625rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.faction-section-title.faction-good {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.faction-section-title.faction-evil {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.faction-icon {
    font-size: 0.9rem;
}

.faction-count {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.9;
    font-weight: 500;
}

.faction-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.player-role-card {
    background: white;
    border-radius: 6px;
    padding: 0.375rem 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.player-role-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.player-role-card.faction-good {
    border-color: rgba(39, 174, 96, 0.25);
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.player-role-card.faction-good:hover {
    border-color: #27ae60;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.player-role-card.faction-evil {
    border-color: rgba(231, 76, 60, 0.25);
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.player-role-card.faction-evil:hover {
    border-color: #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.player-role-card-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.player-role-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.player-role-avatar.faction-good {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.player-role-avatar.faction-evil {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.player-role-card-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.player-role-card-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.player-role-card-role {
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0;
    white-space: nowrap;
}

.player-role-card-role.faction-good {
    color: #27ae60;
}

.player-role-card-role.faction-evil {
    color: #e74c3c;
}

.player-role-card-footer {
    display: flex;
    justify-content: center;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.1rem;
}

.faction-badge-good,
.faction-badge-evil {
    padding: 0.15rem 0.375rem;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-block;
}

.faction-badge-good {
    background: linear-gradient(135deg, #d5f4e6 0%, #a8e6cf 100%);
    color: #27ae60;
    border: 1.5px solid #27ae60;
}

.faction-badge-evil {
    background: linear-gradient(135deg, #fadbd8 0%, #f5b7b1 100%);
    color: #e74c3c;
    border: 1.5px solid #e74c3c;
}

/* 响应式设计 - 确保10人局不滚动 */
@media (min-width: 1200px) {
    .faction-cards-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 800px) and (max-width: 1199px) {
    .faction-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 600px) and (max-width: 799px) {
    .faction-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 599px) {
    .faction-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.3rem;
    }
    
    .player-role-card {
        padding: 0.3rem 0.4rem;
    }
    
    .player-role-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .player-role-card-name {
        font-size: 0.65rem;
    }
    
    .player-role-card-role {
        font-size: 0.7rem;
    }
    
    .faction-section-title {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .faction-badge-good,
    .faction-badge-evil {
        padding: 0.15rem 0.35rem;
        font-size: 0.55rem;
    }
}

/* 欢乐搜打撤游戏样式 */
.happy-search-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.happy-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.happy-search-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.game-timer {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.happy-search-main {
    display: flex;
    flex-direction: row;
    flex: 1;
    gap: 0.5rem;
    padding: 0.5rem;
    overflow: hidden;
    min-height: 0;
    align-items: stretch;
}

/* 左侧固定区域：玩家信息、背包、操作 */
.game-sidebar {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-light);
    padding: 0.5rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.player-info-panel,
.inventory-panel,
.game-controls {
    background-color: var(--bg-color);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-shrink: 0;
}

.player-info-panel h3,
.inventory-panel h3,
.game-controls h3 {
    margin: 0 0 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 0.3rem;
}

.player-info-panel p,
.inventory-panel p {
    margin: 0.3rem 0;
    color: var(--text-color);
    font-size: 0.75rem;
    line-height: 1.3;
}

.game-controls button {
    width: 100%;
    margin: 0.3rem 0;
    padding: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧游戏地图区域 */
.game-map-container {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background-color: var(--bg-light);
    border-radius: 0;
    border: none;
    overflow: hidden;
    min-width: 400px;
    padding: 0;
    margin: 0;
    position: relative;
}

.game-map-container canvas {
    display: block;
    border: none;
    border-radius: 0;
    background-color: #e8e8e8;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

/* 角色配置展示区域 */
.role-config-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 500px;
    margin: 0 auto 20px;
}

.role-config-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    text-align: center;
}

.role-config-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.role-config-item {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.role-config-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.role-config-item.good {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border: 1px solid #90caf9;
}

.role-config-item.evil {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.role-config-item .role-count {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 0 6px;
    margin-left: 6px;
    font-size: 0.75rem;
}

/* 角色tooltip中的本局角色配置 */
.tooltip-role-config {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.tooltip-role-config-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.tooltip-role-config-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tooltip-role-config-item {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tooltip-role-config-item.good {
    background: rgba(21, 101, 192, 0.1);
    color: #1565c0;
}

.tooltip-role-config-item.evil {
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
}

.tooltip-role-config-item .config-role-count {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0 4px;
    margin-left: 4px;
    font-size: 0.7rem;
}

/* ==================== 通知系统样式 ==================== */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid #4ecdc4;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left-color: #27ae60;
}

.notification-error {
    border-left-color: #e74c3c;
}

.notification-warning {
    border-left-color: #f39c12;
}

.notification-info {
    border-left-color: #3498db;
}

.notification-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.notification-success .notification-icon {
    color: #27ae60;
}

.notification-error .notification-icon {
    color: #e74c3c;
}

.notification-warning .notification-icon {
    color: #f39c12;
}

.notification-info .notification-icon {
    color: #3498db;
}

.notification-message {
    flex: 1;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.5;
}

.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.notification-close:hover {
    color: #2c3e50;
}

/* ==================== 加载状态样式 ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.loading-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.loading-overlay-content {
    text-align: center;
}

.loading-spinner-large {
    width: 50px;
    height: 50px;
    border: 4px solid #e1e8ed;
    border-top-color: #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-message {
    color: #2c3e50;
    font-size: 16px;
    margin: 0;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.area-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 100;
    border-radius: 8px;
}

.loading-area {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== 自定义弹窗样式 ==================== */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    pointer-events: none;
}

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.custom-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 1;
}

.custom-modal.show .custom-modal-content {
    transform: scale(1);
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e8ed;
}

.custom-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.custom-modal-close:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.custom-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.custom-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    font-weight: bold;
}

.custom-modal-icon-warning {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.custom-modal-icon-danger {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.custom-modal-icon-info {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.custom-modal-icon-success {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.custom-modal-message {
    color: #2c3e50;
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
}

.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e1e8ed;
    background: #f8f9fa;
}

.custom-modal-footer .btn {
    min-width: 80px;
}

.custom-modal-confirm-warning {
    background: #f39c12;
}

.custom-modal-confirm-warning:hover {
    background: #e67e22;
}

.custom-modal-confirm-danger {
    background: #e74c3c;
}

.custom-modal-confirm-danger:hover {
    background: #c0392b;
}

.custom-modal-confirm-info {
    background: #3498db;
}

.custom-modal-confirm-info:hover {
    background: #2980b9;
}

.custom-modal-confirm-success {
    background: #27ae60;
}

.custom-modal-confirm-success:hover {
    background: #229954;
}

/* 单按钮弹窗（alert样式） */
.custom-modal-footer:has(.custom-modal-cancel[style*="display: none"]) {
    justify-content: center;
}

/* ==================== 阶段转换动画 ==================== */
.phase-transition {
    animation: phaseTransition 0.5s ease;
}

@keyframes phaseTransition {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== 按钮禁用状态tooltip增强 ==================== */
button[disabled][data-tooltip],
button[disabled][title] {
    position: relative;
}

button[disabled][data-tooltip]:hover::after,
button[disabled][title]:hover::after {
    content: attr(data-tooltip) attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #2c3e50;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

button[disabled][data-tooltip]:hover::before,
button[disabled][title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    z-index: 1000;
    margin-bottom: -5px;
    pointer-events: none;
}

/* 音效控制已移至用户下拉菜单 */

/* ==================== 响应式设计增强 ==================== */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .games-lobby-section .section-title,
    .features-section .section-title,
    .cta-content h2 {
        font-size: 1.75rem;
    }
    
    .room-container {
        padding: 0 5px;
        gap: 0.5rem;
    }
    
    .room-info-section,
    .room-players-section {
        padding: 0.5rem;
    }
    
    .players-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.25rem;
    }

    .auth-container {
        padding: 1rem 0.75rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .auth-logo {
        font-size: 1.75rem;
    }

    .auth-header h2 {
        font-size: 1.375rem;
    }
    
    .player-card {
        padding: 0.25rem;
    }
    
    .chat-message {
        max-width: 95%;
        padding: 0.5rem;
    }
    
    
    .nav-menu {
        gap: 0.25rem;
    }
}

/* ==================== 动画效果增强 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.3s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* 按钮点击动画 */
.btn:not(:disabled):active {
    transform: scale(0.98);
}

/* 卡片悬停动画增强 */
.game-card,
.room-card,
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover,
.room-card:hover,
.feature-card:hover {
    transform: translateY(-4px) scale(1.02);
}

/* 输入框焦点动画 */
.form-group input:focus,
.form-group textarea:focus,
.chat-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 列表项动画 - 只应用于新添加的元素 */
.player-card.new-player,
.chat-message {
    animation: fadeInUp 0.3s ease-out;
}

/* 移除动画类，避免重复动画 */
.player-card.new-player {
    animation-fill-mode: forwards;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 减少动画（尊重用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}