/* 服务器页面通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    background: #000;
}

/* 动态粒子背景 */
.particle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(45deg, #0f0f23, #1a1a2e, #16213e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.95);
    padding: 10px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 25px;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 25px;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.dropdown-toggle::after {
    content: '▼';
    margin-left: 8px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after,
.dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-link {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 5px;
}

.dropdown-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

.dropdown-link.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
}

/* 主要内容区域 */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* 页面切换动画 */
.page-section {
    display: none;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease;
    padding: 40px 20px;
}

.page-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 玻璃卡片效果 */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 1s;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* 标题样式 */
.page-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 3s ease infinite;
}

.page-subtitle {
    font-size: 1.2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

@keyframes gradientText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 聊天界面样式 */
.chat-container {
    max-height: 600px;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-header {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.chat-message:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.chat-message.outgoing {
    border-left-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.chat-message.incoming {
    border-left-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.chat-message.test {
    border-left-color: #ffd93d;
    background: rgba(255, 217, 61, 0.1);
}

.chat-header-msg {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chat-player {
    font-weight: bold;
    color: #60a5fa;
    font-size: 0.95rem;
}

.chat-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.chat-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.no-messages {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px 20px;
    font-style: italic;
}

/* 服务器信息网格布局 */
.server-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
    padding: 0;
}

.info-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.info-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.info-description {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    font-size: 1rem;
    flex: 1;
}

/* 状态指示器 */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.status-indicator.offline {
    background: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* 新消息动画效果 */
.new-message-animation {
    animation: newMessageSlide 0.8s ease-out;
}

@keyframes newMessageSlide {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
        background: rgba(102, 126, 234, 0.3);
    }
    50% {
        background: rgba(102, 126, 234, 0.25);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        background: rgba(102, 126, 234, 0.1);
    }
}

/* 为不同类型的消息提供不同的动画颜色 */
.new-message-animation.outgoing {
    animation: newMessageSlideOutgoing 0.8s ease-out;
}

@keyframes newMessageSlideOutgoing {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
        background: rgba(78, 205, 196, 0.3);
    }
    50% {
        background: rgba(78, 205, 196, 0.25);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        background: rgba(78, 205, 196, 0.1);
    }
}

/* 连接错误样式 */
.connection-error {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 20px;
    margin: 15px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
    }
    50% { 
        box-shadow: 0 6px 25px rgba(220, 53, 69, 0.5);
    }
}

.connection-error h4 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 600;
}

.connection-error p {
    margin-bottom: 15px;
    color: #e8e8e8;
    line-height: 1.5;
}

.error-solutions {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    text-align: left;
    margin-top: 15px;
}

.error-solutions h5 {
    color: #ffc107;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.error-solutions ol {
    padding-left: 20px;
    color: #e8e8e8;
}

.error-solutions li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.error-solutions a {
    color: #17a2b8;
    text-decoration: none;
    word-break: break-all;
}

.error-solutions a:hover {
    color: #5bc0de;
    text-decoration: underline;
}

/* 连接成功指示器 */
.chat-status {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
    transition: all 0.3s ease;
}

.chat-status.connected {
    background: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.chat-status.connecting {
    background: #ffc107;
    animation: connectingPulse 1s ease-in-out infinite;
}

@keyframes connectingPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .connection-error {
        margin: 10px;
        padding: 15px;
    }
    
    .connection-error h4 {
        font-size: 1.2rem;
    }
    
    .error-solutions {
        padding: 12px;
    }
    
    .error-solutions h5 {
        font-size: 1rem;
    }
    
    .error-solutions ol {
        padding-left: 15px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
        justify-content: center;
    }
    
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    .nav-item {
        flex: 0 0 auto;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .dropdown-toggle {
        padding: 8px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    /* 调整下拉菜单位置 */
    .dropdown-menu {
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        min-width: 180px;
    }
    
    .dropdown:hover .dropdown-menu,
    .dropdown.active .dropdown-menu {
        transform: translateX(-50%) translateY(0);
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .glass-card {
        padding: 20px;
        margin: 10px 0;
    }
    
    /* 服务器信息网格响应式 */
    .server-info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0;
    }
    
    .info-item {
        padding: 20px;
    }
    
    .info-title {
        font-size: 1.2rem;
    }
    
    .info-description {
        font-size: 0.95rem;
    }
    
    .chat-container {
        max-height: 500px;
    }
    
    .chat-messages {
        max-height: 350px;
        padding: 15px;
    }
    
    .chat-message {
        padding: 10px 12px;
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-footer {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}

/* 导航栏移动端优化 */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 0;
    }
    
    .nav-container {
        min-height: auto;
    }
    
    .nav-menu {
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
}

/* 额外的小屏幕优化 */
@media (max-width: 480px) {
    .nav-menu {
        padding: 0 5px;
    }
    
    /* 确保所有项目都能显示 */
    .nav-item:first-child .nav-link {
        margin-left: 0;
    }
    
    .nav-item:last-child .nav-link {
        margin-right: 0;
    }
}

@media (max-width: 480px) {    .nav-container {
        padding: 0 10px;
    }
    
    .nav-menu {
        gap: 5px;
        justify-content: space-between;
    }
    
    .nav-link,
    .dropdown-toggle {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    /* 进一步缩小下拉菜单 */
    .dropdown-menu {
        min-width: 160px;
        font-size: 0.85rem;
    }
    
    .dropdown-link {
        padding: 10px 15px;
    }
    
    .server-info-grid {
        gap: 15px;
        margin: 15px 0;
    }
    
    .info-item {
        padding: 15px;
    }
    
    .info-title {
        font-size: 1.1rem;
    }
    
    .info-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {    .nav-container {
        gap: 10px;
    }
    
    .nav-menu {
        gap: 3px;
        flex-wrap: wrap;
    }
    
    .nav-item {
        margin: 2px 0;
    }
    
    .nav-link,
    .dropdown-toggle {
        padding: 5px 6px;
        font-size: 0.75rem;
        border-radius: 15px;
    }
    
    /* 简化下拉菜单文本 */
    .dropdown-toggle {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .dropdown-menu {
        min-width: 140px;
        font-size: 0.8rem;
    }
    
    .dropdown-link {
        padding: 8px 12px;
    }
}
