/**
 * 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;
    }
}
