/* ==========================================================================
 * BUD医生详情页按需样式 (doctor-detail.css)
 * 规范：PC 端统一使用 2K(2560px) 基准 calc(N * var(--u))，仅保留平板/手机结构断点
 * ========================================================================== */

.doctor-detail-page {
    background-color: #ffffff;
    min-height: 100vh;
    padding-top: calc(116 * var(--u));
    padding-bottom: calc(120 * var(--u));
}

/* 顶部医生半身像 Hero 区（复用 list-bg.png 淡化居中作为建筑底图） */
.doctor-hero {
    position: relative;
    width: 100%;
    min-height: calc(560 * var(--u));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    background-color: #ffffff;
}

.doctor-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url(../img/news/list-bg.png);
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: min(92%, calc(2100 * var(--u))) auto;
    opacity: .22;
    pointer-events: none;
}

.doctor-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(120 * var(--u));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
    pointer-events: none;
    z-index: 2;
}

.doctor-hero-portrait-wrap {
    position: relative;
    z-index: 1;
    width: calc(620 * var(--u));
    max-width: 82vw;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-top: calc(28 * var(--u));
}

.doctor-hero-portrait {
    display: block;
    width: 100%;
    max-height: calc(620 * var(--u));
    object-fit: contain;
    object-position: center bottom;
    opacity: 0;
    transform: translateY(calc(24 * var(--u)));
    transition: opacity .65s ease, transform .65s cubic-bezier(.22, 1, .36, 1);
}

.doctor-hero-portrait.is-loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 主体居中卡片容器 */
.doctor-detail-body {
    position: relative;
    z-index: 5;
    width: calc(1060 * var(--u));
    max-width: calc(100% - 32px);
    margin: calc(-26 * var(--u)) auto 0;
    display: flex;
    flex-direction: column;
    row-gap: calc(96 * var(--u));
}

/* 异形卡片（出诊信息 / 医生介绍） */
.detail-card {
    position: relative;
    background: linear-gradient(180deg, #f2f7ff 0%, #f6f9ff 100%);
    border: 1px solid #e6eefc;
    border-radius: calc(36 * var(--u));
    border-top-left-radius: 0;
    padding: calc(44 * var(--u)) calc(46 * var(--u)) calc(48 * var(--u));
    box-shadow: 0 calc(12 * var(--u)) calc(34 * var(--u)) rgba(66, 120, 210, .06);
}

/* 左上角异形页签 */
.card-tab-badge {
    position: absolute;
    left: -1px;
    bottom: calc(100% - 1px);
    height: calc(64 * var(--u));
    padding: 0 calc(46 * var(--u)) 0 calc(30 * var(--u));
    background: #f2f7ff;
    border: 1px solid #e6eefc;
    border-bottom: none;
    border-top-left-radius: calc(24 * var(--u));
    border-top-right-radius: calc(32 * var(--u));
    display: inline-flex;
    align-items: center;
    column-gap: calc(10 * var(--u));
    color: #587ed3;
    font-size: max(14px, calc(24 * var(--u)));
    font-weight: 500;
    line-height: 1;
}

.card-tab-badge::after {
    content: "";
    position: absolute;
    right: calc(-22 * var(--u));
    bottom: 0;
    width: calc(24 * var(--u));
    height: calc(24 * var(--u));
    background: radial-gradient(circle at 100% 0, transparent calc(22 * var(--u)), #f2f7ff calc(23 * var(--u)));
}

.card-tab-icon {
    width: max(16px, calc(26 * var(--u)));
    height: max(16px, calc(26 * var(--u)));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-tab-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 医生名片行 + 右侧 3 个绿色快捷图标 */
.doctor-profile-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(20 * var(--u));
    margin-bottom: calc(36 * var(--u));
}

.doctor-name-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: calc(16 * var(--u));
}

.doctor-main-name {
    font-size: max(22px, calc(48 * var(--u)));
    font-weight: 600;
    color: #1f2937;
    line-height: 1.15;
}

.doctor-title-pill {
    display: inline-block;
    padding: calc(6 * var(--u)) calc(20 * var(--u));
    border-radius: 999px;
    background: #fff3e6;
    color: #c87b32;
    font-size: max(12px, calc(20 * var(--u)));
    font-weight: 500;
    line-height: 1.3;
}

.doctor-action-btns {
    display: flex;
    align-items: center;
    column-gap: calc(14 * var(--u));
    flex-shrink: 0;
}

.action-circle-btn {
    width: max(32px, calc(58 * var(--u)));
    height: max(32px, calc(58 * var(--u)));
    border-radius: 50%;
    border: none;
    background: #17c22e;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease;
    box-shadow: 0 calc(6 * var(--u)) calc(14 * var(--u)) rgba(23, 194, 46, .24);
}

.action-circle-btn:hover {
    transform: translateY(-2px);
    background: #12a826;
    box-shadow: 0 calc(10 * var(--u)) calc(18 * var(--u)) rgba(23, 194, 46, .32);
}

.action-circle-btn svg {
    width: 52%;
    height: 52%;
    display: block;
}

/* 7 天排班矩阵 */
.schedule-matrix-wrap {
    display: flex;
    align-items: stretch;
    column-gap: calc(16 * var(--u));
}

.matrix-left-labels {
    width: calc(68 * var(--u));
    min-width: 44px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    row-gap: calc(20 * var(--u));
}

.matrix-label-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #4b5563;
    font-size: max(12px, calc(20 * var(--u)));
    font-weight: 500;
    line-height: 1.35;
}

