/* 遮罩层 */
#modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    /* 增加 flex 布局以便控制按钮 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 统一模态框内的主按钮样式 */
#btn-modal-action, #btn-show-rules-start {
    width: 80%; /* 统一宽度 */
    margin-top: 10px;
    padding: 10px 0;
}

/* 规则和日志浮窗样式 */
#rules-modal, #changelog-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); /* 加深背景遮罩，与主菜单一致 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px); /* 添加毛玻璃效果 */
}

.rules-modal-content {
    background: rgba(30, 30, 35, 0.95); /* 改为暗色背景 */
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    padding: 20px;
    border-radius: 15px; /* 圆角加大 */
    position: relative;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* 加深阴影 */
    text-align: left;
    color: #e0e0e0; /* 文字改为浅色 */
    user-select: text;
    animation: popIn 0.3s ease-out; /* 添加弹出动画 */
}

.close-rules, .close-changelog {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
}

.close-rules:hover, .close-changelog:hover {
    color: #fff;
}

/* 规则内容样式 */
.rules-container h3, .changelog-container h3 {
    text-align: center;
    color: #81c784; /* 浅绿色标题 */
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
    margin-top: 0;
}

.changelog-container h3 {
    color: #e0e0e0;
    border-bottom: 1px solid #444;
}

.rules-container h4 {
    color: #64b5f6; /* 浅蓝色 */
    margin-top: 20px;
    margin-bottom: 10px;
    border-left: 4px solid #64b5f6;
    padding-left: 10px;
    background: #333; /* 深色背景 */
    padding-top: 5px;
    padding-bottom: 5px;
}

.rules-container h5 {
    color: #eee;
    font-size: 15px;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

.rules-container ul, .changelog-container ul {
    padding-left: 20px;
    margin: 5px 0;
}

.rules-container li, .changelog-container li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.rules-container p {
    line-height: 1.6;
    margin: 5px 0;
}

/* 规则表格样式 */
.rules-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
}

.rules-table th, .rules-table td {
    border: 1px solid #555; /* 深色边框 */
    padding: 8px;
    text-align: center;
}

.rules-table th {
    background-color: #444; /* 深色表头 */
    color: #fff;
    font-weight: bold;
}

.rules-table tr:nth-child(even) {
    background-color: #2c2c2c; /* 深色偶数行 */
}

.rules-table tr:hover {
    background-color: #3e3e3e;
}

.rules-note {
    background: #1e3a5f; /* 深蓝色背景 */
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 13px;
    border-left: 4px solid #42a5f5;
    color: #ddd;
}

/* 更新日志内容样式 */
.version-entry {
    margin-bottom: 20px;
    border-bottom: 1px dashed #555;
    padding-bottom: 10px;
}

.version-entry:last-child {
    border-bottom: none;
}

.version-entry h4 {
    margin: 5px 0;
    color: #81c784; /* 浅绿色 */
    font-size: 16px;
}

.version-entry .date {
    font-size: 12px;
    color: #aaa;
    margin: 0 0 5px 0;
}

.version-entry ul {
    font-size: 14px;
    color: #ccc;
}

.version-entry li {
    margin-bottom: 3px;
}

/* 更新日志分类样式 */
.change-category {
    margin-top: 10px;
}

.tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
    font-weight: bold;
    margin-bottom: 5px;
}

.tag.new { background-color: #4caf50; }
.tag.fix { background-color: #f44336; }
.tag.adjust { background-color: #ff9800; }

.change-category ul {
    margin-top: 2px;
    margin-bottom: 10px;
}

/* 版本回顾链接样式 */
.version-link {
    display: inline-block;
    margin-bottom: 10px;
    color: #81c784;
    text-decoration: none;
    font-size: 12px;
    border: 1px solid #81c784;
    padding: 2px 10px;
    border-radius: 12px;
    transition: all 0.2s;
}

.version-link:hover {
    background-color: #81c784;
    color: #000;
}

/* 菜单覆盖层 */
.menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    backdrop-filter: blur(5px);
}

.menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    position: relative;
}

.game-title {
    color: #ffc107;
    font-size: 48px;
    margin-bottom: 40px;
    text-shadow: 0 0 10px #ff6f00;
    letter-spacing: 5px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 80%;
}

.menu-btn {
    position: relative;
    width: 100%;
    aspect-ratio: 2.5 / 1; /* 2.5:1 比例 */
    border: none;
    border-radius: 15px;
    background-color: #fff; /* 底色 */
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.menu-btn:active {
    transform: translateY(1px);
}

.btn-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.8;
    /* 渐变覆盖 */
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(0,0,0,0.1)); 
}

/* 为不同按钮设置底色 */
#btn-menu-pve { background-color: #4caf50; }
#btn-menu-online { background-color: #2196f3; }
#btn-menu-rules { background-color: #ff9800; }
#btn-menu-profile { background-color: #9c27b0; }

