/* =========================================================
 * CSF Group List Page · 京东淘宝商品风
 * 主色：京东红 #e1251b  辅色：拼团橙 #ff6700
 * Version: 4.0.0
 * ========================================================= */

/* === 0. 变量 === */
.csf-jd-wrapper {
    --jd-red: #e1251b;
    --jd-red-dark: #c2170d;
    --jd-orange: #ff6700;
    --jd-orange-light: #ff8a3d;
    --jd-yellow: #ffd700;
    --jd-card-bg: #ffffff;
    --jd-text: #1a1a1a;
    --jd-text-2: #555;
    --jd-text-3: #999;
    --jd-border: #f0f0f0;
    --jd-shadow-sm: 0 2px 8px rgba(0,0,0,.05);
    --jd-shadow-hover: 0 12px 32px rgba(225,37,27,.15);
}

/* === 1. body 背景 === */
body.page-template-page-group-list,
body.page-template-page-group-list #page,
body.page-template-page-group-list .content-wrap,
body.page-template-page-group-list .content-layout {
    background: transparent !important;
}
body.page-template-page-group-list { background: #f5f5f5 !important; }

/* === 2. 容器 === */
.csf-jd-wrapper {
    position: relative;
    width: 100%;
    padding: 20px 0 80px;
    overflow: hidden;
}
.csf-jd-wrapper *,
.csf-jd-wrapper *::before,
.csf-jd-wrapper *::after { box-sizing: border-box; }
.csf-jd-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
    position: relative;
}

