/* 錨點導航 Tab-start */
.breast-disease-nav-section {
    --bd-nav-top: 90px;
    position: sticky;
    top: var(--bd-nav-top);
    z-index: 900;
    padding: 18px 0;
    /* background: linear-gradient(180deg, rgba(253, 248, 248, 0.98) 0%, rgba(255, 252, 245, 0.96) 100%); */
    background-color: var(--tcm-cream);
    /* border-bottom: 1px solid rgba(201, 164, 92, 0.2); */
    box-shadow: 0 6px 20px rgba(44, 36, 22, 0.05);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: box-shadow 0.3s ease;

    &.is-stuck {
        box-shadow: 0 8px 24px rgba(44, 36, 22, 0.08);
    }
}

.breast-disease-tabs-scroll {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    scrollbar-width: thin;
    scrollbar-color: rgba(179, 32, 44, 0.25) transparent;

    &::-webkit-scrollbar {
        height: 4px;
    }

    &::-webkit-scrollbar-thumb {
        background-color: rgba(179, 32, 44, 0.25);
        border-radius: 2px;
    }
}

.breast-disease-nav-inner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.breast-disease-nav-label {
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    font-size: 12px;
    letter-spacing: 0.22em;
    white-space: nowrap;
}

.breast-disease-tabs {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 2px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(179, 32, 44, 0.25) transparent;

    &::-webkit-scrollbar {
        height: 4px;
    }

    &::-webkit-scrollbar-thumb {
        background-color: rgba(179, 32, 44, 0.25);
        border-radius: 2px;
    }
}

.breast-disease-tab {
    flex: 1;
    position: relative;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    font-family: var(--family-font-secondary);
    color: rgba(44, 36, 22, 0.78);
    text-decoration: none;
    white-space: nowrap;
    background: #fff;
    border: 1px solid var(--tcm-border);
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    &::before,
    &::after {
        /* content: '';
        position: absolute;
        width: 41px;
        height: 41px; */
        top: calc(50% - 6px);
        left: calc(50% - 6px);
        opacity: 0;
        pointer-events: none;
        transition:
            top 0.38s cubic-bezier(0.22, 1, 0.36, 1),
            left 0.38s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.28s ease;
    }

    /* &::before {
        border-top: 2px solid var(--primary-color);
        border-right: 2px solid var(--primary-color);
    }

    &::after {
        border-bottom: 2px solid var(--primary-color);
        border-left: 2px solid var(--primary-color);
    } */

    &:hover,
    &.is-active {
        color: var(--primary-color);
        border-color: rgba(179, 32, 44, 0.25);
        /* background: #fff; */

        /* &::before {
            top: -1px;
            left: calc(100% - 41px);
            opacity: 1;
        }

        &::after {
            top: calc(100% - 41px);
            left: -1px;
            opacity: 1;
        } */

        &::before {
            content: '';
            position: absolute;
            /* top: 0;
            right: 0; */
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, transparent 50%, rgba(201, 164, 92, 0.15) 50%);
            /* transition: var(--transition); */
            top: -1px;
            left: calc(100% - 52px);
            opacity: 1;
            z-index: 1;
        }

        .tab-icon {
            &.active {
                display: block;
                opacity: 1;
            }

            &.def {
                display: none;
            }
        }
    }

    &.is-active {
        font-weight: 500;
    }

    .tab-icon {
        width: 30px;
        height: 30px;
        margin-right: 8px;
        opacity: 0.4;

        &.active {
            display: none;
        }

        &.def {
            display: block;
        }
    }
}

/* 錨點導航 Tab-end */

/* 預約-start */
.appoint-form-box {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 32px;
    margin-top: 32px;
    background: #fff;
    border: 1px solid var(--tcm-border);
    padding: 32px;
    box-shadow: var(--tcm-shadow);
}

