﻿/* ============================================================
   医生详情页新版样式（仅 .dd- 前缀，不影响 style.css）
   路径：/cssnew/doctor-detail.css
   ============================================================ */

.dd-article {
    --dd-green: #c59b73;
    --dd-green-d: #96703f;
    --dd-txt: #1f2329;
    --dd-sub: #8b9199;
    --dd-line: #eef0f3;
    margin-top: 16px;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
    color: var(--dd-txt);
    -webkit-font-smoothing: antialiased;
}

.dd-article p { margin: 0; }
.dd-article a { text-decoration: none; -webkit-tap-highlight-color: transparent; }

/* ---------- 医生卡片 ---------- */
.dd-doc {
    position: relative;
    margin-top: -20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 6px 24px rgba(74, 52, 24, .07);
}

.dd-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 24px 28px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(150deg, #f7ead9 0%, #fbf3e8 48%, #fdfaf5 100%);
}

/* 姓名 / 科室 / 机构：头像左侧，垂直居中于背景带内 */
.dd-info {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
}

.dd-hero::before,
.dd-hero::after {
    content: "";
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
}

.dd-hero::before {
    width: 300px; height: 300px;
    right: -110px; top: -170px;
}

.dd-hero::after {
    width: 170px; height: 170px;
    left: -70px; bottom: -120px;
    background: rgba(255, 255, 255, .35);
}

.dd-avatar {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #fff;
    border-radius: 50%;
    /* 无 litpic 时显示统一默认头像（人像剪影）；有真实头像时被内部 <img> 完全覆盖，不产生影响 */
    background-color: #EDEBE7;
    background-image: url("https://www.ybskq.cn/style/img/zj/ybs_common.jpg");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 0 8px 20px rgba(31, 29, 27, .14);
    /* 模板在无图时会输出姓名首字做占位，这里把文字藏掉，只留默认头像 */
    color: transparent;
    font-size: 0;
    font-weight: 600;
    line-height: 1;
    overflow: hidden;
}

/* 真实头像：铺满整个圆形，盖住底下的默认头像 */
.dd-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.dd-body { padding: 4px 28px 0; }

.dd-name {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .5px;
}

.dd-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 7px;
    font-size: 14px;
    color: #6b7280;
}

.dd-meta i {
    display: block;
    width: 1px;
    height: 12px;
    background: #dfe3e8;
}

.dd-org {
    margin-top: 8px;
    font-size: 14px;
    color: var(--dd-sub);
}

/* ---------- 小节 ---------- */
.dd-sec {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--dd-line);
}

.dd-sec-t {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--dd-txt);
}

.dd-sec-t::before {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background: url("https://www.ybs120.com/imgnew/icon-sc.png") center / contain no-repeat;
}

.dd-sec.is-intro .dd-sec-t::before {
    background-image: url("https://www.ybs120.com/imgnew/icon-info.png");
}

.dd-sec-c {
    margin: 14px 0 0;
    font-size: 14.5px;
    line-height: 1.95;
    color: #4b5563;
    word-break: break-word;
}

/* 简介位可能直接输出带 <p> 的职称字段（zc），把内层 p 收成与正文同一套字距 */
.dd-sec-c p {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    text-align: inherit;
}

.dd-sec-c p + p { margin-top: 4px; }

/* ---------- 职称 / 荣誉盒（个人简介下方） ---------- */
.dd-titles {
    margin-top: 14px;
    padding: 12px 18px;
    background: linear-gradient(180deg, #fdf7ef, #fdfbf7);
    border: 1px solid var(--dd-line);
    border-radius: 10px;
}

.dd-titles p {
    margin: 0;
    padding: 2px 0;
    font-size: 13.5px;
    line-height: 1.9;
    text-align: center;
    color: #5b6875;
    word-break: break-word;
}

/* 后台富文本常带着 <p><br/></p> 之类的空行，接模板后自动收掉 */
.dd-titles p:empty { display: none; }
.dd-titles p > br:only-child { display: none; }

/* ---------- 正文（后台 content，位于医生卡片内末尾） ---------- */
.dd-content {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--dd-line);
    font-size: 14.5px;
    line-height: 1.95;
    color: #4b5563;
    word-break: break-word;
}

.dd-content p { margin: 0 0 12px; }
.dd-content p:last-child { margin-bottom: 0; }
.dd-content img { max-width: 100%; height: auto; }
.dd-content p:empty { display: none; }