/* === 3. Hero Banner === */
.csf-jd-hero {
    position: relative;
    margin: 0 16px 16px;
    padding: 36px 0;
    background: linear-gradient(135deg, #e1251b 0%, #ff4d4f 50%, #ff6700 100%);
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(225,37,27,.20);
}
.csf-jd-hero-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(40px);
    opacity: .55;
    z-index: 0;
}
.csf-jd-hero-deco-1 { width: 280px; height: 280px; top: -80px; right: -60px; background: rgba(255,220,100,.55); }
.csf-jd-hero-deco-2 { width: 180px; height: 180px; bottom: -60px; left: 28%; background: rgba(255,130,80,.5); }
.csf-jd-hero-deco-3 { width: 220px; height: 220px; top: 30%; left: -80px; background: rgba(255,180,60,.42); }
.csf-jd-hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.csf-jd-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.32);
    padding: 5px 14px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    margin-bottom: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.csf-jd-hero-tag-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--jd-yellow);
    animation: csf-jd-pulse 1.4s ease-in-out infinite;
}
@keyframes csf-jd-pulse {
    0%,100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(255,215,0,.6); }
    50% { transform: scale(1.18); opacity: .85; box-shadow: 0 0 0 8px rgba(255,215,0,0); }
}
.csf-jd-hero-title {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.18;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.csf-jd-hero-sub {
    font-size: 15px;
    color: rgba(255,255,255,.88);
    margin: 0 0 18px;
    line-height: 1.5;
}

/* 倒计时 */
.csf-jd-countdown {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,.26);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
}
.csf-jd-cd-label { color: rgba(255,255,255,.85); margin-right: 6px; }
.csf-jd-cd-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: var(--jd-yellow);
    font-family: 'Courier New', monospace;
    font-weight: 800;
    border-radius: 6px;
    padding: 4px 8px;
    min-width: 28px;
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.csf-jd-cd-sep { color: #fff; font-weight: 800; font-size: 14px; }
.csf-jd-cd-flash { animation: csf-jd-cd-flash .9s ease-in-out infinite alternate; }
@keyframes csf-jd-cd-flash {
    from { color: var(--jd-yellow); }
    to { color: #fff; }
}

/* hero 右侧统计 */
.csf-jd-hero-right {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.csf-jd-hero-stat {
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 14px;
    padding: 14px 20px;
    min-width: 110px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform .3s;
}
.csf-jd-hero-stat:hover { transform: translateY(-3px); }
.csf-jd-hero-stat-num {
    display: block;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.csf-jd-hero-stat-num i { font-size: 14px; font-style: normal; margin-left: 2px; }
.csf-jd-hero-stat-lbl {
    display: block;
    color: rgba(255,255,255,.85);
    font-size: 12px;
    margin-top: 4px;
}

/* === 4. 快捷入口（兼任 Tab） === */
.csf-jd-quick { padding: 0 0 14px; }
.csf-jd-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.csf-jd-quick-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--jd-card-bg);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s;
    border: 1.5px solid var(--jd-border);
    box-shadow: var(--jd-shadow-sm);
    position: relative;
}
.csf-jd-quick-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(225,37,27,.10);
    border-color: rgba(225,37,27,.18);
}
/* Active 选中（取代原 Tab）：红橙边框 + 红色文字 + 选中标记 */
.csf-jd-wrapper .csf-jd-quick-item.active {
    border-color: var(--jd-red);
    background: linear-gradient(135deg, #fff5f5, #fff);
    box-shadow: 0 8px 20px rgba(225,37,27,.16);
}
.csf-jd-wrapper .csf-jd-quick-item.active::after {
    content: "";
    position: absolute;
    top: -1.5px; right: -1.5px;
    width: 28px; height: 28px;
    background:
        linear-gradient(225deg, var(--jd-red) 50%, transparent 50%);
    border-radius: 0 12px 0 0;
}
.csf-jd-wrapper .csf-jd-quick-item.active::before {
    content: "✓";
    position: absolute;
    top: 2px; right: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    z-index: 1;
}
.csf-jd-wrapper .csf-jd-quick-item.active .csf-jd-quick-text b { color: var(--jd-red); }
.csf-jd-wrapper .csf-jd-quick-item.active .csf-jd-quick-text em { color: var(--jd-orange); }

.csf-jd-quick-ico {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,.06);
}
.csf-jd-quick-ico-red { background: linear-gradient(135deg, #ff6b6b, #ee5a52); }
.csf-jd-quick-ico-orange { background: linear-gradient(135deg, #ffa751, #ff7e5f); }
.csf-jd-quick-ico-purple { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.csf-jd-quick-ico-green { background: linear-gradient(135deg, #84fab0, #8fd3f4); }
.csf-jd-quick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.csf-jd-quick-text b {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--jd-text);
    line-height: 1.3;
}
.csf-jd-quick-text em {
    font-style: normal;
    font-size: 12px;
    color: var(--jd-text-3);
    line-height: 1.3;
}
/* 数量徽章 */
.csf-jd-quick-cnt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(0,0,0,.08);
    color: var(--jd-text-3);
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
    transition: all .25s;
}
.csf-jd-wrapper .csf-jd-quick-item.active .csf-jd-quick-cnt {
    background: linear-gradient(135deg, var(--jd-red), var(--jd-orange));
    color: #fff;
    box-shadow: 0 2px 6px rgba(225,37,27,.32);
}

/* === 5. 筛选行（左排序 + 右搜索） === */
.csf-jd-filter { padding: 0 0 12px; }
.csf-jd-filter-card {
    background: var(--jd-card-bg);
    border-radius: 12px;
    border: 1px solid var(--jd-border);
    padding: 12px 16px;
    box-shadow: var(--jd-shadow-sm);
}
.csf-jd-search-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* 搜索 */
.csf-jd-wrapper .csf-jd-search {
    position: relative;
    flex-shrink: 0;
    width: 320px;
    max-width: 100%;
    margin-left: auto;
}
.csf-jd-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--jd-text-3);
    pointer-events: none;
    z-index: 1;
}
.csf-jd-wrapper .csf-jd-search input {
    width: 100%;
    height: 36px;
    padding: 0 70px 0 34px;
    background: #f7f7f7;
    border: 1.5px solid transparent;
    border-radius: 999px;
    color: var(--jd-text);
    font-size: 13px;
    outline: none;
    transition: all .25s;
}
.csf-jd-wrapper .csf-jd-search input::placeholder { color: var(--jd-text-3); }
.csf-jd-wrapper .csf-jd-search input:focus {
    background: #fff;
    border-color: var(--jd-red);
    box-shadow: 0 0 0 3px rgba(225,37,27,.12);
}
.csf-jd-wrapper .csf-jd-search button {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, var(--jd-red), var(--jd-orange));
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s;
}
.csf-jd-wrapper .csf-jd-search button:hover {
    box-shadow: 0 4px 12px rgba(225,37,27,.28);
    transform: scale(1.02);
}

/* 排序（搜索行左侧） */
.csf-jd-sort-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.csf-jd-sort-label {
    font-size: 12px;
    color: var(--jd-text-3);
    margin-right: 4px;
}
.csf-jd-wrapper .csf-gl-sort-link.csf-jd-sort {
    font-size: 13px;
    color: var(--jd-text-2);
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all .25s;
    cursor: pointer;
    font-weight: 500;
}
.csf-jd-wrapper .csf-gl-sort-link.csf-jd-sort:hover { color: var(--jd-red); }
.csf-jd-wrapper .csf-gl-sort-link.csf-jd-sort.active {
    color: var(--jd-red);
    border-bottom-color: var(--jd-red);
    font-weight: 700;
}

/* === 6. 区域标题 === */
.csf-jd-section-header { padding: 16px 0 8px; }
.csf-jd-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.csf-jd-section-bar {
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--jd-red), var(--jd-orange));
    border-radius: 2px;
}
.csf-jd-wrapper .csf-gl-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--jd-text);
    margin: 0;
}

