/* ========================================
   Module: Shop (商店) v2 — 暗色高级感
   ======================================== */

/* ─── 商店屏幕背景 ─── */
#shop-screen {
    position: relative;
}
.theme-purple #shop-screen {
    background: linear-gradient(135deg, #667eea 0%, #9b59b6 50%, #f093fb 100%) !important;
}
.theme-white #shop-screen {
    background: #fff !important;
}
/* 磨砂纹理叠加（仅粉紫主题） */
.theme-purple #shop-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255,200,255,0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
#shop-screen > * {
    position: relative;
    z-index: 1;
}

/* ─── 顶部栏 ─── */
.shop-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    position: relative;
}
.theme-purple .shop-header-bar {
    background: rgba(255,255,255,0.12) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255,255,255,0.15) !important;
}
.theme-white .shop-header-bar {
    background: rgba(255,255,255,0.85) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid #eee !important;
}
.shop-header-bar::after {
    content: none;
}
.shop-title {
    font-size: 22px;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.5px;
}
.theme-purple .shop-title {
    background: linear-gradient(135deg, #fff, #f093fb) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}
.theme-white .shop-title {
    color: var(--text-color) !important;
    -webkit-text-fill-color: var(--text-color) !important;
}
.shop-coins {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 24px;
}
.theme-purple .shop-coins {
    background: rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}
.theme-white .shop-coins {
    background: rgba(255,215,0,0.1) !important;
    border: 1px solid rgba(255,215,0,0.2) !important;
    box-shadow: none !important;
}
.coin-icon { font-size: 16px; }
#shop-money {
    font-size: 16px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.3);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: inline-block;
}
#shop-money.bump {
    transform: scale(1.3);
}

/* ─── Tab 栏 ─── */
.shop-tabs {
    display: flex;
    padding: 12px 16px;
    gap: 6px;
}
.shop-tab {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
}
.theme-purple .shop-tab {
    background: rgba(255,255,255,0.06) !important;
    color: rgba(255,255,255,0.5) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}
.theme-purple .shop-tab:hover {
    color: rgba(255,255,255,0.8) !important;
    background: rgba(255,255,255,0.12) !important;
}
.theme-purple .shop-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #9b59b6 50%, #f093fb 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 15px rgba(155,89,182,0.4) !important;
}
.theme-white .shop-tab {
    background: transparent !important;
    color: #999 !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
}
.theme-white .shop-tab:hover { color: #666 !important; }
.theme-white .shop-tab.active {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
    background: transparent !important;
}

/* ─── 内容区 ─── */
.shop-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 80px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.shop-content::-webkit-scrollbar { width: 4px; }
.shop-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ─── 分类标题 ─── */
.shop-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 16px 4px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.theme-purple .shop-section-title { color: rgba(255,255,255,0.25) !important; }
.theme-white .shop-section-title { color: #999 !important; }
.shop-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(to bottom, #f48fb1, #b388ff);
    border-radius: 2px;
    flex-shrink: 0;
}
.shop-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
}
.theme-purple .shop-section-title::after { background: linear-gradient(to right, rgba(255,255,255,0.08), transparent); }
.theme-white .shop-section-title::after { background: linear-gradient(to right, #eee, transparent); }

/* ─── 网格 ─── */
.shop-grid-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}

/* ─── 卡片 ─── */
.shop-card {
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: visible;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    perspective: 800px;
    min-height: 180px;
}
.shop-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 180px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 12px;
}
.shop-card.flipped .shop-card-inner {
    transform: rotateY(180deg);
}
.shop-card-front, .shop-card-back {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 14px 16px;
    box-sizing: border-box;
}
.shop-card-back {
    transform: rotateY(180deg);
    cursor: default;
}
.theme-purple .shop-card-front,
.theme-purple .shop-card-back {
    background: rgba(255,255,255,0.06) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 2px solid rgba(255,255,255,0.1) !important;
}
.theme-white .shop-card-front,
.theme-white .shop-card-back {
    background: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}
/* 顶部内光 */
.theme-purple .shop-card-front::before,
.theme-purple .shop-card-back::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 12px 12px 0 0;
}
.shop-card:hover {
    transform: translateY(-4px) scale(1.03);
}
.theme-purple .shop-card:hover {
    background: rgba(155,89,182,0.2) !important;
    border-color: rgba(155,89,182,0.5) !important;
    box-shadow: 0 8px 25px rgba(155,89,182,0.3) !important;
}
.theme-white .shop-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.1) !important;
}
.shop-card:active {
    transform: scale(0.96);
    transition-duration: 0.1s;
}

