/* ============================================================
 * 会员购买弹窗组件样式
 *
 * PC 部分（.pd-*）：
 *   原 home/index.html 内的样式，保持兼容
 *
 * 移动端部分（.mp-*）：
 *   底部抽屉样式，从底部弹出，半屏高度
 *
 * 备注：
 *   通用 .modal-mask / .modal / .modal-header 等样式复用 app.css
 * ============================================================ */

/* ============== PC 部分（沿用原样式） ============== */

.pd-modal {
    max-width: 920px;
    padding: 0;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
}
.pd-modal .modal-header {
    padding: 22px 28px 14px;
    border-bottom: 1px solid #F1F4F8;
    text-align: center;
}
.pd-modal .modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -.01em;
}
.pd-modal .modal-sub {
    margin-top: 4px;
    font-size: 13px;
    color: #64748B;
}
.pd-modal .modal-body {
    padding: 0;
    background: #fff;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.pd-plans {
    padding: 20px 24px 8px;
    display: grid;
    gap: 10px;
}
.pd-plans.n1 { grid-template-columns: 1fr; }
.pd-plans.n2 { grid-template-columns: repeat(2, 1fr); }
.pd-plans.n3 { grid-template-columns: repeat(3, 1fr); }
.pd-plans.n4 { grid-template-columns: repeat(4, 1fr); }
.pd-plan {
    position: relative;
    padding: 16px 14px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1.5px solid #E5E8F0;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.pd-plan:hover {
    border-color: #FCC4A8;
    transform: translateY(-1px);
}
.pd-plan.is-active {
    border-color: #F45C2C;
    background: #fff;
    box-shadow: 0 6px 18px rgba(244, 92, 44, .14);
    transform: translateY(-1px);
}
.pd-plan .pd-name {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    line-height: 1.3;
}
.pd-plan.is-active .pd-name { color: #0F172A; }
.pd-plan .pd-price {
    margin: 8px 0 2px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.pd-plan .pd-price .yen {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
    vertical-align: top;
}
.pd-plan .pd-price .num {
    font-size: 30px;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -.02em;
}
.pd-plan.is-active .pd-price .yen,
.pd-plan.is-active .pd-price .num { color: #0F172A; }
.pd-plan .pd-price .orig {
    font-size: 12px;
    color: #CBD5E1;
    text-decoration: line-through;
    margin-left: 4px;
    font-weight: 400;
}
.pd-plan .pd-sub {
    font-size: 12px;
    color: #94A3B8;
    margin-top: 6px;
}
.pd-plan .pd-tag {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #F45C2C, #FF8A5B);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    letter-spacing: .02em;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(244, 92, 44, .25);
}
.pd-plan .pd-check {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F45C2C;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(244, 92, 44, .35);
    transform: scale(.4);
    opacity: 0;
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s ease;
    z-index: 2;
}
.pd-plan .pd-check .icon {
    width: 18px; height: 18px;
    font-weight: 700;
    font-variation-settings: 'FILL' 1;
}
.pd-plan.is-active .pd-check {
    display: flex;
    transform: scale(1);
    opacity: 1;
}
.pd-plan .pd-divider {
    margin: 12px 0 10px;
    height: 1px;
    background: #F1F4F8;
}
.pd-plan .pd-feats {
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: left;
    padding: 0 2px;
}
.pd-plan .pd-feats .feat {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #475569;
}
.pd-plan .pd-feats .feat .ic {
    flex-shrink: 0;
    font-size: 15px;
    color: #10B981;
    font-variation-settings: 'FILL' 1;
    line-height: 1.2;
}
.pd-plan.is-active .pd-feats .feat { color: #334155; }
.pd-plan.is-active .pd-feats .feat .ic { color: #10B981; }

.pd-divider {
    margin: 16px 24px 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E5E8F0 30%, #E5E8F0 70%, transparent);
}
.pd-divider-title {
    margin: 14px 0 6px;
    text-align: center;
    font-size: 12px;
    color: #94A3B8;
    letter-spacing: .04em;
}
.pd-pay {
    padding: 8px 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.pd-qr-wrap {
    position: relative;
    padding: 10px;
    background: #fff;
    border: 1px solid #E5E8F0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
.pd-qr-wrap canvas { display: block; }
.pd-qr-loading {
    width: 168px; height: 168px;
    background: #FAFAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #94A3B8;
    font-size: 13px;
    letter-spacing: .02em;
}
.pd-qr-wrap canvas {
    animation: pd-qr-fade-in .3s ease-out;
}
@keyframes pd-qr-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.pd-order {
    width: 100%;
    max-width: 340px;
    text-align: center;
}
.pd-order .row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 6px 0;
    font-size: 13px;
}
.pd-order .row .lbl { color: #94A3B8; }
.pd-order .row .val { color: #0F172A; font-weight: 500; }
.pd-order .row .val.code {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 11.5px;
    color: #64748B;
}
.pd-order .row.total .val {
    color: #F45C2C;
    font-weight: 700;
    font-size: 18px;
}
.pd-modal > div[style*="justify-content:flex-end"] {
    padding: 14px 24px !important;
    border-top: 1px solid #F1F4F8 !important;
    background: #FAFBFC !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
}
.pd-foot-safety {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; color: #94A3B8;
}
.pd-foot-safety .icon {
    width: 14px; height: 14px; color: #10B981;
}
.pd-modal .btn-ghost {
    background: #fff !important;
    color: #475569 !important;
    border: 1px solid #E2E8F0 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}
.pd-modal .btn-ghost:hover { border-color: #CBD5E1 !important; }
.pd-modal .btn-primary-brand {
    padding: 9px 18px !important;
    font-size: 13px !important;
    background: linear-gradient(135deg, #F45C2C 0%, #FF8A5B 100%) !important;
    box-shadow: 0 4px 12px rgba(244, 92, 44, .25) !important;
}
.pd-modal .btn-primary-brand:hover {
    background: linear-gradient(135deg, #E14A1D 0%, #F47A4B 100%) !important;
    box-shadow: 0 6px 18px rgba(244, 92, 44, .35) !important;
}
.pd-success {
    text-align: center;
    padding: 56px 24px 36px;
}
.pd-success-icon {
    width: 64px; height: 64px;
    background: #10B981;
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, .30);
    animation: pd-pop .4s ease;
}
.pd-success-icon .icon { width: 36px; height: 36px; font-weight: 700; }
@keyframes pd-pop {
    0% { transform: scale(.4); opacity: 0; }
    70% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}
.pd-success-title {
    font-size: 20px;
    font-weight: 700;
    color: #0F172A;
}
.pd-success-desc {
    margin-top: 8px;
    font-size: 13px;
    color: #64748B;
    line-height: 1.6;
}
.pd-skel {
    padding: 22px 24px 8px;
    display: grid;
    gap: 10px;
}
.pd-skel.n1 { grid-template-columns: 1fr; }
.pd-skel.n2 { grid-template-columns: repeat(2, 1fr); }
.pd-skel.n3 { grid-template-columns: repeat(3, 1fr); }
.pd-skel.n4 { grid-template-columns: repeat(4, 1fr); }
.pd-skel-card {
    height: 92px;
    padding: 16px 14px;
    border: 1.5px solid #EEF1F5;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pd-skel-card .a { height: 12px; background: #EEF1F5; border-radius: 3px; animation: pd-shimmer 1.4s ease-in-out infinite; }
.pd-skel-card .a.s1 { width: 50%; }
.pd-skel-card .a.s2 { width: 38%; height: 24px; }
.pd-skel-card .a.s3 { width: 60%; height: 10px; }
.pd-skel-qr {
    margin: 0 auto;
    width: 168px; height: 168px;
    background: #FAFAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    animation: pd-shimmer 1.4s ease-in-out infinite;
}
.pd-skel-order {
    margin: 14px auto 0;
    width: 100%; max-width: 340px;
    display: flex; flex-direction: column; gap: 6px;
}
.pd-skel-order .r {
    height: 12px; background: #F1F4F8; border-radius: 3px;
    animation: pd-shimmer 1.4s ease-in-out infinite;
}
@keyframes pd-shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

/* ============== 移动端部分 ============== */

.mp-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 9999;
    animation: mp-mask-in .25s ease;
}
@keyframes mp-mask-in { from { opacity: 0; } to { opacity: 1; } }

.mp-panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 85vh;
    background: #fff;
    border-radius: 18px 18px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,.0,.2,1);
    box-shadow: 0 -10px 32px rgba(15, 23, 42, .12);
}
.mp-panel.is-in { transform: translateY(0); }

.mp-handle {
    width: 36px; height: 4px;
    background: #E2E8F0;
    border-radius: 999px;
    margin: 8px auto 0;
    flex-shrink: 0;
}

.mp-title {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #0F172A;
    padding: 10px 0 4px;
    flex-shrink: 0;
}
.mp-sub {
    text-align: center;
    font-size: 12px;
    color: #64748B;
    padding-bottom: 8px;
    flex-shrink: 0;
}

.mp-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 16px;
    overscroll-behavior: contain;
}
.mp-plans {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mp-plan {
    position: relative;
    padding: 14px 14px 12px;
    border: 1.5px solid #E5E8F0;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
    background: #fff;
}
.mp-plan.is-active {
    border-color: #07C160;
    box-shadow: 0 4px 16px rgba(7,193,96,.18);
    background: #FCFEFC;
}
.mp-plan .mp-tag {
    position: absolute;
    top: -8px; left: 12px;
    background: linear-gradient(90deg, #F45C2C, #FF8A5B);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(244, 92, 44, .25);
}
.mp-plan .mp-check {
    position: absolute;
    top: 10px; right: 10px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #07C160;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
}
.mp-plan .mp-check .icon {
    width: 14px; height: 14px;
    font-variation-settings: 'FILL' 1;
}
.mp-plan.is-active .mp-check { display: flex; }
.mp-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.mp-name {
    font-size: 15px;
    font-weight: 600;
    color: #0F172A;
}
.mp-price {
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.mp-price .yen {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    vertical-align: top;
}
.mp-price .num {
    font-size: 22px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 2px;
}
.mp-price .unit {
    font-size: 12px;
    color: #94A3B8;
}
.mp-feats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0;
}
.mp-feats .feat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #475569;
}
.mp-feats .feat .icon {
    width: 14px; height: 14px;
    color: #10B981;
    font-variation-settings: 'FILL' 1;
}

.mp-skel {
    height: 64px;
    background: linear-gradient(90deg, #F1F5F9 0%, #E5EAF1 50%, #F1F5F9 100%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: mp-skel-shimmer 1.2s ease-in-out infinite;
    margin-bottom: 10px;
}
@keyframes mp-skel-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.mp-foot {
    flex-shrink: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #F1F4F8;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 12px;
    align-items: center;
}
.mp-foot-info .lbl {
    font-size: 11px;
    color: #94A3B8;
}
.mp-foot-info .val {
    font-size: 14px;
    color: #0F172A;
    font-weight: 600;
    margin-top: 1px;
}
.mp-foot-info .val.price {
    color: #F45C2C;
    font-size: 18px;
    font-weight: 800;
}
.mp-pay-btn {
    grid-column: 1 / span 2;
    grid-row: 2;
    height: 46px;
    margin-top: 4px;
    background: linear-gradient(135deg, #07C160 0%, #10B981 100%);
    color: #fff;
    border: 0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(7,193,96,.30);
    transition: transform .15s, box-shadow .15s;
    -webkit-tap-highlight-color: transparent;
}
.mp-pay-btn:active { transform: scale(.98); }
.mp-pay-btn:disabled { opacity: .6; cursor: not-allowed; }
.mp-tip {
    grid-column: 1 / span 2;
    text-align: center;
    font-size: 11px;
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding-top: 2px;
}
.mp-tip .icon {
    width: 13px; height: 13px;
    color: #10B981;
}
