/*
Theme Name: Astra Child
Template: astra
Version: 2.5.0
*/

/* --- 1. 灵石余额卡片 --- */
.sn-balance-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 20px; margin: 20px 0 30px; display: flex;
    justify-content: space-between; align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); max-width: 1100px;
}
.sn-balance-main { display: flex; align-items: center; gap: 15px; }
.sn-balance-icon { background: #fffbeb; color: #d97706; padding: 10px; border-radius: 10px; line-height: 1; }
.sn-balance-main .dashicons { font-size: 28px; width: 28px; height: 28px; }
.sn-balance-label { display: block; font-size: 11px; color: #94a3b8; text-transform: uppercase; font-weight: 600; }
.sn-balance-value { font-size: 22px; font-weight: 800; color: #1e293b; }
.sn-balance-btn { background: #ff4757; color: #fff !important; padding: 8px 18px; border-radius: 20px; font-weight: 700; font-size: 13px; text-decoration: none !important; transition: 0.2s; }

/* --- 统一网格系统 (修改为电脑端固定 6 列) --- */
.sn-shelf-grid {
    display: grid;
    /* 核心修改：强制分为 6 列等宽 (1fr = 1份) */
    grid-template-columns: repeat(6, 1fr);
    gap: 25px 15px; /* 稍微缩小一点列间距，防止 6 本书太拥挤 */
    margin: 20px 0;
    justify-content: start;
}

/* --- 为了防止平板和手机上 6 列挤成一条线，增加不同屏幕的适配 --- */
@media (max-width: 1024px) {
    /* 屏幕中等时，一行 4 本 */
    .sn-shelf-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    /* 平板竖屏时，一行 3 本 */
    .sn-shelf-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    /* 手机端保持一行 2 本 */
    .sn-shelf-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
/* --- 3. 封面 2:3 比例控制 --- */
.sn-cover-wrap {
    position: relative; display: block; width: 100%; padding-top: 150%; 
    background: #f1f5f9; border-radius: 10px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.sn-cover-wrap img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; /* 核心：裁剪填充，不变形 */
}

/* --- 4. 文字信息 --- */
.sn-info { padding: 10px 0; }
.sn-title { font-size: 14px; font-weight: 700; margin: 0 0 5px; line-height: 1.3; color: #333; }
.sn-title a { color: inherit; text-decoration: none !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.sn-meta, .sn-last-read { font-size: 11px; color: #94a3b8; }
.sn-last-read a { color: #e67e22 !important; font-weight: 600; text-decoration: none !important; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- 5. 交互样式 --- */
.sn-remove-btn { background: #f1f5f9; border: none; color: #64748b; font-size: 10px; padding: 3px 10px; border-radius: 10px; margin-top: 8px; cursor: pointer; }
.sn-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; }
.sn-book-card { 
    display: flex; 
    flex-direction: column; 
    transition: 0.2s; 
    position: relative; 
    /* 👇 就是下面这行关键代码，防止长标题撑爆网格！ */
    min-width: 0; 
}
.sn-overlay .dashicons { color: #fff; font-size: 40px; width: 40px; height: 40px; }

.sn-empty { padding: 40px; text-align: center; color: #94a3b8; background: #f8fafc; border-radius: 12px; grid-column: 1/-1; border: 1px dashed #e2e8f0; }

/* 手机端 2 列 */
@media (max-width: 480px) {
    .sn-shelf-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}

/* ====================================================
   阅读页布局：正文占满同宽，目录框飘在容器外部
   ==================================================== */

.sn-reading-layout {
    display: block; /* 核心修改1：取消 flex，让正文彻底释放自由 */
    position: relative; /* 为外部悬浮框提供坐标原点 */
    width: 100%;
    margin-top: 20px;
}

.sn-reading-main {
    width: 100%; /* 核心修改2：正文占满 100%，现在它和顶部看板一样宽了！ */
}

/* 侧边栏的隐形轨道 (被扔到了正文右侧外面) */
.sn-reading-sidebar {
    position: absolute; 
    top: 0;
    left: calc(100% + 60px); /* 核心魔法：向右平移 100%（跳出正文），再空出 40px 间距 */
    width: 300px; 
    height: 100%; /* 轨道必须是 100% 高度，让内部的电梯能滑到底 */
    pointer-events: none; /* 防止隐形轨道挡住其他东西的点击 */
}

/* 真正可见并跟着滑动的目录框 (电梯本体) */
.sn-reading-sidebar-inner {
    position: -webkit-sticky;
    position: sticky;
    top: 80px; 
    pointer-events: auto; /* 恢复框内按钮的点击功能 */
    
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* 侧边栏内部文字样式 (保持不变) */
.sn-sidebar-title { margin-top: 0; margin-bottom: 15px; font-size: 18px; font-weight: 700; color: #2c3e50; border-bottom: 2px solid #ff4757; padding-bottom: 10px; display: inline-block; }
.sn-sidebar-list { list-style: none; padding: 0; margin: 0; }
.sn-sidebar-list li { margin-bottom: 8px; }
.sn-sidebar-list li a { color: #64748b; text-decoration: none !important; font-size: 14px; display: block; padding: 8px 10px; border-radius: 6px; transition: 0.2s; line-height: 1.4; }
.sn-sidebar-list li a:hover { background: #e2e8f0; color: #1e293b; }
.sn-sidebar-list li.current-chapter a { background: #ff4757; color: #fff !important; font-weight: bold; box-shadow: 0 4px 10px rgba(255, 71, 87, 0.3); }

/* ====================================================
   智能隐藏策略：当屏幕不够宽时，自动隐藏外部目录
   ==================================================== */
@media (max-width: 1400px) {
    /* 既然框在外面，就需要很宽的屏幕。如果屏幕小于 1400px，外面的框就会撑出横向滚动条，所以我们直接隐藏它 */
    .sn-reading-sidebar {
        display: none !important; 
    }
}

/* ====================================================
   👇 本次修改的部分：手机和平板彻底隐藏侧边栏目录
   ==================================================== */
@media (max-width: 992px) {
    .sn-reading-layout {
        display: block; /* 取消弹性布局，恢复常规块级显示 */
    }
    .sn-reading-sidebar {
        display: none !important; /* 核心修改：手机端直接隐藏它 */
    }
}

/* --- 修复文章页/分类页顶部小说看板布局 --- */

/* 1. 让图片和信息栏横向并排 */
.novel-header-inner {
    display: flex;
    gap: 30px;
    align-items: flex-start; /* 顶部对齐 */
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

/* 2. 核心修复：强制限制封面容器的宽度 */
.novel-cover-box {
    width: 240px; /* 设定一个固定宽度 */
    flex-shrink: 0; /* 防止被挤压 */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    aspect-ratio: 2 / 3; /* 强制保持小说封面比例 */
}

/* 3. 让图片乖乖适应容器大小 */
.novel-cover-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    margin: 0 !important; /* 清除可能存在的默认边距 */
}

/* 4. 右侧信息栏自适应与高度锁定 */
.novel-info-box {
    flex: 1; 
    min-width: 0; 
    height: 360px; /* 核心：高度死死锁定，与左侧图片完全一致 */
    display: flex;
    flex-direction: column;
}

.novel-title {
    margin-top: 0;
    font-size: 28px;
    line-height: 1.3;
    color: #2c3e50;
    flex-shrink: 0; /* 防止标题被挤压 */
}

.novel-actions {
    flex-shrink: 0; /* 防止按钮被挤压 */
}

/* 5. 简介区域内部滚动 */
.novel-synopsis {
    flex: 1; /* 占满底部剩余的所有空间 */
    overflow-y: auto; /* 核心：文字超出时自动出现滚动条 */
    padding-right: 15px; /* 给右边留点空隙，不挡住文字 */
    margin-top: 5px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 15px;
}

.novel-synopsis h3 {
    margin-top: 0;
    font-size: 16px;
    color: #64748b;
}

/* 美化简介的内嵌滚动条 */
.novel-synopsis::-webkit-scrollbar { width: 6px; }
.novel-synopsis::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.novel-synopsis::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 6. 手机端适配：变成垂直排列，释放高度 */
@media (max-width: 768px) {
    .novel-header-inner {
        flex-direction: column; /* 上下排列 */
        align-items: center; /* 居中对齐 */
        text-align: center;
        padding: 20px;
        gap: 20px;
    }

    .novel-cover-box {
        width: 180px; /* 手机上稍微小一点 */
        box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    }

    .novel-actions {
        justify-content: center; /* 按钮居中 */
    }

    .novel-title {
        font-size: 24px;
    }
    
    /* 手机端释放高度并取消内部滚动 */
    .novel-info-box {
        height: auto; 
    }
    .novel-synopsis {
        overflow-y: visible; 
        padding-right: 0;
    }
}
/* ====================================================
   👇 本次修改的部分：隐藏错误导航，美化智能翻页按钮
   ==================================================== */

/* 1. 隐藏 Astra 自带的错误字母排序导航 */
.ast-single-post-navigation, .post-navigation {
    display: none !important;
}

/* 2. 美化我们自己生成的智能翻页按钮 */
.sn-chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 25px;
    border-top: 2px dashed #e2e8f0;
    gap: 15px;
}

.sn-chapter-nav a {
    display: inline-flex;
    align-items: center;
    padding: 12px 25px;
    background: #f8fafc;
    color: #475569;
    text-decoration: none !important;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    transition: 0.3s;
    border: 1px solid #e2e8f0;
    max-width: 48%; /* 防止标题过长撑破排版 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sn-chapter-nav a:hover {
    background: #ff4757;
    color: #fff !important;
    border-color: #ff4757;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.2);
}

/* 如果是第一章（只有下一章按钮时），让它靠右侧对齐 */
.sn-nav-next:first-child {
    margin-left: auto;
}

/* 手机端适配：按钮上下排列以显示完整标题 */
@media (max-width: 768px) {
    .sn-chapter-nav {
        flex-direction: column;
    }
    .sn-chapter-nav a {
        max-width: 100%;
        justify-content: center;
    }
}
/* ====================================================
   终极统一看板样式 (强制文章页与目录页100%一致)
   ==================================================== */

/* 1. 隐藏 Astra 主题自带的默认分类标题和描述，只留我们的精美看板 */
.ast-archive-description {
    display: none !important;
}

/* 2. 统一外层边距 */
.sn-unified-header {
    margin-bottom: 30px !important;
    width: 100%;
}

/* 3. 强制右侧信息栏排版绝对一致 */
.sn-unified-header .novel-info-box {
    height: 360px !important; /* 强制高度 360px，和图片一模一样高 */
    display: flex;
    flex-direction: column;
}

/* 4. 强制标题字体在所有页面完全一样大 */
.sn-unified-header .novel-title {
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
}
.sn-unified-header .novel-title a {
    font-size: 28px !important;
    line-height: 1.3 !important;
    color: #2c3e50 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

/* 5. 强制按钮区域一致 */
.sn-unified-header .novel-actions {
    margin: 0 0 15px 0 !important;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* 6. 统一章节标签的 UI */
.sn-unified-header .sn-chapter-tag {
    background: #e1f5fe !important;
    color: #0288d1 !important;
    padding: 10px 18px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-shadow: 0 2px 5px rgba(2,136,209,0.1) !important;
    line-height: 1 !important;
}

/* 7. 目录页底部的章节列表分割线统一 */
.chapter-list-header {
    margin: 30px 0 15px !important;
    border-bottom: 2px solid #ff4757 !important;
    padding-bottom: 8px !important;
}
/* ====================================================
   🚀 Responsive App-Style Profile UI (电脑/手机自适应版)
   ==================================================== */

/* 1. 外层包裹区与主容器 */
.sn-profile-wrapper {
    width: 100%;
    padding: 20px 15px;
    box-sizing: border-box;
    background: #f8fafc; /* 微弱的背景色，让白色卡片更凸显 */
}

.sn-profile-container {
    max-width: 1000px; /* 电脑端放宽到 1000px */
    margin: 0 auto;
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 2. 顶部头部区 (响应式 Flexbox) */
.sn-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
    gap: 20px;
}

.sn-avatar-wrap img.sn-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 4px solid #fff; /* 清爽的白边 */
}

.sn-header-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sn-user-name {
    margin: 0 0 8px 0;
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sn-user-balance {
    margin: 0 0 20px 0;
    font-size: 15px;
    color: #4b5563;
}
.sn-user-balance strong { color: #111827; }

.sn-header-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 充值按钮 */
.sn-btn-buy-points {
    display: inline-block;
    background: #4f46e5;
    color: #fff !important;
    text-decoration: none !important;
    padding: 12px 35px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: 0.3s;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}
.sn-btn-buy-points:hover { background: #4338ca; transform: translateY(-2px); }

/* 会员等级 */
.sn-user-tier {
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sn-tier-icon { background: #9ca3af; color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }

/* 电脑端 Header 排版覆写 */
@media (min-width: 768px) {
    .sn-profile-header {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        padding-bottom: 30px;
        border-bottom: 1px dashed #e2e8f0;
    }
    .sn-header-info {
        align-items: flex-start;
    }
    .sn-header-actions {
        flex-direction: row; /* 按钮和会员等级横向排列 */
    }
}

/* 3. 标签导航 (Tabs) */
.sn-profile-tabs {
    display: flex;
    justify-content: flex-start; /* 电脑端左对齐 */
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 30px;
    gap: 10px;
    overflow-x: auto; /* 防止小屏幕挤压 */
    scrollbar-width: none;
}
.sn-profile-tabs::-webkit-scrollbar { display: none; }

.sn-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: 0.2s;
}
.sn-tab-btn:hover { color: #475569; }

.sn-tab-btn.active {
    color: #111827;
}
/* 选中状态的动态底部边框 */
.sn-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #111827;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.sn-tab-btn.active::after {
    transform: scaleX(1);
}

.sn-badge { background: #ef4444; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 10px; position: relative; top: -2px; margin-left: 5px; }

/* 手机端 Tabs 排版覆写 */
@media (max-width: 480px) {
    .sn-profile-tabs { justify-content: space-between; gap: 0; }
    .sn-tab-btn { padding: 12px 10px; font-size: 14px; }
}

/* 4. 内容面板区 */
.sn-tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.sn-tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.sn-shelf-section { margin-bottom: 40px; }
.sn-shelf-title { font-size: 20px; font-weight: 800; color: #1e293b; margin: 0 0 20px 0; }
.sn-empty-msg { color: #94a3b8; font-style: italic; text-align: center; }

/* 5. 书籍网格与列表排版 */

/* 横向滑动容器 (收藏的书籍) */
.sn-book-row {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    scrollbar-width: none;
}
.sn-book-row::-webkit-scrollbar { display: none; }

.sn-book-item {
    flex: 0 0 120px; /* 默认手机端封面宽度 */
}
.sn-book-item-link { text-decoration: none; display: block; transition: transform 0.2s; }
.sn-book-item-link:hover { transform: translateY(-5px); }

img.sn-book-cover {
    width: 100%;
    aspect-ratio: 2/3; 
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: block;
}

/* 正在阅读网格 (Currently Reading) */
.sn-reading-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 手机端默认两列 */
    gap: 20px;
}

.sn-reading-item-link { text-decoration: none; color: inherit; display: block; transition: transform 0.2s; }
.sn-reading-item-link:hover { transform: translateY(-3px); }

.sn-reading-item { display: flex; flex-direction: column; }

/* 进度条 UI */
.sn-progress-info { margin-top: 10px; padding: 0 2px; }
.sn-progress-label { font-size: 12px; color: #475569; font-weight: 600; }
.sn-progress-pct { font-size: 12px; color: #111827; float: right; font-weight: 700; }
.sn-progress-bar { width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.sn-progress-fill { height: 100%; background: #4f46e5; border-radius: 3px; }

/* 电脑/平板端网格覆写 */
@media (min-width: 768px) {
    /* 平板端放大横向滑动的封面 */
    .sn-book-item { flex: 0 0 140px; }
    /* 正在阅读变成 4 列 */
    .sn-reading-grid { grid-template-columns: repeat(4, 1fr); gap: 25px; }
}

@media (min-width: 1024px) {
    /* 宽屏电脑端正在阅读变成 5 列 */
    .sn-reading-grid { grid-template-columns: repeat(5, 1fr); gap: 30px; }
    /* 宽屏横滑封面进一步放大 */
     .sn-book-item { flex: 0 0 160px; }
}
/* ====================================================
   头像区域交互优化 (可点击进入设置)
   ==================================================== */
.sn-avatar-wrap {
    position: relative;
    display: inline-block;
}
.sn-avatar-wrap a {
    display: block;
    text-decoration: none;
}
.sn-avatar-wrap img.sn-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 4px solid #fff; 
    transition: 0.3s ease;
}
/* 鼠标放上去时头像变暗 */
.sn-avatar-wrap a:hover img.sn-profile-avatar {
    filter: brightness(0.8);
}
/* 右下角的编辑小图标 */
.sn-avatar-edit-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #111827;
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 2px solid #fff;
    transition: 0.3s;
}
.sn-avatar-edit-icon .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}
/* 鼠标放上去时图标放大 */
.sn-avatar-wrap a:hover .sn-avatar-edit-icon {
    transform: scale(1.1);
    background: #4f46e5; /* 变成主色调蓝色 */
}
/* ====================================================
   新增按钮样式：兑换优惠券 & 设置入口
   ==================================================== */

/* 兑换优惠券按钮 (橙黄色，与充值的蓝色区分开) */
.sn-btn-redeem {
    display: inline-block;
    background: #f59e0b; 
    color: #fff !important;
    text-decoration: none !important;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: 0.3s;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}
.sn-btn-redeem:hover {
    background: #d97706;
    transform: translateY(-2px);
}

/* 右侧的设置按钮样式 */
.sn-tab-settings {
    text-decoration: none !important;
    margin-left: auto; /* 核心魔法：把它推到最右边，和前面的选项卡隔开 */
    color: #64748b !important;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sn-tab-settings:hover {
    color: #111827 !important;
}
/* ====================================================
   Patreon 月度领取按钮样式
   ==================================================== */
.sn-btn-claim {
    display: inline-block;
    background: #10b981; /* 翡翠绿 */
    color: #fff !important;
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}
.sn-btn-claim:hover {
    background: #059669;
    transform: translateY(-2px);
}
.sn-btn-claim:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
/* ====================================================
   YASR 星级评分插件排版修正 (小说目录页)
   ==================================================== */
.sn-yasr-stars {
    display: inline-flex;
    align-items: center;
    /* 强行消除 YASR 插件自带的冗余高度和外边距 */
    margin-top: -5px; 
}

/* 强制 YASR 内部的文字和星星同行显示并调整大小 */
.sn-yasr-stars .yasr-vv-container {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px;
}

/* 隐藏 YASR 可能输出的冗余换行符 */
.sn-yasr-stars br {
    display: none !important;
}

/* 评分提示文字 (例如: 4.5 out of 5) 颜色弱化，融入整体风格 */
.sn-yasr-stars .yasr-rater-stars {
    margin-bottom: 0 !important;
}
.sn-yasr-stars span[id^="yasr-text-rating"] {
    font-size: 13px !important;
    color: #64748b !important;
    font-weight: 500;
}
/* ====================================================
   WooCommerce 灵石商城深度定制 (充值中心风)
   ==================================================== */

/* 1. 强制隐藏无用元素: 难看的分类名、面包屑导航 */
.ast-woo-product-category, 
.product-categories,
.woocommerce-breadcrumb, 
.ast-woocommerce-container .woocommerce-breadcrumb { 
    display: none !important; 
}

/* 2. 完美的网格排版 (彻底解决巨大化，自动一行 4-5 个) */
.woocommerce ul.products {
    display: grid !important;
    /* 魔法代码：每个卡片最小 200px，空间够就自动排在一行 */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 25px !important;
    justify-content: center;
}
/* 清理 Woo 默认的浮动干扰 */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important; 
}

/* 3. 卡片大小严格限制与悬浮特效 */
.woocommerce ul.products li.product {
    width: 100% !important; /* 严格限制在自己的网格格子里，绝不越界 */
    margin: 0 !important; 
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 12px;
    padding-bottom: 20px !important; 
    background: #fff;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

/* 3.1 核心修复：锁死图片尺寸，绝不拉伸 (排除 Emoji 干扰) */
.woocommerce ul.products li.product img:not(.emoji) {
    width: 100% !important;
    height: 220px !important; 
    object-fit: cover !important; 
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    margin-bottom: 15px !important;
}

/* 强制把按钮里的 Emoji 闪电打回原形 */
.woocommerce ul.products li.product .button img.emoji {
    width: 1.2em !important;
    height: 1.2em !important;
    margin: 0 6px 0 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    display: inline-block !important;
}

/* 3.2 标题和价格居中 */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .price {
    text-align: center;
    margin: 5px 15px !important;
}
.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

/* 3.2 标题和价格居中，并利用 margin-bottom: auto 将按钮挤到底部 */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    text-align: center;
    margin: 5px 15px !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
}
.woocommerce ul.products li.product .price {
    text-align: center;
    margin: 10px 15px auto !important; /* 🌟核心：这里的 auto 会自动吸纳多余空间，防止按钮被拉伸 */
    color: #e67e22 !important;
    font-weight: 800 !important;
}

/* 4. 按钮容器全局控制 (死死锁住高度，禁止拉伸) */
.woocommerce ul.products li.product .button {
    display: flex !important; 
    align-items: center !important;
    justify-content: center !important;
    width: 90% !important;
    margin: 6px auto !important;
    border-radius: 30px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    transition: 0.3s;
    flex: 0 0 auto !important; /* 🌟核心：禁止 flex 弹性拉伸 */
    height: 42px !important;   /* 强制锁定按钮高度 */
    line-height: 1 !important;
}

/* 5. 弱化原生加入购物车按钮 (次要操作：边框描边风) */
.woocommerce ul.products li.product .add_to_cart_button {
    background: transparent !important;
    color: #4f46e5 !important;
    border: 2px solid #4f46e5 !important;
}
.woocommerce ul.products li.product .add_to_cart_button:hover {
    background: #e0e7ff !important;
}

/* 6. 强化 Buy Now 按钮 (主要操作：闪电充值土豪金渐变) */
.woocommerce ul.products li.product .sn-buy-now-btn {
    background: linear-gradient(135deg, #f1c40f, #f39c12) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4) !important;
    text-transform: uppercase;
    margin-bottom: 15px !important; /* 距离卡片底部的间距 */
}
.woocommerce ul.products li.product .sn-buy-now-btn:hover {
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6) !important;
    transform: translateY(-2px); /* 悬浮稍微上浮一点点，打击感更好 */
}