/* ===== 彈窗遮罩層 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-overlay.open {
    display: flex;
    animation: modal-fade-in 0.2s ease;
}

@keyframes modal-fade-in {
    from { background: rgba(0, 0, 0, 0); }
    to   { background: rgba(0, 0, 0, 0.55); }
}

/* ===== 彈窗主體（底部滑出）===== */
.modal-box {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: modal-slide-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 固定頂部區域（標題 + 關閉按鈕） */
.modal-header {
    flex-shrink: 0;
    padding: 2rem 1.5rem 0;
}

/* 可滾動內容區 */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 2.5rem;
    -webkit-overflow-scrolling: touch;
}

.modal-body::-webkit-scrollbar {
    width: 4px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 2px;
}

@keyframes modal-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* ===== 關閉按鈕 ===== */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    background: #f2f2f2;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 1;
}

.modal-close:active {
    background: #e0e0e0;
}

/* ===== 彈窗圖標 ===== */
.modal-icon {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
}

.modal-icon svg {
    width: 3rem;
    height: 3rem;
}

/* ===== 彈窗文字 ===== */
.modal-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 0.6rem;
}

.modal-desc {
    font-size: 1.2rem;
    color: #555;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.modal-desc strong {
    color: var(--primary-orange);
}

/* ===== 分類小標題 ===== */
.modal-subtitle {
    font-size: 1.25rem;
    font-weight: 800;
    color: #222;
    margin: 1.2rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--primary-orange);
    text-align: left;
}
.modal-subtitle:first-child {
    margin-top: 0;
}

/* ===== 要點列表 ===== */
.modal-list {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    background: #fff8f2;
    border-radius: 0.75rem;
    overflow: hidden;
}

.modal-list li {
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    font-size: 1.2rem;
    color: #444;
    border-bottom: 1px solid #fde8d6;
    position: relative;
    line-height: 1.5;
}

.modal-list li:last-child {
    border-bottom: none;
}

.modal-list li::before {
    content: '✓';
    position: absolute;
    left: 0.9rem;
    color: var(--primary-orange);
    font-weight: 700;
}

/* ===== 立即參與按鈕 ===== */
.modal-btn {
    display: block;
    width: 100%;
    padding: 0.9rem;
    background-color: var(--primary-orange);
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(255, 111, 0, 0.3);
    position: relative;
    overflow: hidden;
    transition: background-color 0.15s;
}

.modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 40%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.15) 60%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: shine 3s ease-in-out infinite;
}

.modal-btn:active {
    background-color: var(--primary-dark);
}

/* ==========================================================================
   PC 桌面端彈窗置中顯示 (≥1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    .modal-overlay {
        align-items: center;
        padding: 2rem;
    }

    .modal-box {
        max-width: 560px;
        border-radius: 20px;
        max-height: 80vh;
        animation: modal-scale-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }

    @keyframes modal-scale-in {
        from { transform: scale(0.9); opacity: 0; }
        to   { transform: scale(1); opacity: 1; }
    }

    .modal-header {
        padding: 2rem 2rem 0;
    }

    .modal-body {
        padding: 0 2rem 2.5rem;
    }

    .modal-close:hover {
        background: #e0e0e0;
    }

    .modal-btn:hover {
        background-color: #E05B00;
    }
}