/* === 7. 商品网格 === */
.csf-jd-grid-wrap { padding-top: 4px; }
.csf-jd-wrapper .csf-jd-product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* === 8. 商品卡 === */
.csf-jd-wrapper .csf-jd-card {
    display: flex;
    flex-direction: column;
    background: var(--jd-card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--jd-shadow-sm);
    border: 1px solid var(--jd-border);
    transition: all .3s cubic-bezier(.4,0,.2,1);
    text-align: left;
    position: relative;
    animation: csf-jd-card-in .45s ease backwards;
}
.csf-jd-wrapper .csf-jd-card:nth-child(1) { animation-delay: .04s; }
.csf-jd-wrapper .csf-jd-card:nth-child(2) { animation-delay: .08s; }
.csf-jd-wrapper .csf-jd-card:nth-child(3) { animation-delay: .12s; }
.csf-jd-wrapper .csf-jd-card:nth-child(4) { animation-delay: .16s; }
.csf-jd-wrapper .csf-jd-card:nth-child(5) { animation-delay: .20s; }
.csf-jd-wrapper .csf-jd-card:nth-child(6) { animation-delay: .24s; }
.csf-jd-wrapper .csf-jd-card:nth-child(7) { animation-delay: .28s; }
.csf-jd-wrapper .csf-jd-card:nth-child(8) { animation-delay: .32s; }
@keyframes csf-jd-card-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.csf-jd-wrapper .csf-jd-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--jd-shadow-hover);
    border-color: rgba(225,37,27,.22);
}

/* 卡片图（正方形） */
.csf-jd-wrapper .csf-jd-card-img {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f5f5f5;
}
.csf-jd-wrapper .csf-jd-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}
.csf-jd-wrapper .csf-jd-card:hover .csf-jd-card-img img { transform: scale(1.06); }

/* 拼团徽章（左上） */
.csf-jd-badge-pintuan {
    position: absolute;
    top: 8px; left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: linear-gradient(135deg, var(--jd-red), var(--jd-orange));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(225,37,27,.36);
    z-index: 2;
}
.csf-jd-badge-pintuan-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #ffeb3b;
    animation: csf-jd-pulse-dot 1.2s ease-in-out infinite;
}
@keyframes csf-jd-pulse-dot {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: .55; transform: scale(.65); }
}
.csf-jd-badge-newgroup {
    position: absolute;
    top: 8px; left: 8px;
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,184,148,.32);
    z-index: 2;
}

/* 折扣徽章（右上） */
.csf-jd-badge-discount {
    position: absolute;
    top: 8px; right: 8px;
    display: inline-flex;
    align-items: baseline;
    background: var(--jd-yellow);
    color: var(--jd-red);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 800;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255,215,0,.5);
}
.csf-jd-badge-discount em { font-style: normal; font-size: 16px; line-height: 1; }
.csf-jd-badge-discount i { font-style: normal; font-size: 11px; margin-left: 1px; }