.matrix-label-cell.is-date {
    height: calc(104 * var(--u));
    min-height: 64px;
}

.matrix-label-cell.is-period {
    height: calc(104 * var(--u));
    min-height: 68px;
}

.matrix-days-scroll {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.matrix-days-scroll::-webkit-scrollbar {
    height: 4px;
}

.matrix-days-scroll::-webkit-scrollbar-thumb {
    background: rgba(88, 126, 211, .25);
    border-radius: 4px;
}

.matrix-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: calc(18 * var(--u));
}

.day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: calc(20 * var(--u));
}

/* 顶部日期按钮 */
.date-pill-btn {
    position: relative;
    width: 100%;
    height: calc(104 * var(--u));
    min-height: 64px;
    border-radius: calc(20 * var(--u));
    background: #ffffff;
    border: 1px solid #e6edf8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .25s ease;
    color: #374151;
}

.date-pill-btn:hover {
    border-color: #578bf4;
}

.date-pill-btn.active {
    background: linear-gradient(180deg, #5e95ff 0%, #4d7ee6 100%);
    border-color: #4d7ee6;
    color: #ffffff;
    box-shadow: 0 calc(8 * var(--u)) calc(18 * var(--u)) rgba(77, 126, 230, .28);
}

.date-pill-week {
    font-size: max(12px, calc(19 * var(--u)));
    line-height: 1.25;
    opacity: .9;
}

.date-pill-num {
    margin-top: calc(4 * var(--u));
    font-size: max(15px, calc(26 * var(--u)));
    font-weight: 600;
    line-height: 1.1;
}

/* 选中日期右侧德国黑红黄三色竖条 */
.de-flag-bar {
    position: absolute;
    right: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 48%;
    border-radius: 3px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.date-pill-btn.active .de-flag-bar {
    display: flex;
}

.de-flag-bar .f-black {
    flex: 1;
    background: #111111;
}

.de-flag-bar .f-red {
    flex: 1;
    background: #e11d48;
}

.de-flag-bar .f-yellow {
    flex: 1;
    background: #facc15;
}

/* 上午 / 下午号源按钮 */
.slot-btn {
    width: 100%;
    height: calc(104 * var(--u));
    min-height: 68px;
    border-radius: calc(20 * var(--u));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #dce6f7;
    transition: transform .22s ease, box-shadow .22s ease;
}

.slot-btn.is-available {
    cursor: pointer;
    box-shadow: 0 calc(6 * var(--u)) calc(14 * var(--u)) rgba(64, 114, 214, .10);
}

.slot-btn.is-available:hover {
    transform: translateY(-3px);
    box-shadow: 0 calc(12 * var(--u)) calc(22 * var(--u)) rgba(64, 114, 214, .22);
}

.slot-top-tag {
    background: linear-gradient(180deg, #5d93fc 0%, #4b7ee3 100%);
    color: #ffffff;
    font-size: max(11px, calc(18 * var(--u)));
    font-weight: 500;
    text-align: center;
    padding: calc(6 * var(--u)) 0;
    line-height: 1.15;
    flex-shrink: 0;
}

.slot-campus-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #374151;
    font-size: max(11px, calc(18 * var(--u)));
    font-weight: 500;
    line-height: 1.25;
}

.slot-btn.is-disabled {
    background: #eef2f8;
    border-color: #e4eaf3;
    color: #9ca3af;
    align-items: center;
    justify-content: center;
    font-size: max(12px, calc(19 * var(--u)));
    cursor: not-allowed;
}

/* 卡片 2：医生介绍 */
.intro-head-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: calc(16 * var(--u));
    row-gap: calc(6 * var(--u));
    margin-bottom: calc(10 * var(--u));
}

.intro-name {
    font-size: max(22px, calc(46 * var(--u)));
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
}

.intro-title {
    font-size: max(14px, calc(26 * var(--u)));
    font-weight: 500;
    color: #374151;
}

.intro-alias {
    font-size: max(14px, calc(24 * var(--u)));
    font-weight: 600;
    color: #1f2937;
    margin-bottom: calc(24 * var(--u));
}

.intro-honors {
    display: flex;
    flex-direction: column;
    row-gap: calc(10 * var(--u));
    margin-bottom: calc(34 * var(--u));
}

.intro-honor-item {
    font-size: max(13px, calc(21 * var(--u)));
    color: #6b7280;
    line-height: 1.6;
}

.intro-section {
    margin-top: calc(28 * var(--u));
}

.intro-section-label {
    font-size: max(14px, calc(23 * var(--u)));
    font-weight: 600;
    color: #1f2937;
    margin-bottom: calc(12 * var(--u));
}

.intro-section-content {
    font-size: max(13px, calc(21 * var(--u)));
    color: #4b5563;
    line-height: 1.85;
}

.intro-section-content p {
    margin-bottom: calc(12 * var(--u));
}

.intro-section-content p:last-child {
    margin-bottom: 0;
}

/* 卡片 3：医生关联科室科普文章列表 (医生 -> 文章 静态内链) */
.doctor-related-articles-list {
    display: flex;
    flex-direction: column;
}

.doctor-related-article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: calc(20 * var(--u));
    padding: calc(18 * var(--u)) 0;
    border-bottom: 1px dashed #dbe5f5;
    text-decoration: none;
    color: #1f2937;
    transition: color .2s ease;
}

