/* ============ 华信HIS 经典 C/S 视觉样式 ============ */
* { margin:0; padding:0; box-sizing:border-box; }
html,body{ height:100%; overflow:hidden; }
body{
  font-family:"宋体","SimSun",monospace; font-size:12px; color:#000;
  background:#626262; user-select:none;
}
::selection{ background:#0A246A; color:#fff; }

/* 老式滚动条 */
::-webkit-scrollbar{ width:16px; height:16px; }
::-webkit-scrollbar-track{ background:#ECE9D8; }
::-webkit-scrollbar-thumb{ background:#C0C0C0; border-style:solid;border-width:1px;
  border-color:#fff #404040 #404040 #fff; }
::-webkit-scrollbar-corner{ background:#ECE9D8; }

/* ---------- 通用控件 ---------- */
.up{border-style:solid;border-width:1px;border-color:#fff #808080 #808080 #fff;}
.dn{border-style:solid;border-width:1px;border-color:#808080 #fff #fff #808080;}
.fld{border-style:solid;border-width:1px;border-color:#808080 #fff #fff #808080;background:#fff;}

button{ font-family:"宋体","SimSun",monospace; }
.cbtn{
  height:23px; min-width:64px; padding:0 10px; font-size:12px; color:#000;
  background:#D4D0C8; cursor:default; border-style:solid;border-width:1px;
  border-color:#fff #404040 #404040 #fff; white-space:nowrap;
}
.cbtn:active{ border-color:#404040 #fff #fff #404040; padding:1px 9px 0 11px; background:#C6C0B4; }
.cbtn:disabled{ color:#808080; }
.cbtn.primary{ font-weight:bold; }

input[type=text],input[type=number],input[type=password],select,textarea{
  font-family:"宋体","SimSun",monospace; font-size:12px; color:#000;
  border-style:solid;border-width:1px;border-color:#808080 #fff #fff #808080;
  background:#fff; padding:2px 4px; height:22px; outline:none;
}
textarea{ height:auto; resize:none; }
select{ background:#fff; padding:1px 2px; }
input:disabled,select:disabled,textarea:disabled, .ro{ background:#E9E9E9; color:#444; }
input.red{ color:#a00; font-weight:bold; }
label{ white-space:nowrap; }
.grp{ border-style:solid;border-width:1px;border-color:#808080 #fff #fff #808080; }

/* 带标题的字段组分块（老式 GroupBox） */
.gbox{ position:relative; border-style:solid;border-width:1px;
  border-color:#fff #808080 #808080 #fff; padding:16px 8px 6px 8px; background:#ECE9D8; }
.gbox .gt{ position:absolute; top:-9px; left:6px; background:#ECE9D8; padding:0 4px; font-size:12px; }

/* 老式单选/复选保持原生但缩小 */
input[type=checkbox],input[type=radio]{ width:13px; height:13px; margin:0 2px 0 0; vertical-align:-2px; }

/* ---------- 应用主窗口 ---------- */
#app{ position:absolute; inset:0; display:flex; flex-direction:column; }
#titlebar{ height:28px; background:linear-gradient(180deg,#0A246A,#3A6EA5);
  display:flex; align-items:center; padding:0 4px 0 5px; flex:0 0 auto; }
#titlebar .cap{ color:#fff; font-weight:bold; font-size:13px; letter-spacing:1px;
  text-shadow:1px 1px 1px #000; flex:1; white-space:nowrap; }
#titlebar .cap small{ color:#cfe0ff; font-weight:normal; }
#titlebar .sysmark{ margin-right:6px; font-weight:bold; color:#0A246A; background:#fff;
  border:1px solid #fff; border-radius:2px; width:19px;height:19px; line-height:17px;
  text-align:center; font-size:11px; }
.winbtns{ display:flex; gap:2px; }
.winbtn{ width:22px;height:20px;line-height:18px;text-align:center; font-family:"宋体";
  font-size:11px; background:#D4D0C8; border-style:solid;border-width:1px;
  border-color:#fff #404040 #404040 #fff; cursor:default; }
.winbtn:active{ border-color:#404040 #fff #fff #404040; }

#menubar{ height:24px; background:#D4D0C8; border-top:1px solid #fff;
  border-bottom:1px solid #808080; display:flex; align-items:center; padding:0 4px; flex:0 0 auto;
  position:relative; z-index:100; }
.mwrap{ position:relative; height:100%; }
.mwrap b{ font-weight:normal; padding:3px 10px; display:inline-block; cursor:default;
  line-height:16px; white-space:nowrap; }
.mwrap b:hover, .mwrap b.open, .mwrap b.on{ background:#0A246A; color:#fff; }
.mdrop{ position:absolute; left:0; top:23px; min-width:210px; background:#ECE9D8;
  border-style:solid;border-width:1px;border-color:#fff #404040 #404040 #fff;
  box-shadow:3px 3px 6px rgba(0,0,0,.45); display:none; padding:1px; z-index:120; }
.mwrap.alR .mdrop{ left:auto; right:0; }
.mdrop.open{ display:block; }
.mrow{ padding:3px 8px 3px 10px; cursor:default; white-space:nowrap; display:flex; align-items:center; }
.mrow .dot{ width:8px; }
.mrow .mk{ color:#333; }
.mrow:hover{ background:#0A246A; color:#fff; }
.mrow:hover .mk{ color:#fff; }
.mrow.plan .mk{ color:#989898; }
.mrow.plan:hover{ background:#E4E0D6; color:#989898; }
.mrow.plan .plan-tag{ color:#a08; font-size:10px; border:1px solid #c0b0b8; padding:0 3px; margin-left:8px; }
.mrow .st2{ color:#0a6; margin-left:auto; padding-left:14px; font-size:10px; }
.mrow:hover .st2{ color:#adf; }
.msep{ height:1px; margin:2px 6px; background:#808080; box-shadow:0 1px 0 #fff; }

#toolbar{ height:31px; background:#D4D0C8; border-bottom:1px solid #fff;
  display:flex; align-items:center; padding:0 4px; gap:2px; flex:0 0 auto; }
.tbtn{ height:25px; padding:0 9px; background:#D4D0C8; font-size:12px; cursor:default;
  border-style:solid;border-width:1px;border-color:#fff #404040 #404040 #fff;
  display:inline-flex; align-items:center; gap:4px; color:#000; }
.tbtn:active{ border-color:#404040 #fff #fff #404040; }
.tbtn.on{ background:#C6C0B4; border-color:#404040 #fff #fff #404040; }
.tsep{ width:1px; height:22px; background:#808080; box-shadow:1px 0 0 #fff; margin:0 3px; }

#workspace{ flex:1; position:relative; background:#626262; overflow:hidden;
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 8px); }

/* ---------- 子窗口 ---------- */
.child{ position:absolute; background:#ECE9D8; box-shadow:2px 2px 5px rgba(0,0,0,.5);
  display:flex; flex-direction:column; }
.ch-cap{ height:21px; flex:0 0 auto; background:linear-gradient(180deg,#7B7B7B,#B5B5B5);
  color:#000; font-size:12px; display:flex; align-items:center; padding:0 2px 0 5px; }
.child.active .ch-cap{ background:linear-gradient(180deg,#0A246A,#3A6EA5); color:#fff;
  text-shadow:1px 1px 1px #000; }
.ch-cap .t{ flex:1; white-space:nowrap; overflow:hidden; }
.ch-cap .winbtn{ width:17px;height:15px;line-height:13px;font-size:10px; }
.ch-body{ position:absolute; left:2px; right:2px; bottom:2px; top:23px; overflow:hidden; }

#win-nav{ left:6px; top:6px; width:206px; bottom:6px; }
#win-main{ left:218px; right:6px; top:6px; bottom:6px; }

/* 左侧功能树 */
#tree{ position:absolute; inset:0; overflow:auto; padding:3px 0;
  border:none; background:#fff; }
.trow{ padding:1px 3px; white-space:nowrap; cursor:default; display:flex;
  align-items:center; gap:1px; height:19px; }
.trow:hover{ background:#DDE6F2; }
.trow.sel{ background:#0A246A; color:#fff; }
.trow .ar{ width:13px; text-align:center; font-size:9px; }
.trow .ic{ width:15px; text-align:center; }
.trow.leaf .ic{ color:#3a3a3a; }
.trow.grp{ font-weight:bold; height:20px; }
.trow .bdg{ margin-left:4px; background:#a00; color:#fff; font-size:10px; padding:0 4px; border-radius:6px; line-height:13px; }

/* 右侧页面容器 */
#viewbody{ position:absolute; inset:0; }
.ptop{ flex:0 0 auto; height:auto; padding:4px 6px; background:#ECE9D8;
  border-bottom:1px solid #fff; display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.pbody{ position:absolute; left:0; right:0; top:0; bottom:0; }
#win-main .ch-body{ display:flex; flex-direction:column; }
.ptop .lbl2{ color:#000; }
.ptop .fill{ flex:1; }
.pscroll{ overflow:auto; background:#ECE9D8; flex:1; padding:4px; }

/* 老式数据表格 */
.grid{ border-collapse:separate; border-spacing:0; background:#fff; width:max-content; min-width:100%; }
.grid thead th{ background:#D4D0C8; font-weight:normal; text-align:left; padding:3px 6px;
  border-style:solid;border-width:1px;border-color:#fff #808080 #808080 #fff;
  white-space:nowrap; overflow:hidden; }
.grid tbody td{ border:1px solid #d8d8d8; padding:2px 6px; white-space:nowrap;
  overflow:hidden; height:19px; }
.grid tbody tr:hover{ background:#E8EFF7; }
.grid tbody tr.sel{ background:#0A246A; color:#fff; }
.grid tbody tr.sel td{ border-color:#0A246A; }
.grid tbody tr.lack td{ color:#a00; }
.grid .num{ text-align:right; }
.grid .cen{ text-align:center; }
.grid tbody tr.alert td{ background:#FFF3E6; }
.grid tbody tr.done td{ color:#888; }
.gfoot{ height:22px; padding:2px 6px; background:#ECE9D8; border-top:1px solid #fff;
  display:flex; align-items:center; gap:8px; white-space:nowrap; flex:0 0 auto; }
.gfoot b{ color:#a00; }
.gw{ flex:1; min-height:0; overflow:auto; background:#fff; }
.gwwrap{ flex:1; display:flex; flex-direction:column; min-height:0; }

/* 状态徽标文字 */
.st{ padding:0 3px; }
.st.wang{ color:#a00; font-weight:bold; }
.st.ok{ color:#060; }
.st.gray{ color:#666; }

/* 明细行（处方内容） */
.small{ font-size:12px; color:#555; }

/* 页面里的分隔虚线 */
.rule{ height:0; border-top:1px dashed #a0a0a0; margin:2px 0; }

/* 状态栏 */
#statusbar{ height:23px; background:#D4D0C8; flex:0 0 auto; border-top:1px solid #fff;
  display:flex; align-items:stretch; }
#statusbar .panel{ padding:2px 10px; display:flex; align-items:center; white-space:nowrap; }
#statusbar .panel+.panel{ border-left:1px solid #808080; box-shadow:1px 0 0 #fff inset; }
#statusbar .sp{ flex:1; }

/* ---------- 模态/浮动窗 ---------- */
#layer{ position:absolute; left:0; top:0; right:0; bottom:0; overflow:hidden;
  pointer-events:none; }
.modal{ position:absolute; background:#ECE9D8; box-shadow:3px 3px 7px rgba(0,0,0,.5);
  display:flex; flex-direction:column; pointer-events:auto; z-index:20; }
.modal .ch-cap{ cursor:move; }
.modal .mbody{ position:relative; margin:2px; border-style:solid;border-width:1px;
  border-color:#fff #808080 #808080 #fff; background:#ECE9D8; flex:1; overflow:hidden;
  display:flex; flex-direction:column; }
.modal .mfoot{ flex:0 0 auto; height:36px; display:flex; align-items:center;
  justify-content:flex-end; gap:6px; padding:0 8px; background:#ECE9D8;
  border-top:1px solid #fff; }
.mform{ padding:8px; display:flex; flex-direction:column; gap:6px; flex:1; overflow:auto; }
.frow{ display:flex; align-items:center; gap:4px; }
.frow label{ width:66px; text-align:right; flex:0 0 auto; }
.frow .v{ flex:1; display:flex; gap:4px; align-items:center; }
.frow input[type=text],.frow input[type=number],.frow select{ flex:1; min-width:0; }

/* toast */
#toasts{ position:fixed; right:10px; bottom:34px; z-index:999; display:flex;
  flex-direction:column; gap:6px; align-items:flex-end; pointer-events:none; }
.toast{ background:linear-gradient(180deg,#0A246A,#3A6EA5); color:#fff; padding:7px 14px;
  font-size:12px; box-shadow:2px 2px 6px rgba(0,0,0,.5); max-width:420px; }
.toast.err{ background:linear-gradient(180deg,#7a1010,#c33); }
.toast.ok{ background:linear-gradient(180deg,#0a5a2a,#2a8a4a); }
.tnum{ text-align:right; }

/* 打印票样 */
.ticket{ font-family:"宋体"; font-size:13px; line-height:1.6; }
.ticket .t{border-bottom:1px dashed #000;}