/* 即将成团 / 已成团（左下） */
.csf-jd-badge-hot,
.csf-jd-badge-success {
    position: absolute;
    bottom: 8px; left: 8px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    z-index: 2;
}
.csf-jd-badge-hot {
    background: rgba(0,0,0,.78);
    color: #ffeb3b;
    animation: csf-jd-hot-shake 1.6s ease-in-out infinite;
}
@keyframes csf-jd-hot-shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}
.csf-jd-badge-success {
    background: linear-gradient(135deg, #52c41a, #73d13d);
    color: #fff;
}

/* 卡片正文 */
.csf-jd-card-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

/* 标题 */
.csf-jd-wrapper .csf-jd-card-title {
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    height: 2.7em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}
.csf-jd-wrapper .csf-jd-card-title a {
    color: var(--jd-text) !important;
    text-decoration: none;
    transition: color .25s;
}
.csf-jd-wrapper .csf-jd-card-title a:hover { color: var(--jd-red) !important; }

/* 价格行 */
.csf-jd-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.csf-jd-card-price {
    display: inline-flex;
    align-items: baseline;
    color: var(--jd-red);
    font-weight: 800;
}
.csf-jd-card-price-yi { font-size: 12px; }
.csf-jd-card-price-num {
    font-size: 20px;
    line-height: 1;
    letter-spacing: -.5px;
}
.csf-jd-card-price-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    color: var(--jd-red);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(225,37,27,.22);
}
.csf-jd-card-price-old {
    color: var(--jd-text-3);
    font-size: 12px;
    text-decoration: line-through;
}
.csf-jd-card-save {
    display: inline-flex;
    align-items: center;
    background: var(--jd-red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: auto;
}

/* 进度（扁平，无独立背景框） */
.csf-jd-card-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.csf-jd-card-progress-track {
    height: 4px;
    background: #ffe5e5;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.csf-jd-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--jd-orange), var(--jd-red));
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    transition: width .8s ease;
}
.csf-jd-card-progress-fill::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
    animation: csf-jd-progress-shine 1.8s linear infinite;
}
@keyframes csf-jd-progress-shine {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}
.csf-jd-card-progress-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--jd-text-2);
    gap: 6px;
}
.csf-jd-card-progress-text b { color: var(--jd-red); font-weight: 700; }
.csf-jd-card-progress-remain { color: var(--jd-orange); font-weight: 700; }
.csf-jd-card-progress-done { color: #52c41a; font-weight: 700; }

.csf-jd-card-empty-progress {
    font-size: 11px;
    color: #00b894;
    font-weight: 600;
}

/* 卡片底部 */
.csf-jd-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--jd-border);
}
.csf-jd-card-leader {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

/* 头像（沿用原 .csf-gl-card-leader-avatar 包装） */
.csf-jd-wrapper .csf-gl-card-leader-avatar,
.csf-jd-wrapper .csf-gl-card-leader-avatar a,
.csf-jd-wrapper .csf-gl-card-leader-avatar .avatar-mini,
.csf-jd-wrapper .csf-gl-card-leader-avatar .avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.csf-jd-wrapper .csf-gl-card-leader-avatar {
    width: 22px; height: 22px;
    flex: 0 0 22px;
}
.csf-jd-wrapper .csf-gl-card-leader-avatar .avatar-mini {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50%;
    overflow: hidden;
}
.csf-jd-wrapper .csf-gl-card-leader-avatar img,
.csf-jd-wrapper .csf-gl-card-leader-avatar .avatar {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50%;
    border: 1px solid var(--jd-border) !important;
    background: #fff;
    object-fit: cover;
    flex-shrink: 0;
}
.csf-jd-card-leader-name {
    font-size: 11px;
    color: var(--jd-text-3);
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.csf-jd-card-leader-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #ffd700, #ffac33);
    color: #5d4500;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}
.csf-jd-card-time {
    font-size: 11px;
    color: var(--jd-text-3);
}

/* 按钮 */
.csf-jd-wrapper .csf-group-join.csf-jd-card-actions {
    display: flex;
    gap: 0;
    flex-direction: row;
    width: auto;
    margin-top: 0;
}
.csf-jd-wrapper .csf-group-btn.csf-jd-btn {
    display: inline-block !important;
    padding: 5px 12px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all .25s !important;
    border: none !important;
}
.csf-jd-wrapper .csf-group-btn.csf-jd-btn-primary {
    background: linear-gradient(135deg, var(--jd-red), var(--jd-orange)) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(225,37,27,.28);
}
.csf-jd-wrapper .csf-group-btn.csf-jd-btn-primary:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 16px rgba(225,37,27,.42) !important;
}
.csf-jd-wrapper .csf-group-btn.csf-jd-btn-secondary {
    background: #f7f7f7 !important;
    color: var(--jd-text-2) !important;
    border: 1px solid var(--jd-border) !important;
}
.csf-jd-wrapper .csf-group-btn.csf-jd-btn-secondary:hover {
    color: var(--jd-red) !important;
    border-color: var(--jd-red) !important;
    background: #fff5f5 !important;
}

/* === 9. 空状态 === */
.csf-jd-wrapper .csf-jd-empty {
    text-align: center;
    padding: 56px 20px;
    grid-column: 1 / -1;
    background: var(--jd-card-bg);
    border: 1px dashed var(--jd-border);
    border-radius: 12px;
}
.csf-jd-wrapper .csf-gl-empty-icon {
    width: 64px; height: 64px;
    margin: 0 auto 12px;
    background: #fff5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: csf-jd-empty-pulse 3s ease-in-out infinite;
}
.csf-jd-wrapper .csf-gl-empty-icon svg {
    width: 28px; height: 28px;
    color: var(--jd-red);
}
.csf-jd-wrapper .csf-jd-empty p {
    color: var(--jd-text-3) !important;
    font-size: 14px;
    margin: 0;
}
@keyframes csf-jd-empty-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(225,37,27,.18); }
    50% { box-shadow: 0 0 0 14px rgba(225,37,27,0); }
}

