/* 
 * Honor of Kings - 主样式表
 * 此文件包含无法使用 Tailwind 实现的自定义样式
 */

/* ===== 基础样式 ===== */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== 颜色变量 ===== */
:root {
    --color-gold: #d4a257;
    --color-gold-light: rgba(212, 162, 87, 0.2);
    --color-gold-medium: rgba(212, 162, 87, 0.5);
    --transition-standard: all 0.3s ease;
}

/* ===== 自定义颜色类 ===== */
.text-gold {
    color: var(--color-gold);
}

.bg-gold {
    background-color: var(--color-gold);
}

.bg-gold-light {
    background-color: var(--color-gold-light);
}

.hover\:text-gold:hover {
    color: var(--color-gold);
}

/* ===== 自定义 z-index 值 ===== */
.z-90 {
    z-index: 90;
}

.z-100 {
    z-index: 100;
}

/* ===== 区域样式 ===== */
.feature-section {
    background: linear-gradient(180deg, #f8d48a 0%, #f5f5f5 100%);
}

.gameplay-section {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.character-section {
    background: linear-gradient(180deg, #f5f5f5 0%, #f8d48a 100%);
}

/* ===== 导航样式 ===== */
.nav-item {
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-gold);
    transition: var(--transition-standard);
}

.nav-item:hover::after {
    width: 100%;
}

/* ===== 按钮样式 ===== */
.download-button {
    background-color: #000;
    color: #fff;
    border-radius: 4px;
    transition: var(--transition-standard);
}

.download-button:hover {
    background-color: #333;
}

/* ===== 移动端菜单样式 ===== */
.mobile-menu {
    background-color: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-standard);
}

.mobile-menu a:hover {
    background-color: rgba(212, 162, 87, 0.1);
    padding-left: 8px;
}

.mobile-menu-button {
    transition: var(--transition-standard);
}

.mobile-menu-button:hover {
    color: var(--color-gold);
}

/* ===== 特性卡片样式 ===== */
.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-standard);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-card .bg-gradient-to-t {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    transition: var(--transition-standard);
}

.feature-card:hover .bg-gradient-to-t,
.feature-card.active .bg-gradient-to-t {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.feature-card h3 {
    transition: var(--transition-standard);
}

.feature-card:hover h3,
.feature-card.active h3 {
    color: var(--color-gold);
}

/* ===== 角色网格样式 ===== */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.character-card {
    border: 1px solid var(--color-gold);
    aspect-ratio: 1;
    transition: var(--transition-standard);
}

.character-card:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(212, 162, 87, 0.3);
}

/* ===== 分隔线样式 ===== */
.gold-divider {
    height: 1px;
    background-color: var(--color-gold);
    opacity: 0.7;
}

.title-with-dividers {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
}

.title-with-dividers::before,
.title-with-dividers::after {
    content: "";
    height: 1px;
    background-color: var(--color-gold);
    opacity: 0.8;
    flex-grow: 1;
    margin: 0 20px;
}

/* ===== 游戏模式样式 ===== */
.game-mode-icon {
    width: 60px;
    height: 60px;
    background-color: var(--color-gold-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: var(--transition-standard);
}

.game-mode:hover .game-mode-icon {
    background-color: var(--color-gold-medium);
    transform: scale(1.1);
}

/* ===== 页脚链接样式 ===== */
.footer-link {
    color: #999;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--color-gold);
}

/* ===== 图标样式 ===== */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.5em;
    text-align: center;
}

.icon-user::before {
    content: '👤';
}

.icon-android::before {
    content: '📱';
}

.icon-down::before {
    content: '↓';
}

.icon-chess::before {
    content: '♞';
}

.icon-trophy::before {
    content: '🏆';
}

.icon-crown::before {
    content: '👑';
}

/* ===== 模态窗口动画 ===== */
@keyframes modalopen {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    animation: modalopen 0.4s;
}

/* ===== 滑动容器样式 ===== */
.feature-slider {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    touch-action: pan-y;
    /* 禁止水平滑动的默认行为，使用自定义滑动 */
    position: relative;
}

.feature-slider::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Edge */
}

.feature-slider .flex {
    display: flex;
    align-items: stretch;
}

