﻿
:root {
    --ts-radius: 16px;
    --ts-radius-sm: 10px;
    --ts-shadow: 0 4px 18px -4px rgba(0,0,0,.08),0 2px 6px rgba(0,0,0,.04);
    --ts-shadow-sm: 0 2px 8px -2px rgba(0,0,0,.08);
    --ts-transition: .25s cubic-bezier(.4,0,.2,1);
    --ts-primary: #005dac;
    --ts-primary-rgb: 0,93,172;
    --ts-danger: #ff7a19;
    --ts-bg: #f4f6f9;
    --ts-surface: #ffffff;
    --ts-surface-alt: #f9fafc;
    --ts-border: #e3e9ef;
    --ts-border-strong: #d3dbe4;
    --ts-gradient: linear-gradient(135deg,var(--ts-primary) 0%,#1c7ed6 55%,#5ba8f0 100%);
}

body {
    background: linear-gradient(135deg, var(--ts-bg) 0%, var(--ts-bg) 55%, #ffffff 100%);
    /*阻擋手機左滑回上一頁*/
    touch-action: pan-y pinch-zoom;
}

/* 投保計畫比較列背景與邊框柔化 */
.ts-plan-items li {
    background: linear-gradient(90deg,#f0f5fa 0%, #ffffff 100%);
    border-color: var(--ts-border);
}

    .ts-plan-items li .plan-value {
        color: var(--color-blue-400, #0b4f84);
    }

        .ts-plan-items li .plan-value.muted {
            color: #9aacb9;
        }

/* Plan 選中欄位動畫 / 過渡顏色一致 */
.plan-col-selected {
    background: rgba(var(--ts-primary-rgb), .14);
}

.ts-page-title {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin: 0 0 .6rem;
}

/* Main wrapper */
.ts-main {
    margin-top: -1rem;
    padding-top: 3.2rem;
}

/* Section */
.ts-section + .ts-section {
    margin-top: 2.5rem;
}

.ts-insured {
    position: relative;
    transition: var(--ts-transition);
}

    .ts-insured:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 28px -6px rgba(0,0,0,.12);
    }

.ts-insured-name {
    font-size: 1rem;
    letter-spacing: .5px;
}

.ts-mini-label {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #50627a;
/*    margin-bottom: .35rem;*/
}

/* Lists */
.ts-plan-list {
    list-style: none;
    padding: 0;
    margin: 0 0 .5rem;
    font-weight: bold;
}

    .ts-plan-list li {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .5rem;
        background: #f3f7fc;
        border: 1px solid #e1e9f3;
        border-radius: 6px;
        padding: .25rem .55rem;
        position: relative;
        color: #2f3d4d;
        transition: background .25s;
    }

        .ts-plan-list li + li {
            margin-top: .45rem;
        }

        .ts-plan-list li i {
            color: var(--ts-primary);
            font-size: 1rem;
        }

/*        .ts-plan-list li:hover {
            background: #e9f2fd;
        }*/

.ts-desc {
    color: #677b8f;
    padding: .15rem .45rem;
}

.ts-total-label {
    font-weight: 600;
    letter-spacing: 1px;
    color: #2d4373;
}

/* 被保險人收合外框樣式 (比照 ConfirmData) */
.ts-insured-outer {
    border: 0.5px solid #fff0ff;
    border-radius: 5px;
    background: #fff;
    /*    padding: 0 0 1rem 0;*/
    box-shadow: 0 2px 5px -2px rgba(0, 0, 0, .08);
    position: relative;
    transition: var(--ts-transition);
}

    .ts-insured-outer + .ts-insured-outer {
        margin-top: 1.1rem;
    }

    .ts-insured-outer:hover {
        transform: translateY(-3px);
        box-shadow: 0px 6px 7px -6px rgba(0, 0, 0, .12);
    }

.ts-insured-header {
    display: flex;
    align-items: center;
    transition: box-shadow .15s;
    /*    gap: .5rem;*/
}

    .ts-insured-header:hover {
        background: #fbf3ff;
    }

    .ts-insured-header .form-check {
        margin: 0;
    }

.ts-insured-trigger {
    /*    display: flex;*/
    /*    align-items: center;
    justify-content: space-between;*/
    /*    gap: .75rem;*/
    /*    padding: .4rem .6rem;*/
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    user-select: none;
    color: var(--ts-primary);
    transition: var(--ts-transition);
}

    .ts-insured-trigger:hover {
        background: #ffffff00;
    }

.ts-insured-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    transition: var(--ts-transition);
}

.ts-insured-trigger:hover .ts-insured-icon {
    background: #fbf3ff;
}

.ts-insured-icon i {
    font-size: 1.05rem;
    transition: transform .25s;
}

.ts-insured-trigger[aria-expanded="true"] .ts-insured-icon i {
    transform: rotate(180deg);
}

.ts-insured-outer .collapse {
    padding-top: 0;
}

/* Detail 標題樣式 */
.ts-detail-title {
    display: inline-block;
    font-weight: 600;
    font-size: 1.05rem;
    padding: .3rem .85rem;
    border-left: 4px solid var(--ts-primary);
    background: #f0f6ff;
    border-radius: 0 6px 6px 0;
    margin: .5rem 0 .75rem;
    letter-spacing: .5px;
}

/* Left / Right 對齊調整 */
.ts-item-left {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    min-width: 0;
}

.ts-plan-list li .ts-desc {
    margin-left: auto;
    font-weight: 600;
    color: var(--ts-primary);
    white-space: nowrap;
}

/* 手機換行後金額靠右 */
@media (max-width:576px) {
    .ts-plan-list li {
        flex-wrap: wrap;
    }

        .ts-plan-list li .ts-desc {
            width: 100%;
            text-align: right;
            margin-top: .25rem;
        }
}

/* Responsive */
@media (max-width: 991.98px) {
    .ts-page-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 575.98px) {
    .ts-page-title {
        font-size: 1.55rem;
    }
}

@media (min-width:768px) and (max-width:991.98px) {
    .ts-page-title {
        font-size: 1.9rem;
    }
    /* 方案欄位 3 -> 2 欄 (原 col-md-4 改 50%) */
    .ts-insured-outer .row.g-3 > .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

        .ts-insured-outer .row.g-3 > .col-md-4:nth-child(3) {
            flex: 0 0 100%;
            max-width: 100%;
        }

    /* 保費合計區塊垂直居中更緊湊 */
    .ts-total .card-body {
        padding: 1rem 1.1rem;
    }
}
/* 介於 576 ~ 767px (加強小平板 / 直向平板) */
@media (min-width:576px) and (max-width:767.98px) {
    .ts-insured-outer .row.g-3 > .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Desktop 表單寬度縮減 */
@media (min-width: 992px) {
    .ts-main > form {
        max-width: 920px;
        margin: 0 auto;
    }
}
/* 超大螢幕再略縮 */
@media (min-width: 1400px) {
    .ts-main > form {
        max-width: 880px;
    }
}

/* 展開時讓標頭 sticky（使用 :has 監聽裡面的 collapse.show） */
.ts-insured-outer:has(> .collapse.show) .ts-insured-header {
    position: sticky;
    top: 0px;
    z-index: 1050;
    background: #fbf3ff;
    box-shadow: 0 1px 2px 0px #e7b3ff;
}