.calendar-box {
    border: 1px solid var(--tcm-cream);
    padding: 24px;
    background: var(--tcm-paper);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.calendar-header {
    text-align: center;
    margin-bottom: 12px;
}

.calendar-body {
    position: relative;
    min-height: 400px;
}

.calendar-panel {
    width: 100%;
}

.calendar-panel:not(.is-active) {
    display: none;
}

.calendar-label {
    display: block;
    font-size: 14px;
    color: rgba(44, 36, 22, 0.55);
    margin-bottom: 4px;
}

.calendar-selected {
    display: block;
    font-size: 20px;
    font-weight: 500;
    color: rgba(44, 36, 22, 0.4);
    font-family: var(--family-font);
}

.calendar-selected.has-value {
    color: var(--primary-color);
}

#appoint-calendar .layui-laydate {
    box-shadow: none;
    border: none;
    width: 100%;
}

#appoint-calendar .layui-laydate-static {
    width: 100%;
}

#appoint-calendar .layui-laydate-header {
    border-bottom: 1px solid var(--tcm-border);
}

#appoint-calendar .layui-laydate-content td.layui-this {
    background-color: var(--primary-color) !important;
}

#appoint-calendar .layui-laydate-content td:hover {
    background-color: var(--tcm-red-light);
}

.time-picker {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.time-picker-back {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.time-picker-back span {
    font-size: 18px;
    line-height: 19px;
}

.time-picker-back:hover {
    opacity: 0.75;
}

.period-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.period-tab {
    flex: 1;
    height: 40px;
    border: 1px solid var(--tcm-border);
    background: #fff;
    color: var(--tcm-ink);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.period-tab.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

#appoint-time-slots .time-slots {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

#appoint-time-slots .time-slots.is-active {
    display: grid;
}

.time-slot {
    height: 40px;
    border: 1px solid var(--tcm-border);
    background: #fff;
    color: var(--tcm-ink);
    font-size: 14px;
    font-family: var(--family-font);
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-slot:hover:not(.is-disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--tcm-red-light);
}

.time-slot.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.time-slot.is-disabled {
    color: rgba(44, 36, 22, 0.25);
    background: rgba(44, 36, 22, 0.04);
    cursor: not-allowed;
}

.layui-laydate-content td>div {
    display: flex;
    align-items: center;
    justify-content: center;
}

.layui-laydate-content td>div:hover,
.layui-laydate-list li:hover,
.layui-laydate-shortcut>li:hover {
    background-color: var(--tcm-red-light);
}

.laydate-theme-molv .layui-laydate-main {
    width: 100%;
}

.layui-laydate-content table {
    width: 100%;
    height: 400px;
}

.layui-laydate-content td,
.layui-laydate-content th {
    height: 45px;
}

.form-box {
    border-left: 1px solid rgba(179, 32, 44, 0.3);
    padding-left: 32px;
}

.layui-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    row-gap: 30px;
}

.layui-form-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.layui-input-block {
    margin-left: 0;
}

.layui-form-label {
    width: auto;
    text-align: left;
    padding: 10px 0;
    font-size: 16px;
}

.layui-form-label span {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 400;
    margin-left: 5px;
}

.layui-input,
.layui-select,
.layui-textarea {
    height: 48px;
    line-height: 48px;
    font-size: 15px;
    padding-left: 15px;
}

.layui-textarea {
    padding-top: 15px;
    height: 55px;
}

.layui-form-message {
    margin-top: 30px;
}

.layui-input:focus,
.layui-textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 4px 0 rgba(179, 32, 44, 0.1) !important;
}

.appoint-form-btn {
    margin-top: 50px;
    display: flex;
}

.layui-btn {
    height: 45px;
    line-height: normal;
    padding: 0;
    border-radius: 0;
}

.layui-btn:hover {
    opacity: 1;
}

.layui-form-select dl {
    top: 48px;
    height: fit-content;
}

.layui-form-select dl dd.layui-this {
    color: var(--primary-color);
    background-color: rgba(179, 32, 44, 0.05);
}

/* 預約-end */

