:root {
            --red-team-color: #e74c3c;
            --blue-team-color: #3498db;
            --ban-color: #7f8c8d;
            --hover-color: #f1c40f;
        }
        
        * {
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
            color: #2c3e50;
            overflow-x: hidden;
        }
        
        .container {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
        
        /* 头部样式 */
        .header {
            background: linear-gradient(135deg, var(--red-team-color), var(--blue-team-color));
            color: white;
            padding: 15px;
            text-align: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
            position: relative;
            z-index: 10;
        }
        
        .header h1 {
            margin: 0;
            font-size: 2rem;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
        }
        
        .header p {
            margin: 5px 0 0;
            font-size: 0.9rem;
            opacity: 0.9;
        }
        
        /* 主内容区域 */
        .main-content {
            display: flex;     
        }
        
        /* 队伍区域 */
        .team-section {
            width: 220px;
            padding: 15px;
            background-color: #fff;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            display: flex;
            flex-direction: column;
            transition: all 0.3s;
            z-index: 5;
        }
        
        .red-team {
            border-right: 4px solid var(--red-team-color);
        }
        
        .blue-team {
            border-left: 4px solid var(--blue-team-color);
        }
        
        /* 宝可梦池区域 */
        .pool-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background-color: #ecf0f1;
        }
        
        .pool-container {
    height: 70vh; /* 固定高度为视窗的70% */
    overflow-y: auto; /* 内部垂直滚动 */
    padding: 15px;
    background-color: #ecf0f1;
    /* 移除 flex: 1 */
}
        
        /* 宝可梦网格 */
        .pokemon-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 15px;
            padding: 5px;
        }
        
        .pokemon-card {
            background-color: white;
            border-radius: 10px;
            padding: 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            position: relative;
            overflow: hidden;
        }
        
        .pokemon-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 15px rgba(0,0,0,0.2);
        }
        
        .pokemon-card:hover .pokemon-name {
            color: var(--hover-color);
        }
        
        .pokemon-image {
            width: 80px;
            height: 80px;
            object-fit: contain;
            transition: transform 0.3s;
        }
        
        .pokemon-card:hover .pokemon-image {
            transform: scale(1.1);
        }
        
        .pokemon-name {
            margin-top: 5px;
            font-weight: 600;
            font-size: 0.9rem;
            color: #2c3e50;
            transition: color 0.3s;
        }
        
        .pokemon-id {
            position: absolute;
            top: 5px;
            left: 5px;
            font-size: 0.7rem;
            color: #7f8c8d;
            background-color: rgba(255,255,255,0.7);
            padding: 2px 5px;
            border-radius: 10px;
        }
        
        .pokemon-types {
            display: flex;
            justify-content: center;
            gap: 5px;
            margin-top: 5px;
        }
        
        .type-badge {
            font-size: 0.7rem;
            padding: 2px 8px;
            border-radius: 10px;
            color: white;
            text-shadow: 0 1px 1px rgba(0,0,0,0.2);
        }
        
        /* 选中和禁用状态 */
        .pokemon-card.selected-red {
            background-color: rgba(231, 76, 60, 0.1);
            border: 2px solid var(--red-team-color);
        }
        
        .pokemon-card.selected-blue {
            background-color: rgba(52, 152, 219, 0.1);
            border: 2px solid var(--blue-team-color);
        }
        
        .pokemon-card.banned {
            background-color: #ecf0f1;
            opacity: 0.5;
        }
        
        .pokemon-card.banned::after {
            content: "✗";
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 50px;
            color: var(--ban-color);
            opacity: 0.8;
            z-index: 2;
        }
        
        /* 控制栏 */
        .controls {
            padding: 10px 20px;
            background-color: #2c3e50;
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
        }
        
        .control-btn {
            background-color: #34495e;
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .control-btn:hover {
            background-color: #3d566e;
            transform: translateY(-2px);
        }
        
        .control-btn i {
            font-size: 0.9rem;
        }
        
        /* 队伍列表 */
        .team-list {
            flex: 1;
            overflow-y: auto;
            margin-top: 10px;
            padding-right: 5px;
        }
        
        .team-title {
            font-weight: bold;
            text-align: center;
            padding: 8px;
            border-radius: 6px;
            margin-bottom: 10px;
            font-size: 1rem;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        .red-title {
            background-color: var(--red-team-color);
            color: white;
        }
        
        .blue-title {
            background-color: var(--blue-team-color);
            color: white;
        }
        
        .team-pokemon {
            display: flex;
            align-items: center;
            padding: 8px;
            margin-bottom: 8px;
            border-radius: 6px;
            transition: all 0.2s;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        
        .team-pokemon:hover {
            transform: translateX(3px);
            box-shadow: 0 3px 8px rgba(0,0,0,0.2);
        }
        
        .red-team-pokemon {
            background-color: rgba(231, 76, 60, 0.1);
            border-left: 3px solid var(--red-team-color);
        }
        
        .blue-team-pokemon {
            background-color: rgba(52, 152, 219, 0.1);
            border-left: 3px solid var(--blue-team-color);
        }
        
        .team-pokemon img {
            width: 40px;
            height: 40px;
            margin-right: 10px;
            object-fit: contain;
        }
        
        .team-pokemon-info {
            flex: 1;
        }
        
        .team-pokemon-name {
            font-weight: 600;
            font-size: 0.9rem;
        }
        
        .team-pokemon-types {
            display: flex;
            gap: 5px;
            margin-top: 3px;
        }
        
        .team-pokemon-type {
            font-size: 0.7rem;
            padding: 1px 6px;
            border-radius: 8px;
            color: white;
        }
        
        /* 禁用列表 */
        .banned-list {
            margin-top: 15px;
        }
        
        .banned-title {
            background-color: #95a5a6;
            color: white;
        }
        
        .banned-pokemon {
            display: flex;
            align-items: center;
            padding: 6px;
            margin-bottom: 5px;
            background-color: rgba(149, 165, 166, 0.1);
            border-radius: 4px;
            font-size: 0.8rem;
            opacity: 0.8;
        }
        
        .banned-pokemon img {
            width: 25px;
            height: 25px;
            margin-right: 8px;
            opacity: 0.7;
        }
        
        /* 搜索和筛选 */
        .search-filter {
            padding: 15px;
            background-color: #bdc3c7;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            position: sticky;
            top: 0;
            z-index: 5;
        }
        
        .search-box-container {
            position: relative;
        }
        
        .search-box {
            width: 100%;
            padding: 10px 15px 10px 40px;
            border: none;
            border-radius: 25px;
            font-size: 1rem;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #7f8c8d;
        }
        
        .filter-options {
            display: flex;
            margin-top: 10px;
            gap: 10px;
            flex-wrap: wrap;
        }
        
        .filter-select {
            flex: 1;
            min-width: 120px;
            padding: 8px;
            border: none;
            border-radius: 5px;
            background-color: white;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            cursor: pointer;
        }
        
        /* BP阶段指示器 */
        .bp-phase-indicator {
            background-color: #34495e;
            color: white;
            padding: 10px;
            text-align: center;
            font-weight: bold;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            position: sticky;
            top: 0;
            z-index: 10;
        }
        
        .phase-icon {
            font-size: 1.2rem;
        }
        
        .red-phase {
            color: var(--red-team-color);
        }
        
        .blue-phase {
            color: var(--blue-team-color);
        }
        
        /* 宝可梦详情弹窗 */
        .pokemon-details {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: white;
            padding: 25px;
            border-radius: 15px;
            box-shadow: 0 0 30px rgba(0,0,0,0.4);
            z-index: 1000;
            max-width: 90%;
            width: 400px;
            display: none;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .pokemon-details.show {
            display: block;
            animation: fadeIn 0.3s;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translate(-50%, -40%); }
            to { opacity: 1; transform: translate(-50%, -50%); }
        }
        
        .close-details {
            position: absolute;
            top: 15px;
            right: 15px;
            cursor: pointer;
            font-size: 24px;
            color: #7f8c8d;
            transition: color 0.2s;
        }
        
        .close-details:hover {
            color: var(--red-team-color);
        }
        
        .detail-header {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .detail-image {
            width: 120px;
            height: 120px;
            object-fit: contain;
            margin-right: 20px;
        }
        
        .detail-name-id {
            flex: 1;
        }
        
        .detail-name {
            font-size: 1.8rem;
            font-weight: bold;
            margin: 0;
            color: #2c3e50;
        }
        
        .detail-id {
            font-size: 1rem;
            color: #7f8c8d;
            margin: 5px 0;
        }
        
        .detail-types {
            display: flex;
            gap: 10px;
            margin: 10px 0;
        }
        
        .detail-stats {
            margin-top: 20px;
        }
        
        .stat-row {
            display: flex;
            align-items: center;
            margin-bottom: 8px;
        }
        
        .stat-name {
            width: 80px;
            font-weight: 600;
        }
        
        .stat-bar-container {
            flex: 1;
            height: 20px;
            background-color: #ecf0f1;
            border-radius: 10px;
            overflow: hidden;
        }
        
        .stat-bar {
            height: 100%;
            background: linear-gradient(90deg, #3498db, #2ecc71);
            border-radius: 10px;
            transition: width 0.5s;
        }
        
        .stat-value {
            width: 40px;
            text-align: right;
            margin-left: 10px;
            font-weight: 600;
        }
        
        .detail-abilities {
            margin-top: 20px;
        }
        
        .ability {
            display: inline-block;
            padding: 5px 10px;
            background-color: #3498db;
            color: white;
            border-radius: 15px;
            margin-right: 8px;
            margin-bottom: 8px;
            font-size: 0.9rem;
        }
        
        /* 加载动画 */
        .loading {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
            font-size: 1.5rem;
            color: #7f8c8d;
        }
        
        .spinner {
            border: 4px solid rgba(0, 0, 0, 0.1);
            border-radius: 50%;
            border-top: 4px solid #3498db;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin-right: 15px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* 响应式设计 */
        @media (max-width: 1200px) {
            .team-section {
                width: 180px;
            }
        }
        
        @media (max-width: 992px) {
            .team-section {
                position: absolute;
                height: 100%;
                transform: translateX(-100%);
            }
            
            .team-section.active {
                transform: translateX(0);
                box-shadow: 0 0 20px rgba(0,0,0,0.3);
            }
            
            .red-team {
                left: 0;
            }
            
            .blue-team {
                right: 0;
                transform: translateX(100%);
            }
            
            .team-toggle {
                display: block;
                position: fixed;
                top: 100px;
                z-index: 20;
                background-color: white;
                border: none;
                width: 30px;
                height: 50px;
                display: flex;
                justify-content: center;
                align-items: center;
                cursor: pointer;
                box-shadow: 0 0 10px rgba(0,0,0,0.2);
                border-radius: 0 5px 5px 0;
            }
            
            .red-team-toggle {
                left: 0;
            }
            
            .blue-team-toggle {
                right: 0;
                border-radius: 5px 0 0 5px;
            }
        }
        
        @media (max-width: 768px) {
            .pokemon-grid {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            }
            
            .pokemon-image {
                width: 60px;
                height: 60px;
            }
            
            .controls {
                flex-direction: column;
                align-items: stretch;
            }
        }

        /* 进度条 */
        .progress-container {
            width: 100%;
            background-color: #ddd;
            border-radius: 5px;
            margin-top: 10px;
            display: none;
        }
        
        .progress-bar {
            height: 10px;
            background-color: #4CAF50;
            border-radius: 5px;
            width: 0%;
            transition: width 0.3s;
        }
        
        /* 联机控制样式 */
.online-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

/* 团队指示器 */
#team-indicator {
  padding: 5px 10px;
  border-radius: 5px;
  color: white;
  margin-left: 10px;
}

.team-red {
  background-color: var(--red-team-color);
}

.team-blue {
  background-color: var(--blue-team-color);
}

/* 特性提示框样式 */
.ability-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    max-width: 300px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    pointer-events: none;
    line-height: 1.4;
}

/* 为特性文本添加悬停光标提示 */
.ability {
    cursor: help;
    position: relative;
}

/* 在文件末尾添加以下样式 */
.export-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.export-window-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}


.vs-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
}

.team-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.vs {
    font-size: 24px;
    font-weight: bold;
    margin: 0 5px;
}

.red-team, .blue-team {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 800px;
}

.simple-pokemon {
    text-align: center;
    flex: 0 0 auto;
}

.simple-pokemon img {
    width: 80px; height: 80px; object-fit: contain;
}


/* 房间信息样式 */
.room-info {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.control-btn.small {
    padding: 5px 10px;
    font-size: 14px;
}

/* 消息提示样式 */
.toast-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slide-up 0.3s ease-out;
}

.toast-message.fade-out {
    animation: fade-out 0.5s ease-out forwards;
}

@keyframes slide-up {
    from { bottom: -50px; opacity: 0; }
    to { bottom: 20px; opacity: 1; }
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}



/* 聊天容器 - 完整修复版 */
.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    height: 60vh; /* 使用固定高度而非最大高度 */
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 10000;
    border: 1px solid #ddd;
    overflow: hidden; /* 保持溢出隐藏 */
}

.chat-container.show {
    display: block;
}

/* 聊天头部 */
.chat-header {
    padding: 12px 15px;
    background: #4a5568;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 防止头部被挤压 */
    cursor: move;
    user-select: none;
}

/* 消息区域 - 关键修复 */
#chat-messages {
    flex: 1; /* 占据剩余空间 */
    padding-bottom: 60px;
    overflow-y: auto; /* 启用垂直滚动 */
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: calc(70vh - 120px); /* 明确最大高度，减去头部和输入区域高度 */
    scrollbar-width: thin; /* 优化滚动条样式 */
}

