/* 轻量通知样式 */
.myps-compare-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: #fff;
    background: #4CAF50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 99999;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.myps-compare-notice-error {
    background: #f44336;
}
.myps-compare-notice.show {
    opacity: 1;
    transform: translateY(0);
}

/* 对比按钮激活状态 */
.compare-btn.active {
    background: var(--main-color);
    color: #fff;
}

/* ========== 移动端对比表格卡片化 ========== */
@media (max-width: 768px) {
    .myps-compare-table thead {
        display: none;
    }

    .myps-compare-table,
    .myps-compare-table tbody,
    .myps-compare-table tr,
    .myps-compare-table td {
        display: block;
        width: 100%;
    }

    .myps-compare-table tr {
        margin-bottom: 16px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
    }

    .myps-compare-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
    }

    .myps-compare-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .myps-compare-table td:last-child {
        border-bottom: none;
    }
}

/* ========== 底部对比弹窗 ========== */
.myps-compare-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    visibility: hidden;
    pointer-events: none;
}
.myps-compare-modal.open {
    visibility: visible;
    pointer-events: auto;
}
.myps-compare-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.myps-compare-modal.open .myps-compare-modal-overlay {
    opacity: 1;
}
.myps-compare-modal-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px 12px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 1025px) {
    .myps-compare-modal-panel {
        width: min(96vw, 1500px);
        margin: 0 auto;
    }
}
.myps-compare-modal.open .myps-compare-modal-panel {
    transform: translateY(0);
}
.myps-compare-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}
.myps-compare-modal-title {
    margin: 0 0 12px;
    font-size: 18px;
}
.myps-compare-modal-content .myps-compare-wrap {
    overflow-x: auto;
    padding: 8px 4px 16px;
}
.myps-compare-modal-content .myps-compare-table {
    font-size: 15px;
}
.myps-compare-modal-content .myps-compare-table th,
.myps-compare-modal-content .myps-compare-table td {
    padding: 12px 16px;
}
.myps-compare-modal-content .myps-compare-table td:first-child {
    min-width: 140px;
}
body.myps-compare-open {
    overflow: hidden;
}