/* ============ 页内分段标签（医院管理 / 数据字典 等） ============ */
.tabs-inline { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.tabs-inline .opt { font-size: 13.5px; padding: 7px 14px; border-radius: 8px; cursor: pointer; color: var(--text2);
  user-select: none; transition: .15s; border: 1px solid transparent; }
.tabs-inline .opt:hover { background: #f1f4f9; color: var(--primary); }
.tabs-inline .opt.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; border-color: rgba(45,140,240,.25); }

/* ============ 药品私域电商业务数据管理平台 · Soybean Admin 风格 ============ */
:root {
  --primary: #2d8cf0; --primary-hover: #2670cc; --primary-soft: #eef6ff;
  --sidebar-w: 232px; --sidebar-w-collapsed: 64px;
  --bg: #f5f7fb; --card: #ffffff; --border: #e6e8ee;
  --text: #1f2329; --text2: #5a6472; --text3: #98a0ad;
  --success: #18a058; --danger: #e54848; --warn: #f0a020; --purple: #7c5cff; --cyan: #16b8c8;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
a { color: var(--primary); text-decoration: none; }

/* ---------- 线体图标 ---------- */
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.i.lg { width: 20px; height: 20px; }
.i.sm { width: 14px; height: 14px; stroke-width: 1.8; }

/* ================= 登录页（左色块 + 右白卡，合并为整块圆角） ================= */
.login-mask { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #f5f7fa; z-index: 100; padding: 20px; overflow: auto; }
/* 整体容器：宽度 = 左侧色块 352 + 右侧白卡 428，两块严丝合缝，避免容器比内容宽露出白边 */
.login-split { display: flex; align-items: stretch; justify-content: center; gap: 0;
  width: 780px; max-width: 100%; height: 452px; border-radius: 18px; overflow: hidden;
  background: #fff; }
.login-aside { position: relative; width: 352px; flex: none; height: 100%; border-radius: 18px 0 0 18px; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #2f7ff5 55%, #4aa3ff 100%);
  background-repeat: no-repeat; background-size: cover; background-position: center; }
.login-aside > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 左侧仅完整展示背景图，不叠加任何遮罩/渐变效果 */
/* 左侧文案（主标题 / 导语 / 卖点）已按需求移除，登录页左侧仅保留背景图 */
.login-card { width: 428px; flex: 1 1 auto; max-width: 428px; height: 100%; background: #fff; border-radius: 0 18px 18px 0; padding: 34px 42px;
  display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.login-card h1 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.login-card .sub { color: var(--text3); font-size: 12.5px; margin-bottom: 22px; line-height: 1.6; }
.login-note { font-size: 12px; color: var(--text3); margin-top: 12px; text-align: center; }
.login-copy { text-align: center; font-size: 12px; color: var(--text3); margin-top: 8px; }
.login-card .input { height: 40px; }
/* 密码框「眼睛」切换：图标绝对定位在输入框右侧 */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 40px; }
.pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  border: none; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #b4bac6; border-radius: 6px; padding: 0; }
.pwd-eye:hover { color: var(--text2); background: #f2f4f8; }
.pwd-eye .i { stroke: currentColor; fill: none; stroke-width: 1.7; }
.pwd-eye.on { color: var(--primary); }
@media (max-width: 900px) {
  .login-split { flex-direction: column; height: auto; width: 100%; max-width: 440px; }
  .login-aside { width: auto; height: auto; border-radius: 18px 18px 0 0; padding: 24px 24px; }
  .login-card { width: auto; height: auto; max-width: 100%; border-radius: 0 0 18px 18px; padding: 28px 26px; }
}

/* ================= 布局 ================= */
.app { display: none; min-height: 100vh; }
.app.on { display: block; }
/* 侧边栏整体不滚动：顶部品牌区固定，仅中间导航列表滚动 */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); background: #fff;
  border-right: 1px solid var(--border); color: var(--text2); overflow: hidden; z-index: 30;
  display: flex; flex-direction: column;
  transition: width .2s ease; scrollbar-width: thin; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #e2e5ec; border-radius: 3px; }
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .brand > div, .sidebar.collapsed .brand .nav-toggle,
.sidebar.collapsed .nav-item span, .sidebar.collapsed .nav-group-name { display: none; }
.sidebar.collapsed .brand { justify-content: center; padding: 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed .nav-item .i, .sidebar.collapsed .nav-item .nav-img-ico { display: inline-flex; flex: none; }
.sidebar.collapsed .sidebar-foot { display: none; }

.brand { display: flex; align-items: center; gap: 11px; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
  flex: none; position: sticky; top: 0; background: #fff; z-index: 3; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #2d8cf0, #1f6fd0);
  display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 4px 12px rgba(45,140,240,.35); color: #fff; }
.brand .logo .i { width: 18px; height: 18px; stroke: #fff; }
/* 左上角图标：未上传时完全不显示（无占位）；已上传时显示纯图片，去掉蓝色渐变底与阴影 */
.brand .logo.no-logo { display: none; }
/* 折叠态品牌区：只显示图标（未上传自定义 logo 时显示默认药丸图标），避免折叠后顶部空白 */
.sidebar.collapsed .brand .logo { display: flex !important; align-items: center; justify-content: center; }
.brand .logo.has-logo { background: none; box-shadow: none; }
.brand .logo.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 8px; }
.brand .brand-name { font-size: 15px; font-weight: 700; line-height: 1.25; color: var(--text); }
.brand .brand-sub { font-size: 11px; color: var(--text3); }
.brand-center { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nav-toggle { display: none; margin-left: auto; border: none; background: transparent; color: var(--text2); cursor: pointer; padding: 4px; border-radius: 6px; }

.nav { flex: 1 1 auto; min-height: 0; padding: 10px 12px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: #e2e5ec; border-radius: 3px; }
.nav-group-name { font-size: 11px; color: #9aa1af; padding: 12px 10px 6px; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 13px; margin: 2px 0; border-radius: 9px;
  color: #4b5563; cursor: pointer; font-size: 13.5px; user-select: none; transition: .15s; white-space: nowrap; }
.nav-item:hover { color: var(--primary); background: #f3f5f9; }
.nav-item.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-item .i { width: 18px; height: 18px; flex: none; stroke: currentColor; }
.nav-item > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 6px; line-height: 16px; min-width: 18px; text-align: center; }
.sidebar-foot { padding: 10px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text3); flex: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; transition: margin-left .2s ease; }
.main.collapsed { margin-left: var(--sidebar-w-collapsed); }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; height: 60px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 20px; z-index: 10; }
.collapse-btn { width: 36px; height: 36px; border: none; background: transparent; border-radius: 8px; cursor: pointer;
  color: var(--text2); display: flex; align-items: center; justify-content: center; flex: none; }
.collapse-btn:hover { background: #eef1f6; color: var(--primary); }
/* 面包屑（含父级层级 + 图标） */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text2); min-width: 0; overflow: hidden; }
.crumb .c-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.crumb .c-item .i { width: 15px; height: 15px; color: var(--text3); }
.crumb .c-last { color: var(--text); font-weight: 600; }
.crumb .sep { color: var(--text3); font-weight: 400; }
.crumb small { font-weight: 400; color: var(--text3); font-size: 12px; margin-left: 4px; }
.user-area { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.icon-btn { width: 36px; height: 36px; border: none; background: transparent; border-radius: 8px; cursor: pointer;
  color: var(--text2); display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.icon-btn:hover { background: #eef1f6; color: var(--primary); }
.icon-btn .dot-badge { position: absolute; top: 6px; right: 6px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10px; line-height: 15px; text-align: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #2d8cf0, #2670cc);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
/* 状态栏右上角头像：缩小约一半（不影响个人资料页头像） */
/* ---------- 顶栏全局功能搜索 ---------- */
.search-wrap { position: relative; flex: none; }
.gs-panel { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 34px rgba(20,30,60,.18); z-index: 60; overflow: hidden; }
.gs-panel.open { display: block; }
.gs-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text3); }
.gs-input input { flex: 1; min-width: 0; border: none; outline: none; font-size: 13.5px; color: var(--text); background: transparent; height: 22px; }
.gs-input input::placeholder { color: #b6bcc7; }
.gs-kbd { font-size: 10.5px; color: var(--text3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; flex: none; }
.gs-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.gs-list .gs-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.gs-list .gs-item:hover, .gs-list .gs-item.on { background: var(--primary-soft); color: var(--primary); }
.gs-list .gs-item .i { width: 15px; height: 15px; color: var(--text3); flex: none; }
.gs-list .gs-item:hover .i, .gs-list .gs-item.on .i { color: var(--primary); }
.gs-list .gs-item .gs-path { margin-left: auto; font-size: 11.5px; color: var(--text3); font-weight: 300; white-space: nowrap; }
.gs-list .gs-null { padding: 16px 10px; text-align: center; color: var(--text3); font-size: 12.5px; }
.gs-foot { padding: 8px 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text3); font-weight: 300; }
/* 状态栏用户区：与电子处方管理平台保持一致（头像 + 姓名 + 下拉箭头，姓名后不再显示角色标签） */
.user-drop { position: relative; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 10px; border-radius: 10px; user-select: none; }
.user-drop:hover { background: #eef1f6; }
/* 顶栏头像：独立元素（不在 user-drop 内），缩小显示；姓名 + 箭头在 user-drop 内单独作为下拉触发区 */
.topbar .avatar { width: 16px; height: 16px; font-size: 9px; flex: none; overflow: hidden; }
.topbar #userAvatar { margin-left: -4px; }
.user-drop #topUserName { font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-drop .caret { color: var(--text3); font-size: 12px; display: flex; }
.user-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 176px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgba(20,30,60,.16); z-index: 60; }
.user-menu.open { display: block; }
.user-menu .mi { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); white-space: nowrap; display: flex; align-items: center; gap: 9px; }
.user-menu .mi:hover { background: #f1f4f9; color: var(--primary); }
.user-menu .mi.danger { color: var(--danger); }
.user-menu .mi.danger:hover { background: #fdecec; color: var(--danger); }
.user-menu .mi-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ---------- 多页签栏 ---------- */
.tabbar { position: sticky; top: 60px; z-index: 9; display: flex; align-items: stretch; gap: 8px;
  background: #fff; border-bottom: 1px solid var(--border); padding: 0 16px; height: 44px; }
.tabs { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding-top: 6px; }
/* 仅「卡片内」的页签需要与下方内容拉开距离（如结算中心），多页签栏的标签保持贴底 */
.card > .tabs { margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 8px 8px 0 0; font-size: 13px;
  color: var(--text2); cursor: pointer; user-select: none; white-space: nowrap; transition: .15s; }
.tab:hover { color: var(--primary); background: #f3f5f9; }
.tab.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.tab .i { width: 14px; height: 14px; }
.tab .x { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.tab .x:hover { background: rgba(0,0,0,.1); color: var(--text); }
.tab .x .i { width: 9px; height: 9px; }
.tabbar-right { display: flex; align-items: center; gap: 2px; border-left: 1px solid var(--border); padding-left: 10px; flex: none; }
.tabbar-right .icon-btn { width: 32px; height: 32px; }

/* 内容区保持页面浅灰底，各区块靠白底卡片区分（卡片之间由浅灰留白分隔） */
.content { padding: 16px 20px 40px; }

/* ================= 通用组件 ================= */
.card { background: var(--card); border: none; border-radius: 8px; padding: 16px 18px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(20,30,60,.04), 0 2px 10px rgba(20,30,60,.03); }
.card-title { font-size: 14.5px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.card-title .desc { font-weight: 300; font-size: 11.5px; color: var(--text3); }
/* 标题文字不参与收缩，避免被右侧控件挤成竖排 */
.card-title .tt { flex: none; white-space: nowrap; }
/* 新建处方 / 新建病历：标题行最右侧的显示项筛选（全部显示 / 仅显示必填项）
   宽度跟随最长选项文字（select 自适应内容），并固定在标题行右端 */
.card-title select.rx-filter { margin-left: auto; margin-right: 0; width: auto !important; max-width: none;
  min-height: 28px; flex: none; padding: 2px 26px 2px 10px !important; font-size: 12.5px; color: var(--text2);
  background-position: right 8px center !important; border-radius: 5px; }
/* 页面级标题：不带白底卡片，标题与右侧筛选框直接落在浅灰页底上 */
.card-title.page-title { margin: 0 0 14px; padding: 0 2px; font-size: 15.5px; }
.card-title.page-title .i { width: 17px; height: 17px; }
/* 分区小标题（如数据看板「待处理事项」）：直接落在浅灰页底上，不套白卡 */
.dash-sec-h { display: flex; align-items: center; gap: 6px; margin: 0 0 12px 2px;
  font-size: 13.5px; font-weight: 700; color: var(--text2); }
.dash-sec-h .i { width: 15px; height: 15px; stroke: var(--text3); fill: none; stroke-width: 1.8; }
.grid { display: grid; gap: 12px; }
/* 数据看板：一行排不下时横向滚动不换行；每项为一张白底圆角卡片 */
.stat-line { display: flex; gap: 14px; width: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.stat-line::-webkit-scrollbar { height: 6px; }
.stat-line::-webkit-scrollbar-thumb { background: #e2e5ec; border-radius: 3px; }
.stat-line > .stat { flex: 1 1 0; min-width: 190px; }
.stat-line > .card { flex: 1 1 0; min-width: 260px; }
/* 统计卡片（参照图 2）：左侧彩色圆角图标块 + 右侧「数值在上 / 标题在下」 */
.stat-line > .stat { display: flex; align-items: center; gap: 14px;
  background: #fff; border: none; border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(20,30,60,.04), 0 2px 10px rgba(20,30,60,.03); }
.stat .st-ic { width: 46px; height: 46px; border-radius: 12px; flex: none; display: flex;
  align-items: center; justify-content: center; background: var(--primary); }
.stat .st-ic .i { width: 24px; height: 24px; stroke: #fff; stroke-width: 1.8; fill: none; }
.stat .st-bd { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stat .st-bd .value { font-size: 22px; font-weight: 700; line-height: 1.25; margin-top: 0; }
.stat .st-bd .label { font-size: 12.5px; color: var(--text3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.stat .st-bd .foot { margin-top: 2px; }
.stat.primary .st-ic { background: var(--primary); }
.stat.success .st-ic { background: var(--success); }
.stat.warn .st-ic { background: var(--warn); }
.stat.danger .st-ic { background: var(--danger); }
.stat.purple .st-ic { background: var(--purple); }
.stat.cyan .st-ic { background: var(--cyan); } .stat.cyan .value { color: var(--cyan); }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
/* 关键：网格子项默认 min-width:auto，会被内部宽内容（如统计卡 min-width）撑破栅格导致溢出卡片，强制可收缩 */
.grid > .card { min-width: 0; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } }

.stat { background: #fff; border: none; border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(20,30,60,.04), 0 2px 10px rgba(20,30,60,.03); }
.stat .label { font-size: 12.5px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: .5px; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--text3); margin-left: 4px; }
.stat .foot { font-size: 12px; color: var(--text3); margin-top: 4px; }
.stat.primary .value { color: var(--primary); } .stat.danger .value { color: var(--danger); }
.stat.success .value { color: var(--success); } .stat.warn .value { color: var(--warn); }
.stat.purple .value { color: var(--purple); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.toolbar + .toolbar { margin-top: -2px; }
.toolbar .sep { width: 1px; height: 22px; background: var(--border); flex: none; }
.toolbar .inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); }
.toolbar .inline input[type=checkbox] { accent-color: var(--primary); }
/* 工具栏 / 筛选条中的下拉框按内容宽度显示，避免被拉成整行 */
.toolbar .select, .filters .select { width: auto; flex: none; min-width: 120px; max-width: 260px; }
.toolbar input[type=date] { width: 140px; flex: none; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--border); background: #fff;
  color: var(--text); border-radius: 8px; font-size: 13.5px; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f3c2c2; }
.btn.danger:hover { background: #fdecec; border-color: var(--danger); }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .select, textarea.input { width: 100%; border: 1px solid #DCDFE6; border-radius: 4px; padding: 8px 12px; background: #fff; outline: none; min-height: 40px; color: var(--text); }
/* 统一：多行文本框不可拖拽缩放，按字段内容预设行高（避免拉扯后版式错乱） */
textarea.input { resize: none; line-height: 1.7; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,140,240,.14); }
/* 参考图2：占位符用浅灰 */
.input::placeholder, textarea.input::placeholder { color: #C0C4CC; }
/* 选择框：去除原生箭头，使用统一下拉图标（上下居中，右侧留出间距） */
select.input, select.select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%2398a0ad' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 12px; padding-right: 30px; cursor: pointer;
}
select.input::-ms-expand, select.select::-ms-expand { display: none; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text2); margin-bottom: 12px; }
/* 输入框 / 下拉 尺寸工具类：按字段长度选用，避免控件过长 */
.input.xs, .select.xs { width: 88px; }
.input.sm, .select.sm { width: 132px; }
.input.md, .select.md { width: 200px; }
.input.lg, .select.lg { width: 300px; }
.input.xl, .select.xl { width: 440px; }
/* 弹窗 / 筛选内控件上限，防止单行字段拉得过宽 */
.form-grid .input, .form-grid .select { max-width: 460px; }
.filters .input, .filters .select { max-width: 300px; }

.tabs-seg { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs-seg .tab { padding: 9px 16px; font-size: 13.5px; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-seg .tab.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* 表格：浅蓝标题栏 + 仅保留行分隔横线，左右两侧与四周无线条、无阴影（全局列表统一） */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--text); background: transparent; }
table.tbl th, table.tbl td { border-left: none; border-right: none; border-top: none; }
table.tbl th { text-align: left; font-weight: 400; color: var(--text); background: #f0f6ff; padding: 12px 14px;
  border-bottom: 1px solid #e6ecf7; font-size: 13px; white-space: nowrap; }
table.tbl thead { background: #f0f7ff; }
table.tbl td { padding: 12px 14px; border-bottom: 1px solid #f0f0f2; font-size: 14px; line-height: 1.5; vertical-align: middle; }
/* 列表正文单元文字统一字重，不加粗（与同表其它文字一致）；列头 th、表尾 tfoot 不受影响 */
table.tbl tbody td { font-weight: 400; }
table.tbl tbody td b,
table.tbl tbody td strong { font-weight: 400; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: #f6f9ff; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 数字统一字体：所有数字显示（看板统计、金额、表格数字列、发货时间等）与发货时间一致，使用等宽对齐（tabular-nums） */
.num, .mono, .stat .value, .stat.purple .value, .stat.danger .value,
.stat.success .value, .stat.warn .value, table.tbl td.num, table.tbl td.nowrap {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
table.tbl td .cell-sub { display: block; color: var(--text3); font-size: 12px; margin-top: 2px; line-height: 1.4; }
table.tbl td.mono, table.tbl td.nowrap { white-space: nowrap; }

/* 行内操作：查看（蓝）/ 编辑（绿）/ 删除（红）文字链，全局统一，避免按钮样式参差 */
.op { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; cursor: pointer; user-select: none; line-height: 1; padding: 2px 0; transition: opacity .12s; }
.op + .op, .tbl td .op + .op { margin-left: 14px; }
.op:hover { opacity: .8; text-decoration: underline; }
.op.view { color: var(--primary); }
.op.edit { color: var(--success); }
.op.del { color: var(--danger); }
.op.disabled { color: var(--text3); cursor: not-allowed; text-decoration: none; }
/* 表格容器：不带描边、不带圆角外框、不带阴影（对齐参考图 2 的清爽台账样式） */
.tbl-wrap { overflow: auto; border: none; border-radius: 0; background: #fff; max-height: 68vh; box-shadow: none; }
.empty { padding: 46px; text-align: center; color: var(--text3); font-size: 13.5px; }
.link { color: var(--primary); cursor: pointer; }
.muted { color: var(--text3); }
.nowrap { white-space: nowrap; }
/* 编码 / 订单号 / 用户名 / 物流单号等：统一走正文字体 + 等宽数字，避免等宽/衬线字体与中文混排不统一 */
.mono { font-family: inherit; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: .2px; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 11px; border-radius: 6px; font-size: 12px; line-height: 20px; font-weight: 500; }
.tag.gray { background: #f1f3f7; color: var(--text2); }
.tag.blue { background: #e8f0fe; color: #2563eb; }
.tag.green { background: #e6f6ed; color: var(--success); }
.tag.red { background: #fdecec; color: var(--danger); }
.tag.orange { background: #fdf2e0; color: #d98300; }
.tag.purple { background: #f0ecff; color: var(--purple); }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(20,28,48,.5); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.dialog { background: #fff; border-radius: 10px; width: 620px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(20,30,60,.3); }
.dialog.wide { width: 900px; } .dialog.narrow { width: 440px; }
.dialog-head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 700; display: flex; align-items: center; }
.dialog-head .x { margin-left: auto; cursor: pointer; color: var(--text3); display: flex; padding: 2px 6px; border-radius: 6px; }
.dialog-head .x:hover { background: #f1f3f7; color: var(--danger); }
.dialog-body { padding: 18px 20px; overflow: auto; flex: 1; }
.dialog-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
/* 表单排列：字段按控件自身宽度横向紧挨排列，间距统一，不做等分拉伸（全局统一规则） */
.form-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.form-grid .full { flex: 1 1 100%; width: 100%; }
.dialog-tip { font-size: 11.5px; color: var(--text3); margin-top: 10px; text-align: right; font-weight: 300; }
/* 统一注释说明文字：细体 + 小字号，不再加粗 */
.note { font-weight: 300; font-size: 11.5px; color: var(--text3); line-height: 1.8; }

/* ---------- 图表 / 进度 ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 6px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bars .bar { width: 60%; background: linear-gradient(180deg, #7cb0ff, #2d8cf0); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .lb { font-size: 11px; color: var(--text3); }
.progress { height: 8px; background: #eef1f7; border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 6px; }

/* ---------- 提示 ---------- */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; padding: 9px 20px; border-radius: 8px;
  color: #fff; background: #18a058; box-shadow: 0 6px 20px rgba(0,0,0,.18); font-size: 13.5px; }
.toast.err { background: #e54848; }
.alert-box { background: #fff8e8; border: 1px solid #ffe2a8; color: #8a5b00; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-start; }
.alert-box.blue { background: #eef5ff; border-color: #cfe3ff; color: #1a4fa0; }

.timeline { padding-left: 14px; border-left: 2px solid #e8ecf4; }
.timeline .tl-item { position: relative; padding: 0 0 12px 14px; font-size: 13px; }
.timeline .tl-item::before { content: ''; position: absolute; left: -21px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }
.timeline .tl-item .t { color: var(--text3); font-size: 12px; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 10px; font-size: 13px; }
.kv .k { color: var(--text2); }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 6px; border: none; border-radius: 0; padding: 6px 10px; font-size: 12.5px; background: #fafbfd; }
.qr-box { display: flex; gap: 14px; align-items: center; }
.copy-line { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-line .input { flex: 1; font-size: 12.5px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 4px; font-size: 13px; color: var(--text2); }
/* 列表页底部分页条：本页条数 / 总条数 · 每页显示条数 · 第几页 · 翻页 */
.pager.tbl-pager { flex-wrap: wrap; gap: 8px 10px; justify-content: flex-start; align-items: center;
  padding: 12px 4px 4px; margin-top: 2px; border-top: 1px dashed #eef1f7; }
.pager .pg-info b { color: var(--text); font-weight: 600; }
.pager .pg-size, .pager .pg-idx { display: inline-flex; align-items: center; gap: 6px; }
.pager .pg-size .select { width: auto; min-height: 28px; height: 28px; padding: 0 6px; font-size: 12.5px; }
.pager .pg-idx .input { width: 54px; min-height: 28px; height: 28px; padding: 0 4px; text-align: center; font-size: 12.5px; }
.pager .grow { flex: 1 1 auto; }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 筛选条 / 显示项面板 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; background: #fafbfd; border: none; border-radius: 8px; margin-bottom: 12px; }
.filters .input, .filters .select { background: #fff; width: auto; flex: none; min-width: 0; }
.filters .lbl { font-size: 12.5px; color: var(--text2); }
/* 按字段类型分配宽度：关键词最长，状态类最短，日期固定 */
.filters .w-kw { width: 250px; }
.filters .w-l { width: 200px; }
.filters .w-m { width: 160px; }
.filters .w-s { width: 128px; }
.filters .w-xs { width: 96px; }
.filters .w-d { width: 142px; }
.filters .sep { width: 1px; height: 22px; background: var(--border); flex: none; }
.filters .grow { flex: 1; }
.filters .btn { flex: none; }

/* ---------- 图片上传控件（预览 + 删除） ---------- */
.up-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 38px; }
.up-prev { max-height: 72px; max-width: 220px; border-radius: 6px; border: 1px solid var(--border); background: #fff; object-fit: contain; }
.up-prev.circ { border-radius: 50%; width: 56px; height: 56px; max-height: 56px; max-width: 56px; object-fit: cover; }
/* 医生列表圆形头像（与文字高度一致） */
.doc-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; flex: none; }
.doc-avatar.empty { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2d8cf0, #2670cc); color: #fff; font-size: 11px; font-weight: 500; }
.cols-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
.cols-grid .chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 7px 10px; border: none; border-radius: 0; cursor: pointer; background: #f1f3f7; user-select: none; }
.cols-grid .chk:hover { border-color: var(--primary); color: var(--primary); }
.cols-grid .chk input { accent-color: var(--primary); width: 15px; height: 15px; }
.cols-grid .chk input:disabled + span { opacity: .75; }
@media (max-width: 520px) { .cols-grid { grid-template-columns: 1fr; } }

/* ================= 处方笺 / 文书（沿用电子处方管理平台版式） ================= */
.doc-page { width: 794px; aspect-ratio: 210 / 297; background: #fff; margin: 0 auto; padding: 36px 44px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15); color: #000; font-size: 13px; line-height: 1.5; position: relative;
  box-sizing: border-box; font-family: "PingFang SC", "Microsoft YaHei", "SimSun", "Songti SC", serif; }
.doc-page.A5 { width: 559px; font-size: 12px; padding: 26px 32px; }
.doc-page.rx { border: none; }
.doc-head { display: flex; flex-direction: column; align-items: center; border-bottom: 2px solid #333; padding-bottom: 8px; }
.head-top { width: 100%; display: flex; justify-content: flex-start; align-items: center; margin-bottom: 16px; }
.doc-head .h1 { font-size: 22px; font-weight: 700; letter-spacing: 2px; text-align: center; }
.doc-head .h2 { font-size: 14px; margin-top: 4px; letter-spacing: 6px; text-align: center; }
.doc-head .h1-line { position: relative; width: 100%; display: flex; justify-content: center; }
.doc-head .h1-wrap { position: relative; display: inline-block; padding: 2px 0; z-index: 3; }
.doc-head .h1-line .seal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 19%; min-width: 92px; max-width: 168px; height: auto; object-fit: contain; opacity: .9; pointer-events: none; z-index: 2; mix-blend-mode: multiply; }
.head-barcode { display: flex; align-items: center; }
.doc-no-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid #999; }
.doc-no-row .no { font-size: 13px; font-weight: 600; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 18px; padding: 8px 0; border-bottom: 1px solid #999; }
.doc-grid > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-sec { padding: 6px 0; border-bottom: 1px solid #999; }
.doc-sec .lb { color: #444; margin-right: 6px; }
.doc-sec .lb::after { content: '：'; }
table.doc-tbl { width: 100%; border-collapse: collapse; margin-top: 4px; }
table.doc-tbl th, table.doc-tbl td { border: 1px solid #666; padding: 5px 8px; font-size: 12px; text-align: left; vertical-align: middle; }
table.doc-tbl th { background: #f2f2f2; font-weight: 600; text-align: center; }
table.doc-tbl th.c-nowrap, table.doc-tbl td.c-nowrap { white-space: nowrap; }
.doc-page.A5 table.doc-tbl th, .doc-page.A5 table.doc-tbl td { padding: 4px 5px; font-size: 11px; }
.doc-rp { font-size: 16px; font-weight: 700; padding: 8px 0 2px; }
.doc-signs { display: flex; justify-content: space-between; padding: 14px 0 6px; flex-wrap: wrap; gap: 10px; }
.doc-signs .sig { text-align: left; min-width: 130px; display: flex; align-items: flex-end; gap: 4px; }
.doc-signs .sig .sig-empty { display: inline-block; width: 88px; height: 30px; border-bottom: 1px solid #666; }
.doc-signs .sig .sig-img { display: block; max-height: 34px; max-width: 120px; object-fit: contain; margin-top: 2px; }
.doc-signs .sig .sig-stamp { display: block; height: 40px; width: 40px; object-fit: contain; margin-left: 2px; opacity: .9; }
@media print { .doc-signs .sig .sig-img { max-height: 34px; } .doc-signs .sig .sig-stamp { height: 40px; } }
.doc-foot { border-top: 1px solid #999; margin-top: 8px; padding-top: 6px; color: #333; font-size: 11px; display: flex; justify-content: space-between; gap: 12px; }
.rx-doc-scroll { background: #f0f2f6; padding: 16px; border-radius: 10px; overflow: auto; max-height: 66vh; }

/* ================= 打印 ================= */
.print-root { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body { background: #fff !important; height: auto !important; overflow: visible !important; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block !important; position: static !important; width: 100%; background: #fff; }
  .doc-page { width: 100% !important; min-height: 0 !important; height: auto !important; aspect-ratio: auto !important; box-shadow: none !important; margin: 0 !important; background: #fff !important; }
}

/* ================= 响应式 ================= */
@media (max-width: 1100px) {
  .grid.g4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 0px; }
  html { -webkit-text-size-adjust: 100%; }
  .sidebar { position: sticky; top: 0; width: 100% !important; height: auto; display: block; overflow: visible; border-right: none; border-bottom: 1px solid var(--border); z-index: 30; }
  .sidebar.collapsed { width: 100% !important; }
  .sidebar .brand { height: 54px; }
  .sidebar > .brand { padding: 0 14px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav { display: none; padding: 4px 0 10px; border-top: 1px solid var(--border); max-height: calc(100vh - 54px); overflow-y: auto; }
  body.nav-open .nav { display: block; }
  .nav-item { padding: 12px 16px; font-size: 15px; }
  .main, .main.collapsed { margin-left: 0; }
  .topbar { position: static; gap: 8px; }
  .tabbar { position: static; padding: 0 10px; }
  .content { padding: 12px; }
  .login-split { flex-direction: column; height: auto; width: 100%; max-width: 440px; }
  .login-aside { width: auto; height: auto; border-radius: 18px 18px 0 0; }
  .login-card { width: auto; height: auto; max-width: 100%; border-radius: 0 0 18px 18px; }
  .nav-toggle { display: flex; }
}
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .dialog { width: 100%; }
  .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .doc-page, .doc-page.A5 { width: 100%; padding: 14px; }
  .topbar { padding: 0 10px; }
  .user-drop #topUserName { max-width: 74px; }
}

/* ===== OCR 识别区 ===== */
.ocr-box { margin-top: 14px; border: 1px dashed var(--border); border-radius: 10px; padding: 12px; background: #fafbfd; }
.ocr-img { margin: 10px 0; text-align: center; }
.ocr-img img { max-width: 100%; max-height: 240px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
/* ===== 导航自定义 ===== */
.navcfg-list { display: flex; flex-direction: column; gap: 8px; }
.navcfg-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: none; border-radius: 0; background: #fff; }
.navcfg-row .nm { font-weight: 600; min-width: 96px; }
.navcfg-row.child { margin-left: 26px; background: #fafbfd; }
.navcfg-row .grow { flex: 1; }
.navcfg-row input.input { max-width: 220px; }

/* ================= 电子处方 / 电子病历 独立整页 ================= */
/* 紧挨排列：所有表单行（弹窗 form-grid / 处方病历 grid2~4 / clin-row / rx-row）统一为
   「按控件自身宽度排列 + 固定间距」；未指定尺寸类的输入框按内容长度给默认宽度。 */
.form-grid, .grid2, .grid3, .grid4, .clin-row, .rx-row {
  display: flex; flex-wrap: wrap; align-items: flex-start;
}
/* 间距收紧：字段之间保持较小且统一的水平间距（10px），让控件能排得更紧凑 */
.form-grid { gap: 12px 10px; }
.grid2, .grid3, .grid4, .clin-row, .rx-row { gap: 12px 10px; }
.form-grid > .field, .grid2 > .field, .grid3 > .field, .grid4 > .field, .clin-row > .field, .rx-row > .field { flex: none; width: auto; }
.form-grid > .full, .grid2 > .full, .grid3 > .full, .grid4 > .full, .clin-row > .full, .rx-row > .full { flex: 1 1 100%; width: 100%; }
.form-grid > .row-2col { flex: 1 1 100%; width: 100%; }
/* 未带尺寸类（xs/sm/md/lg/xl）的控件给统一的默认宽度，避免出现拉满整行的长横线 */
.form-grid > .field > input.input:not(.xs):not(.sm):not(.md):not(.lg):not(.xl),
.form-grid > .field > select.input:not(.xs):not(.sm):not(.md):not(.lg):not(.xl),
.form-grid > .field > .diag-row input.input:not(.xs):not(.sm):not(.md):not(.lg):not(.xl),
.rx-sec .field > input.input:not(.xs):not(.sm):not(.md):not(.lg):not(.xl),
.rx-sec .field > select.input:not(.xs):not(.sm):not(.md):not(.lg):not(.xl) { width: 200px; }
.form-grid > .field > textarea.input:not(.xs):not(.sm):not(.md):not(.lg):not(.xl),
.rx-sec .field > textarea.input:not(.xs):not(.sm):not(.md):not(.lg):not(.xl) { width: 360px; }
.form-grid > .field.full > textarea.input, .rx-sec .field.full > textarea.input { width: 100%; }
.form-grid > .field.full > input.input, .rx-sec .field.full > input.input { width: 100%; }

/* 表单单元：标签在上、控件在下，行与行之间留出分散间距（修复「上下挤到一起」） */
.rx-sec .field, .up-left .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* 紧凑行：字段按控件自身宽度横向紧挨排列，字段间保持统一间距（不做等分拉伸） */
.rx-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 10px; }
.rx-row > .field { flex: none; width: auto; }
.rx-row > .field.full { flex: 1 1 100%; }
/* 等分行：行内字段平分整行总宽度（用于主诉 / 既往史 / 检查等多文本域）
   注意：上面「默认宽度」规则带了 4 个 :not，特异性更高，这里必须 !important 才能覆盖 */
.rx-row.split > .field { flex: 1 1 0; width: auto; min-width: 0; }
.rx-row.split > .field > .input,
.rx-row.split > .field > select.input,
.rx-row.split > .field > textarea.input { width: 100% !important; max-width: none; }
@media (max-width: 820px) { .rx-row.split > .field { flex: 1 1 100%; } }
.rx-sec .field > label, .up-left .field > label {
  font-size: 13px; color: var(--text2); line-height: 18px; white-space: nowrap; }
/* 同行多个控件时标签基线一致，整体更整齐 */
.rx-sec .grid2, .rx-sec .grid3, .rx-sec .grid4 { align-items: start; }

/* 处方 / 病历分段：同样为白底卡片 + 轻微阴影，段与段之间由浅灰留白分隔 */
.rx-sec { border: none; border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; background: #fff; box-shadow: 0 1px 2px rgba(20,30,60,.04), 0 2px 10px rgba(20,30,60,.03); }
.rx-sec-h { font-size: 13.5px; font-weight: 700; color: var(--text); margin: -2px 0 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rx-sec-h .btn { margin-left: auto; }
.req { color: var(--danger); font-weight: 700; margin-right: 2px; }

/* 诊断 chips + 联想输入 */
.ac-box { position: relative; }
/* 诊断联想输入：加宽到示意图红框长度（约 640px，覆盖 诊断输入+添加 按钮 整组） */
.diag-row { display: flex; gap: 8px; align-items: stretch; max-width: 640px; }
.diag-row .input { flex: 1; min-width: 0; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(20,30,60,.16); max-height: 300px; overflow: auto; max-width: 640px; padding: 0; }
/* 无候选项时彻底隐藏：否则空容器的上下边框会重合成一条多余的横线 */
.ac-list:empty { display: none; }
.ac-item { padding: 10px 18px; font-size: 13.5px; line-height: 1.6; cursor: pointer;
  display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #f0f0f2; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: #f5f8fd; color: var(--primary); }
.ac-item:hover .ac-code { color: var(--primary); }
/* ICD-10 编码：与全局数字同字体（正文字体 + 等宽数字） */
.ac-code { font-size: 12.5px; color: var(--text3); margin-left: auto; flex: none; padding-left: 14px;
  font-family: inherit; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: .2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary);
  border: 1px solid rgba(45,140,240,.25); border-radius: 16px; padding: 4px 10px; font-size: 12.5px; }
.chip-x { cursor: pointer; font-style: normal; font-size: 14px; line-height: 1; opacity: .7; }
.chip-x:hover { opacity: 1; color: var(--danger); }

/* 日期时间组合输入 */
.dt-wrap { display: flex; gap: 8px; align-items: center; }
.dt-wrap .input { flex: 1; min-width: 0; }
.dt-wrap .btn { flex: none; }
/* 日期时间选择：仅保留图标，不再显示日期文本 */
.dt-wrap .btn.dt-icon { width: 36px; min-width: 36px; padding: 0; justify-content: center; }
.dt-wrap .btn.dt-icon .i { width: 14px; height: 14px; }
.dt-wrap input[type=datetime-local].dt-hidden { position: absolute; width: 1px; height: 1px; opacity: 0;
  border: 0; padding: 0; margin: 0; pointer-events: none; }

/* 操作按钮行 */
.row-flex { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
.row-flex .btn { flex: none; }

/* 字典自定义"✎ 自定义"组合控件：默认只看下拉，选中「✎ 自定义」后下方出现输入框 + 添加按钮 */
.dict-wrap { display: flex; flex-direction: column; gap: 6px; }
.dict-custom { display: none; gap: 6px; align-items: center; }
.dict-custom.show { display: flex; }
.dict-custom .input { flex: 1 1 auto; min-width: 56px; height: 28px; padding: 0 8px; font-size: 12.5px; }
.dict-custom .btn { flex: none; height: 28px; padding: 0 10px; font-size: 12.5px; }

/* 主诉 / 病史输入框右上角的「AI辅助」：蓝色纯文字链接（参考图样式，无背景无边框） */
.ai-field { position: relative; }
.ai-field > textarea.input, .ai-field > input.input { padding-right: 72px; }
.ai-tag { position: absolute; top: 8px; right: 10px; z-index: 3; height: auto; min-height: 0;
  padding: 0; border: none; background: none; box-shadow: none; font-size: 12.5px; font-weight: 400;
  line-height: 1.4; color: var(--primary); cursor: pointer; }
.ai-tag:hover { background: none; color: var(--primary); text-decoration: underline; }
.ai-tag.loading { color: var(--text3); cursor: default; text-decoration: none; }
.ai-tag .i { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; vertical-align: -2px; }
/* OCR 识别结果 JSON 预览 */
.rxn-ocr-json { background: #0f1729; color: #cfe3ff; border-radius: 8px; padding: 12px 14px; font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px; line-height: 1.7; overflow: auto; max-height: 260px; white-space: pre-wrap; word-break: break-all; margin-top: 10px; }

/* 上传处方：双栏布局（左图右表） */
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .split2 { grid-template-columns: 1fr; } }
.up-left .field { margin-bottom: 12px; }
.up-actions { margin-top: 14px; }
.up-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ===================== 导航管理（对齐电子处方管理平台 sys-nav） ===================== */
.nav-img-ico { width: 18px; height: 18px; object-fit: contain; display: block; border-radius: 3px; }
.ico-preview { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 9px;
  display: flex; align-items: center; justify-content: center; background: #f7f9fc; flex: none; color: var(--text2); }
.btn.link { border: none; background: none; padding: 0 6px; height: auto; color: var(--primary);
  box-shadow: none; font-size: 13px; }
.btn.link:hover { background: none; text-decoration: underline; color: var(--primary); }
.btn.link.danger { color: var(--danger); }
.btn.link.danger:hover { color: var(--danger); }
.empty-tip { text-align: center; color: var(--text3); padding: 22px 0 !important; }
.req { color: var(--danger); margin-right: 2px; }

/* ===================== 通用增强（医生/药师、水印、排序、序号） ===================== */
.chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.chk input { accent-color: var(--primary); width: 15px; height: 15px; }
.chk-wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 4px 0; }

/* 文书水印层：覆盖整页、平铺、不拦截点击 */
.doc-wm { position: absolute; inset: 0; pointer-events: none; z-index: 5;
  display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around;
  font-weight: 800; letter-spacing: 2px; text-align: center; line-height: 1.5; white-space: nowrap; }
.doc-wm > span { flex: 0 0 33.33%; padding: 12px 0; }

/* 待办面板高亮（顶部铃铛角标点击后定位） */
@keyframes flashBg { 0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); } 30% { box-shadow: 0 0 0 3px rgba(37,99,235,.35); } }
.flash { animation: flashBg 1.4s ease-in-out 2; border-radius: 0; }

/* 列表行内拖拽排序手柄 + 序号列 */
.sortable-ghost { opacity: .45; }
.drag-handle { cursor: ns-move; color: var(--text3); user-select: none; padding: 0 4px; }
.idx-col { width: 56px; text-align: center; color: var(--text3); }

/* 紧凑表单：能一行显示的尽量单行 */
.form-grid.tight { gap: 10px 14px; }
.form-grid.tight .field { min-width: 0; }
/* 表单中需要强制占同一行的两个字段（如：系统名称 + 浏览器标签标题） */
.form-grid .row-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form-grid .row-2col .input, .form-grid .row-2col .select { max-width: none; }
@media (max-width: 720px) { .form-grid .row-2col { grid-template-columns: 1fr; } }

/* 主题色正方形色块 */
.color-sq { width: 36px; height: 36px; padding: 0; border: 1px solid var(--border);
  border-radius: 8px; background: none; cursor: pointer; flex: none; }
.color-sq::-webkit-color-swatch-wrapper { padding: 2px; }
.color-sq::-webkit-color-swatch { border: none; border-radius: 6px; }
.color-sq::-moz-color-swatch { border: none; border-radius: 6px; }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.color-row .input { min-width: 0; }

/* 新建病历：主诉 / 现病史整行加大（左对齐延展至右对齐） */
.mr-chief-block { display: block; }
.mr-chief-block > label { display: block; margin-bottom: 6px; }
textarea.input.mr-chief { width: 100%; min-height: 120px; line-height: 1.8; resize: none; }

/* ================= API 接口（第三方平台对接） ================= */
/* iOS 风格开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cfd6e4; border-radius: 24px; transition: .2s; }
.switch .slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider:before { transform: translateX(20px); }
/* 小号开关：用于表格内的字段级接口开关 */
.switch.sm { width: 34px; height: 18px; }
.switch.sm .slider { border-radius: 18px; }
.switch.sm .slider:before { height: 14px; width: 14px; left: 2px; top: 2px; }
.switch.sm input:checked + .slider:before { transform: translateX(16px); }
/* 分区小标题（弹窗内：基本信息 / 接口文档 / 对外共享） */
.card-title.sm { font-size: 13px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
/* 字段 key 代码小标 */
.fkey { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #f1f3f7; color: var(--text3); font-size: 10.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* 字段映射表：紧凑 */
.map-tbl td { padding: 6px 10px; vertical-align: middle; }
.map-tbl .fname { color: var(--text2); font-size: 12.5px; }
.map-tbl .ftype { color: #aab2c0; font-size: 11px; margin-left: 4px; }
/* 对外共享字段勾选区 */
.exp-wrap { display: flex; flex-wrap: wrap; gap: 14px; }
.exp-group { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; min-width: 240px; flex: 1; }
.exp-g-h { font-weight: 700; font-size: 12.5px; margin-bottom: 8px; color: var(--text2); }
.exp-group .chk { display: inline-flex; width: calc(50% - 6px); margin: 3px 0; }
/* 错误提示（解析失败 / 拉取失败） */
.note.err { color: var(--danger); }
.nowrap { white-space: nowrap; }
.cell-sub { color: var(--text3); font-size: 11px; margin-top: 2px; }