.doctor-related-article-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.doctor-related-article-item:hover {
    color: #2563eb;
}

.doctor-related-article-item .art-title {
    font-size: max(13px, calc(21 * var(--u)));
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doctor-related-article-item .art-date {
    font-size: max(12px, calc(18 * var(--u)));
    color: #9ca3af;
    flex-shrink: 0;
}

/* 详情页加载态 / 异常态 */
.detail-loading-box {
    text-align: center;
    padding: calc(120 * var(--u)) 20px;
    color: #6b7280;
    font-size: max(14px, calc(22 * var(--u)));
}

/* ==========================================================================
 * 通用弹窗 Modal（小程序预约扫码弹窗 + 院区公众号二维码弹窗）
 * ========================================================================== */
.bud-modal-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, .56);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bud-modal-mask.is-open {
    display: flex;
    animation: budModalFadeIn .24s ease forwards;
}

@keyframes budModalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.bud-modal-card {
    position: relative;
    width: 440px;
    max-width: 100%;
    background: #ffffff;
    border-radius: 22px;
    padding: 28px 26px 26px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
    text-align: center;
    animation: budModalPop .28s cubic-bezier(.22, 1, .36, 1) forwards;
}

@keyframes budModalPop {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bud-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    /* background: #f3f4f6; */
    color: var(--color-WeChat);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease, color .2s ease;
}

.bud-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.bud-modal-title {
    font-size: max(25px, calc(36 * var(--u)));
    /* font-weight: 600; */
    color: var(--color-WeChat);
    margin-bottom: 14px;
}

/* 预约摘要胶囊卡片 */
.booking-summary-box {
    /* background: #f4f8ff; */
    border-bottom: 1px solid #e1ecff;
    padding: 12px 16px;
    margin-bottom: 18px;
    text-align: left;
    font-size: max(14px, calc(16 * var(--u)));
    color: #374151;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.booking-summary-item .k {
    color: #6b7280;
    margin-right: 4px;
}