.feature-slider .feature-card {
    transition: var(--transition-standard);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-slider .feature-card.active {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    border-color: rgba(212, 162, 87, 0.5);
    z-index: 5;
}

/* ===== 滑动指示器样式 ===== */
.slide-indicator {
    transition: var(--transition-standard);
    cursor: pointer;
    width: 8px;
    height: 8px;
}

/* ===== 滑动箭头样式 ===== */
.slider-arrow {
    opacity: 0.7;
    transition: var(--transition-standard);
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider-arrow:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.slider-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.slider-arrow.disabled:hover {
    transform: translateY(-50%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.left-arrow {
    left: 8px;
}

.right-arrow {
    right: 8px;
}

/* ===== 游戏特色滑动部分样式 ===== */
.game-feature-slider {
    width: 100%;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.game-feature-slides {
    display: flex;
    width: 100%;
    transition: transform 0.3s ease;
}

.game-feature-slide {
    width: 100%;
    flex-shrink: 0;
}

.game-feature-slide p {
    max-height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.game-feature-indicator {
    cursor: pointer;
    transition: var(--transition-standard);
}

/* ===== 游戏特色左右箭头按钮 ===== */
#game-feature-prev,
#game-feature-next {
    transition: var(--transition-standard);
    opacity: 0.8;
}

#game-feature-prev:hover,
#game-feature-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

#game-feature-prev.opacity-50,
#game-feature-next.opacity-50 {
    cursor: not-allowed;
}

/* ===== 响应式样式 ===== */
@media (max-width: 768px) {

    /* 游戏玩法区域 */
    .gameplay-section {
        position: relative;
        overflow: hidden;
        min-height: auto;
        padding-bottom: 2rem;
    }

    /* 特性卡片 */
    .feature-card:hover {
        transform: translateY(-3px);
    }

    /* 角色网格 */
    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    /* 角色卡片 */
    .character-card:hover {
        transform: scale(1.03);
    }

    /* 标题分隔线 */
    .title-with-dividers::before,
    .title-with-dividers::after {
        margin: 0 10px;
    }

    /* 游戏模式图标 */
    .game-mode-icon {
        width: 50px;
        height: 50px;
    }

    /* 游戏模式悬停效果 */
    .game-mode:hover .game-mode-icon {
        transform: scale(1.05);
    }

    .download-platform-section .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .requirement-card {
        padding: 1rem;
        background: rgba(255, 255, 255, 0.9);
    }

    .tutorial-step {
        padding: 1rem;
        background: rgba(255, 255, 255, 0.9);
    }

    .download-platform-section .bg-white {
        background: rgba(255, 255, 255, 0.85) !important;
    }

    .system-requirements {
        background: rgba(255, 255, 255, 0.9) !important;
    }

    /* 移动端标题优化 */
    .download-section h1 {
        font-size: 2rem;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }

    /* 移动端间距调整 */
    .download-platform-section {
        margin-bottom: 2rem;
    }
}

/* ===== 动画效果 ===== */
/* 定义淡入上移动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 页面加载时立即触发的动画 */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s ease-out forwards;
}

/* 滚动触发的动画元素初始状态 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
        transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity, transform;
}

/* 滚动触发的动画元素可见状态 */
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 为卡片元素添加特殊的动画效果 */
.feature-card.animate-on-scroll {
    transform: translateY(40px) scale(0.9);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0);
}

.feature-card.animate-on-scroll.visible {
    transform: translateY(0) scale(1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 动画延迟类 - 仅用于 fade-in-up */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* 动画持续时间类 - 仅用于 fade-in-up */
.duration-500 {
    animation-duration: 0.5s;
}

.duration-1000 {
    animation-duration: 1000ms;
}

.duration-1500 {
    animation-duration: 1.5s;
}

/* 可见性控制类 */
.invisible {
    opacity: 0;
}

.visible {
    opacity: 1;
}

/* 动画重复类 - 仅用于 fade-in-up */
.animate-once {
    animation-iteration-count: 1;
}

.animate-twice {
    animation-iteration-count: 2;
}

.animate-infinite {
    animation-iteration-count: infinite;
}

/* ===== 下载页面样式 ===== */
.download-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

/* 标题区域 - 完全透明背景 */
.download-section h1 {
    color: white;
    font-weight: 800;
}

.download-section .text-gray-600 {
    font-weight: 500;
}

.download-platform-section {
    transition: opacity 0.6s ease, transform 0.6s ease;
    margin-bottom: 2rem;
}

/* 主要功能卡片 - 70%透明度 + 强毛玻璃效果 */
.download-platform-section .bg-white {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.download-option {
    transition: var(--transition-standard);
}

.download-option:hover {
    transform: translateY(-2px);
}

.download-btn {
    transition: var(--transition-standard);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* 教程步骤 - 更透明 */
.tutorial-step {
    transition: var(--transition-standard);
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 0.75rem;
    border: 1px solid rgba(212, 162, 87, 0.3);
    backdrop-filter: blur(12px) saturate(150%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tutorial-step:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-gold);
    box-shadow: 0 6px 20px rgba(212, 162, 87, 0.2);
}

.tutorial-step h4 {
    color: #1f2937 !important;
    font-weight: 600;
}

.tutorial-step p {
    color: #374151 !important;
    font-weight: 500;
}

/* 安装教程标题 */
.installation-guide h3 {
    color: #1f2937 !important;
    font-weight: 700;
}

/* 系统要求 - 次要信息更透明 */
.requirement-card {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 0.75rem;
    border: 1px solid rgba(212, 162, 87, 0.25);
    transition: var(--transition-standard);
    backdrop-filter: blur(12px) saturate(150%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.requirement-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 162, 87, 0.15);
}

.system-requirements {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.system-requirements h2 {
    color: #1f2937 !important;
    font-weight: 700;
}

.requirement-card h3 {
    color: #1f2937 !important;
    font-weight: 600;
}

.requirement-card ul li {
    color: #374151 !important;
    font-weight: 500;
}

.platform-switch {
    transition: var(--transition-standard);
    backdrop-filter: blur(8px);
}

.platform-switch.active {
    background-color: rgba(59, 130, 246, 0.9);
    color: white;
    backdrop-filter: blur(10px);
}

/* 设备检测区域样式优化 - 更透明 */
#device-detection .bg-blue-100 {
    background: rgba(59, 130, 246, 0.25) !important;
    backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
}

/* 平台切换按钮容器 - 更透明 */
#device-detection .bg-white {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 确保链接按钮样式正确 */
a.download-button,
a.ios-download {
    text-decoration: none;
    display: inline-flex;
}

a.download-button:hover,
a.ios-download:hover {
    text-decoration: none;
}

/* 设备检测提示样式 */
#device-detection {
    animation: fadeInUp 0.6s ease;
}

/* 模态框样式 */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* 增加卡片间距，让背景图更多显露 */
.download-platform-section {
    margin-bottom: 3rem;
}

.download-platform-section .p-6 {
    padding: 2rem;
}

.download-platform-section .md\:p-8 {
    padding: 2.5rem;
}

/* ===== 新增：下载功能合并样式 ===== */

/* 下载按钮组样式 */
.download-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.download-group.hidden {
    display: none !important;
}

/* 按钮内部布局调整 */
.download-button {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.download-button small {
    font-size: 0.75rem;
    opacity: 0.75;
    margin-top: 0.25rem;
}

/* 提示框样式 */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    max-width: 320px;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #10b981;
    color: white;
}

.toast.error {
    background-color: #ef4444;
    color: white;
}

.toast.info {
    background-color: #3b82f6;
    color: white;
}

/* 悬浮安装说明按钮样式 */
#floating-install-guide {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
}

.install-guide-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.install-guide-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.install-guide-btn.hidden {
    display: none !important;
}

/* 悬浮提示文字 */
.install-guide-btn .absolute {
    pointer-events: none;
}

/* 安装教程浮层样式 */
#install-guide-modal {
    backdrop-filter: blur(4px);
}

#install-guide-modal .bg-white {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#install-guide-modal.hidden .bg-white {
    animation: modalSlideOut 0.2s ease-in;
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* 教程图片容器 */
.tutorial-image-container {
    text-align: center;
}

.tutorial-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 教程内容样式 */
.tutorial-content {
    display: block;
}

.tutorial-content.hidden {
    display: none !important;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .download-group {
        gap: 0.75rem;
    }

    .download-button {
        width: 14rem !important;
        /* 224px */
        padding: 0.75rem 2rem;
    }

    .toast {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
        transform: translateY(-100%);
    }

    .toast.show {
        transform: translateY(0);
    }

    /* 移动端悬浮按钮调整 */
    #floating-install-guide {
        right: 0.75rem;
        bottom: 2rem;
        top: auto;
        transform: none;
    }

    .install-guide-btn {
        width: 3rem;
        height: 3rem;
        margin-bottom: 0.5rem;
    }

    .install-guide-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* 移动端隐藏悬浮提示文字 */
    .install-guide-btn .absolute {
        display: none;
    }

    /* 移动端浮层调整 */
    #install-guide-modal .bg-white {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}