/* ---------- 门店信息：地址 + 营业时间（一行，放不下自动折行） ---------- */
/* ---------- 门店到店信息：号源卡内的一行（地址 · 营业时间）----------
   不再单独成卡，去掉边框与底色，只做一行小字，随号源卡一起读 */
.dd-shop {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 3px 14px;
    margin: 10px 2px 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: #6b6b6b;
}

.dd-shop-it {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.dd-shop-it .ic {
    flex: 0 0 15px;
    width: 15px;
    height: 21px;              /* 与首行行高一致，图标对齐首行居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dd-green-d);
}

.dd-shop-it b {
    flex: 0 0 auto;
    font-weight: 600;
    color: #8b7358;
}

.dd-shop-it > span {
    flex: 1;
    min-width: 0;
    word-break: normal;        /* 不能在「19:00」这种数字串中间断行 */
    overflow-wrap: anywhere;   /* 但遇到超长无空格串时仍允许折行，避免撑破容器 */
}

/* 营业时间按「周一至周五 …」「周六至周日 …」分段，段内不折行 */
.dd-shop-it .seg {
    display: inline-block;
    margin-right: 12px;
    white-space: nowrap;
}

.dd-shop-it .seg:last-child { margin-right: 0; }

.dd-shop-sep {
    flex: 0 0 1px;
    align-self: center;
    width: 1px;
    height: 12px;
    background: #ecdbc5;
}

/* ---------- 号源模块 ---------- */
/* 数据填充前不占位：旧模板把 #ddSrc 放在正文之前时会露一个空白卡片，填好后自动恢复显示。
   现模板已把卡片放到正文之后，这条只是兜底（JS 异常时不至于留一块白框）。 */
.dd-src:empty { display: none; }

.dd-src {
    margin-top: 26px;
    padding: 20px 22px 18px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 6px 24px rgba(74, 52, 24, .06);
}

.dd-src-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 74px 13px 16px;
    border: 1.5px solid #e8d5b9;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dd-src-head .t {
    flex: 1;
    overflow: hidden;
    font-size: 16px;
    font-weight: 600;
    color: #96703f;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dd-src-head .caret {
    position: absolute;
    right: 16px;
    top: 50%;
    margin-top: -5px;
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #b8bec6;
    transition: transform .2s ease;
}

/* 折叠状态：只留标题条 */
.dd-src.is-fold .dd-shop,
.dd-src.is-fold .dd-tools,
.dd-src.is-fold .dd-scroll,
.dd-src.is-fold .dd-note { display: none; }

.dd-src.is-fold .dd-src-head .caret { transform: rotate(180deg); }

.dd-badge {
    position: absolute;
    right: 12px;
    top: -11px;
    padding: 4px 7px;
    border-radius: 5px;
    background: var(--dd-green);
    color: #4a3418;
    font-size: 12px;
    line-height: 1;
}

.dd-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 14px;
}

.dd-all {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    color: #333;
}

.dd-all i {
    position: relative;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--dd-green);
    border-radius: 50%;
}

.dd-all i::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 8px;
    border: 1.5px solid var(--dd-green);
    border-top: 0;
    border-left: 0;
    transform: rotate(42deg);
}

.dd-tools-r { display: flex; align-items: center; gap: 10px; }

.dd-pager { display: flex; align-items: center; gap: 6px; }

.dd-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #e6e8eb;
    border-radius: 50%;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .16s, background-color .16s, color .16s;
}

.dd-arrow:hover {
    border-color: var(--dd-green);
    background: #fbf3e8;
    color: var(--dd-green);
}

.dd-arrow:disabled {
    border-color: #eef0f2;
    background: #fbfcfd;
    color: #cdd2d8;
    cursor: not-allowed;
}

.dd-scroll {
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}

.dd-scroll::-webkit-scrollbar { height: 5px; }
.dd-scroll::-webkit-scrollbar-thumb { background: #e3e6ea; border-radius: 3px; }

.dd-table {
    display: grid;
    grid-template-columns: 46px repeat(var(--cols, 7), minmax(64px, 1fr));
    gap: 6px;
}

/* 日期表头可点击查看当天排班 */
.dd-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    padding-top: 8px;
    padding-bottom: 8px;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border-radius: 6px;
    transition: background-color .15s ease;
}

