/**
 * Ripro主题UI美化增强样式
 * 包含：会员按钮动画、整体视觉优化、移动端适配
 */

/* ============================================
   1. 永久会员按钮动态闪烁效果
   ============================================ */

/* 高端金色闪烁动画 - 用于永久会员按钮 */
@keyframes vip-golden-shine {
    0% {
        background-position: -200% center;
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
    }
    50% {
        background-position: 200% center;
        box-shadow: 0 0 30px rgba(255, 193, 7, 0.8), 0 0 60px rgba(255, 193, 7, 0.4);
    }
    100% {
        background-position: -200% center;
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
    }
}

/* 脉冲呼吸效果 */
@keyframes vip-pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 25px rgba(255, 193, 7, 0.6), 0 0 40px rgba(255, 193, 7, 0.3);
    }
}

/* 渐变流光效果 */
@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 永久会员按钮样式 */
.btn-vip-permanent {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        #ffc107 0%,
        #ffdb58 25%,
        #ffd700 50%,
        #ffdb58 75%,
        #ffc107 100%
    );
    background-size: 200% auto;
    border: none;
    color: #212529 !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: 
        vip-golden-shine 3s ease-in-out infinite,
        vip-pulse-glow 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

.btn-vip-permanent::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shine-sweep 2s infinite;
}

@keyframes shine-sweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.btn-vip-permanent:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 193, 7, 0.8), 0 0 50px rgba(255, 193, 7, 0.4);
}

.btn-vip-permanent:active {
    transform: translateY(0) scale(0.98);
}

/* 按钮内图标动画 */
.btn-vip-permanent i {
    animation: icon-bounce 1.5s ease-in-out infinite;
}

@keyframes icon-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* ============================================
   2. VIP卡片整体美化
   ============================================ */

/* 价格卡片优化 */
.price-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.price-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* 永久会员卡片特殊样式 */
.price-card.vip-permanent {
    border: 2px solid #ffc107;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.15);
}

.price-card.vip-permanent:hover {
    box-shadow: 0 20px 40px rgba(255, 193, 7, 0.25);
}

/* 卡片头部优化 */
.price-header {
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.price-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.price-plan {
    font-size: 1.25rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
}

.price-sub {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 价格显示优化 */
.price-ammount {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1.5rem 0;
}

.price-card.vip-permanent .price-ammount {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 特权列表优化 */
.price-desc {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.price-desc li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: #4b5563;
    font-size: 0.9rem;
    position: relative;
    padding-left: 1.5rem;
}

.price-desc li:last-child {
    border-bottom: none;
}

.price-desc li::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: #10b981;
}

.price-card.vip-permanent .price-desc li::before {
    color: #f59e0b;
}

/* 卡片底部按钮区域 */
.price-footer {
    padding: 1.5rem;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.02));
}

/* ============================================
   3. 用户中心整体美化
   ============================================ */

/* 侧边栏菜单优化 */
.uc-menu-warp {
    list-style: none;
    padding: 0;
    margin: 0;
}

.uc-menu-warp li {
    margin: 0.25rem 0;
}

.uc-menu-warp li a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.uc-menu-warp li a:hover {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    color: #667eea;
    transform: translateX(4px);
}

.uc-menu-warp li.current-menu-item a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.uc-menu-warp li i {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* 用户信息卡片优化 */
.card .avatar-xl {
    position: relative;
}

.card .avatar-xl::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover .avatar-xl::after {
    opacity: 0.3;
}

/* 统计卡片美化 */
.card-body .row .col .card {
    border: none;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.card-body .row .col .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-info));
}

/* ============================================
   4. 表单和输入框优化
   ============================================ */

