/**
 * 💰 配音师价格弹窗组件样式
 * 
 * 功能：
 * - 统一的价格弹窗样式
 * - 支持折扣显示和倒计时
 * - 响应式设计
 * - 深色模式支持
 */

/* ========== 弹窗容器（全屏遮罩） ========== */
.teacher-price-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0);
    display: none !important;
    justify-content: center;
    align-items: center;
    z-index: 2147483647 !important; /* 🔧 最大z-index值，确保价格弹窗始终在所有元素之上 */
    margin: 0;
    padding: 0;
    visibility: hidden;
    pointer-events: none;
}

.teacher-price-popup.show,
.teacher-price-popup.closing {
    display: flex !important;
}

.teacher-price-popup.show {
    visibility: visible;
    pointer-events: auto;
    animation: popupOverlayIn 0.25s ease-out forwards;
}

.teacher-price-popup.closing {
    visibility: visible;
    pointer-events: none;
    animation: popupOverlayOut 0.2s ease-in forwards;
}

@keyframes popupOverlayIn {
    from {
        background: rgba(0, 0, 0, 0);
    }
    to {
        background: rgba(0, 0, 0, 0.5);
    }
}

@keyframes popupOverlayOut {
    from {
        background: rgba(0, 0, 0, 0.5);
    }
    to {
        background: rgba(0, 0, 0, 0);
    }
}

/* ========== 弹窗内容区 ========== */
.teacher-price-popup-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.85) translateY(10px);
}

.teacher-price-popup.show .teacher-price-popup-content {
    animation: popupContentIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.teacher-price-popup.closing .teacher-price-popup-content {
    animation: popupContentOut 0.2s ease-in forwards;
}

@keyframes popupContentIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes popupContentOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-5px);
    }
}

/* ========== 关闭按钮 ========== */
.teacher-price-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    font-size: 24px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.teacher-price-popup-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* ========== 标题 ========== */
.teacher-price-popup-title {
    font-weight: 600;
    /* font-size, color, margin-bottom 由后台配置动态生成 */
    padding-right: 40px;
}

/* ========== 折扣信息区 ========== */
.price-discount-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    padding-bottom: 16px;  /* 只保留底部padding */
    border-bottom: 1px solid #ffe0b2;
}

.popup-discount-badge {
    font-size: 14px;
    font-weight: 600;
    color: #ff6b00;
}

.popup-discount-countdown {
    font-size: 13px;
    font-weight: 500;
    color: #999;
}

.popup-discount-countdown.urgent {
    color: #c62828;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========== 价格项 ========== */
.teacher-price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* padding 和 margin 由后台配置动态生成 */
}

.teacher-price-label {
    /* font-size 由后台配置动态生成 */
    color: #666;
     
}

.teacher-price-value {
    /* font-size 和 color 由后台配置动态生成 */
    font-weight: 600;
}

.teacher-price-value .original-price {
    text-decoration: line-through;
    /* color 由后台配置动态生成 */
    font-size: 14px;
    margin-right: 8px;
    font-weight: 400;
}

/* ========== 起配价副注释 ========== */
.price-subnote {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    color: #666;
    font-size: 14px;
}

.price-subnote .original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 8px;
}

/* ========== 备注栏 ========== */
.teacher-price-note {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid #f0f0f0;
}

.price-note-title {
    font-size: 14px;
    font-weight: 600;
    color: #ff6b00;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-note-content {
    font-size: 12px;
    line-height: 1.8;
    color: #666;
    background: #fff9f0;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #ff6b00;
}

/* ========== 深色模式适配（须 !important 覆盖组件内联后台配色） ========== */
body.dark-mode .teacher-price-popup.show {
    animation-name: popupOverlayInDark;
}

@keyframes popupOverlayInDark {
    from { background: rgba(0, 0, 0, 0); }
    to { background: rgba(0, 0, 0, 0.62); }
}

body.dark-mode .teacher-price-popup-content {
    background: #1c1f26 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 12px 40px rgba(0, 0, 0, 0.55) !important;
}

body.dark-mode .teacher-price-popup-title {
    color: #ffffff !important;
}

body.dark-mode .teacher-price-label {
    color: #94a3b8 !important;
}

body.dark-mode .teacher-price-value {
    color: #fb923c !important;
}

body.dark-mode .teacher-price-value .original-price {
    color: #64748b !important;
}

body.dark-mode .price-discount-info {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .popup-discount-badge {
    color: #fb923c !important;
}

body.dark-mode .popup-discount-countdown {
    color: #94a3b8 !important;
}

body.dark-mode .popup-discount-countdown.urgent {
    color: #f87171 !important;
}

body.dark-mode .price-subnote {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

body.dark-mode .price-subnote .original-price {
    color: #64748b !important;
}

body.dark-mode .teacher-price-popup-close {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #94a3b8 !important;
}

body.dark-mode .teacher-price-popup-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}

body.dark-mode .teacher-price-note {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .price-note-title {
    color: #ffffff !important;
}

body.dark-mode .price-note-content {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #cbd5e1 !important;
    border-left: 3px solid rgba(251, 146, 60, 0.55) !important;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .teacher-price-popup-content {
        width: 95%;
        max-width: 350px;
        padding: 24px;
    }
    
    .teacher-price-popup-title {
        /* font-size 和 margin-bottom 由后台配置动态生成 */
    }
    
    .teacher-price-label {
        /* font-size 由后台配置动态生成 */
    }
    
    .teacher-price-value {
        /* font-size 由后台配置动态生成 */
    }
    
    .price-note-content {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .teacher-price-popup-content {
        width: 75%;
        max-width: 320px;
        padding: 20px;
    }
    
    .teacher-price-popup-title {
        /* font-size 由后台配置动态生成 */
    }
    
    .teacher-price-item {
        /* padding 和 margin 由后台配置动态生成 */
    }
}