/* 输入区域 - 绝对固定在底部 */
.chat-input-area {
    position: absolute; /* 关键5: 粘性定位 */
    margin-bottom: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #eee;
    z-index: 1; /* 确保在消息上方 */
    gap: 8px;
}

/* 输入框样式 */
.chat-input-field {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

/* 发送按钮样式 */
.chat-send-btn {
    width: 40px;
    background: #4a5568;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: #2d3748;
}

/* 消息样式 */
/* 聊天消息头像样式 */
.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

.message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0px;
    padding: 6px 8px;
    border-radius: 4px;
}

.message.self {
    align-self: flex-end;
    background: #e3f2fd;
}

.message.system {
    background: #f5f5f5;
    color: #666;
    font-style: italic;
    font-size: 0.9em;
    text-align: center;
}

/* 自定义滚动条 */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* 消息元信息 */
.message-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    margin-bottom: 4px;
    color: #666;
}

.message-user {
    font-weight: bold;
}

/* 消息头像样式 */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
    border: 1px solid #303030;
    flex-shrink: 0;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    
}

.message-username {
    font-weight: bold;
    color: #4a5568;
    white-space: nowrap;
}

.message-text {
    margin-left: 10px; /* 头像宽度 + 边距 */
    word-break: break-word;
    margin-top: 8px;

}