/* === 10. 模态框 === */
.csf-jd-wrapper .csf-group-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.csf-jd-wrapper .csf-group-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 36px 44px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.csf-jd-wrapper .csf-group-modal-content p {
    color: var(--jd-text);
    font-size: 15px;
    margin: 0;
}
.csf-jd-wrapper .csf-group-modal-spinner {
    width: 28px; height: 28px;
    margin: 0 auto 14px;
    border: 3px solid var(--jd-border);
    border-top-color: var(--jd-red);
    border-radius: 50%;
    animation: csf-jd-spin 1s linear infinite;
}
@keyframes csf-jd-spin {
    to { transform: rotate(360deg); }
}

/* === 11. 隐藏父主题旧元素 === */
.csf-jd-wrapper .csf-group-list-tabs,
.csf-jd-wrapper .group-meta,
.csf-jd-wrapper .group-progress-info,
.csf-jd-wrapper .csf-group-progress,
.csf-jd-wrapper .csf-group-leader { display: none !important; }

/* === 12. 响应式 === */
@media (max-width: 1280px) {
    .csf-jd-wrapper .csf-jd-product-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
    .csf-jd-hero-grid { grid-template-columns: 1fr; gap: 18px; }
    .csf-jd-hero-right { justify-content: flex-start; }
    .csf-jd-hero-title { font-size: 28px; }
    .csf-jd-hero { padding: 28px 0; }
    .csf-jd-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .csf-jd-wrapper .csf-jd-product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .csf-jd-wrapper { padding: 10px 0 48px; }
    .csf-jd-inner { padding: 0 8px; }
    .csf-jd-hero { margin: 0 8px 10px; padding: 18px 0; }
    .csf-jd-hero-title { font-size: 22px; margin-bottom: 4px; }
    .csf-jd-hero-sub { font-size: 12px; margin-bottom: 12px; }
    .csf-jd-hero-stat { padding: 8px 10px; min-width: 72px; border-radius: 8px; }
    .csf-jd-hero-stat-num { font-size: 18px; }
    .csf-jd-hero-stat-lbl { font-size: 11px; }
    .csf-jd-hero-right { gap: 8px; }
    .csf-jd-quick { padding: 0 0 8px; }
    .csf-jd-quick-grid { gap: 6px; }
    .csf-jd-quick-item { padding: 8px 10px; gap: 8px; border-radius: 8px; }
    .csf-jd-quick-ico { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
    .csf-jd-quick-text b { font-size: 12px; }
    .csf-jd-quick-text em { font-size: 11px; }
    .csf-jd-quick-cnt { min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
    .csf-jd-filter { padding: 0 0 8px; }
    .csf-jd-filter-card { padding: 8px 10px; border-radius: 8px; }
    .csf-jd-search-row { gap: 8px; }
    .csf-jd-sort-row { gap: 10px; }
    .csf-jd-tabs-row { flex-direction: column; align-items: stretch; }
    .csf-jd-wrapper .csf-jd-search { width: 100%; }
    .csf-jd-wrapper .csf-jd-search input { height: 32px; font-size: 12px; }
    .csf-jd-wrapper .csf-jd-search button { padding: 0 12px; font-size: 11px; }
    .csf-jd-section-header { padding: 10px 0 4px; }
    .csf-jd-wrapper .csf-jd-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .csf-jd-wrapper .csf-jd-card { border-radius: 6px; }
    .csf-jd-card-body { padding: 6px 8px 8px; gap: 4px; }
    .csf-jd-wrapper .csf-jd-card-title { font-size: 12px; height: 2.7em; }
    .csf-jd-card-price-num { font-size: 18px; }
    .csf-jd-card-price-yi { font-size: 11px; }
    .csf-jd-card-price-tag { display: none; }
    .csf-jd-card-price-old { font-size: 11px; }
    .csf-jd-card-save { font-size: 10px; padding: 1px 5px; }
    .csf-jd-card-progress-text { font-size: 10px; }
    .csf-jd-card-footer { padding-top: 5px; gap: 4px; }
    .csf-jd-card-leader-name { font-size: 10px; max-width: 48px; }
    .csf-jd-wrapper .csf-gl-card-leader-avatar,
    .csf-jd-wrapper .csf-gl-card-leader-avatar .avatar-mini,
    .csf-jd-wrapper .csf-gl-card-leader-avatar img,
    .csf-jd-wrapper .csf-gl-card-leader-avatar .avatar {
        width: 18px !important; height: 18px !important; flex: 0 0 18px;
    }
    .csf-jd-wrapper .csf-group-btn.csf-jd-btn {
        padding: 3px 8px !important;
        border-radius: 2px !important;
        font-size: 11px !important;
    }
    .csf-jd-wrapper .csf-group-btn.csf-jd-btn-primary {
        box-shadow: 0 2px 6px rgba(225,37,27,.22);
    }
    .csf-jd-card-empty-progress { font-size: 10px; }
}
@media (max-width: 480px) {
    .csf-jd-wrapper { padding: 8px 0 40px; }
    .csf-jd-inner { padding: 0 6px; }
    .csf-jd-hero { margin: 0 6px 8px; padding: 14px 0; }
    .csf-jd-hero-title { font-size: 20px; }
    .csf-jd-hero-sub { font-size: 11px; margin-bottom: 10px; }
    .csf-jd-hero-tag { padding: 3px 10px; font-size: 11px; margin-bottom: 8px; }
    .csf-jd-countdown { padding: 5px 10px; font-size: 11px; }
    .csf-jd-cd-block { padding: 2px 5px; min-width: 22px; font-size: 11px; border-radius: 4px; }
    .csf-jd-hero-stat { padding: 6px 8px; min-width: 64px; border-radius: 6px; }
    .csf-jd-hero-stat-num { font-size: 16px; }
    .csf-jd-hero-stat-lbl { font-size: 10px; }
    .csf-jd-quick-grid { gap: 5px; }
    .csf-jd-quick-item { padding: 6px 8px; gap: 6px; border-radius: 6px; }
    .csf-jd-quick-ico { width: 28px; height: 28px; font-size: 14px; border-radius: 6px; }
    .csf-jd-quick-text b { font-size: 11px; }
    .csf-jd-quick-text em { font-size: 10px; }
    .csf-jd-filter-card { padding: 6px 8px; border-radius: 6px; }
    .csf-jd-sort-label { font-size: 11px; }
    .csf-jd-wrapper .csf-gl-sort-link.csf-jd-sort { font-size: 11px; }
    .csf-jd-wrapper .csf-jd-product-grid { gap: 5px; }
    .csf-jd-wrapper .csf-jd-card { border-radius: 4px; }
    .csf-jd-card-body { padding: 5px 6px 6px; gap: 3px; }
    .csf-jd-wrapper .csf-jd-card-title { font-size: 11px; }
    .csf-jd-card-price-num { font-size: 16px; }
    .csf-jd-card-price-row { gap: 4px; }
    .csf-jd-card-footer { padding-top: 4px; gap: 3px; }
    .csf-jd-card-leader { gap: 4px; }
    .csf-jd-wrapper .csf-group-btn.csf-jd-btn {
        padding: 2px 6px !important;
        border-radius: 2px !important;
        font-size: 10px !important;
    }
    .csf-jd-badge-pintuan,
    .csf-jd-badge-newgroup { padding: 2px 6px; font-size: 10px; top: 4px; left: 4px; }
    .csf-jd-badge-discount { padding: 2px 5px; top: 4px; right: 4px; }
    .csf-jd-badge-discount em { font-size: 13px; }
    .csf-jd-badge-discount i { font-size: 9px; }
}

/* ==========================================================
 * 11. Hero 右上「拼团规则」入口
 * ========================================================== */
.csf-jd-wrapper .csf-jd-hero-rules {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 10px;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 999px;
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.csf-jd-wrapper .csf-jd-hero-rules:hover {
    background: rgba(255,255,255,.95);
    color: var(--jd-red) !important;
    border-color: rgba(255,255,255,.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.csf-jd-hero-rules-ico { font-size: 14px; line-height: 1; }
.csf-jd-hero-rules-text { letter-spacing: .3px; }

/* ==========================================================
 * 12. 拼团规则 Modal
 * ========================================================== */
body.csf-jd-rules-locked { overflow: hidden; }

.csf-jd-rules-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}
.csf-jd-rules-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: csf-jd-rules-fade .22s ease-out;
}
@keyframes csf-jd-rules-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.csf-jd-rules-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.csf-jd-rules-dialog {
    position: relative;
    margin: 0;
    width: min(560px, calc(100vw - 32px));
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,.32);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: csf-jd-rules-pop .28s cubic-bezier(.22,1.4,.4,1);
}
@keyframes csf-jd-rules-pop {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.csf-jd-rules-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--jd-red,#e1251b) 0%, var(--jd-red-light,#ff4d4f) 50%, var(--jd-orange,#ff6700) 100%);
    color: #fff;
}
.csf-jd-rules-emoji {
    font-size: 22px;
    line-height: 1;
}
.csf-jd-rules-modal h3.csf-jd-rules-title {
    margin: 0;
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    color: #fff !important;
    letter-spacing: .5px;
}
.csf-jd-rules-close {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255,255,255,.2);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .22s;
    padding: 0;
}
.csf-jd-rules-close:hover {
    background: rgba(255,255,255,.32);
    transform: rotate(90deg);
}

/* Body */
.csf-jd-rules-body {
    padding: 18px 22px 8px;
    overflow-y: auto;
    flex: 1;
    color: #333;
}
.csf-jd-rules-tip {
    background: linear-gradient(135deg, #fff5f5, #fff8e6);
    border: 1px solid #ffe0d6;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}
.csf-jd-rules-tip strong {
    display: block;
    margin-bottom: 4px;
    color: var(--jd-red,#e1251b);
    font-size: 14px;
}

.csf-jd-rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: rules;
}
.csf-jd-rules-list li {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #f0f0f0;
}
.csf-jd-rules-list li:last-child { border-bottom: none; }

.csf-jd-rules-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--jd-red,#e1251b), var(--jd-orange,#ff6700));
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(225,37,27,.28);
}
.csf-jd-rules-item { flex: 1; min-width: 0; }
.csf-jd-rules-item h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
}
.csf-jd-rules-item p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.65;
    color: #666;
}

