/* 基础样式重置和移动端优先设计 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: var(--primary-color, #FF8C00);
    color: var(--text-color, white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

:root {
    --primary-color: #FF8C00;
    --secondary-color: #FF6347;
    --text-color: white;
    --card-bg: rgba(255, 255, 255, 0.1);
    --border-radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px 15px;
    text-align: center;
    width: 100%;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.site-name {
    color: var(--text-color);
    font-size: clamp(18px, 4vw, 28px);
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
    line-height: 1.2;
}

/* 轮播图部分 - 完全响应式 */
.carousel-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    margin: 20px auto;
    text-align: center;
    overflow: hidden;
    width: min(95%, 1280px);
    aspect-ratio: 16/9;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.carousel-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

/* 为轮播图容器添加ID选择器样式，提供更强的约束 */
.carousel-section .carousel-inner img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
    box-sizing: border-box !important;
}

.carousel-inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.carousel-item {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.carousel-item.active {
    display: block;
}

/* 特色图片样式 - 保持与轮播图相同的显示效果 */
.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    z-index: 1;
}

/* 轮播图指示点 - 响应式大小 */
.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 5px;
}

.dot {
    height: 8px;
    width: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.dot.active {
    background-color: white;
}

/* 文字说明部分 - 响应式 */
.text-description-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: clamp(15px, 3vw, 25px);
    margin: 15px auto;
    text-align: center;
    border-radius: var(--border-radius);
    max-width: min(95%, 1200px);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.text-description-section:hover {
    transform: translateY(-2px);
}

.text-description {
    color: var(--text-color);
    font-size: clamp(14px, 3vw, 18px);
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    margin: 0;
}

/* 游戏列表部分 - 完全响应式网格 */
.game-list-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: clamp(20px, 4vw, 40px);
    margin: 20px auto;
    border-radius: var(--border-radius);
    max-width: min(95%, 1400px);
    box-shadow: var(--shadow);
}

.game-list-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(3px, 1vw, 20px);
    justify-items: center;
    width: 100%;
    padding: clamp(5px, 2vw, 20px) clamp(3px, 1vw, 10px);
}

.game-item {
    width: 100%;
    text-align: center;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    padding: clamp(3px, 1vw, 15px);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-item:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.game-item:active {
    transform: scale(0.95);
}

.game-thumbnail {
    width: 100%;
    aspect-ratio: 1/1;
    margin: 0 auto clamp(3px, 1vw, 15px) auto;
    border-radius: calc(var(--border-radius) * 0.7);
    object-fit: cover;
    border: clamp(1px, 0.5vw, 3px) solid rgba(255, 255, 255, 0.3);
    display: block;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

/* 确保游戏名称在链接中仍为白色 */
.game-item .game-name {
    color: white;
}

.game-name {
    font-size: clamp(9px, 2vw, 14px);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: clamp(2px, 1vw, 8px) clamp(3px, 1vw, 8px);
    background: rgba(0, 0, 0, 0.2);
    border-radius: calc(var(--border-radius) * 0.5);
    margin-top: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}



/* 域名部分样式 */
.domain-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: clamp(20px, 4vw, 30px);
    margin: 20px auto;
    border-radius: var(--border-radius);
    max-width: min(95%, 1200px);
    box-shadow: var(--shadow);
}

.domain-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 2vw, 20px);
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(5px, 2vw, 0px);
}

.domain-row {
    display: contents;
}

.domain-item {
    color: var(--text-color);
    font-size: clamp(12px, 2.5vw, 16px);
    font-weight: 600;
    text-align: center;
    padding: clamp(10px, 2vw, 15px);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    text-decoration: none;
    box-sizing: border-box;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.domain-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 所有轮播图区域现在使用统一的样式 */

/* 页脚 - 响应式 */
.footer {
    background-color: #FF8C00;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 14px;
}

/* 高级响应式媒体查询 */
@media (max-width: 320px) {
    /* 超小屏幕优化 */
    .header {
        padding: 15px 10px;
    }
    
    .game-list-container {
        gap: 2px;
        padding: 5px 2px;
    }
    
    .domain-container {
        gap: 5px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    /* 平板优化 */
    .header {
        padding: 25px 20px;
    }
    
    .carousel-section {
        margin: 25px auto;
    }
    
    .game-list-section {
        padding: 30px;
    }
}

@media (min-width: 1025px) {
    /* 桌面端优化 */
    .header {
        padding: 30px 25px;
    }
    
    .text-description-section,
    .game-list-section,
    .domain-section {
        margin: 30px auto;
    }
    
    .game-list-section {
        padding: 40px;
    }
}

@media (min-width: 1400px) {
    /* 大屏幕优化 */
    .carousel-section {
        max-width: 1400px;
    }
    
    .game-list-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(255, 255, 255, 0.15);
        --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
}

/* 减少动画的用户偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