.form-control {
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: #fff;
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* 按钮通用优化 */
.btn {
    border-radius: 10px;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #fff;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
    color: #fff;
}

/* ============================================
   5. 移动端适配优化
   ============================================ */

@media (max-width: 991.98px) {
    /* 容器间距优化 */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 卡片间距 */
    .card {
        margin-bottom: 1rem;
    }
    
    /* VIP卡片网格 */
    .row-cols-md-3 > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* 价格卡片移动端 */
    .price-card {
        margin-bottom: 1rem;
    }
    
    .price-header {
        padding: 1.5rem 1rem;
    }
    
    .price-ammount {
        font-size: 2rem;
    }
    
    /* 菜单优化 */
    .uc-menu-warp {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .uc-menu-warp li {
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
        margin: 0;
    }
    
    .uc-menu-warp li a {
        justify-content: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .uc-menu-warp li i {
        margin-right: 0.5rem;
    }
    
    /* 用户信息卡片 */
    .card .d-flex.align-items-center {
        flex-direction: column;
        text-align: center;
    }
    
    .card .avatar-xl {
        margin-bottom: 1rem;
        margin-right: 0 !important;
    }
    
    /* 统计卡片 */
    .row-cols-2 > .col {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* 按钮触摸优化 */
    .btn {
        padding: 0.75rem 1.25rem;
        min-height: 44px;
    }
    
    /* 表单优化 */
    .form-control {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

@media (max-width: 575.98px) {
    /* 更小屏幕的菜单 */
    .uc-menu-warp li {
        min-width: 100%;
    }
    
    /* 统计卡片改为2列 */
    .row-cols-2 > .col {
        padding: 0.25rem;
    }
    
    .card-body .row .col .card {
        padding: 1rem 0.5rem;
    }
    
    .card-body .row .col h4 {
        font-size: 1.25rem;
    }
    
    /* 价格卡片 */
    .price-desc li {
        font-size: 0.8rem;
    }
    
    /* 永久会员按钮移动端 */
    .btn-vip-permanent {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }
}

/* ============================================
   6. 账号页面专项优化
   ============================================ */

/* 个人资料卡片 */
#user-profile .form-control {
    background: #fff;
    border: 2px solid #e5e7eb;
}

#user-profile .form-control:focus {
    border-color: #667eea;
}

/* 头像上传区域 */
#inputAvatarFile + label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#inputAvatarFile + label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

/* 账户绑定区域 */
#edit-email-form .btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

/* 快捷登录按钮 */
.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: #fff;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    transform: translateY(-2px);
}

/* 订单列表优化 */
.pay-vip-log .list-group-item {
    border: none;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.pay-vip-log .list-group-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

/* CDK兑换区域 */
.vip-cdk-body {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: none;
}

.vip-cdk-body .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* 会员到期提醒 */
.badge {
    font-weight: 600;
    padding: 0.5em 1em;
    border-radius: 20px;
}

/* 下载统计数字动画 */
@keyframes count-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card h4.fw-bold {
    animation: count-up 0.6s ease-out;
}

/* ============================================
   7. 滚动条美化
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a67d8 0%, #6b46c1 100%);
}

/* ============================================
   8. 加载动画
   ============================================ */

@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}


/* ============================================
   9. 页面滚动进度条
   ============================================ */

#ri-read-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #0d6efd 0%, #6610f2 60%, #d63384 100%);
    z-index: 10000;
    border-radius: 0 2px 2px 0;
    pointer-events: none;
    transition: width 0.08s linear;
    will-change: width;
}


/* ============================================
   10. 文章卡片骨架屏 + 图片淡入
   ============================================ */

/* LazyLoad 加载前的骨架屏效果 */
@keyframes ri-skeleton-flow {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.post-item .entry-media .media-img:not(.loaded) {
    background-color: var(--bs-secondary-bg, #e9ecef) !important;
    background-image: linear-gradient(
        90deg,
        transparent          0%,
        rgba(255,255,255,.5) 40%,
        rgba(255,255,255,.7) 50%,
        rgba(255,255,255,.5) 60%,
        transparent         100%
    ) !important;
    background-size: 200% 100% !important;
    animation: ri-skeleton-flow 1.4s ease-in-out infinite !important;
}

/* 深色模式骨架屏 */
[data-bs-theme="dark"] .post-item .entry-media .media-img:not(.loaded) {
    background-color: #1e2033 !important;
    background-image: linear-gradient(
        90deg,
        transparent           0%,
        rgba(255,255,255,.06) 40%,
        rgba(255,255,255,.12) 50%,
        rgba(255,255,255,.06) 60%,
        transparent          100%
    ) !important;
}

/* 图片加载完成后平滑淡入 */
@keyframes ri-img-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.post-item .entry-media .media-img.loaded {
    animation: ri-img-fadein 0.45s ease forwards !important;
}


/* ============================================
   11. 文章卡片视觉升级
   ============================================ */

/* Grid 卡片统一圈起、阴影、hover 升起 */
.post-item.item-grid {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: box-shadow .3s ease, transform .3s ease;
}
.post-item.item-grid:hover {
    box-shadow: 0 10px 36px rgba(0,0,0,.13);
    transform: translateY(-5px);
}
[data-bs-theme="dark"] .post-item.item-grid {
    box-shadow: 0 2px 10px rgba(0,0,0,.22);
}
[data-bs-theme="dark"] .post-item.item-grid:hover {
    box-shadow: 0 10px 36px rgba(0,0,0,.45);
}

/* List 卡片 hover */
.post-item.item-list {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    transition: box-shadow .28s ease, transform .28s ease;
}
.post-item.item-list:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.10);
    transform: translateX(3px);
}

/* 标题 hover 滚入式下划线 */
.post-item .entry-title a {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size .3s ease, color .2s ease;
    padding-bottom: 1px;
}
.post-item:hover .entry-title a {
    background-size: 100% 1px;
}

/* Meta 信息小标注优化 */
.post-item .entry-meta {
    font-size: .78rem;
    letter-spacing: .12px;
    opacity: .8;
    transition: opacity .25s ease;
}
.post-item:hover .entry-meta {
    opacity: 1;
}

/* 分类标签微弹 */
.entry-cat-dot .badge {
    font-size: .72rem;
    letter-spacing: .2px;
    border-radius: 20px;
    padding: .3em .78em;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), filter .2s ease;
}
.entry-cat-dot .badge:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
}


