:root {
    --primary-blue: #003366;
    --secondary-blue: #0066cc;
    --light-gray: #e6f3ff;
    --gray: #5c7a99;
    --white: #ffffff;
    --bg-color: #f0f8ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--primary-blue);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--primary-blue);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-logo a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--light-gray);
}

/* 欢迎区域样式 */
.hero-section {
    text-align: center;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, #5B9BD5, #8BB4E3);
    color: var(--white);
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    color: #4A90E2;
}

.hero-section p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* 首页轮播区域样式 */
.home-carousel-section {
    padding: 2rem;
    margin-bottom: 2rem;
}

.carousel-container {
    max-width: 1000px;
    margin: 0 auto;
}

.carousel {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    padding: 2rem;
}

.slide-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.slide-content h2 {
    color: var(--primary-blue);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.slide-content p {
    color: var(--gray);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.slide-content img {
    width: 100%;
    max-width: 500px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 102, 204, 0.4);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-button:hover {
    background: rgba(0, 102, 204, 0.7);
}

.carousel-button.prev {
    left: 1rem;
}

.carousel-button.next {
    right: 1rem;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray);
    opacity: 0.5;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-dot.active {
    background: var(--secondary-blue);
    opacity: 1;
}

/* 功能预览区域样式 */
.features-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.feature-card h2 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.feature-card p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.feature-link {
    display: inline-block;
    background-color: #004080;
    color: var(--white);
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
    transition: background-color 0.3s, transform 0.2s;
}

.feature-link:hover {
    background-color: #003366;
    transform: scale(1.05);
}

/* 页脚样式 */
.footer {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 1.5rem;
    margin-top: auto;
    border-top: none;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--light-gray);
}

.copyright {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero-section {
        padding: 3rem 1rem;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .slide-content h2 {
        font-size: 1.5rem;
    }

    .slide-content p {
        font-size: 1rem;
    }

    .slide-content img {
        height: 200px;
    }

    .features-preview {
        padding: 1rem;
    }

    .feature-card {
        padding: 1.5rem;
    }
}

.chat-section {
    padding: 2rem;
    background-color: #f9f9f9;
    border-top: 1px solid #ccc;
}

.chat-box {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
}

.chat-log {
    border: 1px solid #ccc;
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

#user-input {
    padding: 0.5rem;
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#send-button {
    padding: 0.5rem 1rem;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#send-button:hover {
    background-color: #005bb5;
}

/* 添加渐入特效 */
.fade-in {
    opacity: 0;
    animation: fadeIn 2s forwards; /* 2秒的渐入动画 */
}

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

/* 新增渐入特效的样式 */
.fade-in-text {
    opacity: 0;
    animation: fadeIn 2s forwards; /* 2秒内渐入 */
}

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

.compiler-button {
    display: inline-block; /* 使按钮为块级元素 */
    background-color: #4CAF50; /* 绿色背景 */
    color: white; /* 白色字体 */
    padding: 10px 20px; /* 内边距 */
    text-align: center; /* 文本居中 */
    text-decoration: none; /* 去掉下划线 */
    border-radius: 5px; /* 圆角 */
    margin-top: 20px; /* 上边距 */
}

.compiler-button:hover {
    background-color: #45a049; /* 悬停时的背景颜色 */
}

.footer-content {
    text-align: center;
}

.info-box {
    background-color: var(--white); /* 方框背景颜色 */
    border: none; /* 移除边框 */
    border-radius: 8px; /* 圆角 */
    padding: 1rem; /* 内边距 */
    margin-top: 1rem; /* 上边距 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
}

.download-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.download-link {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    margin: 10px 0;
    transition: background 0.3s;
}

.download-link:hover {
    background: #45a049;
}

.note {
    font-size: 0.9em;
    color: #888;
    margin-top: 10px;
}

/* 称号管理样式 */
.title-item {
    transition: all 0.2s;
    border-radius: 8px;
}

.title-item:hover {
    background-color: rgba(236, 252, 255, 0.5);
    transform: translateX(5px);
}

.titles-list {
    max-height: 300px;
    overflow-y: auto;
}

/* 3D虚拟世界卡片样式 */
.virtual-world-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
}

.virtual-world-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
    color: white;
    transition: all 0.3s ease;
}

.virtual-world-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(102, 126, 234, 0.4);
}

