/* ============================================
   孝爱币充值页样式
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

/* ── 顶部导航 ── */
.ch-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    border-bottom: 1px solid #eee;
}
.ch-nav-back {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ch-nav-icon {
    font-size: 22px;
    color: #333;
    line-height: 44px;
}
.ch-nav-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: center;
}
.ch-nav-right {
    width: 44px;
}

/* ── 主内容区 ── */
.ch-body {
    padding: 60px 12px 80px;
    max-width: 750px;
    margin: 0 auto;
}

/* ── 区块标题 ── */
.ch-section-title {
    font-size: 15px;
    color: #333;
    font-weight: 600;
    margin-bottom: 12px;
    padding-left: 4px;
}

/* ── 套餐卡片网格 ── */
.ch-packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.ch-pkg-card {
    position: relative;
    background: #fff;
    border-radius: 10px;
    padding: 14px 10px 12px;
    text-align: center;
    cursor: pointer;
    border: 1.5px solid #e8e8e8;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.ch-pkg-card:active {
    transform: scale(0.98);
}
.ch-pkg-card.active {
    border-color: #ff5000;
    background: #fff5f2;
    box-shadow: 0 0 0 1px #ff5000 inset;
}
.ch-pkg-card.active::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    border-width: 14px 14px 0 0;
    border-style: solid;
    border-color: #ff5000 transparent transparent transparent;
}
.ch-pkg-card.active::after {
    content: "✓";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    color: #fff;
}

.ch-pkg-name {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 8px;
}
.ch-pkg-coin {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}
.ch-pkg-gift {
    font-size: 10px;
    color: #ff5000;
    display: block;
    margin-top: 2px;
}

.ch-pkg-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
}
.ch-pkg-yen {
    font-size: 12px;
    color: #ff5000;
    font-weight: 600;
}
.ch-pkg-money {
    font-size: 20px;
    color: #ff5000;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.ch-pkg-orig {
    font-size: 10px;
    color: #999;
    text-decoration: line-through;
    margin-top: 2px;
}

/* 热卖标签 */
.ch-pkg-hot {
    position: absolute;
    top: 0;
    left: 0;
    background: #ff5000;
    color: #fff;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 0 0 6px 0;
    line-height: 1.5;
}

/* ── 充值说明 ── */
.ch-tips {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    margin-top: 8px;
}
.ch-tip-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}
.ch-tip-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ch-tip-list li {
    font-size: 12px;
    color: #888;
    line-height: 1.8;
    padding-left: 14px;
    position: relative;
}
.ch-tip-list li::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: #ff5000;
}

/* ── 支付方式 ── */
.ch-pay-methods {
    background: #fff;
    border-radius: 10px;
    padding: 4px 0;
}
.ch-pay-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    -webkit-tap-highlight-color: transparent;
}
.ch-pay-item:last-child {
    border-bottom: none;
}
.ch-pay-item.active {
    background: #fff9f5;
}
.ch-pay-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    background: #f5f5f5;
}
.ch-pay-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}
.ch-pay-check {
    font-size: 16px;
    color: #ff5000;
    font-weight: 700;
}

/* ── 底部支付栏 ── */
.ch-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.06);
    max-width: 750px;
    margin: 0 auto;
    z-index: 100;
}
.ch-footer-price {
    flex: 1;
}
.ch-footer-label {
    font-size: 12px;
    color: #888;
    margin-right: 4px;
}
.ch-footer-money {
    font-size: 18px;
    color: #ff5000;
    font-weight: 700;
}
.ch-footer-money strong {
    font-size: 22px;
}

.ch-btn-pay {
    background: linear-gradient(135deg, #ff5000, #ff2200);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 80, 0, 0.35);
    transition: opacity 0.2s, transform 0.15s;
}
.ch-btn-pay:active {
    transform: scale(0.96);
    opacity: 0.88;
}
.ch-btn-pay:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

/* ── 加载蒙层 ── */
.ch-loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.ch-loading-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
}
.ch-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #ff5000;
    border-radius: 50%;
    animation: ch-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes ch-spin {
    to { transform: rotate(360deg); }
}
.ch-loading-box p {
    font-size: 14px;
    color: #333;
}

/* ── 响应式：桌面端 ── */
@media (min-width: 768px) {
    .ch-nav {
        left: 50%;
        transform: translateX(-50%);
        max-width: 750px;
    }
    .ch-footer {
        left: 50%;
        transform: translateX(-50%);
        max-width: 750px;
    }
    .ch-packages {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .ch-pkg-card {
        padding: 18px 14px 16px;
    }
}

/* ── 安全区适配 ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .ch-nav {
        padding-top: env(safe-area-inset-top);
    }
}