/* 高价商品 */
.shop-card-premium {
    border-color: rgba(255,215,0,0.3);
    background: rgba(255,215,0,0.08);
}
.shop-card-premium .shop-card-front::before,
.shop-card-premium .shop-card-back::before {
    background: linear-gradient(180deg, rgba(255,215,0,0.08) 0%, transparent 100%);
}

/* 发光卡片 */
.shop-card-glow-pink {
    box-shadow: 0 0 20px rgba(255,105,180,0.12), inset 0 0 20px rgba(255,105,180,0.04);
}
.shop-card-glow-pink:hover {
    box-shadow: 0 0 30px rgba(255,105,180,0.2), 0 8px 32px rgba(0,0,0,0.3);
}
.shop-card-glow-purple {
    box-shadow: 0 0 20px rgba(179,136,255,0.12), inset 0 0 20px rgba(179,136,255,0.04);
}
.shop-card-glow-purple:hover {
    box-shadow: 0 0 30px rgba(179,136,255,0.2), 0 8px 32px rgba(0,0,0,0.3);
}

/* 已拥有 */
.shop-card-owned {
    opacity: 0.3;
    pointer-events: none;
}
.shop-card-owned::after {
    content: '✓';
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    background: linear-gradient(135deg, #f48fb1, #b388ff);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 禁用（衣帽间入口） */
.shop-card-disabled {
    opacity: 0.2;
    pointer-events: none;
    border-style: dashed;
    border-color: rgba(255,255,255,0.08);
}

/* 卡片内容 */
.shop-card-icon {
    font-size: 40px;
    position: relative;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}
.shop-card:hover .shop-card-icon {
    transform: scale(1.12) rotate(-5deg);
}
.shop-card-label {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}
.theme-purple .shop-card-label { color: rgba(255,255,255,0.9) !important; }
.theme-white .shop-card-label { color: var(--text-color) !important; }
.shop-card-desc {
    font-size: 11px;
    text-align: center;
    line-height: 1.3;
    margin-top: -4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.theme-purple .shop-card-desc { color: rgba(255,255,255,0.3) !important; }
.theme-white .shop-card-desc { color: #999 !important; }
.shop-card-price {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 700;
}
.theme-purple .shop-card-price { color: #f0c674 !important; }
.theme-white .shop-card-price { color: #ff9800 !important; }

/* 标签角标 */
.shop-tag {
    position: absolute;
    top: 10px; left: -6px;
    padding: 2px 8px 2px 10px;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    border-radius: 0 4px 4px 0;
    letter-spacing: 0.5px;
    z-index: 2;
}
.shop-tag-hot { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.shop-tag-new { background: linear-gradient(135deg, #7c4dff, #b388ff); }
.shop-tag-ltd { background: linear-gradient(135deg, #ffd700, #e67e22); }
.shop-tag-set { background: linear-gradient(135deg, #e84393, #fd79a8); }
/* ─── Toast 提示 ─── */
.shop-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.shop-btn:active { transform: scale(0.95); }
.shop-btn-cancel {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.08);
}
.shop-btn-cancel:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}
.shop-btn-buy {
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}
.theme-purple .shop-btn-buy {
    background: linear-gradient(135deg, #667eea 0%, #9b59b6 50%, #f093fb 100%) !important;
    box-shadow: 0 4px 15px rgba(155,89,182,0.4) !important;
}
.theme-purple .shop-btn-buy:hover {
    box-shadow: 0 6px 20px rgba(155,89,182,0.5) !important;
    transform: translateY(-2px);
}
.theme-white .shop-btn-buy {
    background: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}
.shop-btn-nomoney {
    background: rgba(255,255,255,0.04) !important;
    box-shadow: none !important;
    color: rgba(255,255,255,0.2) !important;
    animation: shop-shake 0.5s;
}
@keyframes shop-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* ─── Toast ─── */
.shop-toast {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    padding: 14px 28px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    white-space: nowrap;
}
.theme-purple .shop-toast {
    background: rgba(20, 25, 40, 0.95) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
}
.theme-white .shop-toast {
    background: rgba(0,0,0,0.75) !important;
}
.shop-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