.virtual-world-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.virtual-world-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.virtual-world-card p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.virtual-world-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.virtual-world-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

/* 新功能标签 */
.virtual-world-card .new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

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

/* 桌面版下载区域样式 */
.desktop-download-section {
    margin-top: 3rem;
    padding: 2rem 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.desktop-download-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(240, 147, 251, 0.3);
    transition: all 0.3s ease;
}

.desktop-download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(240, 147, 251, 0.4);
}

.desktop-download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

.desktop-icon {
    font-size: 3rem;
    opacity: 0.9;
    margin-right: 1rem;
}

.desktop-content {
    flex: 1;
}

.desktop-content h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.desktop-content p {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.desktop-features {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.feature-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.desktop-download-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.desktop-download-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.desktop-download-btn i {
    margin-right: 0.5rem;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .virtual-world-section,
    .desktop-download-section {
        padding: 1rem;
    }
    
    .virtual-world-card,
    .desktop-download-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .desktop-download-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .desktop-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .desktop-features {
        justify-content: center;
    }
    
    .virtual-world-card h2,
    .desktop-content h3 {
        font-size: 1.5rem;
    }
}

/* 现代化高对比度模式支持 - 替代已弃用的-ms-high-contrast */
@media (forced-colors: active) {
    /* 全局颜色重置为系统颜色 */
    :root {
        --primary-blue: ButtonText;
        --secondary-blue: LinkText;
        --light-gray: ButtonFace;
        --gray: GrayText;
        --white: Canvas;
        --bg-color: Canvas;
    }
    
    /* 导航栏高对比度适配 */
    .navbar {
        background-color: ButtonFace !important;
        border: 1px solid ButtonBorder;
    }
    
    .nav-logo a,
    .nav-links a {
        color: ButtonText !important;
        forced-color-adjust: none;
    }
    
    /* 主要内容区域 */
    .hero-section {
        background: Canvas !important;
        color: CanvasText !important;
        border: 1px solid ButtonBorder;
    }
    
    .hero-section h1 {
        color: CanvasText !important;
    }
    
    /* 卡片元素 */
    .feature-card,
    .virtual-world-card,
    .desktop-download-card,
    .carousel {
        background: Canvas !important;
        color: CanvasText !important;
        border: 1px solid ButtonBorder !important;
    }
    
    /* 按钮元素 */
    .compiler-button,
    .download-link,
    .virtual-world-link,
    .desktop-download-btn,
    .carousel-button {
        background: ButtonFace !important;
        color: ButtonText !important;
        border: 1px solid ButtonBorder !important;
    }
    
    /* 输入框 */
    #user-input,
    input,
    textarea,
    select {
        background: Field !important;
        color: FieldText !important;
        border: 1px solid ButtonBorder !important;
    }
    
    /* 链接 */
    a {
        color: LinkText !important;
    }
    
    a:visited {
        color: VisitedText !important;
    }
    
    /* 禁用装饰性元素 */
    .feature-card::before,
    .virtual-world-card::before,
    .desktop-download-card::before {
        display: none !important;
    }
}

/* 为不支持forced-colors的浏览器提供高对比度回退 */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #000000;
        --secondary-blue: #0000ff;
        --light-gray: #ffffff;
        --gray: #666666;
        --white: #ffffff;
        --bg-color: #ffffff;
    }
    
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .navbar {
        background-color: black !important;
        border: 2px solid black;
    }
    
    .nav-logo a,
    .nav-links a {
        color: white !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        border: 2px solid black;
    }
    
    .hero-section h1 {
        color: black !important;
    }
    
    .feature-card,
    .virtual-world-card,
    .desktop-download-card,
    .carousel {
        background: white !important;
        color: black !important;
        border: 2px solid black !important;
    }
    
    .compiler-button,
    .download-link,
    .virtual-world-link,
    .desktop-download-btn {
        background: black !important;
        color: white !important;
        border: 2px solid black !important;
    }
    
    a {
        color: blue !important;
        text-decoration: underline !important;
    }
    
    /* 禁用渐变和阴影 */
    * {
        box-shadow: none !important;
        background-image: none !important;
        text-shadow: none !important;
    }
}