.red-border {
    width: 100%;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 500;
    color: var(--primary-color);
    letter-spacing: 0.06em;
    background-color: #ffffff;
    border: 1px solid var(--primary-color);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-cta-section {
    padding-top: 0;
}

.sex-outcome-card {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mb {
    display: none !important;
}

@media (min-width: 993px) {
    .pc.sex-cause-grid,
    .pc.sex-type-grid,
    .pc.sex-outcome-grid,
    .pc.sex-dual-panel,
    .pc.sex-intro-dual {
        display: grid !important;
    }

    .pc.sex-timeline {
        display: flex !important;
    }

    .pc.sex-alert-stack {
        display: flex !important;
        flex-direction: column;
    }
}

@media (max-width: 992px) {
    .pc,
    .pc.sex-cause-grid,
    .pc.sex-type-grid,
    .pc.sex-outcome-grid,
    .pc.sex-dual-panel,
    .pc.sex-timeline,
    .pc.sex-intro-dual,
    .pc.sex-alert-stack {
        display: none !important;
    }

    .mb {
        display: flex !important;
    }

    .sex-type-accordion.mb,
    .sex-timeline-accordion.mb,
    .sex-cause-accordion.mb,
    .sex-alert-accordion.mb {
        display: flex !important;
    }

    /* Swiper 容器需 block，避免 .mb flex 造成橫向溢出 */
    .mb.swiper {
        display: block !important;
    }

    .sex-content,
    .sex-treatment-layout,
    .sex-treatment-plan,
    .sex-treatment-outcomes {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .sex-cause-swiper,
    .sex-type-swiper,
    .sex-symptom-swiper,
    .sex-panel-swiper,
    .sex-outcome-swiper {
        margin-left: 0;
        margin-right: 0;
        padding-bottom: 8px;
    }

    .sex-cause-swiper .swiper-pagination,
    .sex-type-swiper .swiper-pagination,
    .sex-symptom-swiper .swiper-pagination,
    .sex-panel-swiper .swiper-pagination,
    .sex-outcome-swiper .swiper-pagination {
        position: relative;
        left: auto !important;
        right: auto;
        width: 100%;
        margin-top: 24px;
        padding-top: 0;
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        text-align: center;
        transform: none !important;
    }

    .sex-cause-swiper .swiper-pagination-bullet,
    .sex-type-swiper .swiper-pagination-bullet,
    .sex-symptom-swiper .swiper-pagination-bullet,
    .sex-panel-swiper .swiper-pagination-bullet,
    .sex-outcome-swiper .swiper-pagination-bullet {
        margin: 0 !important;
    }

    .sex-outcome-swiper .sex-outcome-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 16px 14px;
    }

    .sex-outcome-swiper .sex-outcome-card p,
    .sex-outcome-swiper .sex-outcome-body,
    .sex-outcome-swiper .sex-outcome-body p {
        min-width: 0;
        width: 100%;
        text-align: center;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .main {
        overflow-x: hidden;
    }

    .my-section {
        padding: 30px 0;
    }

    .section-title {
        font-size: 26px;
    }

    .overview-intro {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    .sex-advantage-list {
        flex-direction: column;
    }

    #breastDiseaseNav {
        .breast-disease-tab {
            flex: 0 0 auto !important;

            .tab-icon {
                width: 24px;
                height: 24px;
            }
        }
    }

    .row-box,
    .appoint-form-box {
        grid-template-columns: 1fr;
    }

    .appoint-form-box {
        margin-top: 26px;
        padding: 15px;
    }

    .layui-laydate-content table {
        height: auto;
    }

    .calendar-body {
        min-height: auto;
    }

    .calendar-box {
        padding: 15px;
    }

    .layui-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
        row-gap: 10px;
    }

    .layui-form-select dl {
        top: auto;
    }

    .layui-form-message {
        margin-top: 10px;
    }

    .appoint-form-btn {
        margin-top: 30px;
    }

    .form-box {
        border-left: none;
        border-top: 3px solid var(--primary-color);
        padding-left: 0;
        padding-top: 24px;
    }
}