.csf-jd-rules-notice {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    background: #fffaf0;
    border: 1px solid #ffe7c2;
    border-radius: 10px;
    padding: 12px 14px;
}
.csf-jd-rules-notice-ico {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1.4;
}
.csf-jd-rules-notice b {
    display: block;
    color: #d46b08;
    font-size: 13px;
    margin-bottom: 3px;
}
.csf-jd-rules-notice p {
    margin: 0;
    color: #815c30;
    font-size: 12px;
    line-height: 1.6;
}

/* Footer */
.csf-jd-rules-footer {
    padding: 14px 22px 18px;
    text-align: center;
    border-top: 1px solid #f5f5f5;
    background: #fafafa;
}
.csf-jd-rules-confirm {
    min-width: 140px;
    height: 38px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--jd-red,#e1251b), var(--jd-orange,#ff6700));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(225,37,27,.32);
    transition: all .22s;
}
.csf-jd-rules-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(225,37,27,.38);
}

/* Modal 响应式 */
@media (max-width: 768px) {
    .csf-jd-wrapper .csf-jd-hero-rules { top: 10px; right: 12px; padding: 5px 12px 5px 9px; font-size: 11px; }
    .csf-jd-rules-dialog { margin: 0; width: calc(100vw - 24px); max-height: 92vh; border-radius: 14px; }
    .csf-jd-rules-header { padding: 14px 16px; }
    .csf-jd-rules-modal h3.csf-jd-rules-title { font-size: 15px; }
    .csf-jd-rules-body { padding: 14px 16px 6px; }
    .csf-jd-rules-footer { padding: 12px 16px 16px; }
}
