﻿.documentation__search {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 1;
    margin-bottom: 90px;
}

.documentation__search::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(95, 58, 252, 0.05) 0%, transparent 70%);
    z-index: -1;
    opacity: 0.3;
}

.documentation__search:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(95, 58, 252, 0.15);
}

.documentation__search.search-focused {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 25px 50px rgba(95, 58, 252, 0.2);
}

.documentation__search-inner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.documentation__search-input {
    position: relative;
    overflow: hidden;
}

.documentation__search-input::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #5f3afc, #764ba2);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.documentation__search-input:focus-within::after {
    width: 100%;
}

/* 修复手机模式下搜索按钮换行问题 */
.documentation__search-input .input-group {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap; /* 防止换行 */
    min-height: 60px;
}

/* 搜索输入框样式 - 与search.css保持一致 */
.documentation__search-input .flex-grow-1 {
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: none;
    outline: none;
    height: 60px;
    line-height: 1.5;
    background: white;
    flex: 1;
    min-width: 0; /* 允许收缩 */
}

.documentation__search-input .flex-grow-1:focus {
    border-color: #5f3afc;
    box-shadow: none;
}

.documentation__search-input .flex-grow-1::placeholder {
    color: #92909d;
    font-weight: 400;
}

/* 搜索按钮样式 - 修复手机模式换行问题 */
.documentation__search-input .m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    line-height: 1;
    padding: 0 35px;
    color: #fff;
    background: #5f3afc;
    text-align: center;
    border-radius: 0 6px 6px 0;
    font-weight: 500;
    font-size: 16px;
    text-transform: capitalize;
    position: relative;
    z-index: 1;
    border: 2px solid #5f3afc;
    border-left: none;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease-out 0s;
    margin: 0; /* 移除所有外边距 */
    flex-shrink: 0; /* 防止按钮收缩 */
    white-space: nowrap; /* 防止文字换行 */
}

.documentation__search-input .m-btn:hover {
    color: #fff;
    box-shadow: 0 14px 20px 0 rgba(37,17,124,0.16);
}

/* 确保ml-20类在这个上下文中不生效 */
.documentation__search-input .ml-20 {
    margin-left: 0 !important;
}

.documentation__search-input .js_search_btn {
    /* 继承m-btn的所有样式 */
}

/* 搜索按钮加载状态 */
.m-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.m-btn .fa-spinner {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* 简化搜索结果下拉框样式 */
.documentation__search-input .search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid #e9ecef;
    border-top: none;
    display: none;
}

/* 筛选器区域优化 */
.product__sidebar-widget {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
    border: 1px solid rgba(95, 58, 252, 0.1);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(95, 58, 252, 0.08);
    transition: all 0.3s ease;
}

.product__sidebar-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(95, 58, 252, 0.12);
}

.sidebar__widget {
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(95, 58, 252, 0.05);
}

.sidebar__widget-title {
    color: #1a152e;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 8px;
}

.sidebar__widget-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #5f3afc, #764ba2);
    border-radius: 2px;
}

.sidebar__widget-title.collapsed:after {
    width: 20px;
    background: #ccc;
}

.sidebar__widget-title i {
    color: #5f3afc;
    margin-right: 8px;
}

/* 筛选器样式优化 - 解决手机模式换行问题 */
.sidebar__check-wrapper ul {
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.sidebar__check-wrapper ul li {
    margin-bottom: 8px;
    flex: 0 0 auto; /* 防止不必要的拉伸 */
}

.sidebar__check-wrapper ul li a {
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
    border: 2px solid transparent;
    white-space: nowrap; /* 防止文字换行 */
    min-width: auto;
}

.sidebar__check-wrapper ul li a:hover {
    background: rgba(95, 58, 252, 0.05);
    border-color: rgba(95, 58, 252, 0.1);
    transform: translateX(3px);
}

.checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #ddd;
    background: white;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0; /* 防止复选框收缩 */
}

.checkbox.checked {
    background: linear-gradient(135deg, #5f3afc, #764ba2);
    border-color: #5f3afc;
}

.checkbox.checked:after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.m-check-label {
    font-weight: 500;
    color: #555;
    transition: color 0.3s ease;
    white-space: nowrap; /* 防止标签文字换行 */
}

.sidebar__check:hover .m-check-label {
    color: #5f3afc;
}

/* 游戏卡片优化 */
.product__item {
    border-radius: 15px;
    overflow: hidden;
    background: white;
    border: 1px solid rgba(95, 58, 252, 0.08);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
}

.product__item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.product__item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(95, 58, 252, 0.15);
    border-color: rgba(95, 58, 252, 0.2);
}

.product__thumb-inner {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.responsive-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.responsive-img.lazy {
    filter: blur(5px);
    opacity: 0.3;
}

.product__item:hover .responsive-img {
    transform: scale(1.1);
    filter: brightness(1.1) saturate(1.2);
}

/* 游戏标签和价格标签优化 */
.game-price, .game-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 3px 10px rgba(238, 90, 36, 0.3);
    z-index: 2;
}