/* 聊天标签样式 */
.chat-tabs {
    display: flex;
    gap: 5px;
}

.chat-tab {
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

.chat-tab.active {
    background: rgba(255,255,255,0.4);
    font-weight: bold;
}

/* 用户列表样式 */
.user-list {
    display: none;
    flex-direction: column;
    height: 100%;
}

.user-list-header {
    padding: 10px;
    background: #f1f1f1;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

.user-list-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 8px 5px;
    border-radius: 4px;
    margin-bottom: 5px;
    background: #f8f9fa;
}

.user-info { display: flex; align-items: center; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.user-name {
    flex: 1;
    margin-right: 8px;
}

.user-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
}

.user-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
}

/* 玩家角色样式 */
.user-role {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

.user-role.red {
    background-color: var(--red-team-color);
    color: white;
}

.user-role.spectator {
    background-color: #95a5a6;
    color: white;
}
/* 系统公告样式 */
.system-announcement {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 15px;
    border-left: 5px solid var(--blue-team-color);
}

.system-announcement h3 {
    color: var(--blue-team-color);
    margin-top: 0;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 10px;
}

.system-announcement ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.system-announcement li {
    margin: 12px 0;
    list-style-type: none;
    padding-left: 10px;
    position: relative;
}

.system-announcement li::before {
    content: "•";
    color: var(--blue-team-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}
/* 公告弹窗独立样式 */
.announcement-modal {
    width: 600px; /* 自定义公告弹窗宽度 */
    /* 以下是可选的额外样式定制 */
    max-width: 100%;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
}

/* 复制按钮样式 */
.copy-btn {
    font-size: inherit;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.copy-btn.blue {
    background-color: var(--blue-team-color);
    color: white;
}

.copy-btn.red {
    background-color: var(--red-team-color);
    color: white;
}
