/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1d1d1f;
    background-color: #ffffff;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

body.loaded {
    opacity: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 英雄区域 - Minecraft服务器风格 */
.hero {
    height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('images/back.png');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* 服务器Logo区域 */
.server-logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.server-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: logoFloat 4s ease-in-out infinite;
}

.logo-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    /* 使用圆形裁剪来隐藏边框 */
    object-fit: cover;
    object-position: center;
    /* 创建圆形遮罩效果 */
    clip-path: circle(45% at center);
}

.logo-image:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.server-name {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 
        2px 2px 0px rgba(0, 0, 0, 1),
        -2px -2px 0px rgba(0, 0, 0, 1),
        2px -2px 0px rgba(0, 0, 0, 1),
        -2px 2px 0px rgba(0, 0, 0, 1),
        0 4px 20px rgba(0, 0, 0, 0.8);
    margin: 0;
    letter-spacing: 2px;
}

.server-slogan {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 
        1px 1px 0px rgba(0, 0, 0, 1),
        -1px -1px 0px rgba(0, 0, 0, 1),
        1px -1px 0px rgba(0, 0, 0, 1),
        -1px 1px 0px rgba(0, 0, 0, 1),
        0 2px 10px rgba(0, 0, 0, 0.8);
    margin: 0;
    font-weight: 400;
}

/* 功能导航区域 */
.feature-navigation {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3rem;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.nav-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.nav-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

.nav-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-item:hover .nav-icon {
    background: rgba(255, 255, 255, 0.3);
}

.nav-label {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-shadow: 
        1px 1px 0px rgba(0, 0, 0, 1),
        -1px -1px 0px rgba(0, 0, 0, 1),
        1px -1px 0px rgba(0, 0, 0, 1),
        -1px 1px 0px rgba(0, 0, 0, 1),
        0 2px 8px rgba(0, 0, 0, 0.8);
}





/* 动画效果 */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* 按钮样式 */
.btn {
    padding: 12px 32px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #007aff;
    color: white;
}

.btn-primary:hover {
    background: #0056cc;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #333;
    border: 2px solid #ddd;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #007aff;
    color: #007aff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 按钮波纹效果 */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}





/* AI客服 */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #007aff;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 122, 255, 0.4);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

.chat-widget.active {
    display: flex;
}

.chat-header {
    background: #007aff;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    word-wrap: break-word;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bot-message .message-content {
    background: #f0f0f0;
    color: #1d1d1f;
}

.user-message .message-content {
    background: #007aff;
    color: white;
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid #e5e5e7;
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e5e7;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
}

#chat-input:focus {
    border-color: #007aff;
}

#chat-send {
    padding: 0.75rem 1.5rem;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

#chat-send:hover {
    background: #0056cc;
}



/* 按钮波纹效果 */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}









/* Logo入场动画 */
.server-logo-container {
    animation: fadeInScale 1.5s ease-out both;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 功能导航入场动画 */
.feature-navigation {
    animation: fadeIn 1s ease-out 0.5s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .server-logo-container,
    .feature-navigation,
    .nav-item {
        transition: none;
        animation: none;
    }
    
    .nav-item:hover {
        transform: none;
    }
}

/* 确保GPU加速 */
.btn,
.chat-button,
.nav-item,
.server-logo,
.logo-image {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.nav-item {
    will-change: transform;
}

.logo-image {
    will-change: transform;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .server-name {
        font-size: 2.5rem;
    }
    
    .server-slogan {
        font-size: 1rem;
    }
    
    .logo-image {
        width: 80px;
        height: 80px;
    }
    
    .feature-navigation {
        bottom: 40px;
        gap: 1.5rem;
    }
    
    .nav-item {
        padding: 0.75rem;
    }
    
    .nav-icon {
        width: 40px;
        height: 40px;
    }
    
    .nav-icon img {
        width: 20px;
        height: 20px;
    }
    
    .nav-label {
        font-size: 0.8rem;
    }
    
    .chat-widget {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        height: 400px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .btn {
        min-width: 140px;
        padding: 10px 24px;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }

    .chat-button {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007aff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    color: #666;
    font-size: 0.9rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示样式 */
.notification,
.error-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin: 1rem 0;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    color: #c33;
    border: 1px solid #fcc;
}

.success-message {
    background: linear-gradient(135deg, #efe 0%, #dfd 100%);
    color: #363;
    border: 1px solid #cfc;
}

.warning-message {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.info-message {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}