*{margin:0;padding:0;box-sizing:border-box;font-family:system-ui, sans-serif;font-weight: bolder;   -webkit-tap-highlight-color: transparent; user-select: none; }
html{background: #f3f5fa;overflow-x:hidden;}
body{background: #f3f5fa;overflow-x:visible;}
html.no-scroll,body.no-scroll{overflow:hidden;}
/* Toast弹窗 */
.toast{position:fixed;left:50%;bottom:30px;transform:translateX(-50%) translateY(-20px);opacity:0;pointer-events:none;z-index:9999;background:rgba(255, 255, 255, 0.32);color:rgba(30, 30, 30, 0.9);padding:12px 20px;border-radius:35px;transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;white-space:nowrap;}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
/* 侧边栏 */
.sidebar{position: fixed;left:0;top:0;width:260px;height:100%;background: rgba(255,255,255,0.72);backdrop-filter: blur(12px);box-shadow: 2px 0 10px rgba(0,0,0,0.08);padding:24px 18px;z-index:99;transition:transform 0.3s ease;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;border-radius: 0 26px 26px 0;display:flex;flex-direction:column;}
.sidebar .logo{font-size:20px;color:#222;margin-bottom:32px;text-align:center; padding:0% 12px 0% 30px;}
.sidebar .logo .logo-img{width:72px;height:72px;border-radius:50%;display:block;margin:0 auto 10px;box-shadow:0 3px 10px rgba(0,0,0,0.15);}
.sidebar .menu-item{padding:14px 16px;margin:8px 0;border-radius:35px;cursor:pointer;transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;}
.sidebar .menu-item.active{background:#4786FF;color:#fff;}
.sidebar .menu-item:hover:not(.active){background:rgba(71,134,255,0.12);}
/* 移动端菜单按钮 */
.menu-toggle{display:none;position:fixed;top:16px;left:16px;z-index:100;padding:10px 14px;background:#4786FF;color:#fff;border:none;border-radius:35px;cursor:pointer;}
.menu-toggle.hide{display:none;}
/* 主内容区域 */
.main-wrap{margin-left:220px;padding:20px 24px 24px;min-height:100vh;transition:margin-left 0.3s ease;}
/* 页面容器，单页切换 */
.page{position: absolute;top:1px;left:280px;width: calc(100% - 280px);min-height:calc(100vh - 48px);padding:5px 2px;background:#f3f5fa;transform: translateX(40px);opacity:0;pointer-events: none;transition: opacity 0.35s ease, transform 0.35s ease; border-radius: 35px;}
.page.active{opacity:1;transform: translateX(0);pointer-events: auto;}
/* 玻璃卡片 */
.card{background: rgba(255,255,255,0.74);backdrop-filter: blur(10px);border-radius:26px;padding:20px;box-shadow: 0 4px 16px rgba(0,0,0,0.06);margin-bottom:16px;}
#stockFormCard{scroll-margin-top:16px;}
#patientFormCard,#emrFormCard,#prescFormCard,#page5 .card{scroll-margin-top:16px;}
@media print{
    body *{visibility:hidden;}
    #printArea,#printArea *{visibility:visible;}
    #printArea{position:absolute;left:0;top:0;width:100%;box-shadow:none;border:none;background:#fff;padding:16px;margin:0;}
}
.card-title{font-size:22px;margin-bottom:15px;color:#222;text-align:center;font-weight:bold;}
input, select, textarea{width:100%;padding:10px 14px;border:1px solid #dde1ea;border-radius:35px;margin:8px 0 14px;font-weight:normal;outline:none;transition: border-color 0.2s ease;}
input:not([type="checkbox"]):not([type="radio"]), select{height:44px;line-height:42px;padding-top:0;padding-bottom:0;}
/* 日期输入框：隐藏默认日历指示器，用JS创建的自定义图标替代 */
input[type="date"]{
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 84px !important;   /* 右侧留足空间给星期 + 小箭头，避免与日期值黏在一起 */
    height: 44px !important;
    box-sizing: border-box !important;
}
input[type="date"]::-webkit-calendar-picker-indicator{
    display: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
}
/* 时间框原生时钟图标：浅色保持深色，深色模式反白为白色 */
input[type="time"]::-webkit-calendar-picker-indicator{cursor:pointer;}
body.dark input[type="time"]::-webkit-calendar-picker-indicator{filter:invert(1) brightness(1.1);opacity:.85;}
/* 空值占位：用透明色隐藏浏览器原生"年/月/日"，避免与自定义占位重影；不用 display:none，保证日历选择器可正常弹出 */
input[type="date"].dp-empty{color:transparent !important;caret-color:transparent !important;}
input[type="date"].dp-empty::-webkit-datetime-edit{color:transparent !important;}
input[type="date"]:focus{}
.date-weekday{color:#555;}
.date-calendar-icon{color:#a0a6b5;}
.date-calendar-icon svg{display:block;width:23px;height:23px;max-width:none;max-height:none;flex-shrink:0;}
body.dark .date-weekday{color:#c5cbd8;}
body.dark .date-calendar-icon{color:#7a8299;}
body.dark .date-divider{background:#3a4152;}
textarea{border-radius:10px;}
#emrZhusu,#emrXianbing{text-align:center;padding-top:70px;}
#emrTplZhusu,#emrTplXianbing{text-align:center;padding-top:25px;}
input:focus, select:focus, textarea:focus{border-color:#4786FF;}
button{padding:10px 18px;background:#4786FF;color:#fff; border-radius: 35px; border:none;cursor:pointer;transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;margin:4px;}
button:hover{background:#3a6fd1;}
button:active{ transform: scale(0.85);}
.btn-green{background:#22aa66;}
.btn-red{background:#ed4343;}
.btn-out{background:#ff8f1f;}
.btn-out:hover{background:#e67f0d;}
table{width:100%;border-collapse:separate;border-spacing:0;border-radius:10px;overflow:hidden;border:1px solid #e6e8f0;}
table tr:last-child td{border-bottom:none;}
th,td{border-bottom:1px solid #e6e8f0;padding:10px;text-align:center;font-weight:normal;}
th{background:rgba(71,134,255,0.08);}
/* 隐藏原生文件输入 */
.file-input{display:none;}
/* ===== 完善功能新增样式 ===== */
.card-sub{font-size:13px;color:#888;font-weight:normal;margin-left:8px;}
.req{color:#ed4343;font-weight:normal;}
.search-input{margin-bottom:10px;background:#f7f9fc;}
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;}
.btn-plain{background:#fff;color:#4786FF;border:1px solid #4786FF;}
#reuseOpts button{width:100%;}
.btn-blue{background:#2b6de0;}
.btn-mini{padding:4px 10px;font-size:12px;border-radius:10px;}
.drug-line button.btn-mini{border-radius:35px;}
/* 处方多药品行 */
.drug-line{background:rgba(71,134,255,0.05);border:1px solid #e6e8f0;border-radius:26px;padding:12px 14px;margin-bottom:12px;}
#prescLines .drug-line:last-child{margin-bottom:0;}
.drug-line .line-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.drug-line .line-head b{color:#4786FF;font-size:14px;}
.drug-line .dl-qty-text,.drug-line .dl-price{width:100%;margin:4px 0 12px;box-sizing:border-box;}
/* 西药行手风琴折叠：摘要条 */
.drug-line .dl-summary{display:none;flex:1;min-width:0;margin:0 10px;color:#5b6478;font-size:12px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.drug-line.collapsed{padding:10px 14px;}
.drug-line.collapsed .line-head{cursor:pointer;margin-bottom:0;}
.drug-line.collapsed .dl-summary{display:block;}
/* 摘要跑马灯：双份文本供无缝循环，桌面端只显示第一份并省略号截断 */
.drug-line .dl-marquee{display:inline-flex;align-items:center;white-space:nowrap;width:max-content;}
.drug-line .dl-marquee-text{flex:0 0 auto;padding-right:28px;}
.drug-line .dl-marquee-text:last-child{display:none;}
@keyframes dlSummaryMarquee{from{transform:translateX(0);}to{transform:translateX(-50%);}}
@media (max-width:768px){
    .drug-line .dl-summary.marquee .dl-marquee-text:last-child{display:inline;}
    .drug-line .dl-summary.marquee .dl-marquee{animation:dlSummaryMarquee 6s linear infinite;}
}
.drug-line .line-body{overflow:visible;max-height:640px;opacity:1;transform:translateY(0);transition:max-height .28s ease,opacity .22s ease,transform .22s ease;will-change:max-height,opacity;}
.drug-line.collapsed .line-body{overflow:hidden;max-height:0;opacity:0;transform:translateY(-6px);}
body.dark .drug-line .dl-summary{color:#c4cad8;}
/* 统计卡片 */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:16px;}
/* 经营看板：固定列数保证卡片整齐（桌面3列、移动2列） */
#dashCard .stat-grid{grid-template-columns:repeat(3,1fr);gap:12px;}
@media (max-width:768px){#dashCard .stat-grid{grid-template-columns:repeat(2,1fr);}}
.stat-box{background:rgba(255,255,255,0.8);border-radius:12px;padding:16px;box-shadow:0 2px 8px rgba(0,0,0,0.05);text-align:center;}
.stat-box .num{font-size:26px;color:#4786FF;font-weight:900 !important;-webkit-font-smoothing:antialiased;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.stat-box .num.sm{font-size:22px;}
.stat-box .num.xs{font-size:19px;}
.stat-box .lab{color:#666;font-size:13px;margin-top:4px;font-weight:normal;}
/* 近7日营收柱状图 */
.chart-wrap{display:flex;align-items:flex-end;gap:8px;height:150px;margin-top:10px;padding:0 4px;}
.chart-col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;height:100%;}
.chart-bar{width:100%;background:linear-gradient(180deg,#4786FF,#7faaff);border-radius:6px 6px 0 0;min-height:2px;transition:height .3s;}
.chart-day{font-size:11px;color:#888;margin-top:4px;font-weight:normal;}
/* 库存预警高亮 */
tr.warn-low td{background:#fff7e6;}
tr.warn-expire td{background:#ffd0d0;}
tr.warn-danger td{background:#ffd0d0;}
tr.warn-warn td{background:#ffe0b3;}
tr.warn-safe td{background:#fff3b3;}
body.dark tr.warn-low td{background:#3a3118;}
body.dark .badge-low{background:#5a4420;color:#ffca80;}
body.dark tr.warn-expire td,body.dark tr.warn-danger td{background:#4a2525;}
body.dark tr.warn-warn td{background:#4a3820;}
body.dark tr.warn-safe td{background:#4a4420;}
.badge{display:inline-block;padding:1px 8px;border-radius:10px;font-size:12px;font-weight:normal;}
.badge-low{background:#ffe7ba;color:#a26900;}
.badge-expire{background:#ffd9d9;color:#c0392b;}
/* 缺货 / 临期提醒区域 */
#stockAlert .alert-ok{color:#22aa66;font-weight:normal;padding:6px 2px;text-align:center;width:100%;font-size:15px;}
@media (max-width:768px){
    #stockAlert .alert-ok{white-space:nowrap;display:flex;justify-content:center;width:100%;font-size:15px;}
}
#stockAlert .alert-group{text-align:center;}
#stockAlert .alert-title{margin:10px 0 6px;width:280px;font-size:18px;font-weight:bold;color:#c0392b;cursor:pointer;user-select:none;display:inline-flex;align-items:center;gap:6px;text-align:left;}
#stockAlert .alert-group .alert-group .alert-title{width:260px;font-size:16px;}
#stockAlert .alert-group-body{text-align:left;}
#stockAlert .alert-title:hover{opacity:0.8;}
#stockAlert .alert-caret{font-size:12px;color:#999;line-height:1;}
#stockAlert .alert-row{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;margin:6px 0;border-radius:35px;background:#fff7e6;border:1px solid #ffe3a3;}
#stockAlert .alert-row .btn-mini{border-radius:35px;}
#stockAlert .alert-row.expired{background:#ffd0d0;border-color:#ff8080;}
#stockAlert .alert-row.stage-danger{background:#ffd0d0;border-color:#ff8080;}
#stockAlert .alert-row.stage-warn{background:#ffe0b3;border-color:#ffb366;}
#stockAlert .alert-row.stage-safe{background:#fff3b3;border-color:#e6d266;}
#stockAlert .alert-info{font-weight:normal;color:#333;}
body.dark #stockAlert .alert-row.expired,body.dark #stockAlert .alert-row.stage-danger{background:#4a2525;border-color:#a05050;}
body.dark #stockAlert .alert-row.stage-warn{background:#4a3820;border-color:#a07a40;}
body.dark #stockAlert .alert-row.stage-safe{background:#4a4420;border-color:#908840;}
/* 打印处方区域（平时隐藏，打印时只显示处方） */
#printArea{display:none;}
#printArea h2{font-size:22px;text-align:center;font-weight:bold;}
#printArea p{text-align:center;color:#555;font-weight:normal;}
#printArea .presc-info{display:flex;flex-wrap:wrap;gap:12px;margin:8px 0;font-weight:normal;font-size:13px;}
#printArea .presc-days{margin:0 0 4px;color:#444;font-weight:600;font-size:12.5px;}
#printArea .presc-foot{margin-top:12px;display:flex;justify-content:space-between;align-items:center;color:#333;font-weight:normal;}
#printArea .presc-foot .sig-span{display:inline-flex;align-items:center;gap:3px;}
/* 处方笺新版式：顶部两行居中标题(榄塘社区卫生站/处方笺) + 药品明细行 + 签名图（严肃正式，无蓝竖线无emoji） */
#printArea .presc-head{margin-bottom:6px;border-bottom:1px solid #ccc;padding-bottom:6px;}
#printArea .presc-head p{text-align:center;color:#333;font-weight:bold;font-size:18px;margin:0 0 2px;}
#printArea .presc-head h2{font-size:24px;text-align:center;font-weight:bold;margin:0;}
#printArea .presc-cont-head{margin-bottom:8px;padding-bottom:6px;}
#printArea .presc-cont-info{margin:8px 0;gap:10px;font-size:13px;}
#printArea .presc-cont-days{font-size:12.5px;}
#printArea .sig-img{width:90pt;height:60pt;vertical-align:baseline;}
#printArea .sig-img.foot{width:80pt;height:44pt;vertical-align:middle;position:relative;left:-18pt;top:0;}
#printArea .presc-item{margin:5px 0;padding:2px 0;}
#printArea .presc-item-name{font-weight:bold;color:#111;font-size:15px;}
#printArea .presc-item-usage{color:#444;margin:3px 0 0;font-size:14px;}
#printArea .presc-item-note{color:#888;font-size:12px;margin-top:2px;}
#printArea .presc-section-title{font-size:14px;font-weight:bold;margin:8px 0 4px;padding-left:0;border-left:none;}
@media print{
    /* 门诊中药笺 / 西药笺 / 结算笺：固定 A5；格子小方笺走命名页 slip 固定 A4 */
    @page{size:A5;margin:8mm;}
    @page slip{size:A4;margin:8mm;}
    .hp-slip-print,.hp-page,.hp-map-wrap{page:slip;}
    /* 打印单页：只保留处方内容，其余全部隐藏，避免产生多张空白页 */
    body > *:not(#printArea){display:none !important;}
    /* 整页置白底：避免笺面内容短、未铺满 A5 页高时，底部露出页面浅蓝灰背景形成灰框 */
    body{background:#fff !important;}
    #printArea{display:block !important;position:static;width:100%;box-shadow:none;border:none;padding:0;background:#fff;}
    /* 每片笺按 A5 内容区高度（210mm − 上下 16mm = 194mm）铺底贴签名；盒高压到 175mm，底部预留约 19mm 给整块签名行（签名图高约 15.5mm），避免盒底距页边过近、整块签名被 break-inside:avoid 挤到次页；容器 #printArea 自身不撑满，防止把首片往下挤 */
    #printArea .presc-page{display:flex;flex-direction:column;min-height:175mm;}
    #printArea .hrx{display:flex;flex-direction:column;min-height:175mm;}
    #printArea .presc-foot{margin-top:auto;}
    #printArea table{width:100%;border-collapse:collapse;margin:10px 0;}
    #printArea th,#printArea td{border:1px solid #333;padding:8px;text-align:left;}
}
/* ===== 二级菜单（分组导航） ===== */
.menu-group{margin-bottom:2px;}
.menu-group-title{padding:12px 14px;margin:4px 0;border-radius:35px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;text-align:left;color:#333;font-size:15px;transition:background .2s;user-select:none;}
.menu-group-title:hover{background:rgba(71,134,255,0.08);}
.menu-group-title .arrow{font-size:11px;color:#888;transition:transform .25s ease;}
.menu-group-title.collapsed .arrow{transform:rotate(-90deg);}
.menu-group-body{max-height:0;overflow:hidden;opacity:0;transition:max-height .3s ease,opacity .25s ease;}
.menu-group-body.open{max-height:400px;opacity:1;}
.menu-group-body .menu-item{padding-left:0;margin:4px 0;font-size:14px;text-align:center;}
/* 侧边栏底部固定栏：填充系统管理下方的空白 */
.sidebar-footer{margin-top:auto;padding:16px 12px;text-align:center;border-top:1px solid rgba(0,0,0,0.07);background:inherit;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);}
.sidebar-footer .footer-title{font-size:13px;color:#4786FF;font-weight:bold;}
.sidebar-footer .footer-sub{font-size:11px;color:#9aa1b5;margin-top:2px;font-weight:normal;}
/* 侧边栏实时时间：放在“系统管理”分组下方，单个浅灰圆角矩形直接显示时间 */
.sidebar-clock{margin:6px 12px 8px;padding:15px;background:#e8eaf0;border-radius:35px;text-align:center;transition: 0.3s; cursor: pointer;}
.sidebar-clock .clock-time{color:#1a1d23;font-size:15px;font-weight:bolder;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sidebar-clock:active { transform: scale(0.85); }
/* 侧边栏药品出库快捷按钮 */
.sidebar-out{margin:6px 12px 8px;padding:14px;background:#4786FF;color:#fff;border-radius:35px;text-align:center;font-size:15px;font-weight:bold;cursor:pointer;transition:0.3s;box-sizing:border-box;}
.sidebar-out:hover{background:#3b74e6;}
.sidebar-out:active{transform:scale(0.85);}
body.dark .sidebar-out{background:#3a6fd4;color:#fff;}
body.dark .sidebar-out:hover{background:#3563be;}
/* ===== 搜索栏（清空按钮 + 匹配条数） ===== */
.search-row{position:relative;margin-bottom:10px;}
/* 批量删除工具条 */
.batch-bar{display:flex;align-items:center;gap:10px;justify-content:flex-end;margin:0 0 10px;position:relative;}
.batch-bar .batch-toggle-btn{background:#4786FF;color:#fff;border:none;border-radius:35px;padding:10px 20px;font-size:14px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;}
.batch-bar .batch-toggle-btn:hover{box-shadow:0 6px 18px rgba(71,134,255,0.3);}
.batch-bar .batch-del-btn{background:#ed4343;color:#fff;border:none;border-radius:35px;padding:10px 20px;font-size:14px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;}
.batch-bar .batch-del-btn:hover{box-shadow:0 6px 18px rgba(237,67,67,0.35);}
.batch-bar .batch-cancel-btn{background:#eef1f7;color:#555;border:none;border-radius:35px;padding:10px 20px;font-size:14px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;}
.batch-bar .batch-print-btn{background:#4786FF;color:#fff;border:none;border-radius:35px;padding:10px 20px;font-size:14px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;}
.batch-bar .batch-print-btn:hover{box-shadow:0 6px 18px rgba(71,134,255,0.3);}
.batch-bar .batch-cancel-btn:hover{background:#dfe3ee;}
/* 批量删除：1个→2个按钮，原位置柔和衔接出现 */
.batch-toggle-btn.batch-toggle-leave{animation:batchToggleOut 0.18s ease forwards;}
@keyframes batchToggleOut{from{opacity:1;}to{opacity:0;}}
.batch-actions .batch-del-btn,.batch-actions .batch-cancel-btn,.batch-actions .batch-print-btn{opacity:0;transform:translateY(6px);transition:opacity .25s ease,transform .3s cubic-bezier(.2,.7,.3,1);}
.batch-actions.batch-enter .batch-del-btn,.batch-actions.batch-enter .batch-cancel-btn,.batch-actions.batch-enter .batch-print-btn{opacity:1;transform:translateY(0);}
.batch-actions.batch-enter .batch-print-btn{transition-delay:.04s;}
.batch-actions.batch-enter .batch-del-btn{transition-delay:.08s;}
.batch-actions.batch-enter .batch-cancel-btn{transition-delay:.14s;}
/* 两个按钮按下时平滑缩小 */
.batch-actions .batch-del-btn:active,.batch-actions .batch-cancel-btn:active{transform:scale(0.85);}
.drug-total-stat{margin:0 0 10px;font-size:13px;color:#4786FF;font-weight:bold;text-align:right;}
.module-total-stat{margin:0 0 10px;font-size:13px;color:#4786FF;font-weight:bold;text-align:right;}
/* 表格勾选列：默认隐藏，进入批量删除模式才显示 */
.th-check,.td-check{display:none;}
table.batch-mode .th-check,table.batch-mode .td-check{display:table-cell;width:50px;text-align:center;}
@keyframes batchColIn{from{opacity:0;}to{opacity:1;}}
.th-check .batch-check-all{width:90px;height:24px;line-height:22px;padding:0;font-size:13.5px;border-radius:35px;background:#eef1f7;color:#4786FF;border:1px solid #dde1ea;cursor:pointer;white-space:nowrap;text-align:center;box-sizing:border-box;display:inline-block;}
/* 「全选」不能把表头顶高：这一格上下不收内边距，按钮自身高度压在普通表头行高以内 */
table th.th-check{padding-top:0;padding-bottom:0;}
.th-check .batch-check-all.all-checked{background:#4786FF;color:#fff;border-color:#4786FF;}
body.dark .th-check .batch-check-all{background:#2a2f3d;color:#6ea8ff;border-color:#3a4152;}
body.dark .th-check .batch-check-all.all-checked{background:#4786FF;color:#fff;border-color:#4786FF;}
.th-check input,.td-check input{width:17px;height:17px;margin:0;padding:0;cursor:pointer;vertical-align:middle;appearance:auto;}
/* 圆形勾选框 */
.td-check .batch-check{
    appearance:none;-webkit-appearance:none;
    width:20px;height:20px;margin:0;padding:0;box-sizing:border-box;
    border:2px solid #ccd3e0;border-radius:50%;
    background:#fff;cursor:pointer;position:relative;
    vertical-align:middle;
    transition:border-color .2s ease,background .2s ease;
}
.td-check .batch-check:checked{background:#4786FF;border-color:#4786FF;}
.td-check .batch-check:checked::after{
    content:'';position:absolute;left:50%;top:50%;
    width:6px;height:11px;box-sizing:border-box;
    border:solid #fff;border-width:0 2px 2px 0;
    transform:translate(-50%,-50%) rotate(45deg);
    animation:checkDraw .2s ease forwards;
}
@keyframes checkDraw{
    0%{clip-path:inset(100% 0 0 0);opacity:1;}
    100%{clip-path:inset(0 0 0 0);opacity:1;}
}
body.dark .td-check .batch-check{background:#242936;border-color:#3a4152;}
body.dark .td-check .batch-check:checked{background:#4786FF;border-color:#4786FF;}
/* 通用圆形勾选框（与批量删除勾选同款：圆钮 + 白勾 + 描边动画） */
.cb-round{appearance:none;-webkit-appearance:none;width:20px;height:20px;margin:0;padding:0;box-sizing:border-box;border:2px solid #ccd3e0;border-radius:50%;background:#fff;cursor:pointer;position:relative;vertical-align:middle;transition:border-color .2s ease,background .2s ease;}
.cb-round:checked{background:#4786FF;border-color:#4786FF;}
.cb-round:checked::after{content:'';position:absolute;left:50%;top:50%;width:6px;height:11px;box-sizing:border-box;border:solid #fff;border-width:0 2px 2px 0;transform:translate(-50%,-50%) rotate(45deg);animation:checkDraw .2s ease forwards;}
body.dark .cb-round{background:#242936;border-color:#3a4152;}
body.dark .cb-round:checked{background:#4786FF;border-color:#4786FF;}
/* label+span 圆形勾选框：input 隐藏，圆钮与白勾画在 span 上（原生控件自身伪元素在浏览器不渲染） */
.cb-lab{display:inline-flex;align-items:center;flex:none;}
.cb-lab input{position:absolute;opacity:0;width:0;height:0;margin:0;padding:0;border:none;appearance:none;-webkit-appearance:none;pointer-events:none;}
.cb-lab .cb-tick{width:20px;height:20px;box-sizing:border-box;border:2px solid #ccd3e0;border-radius:50%;background:#fff;position:relative;transition:border-color .2s ease,background .2s ease;flex:none;}
.cb-lab input:checked+.cb-tick{background:#4786FF;border-color:#4786FF;}
.cb-lab input:checked+.cb-tick::after{content:'';position:absolute;left:50%;top:50%;width:6px;height:11px;box-sizing:border-box;border:solid #fff;border-width:0 2px 2px 0;transform:translate(-50%,-50%) rotate(45deg);animation:checkDraw .2s ease forwards;}
body.dark .cb-lab .cb-tick{background:#242936;border-color:#3a4152;}
body.dark .cb-lab input:checked+.cb-tick{background:#4786FF;border-color:#4786FF;}
/* 勾选动画改为背景色过渡 + 对勾原地淡入，无transform不位移 */
.search-row .search-input{width:100%;height:44px;padding:0 138px 0 36px;margin:0;box-sizing:border-box;border-radius:35px;}
.btn-search{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:#9aa1b5;pointer-events:none;z-index:2;}
.search-row .search-count{position:absolute;right:42px;top:50%;transform:translateY(-50%);font-size:11px;color:#999;font-weight:normal;white-space:nowrap;pointer-events:none;}
@media(max-width:768px){
    #drugSearchBar{flex-direction:column !important;}
    #drugSearchBar .search-row{width:100% !important;}
    #drugMissingBtn{width:100% !important;padding:0 !important;}
}
.btn-clear{position:absolute;right:14px;top:50%;transform:translateY(-50%) !important;display:none;width:22px;height:22px;padding:0;margin:0;align-items:center;justify-content:center;background:#eef1f7;color:#999;border:none;border-radius:50%;font-size:12px;line-height:1;cursor:pointer;z-index:2;}
.btn-clear.show{display:flex;}
/* hover 仅渐变变色、按钮居中不移动（不弹出“清空”提示） */
.btn-clear:hover{color:#2b6de0;background:linear-gradient(135deg,#d6e7ff,#eef4ff);box-shadow:none;transform:translateY(-50%) !important;}
.btn-clear:hover::after{content:none;}
#prescTemplateClear:hover,#prescNameClear:hover,#prescPickClear:hover{width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,#d6e7ff,#eef4ff);color:#2b6de0;box-shadow:none;transform:translateY(-50%) !important;}
#prescTemplateClear:hover::after,#prescNameClear:hover::after,#prescPickClear:hover::after{content:none;}
#prescTemplateClear:hover::before,#prescNameClear:hover::before,#prescPickClear:hover::before{display:none;}
.btn-clear:active{transform:translateY(-50%) scale(.85);opacity:0.7;}
/* 今日就诊列表排序下拉 */
.sort-row{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:-4px 0 10px;}
.sort-label{font-size:13px;color:#9aa1b5;font-weight:normal;}
.patient-sort{width:auto;flex-shrink:0;margin:0;height:34px;line-height:32px;padding:0 8px;border-radius:35px;font-size:13px;cursor:pointer;background:#fff;border:1px solid #dde1ea;color:#333;}
body.dark .patient-sort{background:#20242f;border-color:#3a4150;color:#eef0f6;}
/* 可搜索患者下拉选择器 */
.search-select{position:relative;}
.search-select-input{width:100%;border-radius:35px;padding-right:40px;margin-top:16px;height:44px;line-height:42px;padding-top:0;padding-bottom:0;}
.search-select-list{position:absolute;left:0;right:0;top:75%;z-index:60;max-height:135px;overflow-y:auto;background:#fff;border:1px solid #dde1ea;border-radius:22px;box-shadow:0 6px 16px rgba(0,0,0,0.12);display:none;margin-top:7px;list-style:none;padding:4px;}
/* 仅药品入库的药品下拉紧贴输入框下方，其他 search-select 保持原样 */
#stockNameList{top:100%;margin-top:2px;}
/* 挂号页姓名框被 .form-row 锁成 44px 高；固定 48px 贴输入框下缘 */
#patNameList{top:48px;margin-top:0;}
/* 处方页患者下拉：紧贴输入框下缘（容器收矮后不再用百分比 top，避免错位抬高） */
#prescPatientList{top:100%;margin-top:4px;}
.search-select-list.show{display:block;}
/* 用量框（西药/中药/注射剂）下拉紧贴输入框下缘 */
.dose-row .search-select-list{top:100%;margin-top:4px;}
/* 用量 / 用法 / 频次等控件一行三等分等宽，包裹层内输入框撑满 */
.dose-row > *{flex:1 1 0%;min-width:0;}
.dose-row .search-select{flex:1 1 0%;min-width:0;}
.dose-row .search-select input{width:100%;}
.search-select-list li{padding:8px 14px;cursor:pointer;border-radius:20px;}
.search-select-list li:hover{background:rgba(71,134,255,0.12);}
.search-select-list li.empty{color:#999;cursor:default;}
/* 患者联想条目：左侧身份信息，右侧就诊次数与最近日期 */
.search-select-list li.p-sel-item{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.p-sel-main{flex:1;min-width:0;}
.p-sel-meta{flex-shrink:0;color:#9aa1b5;font-size:12px;white-space:nowrap;}
body.dark .p-sel-meta{color:#9aa1b5;}
/* 药品入库联想建议条：桌面端药名/规格/库存同一行 */
.ds-suggest{display:flex;flex-direction:column;gap:3px;}
.ds-main{display:flex;align-items:center;gap:8px;width:100%;}
.ds-name{flex:1;min-width:0;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;}
.ds-spec{flex-shrink:0;color:#888;font-size:12px;white-space:nowrap;}
.ds-inv{flex-shrink:0;text-align:right;color:#22aa66;font-size:12px;white-space:nowrap;}
.ds-info{color:#999;font-size:11px;white-space:normal;line-height:1.4;}
/* 附加项目联想条：单行左右排布（名称左、上次价格右），独立于药品/出库通用条 */
.ds-extra{flex-direction:row;align-items:center;gap:10px;}
.ds-extra .ds-main{width:auto;flex:1;min-width:0;}
.ds-extra .ds-name{text-align:left;}
.ds-extra .ds-info{flex-shrink:0;color:#22aa66;font-size:12px;}
@media (max-width:768px){
    /* 手机端流式排布：宽度够规格跟药名同行，再够库存同行；放不下才换行 */
    .ds-main{flex-wrap:wrap;gap:4px 8px;}
    .ds-name{flex:0 1 auto;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
    .ds-spec,.ds-inv{flex:0 0 auto;}
}
/* 遮罩层（移动端抽屉打开时，点击侧边栏外关闭） */
.overlay{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.35);opacity:0;pointer-events:none;transition:opacity .25s ease;z-index:98;display:none;touch-action:pan-y;}
/* 移动端横屏（矮屏）压缩二级菜单，保证可用 */
@media (orientation:landscape) and (max-height:520px){
    .sidebar{padding-top:10px;padding-bottom:10px;}
    .sidebar .logo{margin-bottom:10px;font-size:17px;}
    .menu-group-title{padding:6px 12px;margin:2px 0;}
    .menu-group-body.open{max-height:none;}
}
/* 响应式适配 */
@media (max-width:1000px){
    .menu-toggle{display:block;}
    .overlay{display:block;}
    .sidebar{transform:translateX(-100%);}
    .sidebar.open{transform:translateX(0);}
    .sidebar.open ~ .overlay{opacity:1;pointer-events:auto;}
    .main-wrap{margin-left:0;padding:16px;padding-top:54px;}
    .page{left:16px;width:calc(100% - 32px);top:54px;min-height:calc(100vh - 90px);}
    table{font-size:14px;}
    th,td{padding:6px;}
    /* 移动端二级菜单展开：保留动画但压短到轻快（约0.18s），降低卡顿感 */
    .sidebar .menu-group-body{transition:max-height 0.18s cubic-bezier(0.4,0,0.2,1),opacity 0.12s ease;}
    /* 移动端侧边栏抽屉滑入轻快提速（0.22s），并保留毛玻璃背景 */
    #sidebar{transition:transform 0.22s cubic-bezier(0.4,0,0.2,1);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:rgba(255,255,255,0.12);}
    body.dark #sidebar{background:rgba(24,28,40,0.2);}
    /* 移动端：一级分组标题与二级菜单项等高（纵向 padding / 行高 / 字号 / 外边距统一），后续分组同理 */
    .menu-group-title{padding-top:13px;padding-bottom:13px;margin:4px 0;font-size:15px;line-height:22px;}
    .menu-group-body .menu-item{padding-top:13px;padding-bottom:13px;margin:4px 0;font-size:15px;line-height:22px;}
    /* 移动端：新药品行滚动定位时顶部留出悬浮「菜单」按钮的高度，卡片不被压住 */
    .drug-line{scroll-margin-top:64px;}
}
/* 处方用法用量：一行控件等分等宽（grid 轨道不被下拉文字撑开） */
.dose-row{display:grid;gap:8px;margin:10px 0 14px;grid-template-columns:repeat(auto-fit,minmax(0,1fr));}
.dose-row > *{min-width:0;width:100%;}
.dose-row input,.dose-row select{margin:0;min-width:0;width:100%;}
/* 先/中/后 餐次切换按钮 */
.meal-row{display:flex;gap:8px;margin:0 0 14px;flex-wrap:wrap;}
.meal-btn{margin:0;flex:1;min-width:60px;height:38px;border:1px solid #dde1ea;background:#fff;border-radius:20px;color:#5b6678;font-size:13px;cursor:pointer;transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;display:inline-flex;align-items:center;justify-content:center;gap:2px;outline:none;-webkit-tap-highlight-color:transparent;}
.meal-btn:focus{outline:none;}
.meal-btn.active{background:#2f6fe0;color:#fff;border-color:#2f6fe0;box-shadow:0 3px 10px rgba(47,111,224,0.3);}
.meal-btn .dl-day-num{width:36px;height:auto !important;line-height:1 !important;margin:0;border:none !important;border-radius:0 !important;box-shadow:none !important;background:transparent !important;color:inherit;text-align:center;font-size:13px;padding:0 !important;-moz-appearance:textfield;appearance:none;-webkit-appearance:none;outline:none !important;}
.meal-btn .dl-day-num::-webkit-inner-spin-button,.meal-btn .dl-day-num::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0;}
.meal-btn .dl-day-num:focus{outline:none !important;background:transparent !important;box-shadow:none !important;}
.day-row{display:flex;gap:8px;margin:0 0 14px;}
.day-row .day-btn{width:calc((100% - 16px)/3);flex:none;overflow:hidden;}
/* 本次开药天数 */
.presc-day-total{margin:0 0 14px;padding:10px 14px;background:#f2f7ff;border-radius:14px;border:1px dashed #c6d9fb;}
.presc-day-total label{font-size:13px;color:#5b6678;font-weight:normal;display:block;margin-bottom:6px;}
.day-total-row{display:flex;align-items:center;gap:8px;}
.day-total-row input{width:955px;margin:0;padding:8px 24px;border:1px solid #dde1ea;border-radius:35px;font-size:15px;}
.day-total-row span{color:#5b6678;font-size:14px;}
body.dark .presc-day-total{background:#202a3e;border-color:#3a4c75;}
body.dark .presc-day-total label{color:#b8c2d4;}
body.dark .day-total-row input{background:#20242f;color:#eef0f6;border-color:#3a4152;}
body.dark .day-total-row span{color:#b8c2d4;}
body.dark .meal-btn{background:#20242f;color:#b8c2d4;border-color:#3a4152;}
body.dark .meal-btn.active{background:#2f6fe0;color:#fff;border-color:#2f6fe0;}
/* 移动端禁用 meal-btn 的 hover（避免触摸残留高亮） */
@media (hover:none){
    .meal-btn:hover{background:inherit;color:inherit;border-color:inherit;}
    .meal-btn.active:hover{background:#2f6fe0;color:#fff;border-color:#2f6fe0;}
}
/* 自定义确认弹窗 */
.confirm-dialog{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.4);z-index:10010;display:none;align-items:center;justify-content:center;padding:18px;box-sizing:border-box;}
.confirm-dialog.show{display:flex;}
.confirm-box{background:rgba(255,255,255,0.6);border-radius:28px;padding:24px;max-width:460px;width:100%;max-height:92vh;overflow-y:auto;-webkit-overflow-scrolling:touch;text-align:center;backdrop-filter:blur(35px) saturate(200%);-webkit-backdrop-filter:blur(35px) saturate(200%);}
.confirm-msg{font-size:15px;color:#333;margin-bottom:20px;line-height:1.6;}
/* 弹窗按钮条：贴底独立一条，上分隔线 + 等宽胶囊按钮（1 个占满 / 2 个各半 / 3 个各三分之一，主操作最右） */
.confirm-btns{display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;gap:10px;position:sticky;bottom:0;margin:16px -24px 0;padding:14px 24px 16px;border-top:1px dashed rgba(128,138,156,0.62);background:transparent;z-index:3;}
.confirm-btns::before{content:none;}
body.dark .confirm-btns::before{background:linear-gradient(to bottom,rgba(32,36,47,0),rgba(32,36,47,0.58));}
.confirm-btns button{flex:1 1 0;min-width:0;height:40px;padding:0 10px;margin:0;border-radius:35px;font-size:14px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.confirm-box:has(.confirm-btns){padding-bottom:0;}
body.dark .confirm-btns{background:transparent;border-top-color:rgba(150,170,200,0.45);}}
/* 处方大弹窗本身不滚动，按钮条回到卡片内边距内 */
#prescDlg .confirm-btns{margin:16px 0 0;padding:12px 0 16px;}
}
/* 处方用法用量：一行控件等分等宽（grid 轨道不被下拉文字撑开） */
.dose-row{display:grid;gap:8px;margin:10px 0 14px;grid-template-columns:repeat(auto-fit,minmax(0,1fr));}
.dose-row > *{min-width:0;width:100%;}
.dose-row input,.dose-row select{margin:0;min-width:0;width:100%;}
/* 先/中/后 餐次切换按钮 */
.meal-row{display:flex;gap:8px;margin:0 0 14px;flex-wrap:wrap;}
.meal-btn{margin:0;flex:1;min-width:60px;height:38px;border:1px solid #dde1ea;background:#fff;border-radius:20px;color:#5b6678;font-size:13px;cursor:pointer;transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;display:inline-flex;align-items:center;justify-content:center;gap:2px;outline:none;-webkit-tap-highlight-color:transparent;}
.meal-btn:focus{outline:none;}
.meal-btn.active{background:#2f6fe0;color:#fff;border-color:#2f6fe0;box-shadow:0 3px 10px rgba(47,111,224,0.3);}
.meal-btn .dl-day-num{width:36px;height:auto !important;line-height:1 !important;margin:0;border:none !important;border-radius:0 !important;box-shadow:none !important;background:transparent !important;color:inherit;text-align:center;font-size:13px;padding:0 !important;-moz-appearance:textfield;appearance:none;-webkit-appearance:none;outline:none !important;}
.meal-btn .dl-day-num::-webkit-inner-spin-button,.meal-btn .dl-day-num::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0;}
.meal-btn .dl-day-num:focus{outline:none !important;background:transparent !important;box-shadow:none !important;}
.day-row{display:flex;gap:8px;margin:0 0 14px;}
.day-row .day-btn{width:calc((100% - 16px)/3);flex:none;overflow:hidden;}
/* 本次开药天数 */
.presc-day-total{margin:0 0 14px;padding:10px 14px;background:#f2f7ff;border-radius:14px;border:1px dashed #c6d9fb;}
.presc-day-total label{font-size:13px;color:#5b6678;font-weight:normal;display:block;margin-bottom:6px;}
.day-total-row{display:flex;align-items:center;gap:8px;}
.day-total-row input{width:115px;margin:0;padding:8px 14px;border:1px solid #dde1ea;border-radius:35px;font-size:15px;}
.day-total-row span{color:#5b6678;font-size:14px;}
body.dark .presc-day-total{background:#202a3e;border-color:#3a4c75;}
body.dark .presc-day-total label{color:#b8c2d4;}
body.dark .day-total-row input{background:#20242f;color:#eef0f6;border-color:#3a4152;}
body.dark .day-total-row span{color:#b8c2d4;}
body.dark .meal-btn{background:#20242f;color:#b8c2d4;border-color:#3a4152;}
body.dark .meal-btn.active{background:#2f6fe0;color:#fff;border-color:#2f6fe0;}
/* 移动端禁用 meal-btn 的 hover（避免触摸残留高亮） */
@media (hover:none){
    .meal-btn:hover{background:inherit;color:inherit;border-color:inherit;}
    .meal-btn.active:hover{background:#2f6fe0;color:#fff;border-color:#2f6fe0;}
}
/* 自定义确认弹窗 */
.confirm-dialog{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.4);z-index:10010;display:none;align-items:center;justify-content:center;padding:18px;box-sizing:border-box;}
.confirm-dialog.show{display:flex;}
.confirm-box{background:rgba(255,255,255,0.6);border-radius:28px;padding:24px;max-width:460px;width:100%;max-height:92vh;overflow-y:auto;-webkit-overflow-scrolling:touch;text-align:center;backdrop-filter:blur(35px) saturate(200%);-webkit-backdrop-filter:blur(35px) saturate(200%);}
.confirm-msg{font-size:15px;color:#333;margin-bottom:20px;line-height:1.6;}
/* 弹窗按钮条：贴底独立一条，上分隔线 + 等宽胶囊按钮（1 个占满 / 2 个各半 / 3 个各三分之一，主操作最右） */
.confirm-btns{display:flex;flex-wrap:nowrap;align-items:center;justify-content:center;gap:10px;position:sticky;bottom:0;margin:16px -24px 0;padding:14px 24px 16px;border-top:1px dashed rgba(128,138,156,0.62);background:transparent;z-index:3;}
.confirm-btns::before{content:none;}
body.dark .confirm-btns::before{background:linear-gradient(to bottom,rgba(32,36,47,0),rgba(32,36,47,0.58));}
.confirm-btns button{flex:1 1 0;min-width:0;height:40px;padding:0 10px;margin:0;border-radius:35px;font-size:14px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.confirm-box:has(.confirm-btns){padding-bottom:0;}
body.dark .confirm-btns{background:transparent;border-top-color:rgba(150,170,200,0.45);}}
/* 处方大弹窗本身不滚动，按钮条回到卡片内边距内 */
#prescDlg .confirm-btns{margin:16px 0 0;padding:12px 0 16px;}
/* 深浅色模式切换按钮 */
.theme-toggle{position:fixed;top:var(--moon-top,16px);right:16px;z-index:100;width:40px;height:40px;padding:0;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,0.72);color:#333;border:1px solid #e6e8f0;border-radius:50%;font-size:18px;line-height:1;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,0.1);will-change:transform;isolation:isolate;}
.theme-logout{position:fixed;top:var(--moon-top,16px);right:64px;z-index:100;height:40px;padding:0 14px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,0.72);color:#333;border:1px solid #e6e8f0;border-radius:35px;font-size:13px;line-height:1;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,0.1);will-change:transform;isolation:isolate;}
/* ===== 深色模式 ===== */
html.dark,body.dark{background:#161a26;color:#e8eaf2;}
body.dark .page{background:#161a26;}
body.dark .card{background:rgba(36,41,58,0.85);box-shadow:0 4px 16px rgba(0,0,0,0.35);}
body.dark .card-title{color:#eef0f6;}
body.dark .sidebar{background:rgba(24,28,40,0.92);box-shadow:2px 0 10px rgba(0,0,0,0.4);}
body.dark .sidebar .logo{color:#eef0f6;}
body.dark .menu-group-title{color:#dde1ea;}
body.dark .menu-group-title:hover{background:rgba(71,134,255,0.18);}
body.dark .menu-group-body .menu-item{color:#dde1ea;}
body.dark .menu-group-body .menu-item:hover:not(.active){background:rgba(71,134,255,0.18);}
body.dark .sidebar-footer{border-top-color:rgba(255,255,255,0.08);}
body.dark .sidebar-footer .footer-title{color:#6ea8ff;}
body.dark .sidebar-footer .footer-sub{color:#8b92a6;}
body.dark .theme-toggle{background:rgba(40,45,62,0.9);color:#ffd24a;border-color:#333a4d;box-shadow:0 2px 8px rgba(0,0,0,0.3);}
body.dark .theme-logout{background:rgba(40,45,62,0.9);color:#eef0f6;border-color:#333a4d;box-shadow:0 2px 8px rgba(0,0,0,0.3);}
body.dark .toast{background:rgba(40,45,62,0.45);color:#eef0f6;}
body.dark input,body.dark select,body.dark textarea{background:#20242f;color:#eef0f6;border-color:#3a4152;}
body.dark input::placeholder,body.dark textarea::placeholder{color:#7a8196;}
body.dark .search-input{background:#20242f;}
body.dark .btn-plain{background:#20242f;color:#7fa6ff;border-color:#4786FF;}
body.dark #drugMissingBtn{background:#20242f !important;border-color:#333d51 !important;color:#c3ccdc !important;}
body.dark #drugMissingBtn:hover{background:rgba(71,134,255,.15) !important;color:#8fb4ff !important;border-color:#4786FF !important;}
body.dark table{border-color:#3a4152;}
body.dark table th,body.dark table td{border-color:#3a4152;color:#eef0f6;}
body.dark table th{background:rgba(71,134,255,0.16);}
body.dark .search-row .search-count{color:#8b92a6;}
body.dark .btn-clear{background:#2a2f3d;color:#9aa1b5;}
body.dark .search-select-list{background:#20242f;border-color:#3a4152;}
body.dark .search-select-list li{color:#eef0f6;}
body.dark .drug-line{background:rgba(71,134,255,0.12);border-color:#333a4d;}
body.dark .sidebar-clock{background:rgba(36,41,58,0.85)!important;}
body.dark .sidebar-clock .clock-time{color:#eef0f6!important;}
body.dark .stat-box{background:rgba(36,41,58,0.85);box-shadow:0 2px 8px rgba(0,0,0,0.3);}
body.dark .stat-box .lab{color:#aab0c2;}
body.dark .emr-tpl-bar{background:rgba(36,41,58,0.85)!important;border-color:#333a4d!important;}
body.dark .emr-tpl-bar .emr-tpl-label{color:#eef0f6;}
body.dark #followupCardWrap{background:rgba(36,41,58,0.85)!important;border-color:#5a4a1f!important;}
body.dark #followupCardWrap .card-title{color:#eef0f6!important;}
body.dark .chart-day{color:#8b92a6;}
body.dark .confirm-box{background:rgba(32,36,47,0.55);backdrop-filter:blur(35px) saturate(200%);-webkit-backdrop-filter:blur(35px) saturate(200%);}
body.dark .confirm-msg{color:#eef0f6;}
body.dark .card-sub{color:#8b92a6;}
body.dark #stockAlert .alert-row{background:#3a3118;border-color:#5a4a1f;}
body.dark #stockAlert .alert-title{color:#ff8a80;}
body.dark #stockAlert .alert-info{color:#d8dce6;}
body.dark .dose-row input,body.dark .dose-row select{background:#20242f;color:#eef0f6;border-color:#3a4152;}
/* ===== 局域网同步卡片 深色模式适配（覆盖内联浅色渐变） ===== */
/* 主机地址输入框：明确可见的外框线（之前只有很淡的 1px 内联色 + 阴影，看起来像没边框） */
#lanHost{border:1px solid #cfd7e6 !important;border-radius:35px;box-shadow:0 2px 6px rgba(0,0,0,0.05) !important;}
#doctorName{border:1px solid #cfd7e6 !important;border-radius:35px;box-shadow:0 2px 6px rgba(0,0,0,0.05) !important;}
#lanHost:focus,#doctorName:focus{border-color:#4786FF !important;box-shadow:0 0 0 3px rgba(71,134,255,0.12),0 2px 8px rgba(71,134,255,0.1) !important;}
body.dark #lanHost,body.dark #doctorName{border-color:#3a4152 !important;}
body.dark .lan-sync-card{background:rgba(36,41,58,0.85) !important;border-color:#3a4152 !important;}
body.dark .lan-sync-card .card-title{color:#eef0f6 !important;}
body.dark .lan-sync-card label{color:#b8c2d4 !important;border-color:#3a4152 !important;}
body.dark .lan-sync-card input{background:#20242f !important;color:#eef0f6 !important;border-color:#3a4152 !important;}
body.dark .lan-sync-card input::placeholder{color:#7a8196 !important;}
body.dark .lan-sync-card #lanInfo{color:#8b92a6 !important;}
/* 表单两列同行 */
.form-row{display:flex;gap:12px;}
/* 规格+入库数量：PC 端同行排列 */
.spec-qty-row{display:flex !important;gap:12px;align-items:flex-start;}
.spec-qty-row>div{flex:1;min-width:0;}
.form-row>div{flex:1;min-width:0;}
/* 处方售价 + 单位选择（同一行），移动端整块换行 */
.rx-unit-line{display:flex;gap:8px;align-items:center;}
.rx-unit-line #stockRxPrice{flex:1;min-width:0;margin:8px 0 14px;}
.rx-unit-line .stock-unit-select{flex:0 0 92px;width:92px;margin:8px 0 14px;top:0 !important;}
.rx-unit-line .unit-mgr-btn{flex:none;margin:8px 0 14px;white-space:nowrap;top:0 !important;}
/* 药品条码扫码模块 */
.scan-wrap{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end;margin-bottom:10px;}
.barcode-input-wrap{position:relative;flex:1 1 auto;min-width:0;order:1;}
.barcode-input-wrap input[type=text]{width:100%;padding-right:34px;margin:0;}
.barcode-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:none;width:22px;height:22px;padding:0;margin:0;align-items:center;justify-content:center;background:#eef1f7;color:#999;border:none;border-radius:50%;font-size:12px;line-height:1;cursor:pointer;z-index:2;}
.barcode-clear.show{display:flex;}
.barcode-clear:hover{color:#4786FF;background:rgba(71,134,255,0.1);}
body.dark .barcode-clear{background:#2a2f3d;color:#9aa1b5;}
.scan-btn{flex:0 0 110px;width:110px;height:44px;line-height:1;padding:0 8px;margin:0;border-radius:35px;background:#4786FF;color:#fff;border:none;font-size:14px;cursor:pointer;white-space:nowrap;box-shadow:0 3px 8px rgba(71,134,255,0.22);order:2;display:inline-flex;align-items:center;justify-content:center;gap:5px;}
.scan-btn:hover{background:#3a78f0;}
#drugScanBtn:hover,#outScanBtn:hover{transform:none !important;}   /* 扫码(video)按钮去掉 hover 上浮 */
.barcode-reader{position:relative;width:100%;max-height:280px;margin-top:8px;display:none;border-radius:32px;overflow:hidden;background:#000;}
.barcode-reader video,.barcode-reader img,.barcode-reader canvas,.barcode-reader>div{width:100%!important;max-width:none!important;max-height:280px!important;object-fit:cover;}
.barcode-reader *{max-height:280px!important;}
.torch-btn{position:absolute;left:50%;transform:translateX(-50%);bottom:8px;padding:6px 16px;border-radius:35px;background:rgba(0,0,0,0.6);color:#fff;border:1px solid rgba(255,255,255,0.45);font-size:13px;cursor:pointer;z-index:3;}
/* 闪光灯：扫码画面右上角圆形浮钮（不占布局，开扫码后才出现） */
.torch-fab{position:absolute;right:10px;top:10px;width:42px;height:42px;max-height:42px!important;padding:0;border-radius:50%;background:rgba(0,0,0,0.55);color:#fff;border:1px solid rgba(255,255,255,0.5);display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:8;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);transition:background .18s,color .18s,border-color .18s;}
.torch-fab svg{width:20px;height:20px;max-height:20px!important;display:block;}
.torch-fab.on{background:#ffd24d;color:#3a2c00;border-color:#ffe48a;box-shadow:0 0 12px rgba(255,210,77,0.65);}
.torch-fab:active{transform:scale(.9);}
/* 扫码定位框（四角 + 扫描线） */
.scan-frame{position:absolute;left:50%;top:50%;width:78%;height:44px;transform:translate(-50%,-50%);pointer-events:none;z-index:5;}
.scan-frame i{position:absolute;width:22px;height:22px;border:3px solid #4cffb0;}
.scan-frame .sc-tl{left:0;top:0;border-right:none;border-bottom:none;border-top-left-radius:8px;}
.scan-frame .sc-tr{right:0;top:0;border-left:none;border-bottom:none;border-top-right-radius:8px;}
.scan-frame .sc-bl{left:0;bottom:0;border-right:none;border-top:none;border-bottom-left-radius:8px;}
.scan-frame .sc-br{right:0;bottom:0;border-left:none;border-top:none;border-bottom-right-radius:8px;}
.scan-frame .sc-line{position:absolute;left:8px;right:8px;top:50%;height:2px;border:none;border-radius:2px;background:linear-gradient(90deg,transparent,#4cffb0,#4cffb0,transparent);box-shadow:0 0 8px rgba(76,255,176,0.8);animation:scanMove 2s ease-in-out infinite;}
/* html5-qrcode 路径：白色四角框（覆盖在相机画面上） */
.scan-frame.scan-frame-white i{border-color:#fff;}
.scan-frame.scan-frame-white .sc-line{background:linear-gradient(90deg,transparent,#fff,#fff,transparent);box-shadow:0 0 8px rgba(255,255,255,0.8);}
@keyframes scanMove{0%{top:8%;}50%{top:92%;}100%{top:8%;}}
.barcode-title{display:block;margin-bottom:12px;}
.scan-hint{flex:1 1 100%;order:3;font-size:13px;color:#4786FF;margin:2px 0 0;min-height:0;line-height:1.5;}
body.dark .scan-btn{background:linear-gradient(135deg,#4c8aff,#2b62d0);}
/* 出生日期：改为单个日期输入框 */
.birth-input{width:100%;margin:8px 0 14px;padding:10px 12px;line-height:1.4;padding-right:38px;}
/* 确认弹窗内置输入框（如清空数据输入 yes） */
.confirm-input{width:100%;margin:12px 0 4px;padding:10px 12px;border:1px solid #d8dce6;border-radius:35px;background:#f4f6fb;color:#333;font-size:14px;outline:none;box-sizing:border-box;}
.confirm-input:focus{border-color:#4786FF;box-shadow:0 0 0 3px rgba(71,134,255,0.12);}
body.dark .confirm-input{background:#2a2f3a;border-color:#3a4050;color:#eef0f6;}
.confirm-hint{min-height:20px;margin:6px 0 2px;font-size:13px;text-align:left;line-height:1.5;}
.confirm-hint.err{color:#e54d42;}
.confirm-hint.ok{color:#18a058;}
/* 性别：改为两个单选按钮（胶囊样式，选中高亮） */
.sex-radio{display:flex;gap:8px;align-items:center;margin:8px 0 14px;}
.sex-opt{display:flex;align-items:center;justify-content:center;gap:6px;flex:1;height:40px;border:1px solid #d8dce6;border-radius:35px;background-color:#f4f6fb;color:#333;font-size:14px;cursor:pointer;line-height:1;overflow:hidden;}
.sex-opt input{appearance:none;-webkit-appearance:none;width:18px;height:18px;border-radius:50%;border:2px solid #c3cad6;background:transparent;margin:0;padding:0;flex-shrink:0;position:relative;cursor:pointer;}
.sex-opt input:focus{transform:none;box-shadow:none;outline:none;}
.sex-opt input::after{content:'';position:absolute;inset:2px;border-radius:50%;background:#2b6de0;opacity:0;transition:none;}
.sex-opt input:checked{border-color:#2b6de0;}
.sex-opt input:checked::after{opacity:1;}
.sex-opt span{display:inline-flex;align-items:center;line-height:1;}
.sex-opt:has(input:checked){border-color:#2b6de0;background:linear-gradient(135deg,#d6e7ff,#eef4ff);color:#1d5ed8;font-weight:500;}
body.dark .sex-opt{background-color:#2a2f3a;border-color:#3a4050;color:#eef0f6;}
body.dark .sex-opt input{border-color:#4a5266;}
body.dark .sex-opt input::after{background:#4c8aff;}
body.dark .sex-opt input:checked{border-color:#4c8aff;}
body.dark .sex-opt:has(input:checked){border-color:#4c8aff;background:linear-gradient(135deg,#1e3a6b,#2a2f3a);color:#7ab0ff;}
/* 年龄：单位做成输入框右侧圆角按钮（带下拉箭头） */
.age-input{display:flex;gap:6px;align-items:center;margin:8px 0 14px;}
.age-input input{flex:1;min-width:0;margin:0;}
.age-input .age-unit{flex-shrink:0;width:76px;height:40px;line-height:38px;text-align:center;margin:0;padding:0 26px 0 4px;border:1px solid #d8dce6;border-radius:35px;background-color:#f4f6fb;color:#333;font-size:14px;outline:none;-webkit-appearance:none;appearance:none;cursor:pointer;background-image:linear-gradient(45deg,transparent 50%,#888 50%),linear-gradient(135deg,#888 50%,transparent 50%);background-position:calc(100% - 13px) center,calc(100% - 9px) center;background-repeat:no-repeat;background-size:5px 5px;}
body.dark .age-input .age-unit{background-color:#2a2f3a;border-color:#3a4050;color:#eef0f6;background-image:linear-gradient(45deg,transparent 50%,#9aa1b5 50%),linear-gradient(135deg,#9aa1b5 50%,transparent 50%);}
/* 处方患者框：输入框改块级，消除 inline-block 底部基线间隙，收紧上方多余留白 */
.presc-form #prescPatient{display:block;margin-top:8px;}
/* 处方开具按钮：品牌蓝系配色（主操作亮蓝渐变，次要浅蓝描边，重置中性） */
.presc-form .btn-row button{background:linear-gradient(135deg,#5b9bff,#2f6fe0);color:#fff;border:none;box-shadow:0 4px 12px rgba(71,134,255,0.26);}
.presc-form .btn-row button.btn-blue{background:#eef4ff;color:#2f6fe0;border:1px solid #c6d9fb;box-shadow:none;}
.presc-form .btn-row button.btn-plain{background:#fff;color:#5b6678;border:1px solid #dfe4ec;box-shadow:none;}
body.dark .presc-form .btn-row button{background:linear-gradient(135deg,#4c8aff,#2b62d0);}
body.dark .presc-form .btn-row button.btn-blue{background:#243049;color:#9dc0ff;border-color:#3a4c75;}
body.dark .presc-form .btn-row button.btn-plain{background:#2a3040;color:#b8c2d4;border-color:#3c4458;}
/* 操作按钮一行（移动端也尽量同行） */
.btn-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
.btn-row button{flex:1;margin:0;min-width:0;}
.stock-action-row{align-items:center !important;}
.stock-action-row button{padding:0 14px !important;font-size:14px !important;height:36px !important;line-height:36px !important;align-self:center !important;margin:2px !important;}
/* 快捷报表导出：两个按钮同一行、同宽、铺满整个盒子（所有屏宽生效） */
.report-btn-row{display:flex;gap:8px;}
.report-btn-row button{flex:1 1 0%;max-width:none;margin:0;min-width:0;white-space:normal;}
.charge-action-row{flex-wrap:wrap;}
.charge-action-row button{height:42px;display:inline-flex;align-items:center;justify-content:center;text-align:center;}
.charge-action-row button:nth-child(-n+2){flex:1 1 46%;max-width:none;}
.charge-action-row button:nth-child(n+3){flex:1 1 31%;max-width:none;}
.btn-gray{background:#f1f3f6;color:#5b6678;border:1px solid #d9dfe8;}
.btn-gray:hover{background:#e6eaef;color:#3d4557;box-shadow:0 6px 18px rgba(120,140,170,0.2);}
button[onclick*="reset"]{background:#f1f3f6;color:#5b6678;border:1px solid #d9dfe8;box-shadow:none;transition:transform 0.2s cubic-bezier(0.4,0,0.2,1),background-color 0.2s,box-shadow 0.2s !important;}
button[onclick*="reset"]:hover{background:#e6eaef;color:#3d4557;transform:translateY(-3px) !important;box-shadow:0 6px 18px rgba(120,140,170,0.2);}
button[onclick*="reset"]:active{transform:translateY(0) scale(0.85) !important;}
body.dark button[onclick*="reset"]{background:#2a3040;color:#b8c2d4;border-color:#3c4458;}
body.dark button[onclick*="reset"]:hover{background:#323a4d;}
body.dark .btn-gray{background:#2a3040;color:#b8c2d4;border-color:#3c4458;}
body.dark .btn-gray:hover{background:#323a4d;}
/* ========== 欠费(赊账)记录盒子 ========== */
.debt-box{margin-top:14px;border:1px solid #e6e8f0;border-radius:18px;background:#f7f9fc;padding:12px;}
.debt-title{font-size:15px;font-weight:bold;color:#222;text-align:center;margin-bottom:10px;}
.debt-head{display:flex;align-items:center;gap:8px;margin-bottom:10px;}
.debt-search{flex:1;min-width:120px;height:36px;padding:0 12px;border:1px solid #dde1ea;border-radius:35px;background:#fff;font-size:13px;outline:none;box-shadow:none;}
.debt-add{flex-shrink:0;height:36px;padding:0 14px;font-size:13px;}
.debt-list{max-height:260px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;}
.debt-empty{text-align:center;color:#999;padding:16px 0;font-size:13px;}
.debt-item{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid #e6e8f0;border-radius:14px;padding:10px 12px;}
.debt-info{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;}
.debt-name{font-weight:bold;color:#222;font-size:14px;}
.debt-amt{color:#e03e3e;font-weight:bold;font-size:14px;}
.debt-time{color:#9aa1b5;font-size:12px;}
.debt-btns{display:flex;gap:6px;flex-shrink:0;}
.debt-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:32px;padding:0 12px;border:none;border-radius:35px;cursor:pointer;transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease; ease;position:relative;font-size:13px;}
.debt-btn svg{width:15px;height:15px;flex-shrink:0;}
.debt-btn:hover{transform:none;}
.debt-edit{background:#eef4ff;color:#2f6fe0;}
.debt-edit:hover{background:#dbe9ff;}
.debt-settle{background:#e8f7ee;color:#23a55a;}
.debt-settle:hover{background:#d2f0e0;}
#debtDlg .confirm-box{max-width:375px;width:100%;}
.debt-search-sel{flex:1;min-width:0;}
.debt-search-wrap{display:flex;align-items:center;flex:1;min-width:0;height:44px;border:1px solid #d3d9e8;border-radius:35px;background:#fff;box-sizing:border-box;padding-left:16px;overflow:visible;position:relative;transition:border-color .25s ease,box-shadow .25s ease;}
.debt-search-wrap:focus-within{border-color:#4786FF;box-shadow:0 0 0 3px rgba(71,134,255,0.12);}
.debt-search-wrap::before{content:'';position:absolute;left:16px;top:50%;transform:translateY(-50%);width:18px;height:18px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat center/contain;pointer-events:none;z-index:1;}
.debt-search-wrap .debt-search-sel{flex:1;min-width:0;height:100%;display:flex;align-items:center;position:static !important;}
.debt-search-wrap .search-select-input{border:none !important;outline:none !important;box-shadow:none !important;background:transparent !important;height:100%;padding-left:26px !important;}
.debt-search-wrap .search-select-list{left:0 !important;right:0 !important;top:100% !important;margin-top:3px !important;width:100% !important;}
.debt-search-wrap .sel-clear{display:none !important;}
.debt-search-wrap .debt-add-btn{height:34px;border-radius:18px !important;margin-right:5px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:0 14px;font-size:14px;transform:none !important;box-shadow:none !important;}
body.dark .debt-search-wrap{background:#20242f;border-color:#3a4152;}
/* 弹窗内输入框聚焦发光 */
.confirm-dialog input:focus,.confirm-dialog select:focus,.confirm-dialog textarea:focus{border-color:#4786FF !important;box-shadow:0 0 0 3px rgba(71,134,255,0.12) !important;}
.confirm-dialog .mgr-search-wrap:focus-within{border-color:#4786FF;box-shadow:0 0 0 3px rgba(71,134,255,0.12);}
.debt-dlg-body{padding:4px 4px 8px;}
.debt-dlg-patient{background:#f2f5fa;border:1px solid #e6e8f0;border-radius:35px;padding:10px 14px;font-weight:bold;color:#333;margin:4px 0 12px;min-height:22px;outline:none;cursor:text;}
.debt-dlg-patient:empty::before{content:'输入或选择患者姓名';color:#a0a6b5;font-weight:normal;}
.debt-dlg-patient:focus{border-color:#4786FF;}
body.dark .debt-box{background:#20242f;border-color:#3a4152;}
body.dark .debt-item{background:#262b38;border-color:#3a4152;}
body.dark .debt-name{color:#eef0f6;}
body.dark .debt-search{background:#20242f;color:#eef0f6;border-color:#3a4152;}
body.dark .debt-dlg-patient{background:#20242f;border-color:#3a4152;color:#eef0f6;}
/* 输入框阴影（textarea 除外） */
input,select{box-shadow:0 2px 6px rgba(0,0,0,0.05);}
/* 滚动条：隐藏垂直滚动条，仅保留水平滚动条（表格横向滚动用） */
::-webkit-scrollbar{width:0;height:8px;}
::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.18);border-radius:10px;}
::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,0.3);}
::-webkit-scrollbar-track{background:transparent;}
/* 去掉 textarea 右下角拖拽调整大小的手柄 */
textarea{resize:none;}
/* 患者列表按日期分组 */
.patient-date-group td{background:rgba(71,134,255,0.08);text-align:left;padding:8px 14px;}
.patient-date-group .date-label{color:#4786FF;font-weight:bold;font-size:14px;}
.patient-date-group .date-count{float:right;color:#999;font-weight:normal;font-size:12px;}
body.dark .patient-date-group td{background:rgba(71,134,255,0.16);}
body.dark .patient-date-group .date-label{color:#7faaff;}
/* 区域排序下的入库时间子分组：浅一档、字号略小、左侧缩进，与区域主分组区分 */
.patient-date-group.date-sub-group td{background:rgba(71,134,255,0.04);padding:6px 14px 6px 30px;}
.patient-date-group.date-sub-group .date-label{color:#64748B;font-size:13px;}
body.dark .patient-date-group.date-sub-group td{background:rgba(71,134,255,0.08);}
body.dark .patient-date-group.date-sub-group .date-label{color:#94a3b8;}
/* 表格数据尽量单行 */
table th,table td{white-space:nowrap;}
/* 锁定横向溢出，防止运行时盒子晃动 */
html{overflow-x:hidden;}
/* 深色模式补充 */
body.dark input,body.dark select{box-shadow:0 2px 6px rgba(0,0,0,0.4);}
body.dark .btn-search{color:#6b7280;}
/* 患者选择器清空叉（有内容才显示） */
.search-select .sel-clear{position:absolute;right:12px;top:50%;transform:translateY(-50%) !important;display:none;width:22px;height:22px;padding:0;margin:0;align-items:center;justify-content:center;background:#eef1f7;color:#999;border:none;border-radius:50%;font-size:12px;line-height:1;cursor:pointer;z-index:2;}
.form-row .search-select .sel-clear{top:50%;}
.search-select .sel-clear.show{display:flex;}
.search-select .sel-clear:hover{color:#2b6de0;background:linear-gradient(135deg,#d6e7ff,#eef4ff);box-shadow:none;transform:translateY(-50%) !important;}
.search-select .sel-clear:hover::after{content:'清空';position:absolute;left:calc(100% + 8px);top:50%;transform:translateY(-50%);white-space:nowrap;font-size:12px;color:#2b6de0;background:linear-gradient(135deg,#d6e7ff,#eef4ff);padding:3px 8px;border-radius:6px;line-height:1;}
.search-select .sel-clear:active{transform:translateY(-50%) scale(.85);opacity:0.7;}
/* 处方药品名清除按钮：定位在输入框内部右侧 */
.dl-name{padding-right:36px;}
.dl-name-clear{position:absolute !important;right:14px !important;top:30px !important;transform:translateY(-50%) !important;width:24px !important;height:24px !important;display:none;align-items:center;justify-content:center;background:#eef1f7;color:#999;border:none;border-radius:50%;font-size:12px;cursor:pointer;z-index:5;}
.dl-name-clear.show{display:flex;}
.dl-name-clear:hover{color:#2b6de0;background:linear-gradient(135deg,#d6e7ff,#eef4ff);box-shadow:none;}
.dl-name-clear:hover::after{content:'清空';position:absolute;left:calc(100% + 8px);top:50%;transform:translateY(-50%);white-space:nowrap;font-size:12px;color:#2b6de0;background:linear-gradient(135deg,#d6e7ff,#eef4ff);padding:3px 8px;border-radius:6px;line-height:1;z-index:6;}
.presc-template-del:hover{transform:none !important;box-shadow:none;}
/* 常用配方逐行数据：点击整行套用，行内右侧编辑/删除按钮 */
.presc-tpl-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:7px 6px;border-bottom:1px dashed #eef0f6;cursor:pointer;border-radius:10px;box-sizing:border-box;transition:background .2s;}
.presc-tpl-row:hover{background:rgba(71,134,255,0.06);}
.presc-tpl-name{font-weight:bold;color:#2b6de0;font-size:13px;line-height:1.4;min-width:0;word-break:break-all;}
.presc-tpl-name small{color:#888;font-weight:normal;}
.presc-tpl-actions{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;}
body.dark .presc-tpl-row{border-bottom-color:#2a2f3d;}
body.dark .presc-tpl-name{color:#7fb0ff;}
body.dark .presc-tpl-name small{color:#9aa1b5;}
body.dark .dl-name-clear{background:#2a2f3d;color:#9aa1b5;}
/* 药品库存：输入框 + 单位下拉（参考年龄单位排版）+ 管理单位按钮（圆角统一35px） */
.stock-inv-row{display:flex;align-items:center;gap:8px;}
.stock-inv-row input{flex:1;margin:0;border-radius:35px;}
.stock-unit-select{flex-shrink:0;width:80px;height:44px;padding:0 26px 0 10px;border-radius:35px;border:1px solid #dde1ea;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center/12px;font-size:14px;color:#333;cursor:pointer;box-sizing:border-box;line-height:44px;position:relative;top:4px;appearance:none;-webkit-appearance:none;-moz-appearance:none;}
.stock-unit-select:focus{outline:none;border-color:#4786FF;}
.unit-mgr-btn{flex-shrink:0;height:44px;padding:0 12px;border-radius:35px;border:1px solid #dde1ea;background:#eef1f7;color:#4786FF;font-size:13px;cursor:pointer;white-space:nowrap;position:relative;top:2px;}
.unit-mgr-btn:hover{background:#e3e9f6;}
/* 快速组方：整行可点击选中 + 用量加减控件 */
.presc-pick-row{display:flex;align-items:center;gap:8px;padding:6px 4px;border-bottom:1px dashed #eef0f6;cursor:pointer;border-radius:35px;transition:background .2s;}
.presc-pick-row:hover{background:rgba(71,134,255,0.06);}
.presc-pick-row.checked{background:rgba(71,134,255,0.12);}
.presc-pick-row .presc-pick-cb{
    -webkit-appearance:none;
    appearance:none;
    width:20px;
    height:20px;
    border:2px solid #c8cedd;
    border-radius:50%;
    background:#fff;
    cursor:pointer;
    flex-shrink:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    position:relative;
    margin:0;
    padding:0;
    outline:none;
    transition:border-color .15s,background .15s;
}
.presc-pick-row .presc-pick-cb:checked{
    border-color:#4786FF;
    background:#4786FF;
}
.presc-pick-row .presc-pick-cb:checked::after{
    content:'';
    position:absolute;
    left:50%;
    top:50%;
    width:5px;
    height:9px;
    border:solid #fff;
    border-width:0 2px 2px 0;
    transform:translate(-50%,-55%) rotate(45deg);
    animation:checkDraw .2s ease forwards;
}
.presc-pick-name{flex:1;min-width:0;line-height:1.3;}
.presc-pick-stepper{display:inline-flex;align-items:center;gap:2px;flex-shrink:0;}
.presc-pick-stepper .presc-pick-qty{width:56px;padding:5px 4px;font-size:12px;border:1px solid #dde1ea;border-radius:8px;box-sizing:border-box;text-align:center;margin:0;box-shadow:none;}
.sp-btn{width:28px;height:28px;flex-shrink:0;padding:0;border:1px solid #dde1ea;border-radius:50%;background:#f4f6fb;color:#4786FF;font-size:16px;font-weight:bold;line-height:1;cursor:pointer;box-shadow:none;display:flex;align-items:center;justify-content:center;}
.sp-btn:hover{background:#e3e9f6;color:#2b6de0;transform:none;}
body.dark .presc-pick-row.checked{background:rgba(71,134,255,0.22);}
body.dark .presc-pick-row:hover{background:rgba(71,134,255,0.14);}
/* 热门药品排行 */
.trend-toggle{display:inline-flex;gap:4px;margin-left:8px;vertical-align:middle;}
.rank-sort-select{height:28px;border:1.5px solid #e2e8f0;background:#fff;color:#4a5160;border-radius:35px;padding:0 10px;font-size:12px;cursor:pointer;outline:none;box-shadow:none;}
.rank-sort-select:focus{border-color:#4786FF;}
/* 入库表单字段的校验提示：紧贴输入框下方（输入框自带 14px 下边距，这里拉回来） */
#tip_stockSpec,#tip_stockNum,#tip_stockRetail{margin-top:-8px !important;line-height:1.35;}
body.dark .rank-sort-select{background:#20242f;color:#eef0f6;border-color:#3a4152;}
.stat-box.dash-click{cursor:pointer;}
.dash-click:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(71,134,255,0.16);}
.trend-btn{border:1px solid #d3d9e8;background:#fff;border-radius:35px;padding:2px 12px;font-size:12px;cursor:pointer;color:#333;line-height:1.6;}
.trend-btn.active{background:#4786FF;color:#fff;border-color:#4786FF;}
.range-date-row{margin-top:8px;}
.range-date-field{flex:1;min-width:120px;display:flex;flex-direction:column;gap:3px;width:100%;}
.range-date-field .range-label{font-size:13px;color:#666;line-height:1.2;padding-left:12px;}
/* PC 端：日期框和中间的 ~ 垂直对齐（~ 贴底并与输入框同高，正好落在框的中线上）；移动端不受影响 */
@media (min-width:769px){
    .range-date-row .date-tilde{align-self:flex-end;height:44px;display:flex;align-items:center;justify-content:center;line-height:1;font-size:18px;color:#8a8f9c;}
}
.range-date-field .date-filter-input{margin:0;width:100%;}
body.dark .range-date-field .range-label{color:#9aa1b5;}
@media (max-width:768px){
    /* 移动端：起/止两个日期各占一行，隐藏中间的 ~ */
    .range-date-field{flex-basis:100%;}
    .range-date-row .range-date-field{flex:0 0 100%;width:100%;}
    .range-date-row .date-tilde{display:none;}
}
.emr-tpl-bar{display:flex;flex-direction:column;align-items:stretch;gap:6px;margin:10px 0 4px;padding:0;border:none;background:transparent;}
.emr-tpl-label{font-size:13px;font-weight:600;color:#333;flex-shrink:0;}
.emr-tpl-btns{display:flex;gap:8px;flex-wrap:wrap;}
.emr-tpl-btns button{flex:1 1 0;}
.emr-tpl-bar select{flex:1;min-width:160px;border:1px solid #d3d9e8;border-radius:35px;padding:0 36px 0 14px;font-size:13px;height:44px;box-sizing:border-box;appearance:none;-webkit-appearance:none;-moz-appearance:none;margin-top:12px;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center/12px;}
.emr-tpl-bar button{border-radius:35px !important;padding:0 14px;font-size:14px;height:44px;display:inline-flex;align-items:center;justify-content:center;}
/* 常用病历模板：搜索 + 下拉联想（与上方患者选择器同一套） */
.emr-tpl-bar .emr-tpl-sel{flex:0 0 auto;min-width:0;width:100%;position:relative;display:block;height:44px;}
/* 模板搜索框与患者搜索框用同一套外观：这里只改定位，输入框/下拉列表全部继承 .search-select 默认样式 */
.emr-tpl-bar .emr-tpl-sel .search-select-input{margin:0;height:44px;display:block;}
.emr-tpl-bar .emr-tpl-sel .sel-clear{top:22px;}
.emr-tpl-bar .emr-tpl-sel .search-select-list{top:100%;margin-top:4px;transform:none;}
@media (max-width:1100px){
    .emr-tpl-bar .emr-tpl-sel{flex:0 0 auto;width:100%;min-width:0;}
    .emr-tpl-btns button{flex:1 1 0;min-width:0;}
}
@media (max-width:768px){
    .emr-tpl-bar select{flex:1 1 100%;min-width:0;}
    .emr-tpl-bar button{flex:1 1 0;min-width:0;}
    .emr-tpl-bar .emr-tpl-sel{flex:0 0 auto;width:100%;min-width:0;}
}
.stock-export-btn{float:right;margin-top:2px;border-radius:35px;}
.followup-print-btn{border-radius:35px !important;margin-left:4px;}
.hot-drug-row{display:flex;align-items:center;gap:8px;margin:5px 0;font-size:13px;flex:0 0 auto;}
.hot-drug-name{flex:0 0 auto;min-width:0;white-space:nowrap;line-height:1.3;color:#333;}
.hot-drug-bar{flex:0 0 90px;min-width:90px;height:14px;background:#eef1f7;border-radius:35px;overflow:hidden;}
.hot-drug-fill{display:block;height:100%;background:linear-gradient(90deg,#4786FF,#5b8df8);border-radius:35px;min-width:4px;}
.hot-drug-num{flex:0 0 auto;text-align:right;color:#2b6de0;font-weight:bold;white-space:nowrap;}
/* 排行类图表（药品/病种/毛利）：竖向名次榜，信息密度更高，不用横向拖 */
#profitChart,#hotDrugChart,#hotDiseaseChart,#rangeDiseaseChart{display:block;height:auto;padding:0;overflow:visible;}
.rank-list{display:flex;flex-direction:column;gap:6px;max-height:288px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;padding:2px 2px 2px 0;}
.rank-row{display:flex;align-items:center;gap:8px;padding:4px 6px;border-radius:12px;font-size:13px;transition:background .15s;}
.rank-row.clickable{cursor:pointer;}
.rank-row:hover{background:#f4f7fd;}
.rank-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px;}
.rank-meta{font-size:11px;color:#9aa1b5;line-height:1.25;white-space:normal;word-break:break-word;}
.rank-no{flex:0 0 20px;height:18px;line-height:18px;text-align:center;font-size:11px;font-weight:bold;color:#8a8f9c;background:#f0f3f9;border-radius:7px;}
.rank-no.top1{background:#ffe9c7;color:#b8730b;}
.rank-no.top2{background:#e6ecf6;color:#5c6b82;}
.rank-no.top3{background:#ffe2d4;color:#b4612a;}
.rank-name{flex:1 1 auto;min-width:0;white-space:normal;word-break:break-word;line-height:1.3;color:#333;}
.rank-bar{flex:0 0 84px;height:10px;background:#eef1f7;border-radius:35px;overflow:hidden;}
.rank-fill{display:block;height:100%;background:linear-gradient(90deg,#4786FF,#5b8df8);border-radius:35px;min-width:3px;}
.rank-val{flex:0 0 auto;min-width:44px;text-align:right;font-weight:bold;color:#2b6de0;white-space:nowrap;}
.rank-val.pos{color:#2fa45f;}
.rank-val.neg{color:#e5484d;}
.rank-sub{flex:0 0 auto;min-width:40px;text-align:right;font-size:11px;color:#9aa1b5;white-space:nowrap;}
body.dark .rank-row:hover{background:#242a38;}
body.dark .rank-no{background:#2a303d;color:#9aa1b5;}
body.dark .rank-name{color:#eef0f6;}
body.dark .rank-meta{color:#7c8497;}
body.dark .rank-bar{background:#2a2f3d;}
body.dark .rank-val{color:#7fb0ff;}
body.dark .hot-drug-name{color:#eef0f6;}
body.dark .hot-drug-bar{background:#2a2f3d;}
/* 处方开单界面：该患者历史处方（一键复方入口） */
.presc-hist-head{font-size:13px;color:#4786FF;font-weight:bold;margin-bottom:6px;}
.presc-hist-item{display:flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid #e6e8f0;border-radius:35px;margin-bottom:6px;background:rgba(71,134,255,0.04);}
.presc-hist-info{flex:1;min-width:0;}
.presc-hist-time{display:block;font-size:12px;color:#888;margin-bottom:2px;}
.presc-hist-drugs{display:block;font-size:13px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.presc-hist-btn{flex-shrink:0;border-radius:35px !important;}
/* 历史处方摘要跑马灯：双份文本无缝循环（与西药折叠摘要条同款） */
.presc-hist-drugs .mq{display:inline-flex;align-items:center;white-space:nowrap;width:max-content;}
.presc-hist-drugs .mq-text{flex:0 0 auto;padding-right:28px;}
.presc-hist-drugs .mq-text:last-child{display:none;}
@media (max-width:768px){
    .presc-hist-drugs.marquee .mq-text:last-child{display:inline;}
    .presc-hist-drugs.marquee .mq{animation:dlSummaryMarquee 6s linear infinite;}
}
/* 可长按/点击查看详情的历史条目 */
.presc-hist-info, .hist-card.presc-click{cursor:pointer;}
body.dark .presc-hist-item{border-color:#333a4d;background:rgba(71,134,255,0.1);}
body.dark .presc-hist-time{color:#9aa1b5;}
body.dark .presc-hist-drugs{color:#eef0f6;}
body.no-animation .presc-hist-drugs.marquee .mq{animation:dlSummaryMarquee 6s linear infinite !important;}
/* 入库候选主名跑马灯：双份文本无缝循环，仅手机端溢出时启用，桌面端省略号截断 */
.ds-name .ds-mq{display:inline-flex;align-items:center;white-space:nowrap;width:max-content;}
.ds-name .ds-mq-text{flex:0 0 auto;padding-right:28px;}
.ds-name .ds-mq-text:last-child{display:none;}
@media (max-width:768px){
    .ds-name.marquee .ds-mq-text:last-child{display:inline;}
    .ds-name.marquee .ds-mq{animation:dlSummaryMarquee 6s linear infinite;}
}
body.no-animation .ds-name.marquee .ds-mq{animation:dlSummaryMarquee 6s linear infinite !important;}
body.dark .unit-mgr-btn{background:#2a2f3d;color:#6ea8ff;border-color:#3a4152;}
body.dark .search-select .sel-clear{background:#2a2f3d;color:#9aa1b5;}
/* 两列布局中的搜索框：与同行普通输入框顶部对齐 */
.form-row .search-select-input{margin-top:0;}
.form-row .search-select{margin-top:8px;height:44px;}
/* --- 日期范围筛选行 --- */
.date-filter-row{display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap;}
/* 查找/重置按钮独占一行并居中 */
.date-btn-row{display:flex;justify-content:center;gap:8px;width:100%;margin-top:2px;}
/* 查找/重置按钮等宽：两按钮平均分配且限制最大宽度，保持一致不铺满 */
.date-btn-row button{flex:1;margin:0;min-width:0;}
.date-filter-input{flex:1;min-width:120px;margin:0;height:44px;min-height:44px;line-height:42px;padding-top:0;padding-bottom:0;padding-left:14px;padding-right:14px;font-size:14px;-webkit-appearance:none;appearance:none;box-sizing:border-box;}
.date-tilde{color:#999;font-weight:normal;font-size:16px;flex-shrink:0;}
@media (max-width:768px){
    /* 移动端：处方售价（含单位）单独一行，低库存预警单独一行 */
    .rx-low-row{display:block !important;}
    .rx-low-row>div{width:100%;}
    /* 移动端：药品名称与药品别称各占一行 */
    .name-alias-row{flex-wrap:wrap;}
    .name-alias-row>div{flex-basis:100%;}
    /* 移动端：规格与入库数量放同一行 */
    .spec-qty-row{display:flex !important;gap:10px;align-items:flex-start;}
    .spec-qty-row>div{flex:1;width:auto;}
    /* 移动端：联想条目 hover 圆角统一为 35px */
    .search-select-list li{border-radius:35px !important;}
    /* 移动端：两个日期框保持同一行（横排），右内边距减小到刚好容纳星期+箭头，保证日期值与星期完整显示 */
    .date-filter-input{padding-right:100px !important;}
    /* 移动端：年龄独占一行，联系电话换到下一行 */
    .age-phone-row{flex-wrap:wrap;}
    .age-phone-row .age-block{flex-basis:100%;}
    /* 移动端：姓名独占一行，性别换到下一行 */
    .name-sex-row{flex-wrap:wrap;}
    .name-sex-row>div:first-child{flex-basis:100%;}
    /* 移动端：药品条码输入框独占一行，扫码/相册按钮换到下一行且等宽铺满 */
    .scan-wrap{flex-wrap:wrap;justify-content:flex-start;}
    .barcode-input-wrap{flex-basis:100%;}
    .scan-wrap .scan-btn{flex:1 1 0% !important;width:0 !important;max-width:none !important;padding:0 8px !important;}
    /* 移动端：生产日期 / 有效期至 分成两行（各自独占一行，日期完整显示） */
    .date-pair-row{flex-direction:column;gap:0;}
    /* 移动端：所有 date 筛选框（起始/结束日期）分成两行，且与普通输入框同高 */
    .date-filter-row{flex-direction:column;}
    .date-filter-row .date-tilde{display:block;text-align:center;margin:1px 0;line-height:1;flex-shrink:0;}
    .date-filter-input{height:44px;box-sizing:border-box;}
    /* 移动端：查找/重置、入库保存/重置 等按钮铺满盒子（等宽、占满整行） */
    .date-btn-row button{flex:1 1 0%;max-width:none;}
    .btn-row button{flex:1 1 0%;max-width:none;}
    /* 移动端：收费结算四个操作按钮分成两行（每行两个） */
    .charge-action-row button{flex:1 1 48%;max-width:none;white-space:normal;padding:10px 6px;}
    /* 移动端：库存清单顶部四个圆形操作按钮分成两行（每行两个） */
    .stock-action-row button{flex:1 1 46%;max-width:none;white-space:normal;min-height:38px;height:38px;display:flex;align-items:center;justify-content:center;line-height:1.3;}
    /* 移动端：快捷报表导出按钮更紧凑（等宽铺满已在通用规则中） */
    .report-btn-row button{padding:10px 6px;font-size:13px;}
    /* 移动端：用量独占一行，用法/频率第二行 */
    .dose-row{flex-wrap:wrap;}
    .dose-row .dl-dose{flex:1 1 100%;}
    .dose-row .dl-route,.dose-row .dl-freq{flex:1 1 0%;}
    /* 移动端：库存数量+单位同一行，管理单位按钮独占第二行 */
    .stock-inv-row{flex-wrap:wrap;gap:8px;margin-bottom:20px !important;}
    .stock-inv-row + .btn-row{margin-top:0 !important;}
    .stock-inv-row #stockInventory{flex:2 1 0%;}
    .stock-inv-row .stock-unit-select{flex:0 0 auto;width:80px;}
    .stock-inv-row .unit-mgr-btn{flex:1 1 100%;margin:0 !important;top:0 !important;}
}
/* --- 自定义选择框（药品分类/医药公司） --- */
.custom-select{display:flex;align-items:center;justify-content:space-between;height:44px;padding:0 14px;border:1px solid #dde1ea;border-radius:35px;margin:8px 0 14px;cursor:pointer;transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;background:#fff;}
.custom-select:hover{border-color:#4786FF;box-shadow:0 0 0 3px rgba(71,134,255,0.1);transform:translateY(-1px);}
.custom-select:active{transform:translateY(0) scale(0.85);}
.custom-select-text{color:#333;font-weight:normal;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13.3333px;}
.custom-select-text:empty::before{content:'请选择';color:#999;}
#stockCompanyText:empty::before{content:'请选择医药公司';color:#999;}
.custom-select-arrow{color:#999;font-size:12px;flex-shrink:0;margin-left:8px;transition:transform 0.25s ease;}
.custom-select:hover .custom-select-arrow{color:#4786FF;transform:rotate(180deg);}
body.dark .custom-select{background:#20242f;border-color:#3a4152;color:#eef0f6;}
body.dark .custom-select-text{color:#eef0f6;}
/* 选项管理弹窗列表项 */
.option-item{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px dashed #eef0f6;cursor:pointer;transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease; ease;border-radius:35px;}
.option-item:last-child{border-bottom:none;}
.option-item:hover{background:rgba(71,134,255,0.08);padding-left:16px;}
.option-item .opt-name{font-weight:normal;color:#333;flex:1;}
.option-item .opt-del{padding:0;font-size:12px;flex-shrink:0;border-radius:35px;width:76px;height:36px;display:inline-flex;align-items:center;justify-content:center;}
.option-item .opt-edit{padding:0;font-size:12px;flex-shrink:0;border-radius:35px;width:76px;height:36px;background:#fff;color:#4786FF;border:1px solid #4786FF;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;}
.option-item .opt-edit:hover{background:#4786FF;color:#fff;}
body.dark .option-item .opt-edit{background:#20242f;color:#7fa6ff;border-color:#4786FF;}
body.dark .option-item .opt-edit:hover{background:#4786FF;color:#fff;}
.mgr-search-wrap{display:flex;align-items:center;gap:4px;margin:0 0 10px;padding:0 14px;height:44px;border:1px solid #d3d9e8;border-radius:35px;background:#fff;box-sizing:border-box;}
.mgr-search-wrap:focus-within{border-color:#4786FF;}
.mgr-search-wrap input{flex:1;min-width:0;width:auto;height:100%;line-height:1;border:none !important;outline:none !important;background:transparent !important;font-size:14px;padding:0 !important;margin:0 !important;border-radius:0 !important;box-shadow:none !important;}
.mgr-search-wrap input:focus{border:none !important;box-shadow:none !important;}
.mgr-search-icon{flex-shrink:0;}
body.dark .mgr-search-wrap{background:#20242f;border-color:#3a4152;}
#optionMgrDlg{z-index:10013;}
#optionMgrDlg .confirm-box{max-height:92vh;overflow-y:auto;-webkit-overflow-scrolling:touch;}
#confirmDlg .confirm-box{max-width:335px;width:100%;}
body.dark .option-item .opt-name{color:#eef0f6;}
body.dark .option-item:hover{background:rgba(71,134,255,0.15);}
/* ============================================================
   全站动画升级
   ============================================================ */
/* --- 全局过渡基础 --- */
*{transition-timing-function:cubic-bezier(0.4,0,0.2,1);}
a,button,input,select,textarea,.menu-item,.menu-group-title,.stat-box,.card,th,td,.search-select-list li,.alert-row,.badge,.sel-clear,.btn-clear,.chart-bar,.presc-template-item{transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;}
/* 禁止复制页面文本（输入框内仍可正常编辑） */
body{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-touch-callout:none;}
input,select,textarea{-webkit-user-select:text;-moz-user-select:text;user-select:text;}
/* 滑动开关（iOS 风格：跟手拖动 + 圆点拉伸 + 松手弹簧回弹） */
.switch{position:relative;display:inline-block;width:52px;height:30px;flex-shrink:0;touch-action:none;-webkit-tap-highlight-color:transparent;}
.switch input{opacity:0;width:0;height:0;}
.switch-track{position:absolute;inset:0;background:#ccd2de;border-radius:15px;cursor:pointer;transition:background .3s ease;overflow:hidden;touch-action:none;}
.switch-track:before{content:'';position:absolute;left:3px;top:3px;width:var(--thumb-w,24px);height:24px;background:#fff;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,0.25);transform:translateX(var(--thumb-x,0px));transition:transform .3s cubic-bezier(.34,1.4,.64,1),width .3s cubic-bezier(.34,1.4,.64,1);}
.switch input:checked + .switch-track{background:#0A59F7;--thumb-x:22px;}
.switch input:not(:checked) + .switch-track{--thumb-x:0px;}
/* 诊断分段滑块：西医诊断 / 中医诊断 两格，完全照方笺切换（热/黄/合/跌）那套：白底块跟手拖、松手吸附，hover 不变色 */
.diag-seg{position:relative;display:inline-flex;gap:4px;padding:5px;background:#f1f4fa;border:1px solid #e6e8f0;border-radius:35px;margin:2px 0 8px;max-width:100%;isolation:isolate;touch-action:none;user-select:none;-webkit-user-select:none;box-sizing:border-box;}
.diag-seg-thumb{position:absolute;top:5px;left:0;height:calc(100% - 10px);background:#fff;border-radius:35px;box-shadow:0 1px 4px rgba(30,50,90,.16);transition:left .3s cubic-bezier(.34,1.5,.5,1),transform .48s cubic-bezier(.34,1.56,.5,1);will-change:transform;z-index:0;pointer-events:none;}
.diag-seg-thumb.pop{animation:diagSegPop .48s cubic-bezier(.34,1.56,.5,1) both;}
@keyframes diagSegPop{
    0%{transform:scale(1,1);}
    38%{transform:scale(1.04,1.12);}
    72%{transform:scale(1.01,0.97);}
    100%{transform:scale(1,1);}
}
.diag-seg-btn{position:relative;z-index:1;flex:1 1 auto;border:none;background:transparent!important;box-shadow:none!important;color:#5b6678;font-size:15px;font-weight:700;line-height:1.2;padding:9px 26px;border-radius:35px;cursor:pointer;white-space:nowrap;transition:color .15s;}
.diag-seg-btn.active{color:#2f6fe0;background:transparent!important;}
.diag-seg-btn:not(.active):hover{background:transparent!important;color:#5b6678;}
body.dark .diag-seg{background:#1b2331;border-color:#2b3546;}
body.dark .diag-seg-thumb{background:#2b3546;box-shadow:0 1px 4px rgba(0,0,0,.4);}
body.dark .diag-seg-btn{color:#9fb0c9;}
body.dark .diag-seg-btn.active{color:#8bb4ff;}
/* 置灰的开关（如打印处方弹窗里这张处方没有的那一类）：不响应点击，连滑块也不给按 */
.switch input:disabled + .switch-track{cursor:not-allowed;background:#e6eaf2;}
.switch input:disabled + .switch-track:before{background:#f4f6fa;box-shadow:none;}
.switch input:disabled:checked + .switch-track{background:#b9c6dd;}
/* 拖动中：关掉过渡，圆点完全跟手 */
.switch.dragging .switch-track:before{transition:none !important;}
.switch.dragging .switch-track{transition:background .15s ease;}
body.no-animation .switch-track:before,body.no-animation .switch-track{transition:none !important;}
/* --- 页面切换动画优化 --- */
.page{transition:opacity 0.4s cubic-bezier(0.4,0,0.2,1),transform 0.4s cubic-bezier(0.4,0,0.2,1);}
.page.active{animation:pageIn 0.45s cubic-bezier(0.4,0,0.2,1);}
@keyframes pageIn{
    from{opacity:0;transform:scale(0.98);}
    to{opacity:1;transform:scale(1);}
}
/* --- 卡片入场动画（页面激活时依次出现） --- */
.page.active .card{animation:cardIn 0.5s cubic-bezier(0.4,0,0.2,1) backwards;}
.page.active .card:nth-child(1){animation-delay:0.05s;}
.page.active .card:nth-child(2){animation-delay:0.12s;}
.page.active .card:nth-child(3){animation-delay:0.19s;}
@keyframes cardIn{
    from{opacity:0;transform:translateY(20px);}
    to{opacity:1;transform:translateY(0);}
}
/* --- 卡片悬停效果（已按需求关闭上浮，保留过渡以便未来恢复） --- */
.card{transition:transform 0.3s cubic-bezier(0.4,0,0.2,1),box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);}
/* 卡片上浮 hover 已关闭：开启动画时也不再上浮 */
/* --- 按钮交互升级 --- */
button{transition:transform 0.15s cubic-bezier(0.4,0,0.2,1),box-shadow 0.2s ease,background-color 0.2s ease;position:relative;overflow:hidden;}
/* 悬停手感统一由文末「全站按钮统一点击手感」接管，避免移动端 :hover 残留上浮 */
button:active{transform:translateY(0) scale(0.85);box-shadow:0 2px 8px rgba(71,134,255,0.2);transition:transform 0.15s ease;}
button.btn-plain:hover{box-shadow:0 6px 18px rgba(71,134,255,0.18);}
button.btn-green:hover{box-shadow:0 6px 18px rgba(34,170,102,0.35);}
button.btn-red:hover{box-shadow:0 6px 18px rgba(237,67,67,0.35);}
button.btn-blue:hover{box-shadow:0 6px 18px rgba(43,109,224,0.35);}
/* 按钮点击波纹（从点击位置扩散） */
button .ripple{position:absolute;border-radius:50%;background:rgba(255,255,255,0.35);transform:scale(0);animation:rippleAnim 0.6s ease-out;pointer-events:none;}
@keyframes rippleAnim{to{transform:scale(4);opacity:0;}}
/* --- 输入框聚焦发光 --- */
input:focus,select:focus,textarea:focus{border-color:#4786FF;box-shadow:0 0 0 3px rgba(71,134,255,0.12),0 2px 8px rgba(71,134,255,0.1) !important;}
.confirm-dialog input:focus,.confirm-dialog select:focus,.confirm-dialog textarea:focus{transform:none;}
.confirm-dialog .mgr-search-wrap:focus-within{transform:none;}
body.dark input:focus,body.dark select:focus,body.dark textarea:focus{box-shadow:0 0 0 3px rgba(71,134,255,0.2),0 2px 8px rgba(71,134,255,0.2);}
/* --- 表格行悬停 --- */
table tbody tr{transition:background 0.2s ease;}
table tbody tr:hover td{background:rgba(71,134,255,0.06);}
body.dark table tbody tr:hover td{background:rgba(71,134,255,0.12);}
    tr.row-flash td{background:rgba(71,134,255,0.14);}
    body.dark tr.row-flash td{background:rgba(71,134,255,0.22);}
.patient-date-group:hover td{background:rgba(71,134,255,0.12)!important;}
/* --- 下拉列表出现动画 --- */
.search-select-list{transition:opacity 0.2s ease,transform 0.2s cubic-bezier(0.4,0,0.2,1);opacity:0;transform:translateY(-6px);}
.search-select-list.show{opacity:1;transform:translateY(0);animation:dropdownIn 0.25s cubic-bezier(0.4,0,0.2,1);}
@keyframes dropdownIn{
    from{opacity:0;transform:translateY(-8px) scale(0.98);}
    to{opacity:1;transform:translateY(0) scale(1);}
}
.search-select-list li{transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;}
.search-select-list li:hover{background:rgba(71,134,255,0.12);transform:translateX(4px);padding-left:18px;}
/* --- 侧边菜单动画 --- */
.sidebar{transition:transform 0.35s cubic-bezier(0.4,0,0.2,1);}
.menu-item{transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease; cubic-bezier(0.4,0,0.2,1);}
.menu-group-body{transition:max-height 0.4s cubic-bezier(0.4,0,0.2,1),opacity 0.3s ease;}
/* --- Toast 动画优化 --- */
/* 只过渡透明度/位移，不让宽度变化参与过渡（否则文字长短一变，整个胶囊就在屏幕上滑动） */
.toast{transition:opacity 0.2s ease, transform 0.2s ease;backdrop-filter:blur(45px) saturate(250%) brightness(1.1);-webkit-backdrop-filter:blur(45px) saturate(250%) brightness(1.1);}
.toast.show{animation:toastIn 0.4s cubic-bezier(0.34,1.56,0.64,1);}
@keyframes toastIn{
    from{opacity:0;transform:translateX(-50%) translateY(20px) scale(0.9);}
    to{opacity:1;transform:translateX(-50%) translateY(0) scale(1);}
}
/* --- 统计卡片 --- */
.stat-box{transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;cursor:default;}
.stat-box:hover{transform:translateY(-3px) scale(1.02);box-shadow:0 6px 20px rgba(71,134,255,0.15);}
.stat-box .num{transition:color 0.3s ease;}
.stat-box:hover .num{color:#2b6de0;}
/* --- 图表柱状图动画 --- */
.chart-bar{transition:height 0.6s cubic-bezier(0.34,1.56,0.64,1);position:relative;}
.chart-bar:hover{filter:brightness(1.15);}
.chart-col{transition:transform 0.2s ease;}
.chart-col:hover{transform:scale(1.05);}
/* --- 徽章脉冲 --- */
.badge{transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease; ease;}
.badge-low{animation:pulseLow 2.5s ease-in-out infinite;}
@keyframes pulseLow{
    0%,100%{box-shadow:0 0 0 0 rgba(255,152,0,0.7),0 0 8px rgba(255,152,0,0.4);}
    50%{box-shadow:0 0 0 8px rgba(255,152,0,0),0 0 18px rgba(255,152,0,0.5);}
}
.badge-expire{animation:pulseExpire 2s ease-in-out infinite;}
@keyframes pulseExpire{
    0%,100%{box-shadow:0 0 0 0 rgba(220,50,50,0.7),0 0 8px rgba(220,50,50,0.4);}
    50%{box-shadow:0 0 0 8px rgba(220,50,50,0),0 0 20px rgba(220,50,50,0.6);}
}
/* --- 缺货提醒行 --- */
.alert-row{transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;}
.alert-row:hover{transform:translateX(4px);box-shadow:0 2px 10px rgba(0,0,0,0.08);}
/* --- 清空按钮动画 --- */
.sel-clear,.btn-clear{transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease; cubic-bezier(0.4,0,0.2,1);}
.sel-clear.show{animation:clearIn 0.3s cubic-bezier(0.34,1.56,0.64,1);}
@keyframes clearIn{
    from{opacity:0;transform:translateY(-50%) scale(0.5);}
    to{opacity:1;transform:translateY(-50%) scale(1);}
}
/* --- 确认弹窗 --- */
.confirm-dialog{transition:opacity 0.25s ease;}
.confirm-dialog.show{animation:dialogFade 0.28s ease-out;}
.confirm-dialog.show .confirm-box{animation:dialogIn 0.45s cubic-bezier(0.16,1,0.3,1);}
@keyframes dialogFade{from{opacity:0;}to{opacity:1;}}
@keyframes dialogIn{
    from{opacity:0;transform:scale(0.95) translateY(22px);}
    to{opacity:1;transform:scale(1) translateY(0);}
}
.confirm-box-from{animation:dialogFrom 0.42s cubic-bezier(0.22,1.2,0.3,1)!important;}
@keyframes dialogFrom{
    from{opacity:0;transform:scale(0.15);}
    to{opacity:1;transform:scale(1);}
}
/* --- 主题切换按钮 --- */
.theme-toggle{transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;}
.theme-toggle:hover{box-shadow:0 4px 16px rgba(0,0,0,0.15);}
.theme-toggle:active{transform:scale(0.85);}
/* --- Logo 悬停 --- */
.logo-img{transition:opacity .4s cubic-bezier(0.4,0,0.2,1),transform .4s cubic-bezier(0.4,0,0.2,1);}
.logo:hover .logo-img{transform:rotate(10deg) scale(1.08);box-shadow:0 6px 20px rgba(71,134,255,0.25);}
/* --- 减少动画（尊重系统设置） --- */
@media (prefers-reduced-motion:reduce){
    *{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important;}
}
/* --- 动画总开关（设置弹窗勾选关闭全部动画） --- */
body.no-animation *{
    animation:none !important;
    transition:none !important;
}
/* 摘要跑马灯属信息可读性滚动，不随界面动画开关关闭 */
body.no-animation .drug-line .dl-summary.marquee .dl-marquee{animation:dlSummaryMarquee 6s linear infinite !important;}
/* 关闭动画后，hover 的背景/颜色/浮动/缩放/阴影/滤镜反馈一并取消，还原基础外观 */
body.no-animation *:hover{filter:none !important;}
body.no-animation .sidebar .menu-item:hover:not(.active){background:transparent;}
body.no-animation .menu-group-title:hover{background:transparent;}
body.no-animation .sidebar-clock:active,
body.no-animation .sidebar-out:active,
body.no-animation .custom-select:hover,
body.no-animation .custom-select:active,
body.no-animation .card:hover,
body.no-animation .stat-box:hover,
body.no-animation .dash-click:hover,
body.no-animation .chart-col:hover,
body.no-animation .alert-row:hover,
body.no-animation .theme-toggle:hover,
body.no-animation .theme-toggle:active,
body.no-animation .logo:hover .logo-img,
body.no-animation .search-select-list li:hover,
body.no-animation .batch-actions .batch-del-btn:active,
body.no-animation .batch-actions .batch-cancel-btn:active{transform:none !important;}
body.no-animation .sidebar-out:hover{background:#4786FF;}
body.no-animation .btn-out:hover{background:#ff8f1f;}
body.no-animation .btn-gray:hover{background:#f1f3f6;color:#5b6678;}
body.no-animation .scan-btn:hover{background:#4786FF;}
body.no-animation .sp-btn:hover{background:#f4f6fb;color:#4786FF;}
body.no-animation .unit-mgr-btn:hover{background:#eef1f7;}
body.no-animation .batch-bar .batch-cancel-btn:hover{background:#eef1f7;}
body.no-animation .debt-edit:hover{background:#eef4ff;}
body.no-animation .debt-settle:hover{background:#e8f7ee;}
body.no-animation .out-remove:hover{background:#fdecec;}
body.no-animation .btn-clear:hover,
body.no-animation .barcode-clear:hover,
body.no-animation .search-select .sel-clear:hover,
body.no-animation .dl-name-clear:hover{background:#eef1f7;color:#999;}
body.no-animation .search-select-list li:hover{background:transparent;padding-left:16px;}
body.no-animation .option-item:hover{background:transparent;padding-left:12px;}
body.no-animation .presc-tpl-row:hover,
body.no-animation .presc-pick-row:hover{background:transparent;}
body.no-animation .picked-chip:hover{background:rgba(71,134,255,0.12);}
body.no-animation .custom-select:hover{border-color:#dde1ea;}
body.no-animation .custom-select:hover .custom-select-arrow{color:inherit;}
body.no-animation .card:hover{box-shadow:0 4px 16px rgba(0,0,0,0.06);}
body.no-animation .stat-box:hover{box-shadow:0 2px 8px rgba(0,0,0,0.05);}
body.no-animation .stat-box:hover .num{color:inherit;}
body.no-animation .dash-click:hover{box-shadow:0 4px 16px rgba(0,0,0,0.06);}
body.no-animation .alert-row:hover{box-shadow:none;}
body.no-animation .theme-toggle:hover{box-shadow:0 2px 8px rgba(0,0,0,0.1);}
body.no-animation .logo:hover .logo-img{box-shadow:none;}
body.no-animation .patient-date-group:hover td{background:transparent !important;}
/* 主题切换瞬间禁用所有过渡动画，避免移动端 backdrop-filter/blur 重绘导致卡顿 */
body.no-theme-anim, body.no-theme-anim *{transition:none !important;animation:none !important;}
body.no-animation .batch-bar .batch-toggle-btn:hover,
body.no-animation .batch-bar .batch-del-btn:hover,
body.no-animation .confirm-dialog button:hover:not(:active),
body.no-animation .confirm-dialog button.btn-green:hover:not(:active),
body.no-animation .confirm-dialog button.btn-red:hover:not(:active){box-shadow:none;}
body.no-animation .confirm-dialog .option-item:hover:not(:active){padding-left:12px;background:transparent;}
body.no-animation .confirm-dialog .search-select-list li:hover:not(:active){padding-left:14px;background:transparent;}
/* 关闭动画后：全局所有盒子按钮的 hover 和 active 视觉反馈全部禁用 */
body.no-animation button:hover:not(.login-eye),
body.no-animation button:active:not(.login-eye){
    transform:none !important;
    box-shadow:none !important;
    filter:none !important;
    opacity:1 !important;
}
/* 无 class 的普通按钮（如“保存挂号”）悬停保持蓝色不变，不透明 */
body.no-animation button:not([class]):hover{background-color:#4786FF !important;}
/* 关闭动画后：按钮阴影类变体也一并禁用 */
body.no-animation button.btn-plain:hover,
body.no-animation button.btn-green:hover,
body.no-animation button.btn-red:hover,
body.no-animation button.btn-blue:hover{
    box-shadow:none !important;
}
/* 关闭动画后：卡片 hover 残留阴影也清除（上浮已在开启动画时关闭） */
body.no-animation .card:hover{box-shadow:none !important;}
/* ================= 批量新增功能样式 ================= */
/* --- 复诊提醒 --- */
.followup-card{border:1px solid #ffe3a3;background:#fffbe8;border-radius:16px;padding:10px 14px;margin:8px 0;}
.followup-card .fu-title{color:#b05e00;font-weight:bold;font-size:14px;margin-bottom:6px;}
.followup-item{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:6px 4px;border-bottom:1px dashed #f0e0b0;font-weight:normal;}
.followup-item:last-child{border-bottom:none;}
.followup-item .fi-info{color:#333;font-weight:normal;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.followup-item .fi-info b{color:#b05e00;}
.followup-item .btn-mini{flex-shrink:0;width:64px;padding:8px 0;text-align:center;border-radius:35px;margin:0;}
.followup-item .btn-mini + .btn-mini{margin-left:0;}
body.dark .followup-card{background:#3a3118;border-color:#5a4a1f;}
body.dark .followup-item .fi-info{color:#d8dce6;}
/* --- 临期药品高亮（不足3个月） --- */
tr.warn-expiring td{background:#fff2df;}
.badge-expiring{background:#ffe0b3;color:#b05e00;}
body.dark tr.warn-expiring td{background:#3a2f18;}
body.dark .badge-expiring{background:#5a4420;color:#ffca80;}
.badge-expiring{animation:pulseExpiring 2.5s ease-in-out infinite;}
@keyframes pulseExpiring{
    0%,100%{box-shadow:0 0 0 0 rgba(255,145,0,0.7),0 0 8px rgba(255,145,0,0.4);}
    50%{box-shadow:0 0 0 8px rgba(255,145,0,0),0 0 18px rgba(255,145,0,0.5);}
}
/* --- 药品流水日志弹窗 --- */
#logDlg .confirm-box{max-width:520px;width:100%;max-height:82vh;display:flex;flex-direction:column;}
#logDlg .log-scroll{flex:1;overflow-y:auto;text-align:left;border:1px solid #e6e8f0;border-radius:16px;padding:8px 12px;margin:10px 0 14px;min-height:120px;}
/* 处方详情弹窗：高度在日志弹窗基础上再收窄约三分之一，药品清单在框内滚动 */
#logDlg.detail-mode .confirm-box{max-height:55vh;}
.log-row{display:grid;grid-template-columns:150px 50px 1fr 130px;align-items:center;gap:8px;padding:8px 2px;border-bottom:1px dashed #eef0f6;font-weight:normal;font-size:13px;}
.log-row:last-child{border-bottom:none;}
.log-row .lg-time{color:#999;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.log-row .lg-type{font-weight:bold;flex-shrink:0;justify-self:center;}
.log-row > span:nth-child(3){min-width:0;white-space:normal;word-break:break-word;}
.log-row .lg-type.in{color:#22aa66;}
.log-row .lg-type.out{color:#2b6de0;}
.log-row .lg-type.adj{color:#b05e00;}
.log-row .lg-type.del{color:#ed4343;}
.log-row .lg-note{color:#888;font-size:12px;justify-self:end;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.log-empty{text-align:center;color:#999;padding:24px 0;font-weight:normal;}
/* 患者历史卡片 */
.hist-card{padding:10px 4px;border-bottom:1px dashed #eef0f6;font-size:13px;line-height:1.6;}
.hist-time{color:#999;font-size:12px;margin-bottom:4px;}
.hist-line{color:#333;word-break:break-all;}
body.dark .hist-card{border-bottom-color:#2a2f3d;}
body.dark .hist-line{color:#eef0f6;}
body.dark .log-scroll{border-color:#3a4152;}
body.dark .log-row{border-bottom-color:#2a2f3d;}
body.dark .log-row .lg-note{color:#8b92a6;}
/* 移动端流水日志：药品名不再竖排，时间压缩、备注折到第二行 */
@media (max-width:768px){
    .log-row{grid-template-columns:auto auto 1fr;row-gap:2px;}
    .log-row .lg-time{font-size:11px;}
    .log-row > span:nth-child(3){font-size:13px;white-space:normal;word-break:break-word;}
    .log-row .lg-note{grid-column:1/-1;justify-self:start;text-align:left;white-space:normal;overflow:visible;text-overflow:clip;}
}
/* --- 盘点相关 --- */
#stockCheckDlg .confirm-box{max-width:430px;width:100%;max-height:86vh;overflow-y:auto;}
#stockCheckDlg .log-scroll{overflow-y:auto;-webkit-overflow-scrolling:touch;}
.check-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 14px;border-bottom:1px dashed #eef0f6;font-weight:normal;text-align:left;border-radius:35px;}
.check-row .cr-body{flex:1;min-width:0;}
.check-row .cr-name{display:block;font-weight:bold;color:#333;word-break:break-all;line-height:1.45;}
.check-row .cr-spec{color:#888;font-weight:normal;}
.check-row .cr-loc{display:block;color:#7a8299;font-size:12px;margin-top:2px;word-break:break-all;line-height:1.4;}
body.dark .check-row .cr-loc{color:#9aa1b5;}
.check-row .cr-meta{display:flex;align-items:center;gap:10px;margin-top:5px;}
.check-row .cr-cur{color:#666;}
.check-row input{width:100px;margin:0 0 0 auto;flex-shrink:0;}
.check-reason{width:100%;margin:6px 0 12px;}
.check-search-wrap{position:relative;margin:6px 0 10px;}
.check-search-wrap .check-search-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:#9aa1b5;pointer-events:none;z-index:2;}
.check-zone-select{width:100%;height:44px;margin:6px 0 10px;padding:0 36px 0 14px;border:1px solid #d3d9e8;border-radius:35px;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center/12px;font-size:14px;color:#333;cursor:pointer;box-sizing:border-box;line-height:44px;appearance:none;-webkit-appearance:none;-moz-appearance:none;}
body.dark .check-zone-select{background-color:#20242f;color:#eef0f6;border-color:#3a4152;}
.check-search-wrap .check-reason{width:100%;margin:0;padding-left:36px;padding-right:38px;box-sizing:border-box;}
.check-search-clear{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:22px;height:22px;padding:0;margin:0;display:none;align-items:center;justify-content:center;background:#eef1f7 !important;color:#999 !important;border:none !important;border-radius:50%;font-size:11px;line-height:1;cursor:pointer;z-index:2;box-shadow:none !important;}
.check-search-clear.show{display:flex;}
.check-search-clear:hover{color:#2b6de0 !important;background:linear-gradient(135deg,#dbe9ff,#eef4ff) !important;box-shadow:none !important;transform:translateY(-50%) !important;}
.check-search-clear:active{transform:translateY(-50%) !important;opacity:1;background:linear-gradient(135deg,#c9ddff,#e6f1ff) !important;color:#1f5bc4 !important;box-shadow:none !important;}
body.dark .check-search-clear{background:#2a2f3d !important;color:#9aa1b5 !important;}
body.dark .check-search-clear:hover{color:#7fb0ff !important;}
#stockCheckClear{background:#eef1f7 !important;color:#999 !important;border:none !important;box-shadow:none !important;transform:translateY(-50%) !important;}
#stockCheckClear:hover,#stockCheckClear:active{background:linear-gradient(135deg,#dbe9ff,#eef4ff) !important;color:#2b6de0 !important;border:none !important;box-shadow:none !important;transform:translateY(-50%) !important;}
body.dark #stockCheckClear{background:#2a2f3d !important;color:#9aa1b5 !important;}
/* 选项 / 位置 / 单位管理弹窗搜索清除叉：与盘点清除叉同款（灰底灰叉圆钮，悬停浅蓝渐变） */
#optionMgrClear,#locMgrClear,#unitMgrClear{width:22px;height:22px;padding:0 !important;margin:0;display:inline-flex;align-items:center;justify-content:center;background:#eef1f7 !important;color:#999 !important;border:none !important;border-radius:50%;box-shadow:none !important;cursor:pointer;flex:0 0 auto;}
#optionMgrClear:hover,#locMgrClear:hover,#unitMgrClear:hover{background:linear-gradient(135deg,#dbe9ff,#eef4ff) !important;color:#2b6de0 !important;}
#optionMgrClear:active,#locMgrClear:active,#unitMgrClear:active{background:linear-gradient(135deg,#c9ddff,#e6f1ff) !important;color:#1f5bc4 !important;}
body.dark #optionMgrClear,body.dark #locMgrClear,body.dark #unitMgrClear{background:#2a2f3d !important;color:#9aa1b5 !important;}
body.dark .check-row{border-bottom-color:#2a2f3d;}
body.dark .check-row .cr-name{color:#eef0f6;}
body.dark .check-row .cr-spec,body.dark .check-row .cr-cur{color:#aab0c2;}
/* —— 盘点分组（按药名归组，组内列批次） —— */
.check-group{margin:6px 0 10px;}
.cg-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:4px 2px 2px;}
.cg-name{font-weight:700;color:#2b3444;word-break:break-all;line-height:1.4;}
.cg-count{font-size:12px;color:#888;white-space:nowrap;flex-shrink:0;}
.cg-items{padding-left:10px;border-left:2px solid #eef1f7;}
.check-row{cursor:pointer;transition:background .18s ease,border-radius .18s ease;}
.check-row:hover{background:#eef2f9;border-radius:35px;}
.check-row .cr-meta{flex-wrap:wrap;row-gap:4px;}
.check-row .cr-date{font-size:12px;color:#7a8299;}
.check-row .cr-edit{margin-left:0;flex-shrink:0;align-self:center;font-size:12px;color:#2b6de0;font-weight:600;}
.check-row.changed .cr-edit{color:#2eb876;}
body.dark .cg-name{color:#eef0f6;}
body.dark .cg-count,body.dark .check-row .cr-date{color:#9aa1b5;}
body.dark .cg-items{border-left-color:#2a2f3d;}
body.dark .check-row:hover{background:#1c2230;}
/* —— 盘点批次详情底部抽屉（bottom sheet，拖拽吸附 30/60/90%） —— */
.sheet-mask{position:fixed;inset:0;background:rgba(15,23,42,.42);opacity:0;visibility:hidden;transition:opacity .28s ease,visibility .28s ease;z-index:10001;}
.sheet-mask.open{opacity:1;visibility:visible;}
.check-sheet{position:fixed;left:0;right:0;bottom:0;z-index:10002;margin:0 auto;max-width:520px;background:#fff;border-radius:22px 22px 0 0;box-shadow:0 -8px 30px rgba(20,40,80,.18);height:90vh;display:flex;flex-direction:column;transform:translateY(100%);transition:transform .32s cubic-bezier(.22,1,.36,1);touch-action:none;}
/* 盘点批次详情抽屉是盘点弹窗内的二级层，层级抬到外层盘点弹窗（.confirm-dialog 10010）之上，避免被压住 */
#checkSheetMask{z-index:10011;}
#checkSheet{z-index:10012;}
.check-sheet.dragging{transition:none;}
.cs-handle{padding:10px 0 6px;display:flex;justify-content:center;cursor:grab;touch-action:none;flex-shrink:0;}
.cs-handle span{width:44px;height:5px;border-radius:5px;background:#cfd6e4;}
.cs-handle:active{cursor:grabbing;}
.cs-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:4px 20px 16px;}
.cs-title{font-size:17px;font-weight:700;color:#1d2433;word-break:break-all;line-height:1.4;}
.cs-spec{font-size:13px;color:#888;margin-top:2px;}
.cs-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px;margin:14px 0;}
.cs-price-row{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px;grid-column:1/-1;}
.cs-field{display:flex;flex-direction:column;gap:4px;min-width:0;}
.cs-field label{font-size:11px;color:#9aa1b5;}
.cs-field input{width:100%;height:44px;padding:0 16px;border:1px solid #d3d9e8;border-radius:35px;font-size:14px;background:#fff;color:#1d2433;box-sizing:border-box;}
.cs-field input:focus{border-color:#2b6de0;outline:none;}
.cs-date-wrap{position:relative;}
.cs-date-wrap .date-filter-input{padding-right:92px;}
.cs-grid .custom-select{margin:0;}
.cs-field .cs-ro{font-size:14px;color:#2b3444;word-break:break-all;min-height:44px;display:flex;align-items:center;}
/* 位置 / 选项管理弹窗是从盘点抽屉、盘点弹窗内二级打开的，层级抬到抽屉（10012）之上 */
#locMgrDlg{z-index:10013;}
/* 删除 / 退出等三级确认框，层级抬到管理弹窗（10013）之上 */
#confirmDlg{z-index:10014;}
@media (max-width:768px){
  .cs-grid{grid-template-columns:1fr;}
}
.cs-field.readonly .cs-ro{color:#5b6678;}
body.dark .cs-field input{background:#0f1520;border-color:#2b3546;color:#e6edf7;}
body.dark .cs-field .cs-ro{color:#e6edf7;}
.cs-qty{margin-top:6px;}
.cs-qty label{display:block;font-size:13px;color:#5b6678;margin-bottom:6px;}
.cs-qty input{width:100%;height:46px;padding:0 16px;border:1px solid #c4cddd;border-radius:35px;font-size:16px;background:#fff;color:#1d2433;box-sizing:border-box;box-shadow:none;}
.cs-qty input:focus{border-color:#2b6de0;outline:none;box-shadow:0 0 0 3px rgba(43,109,224,.12);}
#checkSheet .cs-loc-chips{border:1px solid #d3d9e8;border-radius:35px;background:#fff;min-height:44px;padding:6px 12px;align-items:center;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:thin;}
#checkSheet .cs-loc-chips::-webkit-scrollbar{height:4px;}
#checkSheet .cs-loc-chips::-webkit-scrollbar-thumb{background:#cfe0ff;border-radius:35px;}
.cs-loc-field{grid-column:1/-1;}
#checkSheet .cs-loc-field .loc-row{margin:0;gap:10px;}
.cs-loc-add{flex-shrink:0;margin-top:0;width:auto;height:44px;padding:0 18px;white-space:nowrap;}
.cs-head{position:relative;padding:2px 20px 10px 20px;padding-right:56px;flex-shrink:0;touch-action:none;}
.cs-head-txt{min-width:0;}
.cs-confirm{position:absolute;top:-10px;right:10px;width:40px;height:40px;border:1px solid rgba(46,184,118,.38);border-radius:50%;background:rgba(46,184,118,.14);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);color:#2eb876;font-size:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 12px rgba(46,184,118,.18);}
.cs-confirm:active{transform:scale(.94);}
.cs-confirm svg{width:20px;height:20px;max-width:none;max-height:none;flex-shrink:0;display:block;}
.cs-confirm:hover{background:rgba(120,128,145,.16);border-color:rgba(120,128,145,.35);color:#5b6678;box-shadow:0 4px 12px rgba(90,100,120,.18);}
body.dark .cs-confirm{background:rgba(255,255,255,.10);border-color:rgba(127,220,170,.35);color:#7fdcae;}
body.dark .cs-confirm:hover{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.28);color:#e6edf7;}
body.dark .check-sheet{background:#161c27;box-shadow:0 -8px 30px rgba(0,0,0,.4);}
body.dark .cs-handle span{background:#3a4152;}
body.dark .cs-title{color:#eef0f6;}
body.dark .cs-spec,body.dark .cs-field label{color:#9aa1b5;}
body.dark .cs-qty label{color:#aab0c2;}
body.dark .cs-qty input{background:#0f1520;border-color:#2b3546;color:#e6edf7;}
/* —— 药品出库弹窗：空盒子 / 条目 / 数量 —— */
#stockOutDlg .confirm-box{max-width:590px;width:100%;max-height:86vh;overflow-y:auto;-webkit-overflow-scrolling:touch;text-align:center;}
#stockOutDlg .barcode-input-wrap input[type=text]{border-radius:35px;}
#stockOutDlg .out-box{
    border:2px dashed #c9d6ee;border-radius:16px;background:#f8fafd;
    padding:10px 12px;margin:12px 0 4px;max-height:260px;min-height:90px;
    overflow-y:auto;-webkit-overflow-scrolling:touch;text-align:left;
}
#stockOutDlg .out-item{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    padding:8px 4px;border-bottom:1px dashed #e6eaf2;
}
#stockOutDlg .out-item:last-child{border-bottom:none;}
#stockOutDlg .out-item-name{font-weight:bold;color:#333;word-break:break-all;line-height:1.4;}
#stockOutDlg .out-item-meta{color:#888;font-size:13px;margin-top:2px;}
#stockOutDlg .out-avail{color:#ff8f1f;font-weight:bold;}
#stockOutDlg .out-item-ctrl{display:flex;align-items:center;gap:6px;flex-shrink:0;}
#stockOutDlg .out-qty-label{color:#666;font-size:13px;display:inline-flex;align-items:center;height:100%;line-height:1;}
/* 数量框 / 单位下拉 / 删除按钮 三者同宽 */
#stockOutDlg .out-qty{width:76px;text-align:center;margin:0;border:1px solid #d5dbe7;border-radius:35px;padding:6px;height:36px;box-sizing:border-box;}
#stockOutDlg .out-qty-unit{color:#888;font-size:13px;}
#stockOutDlg .out-unit{margin:0;border:1px solid #d5dbe7;border-radius:35px;padding:0 22px 0 8px;font-size:13px;line-height:34px;background-color:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;background-size:12px;color:#333;width:76px;height:36px;box-sizing:border-box;text-align:center;text-align-last:center;appearance:none;-webkit-appearance:none;-moz-appearance:none;}
body.dark #stockOutDlg .out-unit{background-color:#20242f;color:#eef0f6;border-color:#3a4152;}
/* 出库条目的删除按钮：SVG+文字，与外面列表删除样式一致，同宽 */
#stockOutDlg .out-remove{
    padding:6px 0;font-size:13px;display:inline-flex;align-items:center;justify-content:center;gap:4px;
    background:#fdecec;color:#ed4343;border:1px solid #f6c6c6;border-radius:18px;cursor:pointer;margin:0;width:76px;height:36px;box-sizing:border-box;
}
#stockOutDlg .out-remove:hover{background:#f6d5d5;}
/* 出库数量增减 ± 按钮：与输入框等高 */
#stockOutDlg .out-step{width:36px;height:36px;flex:none;margin:0;padding:0;border:1px solid #d5dbe7;border-radius:50%;background:#f1f3f6;color:#333;font-size:18px;line-height:1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-sizing:border-box;}
#stockOutDlg .out-step:hover{background:#e2e8f0;}
#stockOutDlg .out-step:active{background:#dbe1ea;}
/* 条码框占一行；扫码/清空按钮占满整行并等分 */
#stockOutDlg .out-scan-btns{display:flex;gap:8px;margin:8px 0 2px;width:100%;}
#stockOutDlg .out-scan-btns .scan-btn{flex:1 1 0%;width:0;max-width:none;padding:10px 8px;}
#stockOutDlg .search-select{position:relative;}
#stockOutDlg .search-select-list{max-height:180px;overflow-y:auto;}
/* 出库搜索框：放大镜/清除叉 垂直居中、靠边留距（定位稳固） */
#stockOutDlg .search-row{position:relative;display:flex;align-items:center;}
#stockOutDlg .search-row .btn-search{top:50%;transform:translateY(-50%) !important;left:14px;}
#stockOutDlg #outSearchClear{top:50%;transform:translateY(-50%) !important;right:12px;width:26px;height:26px;}
#stockOutDlg .search-row .search-input{height:44px;padding:0 44px 0 44px;}
@media (max-width:768px){
    #stockOutDlg #outSearchClear{right:10px;width:24px;height:24px;}
    #stockOutDlg .search-row .search-input{height:40px;padding:0 40px 0 38px;}
}
body.dark #stockOutDlg .out-box{background:#1c2230;border-color:#3a4152;}
body.dark #stockOutDlg .out-item-name{color:#eef0f6;}
body.dark #stockOutDlg .out-item{border-bottom-color:#2a2f3d;}
/* —— 移动端适配：营收走势日期横轴可横向滚动（内容不溢出盒子）；出库条目控件第一行=出库/−/数量/+/单位，删除按钮单独换到第二行 —— */
@media (max-width:768px){
    .chart-wrap{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;}
    .chart-col{flex:0 0 34px;}
    #stockOutDlg .out-item{flex-wrap:wrap;}
    #stockOutDlg .out-item-info{flex:1 1 100%;min-width:0;}
    /* 第一行：出库标签 / − / 数量 / + / 单位（5列），删除按钮跨满整行自动落到第二行 */
    #stockOutDlg .out-item-ctrl{width:100%;display:grid;grid-template-columns:auto 36px 1fr 36px 1fr;gap:6px;align-items:stretch;}
    #stockOutDlg .out-remove{grid-column:1 / -1;width:100% !important;margin-top:2px;}
    /* 移动端：出库数量 / 单位 与 PC 端高度一致（36px），± 按钮圆形 */
    #stockOutDlg .out-qty,#stockOutDlg .out-unit{width:100%;max-width:none;min-width:0;flex:none;height:36px;box-sizing:border-box;}
    #stockOutDlg .out-step{width:36px;height:36px;border-radius:50%;}
    /* 预览盒子固定高度：完整显示 1 个药品卡片 + 第 2 个露出半行，提示可滚动 */
    #stockOutDlg .out-box{max-height:220px;overflow-y:auto;-webkit-overflow-scrolling:touch;}
}
/* —— 常用配方编辑弹窗：已选中药品盒子 —— */
.picked-box{border:2px dashed #c9d6ee;border-radius:16px;background:#f8fafd;padding:8px 10px;margin:0 0 8px;min-height:36px;max-height:120px;display:flex;flex-wrap:wrap;gap:6px;text-align:left;align-items:center;overflow-y:auto;-webkit-overflow-scrolling:touch;}
.picked-chip{display:inline-flex;align-items:center;gap:4px;background:rgba(71,134,255,0.12);border:1px solid #cfdcf5;border-radius:18px;padding:4px 9px;font-size:12px;color:#2b6de0;cursor:pointer;word-break:break-all;}
.picked-chip:hover{background:rgba(71,134,255,0.22);}
body.dark .picked-box{background:#1c2230;border-color:#3a4152;}
body.dark .picked-chip{background:rgba(71,134,255,0.25);border-color:#3a5270;color:#7fb0ff;}
/* --- 收费小票（复用打印区域） --- */
#printArea .receipt-head{text-align:center;margin-bottom:10px;}
#printArea .receipt-head h2{font-size:20px;}
#printArea .receipt-info{display:flex;flex-wrap:wrap;gap:8px 20px;margin:10px 0;font-weight:normal;}
#printArea .receipt-total{margin-top:12px;text-align:right;font-weight:bold;font-size:16px;}
#printArea .receipt-page{display:flex;flex-direction:column;min-height:175mm;}
#printArea .receipt-foot{margin-top:auto;display:flex;justify-content:space-between;align-items:center;color:#333;font-weight:normal;}
#printArea .receipt-foot>span{display:inline-flex;align-items:center;}
/* 处方笺内嵌的电子病历 / 收费区块 */
#printArea .presc-section{margin-top:14px;}
#printArea .presc-section-title{font-size:14px;font-weight:bold;margin:8px 0 4px;padding-left:0;border-left:none;}
#printArea .presc-section td{vertical-align:top;}
/* 打印分页：区块 / 标题 / 单条药品 / 签名行不被拆到两页，避免标题孤行、签名落次页 */
#printArea .presc-section{break-inside:avoid;}
#printArea .presc-section-title{break-after:avoid;}
#printArea .presc-item{break-inside:avoid;}
#printArea .presc-foot{break-inside:avoid;}
#printArea .emr-table td{white-space:normal;word-break:break-word;overflow-wrap:break-word;line-height:1.4;}
#printArea .emr-table td:first-child{white-space:nowrap;vertical-align:middle;}
/* 附加项目表：备注长文本自动换行，其余短列保持单行 */
#printArea .extra-table td:last-child,#printArea .extra-table th:last-child{white-space:normal;word-break:break-word;overflow-wrap:break-word;line-height:1.5;}
#printArea .extra-table td:last-child{min-width:28%;}
#printArea .extra-table td{vertical-align:middle;}
/* --- 深色模式细节补充 --- */
body.dark .custom-select-text:empty::before{color:#7a8196;}
body.dark #stockCompanyText:empty::before{color:#7a8196;}
/* --- 自定义弹窗：hover 去动画（背景不变/无位移缩放阴影过渡），active 用 opacity 反馈 --- */
.confirm-dialog :hover:not(:active):not(input):not(select):not(textarea):not(.mgr-search-wrap):not(.debt-search-wrap):not(.login-eye){
    transition:none !important;
    transform:none !important;
    box-shadow:none !important;
}
/* hover：按钮背景保持原色，不再变深蓝 #3a6fd1 */
.confirm-dialog .confirm-btns button{transition:background .25s ease,transform .25s ease,box-shadow .25s ease,opacity .25s ease;}
.confirm-dialog button:not(.btn-plain):not(.mf-chip):not(.diag-seg-btn):not(.ec-del):not(.login-eye):hover:not(:active){background:#5b8df8 !important;transform:translateY(-1px);box-shadow:0 6px 16px rgba(71,134,255,0.28);}
.confirm-dialog button.btn-green:hover:not(:active){background:#2eb876 !important;transform:translateY(-1px);box-shadow:0 6px 16px rgba(34,170,102,0.28);}
.confirm-dialog button.btn-red:hover:not(:active){background:#f26060 !important;transform:translateY(-1px);box-shadow:0 6px 16px rgba(237,67,67,0.24);}
.confirm-dialog .btn-plain{background:rgba(71,134,255,0.08);color:#4786FF;border:1px solid #4786FF;border-radius:35px;}
body.dark .confirm-dialog .btn-plain{background:rgba(71,134,255,0.16);color:#7fa6ff;border-color:#4786FF;}
/* 查找药品：字段胶囊（关键字 / 缺失字段两面板同一套样式，间距、字号、字重一致） */
.mf-chip{margin:0;padding:10px 12px;border-radius:35px;background:#fff;color:#5b6678;border:1.5px solid #e2e8f0;font-size:14px;font-weight:700;box-shadow:none;line-height:1.2;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .3s ease,color .3s ease,border-color .3s ease,transform .3s cubic-bezier(.34,1.5,.5,1);}
.mf-chip.on{background:#4786FF;color:#fff;border-color:#4786FF;}
/* 悬停保持原色；按压轻微缩小，松手按弹簧曲线回弹（同分段滑块手感） */
.mf-chip:hover:not(:active){box-shadow:none;transform:none;opacity:1;}
.mf-chip:active{box-shadow:none;transform:scale(.92);opacity:1;}
.mf-chip:not(.on):hover:not(:active),.mf-chip:not(.on):active{background:#fff !important;color:#5b6678 !important;border-color:#e2e8f0 !important;}
.mf-chip.on:hover:not(:active),.mf-chip.on:active{background:#4786FF !important;color:#fff !important;border-color:#4786FF !important;}
body.dark .mf-chip{background:#2a3140;color:#c7d2e4;border-color:#3a4557;}
body.dark .mf-chip.on{background:#4786FF;color:#fff;border-color:#4786FF;}
body.dark .mf-chip:not(.on):hover:not(:active),body.dark .mf-chip:not(.on):active{background:#2a3140 !important;color:#c7d2e4 !important;border-color:#3a4557 !important;}
body.dark .mf-chip.on:hover:not(:active),body.dark .mf-chip.on:active{background:#4786FF !important;color:#fff !important;border-color:#4786FF !important;}
.confirm-dialog .option-item{transition:background .22s ease,padding-left .22s ease,color .22s ease;}
.confirm-dialog .search-select-list li{transition:background .22s ease,padding-left .22s ease,color .22s ease;}
.confirm-dialog .option-item:hover:not(:active){padding-left:12px !important;background:rgba(71,134,255,0.08) !important;}
.confirm-dialog .search-select-list li:hover:not(:active){padding-left:14px !important;background:rgba(71,134,255,0.08) !important;}
body.dark .confirm-dialog .option-item:hover:not(:active),body.dark .confirm-dialog .search-select-list li:hover:not(:active){background:rgba(71,134,255,0.16) !important;}
/* active：按钮点击时有缩放动画（scale），配合轻微 opacity 变淡，保持原背景不变深蓝 */
.confirm-dialog button:not(.btn-plain):not(.mf-chip):not(.diag-seg-btn):not(.ec-del):not(.login-eye):active{
    background:#4786FF !important;
    opacity:0.85 !important;
    transform:scale(0.92) !important;
    box-shadow:none !important;
    transition:transform 0.08s ease !important;
}
.confirm-dialog button.btn-green:active{
    background:#22aa66 !important;
    opacity:0.85 !important;
    transform:scale(0.92) !important;
    box-shadow:none !important;
    transition:transform 0.08s ease !important;
}
.confirm-dialog button.btn-red:active{
    background:#ed4343 !important;
    opacity:0.85 !important;
    transform:scale(0.92) !important;
    box-shadow:none !important;
    transition:transform 0.08s ease !important;
}
/* --- 次要/透明按钮（btn-plain：取消/关闭/重置等）：hover 用 opacity 反馈不变蓝，active 有缩放动画 + opacity --- */
.btn-plain:hover:not(:active){
    background:inherit !important;
    opacity:0.75 !important;
    transform:none !important;
    box-shadow:none !important;
    transition:none !important;
}
.btn-plain:active{
    background:inherit !important;
    opacity:0.85 !important;
    transform:scale(0.92) !important;
    box-shadow:none !important;
    transition:transform 0.08s ease !important;
}
/* 全局数据导入/导出按钮：前两个一行等宽，第三个独占一行占满 */
.io-btn-row{display:flex;gap:6px;}
.io-btn-row button{flex:1;}
.io-btn-full{width:100%;margin-top:10px;}
/* ===== 自定义日期选择器（iframe 托管环境原生日历被拦截时自绘兜底） ===== */
.dp-popup{
    position:fixed;background:#fff;border:1px solid #e2e8f0;border-radius:14px;
    box-shadow:0 10px 30px rgba(15,23,42,.18);padding:12px;width:300px;user-select:none;
    font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;z-index:99999;
    max-height:calc(100vh - 24px);overflow-y:auto;scrollbar-gutter:stable both-edges;-webkit-overflow-scrolling:touch;
}
/* 滑动时平滑跟随输入框（滚动过程中弹窗位置平滑过渡，不做生硬跳变） */
.dp-popup.dp-smooth{transition:top .18s ease,left .18s ease;}
.dp-head{display:flex;align-items:center;justify-content:center;gap:2px;margin-bottom:10px;box-sizing:border-box;}
.dp-title{flex:0 0 auto;text-align:center;font-size:14px;font-weight:700;color:#1e293b;white-space:nowrap;line-height:1.4;padding:0 4px;}
.dp-nav{width:28px;height:30px;border:none;background:#f1f5f9;border-radius:8px;font-size:16px;color:#475569;cursor:pointer;line-height:1;flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:0;}
.dp-nav:hover{background:#e2e8f0;}
.dp-dow{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:4px;}
.dp-dow span{text-align:center;font-size:11px;color:#94a3b8;font-weight:600;}
.dp-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;}
.dp-cell{height:34px;display:flex;align-items:center;justify-content:center;font-size:13px;color:#334155;border-radius:8px;cursor:pointer;}
.dp-cell:hover{background:#eef4ff;color:#2563eb;}
.dp-cell.is-today{color:#2563eb;font-weight:700;}
.dp-cell.is-sel{background:#2563eb;color:#fff;font-weight:700;}
.dp-cell.is-sel:hover{background:#2563eb;color:#fff;}
.dp-blank{height:34px;}
body.dark .dp-popup{background:#222836;border-color:#3a4152;box-shadow:0 10px 30px rgba(0,0,0,.5);}
body.dark .dp-title{color:#eef0f6;}
body.dark .dp-nav{background:#2a2f3d;color:#c5cbd8;}
body.dark .dp-nav:hover{background:#353c4e;}
body.dark .dp-dow span{color:#7a8299;}
body.dark .dp-cell{color:#e8eaf2;}
body.dark .dp-cell:hover{background:rgba(71,134,255,.18);color:#8ab4ff;}
body.dark .dp-cell.is-today{color:#8ab4ff;}
body.dark .dp-cell.is-sel{background:#4786FF;color:#fff;}
body.dark .dp-cell.is-sel:hover{background:#4786FF;color:#fff;}
.dp-title{cursor:pointer;border-radius:8px;transition:background .2s,color .2s;}
.dp-title:hover{background:#eef4ff;color:#2563eb;}
body.dark .dp-title:hover{background:rgba(71,134,255,.18);color:#8ab4ff;}
.dp-y,.dp-m{flex:0 0 auto;text-align:center;font-size:13px;font-weight:700;color:#1e293b;cursor:pointer;border:none;background:none;padding:5px 6px;border-radius:8px;white-space:nowrap;line-height:1.4;min-width:0;overflow:visible;}
.dp-y:hover,.dp-m:hover{background:#eef4ff;color:#2563eb;}
.dp-month-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:4px 0;}
.dp-mcell{height:38px;display:flex;align-items:center;justify-content:center;font-size:14px;color:#334155;border-radius:8px;cursor:pointer;}
.dp-mcell:hover{background:#eef4ff;color:#2563eb;}
.dp-mcell.is-sel{background:#2563eb;color:#fff;font-weight:700;}
.dp-mcell.is-sel:hover{background:#2563eb;color:#fff;}
body.dark .dp-y,body.dark .dp-m{color:#eef0f6;}
body.dark .dp-y:hover,body.dark .dp-m:hover{background:rgba(71,134,255,.18);color:#8ab4ff;}
body.dark .dp-mcell{color:#e8eaf2;}
body.dark .dp-mcell:hover{background:rgba(71,134,255,.18);color:#8ab4ff;}
body.dark .dp-mcell.is-sel{background:#4786FF;color:#fff;}
body.dark .dp-mcell.is-sel:hover{background:#4786FF;color:#fff;}
.dp-year-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:4px 0;}
.dp-year{height:38px;display:flex;align-items:center;justify-content:center;font-size:14px;color:#334155;border-radius:8px;cursor:pointer;}
.dp-year:hover{background:#eef4ff;color:#2563eb;}
.dp-year.is-sel{background:#2563eb;color:#fff;font-weight:700;}
.dp-year.is-sel:hover{background:#2563eb;color:#fff;}
body.dark .dp-year{color:#e8eaf2;}
body.dark .dp-year:hover{background:rgba(71,134,255,.18);color:#8ab4ff;}
body.dark .dp-year.is-sel{background:#4786FF;color:#fff;}
body.dark .dp-year.is-sel:hover{background:#4786FF;color:#fff;}
.dp-foot{display:flex;gap:8px;margin-top:10px;}
.dp-foot-btn{flex:1;height:34px;border:none;border-radius:35px;font-size:13px;font-weight:600;cursor:pointer;background:#f1f5f9;color:#475569;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1;}
.dp-foot-btn:hover{background:#e2e8f0;}
.dp-foot-btn[data-act="today"]{background:#2563eb;color:#fff;}
.dp-foot-btn[data-act="today"]:hover{background:#1d4ed8;}
body.dark .dp-foot-btn{background:#263041;color:#cbd5e1;}
body.dark .dp-foot-btn:hover{background:#2f3b50;}
body.dark .dp-foot-btn[data-act="today"]{background:#4786FF;color:#fff;}
body.dark .dp-foot-btn[data-act="today"]:hover{background:#3d76e0;}
/* 空值的原生 date 框内部占位（yyyy/mm/dd）隐藏，避免与自绘占位重叠 */
input[type="date"].dp-empty::-webkit-datetime-edit,
input[type="date"].dp-empty::-webkit-datetime-edit-fields-wrapper,
input[type="date"].dp-empty::-webkit-datetime-edit-text,
input[type="date"].dp-empty::-webkit-datetime-edit-month-field,
input[type="date"].dp-empty::-webkit-datetime-edit-day-field,
input[type="date"].dp-empty::-webkit-datetime-edit-year-field{color:transparent !important;}
.dp-popup.dp-anim{animation:dpFade .28s ease;}
@keyframes dpFade{from{opacity:0;transform:translateY(-6px) scale(.98);}to{opacity:1;transform:translateY(0) scale(1);}}
/* 关闭动画：与打开对称，淡出 + 轻微上移缩小 */
.dp-popup.dp-out{animation:dpOut .18s ease forwards;}
@keyframes dpOut{from{opacity:1;transform:translateY(0) scale(1);}to{opacity:0;transform:translateY(-6px) scale(.98);}}
/* 快速组方：弹窗固定高度、不整体上下滚动（内容多时仅药品列表内部滚动） */
#prescDlg .confirm-box{max-height:none;overflow:visible;}
/* 批量删除：圆形勾选框（红色选中带对勾） */
input.loc-cb{
    -webkit-appearance:none;
    appearance:none;
    width:20px;
    height:20px;
    border:2px solid #c8cedd;
    border-radius:50%;
    background:#fff;
    cursor:pointer;
    flex-shrink:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    position:relative;
    vertical-align:middle;
    margin:0;
    padding:0;
    outline:none;
    transition:border-color .15s,background .15s;
}
input.loc-cb:hover{border-color:#e23b3b;}
input.loc-cb:checked{
    border-color:#e23b3b;
    background:#e23b3b;
}
input.loc-cb:checked::after{
    content:'';
    position:absolute;
    left:50%;
    top:50%;
    width:5px;
    height:9px;
    border:solid #fff;
    border-width:0 2px 2px 0;
    transform:translate(-50%,-55%) rotate(45deg);
    animation:checkDraw .2s ease forwards;
}
#locMgrList .loc-zone-head,#locMgrList .loc-layer-head,#locMgrList .loc-pos{
    height:40px;
    display:flex;
    align-items:center;
    box-sizing:border-box;
    padding-right:8px !important;
}
/* 药库平面图：一层 / 二层 切换按钮 */
.floor-tabs{display:flex;gap:8px;margin:10px 0 4px;}
.floor-tabs .floor-tab{padding:7px 18px;font-size:13px;border-radius:35px;border:1px solid #dbe3f0;background:#fff;color:#5b6678;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease;margin:0;}
.floor-tabs .floor-tab:hover{background:#f1f5f9;color:#5b6678;border-color:#dbe3f0;transform:none;box-shadow:none;}
.floor-tabs .floor-tab.active{background:#4786FF;color:#fff;border-color:#4786FF;}
.floor-tabs .floor-tab.active:hover{background:#4786FF;color:#fff;border-color:#4786FF;transform:none;box-shadow:none;}
body.dark .floor-tabs .floor-tab{background:#2a3140;color:#c7d2e4;border-color:#3a4557;}
body.dark .floor-tabs .floor-tab.active{background:#4786FF;color:#fff;border-color:#4786FF;}
.floor-map {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 59px;
    align-content: start;
    gap: 6px;
    width: 100%;
    height: 270px;
    box-sizing: border-box;
    margin: 8px auto 4px;
    border: 2px solid rgba(71,134,255,.28);
    border-radius: 16px;
    padding: 4px;
    background: rgb(255 255 255 / 10%);
}
.floor-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 100%;
    font-size: 13px;
    color: #fff;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,0.05);
    user-select: none;
}
.floor-zone.fz-drug {
    cursor: pointer;
    background: rgb(166 189 233);
    border-color: rgba(71,134,255,.45);
    transition: background .15s ease, transform .15s ease;
}
.floor-zone.fz-drug:hover {
    background: rgba(71,134,255,.38);
    transform: translateY(-1px);
}
@keyframes floorFlash {
    0%, 100% { background: rgba(71,134,255,.20); box-shadow: none; }
    50% { background: rgba(255,196,54,.85); box-shadow: 0 0 14px rgba(255,178,38,.95); color: #333; }
}
.floor-zone.fz-drug.flash {
    animation: floorFlash .9s ease 6;
}
.loc-more-btn:hover{background:rgba(0,0,0,0.06)!important;}
body.dark .loc-more-btn{color:#b8c2d4;}
body.dark .loc-more-btn:hover{background:rgba(255,255,255,0.08)!important;}
body.dark .loc-more-menu{background:#2a3040 !important;border-color:#3c4458 !important;}
body.dark .loc-more-menu button{background:#2a3040 !important;color:#e8eaf2 !important;}
body.dark .loc-more-menu button:last-child{color:#ff6b6b !important;border-top-color:#3c4458 !important;}
button.loc-more-btn{
    padding:0 !important;
    background:transparent !important;
    border:none !important;
    color:#5b6678 !important;
    border-radius:35px !important;
    margin:0 !important;
    box-shadow:none !important;
    transform:none !important;
    transition:opacity .15s !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    opacity:0.6;
}
button.loc-more-btn:hover{
    opacity:1 !important;
    transform:none !important;
    box-shadow:none !important;
    background:rgba(0,0,0,0.08) !important;
    border-color:transparent !important;
}
button.loc-more-btn:active{
    transform:scale(0.85) !important;
    box-shadow:none !important;
    background:transparent !important;
}
body.dark button.loc-more-btn{color:#b8c2d4 !important;}
body.dark button.loc-more-btn:hover{background:transparent !important;border-color:#3c4458 !important;}
.loc-more-menu{border-radius:18px !important;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(-4px);transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease;;}
.loc-more-menu.open{opacity:1;visibility:visible;transform:translateY(0);}
.loc-more-menu.drop-up{top:auto !important;bottom:100%;margin-top:0 !important;margin-bottom:4px;transform:translateY(4px);}
.loc-more-menu.drop-up.open{transform:translateY(0);}
.loc-more-menu button{
    padding:8px 16px !important;
    margin:0 !important;
    border-radius:35px !important;
    box-shadow:none !important;
    transform:none !important;
    transition:opacity .15s !important;
    opacity:0.85;
    background:#fff !important;
    border:1px solid transparent !important;
}
.loc-more-menu button:hover,.loc-more-menu button:active{
    transform:none !important;
    box-shadow:none !important;
    background:rgba(71,134,255,0.12) !important;
    opacity:1 !important;
}
body.no-animation .loc-more-menu button:hover,body.no-animation .loc-more-menu button:active{background:rgba(71,134,255,0.12) !important;}
body.dark .loc-more-menu button{background:#2a3040 !important;}
body.dark .loc-more-menu button:hover,body.dark .loc-more-menu button:active{background:rgba(71,134,255,0.18) !important;}
.loc-zone-head,.loc-layer-head,.loc-pos{
    transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease,opacity .25s ease,transform .25s ease; !important;
    border-radius:35px !important;
    border:1px solid transparent;
    min-height:44px;
    display:flex;
    align-items:center;
}
.loc-zone-head:hover,.loc-layer-head:hover,.loc-pos:hover{
    background:#cacfd8 !important;
}
body.dark .loc-zone-head:hover,body.dark .loc-layer-head:hover,body.dark .loc-pos:hover{
    background:#2a3040 !important;
}
body.dark .loc-zone-head,body.dark .loc-layer-head,body.dark .loc-pos{color:#e6ebf3;}
body.dark .loc-zone-head span,body.dark .loc-layer-head span,body.dark .loc-pos span{color:inherit !important;}
#locMgrList .btn-mini{padding:8px 14px !important;font-size:13px !important;}
/* 批量删除按钮：图标与文字强制同一行，不随容器压窄换行竖排 */
#locBatchBtn{display:inline-flex !important;flex-direction:row !important;flex-wrap:nowrap !important;align-items:center !important;justify-content:center !important;white-space:nowrap !important;flex-shrink:0 !important;}
#locBatchBtn svg{flex-shrink:0 !important;display:block !important;}
#locBatchBtn span{white-space:nowrap !important;}
/* 药品别称：与药品名称垂直居中 */
.drug-alias{display:inline-block;vertical-align:middle;line-height:1;font-size:12px;position:relative;top:-1px;}
/* 存放位置多选：胶囊列表 + 添加按钮 */
.loc-chips{display:flex;flex-wrap:wrap;gap:6px;min-height:44px;padding:6px 10px;border:1px solid #e6e8f0;border-radius:14px;background:#fff;align-items:flex-start;box-sizing:border-box;}
.loc-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:4px 4px 4px 10px;border:1px solid #4786FF;border-radius:35px;background:rgba(71,134,255,0.10);font-size:13px;color:#4786FF;line-height:1.2;}
.loc-chip-txt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px;}
.loc-chip-x{border:none;background:transparent;color:#4786FF;font-size:12px;line-height:1;width:20px;height:20px;padding:0;margin:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border-radius:50%;flex:0 0 auto;}
.loc-chip-x:hover{background:rgba(71,134,255,0.18);}
.loc-chip-empty{font-size:13px;color:#8c9ab2;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;}
/* 存放位置胶囊：长按 0.52 秒 = 编辑这个位置（文本不可选、手机不弹系统菜单，按住时有按压反馈） */
.loc-chip,.loc-chip .loc-chip-txt{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;}
.loc-chip{transition:background-color .15s ease,border-color .15s ease,transform .15s ease;cursor:default;}
.loc-chip.loc-chip-press{background:rgba(71,134,255,0.26) !important;border-color:#2f6fe0 !important;transform:scale(.97);}
.loc-add-btn{margin-top:8px;padding:8px 14px;font-size:13px;border:1px dashed #4786FF;border-radius:35px;background:transparent;color:#4786FF;cursor:pointer;width:100%;}
.loc-add-btn:hover{background:rgba(71,134,255,0.08);}
body.dark .loc-chips{background:#262c3b;border-color:#3a4152;}
body.dark .loc-chip{background:rgba(71,134,255,0.18);border-color:#4786FF;color:#cfe0ff;}
body.dark .loc-chip-empty{color:#8890a6;}
/* 存放位置：输入框与「＋ 添加位置」同排，输入框 35px 圆角 */
.loc-row{display:flex;align-items:stretch;gap:10px;}
.loc-row .loc-chips{flex:1;min-width:0;min-height:44px;border-radius:35px;padding:4px 14px 4px 8px;align-items:center;align-content:center;}
.loc-row .loc-add-btn{width:auto;flex-shrink:0;margin-top:0;height:44px;padding:0 18px;border-radius:35px;white-space:nowrap;box-sizing:border-box;}
.loc-row .loc-add-btn:hover{background:rgba(71,134,255,0.08);}
body.dark .loc-row .loc-add-btn{color:#cfe0ff;border-color:#4786FF;}
/* 「＋ 添加位置」按钮：与输入框一致的胶囊形 */
.loc-row{align-items:center;}
.loc-row .loc-chips{border-radius:999px;}
.loc-row .loc-add-btn{border-radius:999px;height:44px;display:inline-flex;align-items:center;justify-content:center;line-height:1;padding:0 20px;}
/* 存放位置：高度与其他输入框统一 44px，chips 不换行改为横向滚动 */
.loc-row{align-items:center;margin:8px 0 14px;}
.loc-row .loc-chips{height:44px;min-height:44px;max-height:44px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;align-items:center;padding:0 14px 0 8px;box-sizing:border-box;}
.loc-row .loc-chips::-webkit-scrollbar{height:0;}
.loc-row .loc-add-btn{height:44px;min-height:44px;max-height:44px;box-sizing:border-box;}
/* 存放位置：与相邻输入框完全同一节奏（标签 + 8px 间距 + 44px 高 + 14px 下边距） */
#page4 .form-row>div .loc-row{margin:8px 0 14px;}
#page4 .form-row>div .loc-row .loc-chips,#page4 .form-row>div .loc-row .loc-add-btn{height:44px;box-sizing:border-box;}
/* 精确对齐「药品分类」框：分类框为 content-box，总高 = 44 + 2px 边框 = 46px */
.loc-row .loc-chips{height:46px;min-height:46px;max-height:46px;box-sizing:border-box;}
.loc-row .loc-add-btn{height:46px;min-height:46px;max-height:46px;box-sizing:border-box;}
/* 最终校准：位置行与「药品分类」框完全等高（总高 44px），上下间距 8/14 */
.loc-row{align-items:center!important;margin:8px 0 14px!important;height:44px!important;}
.loc-row .loc-chips{height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;padding:0 14px 0 8px!important;box-sizing:border-box!important;align-self:center!important;}
.loc-row .loc-add-btn{height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;padding:0 20px!important;box-sizing:border-box!important;align-self:center!important;}
/* 先/中/后 胶囊：桌面端 hover 也完全不变色（之前只在 @media (hover:none) 里锁过） */
.meal-btn:hover{background:#fff !important;color:#5b6678 !important;border-color:#dde1ea !important;box-shadow:none !important;transform:none !important;}
.meal-btn.active:hover{background:#2f6fe0 !important;color:#fff !important;border-color:#2f6fe0 !important;box-shadow:0 3px 10px rgba(47,111,224,0.3) !important;}
body.dark .meal-btn:hover{background:#20242f !important;color:#b8c2d4 !important;border-color:#3a4152 !important;}
body.dark .meal-btn.active:hover{background:#2f6fe0 !important;color:#fff !important;}
/* 添加位置按钮：hover 无底色（与药库小胶囊一致） */
.loc-row .loc-add-btn:hover{background:transparent !important;}
body.dark .loc-row .loc-add-btn:hover{background:transparent !important;}
/* 一层 / 二层：四行均分外框高度，行高一致（约 60px），格子间距统一 6px */
#floorMap1,#floorMap2{grid-template-rows:repeat(4,1fr);grid-auto-rows:auto;align-content:stretch;gap:6px;height:270px;}
#floorMap1 .floor-zone,#floorMap2 .floor-zone{min-height:44px;height:auto;}
/* 中药房：B架 独占第 1 行（跨满宽），第 2 行 A架(左) + D架(右)，第 3 行留空当走道，C架 在第 4 行右侧；四行与一层/二层同高（约 60px）、间距 6px、外框 270px */
#floorMap3{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(4,1fr);grid-auto-rows:auto;align-content:stretch;gap:6px;height:270px;}
#floorMap3 .floor-zone{min-height:44px;height:auto;}
/* 局域网同步：状态提示区固定 1 行高（24px），卡片高度不随提示文字变化 */
#lanHost{height:40px !important;min-height:40px !important;max-height:40px !important;box-sizing:border-box !important;line-height:22px !important;}
/* 一层不再单独拉伸行距：与二层同一套行高与 6px 间距（原先 align-content:space-between 会把间隙拉成 7~8px） */
/* 存放位置弹窗：勾选后的圆形复选框不要蓝色焦点外圈 */
.confirm-dialog input.loc-cb:focus,
.confirm-dialog input.loc-cb:focus-visible{outline:none !important;box-shadow:none !important;border-color:#c8cedd !important;}
.confirm-dialog input.loc-cb:checked:focus,
.confirm-dialog input.loc-cb:checked:focus-visible{box-shadow:none !important;border-color:#e23b3b !important;}
/* 「删除选中」按钮：去掉蓝色边框，与红色底色一致 */
#locBatchDelBtn{border:1px solid #e23b3b !important;box-shadow:none !important;}
/* 移动端：药品分类一行、存放位置一行（仅这两列的表单行纵向排列，PC 端不变） */
@media (max-width:768px){
.cat-loc-row{flex-direction:column;gap:0;}
.cat-loc-row>div{width:100%;flex:none;}
.loc-row .loc-chips{min-width:0;}
}
/* PC 端存放位置胶囊：不再横向裁切，放不下就换行，全部可见 */
@media (min-width:769px){
.loc-row{align-items:center!important;height:auto!important;min-height:44px!important;}
.loc-row .loc-chips{flex-wrap:wrap!important;overflow-x:visible!important;overflow-y:visible!important;height:auto!important;min-height:44px!important;max-height:none!important;padding:4px 14px 4px 8px!important;align-self:center!important;row-gap:6px!important;}
.loc-row .loc-add-btn{align-self:center!important;}
}
/* 隐藏原滚动条规则不再生效时的兼容：小于 PC 宽度仍可滚动 */
@media (max-width:768px){
.loc-row .loc-chips{overflow-x:auto!important;}
.loc-row .loc-chips::-webkit-scrollbar{height:4px;}
.loc-row .loc-chips::-webkit-scrollbar-thumb{background:rgba(71,134,255,.35);border-radius:2px;}
}
/* 药品分类一行、存放位置一行（PC 与移动端统一纵向排列） */
.cat-loc-row{flex-direction:column!important;gap:0!important;}
.cat-loc-row>div{width:100%!important;flex:none!important;min-width:0!important;}
/* 分类与药品属性并排 */
.cat-nature-row{display:flex!important;gap:12px;}
.cat-nature-row>.cat-cell,.cat-nature-row>.nature-cell{flex:1;min-width:0;}
@media (max-width:768px){
.cat-nature-row{gap:8px;}
}
/* 局域网同步状态区：加高一点，文字不再贴着卡片底边 */
/* 局域网状态文字在盒子内垂直居中 */
/* ========== 登录层 ========== */
.login-layer{position:fixed;left:0;top:0;width:100%;height:100%;z-index:10001;display:flex;align-items:center;justify-content:center;background:linear-gradient(165deg,#eef4ff 0%,#f8fbff 45%,#e6effc 100%);overflow:hidden;transition:opacity .28s ease,visibility .28s ease;}
.login-layer.hide{opacity:0;visibility:hidden;pointer-events:none;}
.login-bg-deco{position:absolute;width:520px;height:520px;border-radius:50%;background:radial-gradient(circle,rgba(71,134,255,.22),rgba(71,134,255,0) 68%);top:-190px;right:-150px;pointer-events:none;}
.login-bg-deco::after{content:"";position:absolute;width:360px;height:360px;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.9),rgba(255,255,255,0) 70%);left:-620px;top:520px;}
.login-card{position:relative;width:390px;max-width:88vw;padding:34px 30px 26px;border-radius:22px;background:rgba(255,255,255,.72);backdrop-filter:blur(30px) saturate(180%);-webkit-backdrop-filter:blur(30px) saturate(180%);box-shadow:0 18px 48px rgba(31,61,124,.16),0 2px 6px rgba(31,61,124,.06);border:1px solid rgba(255,255,255,.7);text-align:center;}
.login-logo{width:66px;height:66px;border-radius:50%;display:block;margin:0 auto 12px;box-shadow:0 6px 16px rgba(31,61,124,.18);}
.login-station{font-size:23px;font-weight:700;color:#1a2b47;letter-spacing:1px;}
.login-sub{font-size:12.5px;color:#7c8798;margin:6px 0 22px;letter-spacing:.5px;}
.login-field{position:relative;margin-bottom:12px;text-align:left;}
.login-field input{width:100%;height:48px;margin:0;border:1px solid #dbe3f1;border-radius:35px;background:#fff;padding:0 44px 0 46px;font-size:14.5px;box-sizing:border-box;transition:border-color .2s ease,box-shadow .2s ease;}
.login-field input:focus{border-color:#4786FF;box-shadow:0 0 0 3px rgba(71,134,255,.12);}
.login-ico{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:#9aa6bb;pointer-events:none;}
.login-eye{position:absolute;right:6px;top:0;bottom:0;margin:auto;transform:none;z-index:2;width:36px;height:36px;padding:0;background:transparent !important;border:none;border-radius:50%;color:#9aa6bb;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .18s ease,color .18s ease;outline:none;-webkit-tap-highlight-color:transparent;}
.login-eye:hover{background:rgba(0,0,0,.04) !important;color:#5b6678;}
body.dark .login-eye:hover{background:rgba(255,255,255,.08) !important;color:#c7d2e4;}
.login-eye:active,.login-eye:focus{background:transparent !important;color:#5b6678;transform:none;outline:none;box-shadow:none;}
.login-eye svg{display:block;pointer-events:none;width:18px;height:18px;}
.login-eye .eye-off{display:none;}
.login-eye.show-off .eye-on{display:none;}
.login-eye.show-off .eye-off{display:block;}
.login-error{min-height:20px;margin:2px 4px 6px;font-size:12.5px;color:#e0483f;text-align:left;line-height:1.5;}
.login-remember-row{display:flex;justify-content:flex-start;margin:0 2px 14px;}
.login-remember{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;color:#6b7788;cursor:pointer;user-select:none;}
.login-remember input{display:none;}
.login-remember .lr-box{width:20px;height:20px;box-sizing:border-box;border:2px solid #ccd3e0;border-radius:50%;background:#fff;position:relative;transition:border-color .2s ease,background .2s ease;flex:none;}
.login-remember input:checked+.lr-box{background:#4786FF;border-color:#4786FF;}
.login-remember input:checked+.lr-box::after{content:"";position:absolute;left:50%;top:50%;width:6px;height:11px;box-sizing:border-box;border:solid #fff;border-width:0 2px 2px 0;transform:translate(-50%,-50%) rotate(45deg);animation:checkDraw .2s ease forwards;}
.login-btn{width:100%;height:50px;margin:0;border:none;border-radius:35px;background:linear-gradient(135deg,#5b9bff,#2f6fe0);color:#fff;font-size:16px;font-weight:600;letter-spacing:5px;cursor:pointer;box-shadow:0 8px 18px rgba(47,111,224,.28);transition:transform .2s ease,box-shadow .2s ease,filter .2s ease;}
.login-btn:hover{filter:brightness(1.04);box-shadow:0 10px 22px rgba(47,111,224,.34);}
.login-btn:active{transform:scale(.85);}
.login-hint{margin-top:14px;font-size:12px;color:#8b96a8;line-height:1.6;}
.login-hint.warn{color:#c0392b;}
@media (max-width:480px){
    .login-card{width:88vw;padding:28px 22px 22px;border-radius:20px;}
    .login-station{font-size:20px;}
}
body.dark .login-layer{background:linear-gradient(165deg,#101521 0%,#161d2c 50%,#0e131d 100%);}
body.dark .login-card{background:rgba(32,38,52,.78);border-color:rgba(255,255,255,.08);box-shadow:0 18px 48px rgba(0,0,0,.5);}
body.dark .login-station{color:#eef0f6;}
body.dark .login-sub,body.dark .login-hint{color:#93a0b6;}
body.dark .login-field input{background:#1f2634;border-color:#333d51;color:#eef0f6;}
body.dark .login-field input:focus{background:#232b3b;}
body.dark .login-ico{color:#7c8798;}
body.dark .login-remember{color:#a9b4c6;}
body.dark .login-remember .lr-box{background:#1f2634;border-color:#3c4760;}
body.dark .login-remember input:checked+.lr-box{background:#4786FF;border-color:#4786FF;}
/* ========== 侧边栏人员卡片 ========== */
.sidebar-user{position:relative;display:flex;align-items:center;gap:10px;margin:8px 0 10px;padding:9px 12px;border-radius:35px;background:rgba(71,134,255,.09);cursor:pointer;transition:background .18s ease;}
.sidebar-user:hover{background:rgba(71,134,255,.16);}
.su-avatar{width:34px;height:34px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#5b9bff,#2f6fe0);color:#fff;font-size:15px;font-weight:600;}
.su-meta{display:flex;flex-direction:column;min-width:0;flex:1;text-align:left;}
.su-name{font-size:14px;font-weight:600;color:#24344f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.su-role{font-size:11.5px;color:#71809a;margin-top:1px;}
.su-caret{font-size:12px;color:#9aa6bb;}
.user-menu{position:absolute;top:calc(100% + 8px);left:0;right:0;background:rgba(255,255,255,.92);backdrop-filter:blur(20px);border-radius:24px;box-shadow:0 10px 26px rgba(31,61,124,.16);padding:6px;display:none;z-index:120;}
.user-menu.show{display:block;transform-origin:100% 0;animation:userMenuPop .34s cubic-bezier(.25,.9,.35,1) both;}
@keyframes userMenuPop{
    0%{opacity:0;transform:scale(.9) translateY(-6px);}
    58%{opacity:1;transform:scale(1.02) translateY(1px);}
    82%{transform:scale(.997) translateY(0);}
    100%{opacity:1;transform:scale(1) translateY(0);}
}
.user-menu div{display:flex;align-items:center;gap:9px;padding:11px 12px;border-radius:22px;font-size:13.5px;color:#3a4a63;cursor:pointer;}
.user-menu div:hover{background:rgba(71,134,255,.1);}
.user-menu div.danger{color:#d9534f;}
.user-menu div.danger:hover{background:rgba(217,83,79,.1);}
body.dark .sidebar-user{background:rgba(71,134,255,.16);}
body.dark .sidebar-user:hover{background:rgba(71,134,255,.26);}
body.dark .su-name{color:#eef0f6;}
body.dark .su-role{color:#93a0b6;}
body.dark .user-menu{background:rgba(32,38,52,.95);box-shadow:0 10px 26px rgba(0,0,0,.45);}
body.dark .user-menu div{color:#d7deec;}
body.dark .user-menu div:hover{background:rgba(71,134,255,.2);}
/* ========== 人员管理页 ========== */
.user-tip{font-size:12.5px;color:#7c8798;line-height:1.75;margin:2px 0 14px;text-align:left;}
.user-list{display:flex;flex-direction:column;gap:10px;}
.user-row{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid #e7ecf6;border-radius:18px;background:rgba(255,255,255,.7);flex-wrap:wrap;}
.user-row .ur-avatar{width:38px;height:38px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;color:#fff;font-size:16px;font-weight:600;background:linear-gradient(135deg,#5b9bff,#2f6fe0);}
.user-row .ur-main{flex:1;min-width:140px;text-align:left;}
.user-row .ur-name{font-size:15px;font-weight:600;color:#24344f;display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.user-row .ur-sub{font-size:12px;color:#8590a3;margin-top:3px;}
.user-row .ur-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;}
.user-row .ur-actions button{padding:7px 12px;font-size:12.5px;margin:0;border-radius:35px;height:auto;line-height:1.2;}
.role-badge{font-size:11.5px;padding:2px 9px;border-radius:20px;font-weight:500;line-height:1.6;}
.role-admin{background:rgba(71,134,255,.14);color:#2f6fe0;}
.role-doctor{background:rgba(34,170,102,.14);color:#178a52;}
.role-cashier{background:rgba(230,162,60,.18);color:#b8760f;}
.role-pharmacy{background:rgba(124,92,255,.16);color:#5f43cc;}
.user-off{font-size:11.5px;color:#d9534f;border:1px solid rgba(217,83,79,.35);padding:2px 8px;border-radius:20px;}
.user-empty{color:#98a2b3;font-size:13px;padding:14px;text-align:center;border:1px dashed #dfe5f0;border-radius:16px;background:rgba(255,255,255,.5);}
body.dark .user-row{background:rgba(38,45,60,.7);border-color:#313b4e;}
body.dark .user-row .ur-name{color:#eef0f6;}
body.dark .user-row .ur-sub{color:#93a0b6;}
body.dark .user-tip{color:#93a0b6;}
body.dark .user-empty{border-color:#3a4557;background:rgba(38,45,60,.4);color:#8f9bb0;}
body.dark .role-admin{background:rgba(71,134,255,.22);color:#8fb4ff;}
body.dark .role-doctor{background:rgba(34,170,102,.2);color:#63d69a;}
body.dark .role-cashier{background:rgba(230,162,60,.22);color:#f0bf74;}
body.dark .role-pharmacy{background:rgba(124,92,255,.24);color:#b3a0ff;}
#page8 select,#page8 input{margin:8px 0 14px;}
#pwdDlg input{width:100%;box-sizing:border-box;margin:0 0 4px;}
.pwd-field{position:relative;}
.pwd-field input{padding-right:44px !important;}
/* ========== 数据操作授权码 ========== */
.auth-tip{font-size:12.5px;color:#7c8798;line-height:1.75;margin:2px 0 12px;text-align:left;}
.auth-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.auth-row label{font-weight:normal;color:#666;font-size:13px;margin:0;flex:none;}
#authCodeCard .auth-row button{margin:0;flex:none;height:40px;line-height:40px;padding:0 18px;}
.auth-row select{height:40px;line-height:38px;padding:0 36px 0 14px;border:1px solid #d3d9e8;border-radius:35px;background:#fff;font-size:14px;margin:0;box-sizing:border-box;width:132px !important;min-width:132px;flex:none;}
.auth-code-box{margin-top:12px;padding:14px;border-radius:16px;background:#f4f7fd;border:1px dashed #d7e2f6;color:#8590a3;font-size:13px;text-align:center;line-height:1.6;}
.auth-code-box.on{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;background:#fff;border-style:solid;border-color:#cfe0ff;}
.auth-code-box .ac-code{font-size:24px;font-weight:700;letter-spacing:6px;color:#2f6fe0;font-family:ui-monospace,Menlo,Consolas,monospace;cursor:pointer;padding:2px 8px;border-radius:10px;transition:background .15s ease;-webkit-tap-highlight-color:transparent;}
.auth-code-box .ac-meta{font-size:12px;color:#7c8798;}
body.dark .auth-tip{color:#93a0b6;}
body.dark .auth-row select{background:#1f2634;border-color:#333d51;color:#eef0f6;}
body.dark .auth-code-box{background:rgba(38,45,60,.6);border-color:#333d51;color:#93a0b6;}
body.dark .auth-code-box.on{background:rgba(38,45,60,.85);border-color:#3a5a8f;}
body.dark .auth-code-box .ac-code{color:#8fb4ff;}
#authFixedCode{font-family:ui-monospace,Menlo,Consolas,monospace;text-align:center;}
#authCodeCard .auth-row{flex-wrap:wrap;}
@media (max-width:480px){#authFixedCode{width:100% !important;}}
body.dark #authFixedCode{background:#1f2634;border-color:#333d51;color:#eef0f6;}
#authCodeCard .auth-row .btn-plain{margin:0;flex:none;height:40px;line-height:40px;padding:0 16px;background:#f1f3f6;color:#5b6678;border:1px solid #d9dfe8;}
.auth-code-box .ac-code:hover{background:rgba(71,134,255,.1);}
.auth-code-box .ac-code:active{background:rgba(71,134,255,.18);}
/* 固定码那一行：输入框独占一行，三个按钮三等分铺满 */
@media (max-width:768px){
    #authCodeCard .auth-fixed-row{display:flex;flex-wrap:wrap;gap:10px;}
    #authCodeCard .auth-fixed-row input{flex:1 1 100%;width:100% !important;max-width:none !important;}
    #authCodeCard .auth-row.auth-fixed-row button.btn-plain{flex:1 1 0 !important;min-width:0;width:auto !important;margin:0 !important;padding:0 6px !important;height:40px;line-height:40px;font-size:13.5px;white-space:nowrap;}
}
/* ===== 全站按钮统一点击手感（对齐右上角时钟/主题按钮） ===== */
button{-webkit-tap-highlight-color:transparent;
    transition:transform .3s ease,box-shadow .3s ease,background-color .2s ease,color .2s ease,opacity .2s ease;}
button:not(:disabled):not(.theme-toggle):not(.theme-logout):not(.switch-track):not(.login-eye):not(.btn-clear):not(.sel-clear):not(.dl-name-clear):not(.barcode-clear):not(.torch-btn):not(.sidebar-clock):not(.check-search-clear):not(#optionMgrClear):not(#locMgrClear):not(#unitMgrClear):active{transform:scale(.85);}
button:disabled{opacity:.55;cursor:not-allowed;}
/* 按下态保持（松手后由 setTimeout 延迟回弹） */
button.btn-pressed:not(.btn-clear):not(.sel-clear):not(.dl-name-clear):not(.barcode-clear):not(.login-eye):not(.switch-track):not(.check-search-clear):not(#optionMgrClear):not(#locMgrClear):not(#unitMgrClear){transform:scale(.85) !important;}
/* 点击“编辑”后目标表单高亮提示 */
.card.edit-flash{animation:editCardFlash 1s ease;}
@keyframes editCardFlash{0%{box-shadow:0 0 0 0 rgba(71,134,255,.45);}55%{box-shadow:0 0 0 10px rgba(71,134,255,0);}100%{box-shadow:0 0 0 0 rgba(71,134,255,0);}}
/* 授权码大框：整条框都能点，点击即复制 */
.auth-code-box.on{cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .15s ease,border-color .15s ease;}
.auth-code-box.on:active{background:#eaf1ff !important;border-color:#9bbcff !important;}
body.dark .auth-code-box.on:active{background:#2a3550 !important;}
/* 固定授权码行：PC 端单行，三个按钮三等分铺满剩余整行 */
@media (min-width:769px){
    #authCodeCard .auth-row.auth-fixed-row{flex-wrap:nowrap;gap:10px;}
    #authCodeCard .auth-fixed-row #authFixedCode{flex:0 0 250px;width:250px !important;max-width:250px !important;min-width:0;}
    #authCodeCard .auth-fixed-row button.btn-plain{flex:1 1 0 !important;min-width:0;width:auto !important;margin:0 !important;padding:0 8px !important;white-space:nowrap;}
}
/* 局域网自检结果：默认隐藏，自检后显示，可复制 */
#lanSelfOut{display:none;margin:10px 0 0;padding:10px 12px;border:1px solid #dbe6ff;border-radius:14px;background:#f5f9ff;color:#33475f;font-size:12.5px;line-height:1.7;white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}
body.dark #lanSelfOut{background:#1c2233;border-color:#2c3550;color:#c9d3e6;}
body.dark .lan-sync-card #lanSelfOut{color:#c9d3e6 !important;}
/* 局域网同步：状态点与提示文字各占一行，不再互相压住 */
#syncDot{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12.5px;font-weight:700;line-height:1.55;margin:12px 0 0;}
#syncDot .sd-text{color:#98a2b3;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 96px);}
#lanInfo{display:block;height:auto;min-height:20px;max-height:none;overflow:visible;white-space:pre-line;margin:10px 0 0;padding:10px 12px;border:1px solid #e6ebf5;border-radius:12px;background:#f7f9fd;color:#55637a;font-size:12.8px;line-height:1.7;box-sizing:border-box;}
#lanInfo:empty{display:none;}
.sync-warn{margin:10px 0 0;padding:11px 13px;border-radius:12px;background:#fff6ed;border:1px solid #ffd9b3;color:#a35b00;font-size:12.8px;line-height:1.75;}
.sync-warn b{color:#8a4a00;}
.sync-warn button{margin-top:8px;border:none;border-radius:35px;padding:7px 14px;background:#ff8a1f;color:#fff;font-size:12.5px;font-weight:600;}
body.dark #lanInfo{background:#1c2333;border-color:#2b3448;color:#a9b4c9;}
body.dark .sync-warn{background:#33260f;border-color:#5a431d;color:#ffce8a;}
/* ===== 关于本站（独立整页） ===== */
.sidebar-about{margin:6px 12px 8px;padding:12px 14px;display:flex;align-items:center;gap:6px;background:#eef3fd;color:#2f6fe0;border-radius:35px;font-size:14px;font-weight:700;cursor:pointer;transition:0.3s;box-sizing:border-box;justify-content:center;}
.sidebar-about:hover{background:#e3ecff;}
.sidebar-about.active{background:#4786FF;color:#fff;}
.sidebar-about:active{transform:scale(0.96);}
body.dark .sidebar-about{background:#1f2a3c;color:#8fb0ff;}
body.dark .sidebar-about.active{background:#3a6fd4;color:#fff;}
.about-hero{display:flex;align-items:center;gap:16px;flex-wrap:wrap;}
.about-hero img{width:60px;height:60px;object-fit:contain;flex-shrink:0;}
.about-hero>div{flex:1 1 320px;min-width:0;}
.about-hero h2{margin:0 0 6px;font-size:21px;color:#1f2a3d;}
.about-hero p{margin:0;font-size:13px;color:#6b7280;line-height:1.7;}
.about-badge{margin-left:auto;flex-shrink:0;font-size:12px;font-weight:700;color:#2f6fe0;background:#e8effc;border-radius:999px;padding:6px 12px;white-space:nowrap;}
.about-kpis{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px;}
.about-kpi{flex:1 1 120px;min-width:100px;background:#f7f9fe;border:1px solid #e6ecf9;border-radius:12px;padding:12px 10px;text-align:center;}
.about-kpi b{display:block;font-size:20px;color:#2f6fe0;line-height:1.2;}
.about-kpi span{font-size:12px;color:#8b95aa;}
.about-note{font-size:12px;color:#8b95aa;margin-top:12px;line-height:1.7;}
.about-sec-title{font-size:16px;font-weight:800;color:#1f2a3d;margin-bottom:6px;}
.about-sec-sub{font-size:12.5px;color:#8b95aa;margin-bottom:14px;line-height:1.7;}
.about-sec-sub--scroll{max-height:56vh;overflow-y:auto;}
.about-feature{display:flex;gap:12px;padding:12px 0;border-bottom:1px dashed #e6eaf3;}
.about-feature:last-child{border-bottom:none;}
.about-num{flex-shrink:0;width:24px;height:24px;border-radius:50%;background:#4786FF;color:#fff;font-size:13px;font-weight:800;display:flex;align-items:center;justify-content:center;}
.about-feature h4{margin:0 0 4px;font-size:14px;color:#1f2a3d;}
.about-feature p{margin:0;font-size:13px;color:#4b5563;line-height:1.8;}
.about-feature .where{display:inline-block;margin-top:6px;font-size:12px;color:#2f6fe0;background:#eef4ff;border-radius:999px;padding:2px 10px;}
.about-steps{margin:0;padding:0;list-style:none;counter-reset:step;}
.about-steps li{position:relative;padding:6px 0 6px 32px;font-size:13px;color:#4b5563;line-height:1.8;}
.about-steps li::before{counter-increment:step;content:counter(step);position:absolute;left:0;top:8px;width:22px;height:22px;border-radius:50%;background:#e8effc;color:#2f6fe0;font-size:12px;font-weight:800;display:flex;align-items:center;justify-content:center;}
.about-list{margin:0;padding:0;list-style:none;}
.about-list li{position:relative;padding:5px 0 5px 16px;font-size:13px;color:#4b5563;line-height:1.8;}
.about-list li::before{content:"";position:absolute;left:0;top:12px;width:5px;height:5px;border-radius:50%;background:#4786FF;}
.about-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
.about-grid2 h4{margin:4px 0 6px;font-size:14px;color:#1f2a3d;}
.about-ver-table{table-layout:fixed;width:100%;max-height:56vh;overflow-y:auto;display:block;}
.about-ver-table th,.about-ver-table td{text-align:left;white-space:normal;word-break:break-word;vertical-align:middle;font-size:12.5px;line-height:1.6;}
body.dark .about-hero h2,body.dark .about-sec-title,body.dark .about-feature h4,body.dark .about-grid2 h4{color:#e6ecf7;}
body.dark .about-hero p,body.dark .about-feature p,body.dark .about-list li,body.dark .about-steps li{color:#c3cbdb;}
body.dark .about-kpi{background:#1f2a3c;border-color:#2a3550;}
body.dark .about-feature{border-bottom-color:#2a3550;}
body.dark .about-feature .where,body.dark .about-steps li::before{background:#243049;color:#8fb0ff;}
@media(max-width:760px){.about-grid2{grid-template-columns:1fr;gap:10px;}}
@media(max-width:640px){
    .about-hero h2{font-size:19px;}
    .about-hero>div{flex-basis:100%;}
    .about-badge{margin-left:0;}
    .about-kpi{min-width:calc(50% - 5px);}
}
/* 关于本站：表格移动端适配（堆叠为卡片，避免横向溢出） */
.about-table{table-layout:fixed;width:100%;font-size:12.5px;}
.about-table th,.about-table td{white-space:normal;word-break:break-word;vertical-align:top;line-height:1.65;text-align:left;}
/* 关于本站表格：单元格内容垂直居中（文件名折行时，右侧说明不再贴着第一行） */
.about-table th,.about-table td{vertical-align:middle !important;}
@media(max-width:700px){
    .about-table{display:block;width:100%;border:none;border-radius:0;background:transparent;overflow:visible;}
    .about-table tr:first-child{display:none;}
    .about-table tr{display:block;border:1px solid #e6e8f0;border-radius:12px;padding:10px 12px;margin:0 0 10px;background:#fff;}
    .about-table td{display:block;width:auto!important;max-width:100%;border:none!important;padding:2px 0;text-align:left!important;font-size:12.5px;}
    .about-table td:first-child{font-weight:800;color:#2f6fe0;font-size:13.5px;margin-bottom:2px;}
    .about-table td:nth-child(2){color:#4b5563;}
    .about-ver-table td:nth-child(2){font-size:12px;color:#8b95aa;white-space:normal;}
    .about-ver-table td:nth-child(3){font-weight:700;color:#1f2a3d;margin:4px 0 2px;}
    .about-ver-table td:nth-child(4){color:#4b5563;line-height:1.7;}
}
body.dark .about-table tr{background:#1b2230;border-color:#2a3550;}
body.dark .about-ver-table td:nth-child(3){color:#e6ecf7;}
@media(max-width:700px){
    .about-ver-table{display:block;width:100%;border:none;border-radius:0;background:transparent;table-layout:auto;}
    .about-ver-table tr:first-child{display:none;}
    .about-ver-table tr{display:block;border:1px solid #e6e8f0;border-radius:12px;padding:10px 12px;margin:0 0 10px;background:#fff;}
    .about-ver-table td{display:block;width:auto!important;max-width:100%;border:none!important;padding:2px 0;text-align:left!important;}
    .about-ver-table td:nth-child(1){color:#2f6fe0;font-weight:800;font-size:13.5px;}
    .about-ver-table td:nth-child(2){color:#8b95aa;font-size:12px;}
    .about-ver-table td:nth-child(3){font-weight:700;color:#1f2a3d;font-size:13px;margin:3px 0 2px;}
}
body.dark .about-ver-table tr{background:#1b2230;border-color:#2a3550;}
body.dark .about-ver-table td:nth-child(3){color:#e6ecf7;}
/* ===== 新功能介绍卡片 ===== */
.intro-layer{position:fixed;inset:0;z-index:10005;background:rgba(15,23,42,.48);display:flex;align-items:center;justify-content:center;padding:18px;box-sizing:border-box;backdrop-filter:blur(2px);touch-action:none;overscroll-behavior:contain;}
.intro-layer.hide{display:none;}
.intro-card{width:100%;max-width:460px;max-height:86vh;background:#fff;border-radius:18px;box-shadow:0 24px 60px rgba(15,23,42,.28);display:flex;flex-direction:column;overflow:hidden;touch-action:auto;overscroll-behavior:contain;}
.intro-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 18px;border-bottom:1px solid #eef1f7;}
.intro-title{font-size:15px;font-weight:800;color:#1f2a3d;}
.intro-x{width:36px;height:36px;min-width:36px;margin:0;padding:0;border:none;background:transparent !important;font-size:17px;color:#8b95aa;cursor:pointer;border-radius:35px;line-height:1;display:inline-flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;}
.intro-x:hover{background:#f1f4fa;color:#e23b3b;}
.intro-body{padding:14px 18px 6px;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;min-height:0;}
.intro-sec{margin-bottom:12px;}
.intro-sec h4{margin:0 0 5px;font-size:13.5px;color:#2f6fe0;}
.intro-sec p{margin:0;font-size:13px;color:#4b5563;line-height:1.8;}
.intro-sec ul{margin:0;padding-left:18px;}
.intro-sec li{font-size:13px;color:#4b5563;line-height:1.8;margin:3px 0;}
.intro-sec li b{color:#1f2a3d;}
.intro-foot{display:flex;gap:10px;padding:12px 18px 16px;border-top:1px solid #eef1f7;flex:0 0 auto;}
.intro-foot button{flex:1;height:40px;border-radius:35px;font-size:14px;}
body.dark .intro-card{background:#1b2230;}
body.dark .intro-head,body.dark .intro-foot{border-color:#2a3550;}
body.dark .intro-title,body.dark .intro-sec li b{color:#e6ecf7;}
body.dark .intro-sec p,body.dark .intro-sec li{color:#c3cbdb;}
body.dark .intro-x:hover{background:#243049;}
@media(max-width:480px){
    .intro-card{max-height:82vh;border-radius:16px;}
    .intro-head{padding:12px 14px;}
    .intro-body{padding:12px 14px 4px;}
    .intro-foot{padding:10px 14px 14px;}
    .intro-sec p,.intro-sec li{font-size:12.5px;}
}

/* ===== 网站学习聚光灯漫游引导 ===== */
.tour-layer{position:fixed;inset:0;z-index:10006;pointer-events:none;}
.tour-layer.hide{display:none;}
.tour-mask{position:fixed;background:rgba(15,23,42,.55);}
.tour-mask-top{left:0;top:0;width:100%;}
.tour-mask-bottom{left:0;bottom:0;width:100%;}
.tour-mask-left{top:0;left:0;height:100%;}
.tour-mask-right{top:0;right:0;height:100%;}
.tour-highlight{position:fixed;border-radius:14px;box-shadow:0 0 0 2px rgba(71,134,255,.9),0 10px 30px rgba(15,23,42,.3);background:transparent;pointer-events:none;transition:all .25s ease;}
.tour-bubble{position:fixed;z-index:10007;width:min(360px,88vw);max-height:calc(100vh - 24px);display:flex;flex-direction:column;background:#fff;border-radius:18px;box-shadow:0 24px 60px rgba(15,23,42,.3);overflow:hidden;pointer-events:auto;}
.tour-bubble-head{display:flex;align-items:center;gap:10px;padding:14px 16px 8px;}
.tour-step{flex:none;min-width:34px;height:22px;padding:0 8px;border-radius:35px;background:#eef4ff;color:#2f6fe0;font-size:12.5px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;}
.tour-title{flex:1;font-size:15.5px;font-weight:700;color:#1d2738;}
.tour-x{flex:none;width:28px;height:28px;padding:0;margin:0;box-sizing:border-box;border-radius:50%;border:none;background:#f1f3f6;color:#5b6678;font-size:13px;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;}
.tour-body{flex:1 1 auto;min-height:0;padding:4px 16px 12px;color:#475266;font-size:13.5px;line-height:1.65;overflow-y:auto;overscroll-behavior:contain;}
.tour-foot{flex:none;display:flex;align-items:center;gap:10px;padding:12px 16px 14px;border-top:1px solid #eef1f7;}
.tour-foot .btn-plain{flex:0 0 auto;height:38px;margin:0;padding:0 16px;border-radius:35px;font-size:14px;line-height:1;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;}
.tour-foot .btn-blue{flex:0 0 auto;height:38px;margin:0;padding:0 20px;border-radius:35px;font-size:14px;line-height:1;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;}
.tour-dots{flex:1 1 0;min-width:0;display:flex;gap:5px;justify-content:center;}
.tour-dots i{width:6px;height:6px;border-radius:50%;background:#d6deec;}
.tour-dots i.on{background:#2b6de0;}
body.dark .tour-bubble{background:#1b2230;}
body.dark .tour-title{color:#e6ecf7;}
body.dark .tour-body{color:#c3cbdb;}
body.dark .tour-foot{border-color:#2a3550;}
body.dark .tour-x{background:#243049;color:#c3cbdb;}
@media(max-width:480px){.tour-bubble{width:92vw;}}
/* 回到顶部按钮（药品库存数据页） */
.back-top{position:fixed;right:24px;bottom:24px;width:48px;height:48px;padding:0;margin:0;box-sizing:border-box;border-radius:50%;border:none;background:#2b6de0;color:#fff;font-size:20px;line-height:1;cursor:pointer;box-shadow:0 6px 16px rgba(43,109,224,.32);display:inline-flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transform:translateY(10px);pointer-events:none;transition:opacity .3s ease,transform .3s ease,box-shadow .3s ease,visibility .3s ease;z-index:9990;}
.back-top.show{opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto;}
.back-top:hover{transform:translateY(-4px);box-shadow:0 10px 22px rgba(43,109,224,.4);}
body.dark .back-top{background:#2f6fe0;}
@media(max-width:600px){.back-top{right:16px;bottom:16px;}}
.intro-switch-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 22px;border:1px solid #e6e8f0;border-radius:35px;font-size:13.5px;color:#1f2a3d;font-weight:600;cursor:pointer;}
body.dark .intro-switch-row{border-color:#2a3550;color:#e6ecf7;}
/* 临时授权码：有效期下拉框、固定授权码输入框统一成系统标准输入框样式（1px 灰边、35px 圆角、44 高，聚焦变蓝） */
#authCodeMinutes,#authFixedCode{height:44px !important;line-height:42px;border:1px solid #dde1ea !important;border-radius:35px !important;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.05) !important;outline:none;font-size:14px;transition:border-color .2s ease;}
#authFixedCode{width:268px;padding:0 18px !important;margin:0;text-align:center;letter-spacing:1px;}
#authCodeMinutes{padding:0 36px 0 16px !important;}
#authCodeMinutes:focus,#authFixedCode:focus{border-color:#4786FF !important;box-shadow:0 0 0 3px rgba(71,134,255,.12) !important;}
body.dark #authCodeMinutes,body.dark #authFixedCode{background:#1f2634;border-color:#333d51 !important;color:#eef0f6;box-shadow:0 2px 6px rgba(0,0,0,.4) !important;}
body.dark #authCodeMinutes:focus,body.dark #authFixedCode:focus{border-color:#5b9bff !important;}
/* 临时授权码：移动端「有效期 + 生成授权码」一行等分铺满，标签单独一行，避免文字被挤 */
@media (max-width:768px){
    #authCodeCard .auth-row:not(.auth-fixed-row){display:flex;flex-wrap:wrap;gap:10px;align-items:center;}
    #authCodeCard .auth-row:not(.auth-fixed-row) label{flex:0 0 auto;margin:0;font-size:13px;white-space:nowrap;}
    #authCodeMinutes{flex:1 1 0 !important;width:auto !important;min-width:0 !important;max-width:none !important;padding:0 34px 0 18px !important;}
    #authCodeCard .auth-row:not(.auth-fixed-row) button{flex:1 1 0 !important;width:auto !important;min-width:0 !important;margin:0 !important;padding:0 10px !important;white-space:nowrap;}
}
/* ===== 存放位置提示（最近一次录入药品） ===== */
.loc-prev-bar{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding:10px 16px;border-radius:35px;background:#eef5ff;border:1px solid #cfe0ff;color:#2f6fe0;font-size:13px;font-weight:600;box-shadow:0 2px 6px rgba(0,0,0,.04);}
.loc-prev-bar .loc-prev-txt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.loc-prev-bar .loc-prev-close{border:none;background:transparent;color:#8fb0e8;font-size:15px;line-height:1;width:28px;height:28px;min-width:28px;margin:0;padding:0;border-radius:35px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;}
.loc-prev-bar .loc-prev-close:hover{background:#dfeafc;color:#2f6fe0;}
.loc-prev-hint{margin-top:6px;font-size:12.5px;line-height:1.6;color:#2f6fe0;background:#f4f8ff;border:1px dashed #cfe0ff;border-radius:12px;padding:7px 10px;word-break:break-all;}
.loc-prev-ico{flex:none;}
body.dark .loc-prev-bar{background:#1c2740;border-color:#2f4468;color:#8fb4ff;}
body.dark .loc-prev-bar .loc-prev-close{color:#7f9cc9;}
body.dark .loc-prev-hint{background:#1b2230;border-color:#2f4468;color:#8fb4ff;}
@media (max-width:600px){
    .loc-prev-bar{font-size:12.5px;padding:9px 14px;}
    .loc-prev-bar .loc-prev-txt{white-space:normal;}
}
/* 存放位置：单行横向滑动，每个位置完整显示不省略、不换行堆叠 */
.loc-chip{flex:0 0 auto;max-width:none !important;}
.loc-chip-txt{max-width:none !important;white-space:nowrap !important;overflow:visible !important;text-overflow:clip !important;line-height:1.35;}
.loc-row .loc-chips{max-height:none !important;height:auto !important;min-height:44px;flex-wrap:nowrap !important;overflow-x:auto !important;overflow-y:hidden !important;align-items:center;padding:6px 14px 6px 8px !important;-webkit-overflow-scrolling:touch;scrollbar-width:thin;}
.loc-row .loc-chips::-webkit-scrollbar{height:4px;}
.loc-row .loc-chips::-webkit-scrollbar-thumb{background:#cfe0ff;border-radius:35px;}
@media (max-width:600px){
    .loc-row .loc-chips{height:auto !important;max-height:none !important;flex-wrap:nowrap !important;overflow-x:auto !important;overflow-y:hidden !important;padding:6px 14px 6px 8px !important;}
}
/* 上一个位置提示：胶囊圆角 + 与下方规格留出间距 */
.loc-prev-hint{border-radius:35px !important;margin:8px 0 18px !important;padding:10px 16px !important;line-height:1.7;}
/* 还没有上一次录入时的占位提示：颜色淡一点，和真实提示区分开 */
.loc-prev-hint.loc-prev-hint-empty{color:#8c9ab2 !important;}
/* ===== 回收站 ===== */
.trash-tip{margin:0 0 12px;padding:12px 20px;border-radius:35px;background:#f6f9ff;border:1px solid #e2ecff;color:#4a6b9c;font-size:12.5px;line-height:1.7;font-weight:normal;}
.trash-stats{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px;}
.trash-stat{display:inline-flex;align-items:center;gap:5px;padding:5px 12px;border-radius:35px;background:#f4f6fb;border:1px solid #e4e9f4;color:#5c6880;font-size:12.5px;font-weight:600;}
.trash-stat b{color:#2f6fe0;font-weight:700;}
.trash-stat-all{background:#eef5ff;border-color:#d5e5ff;}
.trash-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 14px;}
.trash-toolbar select{height:42px;border-radius:35px;}
.trash-search-row{flex:1 1 220px;min-width:170px;margin:0;}
.trash-search-row .search-input{padding:0 46px 0 40px;}
.trash-search-row .btn-clear{right:12px;}
.trash-clear-btn{height:42px;white-space:nowrap;border-radius:35px;padding:0 18px;color:#c2413a;border-color:#f0d6d3;}
.trash-wipe-btn{height:42px;white-space:nowrap;border-radius:35px;padding:0 18px;color:#fff;background:#c2413a;border-color:#c2413a;font-weight:700;}
/* 「恢复上次清空」：清空后一键把那一批记录全部放回 */
.trash-undo-btn{height:42px;white-space:nowrap;border-radius:35px;padding:0 18px;color:#2f6fe0;background:#eef5ff;border-color:#cfe0ff;font-weight:700;}
/* 回收站三个按钮：hover / active 全程锁住原色（压过 btn-plain 的 background:inherit + opacity），
   并给柔和的悬停浮起与按压回弹（.btn-plain:hover 的 transition:none 在这里被同权重后置覆盖） */
.btn-plain.trash-wipe-btn,.btn-plain.trash-undo-btn,.btn-plain.trash-clear-btn{transition:transform .18s cubic-bezier(.25,.8,.3,1),box-shadow .18s ease,background-color .18s ease,color .18s ease,border-color .18s ease !important;}
.btn-plain.trash-wipe-btn:hover{background:#c2413a !important;color:#fff !important;border-color:#c2413a !important;opacity:1 !important;transform:translateY(-1px) !important;box-shadow:0 4px 12px rgba(194,65,58,.22) !important;transition:transform .18s cubic-bezier(.25,.8,.3,1),box-shadow .18s ease,background-color .18s ease,color .18s ease !important;}
.btn-plain.trash-wipe-btn:active{background:#b93a33 !important;color:#fff !important;border-color:#b93a33 !important;opacity:1 !important;transform:translateY(0) scale(.97) !important;box-shadow:0 1px 4px rgba(194,65,58,.18) !important;transition:transform .12s ease,box-shadow .12s ease,background-color .12s ease !important;}
.btn-plain.trash-undo-btn:hover{background:#e4efff !important;color:#2f6fe0 !important;border-color:#bcd6ff !important;opacity:1 !important;transform:translateY(-1px) !important;box-shadow:0 4px 12px rgba(47,111,224,.16) !important;transition:transform .18s cubic-bezier(.25,.8,.3,1),box-shadow .18s ease,background-color .18s ease,color .18s ease !important;}
.btn-plain.trash-undo-btn:active{background:#dbe8ff !important;color:#2f6fe0 !important;border-color:#bcd6ff !important;opacity:1 !important;transform:translateY(0) scale(.97) !important;box-shadow:0 1px 4px rgba(47,111,224,.12) !important;transition:transform .12s ease,box-shadow .12s ease,background-color .12s ease !important;}
.btn-plain.trash-clear-btn:hover{background:#fff6f5 !important;color:#c2413a !important;border-color:#e6c4c0 !important;opacity:1 !important;transform:translateY(-1px) !important;box-shadow:0 4px 12px rgba(194,65,58,.14) !important;transition:transform .18s cubic-bezier(.25,.8,.3,1),box-shadow .18s ease,background-color .18s ease,color .18s ease !important;}
.btn-plain.trash-clear-btn:active{background:#fdeceb !important;color:#c2413a !important;border-color:#e6c4c0 !important;opacity:1 !important;transform:translateY(0) scale(.97) !important;box-shadow:0 1px 4px rgba(194,65,58,.1) !important;transition:transform .12s ease,box-shadow .12s ease,background-color .12s ease !important;}
.trash-list{display:flex;flex-direction:column;gap:10px;}
.trash-item{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px 16px;border:1px solid #e8ecf5;border-radius:16px;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.03);}
.trash-item-warn{border-color:#f6d9a8;background:#fffdf6;}
.trash-main{min-width:0;flex:1;}
.trash-head{display:flex;align-items:center;gap:8px;min-width:0;}
.trash-tag{flex:none;padding:2px 9px;border-radius:35px;font-size:12px;font-weight:700;background:#eef2f9;color:#5c6880;}
.trash-tag-patientList{background:#e8f3ff;color:#2f6fe0;}
.trash-tag-emrList{background:#efe9ff;color:#6b52d6;}
.trash-tag-prescList{background:#e6f7f1;color:#12855c;}
.trash-tag-drugList{background:#fff0e6;color:#c1641f;}
.trash-tag-chargeList{background:#fff3d9;color:#a07a10;}
.trash-tag-debtList{background:#fdeaea;color:#c2413a;}
.trash-sum{font-weight:600;font-size:14.5px;color:#2b3245;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
.trash-meta{margin-top:5px;font-size:12.5px;color:#8a94a6;font-weight:normal;line-height:1.5;}
.trash-meta b{color:#c1641f;}
.trash-note{color:#b4844a;}
.trash-ops{display:flex;gap:8px;flex:none;}
.trash-ops button{height:36px;padding:0 16px;border-radius:35px;font-size:13px;margin:0;}
.trash-btn-restore{border-color:#cfe0ff;color:#2f6fe0;}
.trash-btn-del{border-color:#f3d2d0;color:#c2413a;}
/* 回收站新增：编辑 + 撤回出库（保持原色，不随 hover/active 变白） */
.trash-ops{flex-wrap:wrap;justify-content:flex-end;}
.trash-btn-edit{border-color:#e2d9f5;color:#7a5bd0;}
.trash-btn-undo{border-color:#ffe0bd;color:#b26a12;}
.btn-plain.trash-btn-edit:hover,.btn-plain.trash-btn-undo:hover{background:inherit;opacity:1;transform:translateY(-1px);box-shadow:0 4px 10px rgba(0,0,0,.10);transition:transform .18s ease,box-shadow .18s ease;}
.btn-plain.trash-btn-edit:active,.btn-plain.trash-btn-undo:active{background:inherit;opacity:1;transform:scale(.97);box-shadow:none;transition:transform .12s ease;}
/* 回收站编辑弹窗 */
#trashEditDlg .confirm-box{max-width:335px;width:100%;}
.trash-edit-fields{max-height:46vh;overflow-y:auto;padding:4px 2px;margin:6px 0 12px;text-align:left;}
.trash-edit-row{display:flex;flex-direction:column;gap:6px;margin:10px 0;}
.trash-edit-row label{font-size:12.5px;color:#5b6376;font-weight:600;padding-left:8px;}
.trash-edit-input{height:40px;border:1px solid #dfe4ee;border-radius:35px;padding:0 16px;font-size:13.5px;background:#fff;color:#222a3a;width:100%;box-sizing:border-box;}
.trash-edit-input:focus{outline:none;border-color:#4786FF;box-shadow:0 0 0 3px rgba(71,134,255,.15);}
/* 流水日志：撤回出库按钮 / 已撤回标记（另起一行右对齐，不动原有网格） */
.log-row .log-undo-btn{grid-column:1/-1;justify-self:end;height:26px;line-height:24px;padding:0 12px;border-radius:999px;font-size:12px;border-color:#ffe0bd;color:#b26a12;}
.log-row .btn-plain.log-undo-btn:hover{background:inherit;opacity:1;border-color:#ffcf94;transform:translateY(-1px);box-shadow:0 4px 10px rgba(178,106,18,.16);transition:transform .18s ease,box-shadow .18s ease;}
.log-row .btn-plain.log-undo-btn:active{background:inherit;opacity:1;transform:scale(.97);box-shadow:none;transition:transform .12s ease;}
.log-row .log-reverted{grid-column:1/-1;justify-self:end;font-size:12px;color:#9aa1b5;}
body.dark .trash-edit-row label{color:#a6b0c6;}
body.dark .trash-edit-input{background:#121820;border-color:#2b3545;color:#e6ebf5;}
body.dark .trash-btn-edit{border-color:#3d3459;color:#b4a3e8;}
body.dark .trash-btn-undo{border-color:#4a3a22;color:#e0a45e;}
body.dark .log-row .log-undo-btn{border-color:#4a3a22;color:#e0a45e;}
/* 窄弹窗下字段已单列，无需再改栅格 */
.trash-empty{padding:30px 10px;text-align:center;color:#98a2b3;font-size:13.5px;}
.trash-menu-count{display:none;margin-left:6px;padding:0 7px;border-radius:35px;background:#4786FF;color:#fff;font-size:11px;line-height:17px;height:17px;font-weight:700;}
@media (max-width:600px){
    .trash-item{flex-direction:column;align-items:stretch;gap:10px;}
    .trash-ops{justify-content:flex-end;}
    .trash-sum{white-space:normal;}
    .trash-toolbar select{flex:1 1 100%;}
}
body.dark .trash-tip{background:#1b2230;border-color:#2a3a55;color:#8fb4ff;}
body.dark .trash-stat{background:#1b2230;border-color:#2a3a55;color:#9fb0c9;}
body.dark .trash-item{background:#161c27;border-color:#26313f;box-shadow:none;}
body.dark .trash-item-warn{background:#241f14;border-color:#5a452a;}
body.dark .trash-sum{color:#e6ebf5;}
body.dark .trash-meta{color:#8a94a6;}
body.dark .trash-tag{background:#222c3a;color:#9fb0c9;}
body.dark .trash-menu-count{background:#2f6fe0;}
/* 月亮已固定回页面最右上角（与「☰ 菜单」同一行），提示条不再需要给它让位，直接占满整行，✕ 贴在最右边 */
.loc-prev-bar{margin-right:0;padding:10px 10px 10px 16px;}
@media (max-width:900px){
    .loc-prev-bar{margin-right:0;padding:9px 10px 9px 14px;}
}
@media (max-width:380px){
    .loc-prev-bar{padding:9px 8px 9px 12px;}
}
/* 入库表单里「独立成行」的字段名（医药公司 / 入库时间等）：与上方输入框留出间距 */
#stockFormCard > label{display:block;margin:20px 0 2px;line-height:1.4;}
@media (max-width:600px){
    #stockFormCard > label{margin:16px 0 2px;}
}
/* 生产日期右侧「同上」速率按钮：一键填入与入库时间相同的日期 */
#stockFormCard .date-with-btn{display:flex;align-items:center;gap:8px;}
#stockFormCard .date-with-btn input{flex:1;min-width:0;width:auto;}
#stockFormCard .date-same-btn{
    flex:none;height:44px;margin:8px 0 14px;padding:0 16px;
    border:1px solid #c8cedd;border-radius:35px;background:#fff;color:#4786FF;
    font-size:13px;line-height:1;cursor:pointer;white-space:nowrap;
    transition:border-color .2s ease,color .2s ease,background .2s ease;
}
#stockFormCard .date-same-btn:hover{border-color:#4786FF;background:#f2f6ff;}
#stockFormCard .date-same-btn:active{transform:scale(.92);}
body.dark #stockFormCard .date-same-btn{background:#20242f;border-color:#3a4152;color:#8fb4ff;}
body.dark #stockFormCard .date-same-btn:hover{background:#242a38;border-color:#5a6b8f;}
/* 药品库存「批量操作」：新增「改存放位置」按钮，与删除/取消同一排 */
.batch-bar .batch-loc-btn{background:#4786FF;color:#fff;border:none;border-radius:35px;padding:10px 20px;font-size:14px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;}
.batch-bar .batch-loc-btn:hover{box-shadow:0 6px 18px rgba(71,134,255,0.3);}
.batch-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.batch-actions .batch-loc-btn{opacity:0;transform:translateY(6px);transition:opacity .25s ease,transform .3s cubic-bezier(.2,.7,.3,1);}
.batch-actions.batch-enter .batch-loc-btn{opacity:1;transform:translateY(0);transition-delay:.02s;}
.batch-actions .batch-loc-btn:active{transform:scale(.85);}
body.no-animation .batch-actions .batch-loc-btn:active{transform:none !important;}
body.no-animation .batch-bar .batch-loc-btn:hover{box-shadow:none;}
@media (max-width:600px){
    .batch-bar .batch-loc-btn,.batch-bar .batch-del-btn,.batch-bar .batch-cancel-btn{padding:9px 14px;font-size:13px;}
}
/* 幽灵热区治理：非当前页的日期浮层一律不可点击。
   隐藏页(.page 无 active → opacity:0 + pointer-events:none)里的日历图标自带 pointer-events:auto，
   会叠在当前页内容上面偷走点击，表现为「点空白处却弹出日期选择器」。 */
.page:not(.active) .date-calendar-icon,
.page:not(.active) .date-weekday,
.page:not(.active) .date-placeholder,
.page:not(.active) .date-divider{pointer-events:none !important;}
.date-weekday,.date-divider{pointer-events:none;}
/* 圆钮里的 emoji 单独一层：平移只影响字形，不动按钮盒；具体位移由 centerThemeIco() 实测后写入 */
.theme-ico{display:inline-block;line-height:1;pointer-events:none;user-select:none;transform-origin:center center;}
/* ===== 库存清单：搜索 / 筛选 / 表头吸顶，只有表格数据在滚动 ===== */
#stockListCard .stock-sticky-head{position:relative;z-index:1;background:rgba(255,255,255,.94);padding:8px 2px 4px;margin:-8px -2px 0;border-radius:26px 26px 0 0;}
/* 只固定这一条：排序 + 搜索/找缺失 + 批量操作 + 共X数量 */
.stock-fix-bar{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);padding:26px 2px 2px;margin:0 -2px;}
/* 共 X（数量）那一行紧贴表头，中间不留白缝，否则表头像单独贴上去的一条 */
.stock-fix-bar .drug-total-stat{margin-bottom:0;}
.stock-fix-bar .table-scroll{margin-top:0;}
/* 整个表格的框保持原样（四角圆角）；要变直角的只是表头那一块的下沿 */
.stock-fix-bar #drugTable{border-radius:10px;}
.stock-fix-bar #drugTotalStat + .table-scroll{padding-top:0;}
body.dark #stockListCard .stock-sticky-head{background:rgba(20,25,36,.94);}
body.dark .stock-fix-bar{background:rgba(20,25,36,.96);}
#stockTableScroll{position:relative;max-height:calc(100vh - 210px);overflow:auto;}
@media (max-width:768px){
    #stockListCard .stock-sticky-head{padding:6px 0 8px;margin:-6px 0 0;}
    .stock-fix-bar{padding:20px 0 2px;margin:0;}
    #stockTableScroll{max-height:calc(100vh - 150px);}
}
/* ===== 平面图长按选层弹窗 ===== */
#zonePickDlg .confirm-box{max-width:460px;width:100%;}
.zone-pick-list{display:flex;flex-direction:column;gap:6px;width:100%;max-height:46vh;overflow-y:auto;overflow-x:hidden;padding:2px;margin:8px 0 10px;}
.zone-pick-row{display:flex;align-items:center;gap:5px;min-width:0;height:42px;padding:0 5px 0 14px;border-radius:35px;border:1px solid #dfe4ee;background:#f7f9fd;box-sizing:border-box;}
.zone-pick-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;font-size:13px;color:#2b3245;}
.zone-pick-n{flex-shrink:0;min-width:18px;text-align:right;font-size:11px;color:#8c9ab2;}
.zone-pick-btn{flex-shrink:0;height:30px;padding:0 10px;border-radius:35px;border:1px solid transparent;font-size:12px;cursor:pointer;transition:background .15s,border-color .15s,color .15s;}
.zone-pick-btn.zp-filter{background:#eaf1ff;color:#2f6fe0;border-color:#c9dbff;}
.zone-pick-btn.zp-filter:hover{background:#f1f3f6;border-color:#d9dfe8;}
.zone-pick-btn.zp-edit{background:#eafaf1;color:#18945f;border-color:#c6ecd9;}
.zone-pick-btn.zp-edit:hover{background:#f1f3f6;border-color:#d9dfe8;}
/* 选层弹窗按钮：hover / active 一律中性灰，压掉 .confirm-dialog 全局蓝底(!important) */
.confirm-dialog .zone-pick-btn.zp-filter:hover:not(:active){background:#f1f3f6 !important;color:#2f6fe0 !important;border-color:#d9dfe8 !important;transform:none !important;box-shadow:none !important;}
.confirm-dialog .zone-pick-btn.zp-edit:hover:not(:active){background:#f1f3f6 !important;color:#18945f !important;border-color:#d9dfe8 !important;transform:none !important;box-shadow:none !important;}
.confirm-dialog .zone-pick-btn.zp-filter:active,.confirm-dialog .zone-pick-btn.zp-edit:active{background:#e5e8ee !important;border-color:#cdd4e0 !important;opacity:1 !important;transform:scale(.92) !important;box-shadow:none !important;}
body.dark .confirm-dialog .zone-pick-btn.zp-filter:hover:not(:active){background:#2a3140 !important;color:#9dc0ff !important;border-color:#39435a !important;}
body.dark .confirm-dialog .zone-pick-btn.zp-edit:hover:not(:active){background:#2a3140 !important;color:#7fdcaa !important;border-color:#39435a !important;}
body.dark .confirm-dialog .zone-pick-btn.zp-filter:active,body.dark .confirm-dialog .zone-pick-btn.zp-edit:active{background:#31394a !important;border-color:#41495c !important;}
body.dark .zone-pick-row{background:#1b2130;border-color:#2b3245;}
body.dark .zone-pick-name{color:#dbe3f2;}
body.dark .zone-pick-n{color:#7c8798;}
body.dark .zone-pick-btn.zp-filter{background:#22304a;border-color:#3a5580;color:#9dc0ff;}
body.dark .zone-pick-btn.zp-filter:hover{background:#2a3140;border-color:#39435a;}
body.dark .zone-pick-btn.zp-edit{background:#1c3029;border-color:#2f5c47;color:#7fdcaa;}
body.dark .zone-pick-btn.zp-edit:hover{background:#2a3140;border-color:#39435a;}
/* ===== 所有数据表格：表头冻结层（滑动时表头行钉住）+ 滚到底就停 ===== */
.table-scroll{position:sticky;top:0;z-index:2;overflow:auto;-webkit-overflow-scrolling:touch;border-radius:10px;}
.fh-wrap{position:sticky;top:0;z-index:24;background:#fff;overflow:hidden;pointer-events:none;border-radius:10px 10px 0 0;
  box-shadow:inset 0 1px 0 #e6e8f0,inset 1px 0 0 #e6e8f0,inset -1px 0 0 #e6e8f0;}
.fh-inner{display:block;will-change:transform;backface-visibility:hidden;transform:translate3d(0,0,0);}
.fh-table{table-layout:fixed;border-collapse:separate;border-spacing:0;margin:0;border:0;border-radius:0;}
.fh-table th{box-sizing:border-box;}
/* 冻结表头里的「全选」按钮要能点：只放开这一格，其它区域仍然穿透 */
.fh-wrap .fh-table th.th-check,.fh-wrap .fh-table th.th-check *{pointer-events:auto;}
.fh-table th.th-check{vertical-align:middle;}
body.dark .fh-wrap{background:#161c27;}
/* 滚到底不再拉出空白 / 橡皮筋 */
html,body{overscroll-behavior-y:none;}
/* 非当前页面不参与文档高度：切走的页面（回收站可能有上万条）会把文档撑到几万像素，导致「看完了还能一直滑」 */
.page:not(.active){height:calc(100vh - 48px);overflow:hidden;}
/* 页面最后一卡不再留底部空档，文档高度刚好等于视口，滑到底就停 */
.page > .card:last-child{margin-bottom:0;}
#page4 > .card:last-child{margin-bottom:0;}
/* 表格高度上限由脚本按「视口高 - 吸顶区高」实时写入（两端自适应），这里只兜底 */
@media (max-width:768px){
    .table-scroll{max-height:calc(100vh - 300px);}
}
/* —— 处方开单：西药 / 中药 切换 —— */
.presc-mode-row{display:block;width:100%;margin:0 0 14px;}
.presc-mode-switch{display:inline-flex;gap:4px;padding:4px;background:#f1f4fa;border:1px solid #e6e8f0;border-radius:35px;}
.presc-mode-switch .pm-btn{border:none;background:transparent;color:#5b6678;font-size:13.5px;font-weight:600;padding:7px 22px;border-radius:35px;cursor:pointer;transition:background .15s,color .15s;}
.presc-mode-switch .pm-btn.active{background:#4786FF;color:#fff;box-shadow:0 2px 6px rgba(71,134,255,.28);}
.presc-mode-switch .pm-btn:not(.active):hover{background:#e7ecf6;}
/* —— 中药方：热/黄 版式复刻 + 选药 —— */
#herbPane{margin-top:0;}
#extraPane{scroll-margin-top:64px;}
#injectPane{margin-bottom:14px;}
.herb-topbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:10px;}
.herb-search-card{margin:0 0 10px;max-width:820px;margin-left:auto;margin-right:auto;}
.herb-search-card .search-select-input{margin-top:0;}
.herb-lines-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px;}
.herb-lines{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.herb-lines-empty{padding:16px 14px;text-align:center;color:#8a93a6;font-size:13px;border:1px dashed #d8dde8;border-radius:26px;grid-column:1 / -1;}
.herb-line{background:rgba(120,96,255,0.05);border:1px solid #e6e8f0;border-radius:26px;padding:12px 14px;margin-bottom:0;}
.herb-line .line-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.herb-line .hl-head-title{color:#6a5cf0;font-size:14px;}
.herb-line .hl-summary{display:none;flex:1;min-width:0;margin:0 10px;color:#5b6478;font-size:12px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.herb-line .search-select{margin-bottom:8px;}
.herb-line .dose-row{margin:0;align-items:center;display:flex;gap:8px;}
.herb-line .hl-dose-wrap{flex:1;min-width:0;}
.herb-line .hl-dose{flex:1;width:100%;}
.herb-line .hl-unit{flex:0 0 76px;width:76px;margin:-6px 0 0 0;padding:8px 10px;border:1px solid #dde1ea;border-radius:35px;background:#fff;color:#5b6678;font-size:13px;line-height:1;text-align:center;white-space:nowrap;align-self:center;}
body.dark .herb-line .hl-unit{background:#20242f;border-color:#3a4152;color:#eef0f6;}
.herb-layout-disabled{opacity:.45;pointer-events:none;}
.herb-layout-disabled input{cursor:not-allowed;}
.herb-line .line-body{overflow:visible;max-height:640px;opacity:1;transform:translateY(0);transition:max-height .24s ease,opacity .2s ease,transform .2s ease;}
.herb-line.collapsed{padding:10px 14px;}
.herb-line.collapsed .line-head{cursor:pointer;margin-bottom:0;}
.herb-line.collapsed .hl-summary{display:block;}
.herb-line.collapsed .line-body{overflow:hidden;max-height:0;opacity:0;transform:translateY(-4px);}
body.dark .herb-line{background:rgba(120,96,255,0.12);border-color:#333a4d;}
/* —— 注射剂卡片（V171）：复刻中药行卡片，蓝色区分 —— */
.inject-lines{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.inject-lines-empty{padding:16px 14px;text-align:center;color:#8a93a6;font-size:13px;border:1px dashed #d8dde8;border-radius:26px;grid-column:1 / -1;}
.inject-line{background:rgba(71,134,255,0.05);border:1px solid #e6e8f0;border-radius:26px;padding:12px 14px;margin-bottom:0;}
.inject-line .line-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.inject-line .il-head-title{color:#4786FF;font-size:14px;}
.inject-line .il-summary{display:none;flex:1;min-width:0;margin:0 10px;color:#5b6478;font-size:12px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.inject-line .search-select{margin-bottom:8px;}
.inject-line .dose-row{margin:0 0 8px;align-items:center;}
.inject-line .il-unit,.inject-line .il-route{margin:0;padding:8px 10px;border:1px solid #dde1ea;border-radius:35px;background:#fff;color:#5b6678;font-size:13px;line-height:1;text-align:center;white-space:nowrap;align-self:center;}
.inject-line .il-note{margin-top:8px;}
.inject-line .line-body{overflow:visible;max-height:640px;opacity:1;transform:translateY(0);transition:max-height .24s ease,opacity .2s ease,transform .2s ease;}
.inject-line.collapsed{padding:10px 14px;}
.inject-line.collapsed .line-head{cursor:pointer;margin-bottom:0;}
.inject-line.collapsed .il-summary{display:block;}
.inject-line.collapsed .line-body{overflow:hidden;max-height:0;opacity:0;transform:translateY(-4px);}
body.dark .inject-line{background:rgba(71,134,255,0.12);border-color:#333a4d;}
body.dark .inject-line .il-unit{background:#20242f;border-color:#3a4152;color:#eef0f6;}
body.dark .inject-line .il-summary{color:#c3ccdc;}
@media (max-width:768px){ .inject-lines{grid-template-columns:1fr;} }
.herb-flag-row{margin-bottom:14px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.herb-unit-toggle{display:inline-flex;gap:10px;align-items:center;}
.hut-btn{border:1px solid #dde1ea;background:#fff;color:#5b6678;border-radius:35px;padding:13px 30px;font-size:15px;line-height:1;min-width:68px;min-height:46px;cursor:pointer;}
.hut-btn.active{background:#6a5cf0;border-color:#6a5cf0;color:#fff;}
body.dark .hut-btn{background:#20242f;border-color:#3a4152;color:#eef0f6;}
body.dark .hut-btn.active{background:#4786FF;border-color:#4786FF;color:#fff;}
/* g/匙 单位按钮：hover 锁色不变色（同找缺失字段胶囊），不上浮、不出阴影 */
.hut-btn:hover{transform:none !important;box-shadow:none !important;filter:none !important;}
.hut-btn:hover{background:#fff !important;color:#5b6678 !important;border-color:#dde1ea !important;}
.hut-btn.active:hover{background:#6a5cf0 !important;color:#fff !important;border-color:#6a5cf0 !important;}
body.dark .hut-btn:hover{background:#20242f !important;color:#eef0f6 !important;border-color:#3a4152 !important;}
body.dark .hut-btn.active:hover{background:#4786FF !important;color:#fff !important;border-color:#4786FF !important;}
.herb-flag-label{display:inline-flex;align-items:center;gap:10px;font-size:13px;color:#414a5c;cursor:pointer;user-select:none;}
body.dark .herb-flag-label{color:#c4cad8;}
@media (max-width:768px){ .herb-lines{grid-template-columns:1fr;} }
/* 移动端：中药饮片标签与 g/匙 按钮分行，两个按钮等宽并排占满整行，避免挤压错位 */
@media (max-width:768px){
    .herb-flag-row{ flex-direction:column; align-items:flex-start; gap:10px; }
    .herb-unit-toggle{ width:100%; gap:10px; }
    .hut-btn{ flex:1 1 0; min-width:0; min-height:42px; padding:10px 0; font-size:14px; }
}
.herb-fam-switch{display:inline-flex;gap:4px;padding:4px;background:#f1f4fa;border:1px solid #e6e8f0;border-radius:35px;}
.herb-fam-switch .hf-btn{border:none;background:transparent;color:#5b6678;font-size:14px;font-weight:700;padding:6px 24px;border-radius:35px;cursor:pointer;transition:background .15s,color .15s;}
.herb-fam-switch .hf-btn.active{background:#fff;color:#2f6fe0;box-shadow:0 1px 4px rgba(30,50,90,.14);}
.herb-fam-switch .hf-btn:not(.active):hover{background:#e7ecf6;}
.herb-fam-switch .fam-short{display:none;}
@media (max-width:1000px){
    .herb-fam-switch .fam-full{display:none;}
    .herb-fam-switch .fam-short{display:inline;}
}
.herb-tip{flex:1;min-width:180px;font-size:12px;color:#8a93a6;line-height:1.5;}
.herb-sheet{border:1px solid #e0e4ee;border-radius:10px;background:#fff;padding:16px 22px 18px;box-shadow:0 1px 3px rgba(30,50,90,.05);max-width:800px;margin:0 auto;}
.herb-sheet-head{display:flex;gap:18px;flex-wrap:wrap;font-size:13px;color:#2b3444;margin-bottom:6px;}
.herb-sheet-head b{font-weight:600;color:#5b6678;}
.herb-sheet-fam{font-size:14px;font-weight:700;color:#2b3444;margin:2px 0 10px;letter-spacing:.5px;}
.herb-grid{display:grid;gap:2px 6px;justify-items:center;}
.herb-cell{border:none;background:transparent;font-family:"Times New Roman",Georgia,serif;font-size:15px;font-weight:700;letter-spacing:.6px;color:#1d2433;padding:4px 9px;min-width:58px;border-radius:9px;text-align:center;line-height:1.25;box-sizing:border-box;}
.herb-cell.code{cursor:pointer;transition:background .12s,color .12s;}
.herb-cell.code:hover{background:#f0f5ff;color:#2f6fe0;}
.herb-cell.selected{background:#4786FF;color:#fff;}
.herb-cell.selected:hover{background:#4786FF;color:#fff;}
.herb-cell.empty{pointer-events:none;}
.herb-cell.mark{pointer-events:none;font-family:inherit;font-size:13px;font-weight:600;color:#5b6678;letter-spacing:0;}
.herb-cell .hc-name{display:block;font-family:inherit;font-size:10.5px;font-weight:400;letter-spacing:0;color:#8a93a6;line-height:1.2;margin-top:2px;}
.herb-cell.selected .hc-name{color:#e2ebff;}
.herb-pick{padding:14px 0 16px;}
.herb-pick-title{font-size:13px;font-weight:600;color:#2b3444;}
.herb-pick-title span{color:#4786FF;font-weight:700;}
.herb-pick-list{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 12px;}
.herb-pick-empty{font-size:12.5px;color:#9aa1b5;}
.herb-chip{display:inline-flex;align-items:center;gap:6px;background:#f2f5fb;border:1px solid #e0e6f3;border-radius:35px;padding:3px 8px 3px 12px;height:34px;box-sizing:border-box;font-size:13px;color:#2b3444;}
.herb-chip b{font-weight:600;}
.herb-chip .hc-code{font-size:11px;color:#8a93a6;letter-spacing:.4px;}
.herb-chip .hc-dose{width:56px;height:28px;min-height:0;line-height:26px;border:1px dashed #cfd7e4;border-radius:35px;text-align:center;font-size:14px;padding:0 3px;margin:0;outline:none;background:#fff;color:#2b3444;box-shadow:none;}
.herb-chip .hc-dose:focus{border-color:#4786FF;}
.herb-chip-x{border:none;background:transparent;color:#9aa1b5;cursor:pointer;padding:0 2px;font-size:13px;line-height:1;}
.herb-chip-x:hover{color:#e23b3b;}
.herb-pick-foot{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.herb-pick-foot label{font-size:13px;color:#5b6678;margin:0;}
.herb-dose-input{width:76px;height:34px;border:1px dashed #cfd7e4;border-radius:35px;text-align:center;font-size:14px;outline:none;margin:0;}
.herb-dose-input:focus{border-color:#4786FF;}
.herb-pick-foot span{font-size:13px;color:#5b6678;}
/* —— 深色模式 —— */
body.dark .presc-mode-switch,body.dark .herb-fam-switch{background:#1b2331;border-color:#2b3546;}
body.dark .presc-mode-switch .pm-btn,body.dark .herb-fam-switch .hf-btn{color:#9fb0c9;}
body.dark .presc-mode-switch .pm-btn.active,body.dark .herb-fam-switch .hf-btn.active{background:#4786FF;color:#fff;}
body.dark .herb-sheet{background:#161c27;border-color:#2b3546;}
body.dark .herb-sheet-head,body.dark .herb-sheet-fam,body.dark .herb-fam-fam{color:#e6edf7;}
body.dark .herb-cells{background:#161c27;}
body.dark .herb-cell{color:#e6edf7;}
body.dark .herb-cell.code:hover{background:#1e2a3d;color:#8bb4ff;}
body.dark .herb-cell.mark{color:#9fb0c9;}
body.dark .herb-chip{background:#1b2331;border-color:#2b3546;color:#e6edf7;}
body.dark .herb-chip .hc-dose{background:#161c27;border-color:#2b3546;color:#e6edf7;}
@media (max-width:600px){
    .herb-sheet{padding:12px 10px 14px;}
    .herb-cell{font-size:13px;padding:5px 0;letter-spacing:.3px;}
    .herb-cell .hc-name{font-size:12px;}
    .herb-cell.mark{font-size:11.5px;}
    .herb-grid{gap:2px 4px;}
    .herb-fam-switch .hf-btn{padding:6px 18px;}
    .presc-mode-switch .pm-btn{padding:7px 18px;}
    .herb-entry-row.herb-entry-row{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;}
    .herb-entry-row .herb-entry-btn{height:34px;padding:0 14px;font-size:12.5px;min-width:0;width:100%;}
    .herb-entry-tip{grid-column:1/-1;margin-top:2px;}
    .herb-name-toggle-txt{font-size:11.5px;}
    .herb-cell{flex-wrap:wrap;}
    .herb-cell .hc-code{order:0;flex-basis:100%;}
    .herb-cell .hc-cell-dose{order:1;flex-basis:100%;margin:0 auto;}
    .herb-cell .hc-name{order:2;flex-basis:100%;}
}
/* —— 中药入口 / 纸面填克数 / 滑动切换（v20261121herb2） —— */
.herb-entry-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0;}
.herb-entry-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;padding:0 18px;border-radius:35px;border:1px dashed #bcd0f2;background:#f7faff;color:#2f6fe0;font-size:14px;font-weight:600;cursor:pointer;transition:background .15s,border-color .15s;}
.herb-entry-btn .entry-plus{flex:0 0 auto;}
.herb-entry-btn.is-on .entry-plus{display:none;}
.herb-entry-btn.active{border-style:solid;background:#eef5ff;}
.herb-entry-tip{font-size:12px;color:#8a93a6;line-height:1.4;}
/* —— 处方附加项目（V89）：名称 + 数量 + 单价 + 备注，金额自动算，计入收费不扣库存 —— */
.extra-topbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:0 0 10px;}
.extra-tip{flex:1;min-width:180px;font-size:12px;color:#8a93a6;line-height:1.4;}
.extra-line{background:rgba(71,134,255,0.05);border:1px solid #e6e8f0;border-radius:26px;padding:12px 14px;margin-bottom:12px;}
.extra-line .extra-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.extra-line .extra-head b{color:#4786FF;font-size:14px;}
.extra-line label{display:block;font-size:13px;color:#5b6678;margin:6px 0 4px;}
.extra-num-row{display:flex;gap:8px;flex-wrap:wrap;}
.extra-num-row>div{flex:1;min-width:90px;}
.extra-num-row label{margin-top:0;}
.extra-amount{background:#f2f7ff;color:#2f6fe0;font-weight:600;}
/* 附加项目名称框清除钮：与西药药品名框同口径，相对输入框垂直居中、右侧留距 */
.ex-name{padding-right:36px;}
.extra-line .search-select .ex-name-clear{position:absolute !important;right:14px !important;top:30px !important;transform:translateY(-50%) !important;width:24px !important;height:24px !important;}
body.dark .extra-line .search-select .ex-name-clear{background:#2a2f3d;color:#9aa1b5;}
.extra-topbar .btn-plain.btn-mini{border-radius:35px;}
.extra-topbar-btns{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;}
.extra-topbar-btns .btn-plain.btn-mini{border-radius:35px;}
.extra-common-tip{font-size:12px;color:#8a93a6;margin:4px 0 10px;text-align:left;}
.ec-toolbar{display:flex;justify-content:flex-start;margin:0 0 10px;}
.ec-row{gap:8px;flex-wrap:wrap;align-items:center;padding-top:10px;cursor:default;}
.fl-wrap{position:relative;border:1px solid #dde1ea;border-radius:35px;background:#fff;display:flex;align-items:center;outline:none;box-shadow:none;}
.fl-name{flex:1;min-width:120px;}
.fl-price,.fl-qty{width:72px;}
.fl-wrap input{width:100%;box-sizing:border-box;margin:0;border:none;background:transparent;border-radius:35px;outline:none;box-shadow:none !important;}
.fl-wrap input:focus{border:none !important;box-shadow:none !important;outline:none !important;}
.ec-row .ec-name{padding:7px 14px;font-size:13px;box-shadow:none !important;}
.ec-row .dc-dose{padding:7px 14px;font-size:13px;box-shadow:none !important;}
.ec-row .ec-price,.ec-row .ec-qty{padding:7px 8px;font-size:12px;text-align:center;box-shadow:none !important;}
/* 弹窗内聚焦不出现多余描边环/投影/蓝边，保留原浅灰框线 */
#extraCommonDlg .fl-wrap input:focus{border-color:transparent !important;}
#extraCommonDlg .ec-del:focus{outline:none !important;box-shadow:none !important;}
/* 弹窗内浮动框去除顶部整条边线：左/右/底三边边框保留，标签骑在顶部开口处，未激活顶边与激活分段线均不显示 */
#extraCommonDlg .fl-wrap{border-top-color:transparent;}
#extraCommonDlg .fl-wrap::before,#extraCommonDlg .fl-wrap::after{opacity:0 !important;}
/* 顶部边框分段：激活 / 聚焦时标签位置留缺口，左右两段线由伪元素补齐、对齐边框中线，缺口范围由 JS 写入 --gap-l / --gap-r */
.fl-wrap::before,.fl-wrap::after{content:'';position:absolute;top:0;height:1px;background:#dde1ea;opacity:0;}
.fl-wrap.fl-active,.fl-wrap:focus-within{border-top-color:transparent;}
.fl-wrap.fl-active::before,.fl-wrap:focus-within::before{opacity:1;left:0;width:var(--gap-l,14px);}
.fl-wrap.fl-active::after,.fl-wrap:focus-within::after{opacity:1;right:0;left:var(--gap-r,58px);}
.fl-label{position:absolute;left:14px;top:50%;transform:translateY(-50%);font-size:13px;color:#9aa1b5;pointer-events:none;white-space:nowrap;transform-origin:left center;transition:top .18s ease,transform .18s ease,font-size .18s ease,color .18s ease;}
.fl-wrap.fl-active .fl-label,.fl-wrap:focus-within .fl-label{top:0;transform:translateY(-50%);font-size:11px;color:#4786FF;z-index:3;}
.ec-row .ec-del,.dc-item .ec-del{flex-shrink:0;width:32px;height:32px;border:1px solid #dde1ea;border-radius:50%;background:#f4f6fb;color:#f26060;font-size:14px;line-height:1;cursor:pointer;box-shadow:none;display:flex;align-items:center;justify-content:center;padding:0;}
.ec-row .ec-del:hover,.dc-item .ec-del:hover{background:#e6e9f0 !important;color:#f26060 !important;border-color:#cdd4e0 !important;}
body.dark .ec-row .ec-del:hover,body.dark .dc-item .ec-del:hover{background:#3a4356 !important;color:#ff8a8a !important;border-color:#46516a !important;}
/* 常用用量库：每行两组（输入框 + 删除钮）两列并排 */
#doseCommonDlg .dc-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px 12px;}
#doseCommonDlg .dc-item{display:flex;align-items:center;gap:8px;min-width:0;}
#doseCommonDlg .dc-item .fl-wrap{flex:1;min-width:0;}
#doseCommonDlg .dc-item .ec-del{flex-shrink:0;}
.ec-empty{font-size:13px;color:#8a93a6;text-align:center;padding:24px 10px;line-height:1.6;}
body.dark .fl-wrap{background:#2a3140;border-color:#39435a;}
body.dark .fl-wrap input{color:#e6ebf5;}
body.dark .fl-wrap::before,body.dark .fl-wrap::after{background:#39435a;}
body.dark .fl-label{color:#9aa1b5;}
body.dark .fl-wrap.fl-active .fl-label,body.dark .fl-wrap:focus-within .fl-label{color:#7fb0ff;}
body.dark .ec-row .ec-del,body.dark .dc-item .ec-del{background:#31394a;color:#ff8a8a;border-color:#39435a;}
.extra-line .extra-head .btn-red.btn-mini{border-radius:35px;}
/* 附加项目行手风琴折叠：摘要条 */
.extra-line .ex-summary{display:none;flex:1;min-width:0;margin:0 10px;color:#5b6478;font-size:12px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.extra-line.collapsed{padding:10px 14px;}
.extra-line.collapsed .extra-head{cursor:pointer;margin-bottom:0;}
.extra-line.collapsed .ex-summary{display:block;}
.extra-line .extra-body{overflow:visible;max-height:640px;opacity:1;transform:translateY(0);transition:max-height .28s ease,opacity .22s ease,transform .22s ease;will-change:max-height,opacity;}
.extra-line.collapsed .extra-body{overflow:hidden;max-height:0;opacity:0;transform:translateY(-6px);}
body.dark .extra-line .ex-summary{color:#c4cad8;}
body.dark .extra-line{background:rgba(71,134,255,0.12);border-color:#333a4d;}
body.dark .extra-amount{background:#202a3e;color:#8bb4ff;}
.herb-name-toggle{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:#5b6678;cursor:pointer;user-select:none;margin:0;}
.herb-name-toggle .switch{flex:0 0 auto;}
.herb-topbar .btn-plain.btn-mini{height:36px;min-height:36px;padding:0 16px;font-size:13.5px;border-radius:35px;display:inline-flex;align-items:center;justify-content:center;line-height:1;flex:1 1 0%;min-width:0;}
.herb-topbar-actions{display:flex;align-items:center;gap:8px;flex:1 1 100%;}
.herb-topbar-actions .btn-plain.btn-mini{flex:1 1 0%;min-width:0;}
.herb-lines-bar .meal-btn{flex:1 1 0%;min-width:0;}
.herb-lines-bar .meal-btn{height:36px;min-height:36px;padding:0 16px;font-size:13.5px;border-radius:35px;line-height:1;}
.herb-line .hl-del{border-radius:35px;}
.herb-fam-switch{position:relative;isolation:isolate;touch-action:none;user-select:none;-webkit-user-select:none;}
.herb-fam-switch .hf-thumb{position:absolute;top:5px;left:0;height:calc(100% - 10px);background:#fff;border-radius:35px;box-shadow:0 1px 4px rgba(30,50,90,.16);transition:left .44s cubic-bezier(.34,1.5,.5,1),width .26s cubic-bezier(.34,1.45,.64,1);z-index:0;pointer-events:none;}
.herb-fam-switch .hf-thumb.pop{animation:diagSegPop .48s cubic-bezier(.34,1.56,.5,1) both;}
.herb-fam-switch .hf-btn{position:relative;z-index:1;background:transparent!important;box-shadow:none!important;}
.herb-fam-switch .hf-btn.active{background:transparent!important;color:#2f6fe0;box-shadow:none!important;}
.herb-fam-switch .hf-btn:not(.active):hover{background:transparent!important;}
.herb-fam-switch .hf-btn{padding:9px 26px;font-size:15px;line-height:1.2;}
.herb-fam-switch{padding:5px;}
.herb-grid{gap:22px 30px;justify-items:center;}
.herb-cell{display:inline-flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:center;column-gap:7px;row-gap:2px;min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:transparent;box-sizing:border-box;line-height:1.3;}
.herb-cell.empty{background:transparent;border:0;min-width:0;}
.herb-cell.mark.pickable{pointer-events:auto;cursor:pointer;min-width:0;min-height:0;border:0;background:transparent;border-radius:0;padding:2px 4px;color:#5b6678;font-size:13px;font-weight:600;}
.herb-cell.mark.pickable:hover{background:transparent;color:#2f6fe0;}
.herb-cell.mark.pickable.selected{background:transparent;border:0;color:#2f6fe0;}
.herb-cell.mark.pickable.selected:hover{background:transparent;}
.herb-cell.code{font-size:15px;font-weight:700;letter-spacing:.8px;color:#1d2433;}
.herb-cell.code:hover{background:transparent;color:#1d2433;}
.herb-cell.selected{background:transparent;border:0;color:#1d2433;}
.herb-cell.selected:hover{background:transparent;}
.herb-cell.selected .hc-code{color:#2f6fe0;}
.herb-cell .hc-cell-dose{width:56px;height:28px;min-height:0;margin:0;padding:0 4px;border:1px dashed #cfd7e4;border-radius:35px;text-align:center;font-size:15px;font-family:inherit;font-weight:600;letter-spacing:0;line-height:26px;background:#fff;color:#1d2433;outline:none;box-shadow:none;-moz-appearance:textfield;appearance:textfield;}
.herb-cell .hc-cell-dose::placeholder{color:#c3c9d4;font-size:11px;font-weight:400;}
.herb-cell .hc-cell-dose:focus{border-color:#4786FF;}
.herb-cell.selected .hc-cell-dose{border-color:#c9d7ee;background:#fff;color:#1d2433;}
/* 桌面端：代码与中文药名同一行垂直居中，剂量框放到下一行 */
.herb-cell .hc-code{flex:0 0 auto;order:0;}
.herb-cell .hc-name{flex:0 0 auto;order:1;align-self:center;margin:0 0 0 6px;text-align:center;font-size:12px;color:#5b6678;letter-spacing:0;white-space:normal;line-height:1.25;}
.herb-cell .hc-cell-dose{flex:0 0 100%;order:2;width:48px !important;}
.herb-cell.selected .hc-name{color:#5b6678;}
.herb-cell.mark.dose-cell{color:#5b6678;font-size:13px;font-weight:600;gap:6px;pointer-events:auto;cursor:text;}
.herb-cell .hc-sheet-doses{width:56px;height:28px;min-height:0;margin:0;padding:0 4px;border:1px dashed #cfd7e4;border-radius:35px;text-align:center;font-size:15px;font-family:inherit;font-weight:600;line-height:26px;background:#fff;color:#1d2433;outline:none;box-shadow:none;-moz-appearance:textfield;appearance:textfield;}
.herb-cell .hc-sheet-doses:focus{border-color:#4786FF;}
.herb-cell .hc-sheet-doses::-webkit-outer-spin-button,
.herb-cell .hc-sheet-doses::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
.herb-cell .hc-cell-dose::-webkit-outer-spin-button,
.herb-cell .hc-cell-dose::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
body.dark .herb-fam-switch .hf-thumb{background:#2b3546;box-shadow:0 1px 4px rgba(0,0,0,.4);}
body.dark .herb-fam-switch .hf-btn.active{color:#8bb4ff;background:transparent!important;}
body.dark .herb-entry-btn{background:#1b2331;border-color:#33507e;color:#8bb4ff;}
body.dark .herb-entry-btn.active{background:#1e2a3d;}
body.dark .herb-entry-tip{color:#8b97ab;}
body.dark .herb-name-toggle{color:#9fb0c9;}
body.dark .herb-cell{background:transparent;border-color:transparent;}
body.dark .herb-cell.empty,body.dark .herb-cell.mark{background:transparent;border-color:transparent;}
body.dark .herb-cell.code:hover{background:transparent;}
body.dark .herb-cell.selected{background:transparent;border-color:transparent;}
body.dark .herb-cell.mark.pickable{background:transparent;border-color:transparent;color:#9fb0c9;}
body.dark .herb-cell.mark.pickable.selected{background:transparent;border-color:transparent;color:#8bb4ff;}
body.dark .herb-cell .hc-cell-dose{background:#0f1520;border-color:#2b3546;color:#8bb4ff;}
body.dark .herb-cell .hc-sheet-doses{background:#0f1520;border-color:#2b3546;color:#e6edf7;}
body.dark .herb-cell.selected .hc-cell-dose{background:#0f1520;border-color:#33507e;color:#e6edf7;}
/* 手机端：中文释义略小，但仍保持可读 */
@media (max-width:600px){
    .herb-cell .hc-name{font-size:12px;}
    .herb-cell{flex-wrap:wrap;}
}
/* 中药胶囊：内边距与克数框更松，g 单独成单位 */
.herb-chip{height:38px;padding:4px 10px 4px 14px;gap:8px;border-radius:35px;}
.herb-chip .hc-dose{width:58px;height:28px;line-height:26px;font-size:14px;}
.herb-chip .hc-unit{font-size:12px;color:#8a93a6;margin-left:-3px;}
.herb-chip .hc-code{margin-left:-2px;}
.herb-chip-x{margin-left:2px;padding:0 3px;font-size:12px;}.herb-chip .chip-code{font-family:"Times New Roman",Georgia,serif;font-size:13px;font-weight:700;letter-spacing:.6px;color:#1d2433;}
.herb-chip .chip-name{font-size:13px;font-weight:400;color:#5b6678;margin-left:-3px;}
/* 表头固定：用真表头 sticky，列宽与数据行天然一致（替代克隆表头方案） */
.table-scroll table{overflow:visible;}
.table-scroll table thead{position:sticky;top:0;z-index:6;}
.table-scroll table thead th{background:#f6f8fc;background-clip:padding-box;}
.table-scroll table thead th:first-child{border-top-left-radius:10px;}
.table-scroll table thead th:last-child{border-top-right-radius:10px;}
body.dark .table-scroll table thead th{background:#1b2331;}
/* 纸面克数：改无衬线等宽感字体 + 加大字号，数字不再显小 */
.herb-cell .hc-cell-dose,.herb-cell .hc-sheet-doses{width:64px;height:30px;line-height:28px;font-family:"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;font-size:17px;font-weight:600;letter-spacing:0;color:#1d2433;}
.herb-cell .hc-cell-dose::placeholder,.herb-cell .hc-sheet-doses::placeholder{font-size:12px;font-weight:400;color:#aab3c4;letter-spacing:0;}
.herb-chip .hc-dose{font-family:"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;font-size:15px;font-weight:600;}
/* 纸面克数输入框：去掉圆胶囊，改成一条下划线（像纸面上留白写数） */
.herb-cell .hc-cell-dose,.herb-cell .hc-sheet-doses{width:56px;height:26px;line-height:26px;padding:0 2px;border:0;border-bottom:1px solid #c9d2e2;border-radius:0;background:transparent;text-align:center;box-shadow:none;}
.herb-cell .hc-cell-dose:focus,.herb-cell .hc-sheet-doses:focus{border-bottom-color:#4786FF;outline:none;box-shadow:none;}
.herb-cell .hc-sheet-doses{width:48px;}
body.dark .herb-cell .hc-cell-dose,body.dark .herb-cell .hc-sheet-doses{border-bottom-color:#3a465c;background:transparent;color:#e6edf7;}
/* 胶囊里的克数也统一成下划线，不再套小圆圈 */
.herb-chip .hc-dose{width:46px;height:26px;line-height:26px;border:0;border-bottom:1px solid #c9d2e2;border-radius:0;background:transparent;box-shadow:none;padding:0 2px;font-size:16px;}
.herb-chip .hc-dose:focus{border-bottom-color:#4786FF;}
body.dark .herb-chip .hc-dose{border-bottom-color:#3a465c;background:transparent;}
/* 胶囊里已有外框，克数不再画线、不套圈，只保留数字 */
.herb-chip .hc-dose{border:0;border-radius:0;background:transparent;box-shadow:none;}
.herb-chip .hc-dose:focus{border:0;}
/* 聚焦不要那个黑框（浏览器默认 outline），只让那条线变蓝 */
.herb-cell .hc-cell-dose,.herb-cell .hc-sheet-doses,.herb-chip .hc-dose,.hc-cell-dose,input.hc-cell-dose,input.hc-sheet-doses{outline:none !important;box-shadow:none !important;}
.herb-cell .hc-cell-dose:focus,.herb-cell .hc-cell-dose:focus-visible,.herb-cell .hc-sheet-doses:focus,.herb-cell .hc-sheet-doses:focus-visible,.herb-chip .hc-dose:focus,.herb-chip .hc-dose:focus-visible,input.hc-cell-dose:focus,input.hc-cell-dose:focus-visible,input.hc-sheet-doses:focus,input.hc-sheet-doses:focus-visible{outline:none !important;outline-offset:0 !important;box-shadow:none !important;}
/* 最终态：永远没有框；聚焦只让下划线变蓝，底色保持透明 */
.herb-cell .hc-cell-dose,.herb-cell .hc-sheet-doses,.herb-cell.selected .hc-cell-dose{border:0 !important;border-bottom:1px solid #c9d2e2 !important;border-radius:0 !important;background:transparent !important;box-shadow:none !important;outline:none !important;}
.herb-cell .hc-cell-dose:focus,.herb-cell .hc-cell-dose:focus-visible,.herb-cell .hc-sheet-doses:focus,.herb-cell .hc-sheet-doses:focus-visible{border:0 !important;border-bottom:1px solid #4786FF !important;border-radius:0 !important;background:transparent !important;box-shadow:none !important;outline:none !important;}
body.dark .herb-cell .hc-cell-dose,body.dark .herb-cell .hc-sheet-doses,body.dark .herb-cell.selected .hc-cell-dose{border:0 !important;border-bottom:1px solid #3a465c !important;background:transparent !important;}
body.dark .herb-cell .hc-cell-dose:focus,body.dark .herb-cell .hc-sheet-doses:focus{border-bottom-color:#5b91ff !important;}
/* 选中更明显：蓝字 + 淡蓝底（无边框），仍保持纸面感 */
.herb-cell.code.selected .hc-code{color:#1e66e0 !important;font-weight:700 !important;background:rgba(71,134,255,.12) !important;border-radius:6px !important;padding:1px 7px !important;}
.herb-cell.mark.pickable.selected{color:#1e66e0 !important;font-weight:700 !important;background:rgba(71,134,255,.12) !important;border-radius:6px !important;padding:2px 7px !important;}
body.dark .herb-cell.code.selected .hc-code{color:#9cc2ff !important;background:rgba(91,145,255,.18) !important;}
body.dark .herb-cell.mark.pickable.selected{color:#9cc2ff !important;background:rgba(91,145,255,.18) !important;}
/* 选中底再宽一点 + 圆角 35px 胶囊 */
.herb-cell.code.selected .hc-code{padding:3px 9px !important;border-radius:35px !important;min-width:36px !important;text-align:center !important;line-height:20px !important;}
.herb-cell.mark.pickable.selected{padding:3px 14px !important;border-radius:35px !important;min-width:44px !important;text-align:center !important;line-height:20px !important;}
/* ===== 中药处方笺 / 对照表 打印版式 ===== */
.hp-sheet{font-weight:normal;color:#111;text-align:left;}
.hp-head{text-align:center;padding-bottom:2px;margin-bottom:8px;}
.hp-head p{margin:0 0 2px;color:#333;font-weight:bold;font-size:15px;letter-spacing:1px;}
.hp-head h2{font-size:25px;letter-spacing:5px;margin:2px 0 0;font-weight:bold;}
.hp-fam{font-size:13px;color:#333;}
.hp-meta{display:flex;flex-wrap:wrap;gap:5px 20px;font-size:14px;margin:6px 0 10px;color:#111;}
.hp-grid{display:grid;column-gap:10px;row-gap:2px;}
.hp-cell{min-height:32px;display:flex;align-items:center;justify-content:flex-start;gap:5px;padding:2px 2px;font-size:14px;break-inside:avoid;}
.hp-cell.code .hp-code{font-family:Consolas,monospace;font-weight:600;font-size:14px;}
.hp-cell.code .hp-name{color:#111;font-size:13px;flex-shrink:0;}
.hp-cell.code .hp-dose{margin-left:0;font-weight:600;white-space:nowrap;font-size:14px;}
.hp-cell.mark{justify-content:flex-start;font-size:14px;}
.hp-cell.empty{background:#fff;}
.hp-note{margin-top:8px;font-size:13px;color:#111;line-height:1.7;}
.hp-foot{margin-top:16px;display:flex;justify-content:space-between;align-items:flex-end;color:#111;font-weight:normal;}
#printArea .hp-map-title{text-align:center;font-size:22px;font-weight:bold;margin:0 0 4px;}
#printArea .hp-map-sub{text-align:center;font-size:12px;color:#555;margin:0 0 12px;font-weight:normal;}
#printArea .hp-map-cols{display:flex;gap:12px;align-items:flex-start;}
#printArea .hp-map-cols table{flex:1 1 0;width:auto;margin:0;border-collapse:collapse;font-weight:normal;}
#printArea .hp-map-cols th,#printArea .hp-map-cols td{border:1px solid #999;padding:2px 5px;font-size:11.5px;line-height:1.45;text-align:left;}
#printArea .hp-map-cols th{background:#f2f2f2;font-weight:bold;}
/* ===== 中药方笺：一页 A4 六格（2×3）缩排 6 份 ===== */
.hp-page{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(3,1fr);gap:2mm;width:100%;box-sizing:border-box;}
.hp-sheet.small{padding:2.5mm;box-sizing:border-box;overflow:hidden;font-weight:normal;color:#111;}
.hp-sheet.small .hp-head{padding-bottom:2px;margin-bottom:3px;}
.hp-sheet.small .hp-head p{font-size:9.5px;letter-spacing:0.5px;margin:0 0 1px;}
.hp-sheet.small .hp-head h2{font-size:15px;letter-spacing:2.5px;margin:1px 0 0;}
.hp-sheet.small .hp-fam{font-size:8px;}
.hp-sheet.small .hp-meta{font-size:9px;gap:1px 9px;margin:2px 0 3px;}
.hp-sheet.small .hp-cell{min-height:15px;font-size:9px;padding:0 3px;gap:2px;}
.hp-sheet.small .hp-cell.code .hp-code{font-size:9px;}
.hp-sheet.small .hp-cell.code .hp-name{font-size:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.hp-sheet.small .hp-cell.code .hp-dose{font-size:9px;}
.hp-sheet.small .hp-cell.mark{font-size:9px;}
.hp-sheet.small .hp-note{font-size:8.5px;line-height:1.5;margin-top:3px;}
.hp-sheet.small .hp-foot{font-size:8px;margin-top:4px;}
.hp-sheet.small .sig-img.foot{width:42px;height:28px;left:-9px;top:5px;}
.hp-sheet.small{display:flex;flex-direction:column;}
.hp-sheet.small .hp-grid{flex:1 1 auto;align-content:space-between;}
.hp-sheet.small .hp-foot{margin-top:auto;padding-top:5px;}
/* 单张：只印这一张（A4 一格大小，患者一张） */
.hp-one{width:96mm;height:88mm;}
.hp-one .hp-sheet.small{width:100%;height:100%;}
/* 纸面撑满：药材表格吃掉剩余高度，各行均匀铺开，不在底部留一大块空白 */
.hp-one .hp-sheet.small .hp-grid{flex:1 1 auto;align-content:space-between;}
/* 批量：每 6 张一页，跨页时自动换页 */
.hp-page{break-after:page;}
.hp-page:last-child{break-after:auto;}
/* 记录里「中药处方单」入口 + 点开的方笺预览（与打印同版式，96×88mm 放大 1.25 倍显示） */
.herb-slip-btn{display:inline-block;padding:4px 12px;border:1px solid #dae3f5;background:#f5f9ff;color:#2f6fe0;border-radius:35px;font-size:12.5px;font-weight:600;cursor:pointer;line-height:1.45;font-family:inherit;}
/* 悬停不变色（用户要求去掉 hover） */
.herb-slip-btn:hover{background:#f5f9ff;border-color:#dae3f5;}
.herb-slip-btn:active{background:#f5f9ff;}
.herb-slip-stage{width:100%;height:0;margin:10px auto 0;overflow:hidden;background:#fff;border:1px solid #eef1f7;border-radius:16px;}
.herb-slip-zoom{width:96mm;height:88mm;transform-origin:top left;}
/* 预览里的纸面只看不改：鼠标划过不出现任何高亮/选中态 */
#herbSlipDlg .herb-slip-stage{pointer-events:none;user-select:none;}
.herb-slip-stage .hp-one{width:96mm;height:88mm;}
.herb-slip-stage .hp-sheet.small{width:100%;height:100%;}
/* 西药处方单预览：遮罩 + 让 #printArea 以打印版式浮在屏幕中央 */
#prescPvMask{display:none;position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.45);z-index:9996;}
#prescPvMask.show{display:block;touch-action:none;overscroll-behavior:contain;}
.presc-pv-bar{position:fixed;right:26px;top:22px;z-index:9998;display:flex;align-items:center;gap:10px;}
.presc-pv-close{padding:8px 26px;border-radius:35px;border:1px solid #d6deee;background:#fff;color:#2b3445;font-size:14px;cursor:pointer;box-shadow:0 8px 22px rgba(10,20,40,0.22);}
.herb-pv-sw{display:flex;align-items:center;justify-content:space-between;gap:10px;white-space:nowrap;padding:8px 16px;border-radius:35px;border:1px solid #d6deee;background:#fff;color:#2b3445;font-size:13.5px;box-shadow:0 8px 22px rgba(10,20,40,0.22);cursor:default;}
.herb-pv-sw .switch{flex-shrink:0;}
#printArea.pv{display:block !important;position:fixed;left:50%;top:50%;width:210mm;max-width:none;margin:0;padding:8mm;box-sizing:border-box;background:#fff;box-shadow:0 24px 70px rgba(10,20,40,0.45);z-index:9997;transform:translate(-50%,-50%);transform-origin:center center;transition:opacity .14s ease;}
.herb-slip-btn.west{border-color:#d8e8d9;background:#f3fbf4;color:#2f8a46;}
.herb-slip-btn.west:hover{background:#f3fbf4;border-color:#d8e8d9;}
/* ===== 门诊中药处方（A4 打印版式；参考纸质处方的 Rp 写法：药名紧跟克数、每行 3 味、末尾 ×N 剂） ===== */
.hrx{width:100%;box-sizing:border-box;font-family:"Microsoft YaHei","SimSun",serif;color:#111;font-weight:normal;line-height:1.95;font-size:15px;text-align:left;}
.hrx-title{text-align:center;font-size:22px;font-weight:bold;letter-spacing:2px;margin:0 0 10px;}
.hrx-line{margin:0;word-break:break-all;}
.hrx-num{font-family:Consolas,monospace;letter-spacing:0.5px;}
.hrx-blank{display:inline-block;border-bottom:1px solid #111;min-width:80px;height:1.5em;vertical-align:-0.2em;}
.hrx-blank.long{min-width:100%;}
.hrx-flex{display:flex;align-items:baseline;}
.hrx-blank.fill{flex:1 1 auto;min-width:0;}
.hrx-rp{margin:14px 0 4px;font-size:16px;}
.hrx-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:18px;row-gap:2px;}
.hrx-item{font-size:16px;letter-spacing:1px;}
.hrx-item .hrx-g{font-size:14px;}
.hrx-code{font-size:11.5px;letter-spacing:0.5px;color:#333;margin:0 1px;vertical-align:2px;}
.hrx-foot{margin-top:12px;display:flex;justify-content:space-between;gap:10px;font-size:14px;align-items:flex-end;}
/* 中药处方页的签名行：与西药处方笺的签名行同一套字号/位置（12px、同名 .presc-foot 结构） */
.hrx .presc-foot{font-size:12px;line-height:1.6;}
/* 中药处方页里的收费信息：与处方笺同一张表，压在用法下面、签名上面 */
.hrx-fee{margin-top:14px;}
.hrx-fee .presc-section{margin-bottom:0;}
.hrx-fee table{font-size:14px;}
.hrx-fee .presc-section-title{font-size:15px;}
.hrx-sig{width:80px;height:auto;vertical-align:middle;margin:0 4px;}
/* 位置标签：单行横向滑动，胶囊本身不折行、不被压缩，容器内左右拖动 */
.loc-row .loc-chips{display:flex !important;flex-wrap:nowrap !important;overflow-x:auto !important;overflow-y:hidden !important;align-items:center !important;gap:8px !important;-webkit-overflow-scrolling:touch;scrollbar-width:thin;}
.loc-row .loc-chip{flex:0 0 auto !important;max-width:none !important;white-space:nowrap !important;align-items:center !important;}
.loc-row .loc-chip-txt{white-space:nowrap !important;overflow:visible !important;text-overflow:clip !important;max-width:none !important;}
.loc-row .loc-add-btn{flex:0 0 auto !important;}
/* 移动端：方笺切换栏整屏等宽适配，按钮加大为可点触摸区域；PC 端样式保持不变 */
@media (max-width:600px){
    .herb-topbar{gap:8px !important;}
    .herb-fam-switch{width:100% !important;display:flex !important;gap:2px !important;padding:4px !important;overflow:visible !important;flex-wrap:nowrap !important;}
    .herb-fam-switch .hf-btn{flex:1 1 0% !important;min-width:0 !important;height:42px !important;padding:0 4px !important;font-size:15px !important;line-height:1.2 !important;white-space:nowrap !important;letter-spacing:.2px !important;}
    .herb-fam-switch .hf-thumb{top:4px !important;height:calc(100% - 8px) !important;transition:left .18s ease,width .18s ease !important;will-change:left,width;}
    .herb-fam-switch .hf-btn{-webkit-tap-highlight-color:transparent;}
    .herb-grid{gap:10px 4px !important;}
    .herb-cell{padding:6px 2px !important;min-width:0 !important;}
    .herb-cell .hc-code{font-size:15px !important;flex-basis:100% !important;}
    .herb-cell .hc-name{font-size:12px !important;margin-top:3px !important;order:2 !important;flex-basis:100% !important;}
    .herb-cell .hc-cell-dose{order:1 !important;flex-basis:100% !important;margin:0 auto !important;}
    .herb-cell{column-gap:4px !important;}
    .herb-cell .hc-code{letter-spacing:.1px !important;}
    .herb-cell .hc-cell-dose{width:36px !important;height:26px !important;font-size:14px !important;}
    /* 移动端：操作按钮整行三等分 */
    .herb-topbar .herb-name-toggle{flex:1 1 100% !important;}
    .herb-topbar .herb-tip{flex:1 1 100% !important;min-width:0 !important;}
    .herb-topbar .btn-plain.btn-mini{flex:1 1 0% !important;min-width:0 !important;padding:0 !important;}
    .herb-lines-bar{flex-wrap:wrap !important;gap:10px !important;}
    .herb-lines-bar .meal-btn{flex:1 1 0% !important;min-width:0 !important;}
}
/* 快速组方（#prescDlg）：手机端整体高度收四分之一（约 60vh），内容区滚动、按钮条贴底 */
@media (max-width:600px){
    #prescDlg .confirm-box{max-height:60vh;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:16px 16px 0;}
    #prescDlg .confirm-msg{font-size:15.5px;margin-bottom:6px;}
    #prescDlg label{margin-top:6px !important;}
    #prescDlg .search-row{margin-bottom:6px !important;}
    #prescDlg #prescTemplateList{max-height:84px;}
    #prescDlg #prescPickList{height:92px;}
    #prescDlg .confirm-btns{position:sticky;bottom:0;margin:12px -16px 0;padding:10px 16px 14px;}
}
/* 西医 / 中医诊断分段控件：按下与悬停都不变色，只保留轻微按压 */
body .confirm-dialog button.diag-seg-btn:active,
body .confirm-dialog button.diag-seg-btn:hover:not(:active){
    background:transparent !important;
    box-shadow:none !important;
    opacity:1 !important;
}
/* 横屏（矮屏）时弹窗限高并可上下滑动 */
@media (max-height:600px){
    #prescDlg .confirm-box{max-height:88vh !important;overflow-y:auto !important;-webkit-overflow-scrolling:touch;padding:14px 16px 0 !important;}
    #prescDlg .confirm-btns{position:sticky;bottom:0;margin:10px -16px 0;padding:10px 16px 12px;}
    #prescDlg #prescPickList{height:88px;}
    #prescDlg #prescTemplateList{max-height:76px;}
    .confirm-box{max-height:88vh;overflow-y:auto;}
}
/* 快速组方：内容区独立滚动、按钮条独立成块（滚动内容不会从按钮条下面透出） */
#prescDlg .confirm-box.has-scroll{display:flex;flex-direction:column;overflow:hidden;padding:0;}
#prescDlg .confirm-box.has-scroll>.dlg-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:24px 24px 6px;}
#prescDlg .confirm-box.has-scroll>.confirm-btns{position:static;bottom:auto;margin:0;padding:12px 24px 16px;border-top:1px dashed rgba(128,138,156,0.62);background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;}
#prescDlg .confirm-box.has-scroll>.confirm-btns::before{display:none;}
@media (max-width:600px){
    #prescDlg .confirm-box.has-scroll{max-height:60vh;}
    #prescDlg .confirm-box.has-scroll>.dlg-scroll{padding:14px 16px 4px;}
    #prescDlg .confirm-box.has-scroll>.confirm-btns{margin:0;padding:10px 16px 14px;}
}
@media (max-height:600px){
    #prescDlg .confirm-box.has-scroll{max-height:88vh;}
}
/* 方笺上的「剂」格：整格可点、输入框放大，手机上更容易改 */
.herb-cell.mark.dose-cell .hc-sheet-doses{width:64px;height:34px;line-height:32px;font-size:17px;border:0 !important;border-bottom:1px solid #c9d2e2 !important;border-radius:0 !important;background:transparent;cursor:text;}
@media (max-width:600px){
    .herb-cell.mark.dose-cell{justify-content:center;}
    .herb-cell.mark.dose-cell .hc-sheet-doses{width:70px;height:38px;line-height:36px;font-size:18px;}
}
/* ===== V45 弹窗按钮条：与卡片同款毛玻璃底的贴底独立底栏（盖住下方内容） ===== */
.confirm-dialog .confirm-btns{
  background:rgba(255,255,255,0.62);
  -webkit-backdrop-filter:blur(30px) saturate(200%);
  backdrop-filter:blur(30px) saturate(200%);
  border-radius:0 0 28px 28px;
  box-shadow:0 -6px 14px rgba(120,130,150,0.06);
  margin:18px -24px 0;
  padding:12px 24px 20px;
  z-index:5;
}
.confirm-dialog .confirm-btns::before{content:none;}
body.dark .confirm-dialog .confirm-btns{
  background:rgba(32,36,47,0.62);
  border-top-color:rgba(150,170,200,0.45);
  box-shadow:0 -6px 14px rgba(0,0,0,0.18);
}
/* 快速组方：独立滚动区时按钮条同样撑到卡片底边 */
#prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(255,255,255,0.62);
  -webkit-backdrop-filter:blur(30px) saturate(200%);
  backdrop-filter:blur(30px) saturate(200%);
  border-top:1px dashed rgba(128,138,156,0.62);
  border-radius:0 0 28px 28px;
  margin:0;
  padding:12px 24px 18px;
}
body.dark #prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(32,36,47,0.62);
  border-top-color:rgba(150,170,200,0.45);
}
@media (max-width:600px){
  .confirm-dialog .confirm-btns{margin:16px -20px 0;padding:12px 20px 18px;}
  #prescDlg .confirm-box.has-scroll>.confirm-btns{margin:0;padding:10px 16px 14px;}
}
/* ===== V46 按钮条底色：取自用户截图的蓝灰（#B8C7E4 家族），不透明到能盖住内容 ===== */
.confirm-dialog .confirm-btns{
  background:rgba(186,200,226,0.95);
  -webkit-backdrop-filter:blur(30px) saturate(180%);
  backdrop-filter:blur(30px) saturate(180%);
  border-top:1px dashed rgba(120,134,164,0.72);
  box-shadow:0 -6px 14px rgba(110,126,164,0.10);
}
body.dark .confirm-dialog .confirm-btns{
  background:rgba(58,70,96,0.95);
  border-top-color:rgba(150,170,200,0.55);
  box-shadow:0 -6px 14px rgba(0,0,0,0.22);
}
#prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(186,200,226,0.95);
  border-top:1px dashed rgba(120,134,164,0.72);
}
body.dark #prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(58,70,96,0.95);
  border-top-color:rgba(150,170,200,0.55);
}
/* ===== V47 按钮条：纯中性灰，无蓝味（R=G=B），虚线同步改中性灰 ===== */
.confirm-dialog .confirm-btns{
  background:rgba(201,201,201,0.95);
  border-top:1px dashed rgba(120,120,120,0.72);
  box-shadow:0 -6px 14px rgba(0,0,0,0.07);
}
body.dark .confirm-dialog .confirm-btns{
  background:rgba(62,62,62,0.95);
  border-top-color:rgba(172,172,172,0.55);
  box-shadow:0 -6px 14px rgba(0,0,0,0.25);
}
#prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(201,201,201,0.95);
  border-top:1px dashed rgba(120,120,120,0.72);
}
body.dark #prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(62,62,62,0.95);
  border-top-color:rgba(172,172,172,0.55);
}
/* ===== V48 按钮条：浅一档中性灰（#DADADA），负边距撑满卡片两侧无缝隙 ===== */
.confirm-dialog .confirm-btns{
  background:rgba(218,218,218,0.95);
  border-top:1px dashed rgba(132,132,132,0.72);
  margin:18px -24px 0;
  box-shadow:0 -6px 14px rgba(0,0,0,0.05);
}
body.dark .confirm-dialog .confirm-btns{
  background:rgba(70,70,70,0.95);
  border-top-color:rgba(178,178,178,0.55);
}
#prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(218,218,218,0.95);
  border-top:1px dashed rgba(132,132,132,0.72);
  margin:0;
}
body.dark #prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(70,70,70,0.95);
  border-top-color:rgba(178,178,178,0.55);
}
@media (max-width:600px){
  .confirm-dialog .confirm-btns{margin:16px -24px 0;}
}
/* ===== V49 按钮条：取 V47 与 V48 中间档中性灰 #D2D2D2（210） ===== */
.confirm-dialog .confirm-btns{
  background:rgba(210,210,210,0.95);
  border-top:1px dashed rgba(128,128,128,0.72);
}
#prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(210,210,210,0.95);
  border-top:1px dashed rgba(128,128,128,0.72);
}
/* ===== V50 按钮条：再收一档中性灰 #CDCDCD（205） ===== */
.confirm-dialog .confirm-btns{
  background:rgba(205,205,205,0.95);
}
#prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:rgba(205,205,205,0.95);
}
/* V61 简单确认弹窗（删除/退出/清空/撤回等）：按钮不做独立底栏，直接排在卡片内容上，无灰底、虚线与阴影 */
#confirmDlg .confirm-btns{
  background:transparent !important;
  border-top:none !important;
  box-shadow:none !important;
  -webkit-backdrop-filter:none; backdrop-filter:none;
  border-radius:0;
  position:static;
  margin:18px 0 0 !important;
  padding:12px 0 0;
}
body.dark #confirmDlg .confirm-btns{
  background:transparent !important;
  border-top-color:transparent;
  box-shadow:none !important;
}
#confirmDlg .confirm-box:has(.confirm-btns){padding-bottom:24px;}
/* ===== V51 移动端性能：毛玻璃降级到 blur(14px)，阴影收敛，减少 GPU 绘制 ===== */
@media (max-width:768px){
  .confirm-box,
  body.dark .confirm-box{
    backdrop-filter:blur(14px) saturate(140%) !important;
    -webkit-backdrop-filter:blur(14px) saturate(140%) !important;
  }
  .toast{
    backdrop-filter:blur(14px) saturate(140%) !important;
    -webkit-backdrop-filter:blur(14px) saturate(140%) !important;
  }
  .login-card{
    backdrop-filter:blur(14px) saturate(140%) !important;
    -webkit-backdrop-filter:blur(14px) saturate(140%) !important;
  }
  .user-menu{
    backdrop-filter:blur(12px) !important;
    -webkit-backdrop-filter:blur(12px) !important;
  }
  .confirm-dialog .confirm-btns{
    backdrop-filter:blur(14px) saturate(140%);
    -webkit-backdrop-filter:blur(14px) saturate(140%);
  }
  #prescDlg .confirm-box.has-scroll>.confirm-btns{
    backdrop-filter:blur(14px) saturate(140%);
    -webkit-backdrop-filter:blur(14px) saturate(140%);
  }
  .card{box-shadow:0 2px 8px rgba(0,0,0,0.05);}
  .login-card{box-shadow:0 10px 28px rgba(31,61,124,.12);}
  .stat-box{box-shadow:0 2px 8px rgba(15,23,42,.05);}
}
/* ===== V52 中药方笺鸿蒙式跟手滑动（热黄合跌疱） ===== */
.herb-swipe{position:relative;overflow:hidden;max-width:820px;margin:0 auto;touch-action:pan-y;}
.herb-swipe > .herb-sheet{max-width:none;}
.herb-sheet.herb-sheet-moving{transition:transform .3s cubic-bezier(.22,1,.36,1);will-change:transform;}
.herb-sheet-neighbor{position:absolute;top:0;left:0;width:100%;max-width:none;}
/* ===== V53 鸿蒙 Tabs 样式对齐（中性灰）+ 鸿蒙滑动曲线 ===== */
/* 分段条：鸿蒙式玻璃胶囊，中性灰 */
.herb-fam-switch{
  background:rgba(226,228,232,0.92);
  border:1px solid rgba(255,255,255,0.75);
  box-shadow:inset 0 1px 2px rgba(255,255,255,0.85),0 2px 8px rgba(30,40,60,0.08);
}
/* 滑块：白色光感材料，带顶部高光，无回弹 */
.herb-fam-switch .hf-thumb{
  background:#ffffff;
  box-shadow:0 1px 2px rgba(20,28,45,0.12),0 4px 10px rgba(20,28,45,0.10),inset 0 1px 0 rgba(255,255,255,0.9);
  transition:left .32s cubic-bezier(0.2,0,0,1),width .32s cubic-bezier(0.2,0,0,1);
}
/* 选中文字：中性深灰，不用蓝 */
.herb-fam-switch .hf-btn.active{
  color:#1f2329 !important;
}
.herb-fam-switch .hf-btn{
  color:#6b7280;
}
/* 滑动切换曲线：鸿蒙 decelerate，无回弹 */
.herb-sheet.herb-sheet-moving{
  transition:transform .32s cubic-bezier(0.2,0,0,1);
}
/* 深色模式：中性深灰同族 */
body.dark .herb-fam-switch{
  background:rgba(52,56,64,0.92);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:inset 0 1px 2px rgba(255,255,255,0.05),0 2px 8px rgba(0,0,0,0.35);
}
body.dark .herb-fam-switch .hf-thumb{
  background:#3a3f48;
  box-shadow:0 1px 2px rgba(0,0,0,0.4),0 4px 10px rgba(0,0,0,0.35),inset 0 1px 0 rgba(255,255,255,0.06);
}
body.dark .herb-fam-switch .hf-btn.active{color:#e8eaee !important;}
body.dark .herb-fam-switch .hf-btn{color:#9aa0ab;}
/* ===== V54 分段条沉浸光感（中性银白流光，无蓝）+ 滑动性能 ===== */
/* 外层：银白流光胶囊 */
.herb-fam-switch{
  overflow:hidden;
  background:linear-gradient(135deg,#f3f5f8 0%,#e5e8ed 46%,#f7f9fb 100%);
  border:1px solid rgba(255,255,255,0.85);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.95),inset 0 -1px 1px rgba(150,156,166,0.18),0 6px 18px rgba(30,34,42,0.10);
}
/* 流光层：缓慢流动的银白高光 */
.herb-fam-switch::before{
  content:"";position:absolute;inset:-2px;z-index:0;pointer-events:none;border-radius:inherit;
  background:
    radial-gradient(120% 160% at 12% 0%,rgba(255,255,255,0.95),rgba(255,255,255,0) 55%),
    radial-gradient(140% 180% at 88% 100%,rgba(206,210,217,0.65),rgba(206,210,217,0) 55%),
    linear-gradient(115deg,rgba(255,255,255,0) 30%,rgba(255,255,255,0.7) 48%,rgba(255,255,255,0) 62%);
  background-size:200% 200%,200% 200%,220% 220%;
  animation:hfFlow 14s ease-in-out infinite alternate;
}
/* 内亮边 */
.herb-fam-switch::after{
  content:"";position:absolute;inset:0;z-index:0;pointer-events:none;border-radius:inherit;
  box-shadow:inset 0 1px 1px rgba(255,255,255,0.9),inset 0 -1px 2px rgba(120,126,136,0.12);
}
@keyframes hfFlow{
  0%{background-position:0% 0%,100% 100%,0% 50%;}
  100%{background-position:100% 100%,0% 0%,100% 50%;}
}
/* 滑块：光感玻璃，带柔和外发光 */
.herb-fam-switch .hf-thumb{
  z-index:0;
  background:linear-gradient(180deg,#ffffff 0%,#f3f5f8 100%);
  box-shadow:0 0 0 1px rgba(255,255,255,0.9),0 2px 6px rgba(30,34,42,0.10),0 8px 20px rgba(30,34,42,0.10),0 0 16px rgba(255,255,255,0.85),inset 0 1px 0 rgba(255,255,255,0.95);
}
.herb-fam-switch .hf-btn{z-index:1;}
/* 拖动期间强制 GPU 分层，避免每帧重绘大表 */
.herb-swipe.herb-dragging > .herb-sheet,
.herb-swipe.herb-dragging .herb-sheet-neighbor{
  will-change:transform;
  backface-visibility:hidden;
}
.herb-sheet-neighbor{contain:layout paint;}
/* 手机端：覆盖旧的 overflow:visible，保证流光被圆角裁切 */
@media (max-width:600px){
  .herb-fam-switch{overflow:hidden !important;}
}
/* 深色模式：深灰流光同族 */
body.dark .herb-fam-switch{
  background:linear-gradient(135deg,#32363e 0%,#262930 46%,#393d45 100%);
  border:1px solid rgba(255,255,255,0.07);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.06),inset 0 -1px 1px rgba(0,0,0,0.3),0 6px 18px rgba(0,0,0,0.4);
}
body.dark .herb-fam-switch::before{
  background:
    radial-gradient(120% 160% at 12% 0%,rgba(255,255,255,0.10),rgba(255,255,255,0) 55%),
    radial-gradient(140% 180% at 88% 100%,rgba(0,0,0,0.35),rgba(0,0,0,0) 55%),
    linear-gradient(115deg,rgba(255,255,255,0) 30%,rgba(255,255,255,0.10) 48%,rgba(255,255,255,0) 62%);
  background-size:200% 200%,200% 200%,220% 220%;
}
body.dark .herb-fam-switch .hf-thumb{
  background:linear-gradient(180deg,#424750 0%,#33373f 100%);
  box-shadow:0 0 0 1px rgba(255,255,255,0.06),0 2px 6px rgba(0,0,0,0.4),0 8px 20px rgba(0,0,0,0.4),0 0 14px rgba(255,255,255,0.06),inset 0 1px 0 rgba(255,255,255,0.08);
}
@media (prefers-reduced-motion:reduce){
  .herb-fam-switch::before{animation:none;}
}
/* ===== V55 沉浸光感收口：去滑块，整条静态毛玻璃 ===== */
/* 整条：半透毛玻璃 + 银白流光，无移动滑块 */
.herb-fam-switch{
  background:linear-gradient(135deg,rgba(255,255,255,0.72) 0%,rgba(236,238,242,0.62) 100%);
  border:1px solid rgba(255,255,255,0.85);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.95),inset 0 -1px 1px rgba(150,156,166,0.15),0 6px 18px rgba(30,34,42,0.08);
}
/* V61 滑块加回：白色光感块随选中项移动（布局与拖动逻辑本就保留） */
.herb-fam-switch .hf-thumb{opacity:1;}
/* 文字：选中深灰加粗，未选中灰，无任何按钮底色 */
.herb-fam-switch .hf-btn.active{
  color:#1f2329 !important;
  font-weight:800;
  background:transparent !important;
  box-shadow:none !important;
}
.herb-fam-switch .hf-btn{
  color:#6b7280;
  font-weight:600;
  background:transparent !important;
  box-shadow:none !important;
}
/* 深色模式：深色静态毛玻璃 */
body.dark .herb-fam-switch{
  background:linear-gradient(135deg,rgba(64,68,76,0.72) 0%,rgba(44,47,54,0.66) 100%);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.07),inset 0 -1px 1px rgba(0,0,0,0.3),0 6px 18px rgba(0,0,0,0.4);
}
body.dark .herb-fam-switch .hf-btn.active{color:#e8eaee !important;}
body.dark .herb-fam-switch .hf-btn{color:#9aa0ab;}
/* ===== V56 拖动沉浸光感联动 ===== */
.herb-fam-switch{ --hf-drag:0; --hf-strength:0; }
/* 流光层：拖动时暂停环境动画，高光跟手偏移 */
.herb-fam-switch::before{ transition:transform .25s ease; }
.herb-fam-switch.hf-dragging::before{
  animation-play-state:paused;
  transform:translateX(calc(var(--hf-drag) * 34px));
}
/* 整条：外发光随拖动强度增强 */
.herb-fam-switch.hf-dragging{
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.95),inset 0 -1px 1px rgba(150,156,166,0.15),0 6px 18px rgba(30,34,42,0.08),0 0 calc(8px + var(--hf-strength) * 22px) rgba(255,255,255,calc(0.35 + var(--hf-strength) * 0.4));
  transition:box-shadow .2s ease;
}
/* 当前选中文字随进度淡出，目标文字随进度淡入加深 */
.herb-fam-switch.hf-dragging .hf-btn.active{ opacity:calc(1 - var(--hf-strength) * 0.55); }
.herb-fam-switch .hf-drag-target{
  color:#1f2329 !important;
  font-weight:800 !important;
  opacity:calc(0.35 + var(--hf-strength) * 0.65);
}
.herb-fam-switch .hf-btn{ transition:color .2s ease,opacity .2s ease; }
/* 深色模式联动 */
body.dark .herb-fam-switch.hf-dragging{
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.07),inset 0 -1px 1px rgba(0,0,0,0.3),0 6px 18px rgba(0,0,0,0.4),0 0 calc(8px + var(--hf-strength) * 18px) rgba(255,255,255,calc(0.06 + var(--hf-strength) * 0.12));
}
body.dark .herb-fam-switch .hf-drag-target{ color:#e8eaee !important; }
@media (prefers-reduced-motion:reduce){
  .herb-fam-switch::before{ transition:none; }
  .herb-fam-switch .hf-btn{ transition:none; }
}
/* ===== V57 疱方笺窄格：代码独占一行（同 CH 版式） ===== */
.herb-grid-narrow .herb-cell .hc-code{
  flex:0 0 100% !important;
  order:0;
  text-align:center;
}
.herb-grid-narrow .herb-cell .hc-cell-dose{
  flex:0 0 100%;
  order:1;
  margin:2px auto 0;
}
.herb-grid-narrow .herb-cell .hc-name{
  flex:0 0 100% !important;
  order:2;
  margin:2px 0 0;
  text-align:center;
}
/* ===== V58 全部方笺统一堆叠：代码独占一行（热黄合跌疱，含宽视口） ===== */
.herb-grid .herb-cell .hc-code{
  flex:0 0 100% !important;
  order:0;
  text-align:center;
}
.herb-grid .herb-cell .hc-cell-dose{
  flex:0 0 100%;
  order:1;
  margin:2px auto 0;
}
.herb-grid .herb-cell .hc-name{
  flex:0 0 100% !important;
  order:2;
  margin:2px 0 0;
  text-align:center;
}
/* ===== V59 诊断分段条静态毛玻璃（去滑块、去拖动，中性灰） ===== */
.diag-seg{
  background:linear-gradient(135deg,rgba(255,255,255,0.72) 0%,rgba(236,238,242,0.62) 100%);
  border:1px solid rgba(255,255,255,0.85);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.95),inset 0 -1px 1px rgba(150,156,166,0.15),0 6px 18px rgba(30,34,42,0.08);
}
.diag-seg .diag-seg-thumb{opacity:1;}
.diag-seg .diag-seg-btn.active{
  color:#1f2329 !important;
  font-weight:800;
  background:transparent !important;
  box-shadow:none !important;
}
.diag-seg .diag-seg-btn{
  color:#6b7280;
  font-weight:600;
  background:transparent !important;
  box-shadow:none !important;
}
/* 深色模式 */
body.dark .diag-seg{
  background:linear-gradient(135deg,rgba(64,68,76,0.72) 0%,rgba(44,47,54,0.66) 100%);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.07),inset 0 -1px 1px rgba(0,0,0,0.3),0 6px 18px rgba(0,0,0,0.4);
}
body.dark .diag-seg .diag-seg-btn.active{color:#e8eaee !important;}
body.dark .diag-seg .diag-seg-btn{color:#9aa0ab;}
/* ===== V61 手机端弹窗宽度（92%，max-width 380），内容舒展且不横向溢出 ===== */
@media (max-width:600px){
  .confirm-dialog .confirm-box{
    width:100% !important;
    max-width:460px !important;
    box-sizing:border-box;
    overflow-x:hidden;
  }
  /* 简单确认弹窗（删除 / 退出 / 授权码等短消息 + 两按钮）在手机端放宽到屏宽，max-width 限 90% */
  #confirmDlg .confirm-box{
    width:95% !important;
    max-width:90% !important;
  }
}
/* V60 补充：快速组方弹窗内部弹性行允许收缩，不撑破窄弹窗 */
#herbSlipDlg .confirm-box > div{min-width:0;}
#herbSlipDlg .herb-slip-stage{max-width:100%;}
/* V60 补充：快速组方弹窗按钮条负边距对齐其 18px 内边距，消除横向溢出 */
#herbSlipDlg .confirm-btns{margin-left:-18px;margin-right:-18px;padding-left:18px;padding-right:18px;}
/* V63：弹窗底部按钮条去掉灰色底栏，透明贴合卡片（含独立滚动区变体）；无虚线 / 阴影 / 模糊，深色模式同步；背景遮罩保留 */
.confirm-dialog .confirm-btns,
#prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:transparent !important;
  border-top:none !important;
  box-shadow:none !important;
  -webkit-backdrop-filter:none !important;
  backdrop-filter:none !important;
  border-radius:0;
}
body.dark .confirm-dialog .confirm-btns,
body.dark #prescDlg .confirm-box.has-scroll>.confirm-btns{
  background:transparent !important;
  border-top-color:transparent;
  box-shadow:none !important;
}
/* V63+：查看版小方笺打印占 A4 1/6 版面（2列×3行单元，约 96×90mm），单张单独打也按此尺寸；门诊笺 / 西药笺固定 A5，不受影响 */
@media print{
  .hp-slip-print{width:96mm;height:90mm;}
  .hp-slip-print .hp-sheet.small{width:100%;height:100%;box-sizing:border-box;}
  /* 批量六格网格内：填满当前网格单元，不套固定 mm 尺寸 */
  .hp-page{height:auto;grid-template-rows:repeat(3,90mm);}
  .hp-page .hp-slip-print{width:100%;height:100%;}
  .hp-slip-print .hp-sheet.small{border:0.5pt solid #333;}
}

/* --- 滚动渐显（IntersectionObserver，只播一次） --- */
.reveal{opacity:0;transform:translateY(18px);transition:opacity .32s cubic-bezier(.16,1,.3,1),transform .32s cubic-bezier(.16,1,.3,1);will-change:opacity,transform;}
.reveal.reveal-in{opacity:1;transform:translateY(0);}
/* 由渐显接管卡片入场，停用旧 cardIn 位移浮入，避免双重动画 */
.page.active .card{animation:none !important;}
@media (prefers-reduced-motion: reduce){
  .reveal{opacity:1 !important;transform:none !important;transition:none !important;}
}