.dd-date:hover { background: #fdf6ee; }
.dd-date:hover b, .dd-date:hover span { color: var(--dd-green-d); }

/* 选中态：浅绿底 + 描边 + 底部绿条，一眼能看出当前看的是哪天 */
.dd-date.is-sel {
    background: linear-gradient(180deg, #fbf3e8, #fdfaf5);
    border-radius: 8px 8px 4px 4px;
    box-shadow: inset 0 0 0 1px #ecdbc5, inset 0 -3px 0 var(--dd-green);
}

.dd-date.is-sel b,
.dd-date.is-sel span {
    color: #96703f;
    font-weight: 600;
}

.dd-date.is-sel.is-today b,
.dd-date.is-sel.is-today span { color: #96703f; }

.dd-date b {
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    color: #9aa0a6;
    white-space: nowrap;
}

/* 完整日期：11月11日（不再只显示数字） */
.dd-date span {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--dd-txt);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.dd-date.is-today b,
.dd-date.is-today span { color: var(--dd-green); }

.dd-rowhead {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1.25;
    color: #9aa0a6;
    text-align: center;
}

.dd-slot {
    display: flex;
    min-height: 46px;
}

.dd-btn {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    height: 46px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 8px;
    background: linear-gradient(180deg, #d8b48d 0%, #c59b73 52%, #b0844d 100%);
    color: #4a3418;
    font-size: 15px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease;
    cursor: pointer;
}

.dd-btn:hover {
    border-color: #ead8bd;
    background: #fbf3e8;
    color: var(--dd-green);
}

.dd-btn:active { background: linear-gradient(180deg, #b0844d, #96703f); }

.dd-btn.is-past {
    border-color: #eceff3;
    background: #f3f5f7;
    color: #b7bdc5;
    cursor: not-allowed;
    pointer-events: none;
}

.dd-note {
    margin-top: 10px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #a3a9b1;
}

.dd-empty {
    padding: 26px 0;
    text-align: center;
    font-size: 13.5px;
    color: #a3a9b1;
}

/* ---------- 提示弹框 ---------- */
.dd-mask {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, .45);
    opacity: 0;
    transition: opacity .2s;
}

.dd-mask.on { opacity: 1; }

.dd-modal {
    width: 322px;
    padding: 26px 22px 16px;
    border-radius: 16px;
    background: #fff;
    text-align: center;
    transform: translateY(10px);
    transition: transform .2s;
}

.dd-mask.on .dd-modal { transform: none; }

.dd-modal h4 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 600;
    color: var(--dd-txt);
}

.dd-modal p {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.7;
    color: #6b7280;
}

.dd-modal p b { color: var(--dd-green-d); }

/* 排班详情行 */
.dd-mrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed #f1f3f5;
    font-size: 13.5px;
    line-height: 1.5;
    color: #8b9199;
    text-align: left;
}

.dd-mrow:last-child { border-bottom: 0; }

.dd-mrow b {
    font-weight: 500;
    color: #1f2329;
    text-align: right;
    word-break: break-all;
}

.dd-mrow b.dd-ok { color: #a8804a; }

.dd-modal-acts {
    display: flex;
    gap: 10px;
}

.dd-modal-acts .dd-modal-btn { flex: 1; }

.dd-modal-btn.is-ghost {
    background: #fff;
    border: 1px solid #e6e8eb;
    color: #6b7280;
}

.dd-modal-btn.is-ghost:active { filter: none; background: #f7f8fa; }

.dd-modal-btn {
    display: block;
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #d8b48d 0%, #c59b73 52%, #b0844d 100%);
    color: #4a3418;
    font-size: 15px;
    cursor: pointer;
}

.dd-modal-btn:active { filter: brightness(.96); }

/* ---------- 窄屏 ---------- */
@media (max-width: 620px) {
    .dd-hero { gap: 14px; padding: 16px; }
    .dd-body { padding: 2px 16px 20px; }
    .dd-name { font-size: 21px; }
    .dd-meta { gap: 8px; font-size: 12.5px; }
    .dd-org { margin-top: 6px; font-size: 12.5px; }
    .dd-avatar { width: 96px; height: 96px; border-width: 3px; font-size: 34px; }
    .dd-src { padding: 16px 14px 14px; }
    .dd-shop { margin: 8px 0 0; row-gap: 4px; font-size: 12px; }
    .dd-shop-sep { display: none; }          /* 窄屏折行后分隔线会孤零零挂在行尾，直接隐藏 */
    .dd-shop-it { flex: 1 1 100%; }          /* 地址、营业时间各占一行，避免地址被压断 */
    .dd-content { font-size: 14px; line-height: 1.9; }
    .dd-titles { margin-top: 12px; padding: 10px 12px; }
    .dd-titles p { font-size: 13px; line-height: 1.8; }
    .dd-tools-r { gap: 8px; }
    .dd-pager { gap: 5px; }
    .dd-arrow { width: 26px; height: 26px; }
    .dd-btn { height: 42px; font-size: 14px; }
    .dd-table { grid-template-columns: 40px repeat(var(--cols, 7), minmax(62px, 1fr)); gap: 5px; }
    .dd-date span { font-size: 12.5px; }
    .dd-date b { font-size: 12px; }
}

/* ============================================================
   多机构：机构名按钮（.dd-org-btn）+ 出诊机构弹层（.dd-orgs）
   只有勾了副栏目的医生，模板才渲染 .dd-org-btn；其余医生完全不受影响
   ============================================================ */
.dd-zc { color: #96703f; }

.dd-org-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dd-sub);
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
    transition: color .2s;
}
.dd-org-btn:hover { color: #96703f; }
.dd-org-btn.is-static { cursor: default; }
.dd-org-btn.is-static:hover { color: var(--dd-sub); }
.dd-org-btn.is-static .dd-org-ic { display: none; }

.dd-org-num { font-style: normal; color: #96703f; }

.dd-org-ic { flex: 0 0 auto; margin-top: 1px; transition: transform .2s; }
.dd-org-btn:hover .dd-org-ic { transform: translateY(1px); }

.dd-meta:has(.dd-zc:empty) #ddZcDot { display: none; }

html.dd-orgs-on, html.dd-orgs-on body { overflow: hidden; }

.dd-orgs {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}
.dd-orgs.on { opacity: 1; visibility: visible; }

.dd-orgs__mask {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(28, 22, 16, .46);
}

.dd-orgs__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 540px;
    max-width: calc(100% - 32px);
    max-height: 76vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 26px 64px rgba(0, 0, 0, .24);
    transform: translateY(10px) scale(.98);
    transition: transform .24s cubic-bezier(.2, .8, .3, 1);
}
.dd-orgs.on .dd-orgs__panel { transform: none; }

.dd-orgs__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0ebe3;
}
.dd-orgs__head b { font-size: 17px; font-weight: 600; color: #241d16; }
.dd-orgs__head span { font-size: 13px; color: #a2988b; }

.dd-orgs__x {
    width: 32px; height: 32px;
    margin-left: auto;
    font-size: 22px; line-height: 1;
    color: #8d8478;
    background: none; border: 0; border-radius: 50%;
    cursor: pointer;
    outline: none;
}
.dd-orgs__x:hover { background: #f6f2ec; color: #241d16; }

.dd-orgs__list { padding: 6px 10px 14px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.dd-orgs__it {
    display: block;
    padding: 13px 12px;
    border-radius: 12px;
    text-decoration: none;
    border-bottom: 1px solid #f5f1ea;
}
.dd-orgs__it:last-child { border-bottom: 0; }
.dd-orgs__it:hover { background: #faf7f1; }
.dd-orgs__it.is-cur { background: #fbf6ee; }

.dd-orgs__n {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.5;
    color: #241d16;
}
.dd-orgs__n em {
    font-style: normal;
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    padding: 3px 7px;
    color: #B28247;
    background: #fff;
    border: 1px solid #dcc3a0;
    border-radius: 9px;
}

.dd-orgs__a, .dd-orgs__h {
    position: relative;
    display: block;
    margin-top: 5px;
    padding-left: 34px;
    font-size: 12.5px;
    line-height: 1.65;
    color: #8d8478;
}
.dd-orgs__a::before, .dd-orgs__h::before {
    position: absolute;
    left: 0; top: 0;
    color: #b9b0a3;
}
.dd-orgs__a::before { content: "地址"; }
.dd-orgs__h::before { content: "时间"; }

@media (max-width: 620px) {
    .dd-org-btn { margin-top: 6px; font-size: 12.5px; }
    .dd-orgs { align-items: flex-end; }
    .dd-orgs__panel {
        max-width: 100%;
        width: 100%;
        max-height: 80vh;
        border-radius: 18px 18px 0 0;
        transform: translateY(24px);
    }
    .dd-orgs__head { padding: 16px 16px 12px; }
    .dd-orgs__list { padding: 4px 8px 12px; }
}