/* ============================================
   12. 全局排版优化
   ============================================ */

/* 页面整体字体平滑渲染 */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 内容区块每条链接平滑过渡 */
a {
    transition: color .18s ease;
}

/* 表单输入框高级感聚焦 */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(13,110,253,.18);
    border-color: #86b7fe;
    outline: none;
    transition: box-shadow .2s ease, border-color .2s ease;
}

/* 图片默认圆角 */
img {
    border-radius: 4px;
}

/* 模态对话框圆角升级 */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 24px 64px rgba(0,0,0,.18);
}

/* Alert 警告框升级 */
.alert {
    border-radius: 10px;
    border-left-width: 4px;
}

/* 页脚 小布局升级 */
.site-footer a {
    opacity: .8;
    transition: opacity .18s ease;
}
.site-footer a:hover {
    opacity: 1;
}


/* ============================================
   13. 移动端体验优化
   ============================================ */

@media (max-width: 767.98px) {
    /* 卡片移动端关闭 translate，仅保留阴影变化 */
    .post-item.item-grid:hover,
    .post-item.item-list:hover {
        transform: none;
    }
    /* 验证码按钞移动端展示 */
    .post-item .entry-title a {
        background-size: 0 1px !important;
    }
}

/* 触控设备禁用 hover 动效 */
@media (hover: none) {
    .post-item.item-grid:hover,
    .post-item.item-list:hover {
        transform: none;
        box-shadow: initial;
    }
}

/* ============================================
   14. 搜索框动态背景效果
   ============================================ */

/* 首页搜索框动态渐变背景 */
.home-search-box {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    animation: search-bg-gradient 8s ease infinite;
}

@keyframes search-bg-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 搜索框内部白色容器 */
.home-search-box .search-inner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    margin: 4px;
    padding: 1.5rem;
}

.home-search-box .form-control {
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.home-search-box .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: #fff;
}

/* 搜索按钮动态效果 */
.home-search-box .btn-primary,
.home-search-box button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.home-search-box .btn-primary:hover,
.home-search-box button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* 搜索框光效动画 */
.home-search-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: search-shine 6s linear infinite;
}

@keyframes search-shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}


/* VIP卡片发光边框 */
.price-card {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.price-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.price-card .price-header {
    position: relative;
    overflow: hidden;
}

.price-card .price-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: card-shine 4s infinite;
}

@keyframes card-shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* 文章卡片悬停上浮 */
.post-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* ============================================
   16. 移动端专属优化
   ============================================ */

