/* ============================================================
   积分商城前台样式
   移动优先 + PC 双布局（断点 768px）
   复用站点变量（--c-*），与 member / asset-detail 风格统一
   顶部导航条样式来自 asset-detail.css（ast-topbar）
   ============================================================ */

body { background: var(--c-bg); }

.shop-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 12px 88px;
}

/* ---------- PC 默认隐藏 ---------- */
.s-layout-pc { display: none; }

@media (min-width: 769px) {
    .s-layout-mobile { display: none; }
    .s-layout-pc { display: block; }
    .shop-wrap { max-width: 1000px; padding: 24px 16px 60px; }
    .ast-topbar-inner { max-width: 1000px; }
}

/* ============================================================
   资产概览条（我的积分 / 游戏积分 / 兑换记录入口）
   移动端：三卡等宽一排、内容竖排居中；PC 端：横排左对齐
   ============================================================ */
.s-assets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: var(--space-md);
}
.s-asset {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 14px 8px 12px;
    box-shadow: var(--shadow);
}
.s-asset-icon {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.s-asset-icon.s-ic-amber  { background: rgba(245, 158, 11, .12); color: #f59e0b; }
.s-asset-icon.s-ic-cyan   { background: rgba(6, 182, 212, .12);  color: #06b6d4; }
.s-asset-icon.s-ic-violet { background: rgba(139, 92, 246, .12); color: #8b5cf6; }
.s-asset-meta { min-width: 0; }
.s-asset-num { font-size: 18px; font-weight: 800; color: var(--c-text); line-height: 1.2; }
.s-asset-label { font-size: 11px; color: var(--c-text-2); margin-top: 2px; }

/* 兑换记录入口卡（跳转 points-orders.html） */
.s-asset-entry {
    text-decoration: none;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
a.s-asset-entry:hover,
a.s-asset-entry:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(139, 92, 246, .45);
}
.s-asset-entry-title { font-size: 14px; font-weight: 800; color: var(--c-text); line-height: 1.2; }
.s-asset-entry-arrow {
    font-size: 11px; font-weight: 600;
    color: var(--c-text-2);
    display: inline-flex; align-items: center; gap: 3px;
    margin-top: 2px;
    transition: color .2s;
}
.s-asset-entry-arrow i { font-size: 9px; }
a.s-asset-entry:hover .s-asset-entry-arrow { color: #8b5cf6; }

@media (min-width: 769px) {
    .s-assets { gap: 12px; }
    .s-asset {
        flex-direction: row;
        text-align: left;
        gap: 14px;
        padding: 14px 16px;
    }
    .s-asset-icon { width: 42px; height: 42px; border-radius: 12px; font-size: 18px; }
    .s-asset-num { font-size: 22px; }
    .s-asset-label { font-size: 12px; margin-top: 2px; }
    .s-asset-entry-title { font-size: 16px; }
    .s-asset-entry-arrow { font-size: 12px; }
    .s-asset-entry-arrow i { font-size: 10px; }
}

/* ============================================================
   分类 Tab（积分兑换 / 游戏积分兑换）
   ============================================================ */
.s-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: var(--space-md);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 6px;
}
.s-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--c-text-2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.s-tab.active {
    background: linear-gradient(135deg, var(--c-primary), #36cfc9);
    color: #fff;
    box-shadow: 0 4px 12px rgba(24, 144, 255, .28);
}

/* ============================================================
   商品宫格
   ============================================================ */
.s-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (min-width: 769px) {
    .s-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

.s-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.s-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.s-card-cover {
    position: relative;
    height: 0;
    padding-top: 75%; /* 4:3 占位，兼容不支持 aspect-ratio 的旧浏览器 */
    overflow: hidden;
}
.s-card-cover.s-cover-amber { background: linear-gradient(135deg, #f59e0b1f, #f59e0b3d); }
.s-card-cover.s-cover-cyan  { background: linear-gradient(135deg, #06b6d41f, #06b6d43d); }
.s-card-cover img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; /* 铺满容器自适应缩放，两侧不留空 */
    display: block;
}
.s-card-letter {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 42px;
    font-weight: 800;
    color: var(--c-primary);
    opacity: .65;
}

.s-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.s-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--c-text);
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.s-card-desc {
    font-size: 12px;
    color: var(--c-text-2);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}
.s-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.s-card-chip {
    font-size: 11px;
    color: var(--c-text-2);
    background: var(--c-bg-2);
    border-radius: 6px;
    padding: 2px 6px;
}
.s-card-chip.s-chip-warn { color: #dc2626; background: rgba(220, 38, 38, .1); }

.s-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.s-card-price {
    display: flex;
    align-items: baseline;
    gap: 3px;
    font-weight: 800;
    color: #f59e0b;
}
.s-card-price .num { font-size: 18px; }
.s-card-price .unit { font-size: 11px; font-weight: 600; color: var(--c-text-2); }
.s-card-price.s-price-cyan { color: #06b6d4; }

.s-exchange-btn {
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--c-primary), #36cfc9);
    cursor: pointer;
    transition: opacity .2s, transform .15s;
    flex-shrink: 0;
}
.s-exchange-btn:hover { opacity: .9; }
.s-exchange-btn:active { transform: scale(.96); }
.s-exchange-btn:disabled {
    background: var(--c-bg-2);
    color: var(--c-text-3, var(--c-text-2));
    cursor: not-allowed;
    opacity: .7;
}

/* ---------- 空状态 ---------- */
.s-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 16px;
    color: var(--c-text-2);
    font-size: 14px;
    background: var(--c-surface);
    border: 1px dashed var(--c-border);
    border-radius: var(--radius-lg);
}

/* ============================================================
   兑换记录
   ============================================================ */
.s-orders { margin-top: var(--space-md); }
.s-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.s-section-title i { color: var(--c-primary); }
.s-orders-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text-3, var(--c-text-2));
    margin-left: 2px;
}

/* 移动端：卡片式 */
.s-order-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 14px;
    margin-bottom: 10px;
}
.s-order-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.s-order-name { font-size: 14px; font-weight: 700; color: var(--c-text); }
.s-order-price { font-size: 13px; font-weight: 700; color: #f59e0b; }
.s-order-price.s-price-cyan { color: #06b6d4; }
.s-order-line { font-size: 12px; color: var(--c-text-2); margin-top: 4px; }
.s-order-content {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--c-bg-2);
    border-radius: 8px;
    font-size: 12px;
    color: var(--c-text);
    word-break: break-all;
    user-select: all;
}

/* PC：表格式 */
.s-pc-order-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 8px 16px 16px;
    box-shadow: var(--shadow);
}
.s-pc-table { width: 100%; border-collapse: collapse; }
.s-pc-table th, .s-pc-table td {
    padding: 12px 10px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
    vertical-align: middle;
}
.s-pc-table th { color: var(--c-text-2); font-weight: 600; white-space: nowrap; }
.s-pc-table tr:last-child td { border-bottom: none; }

.s-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 14px 0 4px;
}
.s-page-btn {
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text-2);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}
.s-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.s-page-info { font-size: 13px; color: var(--c-text-2); }

/* ============================================================
   确认 / 结果弹窗（与 member 页 m-modal 同风格）
   ============================================================ */
.s-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.s-modal {
    width: 100%;
    max-width: 360px;
    background: var(--c-surface);
    border-radius: 20px;
    padding: 28px 24px 20px;
    text-align: center;
    animation: s-modal-in .25s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes s-modal-in {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.s-modal-icon {
    width: 56px; height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary-light), rgba(54, 207, 201, .18));
    color: var(--c-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.s-modal-title { font-size: 17px; font-weight: 700; color: var(--c-text); margin-bottom: 8px; }
.s-modal-name { font-size: 15px; font-weight: 600; color: var(--c-text); margin-bottom: 6px; }
.s-modal-price { font-size: 26px; font-weight: 800; color: #f59e0b; margin-bottom: 4px; }
.s-modal-price.s-price-cyan { color: #06b6d4; }
.s-modal-price .unit { font-size: 13px; font-weight: 600; color: var(--c-text-2); }
.s-modal-tip { font-size: 12px; color: var(--c-text-2); margin-bottom: 6px; }
.s-modal-content-box {
    margin: 10px 0;
    padding: 10px 12px;
    background: var(--c-bg-2);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    word-break: break-all;
    user-select: all;
}
.s-modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.s-modal-btn {
    flex: 1;
    padding: 11px 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: opacity .2s;
}
.s-modal-btn.cancel { background: var(--c-bg-2); color: var(--c-text-2); }
.s-modal-btn.ok { background: linear-gradient(135deg, var(--c-primary), #36cfc9); color: #fff; }
.s-modal-btn:hover { opacity: .9; }
.s-modal-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   商品详情页（points-product.html）
   移动端单列；PC 端左图右信息双列
   ============================================================ */
.sd-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.sd-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3; /* 与站点其他页面一致，直接依赖 aspect-ratio */
    min-height: 220px;
    overflow: hidden;
}
.sd-cover img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; /* 铺满容器自适应缩放，不留空边 */
    display: block;
}
.sd-cover .s-card-letter { font-size: 64px; }
.sd-body { padding: 18px 16px 20px; }
.sd-name {
    font-size: 18px; font-weight: 800;
    color: var(--c-text); margin: 0 0 8px;
}
.sd-desc {
    font-size: 14px; color: var(--c-text-2); line-height: 1.7;
    margin: 0 0 12px;
    white-space: pre-wrap; word-break: break-word;
}
.sd-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--c-border);
}
.sd-foot .s-card-price .num { font-size: 26px; }

@media (min-width: 769px) {
    .sd-card {
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
        align-items: stretch;
        max-width: 860px;
        margin: 0 auto;
    }
    .sd-cover { aspect-ratio: auto; min-height: 340px; }
    .sd-body { padding: 28px 26px; display: flex; flex-direction: column; }
    .sd-name { font-size: 22px; }
    .sd-desc { flex: 1; }
    .sd-foot { margin-top: 20px; }
}
