/* ============================================================
   购买订阅页面 + 配置订阅详情 - plan.css
   原创设计：渐变横幅 + 居中定价卡 + 彩色顶条 + 步骤条
   ============================================================ */

/* ====== 渐变横幅 ====== */
.pl-banner {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    border-radius: var(--radius-lg);
    padding: 32px 30px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    animation: fadeUp .3s var(--ease-out) both;
}

.pl-banner::before,
.pl-banner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}

.pl-banner::before {
    width: 180px;
    height: 180px;
    top: -60px;
    right: -40px;
}

.pl-banner::after {
    width: 100px;
    height: 100px;
    bottom: -30px;
    left: 20px;
}

.pl-banner-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.pl-banner-sub {
    font-size: 13px;
    color: rgba(255,255,255,.7);
}

/* ====== 分段控制器 ====== */
.pl-segmented {
    display: inline-flex;
    background: var(--surface-alt);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 18px;
    animation: fadeUp .3s var(--ease-out) .04s both;
}

.pl-seg-btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
}

.pl-seg-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ====== 套餐网格 ====== */
.pl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    animation: fadeUp .3s var(--ease-out) .06s both;
}

/* ====== 套餐卡片 ====== */
.pl-card {
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all .2s var(--ease-out);
    display: flex;
    flex-direction: column;
}

.pl-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    transform: translateY(-3px);
    border-color: var(--accent);
}

.pl-card-top {
    padding: 18px 22px;
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.pl-card-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.pl-card-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.pl-price-sym {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
}

.pl-price-num {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.pl-price-period {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 2px;
}

.pl-card-body {
    padding: 18px 22px;
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.pl-card-foot {
    padding: 0 22px 20px;
}

.pl-buy-btn {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(108,92,231,.08);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
}

.pl-buy-btn:hover {
    background: rgba(108,92,231,.15);
}

/* ====== 空状态 ====== */
.pl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    animation: fadeUp .3s var(--ease-out) both;
}

.pl-empty svg {
    width: 56px;
    height: 56px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.2;
    margin-bottom: 12px;
    opacity: .5;
}

.pl-empty p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* ============================================================
   配置订阅详情页 (plan/:id) - 步骤式布局
   ============================================================ */

/* 步骤指示器 */
.pld-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    animation: fadeUp .3s var(--ease-out) both;
}

.pld-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pld-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pld-step.active .pld-step-num {
    background: var(--accent);
    color: #fff;
}

.pld-step.done .pld-step-num {
    background: #10B981;
    color: #fff;
}

.pld-step-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.pld-step.active .pld-step-text {
    color: var(--text-primary);
}

.pld-step-line {
    width: 40px;
    height: 2px;
    background: var(--divider);
    margin: 0 10px;
}

/* 内容卡片 */
.pld-card {
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    animation: fadeUp .3s var(--ease-out) .05s both;
    overflow: hidden;
}

.pld-card-head {
    padding: 16px 22px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pld-card-head svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pld-card-body {
    padding: 20px 22px;
}

.pld-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 周期选择 - 横向滚动胶囊 */
.pld-period-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.pld-period-scroll::-webkit-scrollbar {
    display: none;
}

.pld-period-chip {
    flex-shrink: 0;
    padding: 14px 22px;
    border: 2px solid var(--divider);
    border-radius: 14px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    min-width: 100px;
}

.pld-period-chip:hover {
    border-color: var(--accent);
}

.pld-period-chip.active {
    border-color: var(--accent);
    background: rgba(108,92,231,.06);
}

.pld-period-chip .chip-name {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.pld-period-chip .chip-price {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

/* 优惠券 */
.pld-coupon-row {
    display: flex;
    gap: 10px;
}

.pld-coupon-input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface-alt);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s;
}

.pld-coupon-input:focus {
    border-color: var(--accent);
}

.pld-coupon-btn {
    height: 44px;
    padding: 0 22px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}

.pld-coupon-btn:hover {
    background: var(--accent-dark);
}

.pld-coupon-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.pld-coupon-result {
    margin-top: 8px;
    font-size: 12px;
}

.pld-coupon-result.success { color: #10B981; }
.pld-coupon-result.error { color: #EF4444; }

/* 底部结算栏 */
.pld-checkout-bar {
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    animation: fadeUp .3s var(--ease-out) .08s both;
}

.pld-checkout-info {
    flex: 1;
}

.pld-checkout-rows {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 6px;
}

.pld-checkout-item {
    font-size: 13px;
    color: var(--text-muted);
}

.pld-checkout-item span {
    color: var(--text-primary);
    font-weight: 500;
}

.pld-checkout-discount {
    color: #10B981 !important;
}

.pld-checkout-total {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.pld-checkout-total-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.pld-checkout-total-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.pld-checkout-btn {
    height: 48px;
    padding: 0 36px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6C5CE7, #7C3AED);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}

.pld-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108,92,231,.3);
}

.pld-checkout-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ====== 确认弹窗 ====== */
.pl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9000;
    animation: fadeIn .15s;
}

.pl-confirm {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: calc(100% - 32px);
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    z-index: 9001;
    animation: scaleIn .2s var(--ease-out) both;
}

.pl-confirm-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 22px 22px 8px;
}

.pl-confirm-msg {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 0 22px 20px;
    line-height: 1.6;
}

.pl-confirm-actions {
    display: flex;
    border-top: 1px solid var(--divider);
}

.pl-confirm-btn {
    flex: 1;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    transition: background .15s;
}

.pl-confirm-btn:first-child {
    border-right: 1px solid var(--divider);
    border-bottom-left-radius: var(--radius-lg);
    color: var(--text-secondary);
}

.pl-confirm-btn:first-child:hover {
    background: var(--surface-alt);
}

.pl-confirm-btn:last-child {
    border-bottom-right-radius: var(--radius-lg);
    color: var(--accent);
}

.pl-confirm-btn:last-child:hover {
    background: rgba(108,92,231,.05);
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
    .pl-banner {
        padding: 24px 20px;
    }

    .pl-banner-title {
        font-size: 18px;
    }

    .pl-grid {
        grid-template-columns: 1fr;
    }

    .pld-steps {
        gap: 0;
    }

    .pld-step-text {
        font-size: 11px;
    }

    .pld-step-line {
        width: 30px;
    }

    .pld-checkout-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .pld-checkout-rows {
        justify-content: center;
    }

    .pld-checkout-total {
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .pl-price-val {
        font-size: 22px;
    }

    .pl-price-circle {
        width: 85px;
        height: 85px;
    }
}