@media (max-width: 768px) {
    /* 首页搜索框移动端动态背景 */
    .home-search-box {
        margin: 0.5rem;
        padding: 0;
        border-radius: 16px;
        overflow: hidden;
        position: relative;
    }
    
    /* 搜索背景层动态渐变 */
    .home-search-box .search-bg {
        background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe);
        background-size: 400% 400%;
        animation: mobile-search-gradient 15s ease infinite;
    }
    
    @keyframes mobile-search-gradient {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }
    
    /* 搜索框光效流动 */
    .home-search-box .search-bg::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent
        );
        animation: mobile-search-shine 4s linear infinite;
        z-index: 1;
    }
    
    @keyframes mobile-search-shine {
        0% { left: -100%; }
        100% { left: 100%; }
    }
    
    /* 搜索表单容器 */
    .home-search-box .search-warp {
        position: relative;
        z-index: 2;
        padding: 1.5rem 1rem;
    }
    
    /* 搜索标题动画 */
    .home-search-box .search-title {
        font-size: 1.25rem;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        animation: title-float 3s ease-in-out infinite;
    }
    
    @keyframes title-float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-5px); }
    }
    
    /* 搜索输入框（移动端首页搜索框外框） */
    .home-search-box .search-form {
        background: rgba(255, 255, 255, 0.12);
        border-radius: 60px;
        padding: 5px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.20);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.22);
    }
    
    .home-search-box .search-fields {
        border-radius: 50px;
        overflow: visible;          /* 不裁剪按钮 */
        background: rgba(255,255,255,0.96);
        border-color: transparent;
        box-shadow: none;
    }
    
    .home-search-box .search-fields input {
        flex: 1;
        font-size: 16px;
        height: 46px;
        line-height: 46px;
        border: none;
        background: transparent;
        padding: 0 1rem;
    }
    
    .home-search-box .search-fields input:focus {
        outline: none;
    }
    
    .home-search-box .search-fields button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: linear-gradient(135deg, #667eea, #a855f7);
        color: #fff;
        border-radius: 50px;
        margin: 2px 2px 2px 0;
        flex-shrink: 0;
        transition: all 0.3s ease;
    }
    
    .home-search-box .search-fields button:active {
        transform: scale(0.92);
    }
    
    /* 热词标签 */
    .home-search-box .search-hots {
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .home-search-box .search-hots span a {
        display: inline-block;
        background: rgba(255, 255, 255, 0.9);
        color: #667eea;
        padding: 0.25rem 0.75rem;
        border-radius: 20px;
        font-size: 0.75rem;
        transition: all 0.3s ease;
    }
    
    .home-search-box .search-hots span a:hover {
        background: #fff;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    /* VIP卡片 */
    .price-card {
        margin-bottom: 1rem;
    }
    
    .price-card .price-header {
        padding: 1rem;
    }
    
    .price-card .price-body {
        padding: 1rem;
    }
    
    /* 文章卡片 */
    .post-item {
        border-radius: 12px;
        margin-bottom: 0.75rem;
    }
    
    .post-item .entry-title {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    /* 用户中心卡片 */
    .user-center-card {
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    /* 徽章移动端优化 */
    .badge {
        font-size: 0.75rem;
        padding: 0.4em 0.8em;
    }
    
    /* 按钮触摸优化 */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }
    
    /* 导航栏移动端 */
    .navbar {
        padding: 0.5rem 0;
    }
    
    /* 页脚精简 */
    .site-footer {
        padding: 1.5rem 0;
        text-align: center;
    }
    
    .site-footer .footer-links {
        display: none;
    }
}

/* 移动端底部导航栏 */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 8px 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .mobile-bottom-nav .nav-item {
        flex: 1;
        text-align: center;
        padding: 8px 0;
    }
    
    .mobile-bottom-nav .nav-item i {
        font-size: 1.25rem;
        display: block;
        margin-bottom: 4px;
    }
    
    .mobile-bottom-nav .nav-item span {
        font-size: 0.7rem;
        color: #666;
    }
    
    .mobile-bottom-nav .nav-item.active i,
    .mobile-bottom-nav .nav-item.active span {
        color: var(--bs-primary, #0d6efd);
    }
    
    /* 为页面底部留出空间 */
    body {
        padding-bottom: 70px;
    }
}

/* ============================================
   17. 用户中心美化
   ============================================ */

/* 用户中心卡片 */
.user-center-card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.user-center-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 下载统计卡片 */
.user-center-card .card h4.fw-bold {
    font-size: 1.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 会员信息卡片 */
.vip-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 16px;
    overflow: hidden;
}

.vip-info-card .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}


/* ============================================
   18. 搜索框 & 按钮全面重构（美化版）
   ============================================ */

/* ---- 整体搜索表单包裹 ---- */
.search-form {
    width: 100%;
}

/* ---- form 标签本体：继承宽度，消除默认间距 ---- */
.search-form-inner {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* ---- 搜索字段容器：胶囊形、发光边框，flex 横排 ---- */
.search-fields {
    display: flex !important;
    align-items: center;
    background: #fff;
    border-radius: 50px;           /* 胶囊造型 */
    box-shadow: 0 4px 24px rgba(102,126,234,0.13), 0 1px 4px rgba(0,0,0,0.06);
    border: 1.5px solid rgba(102,126,234,0.18);
    /* 不设 overflow:hidden，防止按钮 hover 被裁 */
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    min-height: 52px;
}

.search-fields:focus-within {
    box-shadow: 0 6px 32px rgba(102,126,234,0.28), 0 0 0 3px rgba(102,126,234,0.12);
    border-color: #667eea;
}

/* ---- 输入框 ---- */
.search-fields input[type="text"],
.search-fields input[name="s"] {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 1.4rem;
    font-size: 0.97rem;
    color: #2d3748;
    min-width: 0;
    height: 52px;
    line-height: 52px;
    border-radius: 0;              /* flex 容器已控制整体圆角，无需单独设 */
    align-self: stretch;
}

.search-fields input[type="text"]::placeholder,
.search-fields input[name="s"]::placeholder {
    color: #b0bec5;
    font-size: 0.93rem;
    letter-spacing: 0.2px;
}

/* ---- 搜索按钮 - 胶囊右侧渐变球 ---- */
.search-fields .search-submit-btn,
.search-fields button[type="submit"] {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    margin: 3px 3px 3px 0;         /* 右侧内嵌效果 */
    border: none;
    border-radius: 50px;           /* 圆形按钮 */
    background: linear-gradient(135deg, #667eea 0%, #a855f7 100%);
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.28s ease, transform 0.22s cubic-bezier(0.34,1.56,0.64,1), background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 4px 14px rgba(102,126,234,0.40);
    z-index: 1;
}

.search-fields .search-submit-btn:hover,
.search-fields button[type="submit"]:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #9333ea 100%);
    box-shadow: 0 6px 22px rgba(102,126,234,0.55);
    transform: scale(1.10);
}

.search-fields .search-submit-btn:active,
.search-fields button[type="submit"]:active {
    transform: scale(0.93);
    box-shadow: 0 2px 8px rgba(102,126,234,0.30);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* ---- 按钮图标 ---- */
.search-btn-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}

.search-fields .search-submit-btn:hover .search-btn-icon {
    transform: scale(1.15) rotate(-10deg);
}

/* ---- 水波纹层 ---- */
.search-btn-ripple {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at center, rgba(255,255,255,0.40) 0%, transparent 65%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    z-index: 1;
}

.search-fields .search-submit-btn:active .search-btn-ripple {
    opacity: 1;
    transform: scale(2.2);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

/* ---- 扫光动画 ---- */
.search-fields .search-submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    animation: search-btn-shine 3.2s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes search-btn-shine {
    0%   { left: -80%; opacity: 0; }
    20%  { opacity: 1; }
    60%, 100% { left: 140%; opacity: 0; }
}

/* ---- 分类下拉框：在 search-fields flex 容器内，左侧竖向分隔 ---- */
.search-select {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 0 0 0.85rem;
    border-right: 1.5px solid rgba(102,126,234,0.15);
    height: 30px;
    margin: auto 0;
}

.search-select .form-select {
    border: none;
    border-radius: 0;
    background: transparent;
    color: #667eea;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0 1.6rem 0 0;
    cursor: pointer;
    height: 30px;
    line-height: 30px;
    outline: none;
    transition: color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23667eea'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.2rem center;
    background-size: 8px;
    min-width: 68px;
    max-width: 110px;
    box-shadow: none;
}

.search-select .form-select:focus {
    box-shadow: none;
    color: #5a67d8;
}

/* ---- 移动端：隐藏分类选择框 ---- */
@media (max-width: 767.98px) {
    .search-select {
        display: none !important;
    }
}


/* ============================================
   19. 搜索结果页 (archive-hero) 专项优化
   ============================================ */

/* 搜索页 hero 容器 */
.search-archive-hero {
    position: relative;
    overflow: hidden;
    min-height: 220px;
}

/* 搜索页动态渐变背景层 */
.search-archive-hero .archive-hero-bg {
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #1a1a2e, #0f0c29);
    background-size: 400% 400%;
    animation: search-page-gradient 14s ease infinite;
}

@keyframes search-page-gradient {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 半透明渐变覆盖层 */
.search-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(102,126,234,0.25) 0%,
        rgba(168,85,247,0.18) 50%,
        rgba(240,147,251,0.12) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* 粒子画布容器 */
.search-hero-particles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.search-hero-particles canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* 搜索页内容层级 */
.search-archive-hero .container {
    position: relative;
    z-index: 3;
}

/* 搜索结果标题 */
.search-archive-hero .archive-title {
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
    font-weight: 700;
    letter-spacing: 0.5px;
    animation: hero-title-fadein 0.6s ease both;
}

@keyframes hero-title-fadein {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 搜索结果描述 */
.search-archive-hero .archive-desc {
    color: rgba(255,255,255,0.80);
    text-shadow: 0 1px 8px rgba(0,0,0,0.25);
    animation: hero-title-fadein 0.6s 0.12s ease both;
}

/* 搜索页内嵌搜索框容器 */
.search-hero-form {
    animation: hero-title-fadein 0.6s 0.24s ease both;
    max-width: 580px;
    margin: 0 auto;
}

/* 玻璃拟态外框 */
.search-hero-form .search-form {
    background: rgba(255,255,255,0.10);
    border-radius: 60px;
    padding: 5px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 8px 36px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* hero 内部搜索字段：白色半透明 */
.search-hero-form .search-fields {
    background: rgba(255,255,255,0.90);
    border-radius: 50px;
    border-color: transparent;
    box-shadow: none;
}

.search-hero-form .search-fields:focus-within {
    box-shadow: 0 0 0 3px rgba(102,126,234,0.35);
    border-color: transparent;
}

/* hero 内下拉框 */
.search-hero-form .search-select .form-select {
    background-color: transparent;
    color: #5a67d8;
}

/* hero 深色背景下搜索选择框分隔线颜色调亮 */
.search-hero-form .search-select {
    border-right-color: rgba(90,103,216,0.25);
}


/* ============================================
   20. 首页搜索框 (home-search-box) 适配
   ============================================ */

/* 首页搜索字段背景 */
.home-search-box .search-fields {
    border-radius: 50px;
    background: rgba(255,255,255,0.96);
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* 首页搜索按钮 */
.home-search-box .search-fields .search-submit-btn,
.home-search-box .search-fields button[type="submit"] {
    width: 50px;
    height: 50px;
}


/* ============================================
   21. 移动端搜索体验专项
   ============================================ */

@media (max-width: 767.98px) {

    /* 搜索页 hero */
    .search-archive-hero {
        min-height: 170px;
    }

    .search-archive-hero .archive-title {
        font-size: 1.3rem;
    }

    /* hero 内嵌搜索框 */
    .search-hero-form {
        max-width: 100%;
        padding: 0 0.25rem;
    }

    .search-hero-form .search-form {
        border-radius: 50px;
        padding: 4px;
    }

    /* 移动端搜索字段高度 */
    .search-fields input[type="text"],
    .search-fields input[name="s"] {
        font-size: 16px;    /* 防止 iOS 放大 */
        padding: 0 1rem;
        height: 46px;
        line-height: 46px;
    }

    /* 移动端搜索按钮 */
    .search-fields .search-submit-btn,
    .search-fields button[type="submit"] {
        width: 44px;
        height: 44px;
        margin: 2px 2px 2px 0;
        font-size: 0.95rem;
    }

    /* 粒子动画透明度降低节省性能 */
    .search-hero-particles {
        opacity: 0.65;
    }
}

/* 超小屏 */
@media (max-width: 374px) {
    .search-fields input[type="text"],
    .search-fields input[name="s"] {
        padding: 0 0.75rem;
    }

    .search-fields .search-submit-btn,
    .search-fields button[type="submit"] {
        width: 40px;
        height: 40px;
    }
}

/* 深色模式适配 */
[data-bs-theme="dark"] .search-fields {
    background: #1e2033;
    border-color: rgba(102,126,234,0.22);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

[data-bs-theme="dark"] .search-fields input[type="text"],
[data-bs-theme="dark"] .search-fields input[name="s"] {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .search-fields input[type="text"]::placeholder,
[data-bs-theme="dark"] .search-fields input[name="s"]::placeholder {
    color: #64748b;
}

[data-bs-theme="dark"] .search-hero-form .search-fields {
    background: rgba(30,32,51,0.90);
}


/* ============================================
   22. 搜索按钮全局可见性兜底（防止主题任意场景下按钮被隐藏/遮挡）
   ============================================ */

/* 保证按钮在所有 search-fields 内强制可见 */
.search-fields .search-submit-btn,
.search-fields button[type="submit"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* 侧边栏 / widget 内的搜索框按钮 – 尺寸统一兜底 */
.widget .search-fields .search-submit-btn,
.widget .search-fields button[type="submit"],
.sidebar .search-fields .search-submit-btn,
.sidebar .search-fields button[type="submit"] {
    width: 46px;
    height: 46px;
    min-width: 46px;
    margin: 3px 3px 3px 0;
    background: linear-gradient(135deg, #667eea 0%, #a855f7 100%);
    color: #fff;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(102,126,234,0.35);
    cursor: pointer;
    flex-shrink: 0;
    transition: box-shadow 0.25s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

.widget .search-fields .search-submit-btn:hover,
.widget .search-fields button[type="submit"]:hover,
.sidebar .search-fields .search-submit-btn:hover,
.sidebar .search-fields button[type="submit"]:hover {
    box-shadow: 0 6px 20px rgba(102,126,234,0.50);
    transform: scale(1.08);
}

/* navbar / header 内嵌搜索框兜底 */
.site-header .search-fields .search-submit-btn,
.site-header .search-fields button[type="submit"],
.navbar .search-fields .search-submit-btn,
.navbar .search-fields button[type="submit"] {
    width: 44px;
    height: 44px;
    min-width: 44px;
    margin: 2px 2px 2px 0;
}

/* 深色模式下搜索按钮强制保持渐变色 */
[data-bs-theme="dark"] .search-fields .search-submit-btn,
[data-bs-theme="dark"] .search-fields button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #a855f7 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(102,126,234,0.45);
}

/* 搜索按钮图标（.search-btn-icon）强制可见 */
.search-btn-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: inherit;
    line-height: 1;
    pointer-events: none;
}

/* 首页搜索框放大镜图标 - 强制高可见度样式 */
.search-btn-icon i,
.search-btn-icon .fa-search,
.search-submit-btn i,
.search-submit-btn .fa-search,
.home-search-box .search-btn-icon i,
.home-search-box .fa-search,
.search-hero-form .search-btn-icon i,
.search-hero-form .fa-search,
.search-fields button i,
.search-fields button .fa-search {
    color: #fff !important;
    opacity: 1 !important;
    font-size: 1.25em !important;
    font-weight: 900 !important;
    text-shadow: 
        0 0 1px rgba(0,0,0,0.8),
        0 1px 2px rgba(0,0,0,0.6),
        0 0 8px rgba(255,255,255,0.4) !important;
    -webkit-text-stroke: 0.5px rgba(0,0,0,0.3);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

/* 深色模式下搜索图标保持高可见度 */
[data-bs-theme="dark"] .search-btn-icon i,
[data-bs-theme="dark"] .search-submit-btn i,
[data-bs-theme="dark"] .search-fields button i {
    color: #fff !important;
    text-shadow: 
        0 0 2px rgba(255,255,255,0.8),
        0 0 10px rgba(102,126,234,0.6) !important;
}


/* ============================================
   23. 320px 超窄屏幕溢出修复 & 全站弹窗移动保护
   ============================================ */

/* 320px 超窄屏容器防溢出 */
@media (max-width: 360px) {
    .container,
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .card-body {
        padding: .75rem !important;
    }
    .price-card {
        margin-bottom: 1rem;
    }
    /* 防止固定宽度组件溢出 */
    .price-ammount {
        font-size: 1.75rem !important;
    }
    .rihide-vip-gate {
        padding: .75rem !important;
    }
}

/* Bootstrap 模态框移动端保护 */
@media (max-width: 600px) {
    .modal-dialog {
        max-width: 90vw !important;
        margin: 5vh auto !important;
    }
    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }
    /* 表单控件最小触摸目标 */
    .modal-body .form-control,
    .modal-body .btn,
    .modal-footer .btn {
        min-height: 44px !important;
    }
    .modal-body .form-control {
        font-size: 16px !important; /* 防 iOS 自动缩放 */
    }
}