.btn-text {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.settings-btn {
    position: absolute;
    top: -60px;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0;
}

.settings-btn:hover {
    background: rgba(255,255,255,0.4);
    transform: rotate(90deg);
    transition: transform 0.5s;
}

/* 二级菜单样式 */
.submenu-content {
    background: rgba(30, 30, 35, 0.95); /* 改为暗色背景，与规则页一致 */
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: popIn 0.3s ease-out;
    color: #e0e0e0; /* 文字改为浅色 */
    backdrop-filter: blur(5px);
}

.submenu-content h2 {
    color: #81c784; /* 浅绿色标题 */
    margin-top: 0;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.construction-text {
    color: #b2b2b2;
    font-style: italic;
    margin: 30px 0;
}

.submenu-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.action-btn {
    background: #4caf50;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 18px;
    border: none;
    width: 100%;
}

.secondary-btn {
    background: #2196f3;
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 16px;
    border: none;
    width: 100%;
}

.back-btn {
    background: #f44336; /* Red for back */
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 16px;
    border: none;
    width: 100%;
    margin-top: 10px;
}

/* 难度选择样式 */
.difficulty-options {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    background: #333333;
    padding: 5px;
    border-radius: 10px;
}

.difficulty-option {
    flex: 1;
    position: relative;
}

.difficulty-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.diff-btn {
    display: block;
    padding: 10px 0;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    color: #c4c4c4;
    font-weight: bold;
}

.difficulty-option input:checked + .diff-btn {
    background: #ffc107;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 动画定义 */
@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes popOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.8); opacity: 0; }
}

/* 退出动画类，JS控制添加 */
.modal-closing {
    animation: popOut 0.2s ease-in forwards !important;
}

/* 确保系统弹窗内容也有进入动画 */
#system-modal .modal-content {
    animation: popIn 0.3s ease-out;
}

/* 登录按钮 */
.login-trigger-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}
.login-trigger-btn:hover {
    background: rgba(255,255,255,0.4);
}

/* 登录表单样式 */
.login-content {
    max-width: 350px;
}

.input-group {
    margin-bottom: 15px;
    width: 100%;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #6a6a6a;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.style-select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 16px;
    margin-top: 5px;
}

.setting-group {
    text-align: left;
    margin-bottom: 20px;
}

.setting-group label {
    font-weight: bold;
    color: #555;
}

/* 个人信息页面样式 */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    background: #666666;
    padding: 15px;
    border-radius: 10px;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fffef5;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    color: rgb(10, 14, 42);
    font-weight: bold;
    flex-shrink: 0;
}

.profile-avatar-large img {
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

.profile-basic-info {
    text-align: left;
    flex: 1;
}

.profile-basic-info p {
    margin: 5px 0;
    color: #c4c4c4;
    font-size: 14px;
}

.profile-section {
    text-align: left;
    margin-bottom: 15px;
    width: 100%;
}

.profile-section label {
    display: block;
    margin-bottom: 5px;
    color: #333333;
    font-size: 14px;
    font-weight: bold;
}

.profile-section h3 {
    font-size: 16px;
    color: #c4c4c4;
    margin-bottom: 10px;
    border-left: 3px solid #2196f3;
    padding-left: 8px;
}

.style-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bcbcbc;
    background: #666666;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    margin-bottom: 5px;
}

.avatar-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    background: #666666;
    padding: 10px;
    border-radius: 8px;
}

.avatar-option {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
    transition: transform 0.2s;
    background: white;
}

.avatar-option img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

.avatar-option:hover { 
    transform: scale(1.1); 
}

.avatar-option.selected { 
    border-color: #4caf50; 
    box-shadow: 0 0 5px #4caf50; 
    transform: scale(1.1); 
}

.separator-line { 
    border: 0; 
    border-top: 1px solid #eee; 
    margin: 20px 0; 
    width: 100%;
}

/* Lobby Seat Styles */
.lobby-seat-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    width: 100px;
    transition: all 0.2s;
}

.lobby-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.seat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    overflow: hidden;
    margin-bottom: 5px;
}

.seat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seat-info {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.seat-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.seat-actions button {
    width: 100%;
    padding: 5px;
    font-size: 12px;
}

.btn-sit { background: #4caf50; color: white; border: none; border-radius: 4px; cursor: pointer; }
.btn-add-bot { background: #607d8b; color: white; border: none; border-radius: 4px; cursor: pointer; }

/* 联机大厅优化样式 */
.online-controls {
    display: flex;
    flex-direction: column;
    align-items: center; /* 居中对齐 */
    width: 100%;
}

.room-input-large {
    width: 100%;
    font-size: 32px;
    text-align: center;
    letter-spacing: 8px;
    padding: 15px;
    border: 2px solid #555; /* 深色边框 */
    border-radius: 12px;
    margin-bottom: 10px;
    background: #2c2c2c; /* 深色背景 */
    font-family: monospace;
    font-weight: bold;
    color: #fff; /* 白色文字 */
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.room-input-large:focus {
    border-color: #2196f3;
    outline: none;
    background: #333;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.2);
}

.menu-hint {
    color: #aaa; /* 浅灰色提示 */
    margin-bottom: 20px;
    font-size: 14px;
}

.divider-horizontal {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 15px 0;
    color: #777;
    font-size: 12px;
    width: 100%; /* 确保分割线占满 */
}

.divider-horizontal::before, .divider-horizontal::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #444;
}

.divider-horizontal span {
    padding: 0 10px;
}

.action-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%; /* 按钮占满宽度 */
}

.input-group-large {
    margin-bottom: 10px;
    width: 100%;
}