.game-label {
    background: linear-gradient(135deg, #5f3afc, #764ba2);
    top: 10px;
    left: 10px;
    right: auto;
    box-shadow: 0 3px 10px rgba(95, 58, 252, 0.3);
}

/* 平台标签优化 */
.badge-span {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px;
    background: #5f3afc;
    color: white;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 评分显示优化 */
.product__price span {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    font-size: 16px;
}

/* 标题和描述优化 */
.product__title {
    color: #1a152e;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.product__title:hover {
    color: #5f3afc;
}

.product_vice {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.product__item:hover .product_vice {
    opacity: 1;
}

/* 匹配uk-pagination uk-flex-center类名 */
.basic-pagination .uk-pagination {
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.basic-pagination .uk-pagination li {
    margin: 0 3px;
}

/* 分页链接样式 */
.basic-pagination .uk-pagination li a {
    border: 2px solid #e9ecef;
    color: #495057;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

/* 分页span样式（用于当前页） */
.basic-pagination .uk-pagination li span {
    border: 2px solid #e9ecef;
    color: #495057;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

/* 悬浮状态 */
.basic-pagination .uk-pagination li a:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 活动状态 - uk-active类 */
.basic-pagination .uk-pagination li.uk-active span {
    background: #5f3afc;
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 兼容旧的CSS选择器 */
.basic-pagination ul {
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.basic-pagination ul li {
    margin: 0 3px;
}

    .basic-pagination ul li a:hover {
        background: #5f3afc;
        border-color: white;
        color: white;
        transform: translateY(-2px);
    }

    .basic-pagination ul li.active a,
    .basic-pagination ul li a.active {
        background: #5f3afc;
        border-color: transparent;
        color: white;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }

.basic-pagination ul li:first-child a,
.basic-pagination ul li:last-child a {
    border-radius: 8px;
}

/* 页面标题优化 */
.sidebar__widget-title.main-title {
    font-size: 28px;
    color: #1a152e;
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    padding: 20px 0;
}

.sidebar__widget-title.main-title:after {
    width: 80px;
    height: 4px;
    left: 50%;
    transform: translateX(-50%);
}

.page-subtitle {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    font-style: italic;
}

/* 返回顶部按钮 */
.back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #5f3afc, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(95, 58, 252, 0.3);
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(95, 58, 252, 0.4);
}

/* 搜索框快捷键提示 */
.search-shortcut-hint {
    position: absolute;
    right: 120px; /* 调整位置，为按钮留出空间 */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: #6c757d;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.documentation__search-input .flex-grow-1:focus + .search-shortcut-hint {
    opacity: 0;
}

/* 搜索框输入状态增强 */
.documentation__search-input.input-focused {
    box-shadow: 0 8px 30px rgba(95, 58, 252, 0.2);
}

.documentation__search-input.input-focused::after {
    width: 100%;
}

/* 搜索按钮加载状态 */
.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.search-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式优化 - 重点修复手机模式 */
@media (max-width: 768px) {
    .documentation__search {
        padding: 20px 10px;
        margin-bottom: 40px;
    }
    
    .documentation__search-inner {
        padding: 15px;
    }
    
    /* 手机模式下的搜索框优化 */
    .documentation__search-input .input-group {
        flex-wrap: nowrap !important;
        width: 100%;
    }
    
    .documentation__search-input .flex-grow-1 {
        padding: 12px 15px;
        font-size: 14px;
        height: 50px;
        min-width: 0;
        flex: 1;
    }
    
    .documentation__search-input .m-btn {
        height: 50px;
        line-height: 1;
        padding: 0 20px; /* 减少内边距 */
        font-size: 14px;
        margin: 0 !important; /* 强制移除边距 */
        flex-shrink: 0;
        white-space: nowrap;
        min-width: auto;
    }
    
    .search-shortcut-hint {
        right: 80px; /* 在手机模式下调整位置 */
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .product__sidebar-widget {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .sidebar__widget {
        padding: 15px;
    }
    
    /* 手机模式下筛选器优化 */
    .sidebar__check-wrapper ul {
        gap: 6px; /* 减少间距 */
        justify-content: flex-start; /* 左对齐 */
    }
    
    .sidebar__check-wrapper ul li {
        margin-bottom: 6px;
        flex: 0 0 auto;
    }
    
    .sidebar__check-wrapper ul li a {
        padding: 6px 12px; /* 减少内边距 */
        font-size: 14px;
        min-width: auto;
        white-space: nowrap;
    }
    
    .product__item {
        margin-bottom: 20px;
    }
    
    .sidebar__widget-title.main-title {
        font-size: 24px;
    }
    
    .sidebar__widget-title {
        cursor: pointer;
        user-select: none;
    }
    
    .sidebar__widget-title:before {
        content: '▼';
        font-size: 12px;
        margin-right: 8px;
        transition: transform 0.3s ease;
    }
    
    .sidebar__widget-title.collapsed:before {
        transform: rotate(-90deg);
    }
}

@media (max-width: 576px) {
    .documentation__search {
        padding: 15px 5px;
        margin-bottom: 30px;
    }
    
    .documentation__search-inner {
        padding: 12px;
    }
    
    /* 小屏幕手机的特殊优化 */
    .documentation__search-input .input-group {
        min-height: 46px;
    }
    
    .documentation__search-input .flex-grow-1 {
        padding: 10px 12px;
        font-size: 14px;
        height: 46px;
    }
    
    .documentation__search-input .m-btn {
        height: 46px;
        line-height: 1;
        padding: 0 16px; /* 进一步减少内边距 */
        font-size: 13px;
        margin: 0 !important;
    }
    
    .search-shortcut-hint {
        display: none !important; /* 在小屏幕上完全隐藏 */
    }
    
    /* 小屏幕下筛选器进一步优化 */
    .sidebar__check-wrapper ul {
        gap: 4px; /* 进一步减少间距 */
        flex-direction: row; /* 保持水平排列而不是列 */
        flex-wrap: wrap; /* 允许换行但紧凑排列 */
        align-items: flex-start;
    }
    
    .sidebar__check-wrapper ul li {
        margin-bottom: 4px;
        flex: 0 0 auto;
    }
    
    .sidebar__check-wrapper ul li a {
        padding: 4px 8px; /* 更小的内边距 */
        font-size: 13px;
        border-radius: 6px;
    }
    
    .checkbox {
        width: 16px;
        height: 16px;
    }
    
    .m-check-label {
        font-size: 13px;
    }
    
    .product__thumb-inner {
        height: 150px;
    }
    
    .back-to-top-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
        bottom: 15px;
        right: 15px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
    .documentation__search-input .m-btn {
        padding: 0 12px;
        font-size: 12px;
    }
    
    .documentation__search-input .flex-grow-1 {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    /* 超小屏幕下筛选器最小化样式 */
    .sidebar__check-wrapper ul {
        gap: 3px;
    }
    
    .sidebar__check-wrapper ul li a {
        padding: 3px 6px;
        font-size: 12px;
    }
    
    .checkbox {
        width: 14px;
        height: 14px;
    }
    
    .m-check-label {
        font-size: 12px;
    }
}

/* 横屏模式优化（针对手机横屏） */
@media (max-width: 812px) and (orientation: landscape) {
    .sidebar__check-wrapper ul {
        flex-wrap: wrap;
        max-height: 200px; /* 限制高度防止过长 */
        overflow-y: auto;
    }
    
    .sidebar__check-wrapper ul li a {
        padding: 4px 10px;
        font-size: 13px;
    }
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product__item {
    animation: fadeInUp 0.6s ease forwards;
}

.product__item:nth-child(1) { animation-delay: 0.1s; }
.product__item:nth-child(2) { animation-delay: 0.2s; }
.product__item:nth-child(3) { animation-delay: 0.3s; }
.product__item:nth-child(4) { animation-delay: 0.4s; }

/* 滚动条优化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #5f3afc, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4c2ad1, #5a3c8a);
}

/* 悬浮效果增强 */
.product__item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(95, 58, 252, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 15px;
    z-index: 1;
}

.product__item:hover::before {
    opacity: 1;
}

.product__content {
    position: relative;
    z-index: 2;
}

/* 筛选器标签样式 */
.filter-active {
    color: #5f3afc !important;
    border-color: #5f3afc !important;
    transform: translateX(5px) !important;
    font-weight: 600 !important;
}

.filter-active .checkbox {
    background: linear-gradient(135deg, #5f3afc, #764ba2) !important;
    border-color: #5f3afc !important;
}

.filter-active .checkbox:after {
    color: white !important;
}

.filter-active .m-check-label {
    color: #5f3afc !important;
    font-weight: 600 !important;
}

/* 搜索框placeholder动画 */
.documentation__search-input .flex-grow-1::placeholder {
    transition: color 0.3s ease;
}

.documentation__search-input .flex-grow-1:focus::placeholder {
    color: transparent;
}

/* 搜索框背景动画增强 */
.documentation__search::before {
    animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* 搜索框输入时的实时反馈 */
.documentation__search-input .flex-grow-1:not(:placeholder-shown) {
    border-color: #5f3afc;
    box-shadow: 0 0 0 2px rgba(95, 58, 252, 0.1);
}

/* 搜索按钮悬浮时的粒子效果模拟 */
.documentation__search-input .m-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.documentation__search-input .m-btn:hover::before {
    opacity: 1;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .documentation__search-input .flex-grow-1 {
        border-width: 3px;
    }
    
    .documentation__search-input .m-btn {
        border-width: 3px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .documentation__search,
    .documentation__search-input,
    .m-btn,
    .flex-grow-1 {
        transition: none !important;
        animation: none !important;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .documentation__search-inner {
        background: rgba(45, 45, 45, 0.95);
        color: #f8f9fa;
    }
    
    .documentation__search-input .flex-grow-1 {
        background: #3a3a3a;
        border-color: #4a4a4a;
        color: #f8f9fa;
    }
    
    .documentation__search-input .flex-grow-1:focus {
        border-color: #5f3afc;
    }
    
    .documentation__search-input .flex-grow-1::placeholder {
        color: #adb5bd;
    }
}