/* ============ 极客录共享样式（桌面 / H5 / 管理端） ============ */
:root{
  color-scheme:only light;
  --bg:#f2f5fa; --card:#ffffff; --ink:#1b2537; --ink2:#5b6b85; --line:#e4e9f2;
  --brand:#0e7490; --brand2:#0891b2; --accent:#14b8a6; --danger:#e11d48;
  --ok:#059669; --side1:#f7fbfd; --side2:#e8f2f6;
  --radius:14px; --shadow:0 6px 24px rgba(23,43,77,.08);
}
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:"PingFang SC","Microsoft YaHei","Segoe UI",sans-serif;background:var(--bg);color:var(--ink);min-height:100vh;font-size:16px;line-height:1.6}
.app{display:flex;min-height:100vh}

/* ---------- 侧边栏（桌面） ---------- */
.side{width:240px;background:linear-gradient(180deg,var(--side1),var(--side2));color:var(--ink);
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh;flex-shrink:0}
.brand{display:flex;align-items:center;gap:10px;padding:22px 18px 18px}
.brand .logo{width:38px;height:38px;border-radius:11px;background:linear-gradient(135deg,#0891b2,#14b8a6);
  display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(8,145,178,.45)}
.brand .logo svg{width:22px;height:22px}
.brand b{font-size:18px;letter-spacing:1px;color:var(--ink)}
.brand small{display:block;font-size:14px;color:var(--ink2);letter-spacing:2px}
.nav{flex:1;padding:8px 10px;overflow-y:auto}
.nav .group{font-size:14px;color:var(--ink2);letter-spacing:2px;padding:12px 10px 6px}
.nav a{display:flex;align-items:center;gap:10px;padding:9px 12px;margin:2px 0;border-radius:10px;
  color:#355369;font-size:15.5px;cursor:pointer;text-decoration:none;transition:.18s}
.nav a svg{width:17px;height:17px;flex-shrink:0}
.nav a:hover{background:#e7f2f8;color:var(--brand)}
.nav a.on{background:#e0f2f2;color:#09647c;
  box-shadow:inset 3px 0 0 var(--accent)}
.side .foot{padding:14px 18px;font-size:14px;color:var(--ink2);border-top:1px solid var(--line)}
.side .foot a{color:var(--brand);text-decoration:none}
.side .foot a:hover{text-decoration:underline}

/* ---------- 主区 ---------- */
.main{flex:1;min-width:0;padding:26px 32px 60px}
.pagehead{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:20px;gap:12px;flex-wrap:wrap}
.pagehead h1{font-size:24px}
.pagehead p{color:var(--ink2);font-size:15px;margin-top:5px}
.crumb{font-size:14px;color:var(--ink2);margin-bottom:6px}
.crumb b{color:var(--brand);cursor:pointer}

/* 统计卡 */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:26px}
.stat{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px 20px;
  display:flex;align-items:center;gap:14px;border:1px solid var(--line)}
.stat .ico{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;flex-shrink:0}
.stat .ico svg{width:22px;height:22px}
.stat .num{font-size:22px;font-weight:700}
.stat .num em{font-style:normal;font-size:14px;color:var(--ink2);font-weight:400;margin-left:4px}
.stat .lbl{font-size:14.5px;color:var(--ink2);margin-top:2px}

/* 模块九宫格 */
.grid9{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.mod{background:var(--card);border-radius:var(--radius);border:1px solid var(--line);box-shadow:var(--shadow);
  padding:20px;cursor:pointer;transition:.2s;position:relative;overflow:hidden}
.mod:hover{transform:translateY(-3px);box-shadow:0 12px 28px rgba(23,43,77,.13);border-color:#c7d5e8}
.mod .mico{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;margin-bottom:12px}
.mod .mico svg{width:21px;height:21px}
.mod h3{font-size:17px;margin-bottom:5px}
.mod p{font-size:14px;color:var(--ink2);line-height:1.6}
.mod .cnt{position:absolute;top:16px;right:18px;font-size:14px;color:#9db0c8}
.mod .hist{font-size:14px;color:var(--brand2);margin-top:10px;cursor:pointer;text-decoration:none;display:inline-block}
.mod .hist:hover{text-decoration:underline}

/* 表单卡 */
.card{background:var(--card);border-radius:var(--radius);border:1px solid var(--line);box-shadow:var(--shadow);
  padding:26px 28px;margin-bottom:18px}
.card h2{font-size:17px;margin-bottom:16px;display:flex;align-items:center;gap:8px}
.card h2::before{content:"";width:4px;height:16px;border-radius:2px;background:linear-gradient(var(--brand2),var(--accent))}
.frow{display:flex;gap:18px;flex-wrap:wrap;margin-bottom:16px}
.fitem{display:flex;flex-direction:column;gap:7px;min-width:220px;flex:1}
.fitem > label{font-size:14.5px;color:var(--ink2);font-weight:600}
.fitem > label .req{color:var(--danger);margin-left:2px}
.hint{font-size:14px;color:#93a5bd}

input[type=text],input[type=number],input[type=search],select,textarea{
  border:1.5px solid var(--line);border-radius:10px;padding:9px 12px;font-size:16px;color:var(--ink);
  background:#fbfcfe;outline:none;transition:.15s;width:100%;font-family:inherit}
input:focus,select:focus,textarea:focus{border-color:var(--brand2);background:#fff;box-shadow:0 0 0 3px rgba(8,145,178,.12)}
input:disabled{background:#eef1f6;color:#a3b1c6;cursor:not-allowed}
textarea{resize:vertical;min-height:74px;line-height:1.7}
select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237c8ba5' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;padding-right:30px}

/* 单选标签 chips */
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{padding:7px 16px;border-radius:999px;border:1.5px solid var(--line);font-size:15px;color:var(--ink2);
  cursor:pointer;transition:.15s;background:#fbfcfe;user-select:none}
.chip:hover{border-color:var(--brand2);color:var(--brand)}
.chip.on{background:linear-gradient(135deg,var(--brand2),var(--accent));border-color:transparent;color:#fff;
  font-weight:600;box-shadow:0 3px 10px rgba(8,145,178,.3)}
.chip .x{margin-left:6px;font-weight:700;opacity:.7}
.chip .x:hover{opacity:1}

/* 语音/OCR 小按钮 */
.mini{display:inline-flex;align-items:center;gap:4px;font-size:14px;color:var(--brand2);
  border:1px dashed #9ad4e0;border-radius:8px;padding:3px 9px;cursor:pointer;background:#f0fbfd}
.mini:hover{background:#e0f6fa}
.mini svg{width:13px;height:13px}

/* 上传区 */
.upzone{border:1.5px dashed #c2d2e4;border-radius:12px;background:#f8fafd;padding:18px;
  text-align:center;color:var(--ink2);font-size:14.5px;cursor:pointer;transition:.15s;flex:1}
.upzone:hover{border-color:var(--brand2);background:#f0fbfd;color:var(--brand)}
.upzone svg{width:20px;height:20px}
.upzone input{display:none}
.uplist{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.upfile{display:flex;align-items:center;gap:6px;background:#eef7fb;border:1px solid #cfe7f2;color:#0b6480;
  border-radius:8px;padding:5px 10px;font-size:14px}
.upfile span{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upfile .x{cursor:pointer;color:#8aa7ba;font-weight:700}
.upfile .x:hover{color:var(--danger)}
.seg{display:flex;background:#edf1f7;border-radius:10px;padding:3px;width:fit-content;margin-bottom:2px}
.seg div{padding:6px 18px;border-radius:8px;font-size:15px;cursor:pointer;color:var(--ink2)}
.seg div.on{background:#fff;color:var(--brand);font-weight:600;box-shadow:0 2px 6px rgba(23,43,77,.12)}

/* 明细列表 */
.dlist{border:1.5px solid var(--line);border-radius:12px;overflow:hidden}
.drow{display:flex;align-items:center;gap:14px;padding:11px 16px;border-bottom:1px solid var(--line);
  background:#fbfcfe;font-size:15.5px}
.drow:last-child{border-bottom:none}
.drow .tag{background:linear-gradient(135deg,var(--brand2),var(--accent));color:#fff;border-radius:7px;
  font-size:14px;padding:3px 8px;font-weight:600}
.drow .pname{font-weight:600;min-width:80px}
.drow .pv{color:var(--ink2)}
.exercise-detail-params{display:flex;flex:1 1 230px;flex-wrap:wrap;align-items:center;gap:8px 14px;min-width:0}
.exercise-detail-param{display:inline-flex;align-items:center;gap:6px;color:var(--ink2);white-space:nowrap;font-size:14px}
.exercise-detail-param input[type=number]{width:80px;min-width:0;min-height:32px;padding:5px 7px;border:1px solid var(--line);border-radius:7px;background:#fff;font:inherit;color:var(--ink)}
.exercise-param-unit{font-size:13px;color:var(--muted)}
.medical-panel{width:100%;max-width:650px;margin:0 auto;padding:20px 26px!important}
.medical-panel h1{font-size:24px;text-align:center;margin:0 0 16px}
.medical-panel .module-storage-stats{margin-bottom:20px}
.medical-field{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:10px;margin:14px 0}
.medical-field input,.medical-panel textarea{width:100%;min-width:0}
.medical-image-label,.medical-note-label{display:flex;align-items:center;justify-content:space-between;margin:12px 0 6px}
.medical-image-label{justify-content:flex-start;gap:8px}
.medical-panel .medical-image-label .btn,.medical-panel .medical-note-label .btn{padding:5px 9px;display:inline-flex;align-items:center}
.medical-panel .upzone,.medical-panel .upzone:hover{border:1px dashed #b5cbd6!important;border-radius:10px;background:#f8fbfd!important;min-height:92px;padding:10px!important;justify-content:center}
.medical-panel .upzone:not(.has-files)>svg{display:none}
.medical-panel .upload-prompt{font-size:30px}
.medical-panel .upzone.has-files .upload-prompt{display:none}
.medical-panel textarea{min-height:76px;resize:vertical}
.medical-actions{display:flex;gap:10px;margin-top:14px}.medical-actions .btn:last-child{margin-left:auto}
#medicalResult{font-size:14px;color:#0e8c73;margin-top:10px}
#medicalLatest:not([hidden]){display:flex;flex-wrap:wrap;align-items:center;gap:7px 12px;font-size:14px;margin-top:10px;border-top:1px solid var(--line);padding-top:10px}
#medicalLatest time{color:var(--ink2)}
@media(max-width:640px){.medical-panel{padding:16px!important}.medical-field{grid-template-columns:66px minmax(0,1fr);gap:8px}.medical-actions .btn{padding:9px 15px}.medical-panel h1{font-size:22px}}
.new-item-param[data-param-module]{display:grid;grid-template-columns:minmax(0,1fr) 64px 50px 28px;gap:5px;align-items:center}
.new-item-param[data-param-module] input,.new-item-param[data-param-module] select{width:100%;min-width:0;padding:6px 4px;font-size:13px}
.new-item-param[data-param-module] .btn{padding:5px 3px;min-width:0}
.drow .ops{margin-left:auto;display:flex;gap:12px;font-size:14px}
.drow .ops a{cursor:pointer;color:var(--brand2)}
.drow .ops a.del{color:#c0566f}
.dempty{padding:26px;text-align:center;color:#9db0c8;font-size:14.5px}

/* 按钮 */
.btns{display:flex;gap:12px;margin-top:8px;align-items:center;flex-wrap:wrap}
.btn{border:none;border-radius:10px;padding:10px 26px;font-size:15.5px;cursor:pointer;transition:.18s;font-family:inherit}
.btn.pri{background:linear-gradient(135deg,var(--brand2),var(--accent));color:#fff;font-weight:600;
  box-shadow:0 5px 14px rgba(8,145,178,.32)}
.btn.pri:hover{filter:brightness(1.07);transform:translateY(-1px)}
.btn.ghost{background:#fff;border:1.5px solid var(--line);color:var(--ink2)}
.btn.ghost:hover{border-color:var(--brand2);color:var(--brand)}
.btn.link{background:none;color:var(--brand2);padding:10px 8px}
.btn.link:hover{text-decoration:underline}
.btn.sm{padding:6px 14px;font-size:14.5px;border-radius:8px}
.btn.sm.danger{background:#fff1f4;color:var(--danger);border:1px solid #f8c9d4}
.btn.sm.danger:hover{background:#ffe4ea}

/* 历史记录 */
.toolbar{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-bottom:16px}
.toolbar .search{position:relative;flex:1;min-width:220px}
.toolbar .search svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);width:15px;height:15px;color:#9db0c8}
.toolbar .search input{padding-left:34px}
.toolbar select{width:auto;min-width:130px}
.rlist{display:flex;flex-direction:column;gap:12px}
.rrow{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:16px 20px;display:flex;gap:14px;align-items:flex-start;transition:.18s}
.rrow:hover{border-color:#c7d5e8}
.rrow .rdate{width:86px;flex-shrink:0;text-align:center;padding-top:2px}
.rrow .rdate b{display:block;font-size:17px;color:var(--brand)}
.rrow .rdate span{font-size:14px;color:#9db0c8}
.rrow .rbody{flex:1;min-width:0}
.rrow .rt{font-size:16px;font-weight:600;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rrow .rt .pill{font-size:14px;font-weight:600;color:#0b6480;background:#e0f4fa;border-radius:999px;padding:2px 9px}
.rrow .rt .pill.gray{color:#5b6b85;background:#eef1f6}
.rrow .rdesc{font-size:14.5px;color:var(--ink2);margin-top:5px;line-height:1.7;display:-webkit-box;
  -webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.rrow .rops{display:flex;gap:8px;flex-shrink:0}
.rempty{background:var(--card);border:1px dashed #c2d2e4;border-radius:var(--radius);padding:48px;
  text-align:center;color:#9db0c8;font-size:15px}
.rempty .btn{margin-top:14px}

/* 弹窗 */
.mask{position:fixed;inset:0;background:rgba(15,28,48,.45);backdrop-filter:blur(3px);display:none;
  align-items:center;justify-content:center;z-index:50}
.mask.show{display:flex}
.modal{background:#fff;border-radius:16px;width:480px;max-width:92vw;max-height:82vh;overflow:auto;
  padding:24px 26px;box-shadow:0 24px 60px rgba(10,25,50,.35)}
.modal h3{font-size:17px;margin-bottom:16px}
.ilib{display:flex;flex-direction:column;gap:8px;max-height:280px;overflow:auto;margin-bottom:14px}
.irow{display:flex;align-items:center;gap:10px;border:1.5px solid var(--line);border-radius:11px;
  padding:10px 14px;cursor:pointer;transition:.15s}
.irow:hover{border-color:var(--brand2)}
.irow.on{border-color:var(--brand2);background:#f0fbfd;box-shadow:0 0 0 3px rgba(8,145,178,.12)}
.irow .ava{width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,#dbeafe,#ccfbf1);
  display:flex;align-items:center;justify-content:center;color:var(--brand);font-weight:700;font-size:16px}
.irow b{font-size:15.5px}
.irow small{display:block;color:var(--ink2);font-size:14px;margin-top:1px}
.kv{display:grid;grid-template-columns:88px 1fr;gap:9px 12px;font-size:15px;margin-bottom:16px}
.kv .k{color:#93a5bd}
.kv .v{color:var(--ink);line-height:1.6;word-break:break-all}

/* toast */
#toast{position:fixed;top:26px;left:50%;transform:translateX(-50%) translateY(-80px);z-index:99;
  padding:11px 26px;border-radius:12px;color:#fff;font-size:15.5px;transition:.3s;box-shadow:0 10px 30px rgba(10,25,50,.3)}
#toast.ok{background:linear-gradient(135deg,#059669,#10b981)}
#toast.err{background:linear-gradient(135deg,#e11d48,#f43f5e)}
#toast.show{transform:translateX(-50%) translateY(0)}

svg.ic{width:1.2em;height:1.2em;flex-shrink:0;vertical-align:middle;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ============================================================
   管理端
============================================================ */
.admtop{position:sticky;top:0;z-index:20;background:linear-gradient(90deg,var(--side1),var(--side2));
  color:var(--ink);display:flex;align-items:center;gap:14px;padding:14px 28px}
.admtop .logo{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,#0891b2,#14b8a6);
  display:flex;align-items:center;justify-content:center}
.admtop .logo svg{width:18px;height:18px}
.admtop b{font-size:17px;letter-spacing:1px}
.admtop small{color:var(--ink2);font-size:14px}
.admtop .conn{margin-left:auto;font-size:14px;color:#355369}
.admtop .conn a{color:var(--brand);text-decoration:none;margin-left:14px}
.admtop .conn a:hover{text-decoration:underline}
.admtabs{display:flex;gap:4px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:4px;
  width:fit-content;margin:20px 0 18px;box-shadow:var(--shadow)}
.admtabs div{padding:8px 18px;border-radius:9px;font-size:15.5px;cursor:pointer;color:var(--ink2);transition:.15s}
.admtabs div:hover{color:var(--brand)}
.admtabs div.on{background:linear-gradient(135deg,var(--brand2),var(--accent));color:#fff;font-weight:600;
  box-shadow:0 3px 10px rgba(8,145,178,.3)}
.tbl{width:100%;border-collapse:collapse;font-size:15px;background:#fff;border-radius:12px;overflow:hidden;
  box-shadow:var(--shadow);border:1px solid var(--line)}
.tbl th{text-align:left;padding:10px 14px;background:#f4f7fb;color:#5b6b85;font-size:14px;font-weight:600}
.tbl td{padding:10px 14px;border-top:1px solid var(--line);vertical-align:top}
.tbl tr:hover td{background:#fafcff}
.badge{display:inline-block;font-size:14px;font-weight:600;border-radius:999px;padding:2px 9px}
.badge.on{color:#047857;background:#d1fae5}
.badge.off{color:#9f1239;background:#ffe4ea}
.badge.gray{color:#5b6b85;background:#eef1f6}
.paramtag{display:inline-block;background:#f0fbfd;border:1px solid #cfe7f2;color:#0b6480;border-radius:6px;
  padding:1px 7px;font-size:14px;margin:2px 4px 2px 0}
.admgrid{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start}
.dictwrap{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.dictwrap .chip{display:inline-flex;align-items:center}

@media (max-width:640px){
  .side{display:none}
  .main{padding:18px 14px 60px}
  .grid9{grid-template-columns:1fr 1fr}
  .stats{grid-template-columns:1fr 1fr}
}

/* ---------- 语音识别中状态 ---------- */
.voice-btn.rec{ color:#e11d48; font-weight:600; animation:voicePulse 1s ease-in-out infinite; }
@keyframes voicePulse{ 50%{ opacity:.45; } }

/* 品牌标识：桌面、管理端与移动端共用矢量资源 */
.brand .logo,.admtop .logo{background:transparent;overflow:hidden;flex-shrink:0;box-shadow:0 3px 12px rgba(8,145,178,.2)}
.brand .logo{width:44px;height:44px;border-radius:11px}
.admtop .logo{width:38px;height:38px;border-radius:9px}
.logo img{display:block;width:100%;height:100%;object-fit:contain}
.h5brand{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
.h5brand img{display:block;border-radius:8px}

/* 字体放大后的布局适配 */
input,select,textarea,button{line-height:1.5}
input[type=datetime-local]{font:inherit;min-width:0;max-width:100%;padding:9px 12px;border:1.5px solid var(--line);border-radius:10px;background:#fbfcfe;color:var(--ink)}
.fitem{min-width:min(220px,100%)}
.stat{min-width:0;flex-wrap:wrap}
.mod{min-width:0}
.mod p,.hint,.upzone{overflow-wrap:anywhere}
.rrow .rdate{width:100px}
.drow{flex-wrap:wrap}
.hint{line-height:1.65;color:#71849e}
.admtabs{max-width:100%;flex-wrap:wrap}
@media (min-width:641px) and (max-width:1100px){
  .grid9{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .main{padding-left:24px;padding-right:24px}
}
@media (max-width:640px){
  .h5top{gap:12px;flex-wrap:wrap}
  .h5main .stat .num em{display:block;margin-left:0}
  .rrow{flex-wrap:wrap}
  .rrow .rops{width:100%;flex-direction:row}
  .admtop{flex-wrap:wrap;padding:14px 18px}
  .admtop .conn{width:100%;margin-left:0}
  .admgrid{grid-template-columns:minmax(0,1fr)}
}

/* 登录与账号状态 */
.account-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:14px}
.logout-link{border:0;background:transparent;color:inherit;font:inherit;text-decoration:underline;text-underline-offset:4px;cursor:pointer;padding:3px 0}
.account-bar .logout-link{color:#8fd4e2}
.h5-account{display:flex;justify-content:space-between;align-items:center;padding:10px 18px;background:#e5f1f5;color:#0e7490;font-size:14px}

.side .foot .account-bar{margin-bottom:0;justify-content:space-between}
.side .foot #accountName{font-size:16px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}

/* 九类录入页：模块标题、内容卡片与辅助说明 */
.entry-page{max-width:1320px;margin:0 auto}
.entry-page .crumb{font-size:14px;margin-bottom:22px;display:flex;gap:9px;align-items:center}
.entry-page .crumb>span{color:#b6c1d0}
.entry-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}
.entry-heading{display:flex;align-items:center;gap:18px;min-width:0}
.entry-module-icon{width:64px;height:64px;border-radius:19px;display:grid;place-items:center;flex-shrink:0;background:var(--module-color);color:#fff;box-shadow:0 7px 20px color-mix(in srgb,var(--module-color) 22%,transparent)}
.entry-module-icon svg{width:30px;height:30px}
.entry-overline{font-size:13px;font-weight:600;letter-spacing:1px;color:var(--module-color);margin-bottom:3px}
.entry-heading h1{font-size:27px;line-height:1.4;letter-spacing:.5px}
.entry-heading p{font-size:15px;color:var(--ink2);margin-top:5px}
.entry-history{display:flex;align-items:center;gap:7px;white-space:nowrap;padding:10px 16px;font-size:15px;box-shadow:0 2px 5px #142f4b04}
.entry-history svg{width:18px;height:18px}
.entry-layout{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:24px;align-items:start}
.entry-form{min-width:0}
.entry-page .entry-card{padding:28px 30px;margin:0;border-radius:18px;border-color:#e3eaf1;box-shadow:0 4px 22px #1a395008}
.entry-card h2{font-size:18px;gap:10px;padding-bottom:19px;margin-bottom:24px;border-bottom:1px solid #edf1f6}
.entry-card h2::before{height:19px;background:var(--module-color);border-radius:5px}
.entry-page .frow{gap:20px;margin-bottom:24px}
.entry-page .fitem{gap:9px;min-width:min(230px,100%)}
.entry-page .fitem>label{color:#33465e;font-size:15px;font-weight:600;line-height:1.7}
.entry-page label>.hint{font-size:13px;font-weight:400;color:#75869c;margin-left:5px}
.entry-page .hint{font-size:13px;line-height:1.7}
.entry-page input,.entry-page select,.entry-page textarea{border-width:1px;border-color:#dce5ee;background:#f8fafc;border-radius:10px;font-size:16px;padding:11px 14px;min-height:46px}
.entry-page select{padding-right:32px}
.entry-page textarea{min-height:108px;line-height:1.85;resize:vertical}
.entry-page input:focus,.entry-page select:focus,.entry-page textarea:focus{background:#fff;border-color:var(--module-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--module-color) 9%,transparent)}
.entry-page input:disabled{background:#eff3f7;color:#95a2b4}
.entry-page .entry-card>.fitem{margin-top:24px}
.entry-page .entry-notes{padding-top:22px;border-top:1px solid #edf1f6}
.entry-page .entry-notes>div{margin-top:1px}
.entry-page .mini{font-size:13px;min-height:30px;background:#f1f8fb;border:1px solid #dcecf2;border-radius:7px;padding:4px 9px}
.entry-page .chip{font-size:15px;padding:8px 20px;background:#fff;border-width:1px}
.entry-page .chip.on{background:color-mix(in srgb,var(--module-color) 9%,white);color:var(--module-color);border-color:color-mix(in srgb,var(--module-color) 45%,white);box-shadow:0 2px 8px #1a395008}
.entry-page .seg{padding:4px;border:1px solid #e3eaf2;background:#f0f4f8;min-height:46px}
.entry-page .seg div{font-size:15px;padding:7px 20px}
.entry-page .seg div.on{color:var(--module-color)}
.entry-page .dlist{border:1px solid #dce6ef;background:#f8fafc;border-radius:12px}
.entry-page .dempty{padding:32px 22px;color:#71869c;font-size:14px;line-height:1.9;background:radial-gradient(ellipse at center,#eef5fa,transparent)}
.entry-page .drow{padding:15px 18px;background:#fff;gap:12px;font-size:15px}
.entry-page .drow .tag{color:var(--module-color);background:color-mix(in srgb,var(--module-color) 8%,white);font-size:12px}
.entry-page .upzone{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:142px;border:1.5px dashed #c4d5e3;background:linear-gradient(135deg,#f8fbfd,#f2f7fa);font-size:14px;line-height:1.8;border-radius:12px;transition:border-color .2s,background .2s}
.entry-page .upzone svg{width:28px;height:28px;box-sizing:content-box;padding:10px;border-radius:13px;background:#fff;box-shadow:0 2px 10px #19394f0a;color:var(--module-color)}
.entry-page .upzone:hover{border-color:var(--module-color);background:#eff8fa}
.entry-page .btns{gap:10px}
.entry-page .btn.sm{font-size:14px;padding:8px 13px}
.entry-page .btn.ghost{border-width:1px}
.entry-page .btn.link{font-size:14px}
.entry-page .btn:disabled{opacity:.45;cursor:not-allowed;transform:none}
.entry-actions{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 4px 0}
.entry-required{display:flex;gap:5px;align-items:center;font-size:13px;color:#7b8da2}
.entry-required i{width:5px;height:5px;border-radius:50%;background:#a7b8ca;margin-right:3px}
.entry-required .req{color:#dc4770}
.entry-actions .btns{margin:0;flex-shrink:0}
.entry-actions .btn{font-size:15px;min-height:45px;padding:10px 21px}
.entry-actions .btn.pri{display:flex;align-items:center;gap:7px;background:var(--module-color);box-shadow:0 5px 14px color-mix(in srgb,var(--module-color) 20%,transparent)}
.entry-actions .btn svg{width:19px;height:19px}
.entry-guide{position:sticky;top:26px;padding:22px;background:linear-gradient(145deg,#fff,#f8fbfd);border:1px solid #e2eaf2;border-radius:16px}
.entry-guide-title{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#3e536a;margin-bottom:24px}
.entry-guide-title svg{width:19px;height:19px;color:var(--module-color)}
.entry-guide ol{counter-reset:entry-tip;list-style:none}
.entry-guide li{position:relative;padding:0 0 24px 30px;counter-increment:entry-tip}
.entry-guide li::before{content:counter(entry-tip);position:absolute;left:0;top:1px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:#eaf0f5;color:#688299;font-size:12px;font-weight:600}
.entry-guide li:not(:last-child)::after{content:"";position:absolute;left:10px;top:25px;bottom:6px;border-left:1px solid #e1e9f0}
.entry-guide li b{font-size:14px;font-weight:600;color:#425a70}
.entry-guide li p{font-size:13px;color:#71859b;line-height:1.9;margin-top:5px}
.entry-guide-note{border-top:1px solid #e4ecf3;padding-top:17px;font-size:13px;line-height:1.9;color:#8b9bad}
@media(min-width:641px) and (max-width:1150px){.entry-layout{grid-template-columns:minmax(0,1fr)}.entry-guide{display:none}}
@media(max-width:640px){
 .entry-page .crumb{font-size:13px;margin-bottom:18px;gap:6px}.entry-header{align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:20px}.entry-heading{gap:12px}.entry-module-icon{width:48px;height:48px;border-radius:14px}.entry-module-icon svg{width:25px;height:25px}.entry-heading h1{font-size:23px}.entry-heading p{font-size:14px}.entry-overline{font-size:12px}.entry-history{padding:7px 11px;font-size:14px;margin-left:60px}
 .entry-layout{grid-template-columns:minmax(0,1fr);gap:16px}.entry-guide{display:none}.entry-page .entry-card{padding:22px 18px;border-radius:15px}.entry-card h2{padding-bottom:15px;margin-bottom:20px;font-size:17px}.entry-page .frow{gap:18px;margin-bottom:20px}.entry-page .fitem{min-width:100%}.entry-page label>.hint{display:block;margin-left:0;margin-top:3px}.entry-page .chip{padding:7px 16px}.entry-page .dempty{padding:25px 15px}.entry-page .upzone{min-height:132px}.entry-page .entry-notes{padding-top:20px}.entry-actions{flex-wrap:wrap;padding:17px 0 4px;gap:13px}.entry-actions .btns{width:100%;justify-content:flex-end}.entry-actions .btn.pri{flex:1;justify-content:center}.entry-required{font-size:13px}
}

/* 侧栏账号：平时仅呈现用户名，悬浮或键盘聚焦后显示退出操作 */
.side .account-footer{padding:14px 16px 18px;border-top:1px solid var(--line)}
.sidebar-account{position:relative;width:100%}
.account-trigger{display:block;width:100%;border:1px solid transparent;border-radius:10px;background:transparent;text-align:left;padding:11px 12px;color:var(--ink);font:inherit;cursor:pointer;transition:background .18s,border-color .18s}
.side .account-trigger #accountName{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;font-weight:600;letter-spacing:.3px}
.sidebar-account:hover .account-trigger,.sidebar-account:focus-within .account-trigger{background:#fff;border-color:var(--line)}
.account-trigger:focus-visible,.account-signout:focus-visible{outline:2px solid var(--brand2);outline-offset:3px}
.account-popover{position:absolute;left:0;right:0;bottom:100%;padding:0 0 8px;visibility:hidden;opacity:0;transform:translateY(5px);pointer-events:none;transition:opacity .16s,transform .16s,visibility .16s;z-index:40}
.sidebar-account:hover .account-popover,.sidebar-account:focus-within .account-popover{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto}
.account-signout{display:flex;align-items:center;gap:10px;width:100%;padding:13px 15px;border:1px solid var(--line);border-radius:11px;box-shadow:var(--shadow);background:#fff;color:#355369;font:inherit;font-size:14px;cursor:pointer;text-align:left;transition:background .15s,color .15s}
.account-signout svg{width:18px;height:18px;color:var(--brand)}
.account-signout:hover{background:#e7f2f8;color:var(--brand)}
@media(prefers-reduced-motion:reduce){.account-popover,.account-trigger,.account-signout{transition:none}}

/* 上传框内直接回显选中文件及上传状态 */
.upload-prompt{display:block;margin-top:6px}
.upload-feedback{display:flex;flex-direction:column;gap:5px;max-width:100%;min-width:0}
.upload-feedback:empty{display:none}
.upload-selected-name{display:block;font-size:15px;font-weight:600;line-height:1.7;overflow-wrap:anywhere;color:#24566d}
.upload-selected-status{font-size:13px;line-height:1.8;color:#548272;font-weight:400}
.entry-page .upzone.has-files{border-style:solid;border-color:#b5dacd;background:#f2faf7;gap:8px}
.upzone.has-files .upload-prompt{display:none}
.entry-page .upzone.uploading{border-style:dashed;border-color:#7ebed8;background:#f2f8fc;cursor:wait}
.upzone.uploading .upload-selected-status{color:#307a9c}
.entry-page .upzone.upload-failed{border-color:#efb8bf;background:#fff7f8}
.upzone.upload-failed .upload-selected-status{color:#b34458}
.upzone:focus-visible{outline:2px solid #0e7490;outline-offset:4px}

/* 文件选择按钮与框内文件卡片 */
.entry-page .seg button{border:0;background:transparent;padding:7px 20px;border-radius:8px;font:inherit;font-size:15px;color:var(--ink2);cursor:pointer}
.entry-page .seg button.on{background:#fff;color:var(--module-color);font-weight:600;box-shadow:0 2px 6px #172b4d14}
.entry-page .seg button:focus-visible{outline:2px solid var(--module-color);outline-offset:2px}
.entry-page .upzone.has-files{border-style:dashed}
.upload-feedback{width:100%;gap:10px}
.upload-file-row{display:flex;align-items:center;gap:12px;width:100%;padding:12px;border:1px solid #dce9e7;border-radius:10px;background:#ffffffd9;text-align:left;min-width:0}
.upload-file-info{flex:1;min-width:0}
.upload-file-size{display:block;font-size:13px;font-weight:400;color:#75899c;margin-top:2px}
.upload-file-icon{display:grid;place-items:center;width:40px;height:44px;flex-shrink:0;background:#edf5f8;border-radius:8px}
.entry-page .upzone .upload-file-icon svg{width:22px;height:22px;padding:0;box-shadow:none;background:none;border-radius:0}
.upload-thumbnail{width:56px;height:56px;object-fit:cover;border-radius:8px;flex-shrink:0;border:1px solid #e1e9ef}
.upload-remove{border:0;background:#f3f6f9;border-radius:7px;padding:6px 10px;font:inherit;font-size:13px;color:#627a8e;cursor:pointer;flex-shrink:0}
.upload-remove:hover{color:#bd3658;background:#fff0f3}
.uplist[hidden]{display:none}

/* 历史记录详情与批次读数 */
.rrow .rops .btn{display:inline-flex;align-items:center;justify-content:center;gap:5px}
.rrow .rops svg{width:16px;height:16px}
.modal.device-detail{width:900px;max-width:94vw}
.detail-files{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0 22px}
.detail-file{display:flex;align-items:center;gap:10px;padding:11px 14px;border:1px solid #dce8f1;background:#f7fafc;border-radius:10px;color:#176580;text-decoration:none;max-width:100%;overflow-wrap:anywhere;font-size:14px}
.detail-file svg{width:23px;height:23px;flex-shrink:0}.detail-file small{display:block;font-size:12px;color:#7a8ea1;margin-top:2px}
.detail-readings-title{font-size:17px;font-weight:600;margin:18px 0 12px}.detail-readings-title span{font-size:13px;font-weight:400;color:#71859b;margin-left:8px}
.readings-scroll{overflow:auto;max-height:360px;border:1px solid #e1e9f1;border-radius:10px}
.readings-table{width:100%;border-collapse:collapse;font-size:14px;text-align:left}
.readings-table th{position:sticky;top:0;background:#f0f5f9;color:#597086;font-weight:600}.readings-table th,.readings-table td{padding:10px 12px;border-bottom:1px solid #e8eef4;white-space:nowrap}
.readings-table td:last-child{white-space:normal;min-width:120px}.readings-table tr:last-child td{border-bottom:0}
.readings-pager{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px;font-size:13px;color:#6f8295}.readings-pager .btn:disabled{opacity:.4;cursor:default}
.detail-actions{justify-content:flex-end;margin-top:23px;padding-top:18px;border-top:1px solid #e5ecf3}
@media(max-width:640px){body.h5 .modal.device-detail{max-width:480px;width:100%;max-height:90vh}.rrow .rops .btn{flex:1}.readings-pager{gap:5px;font-size:12px}.readings-pager .btn{padding:6px 8px}}

.home-simple .backup-button{display:flex;align-items:center;gap:8px;font-size:15px}.backup-button svg{width:19px;height:19px}.backup-button:disabled{opacity:.6;cursor:wait}
.inline-item-create{margin:18px 0;padding:14px;border:1px solid #dce8ee;border-radius:10px;background:#f7fbfc}.inline-item-create summary{color:#0e7490;cursor:pointer;font-size:15px;font-weight:600}.inline-item-create .fitem{min-width:0;gap:7px;margin:13px 0}.inline-item-create>label{display:block;margin-top:12px;font-size:14px}.inline-item-create>.btn{margin-top:12px}.new-item-param{display:flex;gap:8px;margin:10px 0}.new-item-param input{min-width:0;flex:1}.new-item-param input:nth-child(2){max-width:100px}
.h5-module-select{display:flex;gap:12px;align-items:center;padding:12px 18px;background:#fff;border-bottom:1px solid #e1e9f0;font-size:14px;color:#597086}.h5-module-select select{flex:1;min-width:0}

/* 紧凑布局：收拢留白，优先在常用笔记本屏幕完成录入 */
.main{padding:18px 24px 24px}
.side{width:216px}
.brand{padding:18px 16px 14px;gap:10px}
.nav{padding:4px 9px}
.nav a{padding:7px 11px;gap:9px}
.nav .group{padding-top:10px;padding-bottom:4px;letter-spacing:1px}
.side .account-footer{padding:9px 13px 12px}
.pagehead{margin-bottom:14px}.pagehead h1{font-size:24px}.pagehead p{margin-top:3px;font-size:14px}
.stats{gap:12px;margin-bottom:16px}.stat{padding:14px 17px;gap:12px}.stat .ico{width:40px;height:40px}.stat .num{font-size:22px}
.entry-page .crumb{margin-bottom:10px;font-size:13px}
.entry-header{margin-bottom:15px;gap:14px}.entry-heading{gap:12px}.entry-module-icon{width:48px;height:48px;border-radius:14px}.entry-module-icon svg{width:25px;height:25px}
.entry-heading h1{font-size:24px;line-height:1.35}.entry-overline{font-size:12px;margin-bottom:0}.entry-heading p{font-size:14px;margin-top:2px}.entry-history{padding:8px 13px}
.entry-layout{grid-template-columns:minmax(0,1fr);gap:0}.entry-guide{display:none}
.entry-page .entry-card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 20px;padding:18px 22px;border-radius:14px}
.entry-card h2{grid-column:1/-1;font-size:17px;padding-bottom:10px;margin:0;border-bottom:1px solid #edf1f6}
.entry-page .entry-card>.frow,.entry-page .entry-card>.btns,.entry-page .entry-card>.uplist{grid-column:1/-1;margin:0!important}
.entry-page .frow{gap:14px;margin-bottom:0}
.entry-page .fitem{min-width:0;gap:5px}
.entry-page .fitem>label{font-size:15px;line-height:1.65}
.entry-page .entry-card>.fitem{margin-top:0;min-width:0!important;align-self:start}
.entry-page .entry-card>.entry-notes{padding:0 0 0 20px;border-top:0;border-left:1px solid #edf1f6;min-width:0!important}
.entry-page .entry-card>.entry-notes:only-of-type{grid-column:1/-1;border-left:0;padding-left:0}
.entry-page input,.entry-page select,.entry-page textarea{min-height:40px;padding:8px 12px;font-size:16px}
.entry-page select{padding-right:30px}
.entry-page textarea{min-height:76px;line-height:1.65}
.entry-page #d_content{min-height:96px!important}
.entry-page .hint,.entry-page label>.hint{font-size:13px;line-height:1.55}
.entry-page .chip{padding:5px 16px;font-size:15px}.entry-page .chips{gap:7px}
.entry-page .seg{min-height:40px;padding:3px}.entry-page .seg button{padding:5px 16px}
.entry-page .dempty{padding:18px;font-size:14px;line-height:1.7}.entry-page .drow{padding:9px 13px}
.entry-page .entry-card .dlist{max-height:155px;overflow:auto}
.entry-page .entry-card .upzone{min-height:88px;padding:12px;gap:5px;flex-direction:row;flex-wrap:wrap}
.entry-page .upzone>svg{width:23px;height:23px;padding:7px;border-radius:10px;flex-shrink:0}.entry-page .upload-prompt{margin:0 0 0 6px}
.entry-page .upzone.has-files>svg{display:none}
.entry-page .upload-feedback{gap:6px;max-height:170px;overflow:auto}
.entry-page .upload-file-row{padding:7px 10px;gap:9px}.entry-page .upload-thumbnail{width:42px;height:42px}.entry-page .upload-file-icon{width:32px;height:36px}.entry-page .upload-selected-status{font-size:13px;line-height:1.5}
.entry-page .btn.sm{padding:6px 12px;font-size:14px}.entry-page .btn.link{padding:6px 8px}
.entry-page .mini{min-height:27px;padding:3px 8px;font-size:13px}
.entry-actions{padding:12px 2px 0;gap:12px}.entry-actions .btn{min-height:40px;padding:8px 19px}
.entry-page[data-module="daily"] .entry-card>.fitem{grid-column:1/-1}
.rlist{gap:9px}.rrow{padding:12px 16px;gap:12px}.rrow .rdesc{margin-top:3px;-webkit-line-clamp:1}.rrow .rdate{width:95px}.rrow .rdate b{font-size:16px}.toolbar{margin-bottom:12px}
.modal{padding:20px 22px;max-height:90vh}.modal h3{margin-bottom:13px}.ilib{max-height:190px;margin-bottom:10px}.irow{padding:8px 11px}.kv{gap:6px 12px;font-size:14px;margin-bottom:12px}.detail-files{margin:10px 0 14px}.detail-readings-title{margin-top:12px}.detail-actions{padding-top:12px;margin-top:15px}
@media(min-width:900px) and (max-height:820px){
 .main{padding-top:14px;padding-bottom:16px}.entry-header{margin-bottom:12px}.entry-page .entry-card{gap:10px 18px;padding:15px 19px}.entry-page .crumb{margin-bottom:8px}
 .entry-page .entry-card .dempty{padding:12px}.entry-page .entry-card>.btns{gap:7px}.entry-page .entry-card .upzone{min-height:76px;padding:10px}.entry-page .entry-card .dlist{max-height:110px}
 .readings-scroll{max-height:30vh}.readings-table th,.readings-table td{padding:7px 10px}
}
@media(max-width:899px){
 .main{padding:16px 18px 22px}.side{width:200px}.entry-page .entry-card{padding:17px;gap:13px}.entry-page .frow{flex-wrap:wrap}.entry-page .frow>.fitem{min-width:180px;flex:1}
}
@media(max-width:640px){
 .main{padding:14px 12px 20px}.h5main{padding:13px 12px}.h5top{padding:10px 15px}.h5-account{padding:6px 15px}.h5-module-select{padding:8px 15px}.h5-module-select select{padding:6px 11px}
 .entry-page .crumb{margin-bottom:10px}.entry-header{margin-bottom:14px;gap:9px}.entry-heading h1{font-size:22px}.entry-module-icon{width:42px;height:42px;border-radius:12px}.entry-heading{gap:10px}.entry-history{margin-left:0;padding:6px 10px;font-size:14px}.entry-heading p{font-size:13px}
 .entry-page .entry-card{display:flex;flex-direction:column;gap:15px;padding:17px 15px}.entry-page .entry-card>.frow{margin:0!important}.entry-page .frow{gap:13px}.entry-page .frow>.fitem{min-width:100%}.entry-page .fitem{gap:6px;min-width:0}.entry-page .entry-card>.entry-notes{padding:13px 0 0;border-left:0;border-top:1px solid #edf1f6}
 .entry-page label>.hint{margin-top:0}.entry-page .entry-card .upzone{min-height:92px}.entry-page .dempty{padding:15px}.entry-actions{gap:10px;padding-top:13px}.entry-actions .btns{width:auto;flex:1;justify-content:flex-end}.entry-actions .btn.pri{flex:0 1 auto}.entry-required{font-size:12px}.rrow{padding:12px}.modal{padding:18px}
}

.rrow .rdate{width:104px}.rrow .rdate b{font-size:14px;white-space:nowrap;line-height:1.7}.rrow .rdate span{font-size:13px;white-space:nowrap;line-height:1.7}.rrow .rt{max-height:3.2em;overflow:hidden}

/* 窄屏桌面入口仍提供完整的模块导航 */
.mobile-nav{display:none}
@media(max-width:640px){
 .app{flex-direction:column}
 .mobile-nav{display:block;background:#fff;color:var(--ink);border-bottom:1px solid var(--line)}
 .mobile-nav-top{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;gap:12px}
 .mobile-brand{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:600;text-decoration:none;color:var(--ink);white-space:nowrap}.mobile-brand img{border-radius:8px}
 .mobile-account{display:flex;align-items:center;gap:12px;font-size:14px;min-width:0}.mobile-account span{max-width:110px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mobile-account button{border:0;background:none;color:var(--brand);font:inherit;cursor:pointer;padding:4px 0;white-space:nowrap}
 .mobile-module-row{display:flex;align-items:center;gap:10px;padding:0 14px 12px;font-size:14px;color:var(--ink2)}.mobile-module-row label{white-space:nowrap}.mobile-module-row select{flex:1;min-width:0;min-height:38px;padding:7px 30px 7px 12px;background-color:#fff;font-size:15px;border:0;border-radius:8px}
 .mobile-entry-button{border:1px solid var(--line);border-radius:8px;padding:7px 12px;background:#f7fbfe;color:var(--brand);font:inherit;cursor:pointer;white-space:nowrap}
 .mobile-nav button:focus-visible,.mobile-nav select:focus-visible{outline:2px solid var(--brand2);outline-offset:3px}
}

/* 模块下拉：统一触发器与两列选项面板 */
.mobile-module-row,.h5-module-select{position:relative}
.module-picker{flex:1;min-width:0;position:static}
.module-native-select{position:absolute!important;width:1px!important;height:1px!important;opacity:0;pointer-events:none;overflow:hidden;padding:0!important;border:0!important}
.module-picker-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:42px;padding:7px 11px;border:1px solid #dce7ee;border-radius:10px;background:#fff;color:#24465d;font:inherit;font-size:15px;text-align:left;cursor:pointer;box-shadow:0 2px 7px #071a2d08;transition:border-color .18s,box-shadow .18s}
.module-picker-trigger:hover{border-color:#70b9c8}.module-picker.expanded .module-picker-trigger{border-color:#52b9c4;box-shadow:0 0 0 3px #2fb9b31a}
.module-picker-current{display:flex;align-items:center;gap:9px;min-width:0;font-weight:600}.module-picker-current>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.module-picker-trigger>svg{width:17px;height:17px;color:#7996a7;flex-shrink:0;transition:transform .18s}.module-picker.expanded .module-picker-trigger>svg{transform:rotate(180deg)}
.module-option-icon{display:grid;place-items:center;width:27px;height:27px;flex-shrink:0;border-radius:8px;color:var(--option-color);background:color-mix(in srgb,var(--option-color) 9%,white)}
.module-option-icon svg{width:17px;height:17px}
.module-picker-menu{display:none;position:absolute;top:calc(100% - 3px);left:14px;right:14px;z-index:60;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:9px;border:1px solid #dce8ee;border-radius:14px;background:#fff;box-shadow:0 15px 45px #0a23322b;max-height:55vh;overflow-y:auto}
.module-picker.expanded .module-picker-menu{display:grid}
.module-picker-menu button{display:flex;align-items:center;gap:8px;min-width:0;min-height:44px;padding:8px;border:1px solid transparent;border-radius:9px;background:transparent;color:#4c6378;font:inherit;font-size:14px;text-align:left;cursor:pointer;transition:background .15s,border-color .15s}
.module-picker-menu button>span:nth-child(2){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.module-picker-menu button:hover{background:#f1f7fa}.module-picker-menu button.selected{border-color:#bfe5dd;background:#edf9f5;color:#087866;font-weight:600}
.module-option-check{margin-left:auto;color:#139b80;visibility:hidden;font-size:15px}.selected .module-option-check{visibility:visible}
.module-picker-trigger:focus-visible,.module-picker-menu button:focus-visible{outline:2px solid #0d9488;outline-offset:2px}
.mobile-module-row .module-picker-trigger{background:#f7fbfe;border-color:var(--line);min-height:42px}
.h5-module-select .module-picker-menu{left:15px;right:15px}
@media(prefers-reduced-motion:reduce){.module-picker *{transition:none!important}}

/* 首页备份入口与移动端纵向统计卡片 */
.home-simple .backup-button{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:46px;padding:8px 15px 8px 9px;background:linear-gradient(110deg,#087e91,#0f9c92);border:1px solid #118b92;border-radius:12px;color:#fff;font-size:15px;font-weight:600;box-shadow:0 5px 15px #087e9126;transition:box-shadow .18s,transform .18s}
.home-simple .backup-button .backup-icon{display:grid;place-items:center;width:31px;height:31px;border-radius:8px;background:#ffffff1c}
.home-simple .backup-button svg{width:18px;height:18px;color:#fff}.home-simple .backup-download{display:flex;margin-left:5px;opacity:.85}
.home-simple .backup-button:hover{background:linear-gradient(110deg,#076f80,#0a8c84);color:#fff;border-color:#087e91;box-shadow:0 7px 20px #087e9138;transform:translateY(-1px)}
.home-simple .backup-button:focus-visible{outline:3px solid #6cd9cc;outline-offset:3px}.home-simple .backup-button:disabled{transform:none;opacity:.7;cursor:wait}
@media(max-width:640px){
 .home-simple .pagehead{gap:15px;margin-bottom:18px}.home-simple .pagehead>div{width:100%}.home-simple .pagehead p{font-size:13px;line-height:1.7}
 .home-simple .backup-button{width:100%;min-height:49px;padding-left:11px;padding-right:15px;justify-content:flex-start;gap:11px;border-radius:12px}.home-simple .backup-download{margin-left:auto}
 .home-simple .stats{grid-template-columns:minmax(0,1fr);gap:14px;margin-bottom:8px}
 .home-simple .stat{--stat-accent:#0891b2;position:relative;overflow:hidden;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:19px;min-height:116px;padding:23px 24px;text-align:left;border:1px solid #dfe9f0;border-radius:16px;background:linear-gradient(110deg,#fff 55%,color-mix(in srgb,var(--stat-accent) 5%,white));box-shadow:0 4px 16px #19364c08}
 .home-simple .stat:nth-child(2){--stat-accent:#14b8a6}.home-simple .stat:nth-child(3){--stat-accent:#6366f1}
 .home-simple .stat::after{content:"";position:absolute;right:-22px;top:-28px;width:112px;height:112px;border-radius:50%;border:17px solid color-mix(in srgb,var(--stat-accent) 5%,transparent);pointer-events:none}
 .home-simple .stat .ico{width:53px;height:53px;border-radius:15px;box-shadow:0 5px 14px color-mix(in srgb,var(--stat-accent) 15%,transparent)}
 .home-simple .stat .ico svg{width:25px;height:25px}.home-simple .stat .num{display:flex;align-items:baseline;gap:11px;font-size:29px;line-height:1.3;white-space:nowrap}
 .home-simple .stat .num em{display:inline-block;margin-left:0;font-size:14px;line-height:1.5;color:#8a9aae;white-space:nowrap}.home-simple .stat .lbl{font-size:15px;color:#60778d;margin-top:7px}
}
@media(prefers-reduced-motion:reduce){.home-simple .backup-button{transition:none}}

/* 明确区分新建与已有记录，所有模块提供直接查看和修改的入口 */
.nav-module{display:flex;align-items:center;gap:2px}.nav-module>a{flex:1;min-width:0;padding-right:5px;gap:7px}
.record-page-tabs{display:inline-flex;gap:4px;padding:4px;border:1px solid #dce7ef;border-radius:11px;background:#eaf0f6;flex-shrink:0;max-width:100%}
.record-page-tabs button{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 13px;border:1px solid transparent;border-radius:8px;background:transparent;color:#637a90;font:inherit;font-size:14px;white-space:nowrap;cursor:pointer}
.record-page-tabs button.active{background:#fff;border-color:#dce9ef;box-shadow:0 2px 5px #17375108;color:#0c7a8c;font-weight:600}.record-page-tabs button:hover{color:#087e91}
.record-page-tabs svg{width:16px;height:16px}.record-page-tabs button:focus-visible{outline:2px solid #14b8a6;outline-offset:2px}
@media(max-width:640px){.entry-header>.record-page-tabs{width:100%}.record-page-tabs button{flex:1;padding:8px 12px}.pagehead>.record-page-tabs{width:100%}.rrow .rops{gap:6px}.rrow .rops .btn{font-size:13px;padding:7px 10px}}

/* 空记录状态不允许 SVG 随容器拉伸 */
.rempty>svg.ic{display:block;width:36px;height:36px;margin:0 auto 9px;color:#9bb1c3}
#rlist>.rempty{padding:30px 22px}

/* 记录详情直接展示图片，保持比例并适应手机宽度 */
.detail-image{margin:0;flex:1 1 100%;min-width:0;border:1px solid #dce8f1;border-radius:12px;overflow:hidden;background:#f7fafc}
.detail-image>a{display:block;background:#eef3f7;text-align:center;line-height:0}
.detail-image img{display:block;width:100%;height:auto;margin:0 auto}
.detail-image figcaption{padding:10px 12px;color:#176580;font-size:14px;overflow-wrap:anywhere}
.detail-image figcaption small{display:block;margin-top:3px;color:#7a8ea1;font-size:12px}

.upload-mode-disabled{opacity:.42}
.upload-mode-disabled .upzone{pointer-events:none;background:#eef1f5;cursor:not-allowed}
#detect_time:disabled{background:#edf1f5;color:#8b98a6;cursor:not-allowed}
.import-result{padding:12px 16px;border:1px solid #a9e3d7;border-radius:10px;background:#effbf7;color:#146955;margin-bottom:14px;font-size:14px}

/* 移动端录入页只保留模块标题与操作切换，收拢重复说明。 */
body.h5 .entry-page>.crumb,body.h5 .entry-overline,body.h5 .entry-heading p{display:none}
@media(max-width:640px){
 .entry-page>.crumb,.entry-page .entry-overline,.entry-page .entry-heading p{display:none}
 .entry-page .entry-header{gap:12px;margin-bottom:12px}
}

/* 记录页复用录入页标题，仅追加当前状态，切换时保持页头位置。 */
.history-page{max-width:1320px;margin:0 auto}
.history-title-state{font-size:.68em;font-weight:500;color:var(--ink2);white-space:nowrap;letter-spacing:0}
body.h5 .history-page>.crumb,body.h5 .history-page .entry-overline,body.h5 .history-page .entry-heading p{display:none}
@media(max-width:640px){
 .history-page>.crumb,.history-page .entry-overline,.history-page .entry-heading p{display:none}
 .history-page>.entry-header{gap:12px;margin-bottom:12px}
 .history-title-state{font-size:14px}
}

/* 日期与时间连续展示，手机端单独占一行以免挤压记录内容。 */
.rrow .rdate{display:flex;align-items:baseline;gap:6px;width:150px;text-align:left;white-space:nowrap}
.rrow .rdate b{display:inline}
@media(max-width:640px){.rrow .rdate{width:100%;padding-top:0}}

/* 可输入下拉：统一选项面板、搜索与选中态，保留直接新增内容。 */
.data-combobox{position:relative;min-width:0;width:100%}
.entry-page .data-combobox>input{padding-right:42px;background:#f8fafc}
.data-combobox-arrow{position:absolute;right:5px;top:4px;bottom:4px;display:flex;align-items:center;justify-content:center;width:32px;padding:0;border:0;border-radius:7px;background:transparent;color:#7d94a9;cursor:pointer}
.data-combobox-arrow:hover{background:#e9f3f7;color:#0e7490}.data-combobox-arrow svg{width:18px;height:18px;transition:transform .15s}
.data-combobox.open .data-combobox-arrow svg{transform:rotate(180deg)}
.data-combobox-menu{position:absolute;top:calc(100% + 7px);left:0;right:0;z-index:45;max-height:250px;overflow:auto;padding:6px;border:1px solid #dbe6ed;border-radius:12px;background:#fff;box-shadow:0 12px 32px #17394d26;scrollbar-width:thin;scrollbar-color:#c5d8e1 transparent}
.data-combobox-menu[hidden]{display:none}.data-combobox.opens-up .data-combobox-menu{top:auto;bottom:calc(100% + 7px)}
.data-choice{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:40px;padding:8px 11px;border-radius:8px;font-size:15px;line-height:1.5;color:#344f65;cursor:pointer;overflow-wrap:anywhere}
.data-choice>span{min-width:0}.data-choice:hover,.data-choice.active{background:#eff7fa;color:#0e7490}
.data-choice.selected{background:#eaf8f5;color:#087f72;font-weight:600}.data-choice svg{width:17px;height:17px;flex-shrink:0}
.data-choice-hint{padding:9px 11px 5px;margin-top:4px;border-top:1px solid #edf2f6;font-size:12px;line-height:1.6;color:#8295a6}
.data-add-device{display:block;width:100%;margin-top:4px;padding:11px;text-align:left;border:0;border-top:1px solid #edf2f6;border-radius:0 0 7px 7px;background:#fff;color:#0e7490;font:inherit;font-weight:600;cursor:pointer}
.data-add-device:hover,.data-add-device:focus-visible{background:#eff7fa;outline:2px solid #0891b2;outline-offset:-2px}
.data-combobox-arrow:focus-visible{outline:2px solid #0891b2;outline-offset:1px}

/* 历史页设备/类型筛选，替代浏览器原生选项弹层。 */
.filter-picker{position:relative;flex:0 0 auto;min-width:132px;max-width:100%}
.filter-native{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;opacity:0;pointer-events:none;overflow:hidden}
.filter-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:42px;padding:9px 12px;border:1.5px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);font:inherit;font-size:15px;text-align:left;cursor:pointer}
.filter-trigger>span{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.filter-trigger svg{width:17px;height:17px;color:#7d94a9;flex-shrink:0;transition:transform .15s}
.filter-trigger:hover,.filter-picker.open .filter-trigger{border-color:#58b2c3;background:#f8fcfd}.filter-picker.open .filter-trigger{box-shadow:0 0 0 3px #0891b218}.filter-picker.open .filter-trigger>svg{transform:rotate(180deg)}
.filter-menu{left:auto;right:0;min-width:210px;width:max-content;max-width:min(300px,calc(100vw - 32px));max-height:280px}
.filter-choice{display:flex;align-items:center;justify-content:space-between;gap:18px;width:100%;min-height:42px;border:0;border-radius:8px;background:#fff;padding:9px 12px;font:inherit;font-size:15px;line-height:1.5;color:#344f65;text-align:left;cursor:pointer;overflow-wrap:anywhere}
.filter-choice>span{min-width:0}.filter-choice svg{width:17px;height:17px;flex-shrink:0}.filter-choice:hover,.filter-choice:focus-visible{background:#eff7fa;color:#0e7490;outline:none}.filter-choice.selected{background:#eaf8f5;color:#087f72;font-weight:600}
.filter-trigger:focus-visible{outline:2px solid #0891b2;outline-offset:2px}
.h5main .filter-picker{width:100%}.h5main .filter-menu{width:100%}
@media(max-width:640px){.filter-trigger{min-height:44px}.filter-menu{max-height:40vh}}

/* 检测设备按参考图集中为一张纵向录入面板。 */
.device-entry-page{max-width:740px;padding:12px 0}
.device-panel{padding:26px 32px;border:1px solid #d8e5ee;border-radius:18px;box-shadow:0 8px 32px #163d5010}
.device-panel h1{font-size:25px;line-height:1.35;margin:0 0 24px;color:#173e50}
.device-field{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:14px;margin-bottom:18px}
.device-field>label{font-size:16px;font-weight:600;color:#354e60;white-space:nowrap}.device-field>label .req{margin-left:4px}
.device-panel .data-combobox>input{background:#f8fafc;min-height:42px}
.device-panel .device-mode{display:inline-flex;min-height:42px;margin-bottom:18px;padding:4px;background:#edf4f8;border:1px solid #dce8ee;border-radius:10px}
.device-panel .device-mode button{min-width:125px;padding:7px 22px;border:0;border-radius:7px;background:transparent;color:#6a8394;font:inherit;font-size:16px;cursor:pointer}
.device-panel .device-upload{margin-bottom:20px}
.device-panel .upzone{min-height:112px;padding:18px;gap:10px;border:1.5px dashed #91b8cf;background:#f8fbfd;border-radius:12px}
.device-panel .upzone>svg{width:26px;height:26px;padding:0;background:none;box-shadow:none}
.device-panel .upload-feedback{max-height:180px;overflow:auto}.device-panel .upzone.has-files .upload-prompt{display:none}
.device-panel .upload-thumbnail{width:72px;height:72px;object-fit:contain}.device-panel .upload-file-row{width:100%}
.device-panel .device-time .hint{display:block;margin-top:4px;font-size:13px}.device-panel .device-time input{min-height:42px}
.device-note-control{display:flex;align-items:center;gap:10px;min-width:0}.device-panel .device-note textarea{min-height:44px;max-height:110px;line-height:1.5;flex:1;resize:vertical}
.device-note-control .voice-btn{white-space:nowrap;display:inline-flex;align-items:center;gap:4px;cursor:pointer;min-height:38px;padding:6px 8px;border-radius:8px;color:#0e7490;background:#edf8fb;font-size:13px}.device-note-control .voice-btn svg{width:18px;height:18px}
.device-buttons{display:flex;align-items:center;gap:12px;margin:23px 0 20px}.device-buttons>.btn{min-width:92px;justify-content:center}.device-buttons .device-history{margin-left:auto}
.device-result{display:flex;align-items:flex-start;gap:12px;border:1.5px dashed #b7cddb;border-radius:12px;padding:16px 18px;background:#f8fbfd;color:#668195;min-height:86px}
.device-result-icon{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:9px;background:#e8f2f7}.device-result-icon svg{width:19px;height:19px}
.device-result b{font-size:16px;line-height:1.6}.device-result p{font-size:14px;line-height:1.7;margin-top:3px;overflow-wrap:anywhere}
.device-result.success{color:#147e6b;border-color:#8ecebd;background:#f1fbf7}.device-result.success .device-result-icon{background:#daf2e9}
.device-result.error{color:#b64b54;border-color:#e9b3bb;background:#fff7f8}.device-result.error .device-result-icon{background:#fbe3e7}
@media(max-width:640px){
 .device-entry-page{padding:0}.device-panel{padding:21px 18px;border-radius:15px}.device-panel h1{font-size:22px;margin-bottom:22px}
 .device-field{grid-template-columns:68px minmax(0,1fr);gap:9px;margin-bottom:17px}.device-field>label{font-size:15px}
 .device-panel .device-mode{display:flex;width:100%;margin-bottom:16px}.device-panel .device-mode button{flex:1;min-width:0;padding:7px 10px;font-size:15px}
 .device-panel .upzone{min-height:120px;padding:14px}.device-panel .upload-thumbnail{width:54px;height:54px}
 .device-note-control{gap:6px}.device-note-control .voice-btn{font-size:0;padding:7px}.device-note-control .voice-btn svg{width:20px;height:20px}
 .device-buttons{gap:9px;margin-top:21px}.device-buttons>.btn{min-width:70px;padding:9px 15px}.device-result{padding:13px;gap:10px}
}

.device-panel .device-mode button:disabled{color:#a1afba;cursor:not-allowed;opacity:.65;background:transparent;box-shadow:none}

.device-panel .device-mode{margin-bottom:16px}
@media(min-width:641px){.device-panel{padding-top:22px;padding-bottom:22px}.device-panel h1{margin-bottom:20px}.device-field{margin-bottom:15px}.device-buttons{margin-top:19px;margin-bottom:16px}}

.device-panel .upzone.upload-preview-only{cursor:default}
.device-panel .upzone.upload-preview-only:hover{border-color:#91b8cf;background:#f8fbfd;color:var(--ink2)}
.device-panel .upzone.upload-preview-only .upload-prompt{cursor:default}


.device-panel .device-time input[type=text]:disabled{width:100%;font-size:14px}
.device-panel .device-time input:disabled::placeholder{color:#91a1b1;opacity:1}
@media(max-width:360px){.device-panel .device-time{grid-template-columns:1fr}}

/* 两个上传入口使用相同的操作按钮样式，不表达选中状态。 */
.device-panel .device-mode{display:flex;gap:12px;padding:0;border:0;background:transparent;width:100%;margin-bottom:18px}
.device-panel .device-mode button{flex:1;min-width:0;min-height:44px;border:1px solid #b9d8e2;background:#f5fafc;color:#0e7490;border-radius:9px;font-weight:600;box-shadow:none}
.device-panel .device-mode button:not(:disabled):hover{background:#eaf5f9;border-color:#70b6c8}
.device-panel .device-mode button:focus-visible{outline:2px solid #0891b2;outline-offset:2px}
.device-panel .device-mode button:disabled{border-color:#dce5eb;background:#f6f8fa;color:#a1afba}
@media(max-width:640px){.device-panel .device-mode{gap:9px}.device-panel .device-mode button{padding:8px 9px;font-size:14px}}

/* Shared storage summary for all nine entry/history modules. */
.module-storage-stats{display:flex;flex-wrap:wrap;gap:10px 24px;padding:12px 16px;margin-bottom:16px;border:1px solid #dbe8ef;border-radius:12px;background:linear-gradient(110deg,#f0f9fc,#f5fbf9);color:#365668;font-size:14px;line-height:1.6;font-variant-numeric:tabular-nums}
.module-storage-stats>span{display:flex;align-items:center;gap:3px;white-space:nowrap}
.module-storage-stats svg{width:17px;height:17px;margin-right:5px;color:#0e7490;flex-shrink:0}
.module-storage-stats b{font-weight:600;color:#174d62}
@media(max-width:640px){.module-storage-stats{flex-wrap:nowrap;justify-content:space-between;gap:8px;padding:10px;margin-bottom:12px;font-size:13px}.module-storage-stats>span{flex:0 0 auto;gap:1px}.module-storage-stats svg{width:14px;height:14px;margin-right:2px}}
@media(max-width:380px){.module-storage-stats{font-size:12px;gap:6px;padding:10px 8px}.module-storage-stats svg{display:none}}

/* PC reference layout: global summary in the rail, one focused entry panel. */
.sidebar-storage{display:none}
@media(min-width:641px){
 .desktop-shell .side{width:258px}
 .desktop-shell .brand{padding:24px 22px 15px;gap:13px}
 .desktop-shell .brand .logo{width:48px;height:48px;background:transparent;box-shadow:none}
 .desktop-shell .brand .logo img{width:48px;height:48px}
 .desktop-shell .brand b{font-size:26px;letter-spacing:2px}
 .desktop-shell .brand small{font-size:14px;letter-spacing:1px}
 .desktop-shell .sidebar-storage{display:grid;gap:7px;margin:0 17px 12px;padding:13px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:13px;color:#355369;font-variant-numeric:tabular-nums}
 .desktop-shell .sidebar-storage>div{display:flex;flex-wrap:wrap;gap:2px}
 .desktop-shell .sidebar-storage b{color:var(--brand);font-weight:600}
 .desktop-shell .nav{padding:2px 16px 12px}
 .desktop-shell .nav .group{font-size:12px;padding:9px 9px 7px;letter-spacing:1px}
 .desktop-shell .nav-module{margin:0 0 6px;border:1px solid var(--line);border-radius:10px}
 .desktop-shell .nav a{min-height:37px;margin:0;padding:7px 10px;font-size:15px}
 .desktop-shell .main{padding:24px 30px 28px;background:radial-gradient(ellipse at 20% 0,#e8f3f8,transparent 65%),#f0f5f9}
 .desktop-shell .entry-page,.desktop-shell .history-page{max-width:920px;margin:0 auto}
 .desktop-shell .entry-page:not(.device-entry-page){display:grid;padding:23px 27px;background:#fff;border:1px solid #d8e5ed;border-radius:18px;box-shadow:0 8px 32px #163d500b}
 .desktop-shell .entry-page>.crumb{display:none}
 .desktop-shell .entry-page>.entry-header{grid-row:1;justify-content:center;flex-wrap:wrap;gap:12px;margin-bottom:15px}
 .desktop-shell .entry-page .entry-heading{justify-content:center}
 .desktop-shell .entry-page .entry-heading h1{font-size:24px}
 .desktop-shell .entry-page .entry-heading p,.desktop-shell .entry-page .entry-module-icon{display:none}
 .desktop-shell .entry-page>.module-storage-stats{grid-row:2;justify-content:space-between;gap:8px 18px;margin:0 0 22px;padding:11px 0;border:0;border-top:1px solid #e9f0f5;border-bottom:1px solid #e9f0f5;border-radius:0;background:transparent}
 .desktop-shell .entry-page>.entry-layout{grid-row:3}
 .desktop-shell .entry-page .entry-card{padding:0;border:0;border-radius:0;box-shadow:none}
 .desktop-shell .device-entry-page{display:grid;max-width:680px;padding:24px 30px;background:#fff;border:1px solid #d8e5ed;border-radius:18px;box-shadow:0 8px 32px #163d500b}
 .desktop-shell .device-panel{display:contents}
 .desktop-shell .device-panel>h1{grid-row:1;text-align:center;margin:0 0 18px;font-size:25px}
 .desktop-shell .device-panel .device-field{grid-template-columns:84px minmax(0,1fr);margin-bottom:18px;gap:12px}
 .desktop-shell .device-panel .device-mode{display:flex;gap:14px;margin-bottom:18px;padding:0;border:0;background:transparent}
 .desktop-shell .device-panel .device-mode button{flex:1;min-width:0;padding:9px 14px}
 .desktop-shell .device-panel .upzone{min-height:132px}
 .desktop-shell .device-panel .device-upload{margin-bottom:19px}
 .desktop-shell .device-panel .device-note textarea{min-height:44px}
 .desktop-shell .device-panel .device-buttons{margin:5px 0 18px;gap:14px}
 .desktop-shell .device-panel .device-result{margin:0;min-height:94px}
}
@media(min-width:641px) and (max-width:1000px){.desktop-shell .side{width:225px}.desktop-shell .main{padding:18px}.desktop-shell .device-entry-page{padding:22px}.desktop-shell .sidebar-storage{font-size:12px}}
@media(min-width:641px) and (max-height:800px){.desktop-shell .brand{padding-top:18px}.desktop-shell .main{padding-top:17px}.desktop-shell .device-entry-page{padding-top:20px;padding-bottom:20px}.desktop-shell .device-panel .upzone{min-height:108px}.desktop-shell .device-panel .device-field{margin-bottom:15px}.desktop-shell .device-panel .device-result{min-height:80px}.desktop-shell .entry-page>.module-storage-stats{margin-bottom:17px}}

.device-existing{min-width:0;margin-bottom:18px;padding:12px 0;border-top:1px solid #e5edf3;border-bottom:1px solid #e5edf3}
.device-existing[hidden]{display:none}
.device-existing .detail-readings-title{margin-top:0;font-size:15px}
.device-existing .readings-scroll{max-height:290px}
.device-edit-notice{color:#98601a;background:#fff8eb;padding:10px 12px;border-radius:9px;font-size:14px}
.readings-editable input[data-reading-time]{min-width:190px}
.readings-editable input[data-reading-value]{min-width:100px;width:110px}
.readings-editable input[data-reading-unit]{min-width:75px;width:85px}
.readings-editable{min-width:800px}
.readings-editable td:last-child{min-width:160px}
.device-result.editing{background:#eef7fc;border-color:#bcdde9}
@media(min-width:641px){.desktop-shell .nav{min-height:0;scrollbar-width:thin}}
@media(min-width:641px) and (max-height:720px){
 .desktop-shell .brand{padding:15px 20px 12px}
 .desktop-shell .sidebar-storage{padding:10px 12px;gap:5px;margin-bottom:9px}
 .desktop-shell .nav-module{margin-bottom:4px}
 .desktop-shell .nav a{min-height:35px;padding:6px 10px}
}
@media(min-width:641px) and (max-height:560px){
 .desktop-shell .brand{padding:11px 18px 9px}
 .desktop-shell .brand .logo,.desktop-shell .brand .logo img{width:40px;height:40px}
 .desktop-shell .brand b{font-size:23px}
 .desktop-shell .sidebar-storage{padding:7px 10px;margin-bottom:7px;gap:3px}
 .desktop-shell .nav-module{margin-bottom:3px}
 .desktop-shell .nav a{min-height:30px;padding:3px 10px;font-size:14px}
}

.device-upload-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;margin-bottom:18px;min-width:0}
.device-panel .device-upload-pair .device-upload{min-width:0;margin-bottom:0}
.device-upload-label{font-size:14px;font-weight:600;color:#426578;margin-bottom:6px}
.device-upload-pair .upzone{height:100%;max-height:260px}
.device-panel .device-upload-pair .upzone{min-height:116px;padding:12px}
.device-upload-pair .device-upload{display:flex;flex-direction:column}
.device-upload.is-inactive .device-upload-label{color:#9aa7b3}
.device-upload.is-inactive .upzone{background:#f0f2f5;border-color:#d9e0e6;border-style:dashed;color:#a0acb7;cursor:not-allowed;opacity:.6;box-shadow:none}
.device-upload.is-inactive .upzone *{pointer-events:none}
.device-upload:not(.is-inactive) .upzone{border-color:#44a6ba;background:#f4fbfd}
.device-upload-pair .upload-file-row{gap:6px;flex-wrap:wrap}
.device-upload-pair .upload-file-info{flex:1;min-width:90px}
.device-upload-pair .upload-selected-name{font-size:13px}
.device-upload-pair .upload-file-icon{display:none}
@media(max-width:640px){.device-upload-pair{grid-template-columns:minmax(0,1fr);gap:12px}.device-panel .device-upload-pair .upzone{min-height:88px}.device-upload-pair .upzone{height:auto}}

/* Compact status text; keep complete success/error messages without a card. */
.device-panel .device-result,.desktop-shell .device-panel .device-result{display:block;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;line-height:1.5}
.device-result>div{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 6px}
.device-result b{font-size:14px;line-height:1.5;font-weight:600}
.device-result p{display:inline;margin:0;font-size:13px;line-height:1.5;flex:1;min-width:140px}
.device-panel .device-buttons,.desktop-shell .device-panel .device-buttons{margin-bottom:10px}
@media(min-width:641px) and (max-height:720px){
 .desktop-shell .main{padding:12px 22px}
 .desktop-shell .device-entry-page{padding:15px 24px}
 .desktop-shell .device-panel>h1{font-size:23px;margin-bottom:11px}
 .desktop-shell .device-entry-page>.module-storage-stats{padding:8px 0;margin-bottom:12px}
 .desktop-shell .device-panel .device-field{margin-bottom:11px}
 .desktop-shell .device-panel .device-mode{margin-bottom:11px}
 .device-upload-pair{margin-bottom:12px}
 .desktop-shell .device-panel .device-upload-pair .upzone{min-height:88px;padding:10px}
 .device-panel .device-upload-pair .upload-feedback{max-height:115px}
 .desktop-shell .device-panel .device-buttons{margin-top:0;margin-bottom:8px}
 .device-existing .readings-scroll{max-height:150px}
}
@media(max-width:640px){
 .device-panel{padding:16px 15px}
 .device-panel h1{font-size:21px;margin-bottom:13px}
 .device-panel .device-field{margin-bottom:11px}
 .device-panel .device-mode{margin-bottom:11px}
 .device-panel .device-mode button{padding:7px 8px}
 .device-upload-pair{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px;margin-bottom:12px}
 .device-upload-label{font-size:13px;margin-bottom:5px}
 .device-panel .device-upload-pair .upzone{min-height:82px;padding:9px;gap:6px}
 .device-upload-pair .upload-prompt{font-size:13px;line-height:1.5}
 .device-upload-pair .upload-file-info{min-width:0;width:100%}
 .device-upload-pair .upload-selected-name{font-size:12px}
 .device-panel .device-upload-pair .upload-thumbnail{width:46px;height:46px}
 .device-panel .device-upload-pair .upload-feedback{max-height:122px}
 .device-panel .device-buttons{margin:4px 0 8px;gap:8px}
 .device-panel .device-buttons>.btn{padding:7px 12px}
 .device-result b{font-size:13px}.device-result p{font-size:12px;min-width:110px}
 .device-existing .readings-scroll{max-height:160px}
}

@media(min-width:641px) and (max-height:600px){
 .desktop-shell .device-entry-page{padding:12px 22px}
 .desktop-shell .device-panel>h1{font-size:22px;margin-bottom:8px}
 .desktop-shell .device-entry-page>.module-storage-stats{margin-bottom:8px}
 .desktop-shell .device-panel .device-field{margin-bottom:8px}
 .desktop-shell .device-panel .device-mode{margin-bottom:9px}
 .desktop-shell .device-panel .device-upload-pair .upzone{height:76px;min-height:76px;padding:8px}
 .desktop-shell .device-panel .device-upload-pair .upload-feedback{max-height:58px}
 .device-upload-pair{margin-bottom:10px}
}
@media(max-width:640px) and (max-height:740px){
 .main:has(.device-entry-page){padding-top:10px;padding-bottom:8px}
 .device-entry-page .device-panel{padding:12px;margin-bottom:0}
 .device-panel h1{font-size:20px;margin-bottom:9px}
 .device-panel .device-field{margin-bottom:8px}
 .device-panel .device-field input,.device-panel .device-time input{height:36px;min-height:36px;padding:6px 10px;font-size:15px}
 .device-panel .device-note textarea{height:36px;min-height:36px;padding:6px 10px;font-size:15px}
 .device-panel .device-mode{min-height:36px;margin-bottom:9px}
 .device-panel .device-mode button{padding:5px 7px}
 .device-upload-pair{margin-bottom:9px}
 .device-panel .device-upload-pair .upzone{height:68px;min-height:68px;padding:8px}
 .device-upload-pair .upzone>svg{display:none}
 .device-panel .device-upload-pair .upload-feedback{max-height:50px}
 .device-panel .device-buttons>.btn{padding:6px 11px}
 .module-storage-stats{padding-top:6px;padding-bottom:6px;margin-bottom:8px}
 .h5wrap:has(.device-entry-page){padding-bottom:66px}
 .h5wrap:has(.device-entry-page) .h5main{padding:6px 12px}
 .h5wrap:has(.device-entry-page) .h5top{padding:6px 15px}
 .h5wrap:has(.device-entry-page) .h5-account{padding:2px 15px}
 .h5wrap:has(.device-entry-page) .h5-module-select{padding:6px 15px}
 .h5wrap:has(.device-entry-page) .module-picker-trigger{min-height:36px;padding:5px 10px}
}

@media(min-width:641px){
 #z_csv .upload-file-row{flex-wrap:nowrap;padding:6px 8px}
 #z_csv .upload-file-info{display:flex;align-items:center;gap:5px;min-width:0}
 #z_csv .upload-selected-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #z_csv .upload-file-size{flex-shrink:0;white-space:nowrap;margin:0}
}
@media(min-width:641px) and (min-height:721px) and (max-height:800px){
 .desktop-shell .device-panel .device-upload-pair .upzone{height:140px;min-height:108px}
 .device-panel .device-upload-pair .upload-feedback{max-height:114px}
}
@media(max-width:640px) and (min-height:741px){
 .device-entry-page .device-panel{margin-bottom:0}
 .device-panel .device-upload-pair .upzone{height:108px;min-height:108px}
 .device-panel .device-upload-pair .upload-feedback{max-height:86px}
}

/* One display-only preview region; mode selection lives in the buttons above. */
.device-panel .device-upload-unified{margin-bottom:16px;min-width:0}
.device-panel .device-upload-unified .upzone{height:128px;min-height:128px;padding:12px;cursor:default}
.device-upload-unified .upload-feedback{width:100%;max-height:102px;gap:5px;overflow:auto}
.device-upload-unified .upload-file-row{padding:3px 8px;gap:8px;flex-wrap:nowrap}
.device-upload-unified .upload-file-row>svg{width:17px;height:17px;flex-shrink:0;color:#0e7490}
.device-upload-unified .upload-selected-name{flex:1;min-width:0;font-size:14px;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.device-upload-unified .upload-remove{display:grid;place-items:center;width:24px;height:24px;min-width:24px;padding:3px;border:0;border-radius:5px}
.device-upload-unified .upload-remove svg{width:14px;height:14px}
.device-upload-unified .upload-feedback:has(.device-preview-image){display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:8px}
.device-preview-image{position:relative;display:flex;align-items:center;justify-content:center;height:82px;border-radius:8px;background:#fff;border:1px solid #e1ebf0}
.device-panel .device-upload-unified .upload-thumbnail{width:100%;height:76px;object-fit:contain;border-radius:6px}
.device-preview-image>.upload-remove{position:absolute;right:3px;top:3px;background:#ffffffdc}
@media(max-height:720px){.device-panel .device-upload-unified .upzone{height:88px;min-height:88px;padding:8px}.device-upload-unified .upload-feedback{max-height:70px}.device-panel .device-upload-unified{margin-bottom:11px}.device-preview-image{height:66px}.device-panel .device-upload-unified .upload-thumbnail{height:60px}}

.device-upload-unified .upload-file-row.invalid,.device-upload-unified .device-preview-image.invalid{border-color:#e8a0a0;background:#fff4f4}
.device-upload-unified .upload-file-row.invalid .upload-selected-name{color:#b13f49}


/* Compact file lists shared by entry, edit and record details. */
.entry-page :is(.entry-card,.device-panel) .upzone,
.entry-page :is(.entry-card,.device-panel) .upzone:hover,
.entry-page :is(.entry-card,.device-panel) .upzone.upload-preview-only,
.entry-page :is(.entry-card,.device-panel) .upzone.upload-preview-only:hover{
 border:0;border-radius:0;box-shadow:none;background:transparent;
 height:auto;min-height:0;padding:4px 0;justify-content:flex-start;
}
.entry-page :is(.entry-card,.device-panel) .upzone.upload-preview-only:not(.has-files){padding:0}
.entry-page .device-upload-unified{margin-bottom:10px}
.entry-page :is(.entry-card,.device-panel) .upload-feedback{max-height:none;overflow:visible;gap:3px}
.entry-page :is(.entry-card,.device-panel) .upload-file-row{
 width:100%;padding:2px 0;gap:7px;border:0;border-radius:0;
 background:transparent;box-shadow:none;align-items:flex-start;flex-wrap:nowrap;
}
.entry-page :is(.entry-card,.device-panel) .upload-file-row>svg,
.entry-page :is(.entry-card,.device-panel) .upload-file-icon{display:none}
.entry-page :is(.entry-card,.device-panel) .upload-selected-name{
 min-width:0;font-size:14px;font-weight:400;line-height:1.6;
 white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;
}
.entry-page :is(.entry-card,.device-panel) .upload-file-size{display:none}
.entry-page :is(.entry-card,.device-panel) .upload-selected-status{font-size:12px;line-height:1.5}
.entry-page :is(.entry-card,.device-panel) .upload-remove{background:transparent;margin-left:auto}
.entry-page :is(.entry-card,.device-panel) .upload-thumbnail,
.entry-page :is(.entry-card,.device-panel) .device-preview-image{border:0;background:transparent;box-shadow:none}
.entry-page :is(.entry-card,.device-panel) .upload-file-row.invalid .upload-selected-name{color:#b13f49}
.entry-page :is(.entry-card,.device-panel) .device-preview-image.invalid{outline:1px solid #b13f49;outline-offset:1px}
.detail-files{gap:6px;margin:8px 0 12px}
.detail-file{flex:1 1 100%;padding:2px 0;border:0;border-radius:0;background:transparent;box-shadow:none;align-items:flex-start;gap:0}
.detail-file>svg{display:none}
.detail-file>span{min-width:0;overflow-wrap:anywhere;line-height:1.6}
.detail-file small{margin-top:0}
.detail-image{border:0;border-radius:0;background:transparent}
.detail-image figcaption{padding:4px 0}


/* Oral entry follows the same focused panel as device entry. */
.entry-page.oral-entry-page,.desktop-shell .entry-page.oral-entry-page{display:block;max-width:780px;margin:0 auto;padding:0;background:transparent;border:0;box-shadow:none}
.oral-entry-page .oral-panel.entry-card{display:block;padding:22px 26px;border:1px solid #d8e5ed;border-radius:18px;background:#fff;box-shadow:0 8px 32px #163d500b}
.oral-panel h1{font-size:24px;text-align:center;margin:0 0 12px}
.oral-panel .module-storage-stats{display:flex;justify-content:space-between;margin:0 0 14px;padding:8px 0;border:0;border-radius:0;border-top:1px solid #e9f0f5;border-bottom:1px solid #e9f0f5;background:transparent}
.oral-panel .chips{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:0 0 14px}
.oral-panel .chip{text-align:center;padding:7px 0;font-size:15px;white-space:nowrap}
.oral-template-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto auto;align-items:center;gap:9px;margin-bottom:10px}
.oral-template-row label{margin:0;font-weight:600}
.oral-template-row select{width:100%;min-width:0;min-height:0;height:36px;padding:5px 10px}
.oral-panel .oral-details{max-height:289px;overflow:auto;border-top:1px solid #cbdfe8;border-bottom:1px solid #cbdfe8;margin-bottom:9px}
.oral-details table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px}
.oral-details th{position:sticky;top:0;background:#f4f9fb;text-align:left;font-weight:600;color:#496879;z-index:1}
.oral-details th,.oral-details td{height:31px;box-sizing:border-box;padding:1px 6px;border-bottom:1px solid #eff4f7}
.oral-details th:first-child{width:auto}.oral-details th:nth-child(2){width:96px}.oral-details th:nth-child(3){width:68px}.oral-details th:last-child{width:32px}
.oral-panel .oral-details input{height:25px;min-height:0;padding:2px 7px;width:100%;font-size:14px;border-radius:6px}
.oral-details .oral-item-name{display:block;padding:0;border:0;background:none;color:var(--ink);text-align:left;font:inherit;cursor:pointer;overflow-wrap:anywhere}
.oral-details .oral-remove{display:grid;place-items:center;width:22px;height:22px;line-height:1;border:0;padding:0;background:none;font-size:18px;color:#879ca8;cursor:pointer}.oral-details .oral-remove:hover{color:#b13f49}
.oral-details .oral-placeholder td{color:#9aabb6;font-size:13px}
.oral-library-actions{display:flex;justify-content:space-between;gap:10px;margin-bottom:14px}
.oral-panel .oral-field{display:grid;grid-template-columns:76px minmax(0,1fr);gap:10px;align-items:center;margin-bottom:12px}
.oral-field>label{margin:0;font-size:15px;font-weight:600}.oral-field>input{width:100%;min-width:0}
.oral-note{display:flex;align-items:center;gap:8px;min-width:0}.oral-panel .oral-note textarea{flex:1;min-width:0;min-height:38px;height:38px;padding:8px 10px;resize:vertical}
.oral-note .voice-btn{padding:7px;white-space:nowrap;font-size:12px}
.oral-actions{display:flex;gap:12px;margin:14px 0 6px}.oral-actions>.btn:last-child{margin-left:auto}
.oral-result{font-size:13px;line-height:1.6;color:#327284}.oral-result:empty{display:none}
.oral-library-list{max-height:220px;overflow:auto;margin-bottom:14px}
.oral-library-item{display:flex;justify-content:space-between;gap:10px;width:100%;padding:9px 0;border:0;border-bottom:1px solid #edf2f6;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.oral-library-item small{color:#7b93a2;white-space:nowrap}.oral-library-item span{min-width:0;overflow-wrap:anywhere}
.oral-library-editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(80px,.5fr);gap:9px;margin-bottom:16px}.oral-library-editor label{grid-column:1/-1}
@media(min-width:641px) and (max-height:800px){
 .oral-entry-page .oral-panel.entry-card{padding:16px 22px}.oral-panel h1{margin-bottom:9px;font-size:22px}.oral-panel .module-storage-stats{margin-bottom:10px;padding:6px 0}.oral-panel .chips{margin-bottom:10px}.oral-panel .oral-details{max-height:253px}.oral-details th,.oral-details td{height:27px}.oral-details input{height:25px}.oral-library-actions{margin-bottom:10px}.oral-panel .oral-field{margin-bottom:9px}.oral-actions{margin-top:10px}
}
@media(max-width:640px){
 .oral-entry-page .oral-panel.entry-card{padding:16px 13px;border-radius:14px}.oral-panel h1{font-size:21px}.oral-panel .module-storage-stats{font-size:12px;gap:5px}.oral-panel .chips{gap:4px}.oral-panel .chip{font-size:14px;padding:7px 0}.oral-template-row{grid-template-columns:32px minmax(0,1fr) auto auto;gap:5px}.oral-template-row .btn{padding:6px 8px}.oral-details th:nth-child(2){width:76px}.oral-details th:nth-child(3){width:43px}.oral-details th:last-child{width:26px}.oral-details td,.oral-details th{padding-left:3px;padding-right:3px}.oral-panel .oral-details{max-height:253px}.oral-details th,.oral-details td{height:27px}.oral-panel .oral-field{grid-template-columns:65px minmax(0,1fr);gap:7px}.oral-actions{gap:8px}.oral-actions>.btn{padding-left:12px;padding-right:12px}.oral-library-actions .btn{padding:6px 9px}.oral-note .voice-btn{font-size:0}.oral-note .voice-btn svg{width:17px;height:17px}
}


/* Separate multi-select library and blank catalog editor. */
.modal.oral-item-modal{width:760px;max-width:94vw;padding:20px 24px}
.oral-item-modal h3{margin-bottom:14px}.oral-item-modal h3 .hint{margin-left:8px;font-weight:400}
.oral-library-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}
.oral-library-toolbar>input{flex:1;min-width:0;max-width:370px;height:36px}
.oral-library-toolbar>span{white-space:nowrap;font-size:13px;color:#738a99}
.oral-library-table{max-height:305px;overflow:auto;border-top:1px solid #c8dce7;border-bottom:1px solid #c8dce7}
.oral-library-table table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px}
.oral-library-table th{position:sticky;top:0;background:#f4f9fb;font-weight:600;color:#4b6979;z-index:1;text-align:left}
.oral-library-table td,.oral-library-table th{padding:5px 7px;border-bottom:1px solid #eef3f6;overflow-wrap:anywhere;height:36px;vertical-align:middle}
.oral-library-table tr.selected{background:#edf8fa}.oral-library-table tbody tr:hover{background:#f4fafb}
.oral-library-table .oral-check-col{width:32px}.oral-library-table .oral-unit-col{width:65px}.oral-library-table .oral-image-col{width:48px}
.oral-library-table input[type=checkbox]{width:16px;height:16px;accent-color:#0e7490;vertical-align:middle;cursor:pointer}
.oral-library-table label{font:inherit;color:var(--ink);cursor:pointer}
.oral-library-select{font:inherit;text-align:left;color:#176580;border:0;background:none;padding:0;cursor:pointer;overflow-wrap:anywhere}
.oral-item-thumb{display:block;width:28px;height:28px;object-fit:contain}
.oral-library-empty{color:#92a5b0;text-align:center}
.oral-item-form{display:grid;grid-template-columns:76px minmax(0,1fr);gap:10px 12px;align-items:center;margin-bottom:8px}
.oral-item-form>label{margin:0;font-size:14px;color:#496879}
.oral-item-form input,.oral-item-form textarea{width:100%;min-width:0}.oral-item-form textarea{min-height:52px;padding:7px 10px;line-height:1.5;resize:vertical}
.oral-item-form .data-picker{max-width:220px}.oral-item-form .data-picker-menu{max-height:160px}
.oral-item-image-preview{display:flex;align-items:flex-start;gap:6px;min-height:0}
.oral-item-image-preview img{max-width:100%;width:100px;height:70px;object-fit:contain}
.oral-item-image-preview .oral-remove{border:0;background:none;color:#7a8d99;padding:0 4px;font-size:19px;cursor:pointer}
.oral-item-feedback{font-size:13px;line-height:1.5;color:#718a99;margin:4px 0 10px;overflow-wrap:anywhere}
.oral-modal-actions{display:flex;gap:10px;justify-content:flex-start;margin:12px 0}.oral-modal-actions>.btn:last-child{margin-left:auto}
.oral-item-modal .oral-modal-actions:last-child{margin-bottom:0}
@media(max-width:640px){
 .modal.oral-item-modal{padding:16px 13px;max-width:96vw}.oral-item-modal h3{font-size:18px}.oral-library-toolbar{gap:8px}.oral-library-toolbar>span{font-size:12px}.oral-library-table th,.oral-library-table td{padding:4px;font-size:13px}.oral-library-table .oral-unit-col{width:39px}.oral-library-table .oral-check-col{width:26px}.oral-library-table .oral-image-col{width:37px}.oral-item-form{grid-template-columns:62px minmax(0,1fr);gap:8px}.oral-item-form .data-picker{max-width:100%}.oral-modal-actions .btn{padding:8px 12px;font-size:14px}.oral-library-table{max-height:285px}
}


.import-dedup-note{margin:12px 0 8px;color:#56798b;font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.import-file-summary{display:flex;flex-direction:column;gap:7px;margin:10px 0 14px;font-size:13px;line-height:1.6}
.import-file-summary>div{min-width:0}.import-file-summary span{display:block;color:#748d9d;overflow-wrap:anywhere}.import-file-summary .import-source-name{color:#375e72}

.record-readonly-note{margin-top:14px;font-size:13px;line-height:1.6;color:#8195a4}


.history-page .history-back{display:inline-flex;align-items:center;gap:5px;padding:8px 15px}.history-back svg{width:17px;height:17px}
.history-page .rrow{border:0;border-radius:0;background:transparent;box-shadow:none;padding:12px 0}
.history-page .rlist{gap:6px}.history-page .import-result{border:0;border-radius:0;background:transparent;padding:0;margin:0 0 12px}
.history-time-filter{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 13px;color:#748b9b;font-size:13px}
.history-time-filter input[type=date]{width:145px;min-width:0;max-width:100%;height:36px;padding:5px 8px;border:1px solid #dce5ee;border-radius:8px;background:#fbfcfe;color:#496879;font:inherit}
.history-time-filter .filter-trigger{min-height:36px;padding:6px 10px;font-size:13px}.history-time-filter .filter-trigger>span{max-width:90px}
#hist_time_total{margin-left:auto;white-space:nowrap;color:#557787}
@media(max-width:640px){.history-time-filter{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:7px}.history-time-filter>span:first-child{grid-column:1}.history-time-filter>.filter-picker{grid-column:2/4;width:auto}.history-time-filter input[type=date]{width:100%;font-size:13px}.history-time-filter>#hist_time_total{grid-column:1/-1;margin-left:0}.history-page .rrow{padding:10px 0}.history-page .history-back{padding:7px 12px}}

@media(max-width:640px){.h5main .history-page .rrow .rops{flex-direction:row}.history-page .rrow .rops>.danger{flex:0 0 50px}.history-pagination{gap:8px;flex-wrap:nowrap}.history-pagination .btn{font-size:13px;padding:8px 11px}.history-pagination>span{font-size:13px;text-align:center}}

.oral-library-table .oral-delete-col{width:40px}.oral-library-delete{display:grid;place-items:center;width:28px;height:28px;border:0;border-radius:6px;padding:4px;background:transparent;color:#b26571;cursor:pointer}.oral-library-delete:hover{background:#fff0f3;color:#d33e58}.oral-library-delete:disabled{opacity:.5;cursor:wait}.oral-library-delete svg{width:16px;height:16px}
@media(max-width:640px){.oral-library-table .oral-delete-col{width:30px}.oral-library-delete{width:25px;height:25px;padding:3px}}

.oral-modal-actions>[hidden],.oral-item-image-preview>[hidden]{display:none}.oral-item-form input[readonly],.oral-item-form textarea[readonly]{background:#f4f7fa;color:#617789}

.oral-item-image-preview{flex-wrap:wrap;gap:9px}.oral-image-preview{position:relative;display:inline-flex;align-items:center}.oral-image-preview .oral-remove{position:absolute;top:0;right:0;background:#ffffffdc;border-radius:5px}.oral-image-count{display:block;color:#7c92a0;font-size:11px;white-space:nowrap}

.detail-drag-handle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;height:25px;min-height:0;padding:3px;border:0;border-radius:5px;background:transparent;color:#9aaeba;cursor:grab;touch-action:none;user-select:none}.detail-drag-handle svg{width:16px;height:18px;stroke-width:4;stroke-linecap:round}.detail-drag-handle:hover{background:#eaf6fa;color:#0e7490}.detail-drag-handle:active{cursor:grabbing}.detail-drag-handle:focus-visible{outline:2px solid #0e7490;outline-offset:1px}.oral-item-cell{display:flex;align-items:center;gap:4px;min-width:0}.oral-item-cell .oral-item-name{min-width:0}.oral-details tr.detail-dragging>td,.drow.detail-dragging{background:#eaf7fa}.drow .detail-drag-handle{align-self:center}

.oral-ingredient-actions{display:flex;align-items:center;gap:7px}.oral-library-actions{flex-wrap:wrap}.oral-library-actions>.btn:last-child{margin-left:auto}

/* Medical entry keeps a single compact column on desktop and mobile. */
.medical-entry-page .medical-panel.entry-card{display:block;gap:0;max-width:650px;margin:0 auto;border:1px solid #d8e5ed;border-radius:16px;background:#fff;box-shadow:0 8px 32px #163d500b}
.medical-entry-page .medical-panel .module-storage-stats{margin-bottom:14px}
.medical-entry-page .medical-field{margin:10px 0}
.medical-entry-page .medical-panel .upzone:not(.has-files){display:flex;align-items:center;justify-content:center;min-height:84px}
.medical-entry-page .medical-panel textarea{min-height:70px}

@media(max-width:640px){
 .medical-entry-page .medical-panel .upzone:not(.has-files){min-height:64px!important}
 .medical-entry-page .medical-panel textarea{height:64px;min-height:64px}
 .medical-entry-page .medical-field{margin:8px 0}
}

/* The shared content pane follows a height/width ratio of 1.6 on desktop. */
:root{--record-width:min(620px,calc((100dvh - 36px)/1.6))}
.desktop-shell .main>.entry-page,.desktop-shell .main>.history-page,.desktop-shell .main>.record-detail-page{width:100%;max-width:var(--record-width);margin:0 auto;display:block;padding:18px;background:#fff;border:1px solid #d8e5ed;border-radius:14px;box-shadow:0 8px 30px #163d5008}
.entry-page .entry-guide,.entry-page .record-page-tabs,.entry-required{display:none!important}.entry-page .entry-layout{display:block}
.entry-page .entry-card,.medical-entry-page .medical-panel.entry-card,.oral-entry-page .oral-panel.entry-card{display:block!important;gap:0;min-width:0;width:100%;padding:0!important;border:0!important;box-shadow:none!important;margin:0}
.desktop-shell .device-panel{display:block}.entry-header,.entry-heading{justify-content:center;text-align:center;margin-bottom:12px}.entry-heading h1,.medical-panel h1,.device-panel h1{font-size:22px!important;margin:0 0 12px!important;text-align:center}.entry-page .entry-module-icon{display:none}
.entry-page .module-storage-stats{font-size:12px!important;display:flex;flex-wrap:nowrap;justify-content:space-between;gap:5px;margin:0 0 14px!important;padding:8px!important;background:#f5fbfc;border:1px solid #e0edf2;border-radius:9px}.entry-page .module-storage-stats>span{white-space:nowrap;gap:3px}
.entry-page .entry-card h2{display:none}.entry-page .entry-card>.frow{margin:0 0 12px!important}.entry-page .frow{display:flex;flex-wrap:wrap;gap:10px}.entry-page .fitem{min-width:0!important;flex:1 1 100%;gap:5px}.entry-page .entry-notes{border:0!important;padding:0!important}.entry-page .fitem>label{font-size:14px}.entry-page .entry-actions{margin-top:12px;padding:0;border:0;display:block}.entry-page .entry-actions .btns{display:flex;gap:8px;justify-content:flex-start}.entry-page .entry-actions .btns>.btn:last-child{order:-1}
.entry-page .btn,.history-page .btn,.record-detail-page .btn,.modal .btn{border-radius:8px;padding:8px 14px;font-size:14px}.entry-page .medical-actions{margin-top:12px}.entry-page .hint{font-size:12px}.entry-page .entry-heading p,.entry-page .fitem>label>.hint{display:none}.knowledge-image-input[hidden]{display:none!important}
.history-page .module-storage-stats{display:none}.history-page .entry-header{display:flex;align-items:center;justify-content:space-between;text-align:left}.history-page .entry-heading h1{font-size:21px!important;margin:0!important}.history-page .entry-module-icon{display:none}.history-page .toolbar{gap:8px;margin-bottom:10px}.history-page .history-time-filter{gap:6px;font-size:12px;flex-wrap:wrap}.history-page .history-time-filter input{min-width:0;width:120px;font-size:12px}.history-page .history-time-filter .filter-select{max-width:110px}
.history-record{display:flex;gap:12px;padding:10px 0!important;cursor:pointer;border:0!important;border-bottom:1px solid #e7eef3!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}.history-record:focus-visible{outline:2px solid #0e7490;outline-offset:2px}.history-record:hover{background:#f5fafc!important}.history-record .rdate{font-size:12px;flex:0 0 100px;white-space:normal;line-height:1.5}.history-record .rbody{min-width:0;flex:1}.history-record .rt{font-size:14px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-record .rdesc{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-height:20px}.history-pagination{font-size:12px;gap:7px!important}
.record-detail-page{background:#fff;padding:16px;border:1px solid #d8e5ed;border-radius:14px}.detail-page-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:18px}.detail-page-header h1{font-size:22px;margin:0}.detail-page-header svg{width:18px;height:18px}.record-detail-page .kv{display:grid;grid-template-columns:78px minmax(0,1fr);gap:10px;font-size:14px;line-height:1.6}.record-detail-page .kv .v{overflow-wrap:anywhere;white-space:pre-wrap}
.record-media{margin-top:16px;min-width:0}.media-toolbar{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:12px;margin-bottom:8px}.media-content{background:#f7fafc;border-radius:8px;min-height:230px;display:flex;align-items:flex-start;justify-content:center;touch-action:pan-y}.media-content img{display:block;width:100%;height:auto;max-height:65dvh;object-fit:contain}.media-name{display:block;font-size:12px;margin-top:6px;overflow-wrap:anywhere}.document-text,.daily-full-text{white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:14px;line-height:1.7;margin:0;padding:12px;width:100%}.document-text{max-height:65dvh;overflow:auto}.daily-detail-preview{margin-top:12px;background:#f7fafc;border-radius:8px}.daily-detail-preview img{display:block;width:100%;height:auto;margin-top:10px}.record-readonly-note{font-size:12px;color:#8495a6;margin-top:16px}.modal{width:min(96vw,620px);border-radius:14px}.modal h3{font-size:20px}.modal .btns{gap:8px}
@media(max-width:760px), (pointer:coarse), (hover:none){.mobile-nav-top,.h5top,.h5-account,.h5tabbar{display:none!important}.mobile-nav{position:static;padding:0}.mobile-nav .mobile-module-row,.h5-module-select{margin:0;padding:9px 12px}.h5wrap{max-width:100%;min-height:100dvh}.main,.h5main{padding:10px!important;margin:0!important}.entry-page,.history-page,.record-detail-page{width:100%;max-width:620px!important;margin:0 auto!important;padding:14px!important;background:#fff;border:1px solid #d8e5ed;border-radius:12px}.entry-page .device-panel{padding:0!important}.entry-page .oral-details{max-height:220px}.entry-page .btn{padding:8px 12px}.history-page .entry-heading h1{font-size:18px!important}.history-record .rdate{flex-basis:88px;font-size:11px}.history-time-filter input{width:110px!important}.module-storage-stats svg{width:12px;height:12px}.entry-page .module-storage-stats{font-size:11px!important}.record-detail-page .kv{grid-template-columns:68px minmax(0,1fr);gap:8px;font-size:13px}.detail-page-header h1{font-size:21px}}

.desktop-shell .main>.entry-page,.desktop-shell .main>.history-page,.desktop-shell .main>.record-detail-page{min-height:min(calc(100dvh - 36px),992px)}
.entry-page .device-panel{border:0!important;box-shadow:none!important;background:transparent;padding:0!important;border-radius:0}
.entry-page>.entry-header{order:0}.entry-page>.module-storage-stats{order:1}.entry-page>.entry-layout{order:2}
@media(max-width:760px), (pointer:coarse), (hover:none){.entry-page,.history-page,.record-detail-page{min-height:calc((100vw - 20px)*1.6)}.entry-page:not(.medical-entry-page):not(.oral-entry-page):not(.device-entry-page){display:flex!important;flex-direction:column}.entry-page>.entry-header{width:100%}}

.history-page[data-module="knowledge"] .history-time-filter{display:none}
#hist_time_total{font-size:12px;white-space:nowrap;color:#60798d}

.entry-page .oral-placeholder td{height:15px!important;line-height:15px;padding-top:1px;padding-bottom:1px}
.entry-page .oral-details{max-height:220px}.entry-page .upload-selected-status{display:none}
.entry-page .entry-notes textarea{min-height:60px;height:60px}
.entry-page .fitem>.hint{display:none}

/* Match the proportional pane to the actual outer padding, without blank page overflow. */
@media(min-width:761px) and (pointer:fine) and (hover:hover){.desktop-shell .main{padding:18px 24px}}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .desktop-shell .side{display:none}.desktop-shell .mobile-nav{display:block}.desktop-shell .app{display:block}
 .entry-page,.history-page,.record-detail-page{max-width:min(620px,calc((100dvh - 78px)/1.6))!important;min-height:min(calc((100vw - 20px)*1.6),calc(100dvh - 78px),992px)}
}

@media(max-width:760px), (pointer:coarse), (hover:none){
 .h5wrap{padding-bottom:0!important}
 .mobile-nav .mobile-module-row{display:flex;align-items:center;gap:8px}
 .mobile-nav .mobile-module-row>label{white-space:nowrap}
 .mobile-nav .mobile-module-row>.module-picker{flex:1;min-width:0}
 .mobile-nav .mobile-entry-button{display:none}
 .entry-page,.history-page,.record-detail-page{max-width:min(620px,calc((100dvh - 82px)/1.6))!important;min-height:min(calc((100vw - 20px)*1.6),calc(100dvh - 82px),992px)!important}
}

/* Symmetric desktop rails keep the shared phone pane at the centre of the window. */
@media(min-width:761px) and (pointer:fine) and (hover:hover){
 .desktop-shell{--record-width:min(620px,calc(100dvh/1.6),calc(100vw - 400px))}
 .desktop-shell .app{display:grid;grid-template-columns:minmax(200px,1fr) var(--record-width) minmax(200px,1fr);align-items:start;min-height:100dvh;background:#edf4f9}
 .desktop-shell .side{grid-column:1;grid-row:1;width:100%;height:100dvh;min-width:0;align-items:center;padding:0 12px;overflow:hidden}
 .desktop-shell .side .brand,.desktop-shell .side .sidebar-storage,.desktop-shell .side .nav{width:100%;max-width:240px;flex-shrink:0;margin-left:auto;margin-right:auto}
 .desktop-shell .side .brand{justify-content:center;padding-left:8px;padding-right:8px}
 .desktop-shell .side .nav{flex:0 1 auto;padding:8px 0;overflow-y:auto;scrollbar-width:thin}
 .desktop-shell .side .nav a{justify-content:center}
 .desktop-shell .main{grid-column:2;grid-row:1;width:100%;padding:0!important;background:transparent;min-height:100dvh}
 .desktop-shell .main>.entry-page,.desktop-shell .main>.history-page,.desktop-shell .main>.record-detail-page{max-width:100%;min-height:100dvh;margin:0;border-radius:0}
}
/* Fixed preview and note slots: text and files scroll inside, never stretch the form. */
.entry-page.device-entry-page{height:100dvh;min-height:0!important;padding:20px 24px!important;overflow:hidden;box-shadow:none}
.device-entry-page .device-panel{display:grid!important;grid-template-rows:auto auto auto auto minmax(72px,1fr) auto minmax(80px,.75fr) auto 28px 28px;gap:12px;height:100%;min-height:0}
.device-entry-page #devicePanelTitle{margin:0!important;font-size:24px!important;line-height:1.5}
.device-entry-page .device-panel .module-storage-stats{margin:0!important;padding:4px 0!important;border:0;background:transparent;min-height:25px}
.device-entry-page .device-panel .device-field{margin:0;grid-template-columns:72px minmax(0,1fr);gap:8px;align-items:center;min-height:0}
.device-entry-page .device-panel .device-mode{display:flex;gap:16px;padding:0;margin:0;background:transparent;border:0;width:100%}
.device-entry-page .device-mode button{flex:1;min-width:0;padding:8px 10px;font-size:15px}
.device-entry-page .device-panel .device-upload-unified{height:100%;min-height:0;margin:0;overflow:hidden}
.device-entry-page .device-panel #deviceUploadPreview{height:100%!important;min-height:0!important;max-height:100%;padding:0!important;border:0!important;background:transparent;overflow:hidden;display:block}
.device-entry-page .device-panel #deviceUploadPreview .upload-feedback{height:100%;max-height:100%!important;min-height:0;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:thin;gap:2px;align-content:start;padding:0 4px 0 0}
.device-entry-page #deviceUploadPreview .upload-file-row{padding:1px 0!important;gap:6px;border:0;background:transparent;align-items:flex-start;min-height:24px}
.device-entry-page #deviceUploadPreview .upload-selected-name{font-size:15px;line-height:1.5;white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
.device-entry-page .device-panel #fl_device[hidden]{display:none!important}
.device-entry-page .device-panel .device-note{display:flex;flex-direction:column;align-items:stretch;gap:5px;height:100%;min-height:0}
.device-note-heading{display:flex;align-items:center;justify-content:space-between;flex:0 0 24px}
.device-note-heading .voice-btn{font-size:0;padding:3px 7px;margin:0}.device-note-heading .voice-btn svg{width:18px;height:18px}
.device-entry-page .device-note-control{flex:1;min-height:0;display:block}
.device-entry-page .device-panel #dev_note{height:100%!important;min-height:0!important;max-height:100%;width:100%;resize:none;overflow:auto;overscroll-behavior:contain;padding:8px 10px;font-size:15px;line-height:1.6}
.device-entry-page .device-panel .device-buttons{margin:0;gap:12px;align-items:center}
.device-entry-page .device-buttons .device-history{margin-left:auto}
.device-entry-page .device-panel .device-result{height:28px;min-height:0;max-height:28px;margin:0;padding:0;overflow:auto;font-size:13px}
.device-entry-page .device-result>div{line-height:1.4;gap:0 5px}.device-entry-page .device-result b,.device-entry-page .device-result p{font-size:13px}
.device-entry-page #medicalLatest{display:flex!important;align-items:center;flex-wrap:nowrap;gap:6px;height:28px;min-height:0;max-height:28px;overflow:hidden;white-space:nowrap;margin:0;padding:0;border:0;font-size:12px}
.device-entry-page #medicalLatest[hidden]{visibility:hidden}
.device-entry-page #medicalLatest b{overflow:hidden;text-overflow:ellipsis;min-width:0}.device-entry-page #medicalLatest .btn{padding:3px 7px;font-size:12px;flex-shrink:0}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .desktop-shell .app:has(.device-entry-page),.h5wrap:has(.device-entry-page){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .main:has(.device-entry-page),.h5main:has(.device-entry-page){flex:1;min-height:0;overflow:hidden;padding:0 10px!important}
 .entry-page.device-entry-page{height:100%!important;max-width:100%!important;min-height:0!important;margin:0!important;padding:14px!important;border-radius:0}
 .device-entry-page .device-panel{gap:10px}.device-entry-page .device-panel .device-field{grid-template-columns:68px minmax(0,1fr)}
 .device-entry-page .device-panel .device-mode{gap:10px}
}
@media(max-height:680px){
 .entry-page.device-entry-page{padding:12px 16px!important}
 .device-entry-page .device-panel{gap:7px;grid-template-rows:auto auto auto auto minmax(50px,1fr) auto minmax(56px,.75fr) auto 24px 24px}
 .device-entry-page .device-panel input{min-height:34px;padding-top:5px;padding-bottom:5px}
 .device-entry-page .device-panel .device-mode button,.device-entry-page .device-buttons .btn{padding-top:6px;padding-bottom:6px}
 .device-entry-page #devicePanelTitle{font-size:24px!important;line-height:1.35}
 .device-entry-page .device-result,.device-entry-page #medicalLatest{height:24px;max-height:24px}
}

.device-entry-page #deviceUploadPreview .upload-file-row{flex:0 0 auto;height:auto}
@media(max-height:680px) and (min-width:761px){.desktop-shell .side .nav a{padding-top:6px;padding-bottom:6px}}

/* History and detail headers share one back symbol and a fixed content viewport. */
.history-page .history-header,.detail-page-header{display:grid;grid-template-columns:32px minmax(0,1fr) 32px;align-items:center;gap:7px;margin:0 0 12px}
.history-header h1,.detail-page-header h1{text-align:center;font-size:21px!important;min-width:0;margin:0!important}
.history-header .back-arrow,.detail-page-header .back-arrow,.detail-page-header>.danger{display:flex;align-items:center;justify-content:center;width:32px;height:34px;padding:4px;border:0;background:transparent;border-radius:6px;box-shadow:none}
.back-arrow svg{width:24px;height:24px}.detail-page-header>.danger svg{width:20px;height:20px}.header-spacer{width:32px}
.history-page.device-history-page,.record-detail-page.device-detail-page{height:100dvh;min-height:0!important;padding:20px 24px!important;overflow:hidden}
.history-page.device-history-page{display:flex!important;flex-direction:column;gap:10px}
.device-history-page .history-header{flex:0 0 auto;margin:0}
.device-history-heading{display:flex;align-items:center;justify-content:center;gap:4px;white-space:nowrap}
.device-history-heading>.filter-picker{min-width:0;max-width:58%;width:auto}.device-history-heading .filter-trigger{border:0;padding:0;min-height:32px;background:transparent;font-size:21px;font-weight:700;gap:3px;box-shadow:none}
.device-history-heading .filter-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.device-history-heading .filter-menu{width:240px;max-width:75vw;left:0;right:auto;font-weight:400;font-size:14px}
.device-history-page .toolbar{display:flex;flex-direction:row;align-items:center;gap:8px;margin:0;flex-shrink:0}.device-history-page .search{min-width:0;flex:1}.device-history-page .search input{padding:8px 9px 8px 32px;font-size:14px}
.device-history-page #hist_time_total{font-size:12px}.device-history-page .history-time-filter{display:grid;grid-template-columns:88px minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:6px;flex-shrink:0;margin:0;font-size:12px}
.device-history-page .history-time-filter>span:first-child{display:none}.device-history-page .history-time-filter>.filter-picker{grid-column:1;width:100%;max-width:none}
.device-history-page .history-date-start{grid-column:2}.device-history-page .history-date-separator{grid-column:3}.device-history-page .history-date-end{grid-column:4}
.device-history-page .history-time-filter input{width:100%!important;height:33px;min-width:0;padding:4px;font-size:12px}.device-history-page .history-time-filter .filter-trigger{font-size:12px;padding:5px 7px;min-height:33px}
.device-history-page #rlist{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;border-top:1px solid #9dbacb;padding-top:5px}
.device-history-page #rlist>.rlist{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;display:block}
.device-history-page .history-record{padding:3px 0!important;gap:8px;border:0!important;line-height:1.5}
.device-history-page .history-record .rdate{flex:0 0 112px;width:112px;font-size:12px;line-height:1.5}
.device-history-page .history-record .rbody{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;min-width:0;line-height:1.5}
.device-record-name{font-size:14px;font-weight:600;flex-shrink:0}.device-record-file{font-size:13px;overflow-wrap:anywhere;min-width:0;flex:1 1 130px}
.device-history-page .history-pagination{flex:0 0 auto;margin-top:6px!important;gap:6px!important}.device-history-page .history-pagination .btn{padding:5px 9px;font-size:12px}.device-history-page .history-pagination>span{font-size:12px}
.device-history-page .rempty{flex:1;overflow:auto}
.device-detail-page{display:grid!important;grid-template-rows:auto auto minmax(82px,.55fr) minmax(120px,1fr);gap:12px}
.device-detail-page .detail-page-header{margin:0}.device-detail-page>.record-readonly-note{display:none}
.device-detail-meta{min-width:0;max-height:210px;overflow:auto;font-size:13px;line-height:1.6}
.device-detail-page .kv{grid-template-columns:62px minmax(0,1fr);gap:6px 8px;font-size:13px}.device-detail-page .device-source-name{max-height:42px;overflow:auto}
.device-detail-times{display:grid;grid-template-columns:62px minmax(0,1fr) 55px minmax(0,1fr);gap:5px 8px;align-items:start;margin-top:7px;font-size:12px}
.device-detail-times>span,.device-note-summary>span{color:#8195a4}.device-detail-times time{overflow-wrap:anywhere}
.device-note-summary{display:grid;grid-template-columns:62px minmax(0,1fr);gap:8px;margin-top:6px}.device-note-summary>div{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.device-detail-description{min-height:0;overflow:hidden;border:1px dashed #c9d8e2;border-radius:8px;padding:8px}
.device-description-scroll{height:100%;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;font-size:13px;line-height:1.6}.device-description-scroll p{white-space:pre-wrap;overflow-wrap:anywhere;margin:2px 0 7px}.device-description-scroll .import-file-summary{font-size:12px;margin:4px 0}
.device-detail-data{display:flex;flex-direction:column;min-height:0;overflow:hidden}.device-detail-data .detail-readings-title{margin:0 0 5px;flex-shrink:0;font-size:14px}.device-detail-data .detail-readings-title span{font-size:12px}
.device-detail-page #deviceReadings{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.device-detail-page .readings-scroll{flex:1;min-height:0;max-height:none;overflow:auto;border:0;border-radius:0;overscroll-behavior:contain;scrollbar-width:thin}
.device-detail-page .readings-table{min-width:520px;font-size:12px;border:0;border-collapse:collapse}
.device-detail-page .readings-table th,.device-detail-page .readings-table td{height:auto;white-space:nowrap;padding:3px 5px;border:0;line-height:1.5;text-align:left}
.device-detail-page .readings-table th{position:sticky;top:0;background:#f2f7fa}.device-detail-page .readings-pager{flex-shrink:0;gap:6px;margin-top:6px;font-size:12px}.device-detail-page .readings-pager .btn{padding:4px 7px;font-size:12px}
.device-detail-page #recordMedia{flex:1;min-height:0;margin:0;display:flex;flex-direction:column;overflow:hidden}.device-detail-page .media-toolbar{flex-shrink:0}.device-detail-page .media-content{flex:1;min-height:0;overflow:auto}.device-detail-page .media-content img{max-height:100%;height:100%;object-fit:contain}.device-detail-page .media-name{flex-shrink:0;max-height:20px;overflow:hidden}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .desktop-shell .app:has(.device-history-page),.desktop-shell .app:has(.device-detail-page),.h5wrap:has(.device-history-page),.h5wrap:has(.device-detail-page){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .main:has(.device-history-page),.main:has(.device-detail-page),.h5main:has(.device-history-page),.h5main:has(.device-detail-page){flex:1;min-height:0;overflow:hidden;padding:0 10px!important}
 .history-page.device-history-page,.record-detail-page.device-detail-page{height:100%;min-height:0!important;max-width:100%!important;margin:0!important;padding:14px!important;border-radius:0}
 .device-history-page .history-time-filter{grid-template-columns:78px minmax(0,1fr) auto minmax(0,1fr);gap:4px}.device-history-page .history-time-filter input{font-size:11px}
 .device-history-heading .filter-trigger,.device-history-page .history-header h1{font-size:19px!important}.device-history-page .history-record .rdate{flex-basis:99px;width:99px;font-size:11px}
 .device-detail-page{gap:9px}.device-detail-meta{max-height:180px}.device-detail-times{grid-template-columns:53px minmax(0,1fr) 50px minmax(0,1fr);gap:5px;font-size:11px}
}
@media(max-height:680px){.history-page.device-history-page,.record-detail-page.device-detail-page{padding:10px 14px!important;gap:7px}.device-detail-meta{max-height:151px}.device-detail-page{grid-template-rows:auto auto minmax(60px,.5fr) minmax(90px,1fr)}}

.device-history-page .history-time-filter>.filter-picker{min-width:0}

/* Align the device history/detail typography and spacing with the supplied mockup. */
.history-page.device-history-page,.record-detail-page.device-detail-page{padding:clamp(28px,4.2dvh,44px) 30px 22px!important}
.device-history-page{gap:13px!important}
.device-history-page .history-header,.device-detail-page .detail-page-header{grid-template-columns:36px minmax(0,1fr) 36px;gap:8px;min-height:36px}
.device-history-page .history-header h1,.device-detail-page .detail-page-header h1,.device-history-heading .filter-trigger{font-size:24px!important;line-height:1.4;font-weight:700}
.device-history-page .back-arrow,.device-detail-page .back-arrow,.device-detail-page .detail-page-header>.danger{width:36px;height:36px;padding:5px;border:0!important;background:transparent!important;box-shadow:none!important}
.device-history-page .header-spacer{width:36px}
.device-history-page .search input{height:40px;font-size:15px;padding-top:7px;padding-bottom:7px}
.device-history-page #hist_time_total{font-size:13px;color:#33455b}
.device-history-page .history-time-filter{grid-template-columns:100px minmax(0,1fr) auto minmax(0,1fr);gap:7px;color:#33455b}
.device-history-page .history-time-filter input,.device-history-page .history-time-filter .filter-trigger{height:35px;min-height:35px;font-size:13px;line-height:1.4}
.device-history-page .history-time-filter .filter-trigger{gap:4px;padding:5px 7px}
.device-history-page #rlist{padding-top:7px;border-top-color:#8fa8c0}
.device-history-page .history-record{padding:4px 0!important;gap:9px;align-items:baseline;line-height:1.45}
.device-history-page .history-record .rdate{flex:0 0 128px;width:128px;font-size:14px;line-height:1.45;color:#26374d}
.device-history-page .history-record .rbody{gap:7px;line-height:1.45}
.device-history-page .device-record-name{font-size:15px;font-weight:500}
.device-history-page .device-record-file{font-size:14px;line-height:1.45;color:#26374d}
.device-history-page .history-pagination{padding-top:4px}
.device-history-page .history-pagination .btn,.device-history-page .history-pagination>span{font-size:13px}
.device-detail-page{gap:14px}
.device-detail-meta{max-height:245px;font-size:15px;line-height:1.5}
.device-detail-page .kv{grid-template-columns:66px minmax(0,1fr);gap:8px 9px;font-size:15px;line-height:1.5}
.device-detail-page .kv .k,.device-detail-times>span,.device-note-summary>span{color:#293b50;font-weight:400}
.device-detail-page .device-source-name{max-height:45px}
.device-detail-times{grid-template-columns:66px minmax(0,1fr) 60px minmax(0,1fr);gap:6px 9px;margin-top:9px;font-size:13px;line-height:1.5}
.device-note-summary{grid-template-columns:66px minmax(0,1fr);gap:9px;margin-top:8px;font-size:15px;line-height:1.5}
.device-detail-description{padding:10px 11px;border-color:#b9c9d7;border-radius:7px}
.device-description-scroll{font-size:15px;line-height:1.5;color:#26374d}
.device-description-scroll>b{font-size:15px;font-weight:500}
.device-description-scroll p{margin:3px 0 8px}
.device-description-scroll .import-file-summary{font-size:13px;line-height:1.5}
.device-detail-data .detail-readings-title{font-size:16px;line-height:1.5;margin-bottom:6px}
.device-detail-data .detail-readings-title span{font-size:13px;color:#41546c}
.device-detail-page .readings-table{font-size:14px}
.device-detail-page .readings-table th,.device-detail-page .readings-table td{padding:2px 6px;line-height:1.45;font-weight:400}
.device-detail-page .readings-table th{font-weight:500;color:#354961}
.device-detail-page .readings-pager,.device-detail-page .readings-pager .btn{font-size:13px}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .history-page.device-history-page,.record-detail-page.device-detail-page{padding:24px 18px 16px!important}
 .device-history-page{gap:11px!important}
 .device-history-page .history-header h1,.device-detail-page .detail-page-header h1,.device-history-heading .filter-trigger{font-size:22px!important}
 .device-history-page .history-header,.device-detail-page .detail-page-header{grid-template-columns:32px minmax(0,1fr) 32px;gap:5px}
 .device-history-page .back-arrow,.device-detail-page .back-arrow,.device-detail-page .detail-page-header>.danger{width:32px;height:34px}
 .device-history-page .header-spacer{width:32px}
 .device-history-page .history-time-filter{grid-template-columns:88px minmax(0,1fr) auto minmax(0,1fr);gap:5px}
 .device-history-page .history-record .rdate{flex-basis:121px;width:121px;font-size:13px}
 .device-detail-page{gap:11px}
 .device-detail-meta{max-height:220px}
 .device-detail-times{grid-template-columns:59px minmax(0,1fr) 55px minmax(0,1fr);gap:5px;font-size:12px}
 .device-detail-page .kv,.device-note-summary{grid-template-columns:59px minmax(0,1fr);gap:7px 8px;font-size:14px}
 .device-description-scroll{font-size:14px}
 .device-detail-page .readings-table{font-size:13px}
}
@media(max-width:350px){
 .history-page.device-history-page,.record-detail-page.device-detail-page{padding-left:12px!important;padding-right:12px!important}
 .device-history-page .history-header h1,.device-history-heading .filter-trigger{font-size:20px!important}
 .device-history-page .history-time-filter{grid-template-columns:78px minmax(0,1fr) auto minmax(0,1fr);gap:4px}
 .device-history-page .history-time-filter input{font-size:11.5px;padding:3px}
 .device-history-page .history-time-filter .filter-trigger{font-size:12px;padding:4px}
 .device-history-page .history-record .rdate{flex-basis:107px;width:107px;font-size:12px}
 .device-history-page .device-record-name,.device-history-page .device-record-file{font-size:13px}
 .device-detail-page .kv,.device-note-summary{grid-template-columns:53px minmax(0,1fr);font-size:14px}
 .device-detail-times{grid-template-columns:49px minmax(0,1fr) 49px minmax(0,1fr);font-size:11.5px}
}
@media(max-height:680px){
 .history-page.device-history-page,.record-detail-page.device-detail-page{padding-top:16px!important;padding-bottom:12px!important}
 .device-history-page{gap:8px!important}.device-detail-page{gap:9px}
 .device-detail-meta{max-height:185px}
}

.device-history-page .history-time-filter .filter-trigger{gap:2px;padding-left:4px;padding-right:4px;font-size:12.5px}
.device-history-page .history-time-filter .filter-trigger svg{width:14px;height:14px}
.device-detail-times time{overflow-wrap:normal;word-break:normal}
@media(max-width:350px){.device-detail-times{grid-template-columns:53px minmax(0,1fr);font-size:12px;gap:5px 8px}}
/* Oral entry: stable list viewport, compact headerless details and one-line results. */
.entry-page.oral-entry-page{height:100dvh;min-height:0!important;padding:28px 24px!important;overflow:hidden}
.oral-entry-page .oral-panel.entry-card{display:flex!important;flex-direction:column;height:100%;min-height:0;gap:12px}
.oral-panel>*{flex-shrink:0}
.oral-panel h1{font-size:24px;line-height:1.5;margin:0}
.oral-panel .module-storage-stats{margin:0!important;padding:4px 0!important;border:0;background:transparent}
.oral-panel .chips,.oral-panel .oral-template-row,.oral-panel .oral-library-actions,.oral-panel .oral-field,.oral-panel .oral-actions{margin:0}
.oral-panel .oral-details{flex:1 1 0;min-height:60px;max-height:none;height:0;overflow:auto;margin:0;border:0;border-top:1px solid #b8cdd8;border-bottom:1px solid #b8cdd8;overscroll-behavior:contain;scrollbar-width:thin}
.oral-details .oral-qty-col{width:76px}.oral-details .oral-detail-unit-col{width:44px}.oral-details .oral-action-col{width:26px}
.oral-details td{height:auto;padding:3px 3px;line-height:1.5;border:0;font-size:15px;vertical-align:middle}
.oral-details .oral-item-name{line-height:1.5}.oral-details .oral-item-cell{align-items:flex-start}
.oral-panel .oral-note textarea{height:38px;min-height:38px;max-height:38px;resize:none;overflow:auto}
.oral-library-actions{align-items:center;gap:6px;flex-wrap:wrap}
.oral-ingredient-actions{gap:6px;flex-wrap:wrap}
.oral-library-actions .btn{font-size:12px;padding:6px 7px!important;white-space:nowrap}
.oral-library-actions [hidden]{display:none!important}
.oral-panel .oral-actions{gap:10px}
.oral-panel #oralResult:empty,.entry-page #medicalResult:empty{display:none}
.entry-page #medicalLatest:not([hidden]){display:block;min-width:0;margin:0;padding:0;border:0;height:26px;min-height:26px;overflow:hidden}
.entry-page .entry-saved-summary{display:flex;align-items:center;gap:7px;width:100%;height:26px;min-width:0;padding:0;border:0;background:transparent;text-align:left;color:#36576a;font:inherit;font-size:13px;line-height:1.5;cursor:pointer}
.entry-saved-summary time{flex-shrink:0}.entry-saved-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.entry-status-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex:0 0 18px;background:#387b6b;color:white;border-radius:50%;font-size:13px}
.entry-page .entry-save-error{color:#b64b54!important;display:flex;align-items:center;gap:7px;font-size:13px;max-height:40px;overflow:auto;margin:0;padding:0;border:0;background:transparent}
.entry-save-error .entry-status-icon{background:#b64b54}
.entry-page #medicalLatest[hidden],.entry-page #medicalResult[hidden],.entry-page #oralResult[hidden],.entry-page #deviceResult[hidden]{display:none!important}
/* Device grid keeps its reserved slots when the result is empty. */
.device-entry-page #deviceResult[hidden]{display:block!important;visibility:hidden}
.device-entry-page #medicalLatest[hidden]{display:flex!important;visibility:hidden}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .desktop-shell .app:has(.oral-entry-page),.h5wrap:has(.oral-entry-page){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .main:has(.oral-entry-page),.h5main:has(.oral-entry-page){flex:1;min-height:0;overflow:hidden;padding:0 10px!important}
 .entry-page.oral-entry-page{height:100%!important;max-width:100%!important;min-height:0!important;margin:0!important;padding:20px 16px!important;border-radius:0}
 .oral-entry-page .oral-panel.entry-card{gap:10px}.oral-panel h1{font-size:22px}
 .oral-details td{font-size:14px}.oral-details .oral-qty-col{width:62px}.oral-details .oral-detail-unit-col{width:32px}.oral-details .oral-action-col{width:24px}
}
@media(max-height:680px){
 .entry-page.oral-entry-page{padding:12px!important}.oral-entry-page .oral-panel.entry-card{gap:7px}
 .oral-panel .chip{padding:5px 0}.oral-panel .oral-field input{min-height:32px;padding-top:4px;padding-bottom:4px}
 .oral-panel .oral-actions .btn{padding:6px 10px}.oral-panel .oral-template-row select{min-height:32px;height:32px}
 .oral-panel h1{font-size:22px}.oral-panel .oral-note textarea{height:34px;min-height:34px;max-height:34px}
}
.entry-page [id$="_delete_template"][hidden]{display:none!important}
.entry-page [id$="_delete_template"]{margin-left:auto}
/* Oral catalog shares the central viewport and scrolls only its compact list. */
.oral-library-page{display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden;background:#fff;padding:28px 24px;gap:14px}
.oral-library-header{display:grid;grid-template-columns:34px minmax(0,1fr) 72px;align-items:center;gap:7px;flex-shrink:0}
.oral-library-header h1,.oral-library-header h3{display:flex;align-items:center;justify-content:center;gap:3px;font-size:23px;line-height:1.5;margin:0;white-space:nowrap}
.oral-library-header select{font:inherit;font-weight:600;min-width:0;max-width:132px;height:auto;padding:2px 16px 2px 3px;border:0;border-radius:0;background-color:transparent;color:inherit}
.oral-library-header .btn{padding:5px 7px;font-size:13px;white-space:nowrap}
.oral-library-page .oral-library-toolbar{flex-shrink:0;margin:0;display:flex;justify-content:space-between;gap:8px;align-items:center}
.oral-library-page .oral-library-toolbar input{width:55%;min-width:0;font-size:14px}.oral-library-page .oral-library-toolbar span{font-size:12px;white-space:nowrap}
.oral-library-page .oral-library-table{flex:1;min-height:0;max-height:none;overflow:auto;border:0;border-top:1px solid #b8cdd8;border-bottom:1px solid #b8cdd8;border-radius:0;scrollbar-width:thin;overscroll-behavior:contain}
.oral-library-page .oral-library-table table{width:100%;table-layout:fixed;border-collapse:collapse}
.oral-library-page .oral-library-table td{padding:4px 3px;vertical-align:top;border:0;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.oral-library-page .oral-check-col{width:23px}.oral-library-page .oral-unit-col{width:62px}.oral-library-page .oral-image-col{width:29px}
.oral-library-page .oral-library-select{font-size:inherit;text-align:left;line-height:inherit;padding:0}
.oral-library-page footer{display:flex;justify-content:flex-end;flex-shrink:0}
.oral-picture-marker{padding:1px;color:#1592a6;display:inline-flex;vertical-align:middle}.oral-picture-marker svg{width:19px;height:19px}
.modal.oral-item-modal{width:520px;max-width:94vw}.oral-item-modal>.oral-library-toolbar{display:none}
.oral-item-modal .oral-library-header{margin-bottom:14px}.oral-item-modal .oral-library-header h3{font-size:21px;margin:0}
.oral-item-modal .oral-item-form{grid-template-columns:62px minmax(0,1fr)}
.oral-item-modal .oral-item-image-preview{min-height:120px;max-height:200px;overflow:auto;border:1px dashed #c3d3de;border-radius:6px;padding:6px}
.oral-image-add{display:grid;place-items:center;min-height:104px;min-width:72px;flex:1;font-size:32px;background:transparent;border:0;color:#7995a4;cursor:pointer}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .desktop-shell .app:has(.oral-library-page),.h5wrap:has(.oral-library-page){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .main:has(.oral-library-page),.h5main:has(.oral-library-page){flex:1;min-height:0;overflow:hidden;padding:0 10px!important}
 .oral-library-page{height:100%;padding:20px 12px;gap:12px}
 .oral-library-header{grid-template-columns:28px minmax(0,1fr) 61px;gap:3px}.oral-library-header h1{font-size:21px}
 .oral-library-header select{max-width:112px}.oral-library-header .btn{font-size:12px;padding:5px}
 .oral-library-page .oral-library-table td{font-size:13px}.oral-library-page .oral-unit-col{width:50px}
}
.oral-preset-fields{display:grid;grid-template-columns:minmax(58px,.7fr) 30px minmax(0,1fr);gap:7px;align-items:center;min-width:0}
.oral-preset-fields>input,.oral-preset-fields>div{min-width:0;width:100%}.oral-preset-fields>label{font-size:14px}
.oral-item-modal .oral-modal-actions{display:none}.oral-item-feedback:empty{display:none}
.oral-history-page .history-time-filter{grid-template-columns:100px minmax(0,1fr) auto minmax(0,1fr)}
.oral-history-page .history-record{align-items:baseline;gap:8px}
.oral-history-page .history-record .rdate{flex:0 0 135px;width:135px;font-size:13px;white-space:nowrap}
.oral-history-page .history-record .rbody{min-width:0}.oral-history-page .history-record .rt{font-size:14px;font-weight:400}
.oral-record-detail-page,.oral-archive-page{display:flex!important;flex-direction:column;height:100dvh;min-height:0!important;overflow:hidden;background:#fff;padding:28px 24px!important;gap:14px}
.oral-record-detail-page .detail-page-header,.oral-archive-page .detail-page-header{display:grid;grid-template-columns:32px minmax(0,1fr) 32px;align-items:center;margin:0;flex-shrink:0;text-align:center}
.oral-record-detail-page .detail-page-header h1,.oral-archive-page .detail-page-header h1{font-size:24px}
.oral-record-times{display:grid;grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr);font-size:12px;gap:5px;flex-shrink:0}
.oral-record-times>span,.oral-record-note>span,.oral-archive-field>span,.oral-archive-description>span{color:#7a8d9b}
.oral-record-note{display:grid;grid-template-columns:34px minmax(0,1fr);gap:8px;min-height:25px;max-height:90px;flex-shrink:0;font-size:14px}.oral-record-note p{white-space:pre-wrap;overflow:auto;margin:0;line-height:1.5;overflow-wrap:anywhere}
.oral-record-items{min-height:0;flex:1;overflow:auto;border-top:1px solid #b8cdd8;border-bottom:1px solid #b8cdd8;overscroll-behavior:contain;scrollbar-width:thin}
.oral-record-item{display:grid;grid-template-columns:minmax(0,1fr) 60px 38px;gap:8px;text-align:left;align-items:start;background:transparent;border:0;padding:4px 0;width:100%;font:inherit;font-size:15px;line-height:1.5;color:var(--ink);cursor:pointer}
.oral-record-item>span{overflow-wrap:anywhere}.oral-record-item:focus-visible{outline:2px solid #0e7490;outline-offset:-2px}
.oral-record-detail-page>.record-readonly-note{display:none}
.oral-archive-field{display:grid;grid-template-columns:70px minmax(0,1fr);gap:8px;align-items:center;font-size:14px;flex-shrink:0}
.oral-archive-field>div{background:#f7fafc;padding:7px 9px;min-height:35px;overflow-wrap:anywhere}
.oral-archive-preset{grid-template-columns:58px minmax(0,1fr) 32px minmax(0,1fr)}
.oral-archive-description{display:flex;flex-direction:column;gap:7px;height:110px;flex-shrink:0;font-size:14px}
.oral-archive-description>div{flex:1;min-height:0;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;padding:8px;background:#f7fafc;scrollbar-width:thin}
.oral-archive-images{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}
.oral-archive-images img{display:block;width:100%;height:auto;margin-bottom:8px}
.oral-snapshot-notice{font-size:12px;color:#8495a6;margin:0;flex-shrink:0}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .desktop-shell .app:has(.oral-record-detail-page,.oral-archive-page),.h5wrap:has(.oral-record-detail-page,.oral-archive-page){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .main:has(.oral-record-detail-page,.oral-archive-page),.h5main:has(.oral-record-detail-page,.oral-archive-page){flex:1;min-height:0;overflow:hidden;padding:0 10px!important}
 .oral-record-detail-page,.oral-archive-page{height:100%!important;min-height:0!important;max-width:100%!important;margin:0!important;padding:20px 14px!important;border-radius:0;gap:12px}
 .oral-record-detail-page .detail-page-header h1,.oral-archive-page .detail-page-header h1{font-size:22px}
 .oral-history-page .history-time-filter{grid-template-columns:83px minmax(0,1fr) auto minmax(0,1fr)}
 .oral-history-page .history-record .rdate{flex-basis:119px;width:119px;font-size:12px}.oral-history-page .history-record .rt{font-size:13px}
 .oral-record-times{grid-template-columns:55px minmax(0,1fr);font-size:13px}.oral-record-item{font-size:14px;grid-template-columns:minmax(0,1fr) 45px 30px}
}
/* Shared exercise/physical entry: fixed central pane and compact editable rows. */
.entry-page.parameter-entry-page{height:100dvh;min-height:0!important;padding:28px 24px!important;overflow:hidden}
.parameter-entry-page .parameter-panel.entry-card{display:flex!important;flex-direction:column;gap:14px;height:100%;min-height:0}
.parameter-panel>*{flex-shrink:0}
.parameter-panel h1{font-size:24px;line-height:1.5;text-align:center;margin:0}
.parameter-panel .module-storage-stats{margin:0!important;padding:4px 0!important;border:0;background:transparent}
.parameter-template-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto auto;gap:8px;align-items:center}
.parameter-template-row select{min-width:0;width:100%;height:36px}
.parameter-template-row label,.parameter-field>label{font-size:15px;margin:0;white-space:nowrap}
.parameter-template-row .btn{padding:6px 10px;font-size:13px}
.parameter-entry-page .entry-card .dlist{flex:1 1 0;height:0;min-height:64px;max-height:none;overflow:auto;background:transparent;border:0;border-top:1px solid #b8cdd8;border-bottom:1px solid #b8cdd8;border-radius:0;overscroll-behavior:contain;scrollbar-width:thin}
.parameter-entry-page .drow{display:grid;grid-template-columns:20px minmax(72px,.7fr) minmax(0,1.5fr) 18px;align-items:start;gap:5px;padding:4px 0;border:0;background:transparent;border-radius:0;font-size:14px;line-height:1.5}
.parameter-entry-page .drow .pname{margin:0;padding:1px 0;min-width:0;max-width:none;background:transparent;border:0;font:inherit;text-align:left;white-space:normal;overflow-wrap:anywhere;color:var(--ink);cursor:pointer}
.parameter-entry-page .drow .del{border:0;background:transparent;color:#8a9caa;padding:0;width:18px;height:25px;font-size:18px;cursor:pointer}
.parameter-entry-page .drow .detail-drag-handle{width:20px;flex-basis:20px;align-self:start;padding:2px}
.parameter-entry-page .exercise-detail-params{display:flex;flex-wrap:wrap;gap:4px 8px;margin:0;min-width:0}
.parameter-entry-page .exercise-detail-param{display:inline-flex;align-items:center;gap:3px;font-size:13px;line-height:1.5;white-space:nowrap}
.parameter-entry-page .exercise-detail-param input[type=number]{width:54px;min-width:0;min-height:25px;height:25px;padding:2px 3px;border:1px solid #dce6ed;border-radius:4px;font-size:13px}
.parameter-entry-page .exercise-param-unit{font-size:12px;color:#72899a}
.parameter-library-actions,.parameter-actions{display:flex;align-items:center;gap:10px;margin:0}
.parameter-library-actions .btn{padding:6px 10px;font-size:13px}
.parameter-field{display:grid;grid-template-columns:72px minmax(0,1fr);gap:8px;align-items:center}
.parameter-field>input{min-width:0;width:100%}
.parameter-note{display:flex;align-items:center;gap:6px;min-width:0}
.parameter-note textarea{height:36px;min-height:36px;max-height:36px;flex:1;min-width:0;padding:6px 9px;resize:none;overflow:auto;line-height:1.5}
.parameter-note .voice-btn{font-size:0;padding:5px;margin:0}.parameter-note .voice-btn svg{width:17px;height:17px}
.parameter-actions>.btn:last-child{margin-left:auto}
.parameter-status{height:27px;min-height:27px;max-height:27px;overflow:auto;flex-shrink:0}
.parameter-status #medicalResult{margin:0;padding:0}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .desktop-shell .app:has(.parameter-entry-page),.h5wrap:has(.parameter-entry-page){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .main:has(.parameter-entry-page),.h5main:has(.parameter-entry-page){flex:1;min-height:0;overflow:hidden;padding:0 10px!important}
 .entry-page.parameter-entry-page{height:100%!important;min-height:0!important;max-width:100%!important;margin:0!important;padding:20px 14px!important;border-radius:0}
 .parameter-entry-page .parameter-panel.entry-card{gap:12px}.parameter-panel h1{font-size:22px}
 .parameter-template-row{grid-template-columns:32px minmax(0,1fr) auto auto;gap:5px}.parameter-template-row .btn{padding:6px 7px;font-size:12px}
 .parameter-field{grid-template-columns:64px minmax(0,1fr)}
 .parameter-entry-page .drow{grid-template-columns:18px minmax(60px,.7fr) minmax(0,1.4fr) 16px;gap:4px;font-size:14px}
 .parameter-entry-page .exercise-detail-params{gap:3px 5px}.parameter-entry-page .exercise-detail-param{font-size:12px;gap:3px}
 .parameter-entry-page .exercise-detail-param input[type=number]{width:48px;font-size:13px}
}
@media(max-height:680px){
 .entry-page.parameter-entry-page{padding:12px!important}.parameter-entry-page .parameter-panel.entry-card{gap:8px}
 .parameter-field>input{height:34px;min-height:34px;padding-top:4px;padding-bottom:4px}
 .parameter-actions .btn{padding:6px 10px}.parameter-template-row select{height:32px;min-height:32px}
 .parameter-note textarea{height:34px;min-height:34px;max-height:34px}
}
.parameter-library-page .parameter-name-col{width:38%}
.parameter-library-page td label{cursor:pointer}.parameter-library-page td{font-weight:400}
.modal.parameter-item-modal{width:500px;max-width:94vw;padding:20px;overflow:auto}
.parameter-item-modal .oral-library-header{margin-bottom:16px;grid-template-columns:30px minmax(0,1fr) 38px}
.parameter-item-modal .oral-library-header h3{font-size:22px;margin:0}
.parameter-item-name{display:grid;grid-template-columns:65px minmax(0,1fr);gap:8px;align-items:center;margin:12px 0;font-size:14px}
.parameter-item-name input{min-width:0;width:100%}
.parameter-item-parameters{display:grid;grid-template-columns:80px minmax(0,1fr);gap:8px;align-items:start}
.parameter-item-parameters>.btn{font-size:12px;padding:7px 5px;white-space:nowrap}
.parameter-item-modal #newItemParams{min-height:152px;min-width:0}
.parameter-item-modal .new-item-param{display:grid;grid-template-columns:minmax(0,1fr) minmax(45px,.75fr) 48px 20px;align-items:center;gap:6px;margin:0 0 6px;height:32px}
.parameter-item-modal .new-item-param select,.parameter-item-modal .new-item-param input{min-width:0;width:100%;min-height:30px;height:30px;padding:3px 4px;font-size:13px}
.parameter-item-modal .new-item-param input[readonly]{background:#f2f6f9;color:#6c8090;text-align:center}
.parameter-item-modal .new-item-param button{padding:0;border:0;background:transparent;font-size:18px;width:20px;height:30px}
#parameterItemFeedback{font-size:13px;color:#b64b54;line-height:1.5}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .parameter-library-page .oral-library-header h1{font-size:19px}
 .modal.parameter-item-modal{padding:16px 12px}
 .parameter-item-parameters{grid-template-columns:66px minmax(0,1fr);gap:5px}
 .parameter-item-parameters>.btn{font-size:11px}
 .parameter-item-modal .new-item-param{grid-template-columns:minmax(0,1fr) minmax(36px,.7fr) 40px 16px;gap:3px}
 .parameter-item-modal .new-item-param select,.parameter-item-modal .new-item-param input{font-size:12px;padding:3px 2px}
 .parameter-item-name{grid-template-columns:60px minmax(0,1fr);gap:5px}
}
.parameter-record-item{grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr);gap:10px}
.parameter-archive-presets{display:grid;grid-template-columns:70px minmax(0,1fr);gap:8px;flex:0 1 auto;max-height:180px;min-height:35px;font-size:14px;overflow:auto}
.parameter-archive-presets>span,.parameter-archive-note>span{color:#7a8d9b}
.parameter-archive-presets>div>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.75fr) 46px;gap:8px;padding:5px 0;line-height:1.5;overflow-wrap:anywhere}
.parameter-archive-note{display:flex;flex-direction:column;gap:8px;flex:1;min-height:0;font-size:14px}
.parameter-archive-note>div{flex:1;min-height:0;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;padding:8px;background:#f7fafc;scrollbar-width:thin;overscroll-behavior:contain}
@media(max-width:760px), (pointer:coarse), (hover:none){.parameter-record-item{grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr)}.parameter-archive-presets{grid-template-columns:60px minmax(0,1fr)}}
@media(max-width:350px){
 .oral-history-page .history-time-filter{grid-template-columns:74px minmax(0,1fr) 8px minmax(0,1fr);gap:4px}
 .oral-history-page .history-time-filter .filter-trigger{font-size:12px;padding-left:2px;padding-right:2px}
 .oral-history-page .history-time-filter .filter-trigger svg{width:11px;height:11px}
 .oral-history-page .history-time-filter input{font-size:11px;padding:3px 2px}
}
/* Reserve four preset rows so archive notes keep a stable starting position. */
.parameter-archive-presets{height:140px;min-height:140px;max-height:140px;flex:0 0 140px}
@media(max-height:680px){.parameter-archive-presets{height:128px;min-height:128px;max-height:128px;flex-basis:128px}}
.catalog-definition-rule{font-size:12px;color:#738898;line-height:1.6;margin:0;flex-shrink:0}
.catalog-lock-icon{color:#8399a8;display:flex;align-items:center;justify-content:center}.catalog-lock-icon svg{width:19px;height:19px}
.catalog-delete.locked,.catalog-delete:disabled{opacity:1!important;color:#a0acb7!important;background:transparent!important;border-color:transparent!important;box-shadow:none!important;cursor:not-allowed}
.catalog-delete.locked svg{stroke:#a0acb7!important}
/* All entry modules share one reserved footer, independent of form content. */
.entry-page{position:relative;height:100dvh;min-height:0!important;box-sizing:border-box;padding-bottom:112px!important;overflow:hidden}
.entry-page .entry-footer{position:absolute;left:24px;right:24px;bottom:20px;height:76px;display:grid;grid-template-rows:38px 26px;gap:12px;margin:0;padding:0;z-index:2;background:#fff}
.entry-page .entry-footer .entry-actions-row{display:flex;align-items:center;gap:8px;height:38px;min-height:38px;margin:0;padding:0;border:0}
.entry-page .entry-action-group{display:flex;align-items:center;gap:inherit}
.entry-page .entry-action-group>.btn{height:36px;min-height:36px;padding:6px 14px;font-size:14px;line-height:22px;white-space:nowrap}
.entry-page .entry-browse-actions{margin-inline-start:auto}
.entry-page .entry-browse-actions::before{content:"";width:1px;height:22px;margin-inline:4px 2px;background:var(--ink2);opacity:.5}
.entry-page .entry-status{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:26px;height:26px;min-height:0;overflow:hidden}
.entry-page .entry-status>div{grid-area:1/1;min-width:0;margin:0!important;padding:0!important;border:0;background:transparent;font-size:13px;line-height:26px;max-height:26px;overflow:hidden}
.entry-page .entry-status #medicalLatest{height:26px;max-height:26px;min-height:0}
.entry-page .entry-status .entry-saved-summary{height:26px;min-width:0}
.entry-page .entry-status .entry-save-error{display:flex;flex-wrap:nowrap;white-space:nowrap;text-overflow:ellipsis;line-height:26px;gap:6px}
.entry-status .entry-save-error>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis}
.entry-page .entry-status #deviceResult[hidden],.entry-page .entry-status #medicalLatest[hidden]{display:none!important;visibility:hidden}
.entry-page .entry-status #deviceResult>div{display:flex;flex-wrap:nowrap;min-width:0;white-space:nowrap;gap:5px}
.entry-page .entry-status #deviceResult p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.entry-page .entry-status #deviceResult b{flex-shrink:0}
.entry-page.device-entry-page .device-panel{grid-template-rows:auto auto auto auto minmax(60px,1fr) auto minmax(65px,.8fr)}
.entry-page.medical-entry-page .medical-panel.entry-card{display:flex!important;flex-direction:column;gap:10px;height:100%;min-height:0;overflow:auto;scrollbar-width:thin;overscroll-behavior:contain}
.medical-panel>*{flex-shrink:0}
.medical-panel .medical-field,.medical-panel .medical-image-label,.medical-panel .medical-note-label{margin:0}
.medical-panel h1{font-size:24px!important;line-height:1.5;margin:0!important;text-align:center}
.medical-panel .module-storage-stats{margin:0!important;padding:4px 0!important;border:0;background:transparent}
.medical-panel>textarea{flex:1 0 64px;min-height:64px;max-height:none!important;resize:none;overflow:auto;line-height:1.6}
.medical-panel>.upzone:not(.knowledge-image-input){flex:1 0 64px;min-height:64px!important;max-height:130px;margin:0;overflow:auto}
.entry-page.excretion-entry-page .medical-panel{overflow:hidden}
.excretion-entry-page .medical-panel .chips{margin:clamp(8px,2dvh,22px) 0 10px;gap:10px}
.excretion-entry-page .medical-panel .chip{font-size:15px;padding:6px 18px}
.excretion-entry-page .medical-field{grid-template-columns:72px minmax(0,1fr);gap:8px;flex-shrink:0}
.excretion-entry-page .medical-field label{font-size:15px}
.excretion-entry-page .medical-note-label{margin-top:4px}
.excretion-entry-page .medical-panel>#note{flex:1 1 0;height:0;min-height:60px;resize:none;overflow:auto;margin:0}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .desktop-shell .app:has(.entry-page),.h5wrap:has(.entry-page){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .main:has(.entry-page),.h5main:has(.entry-page){flex:1;min-height:0;overflow:hidden;padding:0 10px!important}
 .entry-page{height:100%!important;min-height:0!important;max-width:100%!important;margin:0!important;border-radius:0;padding-bottom:108px!important}
 .entry-page .entry-footer{left:14px;right:14px;bottom:16px}
 .entry-page .entry-action-group>.btn{padding:6px 12px;font-size:14px}
 .medical-panel h1{font-size:22px!important}
 .medical-panel .medical-field{gap:7px}
 .medical-panel>textarea{min-height:56px;flex-basis:56px}
 .excretion-entry-page .medical-panel .chips{margin:8px 0}
}
@media(max-height:680px){
 .entry-page{padding-bottom:100px!important}
 .entry-page .entry-footer{bottom:12px;height:72px;grid-template-rows:36px 26px;gap:10px}
 .entry-page .entry-footer .entry-actions-row{height:36px;min-height:36px}
 .entry-page.medical-entry-page .medical-panel.entry-card{gap:7px}
 .medical-panel .medical-field input{min-height:34px;height:34px;padding-top:4px;padding-bottom:4px}
 .medical-panel>.upzone:not(.knowledge-image-input){min-height:50px!important;flex-basis:50px}
 .excretion-entry-page .medical-panel .chips{margin:0}
 .excretion-entry-page .medical-panel>#note{min-height:45px}
}
.entry-page:is(.device-entry-page,.oral-entry-page,.parameter-entry-page,.medical-entry-page){padding-bottom:112px!important}
@media(max-width:760px), (pointer:coarse), (hover:none){.entry-page:is(.device-entry-page,.oral-entry-page,.parameter-entry-page,.medical-entry-page){padding-bottom:108px!important}}
@media(max-height:680px){.entry-page:is(.device-entry-page,.oral-entry-page,.parameter-entry-page,.medical-entry-page){padding-bottom:100px!important}}
.excretion-record-detail-page .excretion-detail-fields{flex-shrink:0;grid-template-columns:58px minmax(0,1fr);margin:12px 0 0;gap:16px 9px;font-size:15px}
.excretion-record-detail-page .oral-record-times{margin-top:4px}
.excretion-detail-note{display:flex;flex:1;min-height:0;flex-direction:column;gap:9px;font-size:14px;line-height:1.7}
.excretion-detail-note>span{color:#7a8d9b;flex-shrink:0}
.excretion-detail-note>div{flex:1;min-height:0;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;scrollbar-width:thin;overscroll-behavior:contain}
@media(max-width:760px), (pointer:coarse), (hover:none){.excretion-record-detail-page .excretion-detail-fields{font-size:14px;gap:14px 8px}}
/* Medical images and notes occupy stable independent scroll regions. */
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel.entry-card{display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto auto auto minmax(62px,1fr) auto auto minmax(65px,.85fr);gap:11px;overflow:hidden}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .medical-field{grid-template-columns:64px minmax(0,1fr);gap:8px}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .medical-image-label,.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .medical-note-label{min-height:23px;align-items:center}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .upzone{display:block!important;min-height:0!important;max-height:none!important;height:100%;margin:0;padding:7px!important;overflow:hidden;border:1px dashed #bfd3df!important;border-radius:8px;background:transparent}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .upzone>svg{display:none}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .upzone:not(.has-files){display:grid!important;place-items:center}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .upzone:not(.has-files) .upload-feedback{display:none!important}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .upzone .upload-prompt{font-size:28px;line-height:1;color:#839cab}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .upzone.has-files .upload-prompt{display:none}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .upload-feedback{display:flex;flex-direction:column;align-content:start;height:100%;max-height:100%!important;min-height:0;overflow:auto!important;overscroll-behavior:contain;scrollbar-width:thin;gap:4px}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .upload-file-row{flex:0 0 auto;min-height:40px;height:auto}
.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel>:is(#note,#l_note){height:100%!important;min-height:0!important;max-height:100%!important;resize:none;overflow:auto;margin:0}
@media(max-width:760px), (pointer:coarse), (hover:none){.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel.entry-card{gap:9px}}
@media(max-height:680px){
 .entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel.entry-card{gap:6px;grid-template-rows:auto auto auto auto auto minmax(45px,1fr) auto auto minmax(45px,.85fr)}
 .entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .medical-field input{height:32px;min-height:32px}
 .entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .medical-image-label,.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .medical-note-label{min-height:20px}
 .entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .medical-image-label .btn,.entry-page:is([data-module=medical],[data-module=lab],[data-module=knowledge],[data-module=daily]) .medical-panel .medical-note-label .btn{padding:3px 7px}
}
.medical-record-detail-page .medical-detail-meta{flex-shrink:0;min-height:0;max-height:46%;display:flex;flex-direction:column;gap:12px;overflow:hidden}
.medical-record-detail-page .medical-detail-fields{grid-template-columns:48px minmax(0,1fr);font-size:14px;gap:10px 8px;margin:0;max-height:115px;overflow:auto;flex-shrink:0;scrollbar-width:thin}
.medical-record-detail-page .oral-record-times{flex-shrink:0}
.medical-detail-note{display:grid;grid-template-columns:48px minmax(0,1fr);gap:8px;font-size:14px;min-height:25px;max-height:100px;overflow:hidden}
.medical-detail-note>span,.medical-detail-images>span{color:#7a8d9b}
.medical-detail-note>div{white-space:pre-wrap;overflow-wrap:anywhere;min-height:0;overflow:auto;line-height:1.6;scrollbar-width:thin;overscroll-behavior:contain}
.medical-detail-images{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;font-size:14px;overflow:hidden}
.medical-record-detail-page #recordMedia{flex:1;min-height:0;display:flex;flex-direction:column;margin:0;overflow:hidden;border:1px dashed #c5d6e1;border-radius:8px;padding:6px}
.medical-record-detail-page .media-toolbar{flex-shrink:0;margin:0 0 6px;gap:6px;font-size:12px}
.medical-record-detail-page .media-toolbar .btn{padding:5px 8px;font-size:13px}
.medical-record-detail-page .media-content{flex:1;min-height:0;max-height:none;overflow:auto;display:block;border-radius:0;background:transparent;scrollbar-width:thin;overscroll-behavior:contain}
.medical-record-detail-page .media-content img{display:block;width:100%;height:auto;max-height:none;object-fit:contain}
.medical-record-detail-page .media-name{flex-shrink:0;max-height:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;margin-top:5px}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .medical-record-detail-page .medical-detail-meta{gap:9px;max-height:48%}
 .medical-record-detail-page .medical-detail-fields{max-height:90px;gap:7px 8px}
 .medical-detail-note{max-height:80px}
}

.entry-page[data-module=knowledge] .medical-panel.entry-card{grid-template-rows:auto auto auto auto minmax(85px,1fr) auto auto auto}
.entry-page[data-module=knowledge] .medical-panel .knowledge-image-input[hidden]{display:none!important}
@media(max-height:680px){.entry-page[data-module=knowledge] .medical-panel.entry-card{grid-template-rows:auto auto auto auto minmax(65px,1fr) auto auto auto}}

/* 知识文库：紧凑历史列表与固定文件预览。 */
.knowledge-detail-meta{flex-shrink:0;min-height:0;max-height:32%;overflow:auto;display:flex;flex-direction:column;gap:12px;font-size:14px;scrollbar-width:thin}
.knowledge-detail-name{display:grid;grid-template-columns:64px minmax(0,1fr);gap:8px}
.knowledge-detail-category{display:grid;grid-template-columns:32px minmax(0,1fr) 32px minmax(0,1fr);gap:8px}
.knowledge-detail-meta>div>span{color:#7a8d9b}
.knowledge-detail-name>div,.knowledge-detail-category>div{overflow-wrap:anywhere;white-space:pre-wrap}
.record-detail-page[data-module=knowledge] .document-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:14px;line-height:1.6}
@media(max-width:760px), (pointer:coarse), (hover:none){.knowledge-detail-meta{gap:9px;font-size:13px}.knowledge-detail-name{grid-template-columns:56px minmax(0,1fr)}}

.knowledge-detail-name{max-height:64px;overflow:auto;flex-shrink:0;scrollbar-width:thin}
.knowledge-detail-category{max-height:50px;overflow:auto;flex-shrink:0;scrollbar-width:thin}
.knowledge-detail-meta .oral-record-times{flex-shrink:0}
@media(max-width:760px), (pointer:coarse), (hover:none){.knowledge-detail-name{max-height:48px}}

/* 每日日志：正文、图片固定区域，底部操作保持统一。 */
.entry-page[data-module=daily] .medical-panel.entry-card{grid-template-rows:auto auto auto minmax(75px,1.05fr) auto minmax(65px,1fr) auto}
.entry-page[data-module=daily] .medical-panel>#d_content{height:100%!important;min-height:0!important;max-height:100%!important;resize:none;overflow:auto;margin:0;scrollbar-width:thin}
@media(max-height:680px){.entry-page[data-module=daily] .medical-panel.entry-card{grid-template-rows:auto auto auto minmax(55px,1.05fr) auto minmax(50px,1fr) auto}}
@media(max-width:760px), (pointer:coarse), (hover:none){
  /* The title is in the mobile header, leaving six rows in the form. */
  .desktop-shell .entry-page[data-module=daily] .medical-panel.entry-card{
    grid-template-rows:auto auto minmax(56px,1fr) auto clamp(76px,14dvh,132px) auto;
  }
  .desktop-shell .entry-page[data-module=daily] .medical-panel .upzone{
    background:#f0f1f2;
  }
  .desktop-shell .entry-page[data-module=daily] .medical-panel .upzone .upload-prompt{
    color:var(--ink2);
    font-weight:600;
  }
  .desktop-shell .entry-page[data-module=daily] .medical-panel .medical-field{
    margin-block-end:6px;
  }
}

/* 日志详情：全文和原图共用固定滚动预览区。 */
.record-detail-page[data-module=daily] .daily-detail-preview{flex:1;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;border:1px dashed #bfd3df;border-radius:8px;padding:12px;display:block;margin:0}
.record-detail-page[data-module=daily] .daily-full-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.6;margin:0 0 12px}
.record-detail-page[data-module=daily] .daily-detail-preview img{display:block;width:100%;height:auto;max-height:none;object-fit:contain;margin:0 0 10px;border-radius:0}

/* 穿戴检测：统一单行结果，操作区适当下移。 */
.device-entry-page .entry-footer{bottom:10px}
.device-entry-page .device-panel .device-mode button{padding:5px 10px;font-size:14px;min-height:32px}
.device-entry-page .device-status-line{display:flex;align-items:center;gap:7px;min-width:0;font-size:13px;line-height:24px}
.device-entry-page .device-status-line>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.device-entry-page .entry-status #deviceResult{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px;line-height:24px;padding:0;margin:0;border:0;background:none;max-height:26px}
.device-entry-page .entry-status #deviceResult[hidden]{display:none}
@media(max-height:680px){.device-entry-page .entry-footer{bottom:6px}}

/* 穿戴历史：稳定总数、单行摘要、滚动加载。 */
.history-page[data-module=device] #hist_time_total{min-width:78px;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:13px}
.history-page[data-module=device] .history-record{flex-wrap:nowrap;align-items:baseline}
.history-page[data-module=device] .history-record .rdate{white-space:nowrap}
.history-page[data-module=device] .history-record .rbody{flex-wrap:nowrap;overflow:hidden;white-space:nowrap}
.history-page[data-module=device] .device-record-name{max-width:42%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.history-page[data-module=device] .device-record-file{flex:1 1 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;overflow-wrap:normal}

/* 穿戴详情：元数据不滚动，备注弹窗，读数滚动加载。 */
.device-detail-page .device-detail-meta{max-height:none;overflow:hidden}
.device-detail-page .device-source-name{max-height:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.device-detail-page .device-detail-times{grid-template-columns:66px minmax(0,1fr);font-size:12px;gap:4px 8px}
.device-detail-page .device-detail-times time{white-space:nowrap;font-variant-numeric:tabular-nums;font-size:12px}
.device-note-full{max-height:65dvh;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:350px){.device-detail-page .device-detail-times{grid-template-columns:53px minmax(0,1fr);gap:4px}.device-detail-page .device-detail-times time{font-size:10px}}

/* 全模块历史页统一总数与滚动加载。 */
.history-page #hist_time_total{display:block;min-width:74px;flex-shrink:0;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:13px;text-align:right}

/* 筛选菜单以控件左侧为锚点，避免向左越界。 */
.history-page .history-time-filter .filter-menu{left:0;right:auto;min-width:160px;max-width:min(260px,calc(100vw - 32px))}
.device-source-name[role=button]{cursor:pointer}
.device-detail-description{display:flex;flex-direction:column;gap:4px}
.device-description-title{flex-shrink:0;font-size:14px;font-weight:500}
.device-description-scroll{flex:1}
.device-detail-page .image-record-times{grid-template-columns:56px minmax(0,1fr) 56px minmax(0,1fr);font-size:12px}
.device-detail-page .image-record-times time{font-size:12px}
.device-image-viewer{position:relative;display:flex;flex-direction:column;flex:1;min-height:0;margin:0;overflow:hidden}
.device-image-viewer .media-content{flex:1;min-height:0;overflow:auto;max-height:none;display:block}
.device-image-viewer .media-content img{width:100%;max-height:none;height:auto;display:block}
.image-switch-controls{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;background:#ffffffe8;border-radius:20px;padding:2px 7px;font-size:12px}
.image-switch-controls .btn{font-size:22px;line-height:24px;padding:0 9px}
@media(max-width:350px){.device-detail-page .image-record-times{grid-template-columns:49px minmax(0,1fr) 49px minmax(0,1fr);gap:3px}.device-detail-page .image-record-times time{font-size:10px}}

/* 单品库保持紧凑单行，分类名称靠近箭头。 */
.oral-library-page .oral-library-table table{table-layout:fixed;width:100%}
.oral-library-page .oral-library-table td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;height:30px;vertical-align:middle}
.oral-library-page .oral-library-table tr:has(input:checked){background:#e8f6f5}
.oral-library-page .oral-library-select{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.oral-library-header h1 .filter-picker{min-width:0;width:auto}
.oral-library-header h1 .filter-trigger{gap:5px;justify-content:flex-end;padding-left:0;padding-right:0}
.oral-library-page footer>.btn{min-height:36px;height:36px;font-size:14px;padding:6px 14px;line-height:22px}
.oral-note .voice-btn,.parameter-note .voice-btn{padding:5px 8px;min-width:32px}
.entry-status>[role=status]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.entry-status .entry-saved-summary{cursor:default}

/* 单品新增弹窗与档案按统一紧凑布局展示。 */
.modal.oral-item-modal{width:min(580px,94vw);max-height:90dvh;overflow:auto;padding:18px 20px}
.oral-item-modal .oral-item-form{gap:10px 12px;align-items:center}
.oral-item-modal .oral-item-form textarea{height:120px;min-height:120px;resize:none}
.oral-item-modal .oral-item-image-preview{height:96px;min-height:96px;max-height:96px;overflow:auto}
.oral-item-modal .oral-item-image-preview:has(>.oral-image-add:only-child){display:flex;align-items:center;justify-content:center}
.oral-item-modal .oral-image-add:only-child{border:0;background:none;font-size:32px;width:100%;height:100%}
.catalog-definition-page[data-module=oral] .oral-archive-images{flex:1;min-height:100px;border:1px dashed #c3d3de;border-radius:6px;padding:8px}
.archive-image-label{display:block;font-size:14px;color:#7a8d9b;margin-bottom:7px}
.catalog-delete.locked{opacity:.45;cursor:pointer}
@media(max-height:680px){
  .modal.oral-item-modal{padding:12px 14px}
  .oral-item-modal .oral-item-form{gap:7px}
  .oral-item-modal .oral-item-form textarea{height:88px;min-height:88px}
  .oral-item-modal .oral-item-image-preview{height:78px;min-height:78px;max-height:78px}
  .oral-item-modal .oral-item-image-preview img{height:62px}
}

/* 历史摘要按实际可用宽度省略，不在内容生成时截短。 */
.history-page:not([data-module=device]) .history-record .rbody{display:block;min-width:0;flex:1}
.history-page:not([data-module=device]) .history-record .rt{display:block;width:100%;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* 日期时间弹层与页面保持一致，不依赖浏览器原生弹出面板。 */
input:is([type=date],[type=datetime-local]){font-variant-numeric:tabular-nums;accent-color:#0e7490;color-scheme:only light}
input:is([type=date],[type=datetime-local]):not(:disabled){cursor:pointer}
[data-time-picker][hidden]{display:none}
.time-picker-button{
  display:inline-flex;align-items:center;justify-content:space-between;gap:8px;
  width:100%;max-width:100%;min-width:0;min-height:38px;padding:6px 10px;
  appearance:none;border:1px solid #cbd5df;border-radius:10px;background:#fbfcfe;color:var(--ink);
  color-scheme:only light;font:inherit;font-variant-numeric:tabular-nums;text-align:left;cursor:pointer;
}
.time-picker-button .ic{width:16px;height:16px;flex-shrink:0;color:var(--brand)}
.time-picker-button:focus-visible{outline:2px solid var(--brand2);outline-offset:1px}
.time-picker-button:disabled{background:#f3f6f9;color:var(--ink2);font-size:13px;cursor:default}
.time-picker-button:disabled .ic{display:none}
.date-picker-popup{position:fixed;z-index:10020;background:#fff;color-scheme:only light;border:1px solid #dbe7ef;border-radius:14px;box-shadow:0 12px 38px #173c5b24;padding:12px;color:#213c54;font-size:14px;max-height:calc(100dvh - 16px);overflow:auto}
.date-picker-popup header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.date-picker-popup button{font:inherit;border:0;background:transparent;color:inherit;cursor:pointer;border-radius:7px}
.date-picker-popup header button{width:32px;height:30px;font-size:24px;color:#68879c}
.calendar-week,.calendar-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));text-align:center;gap:3px}
.calendar-week{font-size:12px;color:#91a4b2;margin-bottom:4px;line-height:24px}
.date-picker-popup .calendar-day{height:31px;font-size:13px;padding:0}
.date-picker-popup button:hover:not(:disabled){background:#edf7f8;color:#07899b}
.date-picker-popup .calendar-day.muted{color:#adbbc5}
.date-picker-popup .calendar-day.today{box-shadow:inset 0 0 0 1px #92d9df}
.date-picker-popup .calendar-day.selected,.date-picker-popup .calendar-confirm{background:#0e8197;color:white}
.date-picker-popup button:disabled{opacity:.35;cursor:default}
.calendar-time {
  --time-wheel-row:28px;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  border-top:1px solid #edf2f6;
  margin-top:8px;
  padding-top:6px;
}
.time-wheel { min-width:0;text-align:center; }
.time-wheel > span { display:block;color:#536e80;font-size:12px;line-height:22px; }
.time-wheel-track { position:relative; }
.time-wheel-track::before {
  position:absolute;
  inset:var(--time-wheel-row) 0;
  border-radius:7px;
  background:#e6f4f6;
  content:"";
  pointer-events:none;
}
.time-wheel-list {
  position:relative;
  height:calc(3 * var(--time-wheel-row));
  overflow-y:auto;
  overscroll-behavior:contain;
  scroll-snap-type:y mandatory;
  scrollbar-width:none;
  touch-action:pan-y;
  user-select:none;
  border-radius:7px;
}
.time-wheel-list::-webkit-scrollbar { display:none; }
.time-wheel-list:focus-visible { outline:2px solid #16a9b8;outline-offset:1px; }
.time-wheel-options { padding-block:var(--time-wheel-row); }
.time-wheel-list [role=option] {
  height:var(--time-wheel-row);
  line-height:var(--time-wheel-row);
  scroll-snap-align:center;
  color:#536e80;
  font-variant-numeric:tabular-nums;
  cursor:pointer;
}
.time-wheel-list [aria-selected=true] { color:#0b6277;font-weight:700; }
.date-picker-popup footer{display:flex;align-items:center;gap:8px;margin-top:12px}
.date-picker-popup footer button{height:32px;padding:4px 12px;font-size:13px}
.date-picker-popup footer .calendar-confirm{margin-left:auto}
#pickerError:empty{display:none}#pickerError{font-size:12px;color:#dc5069;margin-top:6px}
.date-picker-popup button:focus-visible{outline:2px solid #16a9b8;outline-offset:1px}

/* 文件名保持单行；图片时间字号固定，空间不足仅缩短标签。 */
.record-detail-page.device-detail-page .kv .device-source-name{display:block;white-space:nowrap;overflow-wrap:normal;word-break:normal;overflow:hidden;text-overflow:ellipsis;min-width:0;max-height:none}
.device-detail-page .device-detail-times.image-record-times{display:flex;align-items:baseline;justify-content:space-between;gap:3px;min-width:0;white-space:nowrap}
.device-detail-page .device-detail-times.image-record-times>span,.device-detail-page .device-detail-times.image-record-times>time{flex:0 0 auto;font-size:12px;white-space:nowrap}

.device-detail-page .device-detail-times.image-record-times.compact-time-labels{gap:1px}
.device-detail-page .image-record-times.compact-time-labels time{letter-spacing:-.2px}

/* 多行上传报错提示退场时完整隐藏，避免固定偏移量留下残片。 */
#toast{max-width:min(520px,calc(100vw - 28px));max-height:calc(100dvh - 52px);overflow:hidden;overflow-wrap:anywhere;white-space:normal;transform:translate(-50%,calc(-100% - 30px));opacity:0;visibility:hidden;pointer-events:none;transition:transform .25s ease,opacity .2s ease,visibility .25s}
#toast.show{transform:translate(-50%,0);opacity:1;visibility:visible;pointer-events:none}

/* 检测时、入库时与上方文件名同字号，窄屏换行而不缩字。 */
.device-detail-page .device-detail-meta{--record-meta-font:15px}
.device-detail-page .device-detail-times,.device-detail-page .device-detail-times>span,.device-detail-page .device-detail-times>time,.device-detail-page .device-detail-times.image-record-times>span,.device-detail-page .device-detail-times.image-record-times>time{font-size:var(--record-meta-font);letter-spacing:normal}
.device-detail-page .device-detail-times.image-record-times.stacked-time-labels{display:grid;grid-template-columns:59px minmax(0,1fr);gap:4px 8px;justify-content:normal}
@media(max-width:760px), (pointer:coarse), (hover:none){.device-detail-page .device-detail-meta{--record-meta-font:14px}}

/* 全模块记录详情：业务时与入库时同正文字号，仅按完整时间对换行。 */
.record-detail-page .oral-record-times{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 16px;font-size:14px;line-height:1.5}
.record-detail-page .oral-record-times .record-time-pair{display:flex;align-items:baseline;gap:8px;white-space:nowrap;min-width:0}
.record-detail-page .oral-record-times span{color:#7a8d9b}
.record-detail-page .oral-record-times time{font:inherit;font-variant-numeric:tabular-nums;letter-spacing:normal;white-space:nowrap}
@media(max-width:760px), (pointer:coarse), (hover:none){.record-detail-page[data-module=knowledge] .oral-record-times{font-size:13px}}

/* 新增单品弹窗略窄于来源页面，图片操作置于展示区上方。 */
.modal.oral-item-modal,body.h5 .modal.oral-item-modal{width:var(--oral-modal-width, min(480px,calc(100vw - 24px)) );max-width:calc(100vw - 24px);box-sizing:border-box;border-radius:14px;padding:16px}
.oral-item-modal .oral-preset-fields{display:grid;grid-template-columns:minmax(55px,95px) auto minmax(70px,115px);justify-content:start;align-items:center;column-gap:14px;min-width:0}
.oral-item-modal .oral-preset-fields input{width:100%;min-width:0;box-sizing:border-box}
.oral-item-modal .oral-preset-fields>label{white-space:nowrap}
.oral-item-modal .oral-item-photo-heading{grid-column:1/-1;display:flex;align-items:center;gap:10px;margin-top:2px}
.oral-item-modal .oral-item-photo-heading .btn{min-width:30px;padding:4px 7px}
.oral-item-modal .oral-item-image-preview{grid-column:1/-1;overflow:auto;scrollbar-width:thin;align-content:flex-start}
.oral-item-modal #oralLibrarySave{border:0;background:transparent;box-shadow:none;padding:5px;min-width:30px;width:30px;justify-self:end}
@media(max-width:380px){.modal.oral-item-modal,body.h5 .modal.oral-item-modal{padding:12px}.oral-item-modal .oral-item-form{grid-template-columns:56px minmax(0,1fr);column-gap:8px}.oral-item-modal .oral-preset-fields{grid-template-columns:minmax(48px,1fr) 28px minmax(55px,1fr);column-gap:7px}}

.oral-item-modal .oral-image-add:only-child{min-height:0;min-width:0;box-sizing:border-box}

/* 紧凑输入区域上下居中，避免单行备注因行高和内边距而挤出滚动条。 */
.entry-page input:not([type=file]):not([type=checkbox]),.modal input:not([type=file]):not([type=checkbox]),.entry-page select,.modal select{line-height:normal}
.oral-panel .oral-note{--compact-note-height:38px}
.parameter-note{--compact-note-height:36px}
.oral-panel .oral-note textarea,.parameter-note textarea{box-sizing:border-box;height:var(--compact-note-height);min-height:var(--compact-note-height);max-height:var(--compact-note-height);line-height:20px;padding-block:calc((var(--compact-note-height) - 22px)/2);overflow:auto}
@media(max-height:680px){.oral-panel .oral-note,.parameter-note{--compact-note-height:34px}}

/* 单品库确认按钮与录入保存共用紧凑尺寸。 */
.entry-page .entry-footer .btn.compact-primary-action,.oral-library-page footer>.btn.compact-primary-action,.modal .btns>.btn{box-sizing:border-box;flex:0 0 auto;width:auto;min-width:0;height:36px;min-height:36px;padding:6px 14px;font-size:14px;line-height:22px;border-radius:8px;white-space:nowrap}
@media(max-width:760px), (pointer:coarse), (hover:none){.entry-page .entry-footer .btn.compact-primary-action,.oral-library-page footer>.btn.compact-primary-action,.modal .btns>.btn{padding:6px 12px}}

/* 数字控件无增减箭头；模板明细参数保持同行。 */
input[type=number]{appearance:textfield;-moz-appearance:textfield}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.parameter-entry-page .drow{grid-template-columns:16px 4em minmax(0,1fr) 16px;align-items:center;gap:4px}
.parameter-entry-page .drow .pname{width:4em;max-width:4em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
.parameter-entry-page .drow .detail-drag-handle{width:16px;padding:0}
.parameter-entry-page .exercise-detail-params{flex-wrap:nowrap;gap:3px;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;align-items:center}
.parameter-entry-page .exercise-detail-param{flex:0 0 auto;gap:2px;white-space:nowrap;font-size:12px}
.parameter-entry-page .exercise-detail-param input[type=number]{box-sizing:content-box;width:3ch;min-width:3ch;max-width:3ch;padding:2px 3px;height:20px;min-height:20px;font-size:13px;line-height:20px}
.oral-details .oral-qty-col{width:44px}
.oral-details input[type=number]{box-sizing:content-box;width:3ch;min-width:3ch;max-width:3ch;padding:2px 3px;font-size:13px}
.parameter-item-modal .new-item-param input[type=number]{width:calc(3ch + 12px);min-width:0;max-width:calc(3ch + 12px);padding-inline:5px}

/* 新增单品预设值需容纳完整的“可留空”提示。 */
.oral-item-modal #oralItemDefaultQuantity{width:100%;min-width:0;max-width:none;box-sizing:border-box;padding-inline:8px}
.oral-item-modal .oral-preset-fields{grid-template-columns:minmax(72px,95px) auto minmax(70px,115px)}
@media(max-width:380px){.oral-item-modal .oral-preset-fields{grid-template-columns:minmax(64px,1fr) 28px minmax(55px,1fr);column-gap:7px}.oral-item-modal #oralItemDefaultQuantity{padding-inline:6px}}

/* 新增单品返回与保存均为同尺寸无框图标。 */
.oral-item-modal .oral-library-header>.back-arrow,.oral-item-modal #oralLibrarySave{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;width:30px;min-width:30px;height:30px;min-height:30px;padding:5px;border:0;background:transparent;box-shadow:none;border-radius:0}
.oral-item-modal .oral-library-header>.back-arrow svg,.oral-item-modal #oralLibrarySave svg{width:18px;height:18px}

/* 单品库分类下拉与全站选项面板一致。 */
.oral-library-header h1 .filter-picker{width:auto;min-width:0;flex:0 0 auto}
.oral-library-header h1 .filter-trigger{font:inherit;font-weight:inherit;line-height:1.4;min-height:32px;padding:2px 4px;border:0;background:transparent;gap:6px;border-radius:6px;white-space:nowrap}
.oral-library-header h1 .filter-trigger>span{max-width:5em}
.oral-library-header h1 .filter-menu{left:0;right:auto;width:164px;min-width:164px;max-width:calc(100vw - 28px);max-height:260px;padding:5px;box-sizing:border-box;border:1px solid #dce8ef;border-radius:10px;box-shadow:0 8px 24px #1c405e1f;background:#fff;z-index:50;text-align:left;font-size:14px;font-weight:400}
.oral-library-header h1 .filter-choice{min-height:35px;padding:7px 10px;font-size:14px;line-height:21px;white-space:nowrap}

/* 穿戴历史与导入成功统一：日期、设备、类型.后缀、文件名。 */
.history-page[data-module=device] .device-record-summary{display:block;min-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:pre;font-size:14px;font-weight:400;line-height:1.45}
.device-entry-page .device-status-line>span:last-child{white-space:pre}
@media(max-width:760px), (pointer:coarse), (hover:none){.history-page[data-module=device] .device-record-summary{font-size:13px}}

/* 单品库确认按钮贴近底部，同时保留手机安全区域。 */
.oral-library-page{padding-bottom:max(8px,env(safe-area-inset-bottom,0px))}

/* 单品库返回按钮使用固定盒模型，避免文字按钮内边距挤偏图标。 */
.oral-library-page>.oral-library-header{grid-template-columns:34px minmax(0,1fr) 72px}
.oral-library-page>.oral-library-header>.back-arrow{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:32px;height:34px;min-width:32px;min-height:34px;padding:4px;margin:0;border:1px solid #dce5ef;border-radius:8px;background:#fff;box-shadow:none;line-height:1;justify-self:start}
.oral-library-page>.oral-library-header>.back-arrow svg{display:block;width:20px;height:20px;flex:0 0 20px;margin:0;vertical-align:initial}
@media(max-width:760px), (pointer:coarse), (hover:none){.oral-library-page>.oral-library-header{grid-template-columns:32px minmax(0,1fr) 61px}}

/* 数值与单位右对齐；单品预设及单位按短内容留宽。 */
input[type=number],.parameter-entry-page .exercise-detail-param input[type=number],.oral-details input[type=number],.parameter-item-modal .new-item-param input[type=number]{text-align:right}
#oralItemUnit,#newItemUnit,#du,.parameter-item-modal .new-item-param input[aria-label="参数单位"]{text-align:right}
.oral-archive-page .oral-archive-preset{grid-template-columns:58px calc(4ch + 22px) 28px calc(2em + 22px);column-gap:14px;justify-content:start}
.oral-archive-page .oral-archive-preset>div{text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
.oral-item-modal .oral-preset-fields{grid-template-columns:max(68px,calc(4ch + 28px)) 28px calc(2em + 34px);column-gap:14px;justify-content:start}
.oral-item-modal #oralItemDefaultQuantity{width:100%;padding-inline:8px;text-align:right}
.oral-item-modal #oralItemUnit{padding-left:6px;padding-right:24px;text-align:right}
.oral-item-modal .oral-preset-fields .data-combobox-arrow{width:24px}
@media(max-width:380px){.oral-item-modal .oral-preset-fields{grid-template-columns:minmax(64px,1fr) 28px minmax(58px,1fr);column-gap:6px}.oral-item-modal #oralItemUnit{font-size:13px}.oral-archive-page .oral-archive-preset{grid-template-columns:53px calc(4ch + 18px) 28px calc(2em + 18px);column-gap:9px}}

.oral-item-modal #oralItemDefaultQuantity{font-size:14px;transition:border-color .18s,background-color .18s,box-shadow .18s}

.oral-item-modal #oralItemUnit{font-size:14px}

/* 单品库搜索与总数保持独立空间，各模块共用。 */
.oral-library-page .oral-library-toolbar{gap:20px}
.oral-library-page .oral-library-toolbar>input{flex:0 1 62%;width:62%;max-width:340px;min-width:0}
.oral-library-page .oral-library-toolbar>span{flex:0 0 auto;margin-left:auto;font-variant-numeric:tabular-nums}
@media(max-width:360px){.oral-library-page .oral-library-toolbar{gap:14px}.oral-library-page .oral-library-toolbar>input{flex-basis:56%;width:56%}}

.oral-archive-page>.archive-image-label{flex-shrink:0;margin:0}
.oral-archive-page>.oral-archive-images{min-height:0;border:1px dashed #c3d3de;border-radius:6px;padding:8px}

.excretion-entry-page .medical-field .data-combobox:has(#ex_vol){width:128px;max-width:100%;justify-self:start}
.entry-page.excretion-entry-page .medical-panel.entry-card{gap:14px}
@media(max-height:680px){.entry-page.excretion-entry-page .medical-panel.entry-card{gap:9px}}

.entry-page :is(.oral-template-row,.parameter-template-row)>select{padding-top:0;padding-bottom:0;line-height:normal;vertical-align:middle}

/* 历史页时间筛选文字在控件内水平居中，各模块统一。 */
.history-page .history-time-filter input[type=date]{text-align:center}
.history-page .history-time-filter input[type=date]::-webkit-datetime-edit{text-align:center}
.history-page .history-time-filter .filter-trigger{position:relative;justify-content:center;padding-left:18px;padding-right:18px}
.history-page .history-time-filter .filter-trigger>span{flex:1;max-width:none;min-width:0;text-align:center}
.history-page .history-time-filter .filter-trigger>svg{position:absolute;right:5px;top:50%;transform:translateY(-50%)}

.parameter-entry-page .exercise-detail-params{column-gap:1ch}
.parameter-entry-page .exercise-detail-param input[type=number]{text-align:right}

.entry-page[data-module=knowledge] .upzone[data-upload=up_knowledge]{position:relative}
.knowledge-upload-hint{position:absolute;top:10px;left:10px;right:10px;pointer-events:none;color:#7a8d9b;font-size:12px;line-height:1.5;text-align:left}
.entry-page[data-module=knowledge] .upzone[data-upload=up_knowledge].has-files .upload-feedback{padding-top:26px;box-sizing:border-box}

/* 所有历史条目统一为时间、名称、备注，完整内容进入详情查看。 */
.history-page .history-record{flex-wrap:nowrap;cursor:pointer}
.history-page .history-record .rbody{display:block;flex:1;min-width:0;overflow:hidden}
.history-page .history-record .history-record-summary{display:block;width:100%;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:400}

/* 运动、物理干预新增弹窗采用同一组紧凑列宽。 */
.modal.parameter-item-modal{width:var(--parameter-modal-width,460px);max-width:calc(100vw - 24px);box-sizing:border-box}
.parameter-item-modal .oral-library-header{grid-template-columns:30px minmax(0,1fr) 30px;align-items:center}
.parameter-item-modal .oral-library-header :is(.back-arrow,#createItemButton){display:flex;align-items:center;justify-content:center;width:30px;height:30px;min-width:30px;min-height:30px;padding:0;border:0;background:transparent;box-shadow:none;border-radius:0}
.parameter-item-modal .oral-library-header :is(.back-arrow,#createItemButton) svg{width:18px;height:18px;flex:none}

.oral-item-modal .oral-library-header{grid-template-columns:30px minmax(0,1fr) 30px}
.oral-item-modal .oral-library-header h3,.parameter-item-modal .oral-library-header h3{text-align:center}
.oral-item-name-fields{display:flex;gap:8px;align-items:center;min-width:0}
.oral-food-entry{display:flex;flex-shrink:0;gap:6px;align-items:center;white-space:nowrap}
.oral-food-entry select{width:auto;min-width:94px}
.oral-archive-food{grid-template-columns:auto minmax(0,1fr) auto minmax(72px,94px)}
.oral-archive-food>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.oral-archive-food select{min-width:0;width:100%;padding-inline:4px}
.oral-food-filter:not([hidden]){display:flex;align-items:center;gap:6px;white-space:nowrap}
.oral-library-page .oral-library-toolbar:has(.oral-food-filter:not([hidden])){gap:8px}
.oral-library-page .oral-library-toolbar:has(.oral-food-filter:not([hidden]))>input{flex:1 1 0;width:0}
.oral-food-filter select{width:auto;height:36px;padding-block:0;padding-inline:6px;text-align:center;text-align-last:center}
.oral-library-page .oral-unit-col{width:72px}
.oral-library-table td.catalog-unit-cell{text-align:right}
.catalog-definition-page .catalog-note-editor{flex:1 1 auto;min-height:100px}
.catalog-definition-page[data-module=oral] .catalog-note-editor{flex:0 0 auto}
.catalog-note-editor textarea{display:block;width:100%;min-height:0;flex:1;resize:none;overflow:auto;scrollbar-width:none}
.catalog-note-editor textarea::-webkit-scrollbar{display:none}
.catalog-definition-page[data-module=oral] .catalog-note-editor textarea{flex:none;height:clamp(76px,18dvh,160px)}
.record-note-preview{display:flex;align-items:center;gap:8px;min-width:0;padding:0;border:0;background:none;text-align:left;color:var(--ink);font:inherit;cursor:pointer}
.record-note-preview span{min-width:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.record-note-preview svg{flex:none;width:14px;height:14px;color:#637d91}
.record-note-preview:hover{text-decoration:underline}
.record-note-input{display:block;width:100%;margin:12px 0;resize:vertical}
@media(max-width:380px){
  .oral-library-page .oral-unit-col{width:60px}
  .oral-food-filter label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
}
.parameter-item-modal .parameter-item-name,.parameter-item-modal .parameter-item-parameters{grid-template-columns:76px minmax(0,1fr);gap:10px}
.parameter-item-modal .parameter-item-name{margin:14px 0}
.parameter-item-modal .new-item-param{grid-template-columns:minmax(0,1fr) 60px 56px 18px;gap:8px;height:32px;margin-bottom:8px}
.parameter-item-modal .new-item-param input[type=number]{width:100%;min-width:0;max-width:none;box-sizing:border-box}
.parameter-item-modal .new-item-param select{padding-right:16px}
.parameter-item-modal .parameter-note{min-width:0}
.parameter-item-modal .parameter-note textarea{resize:none}
@media(max-width:760px), (pointer:coarse), (hover:none){
 .parameter-item-modal .parameter-item-name,.parameter-item-modal .parameter-item-parameters{grid-template-columns:62px minmax(0,1fr);gap:7px}
 .parameter-item-modal .new-item-param{grid-template-columns:minmax(0,1fr) 48px 44px 16px;gap:4px}
}

.parameter-item-modal .new-item-param button{width:100%;min-width:0}

.entry-page[data-module=lab] .medical-field label{white-space:nowrap}
.entry-page[data-module=lab] .medical-field .data-combobox:has(#l_cat){width:140px;max-width:100%}
.entry-page[data-module=lab] #t_lab{width:230px;max-width:100%;min-width:0;box-sizing:border-box}

.device-name-controls{display:flex;align-items:center;gap:8px}.device-name-controls .data-combobox{flex:1;min-width:0}.device-template-choices{display:grid;gap:14px;padding:12px 0}.device-template-choices label{display:flex;align-items:center;gap:8px}.device-template-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}

.modal:has(.device-template-choices){width:min(420px,calc(100vw - 32px));max-height:85dvh;overflow:auto}

#newDeviceName{display:block;width:100%;margin:8px 0 14px;padding:10px 12px;border:1px solid var(--line,#dce7f0);border-radius:9px;font:inherit}

.catalog-definition-page .oral-archive-preset{grid-template-columns:auto minmax(55px,85px) auto minmax(50px,70px) 32px;gap:10px;align-items:center}.catalog-definition-page .oral-archive-preset input{width:100%;min-width:0;padding:8px;border:1px solid #dce7f0;border-radius:8px;font:inherit;text-align:right}.catalog-definition-page #saveCatalogDefaults{padding:0;border:0;width:32px;height:32px}

.catalog-param-default-row{display:grid;grid-template-columns:1fr 85px 70px;gap:12px;align-items:center;margin-bottom:8px}.catalog-param-default-row input{width:100%;padding:8px;border:1px solid #dce7f0;border-radius:8px;text-align:right;font:inherit}

.catalog-definition-page .parameter-archive-presets{height:auto;min-height:0;max-height:none;flex:0 0 auto}
.catalog-definition-page .parameter-archive-presets>div>.catalog-param-default-row{grid-template-columns:minmax(32px,1fr) minmax(45px,70px) minmax(38px,55px);column-gap:8px;align-items:center}.catalog-param-default-row input{min-width:0;box-sizing:border-box}

.catalog-param-default-row>span{white-space:nowrap}

@media (max-width:760px), (pointer:coarse), (hover:none) {
  .desktop-shell .app {
    min-height: 100vh;
    min-height: 100dvh;
  }
  .desktop-shell .mobile-nav {
    flex: 0 0 auto;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
    background:#fff;
    color:var(--ink);
  }
  .desktop-shell .mobile-module-row { color: #aac7db; }
  .desktop-shell .main {
    width: 100%;
    min-width: 0;
    border-inline: solid transparent;
    border-left-width: env(safe-area-inset-left, 0px);
    border-right-width: env(safe-area-inset-right, 0px);
    border-bottom: env(safe-area-inset-bottom, 0px) solid transparent;
  }
  .desktop-shell .main > :is(.history-page,.record-detail-page,.oral-library-page) {
    width: 100%;
    max-width: 100% !important;
  }
}

@media (max-height:520px) and (max-width:760px),
       (max-height:520px) and (pointer:coarse),
       (max-height:520px) and (hover:none) {
  .desktop-shell .main:has(.entry-page) { overflow-y: auto; }
  .desktop-shell .entry-page { min-height: 540px !important; }
}

.mobile-entry-label,.home-logout { display:none; }

.entry-remark { min-width:0; }
.entry-remark-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.entry-remark textarea {
  display:block;
  width:100%;
  height:72px;
  min-height:0;
  margin:4px 0 0;
  resize:none;
}
.module-overview dl { display:grid; gap:12px; margin:14px 0; }
.module-overview dl > div { display:flex; justify-content:space-between; gap:12px; }
.module-overview dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.module-overview .btns { justify-content:flex-end; }

@media (max-width:760px), (pointer:coarse), (hover:none) {
  .desktop-shell:has(.entry-page) {
    font-family:system-ui,"HarmonyOS Sans SC","PingFang SC","Microsoft YaHei",sans-serif;
    -webkit-text-size-adjust:none;
    text-size-adjust:none;
  }
  .desktop-shell:has(.entry-page) .mobile-nav,
  .desktop-shell .main:has(.entry-page) {
    background:#fff;
    color:#202124;
  }
  .desktop-shell .main:has(.entry-page) { padding-inline:0!important; }
  .desktop-shell:has(.entry-page) .mobile-module-row {
    padding:4px 12px 0;
    color:#202124;
  }
  .desktop-shell:has(.entry-page) .module-picker-trigger .module-option-icon,
  .desktop-shell:has(.entry-page) .module-picker-trigger > svg { display:none; }
  .desktop-shell .entry-page > .card > h1 {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
  }
  .desktop-shell:has(.entry-page) .module-picker-trigger {
    justify-content:center;
    min-height:44px;
    padding:0 4px;
    border:0;
    box-shadow:none;
    background:transparent;
    color:inherit;
  }
  .desktop-shell:has(.entry-page) .module-picker-current { gap:5px; font-size:17px; color:inherit; }
  .desktop-shell:has(.entry-page) .mobile-entry-label { display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
  .mobile-entry-label svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; }
  .home-logout.btn { display:inline-flex; margin-top:16px; }
  .desktop-shell .main > .entry-page {
    font-size:16px;
    font-weight:400;
    line-height:1.6;
    color:#202124;
    background:#fff;
    border:0;
    padding:0 16px 88px!important;
  }
  .desktop-shell .entry-page > :is(.entry-card,.device-panel) { background:transparent; }
  .desktop-shell .entry-page > :is(.oral-panel,.parameter-panel).entry-card { gap:8px; }
  .desktop-shell .entry-page :is(.oral-field,.parameter-field,.medical-field) > label {
    white-space:nowrap;
    font-size:15px;
    font-weight:400;
  }
  .desktop-shell .entry-page :is(.oral-field,.parameter-field,.medical-field):has(.time-picker-button) {
    grid-template-columns:max-content minmax(0,1fr);
    gap:8px;
  }
  .desktop-shell .entry-page .time-picker-button {
    width:min(100%, 230px);
    padding-inline:8px;
    font-size:14px;
  }
  .desktop-shell .entry-page :is(.oral-template-row,.parameter-template-row) {
    grid-template-columns:max-content minmax(0,1fr) auto auto;
    gap:7px;
  }
  .desktop-shell .entry-page :is(.oral-template-row,.parameter-template-row) label { white-space:nowrap; font-weight:400; }
  .desktop-shell .entry-page :is(.oral-template-row,.parameter-template-row) select {
    width:100%;
    min-width:0;
    padding-inline:8px 4px;
    appearance:auto;
    font-size:15px;
  }
  .desktop-shell .entry-page :is(.oral-template-row,.parameter-template-row) .btn { min-height:34px; padding-inline:9px; }
  .desktop-shell .entry-page .chips { gap:5px; }
  .desktop-shell .entry-page .chips .chip { border-color:transparent; border-radius:7px; font-size:15px; }
  .desktop-shell .entry-page .chips .chip.on { background:#e1e3e5; color:#202124; box-shadow:none; }
  .desktop-shell .oral-entry-page .oral-details,
  .desktop-shell .parameter-entry-page .entry-card .dlist {
    background:#f0f1f2;
    border:0;
    border-radius:4px;
    min-height:64px;
    max-height:none;
  }
  .desktop-shell .entry-page .entry-remark { flex:none; }
  .desktop-shell .entry-page .entry-remark textarea { height:clamp(68px,13dvh,110px); }
  .desktop-shell .entry-page :is(.entry-remark-heading,.medical-note-label) label span {
    font-size:14px;
    color:#667581;
  }
  .desktop-shell .entry-page :is(.entry-remark textarea,.medical-panel > textarea) {
    font-size:14px;
    line-height:1.6;
  }
  .desktop-shell .entry-page .medical-note-label .voice-btn { margin:0; }
  .desktop-shell .device-entry-page .device-panel {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto auto minmax(60px,1fr) auto minmax(100px,.42fr);
    gap:8px;
    font-size:14px;
  }
  .desktop-shell .entry-page .card .module-storage-stats {
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    column-gap:10px;
    row-gap:3px;
    padding:2px 0 6px!important;
    font-size:clamp(10px,2.6vw,11px)!important;
    color:inherit;
  }
  .desktop-shell .entry-page .module-storage-stats b { color:inherit; }
  .desktop-shell .device-entry-page .device-panel .device-field:not(.device-note) {
    grid-template-columns:minmax(4em,max-content) minmax(0,1fr);
    gap:8px;
  }
  .desktop-shell .device-entry-page .device-field > label { font-size:inherit; font-weight:400; }
  .desktop-shell .device-entry-page .device-name-controls { gap:6px; }
  .desktop-shell .device-entry-page .device-name-controls .btn {
    flex:0 0 36px;
    height:36px;
    justify-content:center;
    padding:0;
    border:0;
    background:transparent;
  }
  .desktop-shell .device-entry-page .device-field input { max-width:100%; min-width:0; font-size:14px; }
  .desktop-shell .device-entry-page .device-name-controls .data-combobox > input { padding-inline:10px 32px; }
  .desktop-shell .device-entry-page .device-name-controls .data-combobox-arrow { width:26px; }
  .desktop-shell .device-entry-page .device-panel .device-mode {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:min(100%, 280px);
    justify-self:center;
    gap:8px;
  }
  .desktop-shell .device-entry-page .device-panel .device-mode button {
    min-height:36px;
    padding:4px;
    font-size:14px;
    font-weight:500;
    white-space:nowrap;
  }
  .desktop-shell .device-entry-page .device-upload-unified {
    border-block:1px solid #dce5ea;
    padding-block:4px;
  }
  .desktop-shell .device-entry-page .device-time .time-picker-button {
    width:min(100%, 270px);
    padding-inline:8px;
  }
  .desktop-shell .device-entry-page .device-time .time-picker-button:disabled { font-size:13px; }
  .desktop-shell .device-entry-page .device-note-heading label { font-weight:400; }
  .desktop-shell .device-entry-page .device-note-heading label span { color:#667581; font-size:13px; }
  .desktop-shell .device-entry-page .device-panel #dev_note { font-size:14px; line-height:1.6; }
  .desktop-shell .entry-page .entry-footer { bottom:8px; left:16px; right:16px; background:#fff; }
  .desktop-shell .entry-page .entry-actions-row { gap:6px; }
  .desktop-shell .entry-page .entry-action-group > .btn { padding-inline:clamp(6px,2.15vw,14px); }
}

.history-date-display {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  width:100%;
  height:var(--history-control-height);
  padding:0 3px;
  border:1px solid #dce5ee;
  border-radius:8px;
  background:#fff;
  color:var(--ink);
  font-family:inherit;
  font-size:clamp(11px,3.1vw,13px);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  cursor:pointer;
}
.history-date-display .ic { width:13px; height:13px; flex-shrink:0; }
.history-date input[type=date] { display:none; }
.history-date-display:disabled { color:#53677a; cursor:default; }
.history-date-display:focus-visible { outline:2px solid var(--brand2); outline-offset:1px; }