.booking-summary-item .v {
    color: #1f2937;
    font-weight: 600;
}

.booking-summary-item.is-full {
    grid-column: 1 / -1;
}

/* 手机端一键拉起小程序按钮 */
.scheme-launch-btn {
    display: none;
    width: 100%;
    padding: 13px 18px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 100%);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(22, 163, 74, .28);
    /* margin-bottom: 16px; */
    cursor: pointer;
}

.scheme-launch-btn.is-show {
    display: block;
}

/* 小程序码展示盒 */
.qr-stage-box {
    min-height: 224px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.booking-qr-img {
    width: 210px;
    height: 210px;
    object-fit: contain;
    border-radius: 14px;
    /* border: 1px solid #eef2f7; */
    padding: 8px;
    /* background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06); */
}

.booking-qr-tip {
    margin-top: 12px;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.booking-qr-subtip {
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
}

/* 轮询等待动态徽章 */
.booking-polling-badge {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    /* border-radius: 999px; */
    /* background: #eff6ff; */
    color: var(--color-WeChat);
    font-size: max(13px, calc(16 * var(--u)))
}

.booking-polling-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-WeChat);
    animation: budPulseDot 1.3s ease-in-out infinite;
}

@keyframes budPulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .35;
        transform: scale(.75);
    }
}

/* 超时刷新态 */
.booking-timeout-box {
    padding: 20px 10px;
}

.booking-timeout-text {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.bud-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding: 10px 26px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(90deg, #4b7ee3 0%, #5d93fc 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .2s ease;
}

.bud-primary-btn:hover {
    opacity: .92;
}

/* 预约成功态（“恭喜你预约成功”） */
.booking-success-box {
    padding: 12px 6px 4px;
}

.booking-success-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.booking-success-title {
    font-size: 22px;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 10px;
}

.booking-success-desc {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.65;
    margin-bottom: 18px;
}

/* 公众号二维码弹窗院区切换 */
.oa-campus-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.oa-campus-tab {
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid #dbe4f3;
    background: #f8fafc;
    color: #4b5563;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s ease;
}

.oa-campus-tab.active {
    background: #4b7ee3;
    border-color: #4b7ee3;
    color: #ffffff;
}

/* 轻提示 Toast */
.bud-toast {
    position: fixed;
    left: 50%;
    top: 22%;
    transform: translateX(-50%);
    z-index: 10001;
    padding: 10px 22px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .86);
    color: #ffffff;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
}

.bud-toast.is-show {
    opacity: 1;
}

/* ==========================================================================
 * 平板与手机端结构切换与兜底
 * ========================================================================== */
@media screen and (max-width: 1199px) {
    .doctor-detail-page {
        padding-top: 75px;
        padding-bottom: 70px;
    }

    .doctor-hero {
        min-height: 300px;
    }

    .doctor-hero-portrait-wrap {
        width: 340px;
    }

    .doctor-hero-portrait {
        max-height: 340px;
    }

    .doctor-detail-body {
        width: 100%;
        max-width: 780px;
        margin-top: -14px;
        row-gap: 56px;
    }

    .detail-card {
        border-radius: 22px;
        border-top-left-radius: 0;
        padding: 24px 20px 26px;
    }

    .card-tab-badge {
        height: 40px;
        padding: 0 24px 0 16px;
        border-top-left-radius: 14px;
        border-top-right-radius: 20px;
    }
}

@media screen and (max-width: 767px) {
    .doctor-hero {
        min-height: 240px;
    }

    .doctor-hero-portrait-wrap {
        width: 260px;
    }

    .doctor-hero-portrait {
        max-height: 260px;
    }

    .doctor-detail-body {
        max-width: calc(100% - 24px);
        row-gap: 48px;
    }

    .detail-card {
        padding: 20px 14px 22px;
    }

    .doctor-profile-line {
        margin-bottom: 20px;
    }

    .matrix-days-grid {
        min-width: 490px;
        column-gap: 8px;
    }

    .date-pill-btn,
    .slot-btn {
        border-radius: 12px;
    }

    .bud-modal-card {
        padding: 24px 18px 20px;
    }
}