/* ==========================================================================
   V1.0.0 b15 · 交互精简补丁
   1) 受试者信息条固定（sticky）
   2) 数据核查明细：访视页签化（一键按访视观察）
   3) 访视「未采集」：黄色入口 + 单/多选 + 原因
   4) 右上角「数据词典维护」聚合入口
   5) 访视日程：日历前置 + 今日绿色
   ========================================================================== */

/* ---------------- 一、受试者信息条固定 ---------------- */
/* 关键前提：Chrome 把 body 算成了「滚动容器」（overflow 计算值为 hidden），
   sticky 会相对 body 定位而不是窗口，于是完全不吸顶（实测滚动后信息条被推出视口）。
   桌面端放开 body 的裁剪，让窗口重新成为滚动容器；移动端不动，
   以免覆盖 body.nav-open{overflow:hidden} 的抽屉锁滚动。 */
@media (min-width: 1024px) {
  /* display:flow-root 是必须的：body 一旦 overflow:visible，其首个块级子元素
     的 margin-top 会与 body 发生外边距合并，把整个 body 向下推（实测推了约 490px，
     页面顶部出现大片空白）。flow-root 建立 BFC 消除合并，同时不影响 sticky。 */
  body.has-shell { overflow: visible; display: flow-root; }
}
#page > .sub-hero {
  position: sticky;
  /* 由 v103-b15.js 的 syncStickyTop() 按项目顶栏实测高度写入；兜底 106px */
  top: var(--v103-top, 106px);
  z-index: 35;
  box-shadow: 0 6px 18px rgba(13, 43, 69, .07);
  backdrop-filter: blur(2px);
}
@media (max-width: 1023px) {
  #page > .sub-hero { top: 0; box-shadow: 0 4px 12px rgba(13, 43, 69, .1); }
}
/* 固定后与下方卡片留出间距，避免视觉粘连 */
#page > .sub-hero + .card { margin-top: 12px; }

/* ---------------- 二、数据核查明细：访视页签 ---------------- */
.v103-vtabs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; background: #fff;
  border-bottom: 1px solid #e8f0f4; position: relative;
}
.v103-vtabs .lb {
  font-size: 11.5px; color: #7b8f9d; letter-spacing: .5px; margin-right: 2px;
}
.v103-vt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 8px; border: 1px solid #e2ecf1;
  background: #f8fbfd; color: #33505e; font-size: 12.5px; cursor: pointer;
  line-height: 1.2; white-space: nowrap; transition: .15s;
}
.v103-vt:hover { border-color: #b9dfd6; background: #f2fbf8; }
.v103-vt .c { font-weight: 700; font-variant-numeric: tabular-nums; }
.v103-vt .nm { color: #7b8f9d; font-size: 11.5px; max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
.v103-vt .n { font-size: 11px; color: #8ba0ae; background: #eef4f8; border-radius: 999px; padding: 1px 6px; }
.v103-vt .q { font-size: 11px; color: #b3261e; background: #fdeceb; border-radius: 999px; padding: 1px 6px; }
.v103-vt .nc { font-size: 11px; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 1px 6px; }
.v103-vt.on {
  background: #0d6b5f; border-color: #0d6b5f; color: #fff;
  box-shadow: 0 3px 10px rgba(13, 107, 95, .22);
}
.v103-vt.on .nm, .v103-vt.on .n { color: #c9ece6; }
.v103-vt.on .n { background: rgba(255, 255, 255, .16); }
.v103-vt.on .q { background: rgba(255, 255, 255, .18); color: #ffd9d6; }
.v103-vt.on .nc { background: rgba(254, 243, 199, .22); color: #ffe6a8; }
.v103-vt.done .c::after { content: '✓'; margin-left: 3px; font-size: 10px; color: #14a37f; }
.v103-vt.on.done .c::after { color: #b7f0e2; }

.v103-vtabs .sp { flex: 1; }
.v103-ncbtn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 8px; font-size: 12px; cursor: pointer;
  border: 1px dashed #e3b04b; background: #fffaeb; color: #92400e;
  white-space: nowrap;
}
.v103-ncbtn:hover { background: #fef3c7; border-style: solid; }
.v103-ncbtn svg { opacity: .8; }

/* 单个访视卡片：页签化后只显示一个 */
.v99-vgrid.v103-one { grid-template-columns: 1fr; }
.v99-vgrid.v103-one .v99-vcard { display: none; }
.v99-vgrid.v103-one .v99-vcard.on { display: block; }
.v99-vgrid.v103-one .v99-vcard .v99-vwrap { max-height: none; }

/* ---- 自渲染明细（展开行） ---- */
.v103-drow > td { padding: 0 !important; background: #fbfdfe; }
.v103-din { border-top: 1px solid #e8f0f4; }
.v103-dbody { padding: 0 12px 12px; }
.v103-empty { padding: 18px 12px; color: #8ba0ae; font-size: 12.5px; text-align: center; }
.v103-fwrap { max-height: 460px; overflow: auto; border: 1px solid #eaf1f5; border-radius: 9px; background: #fff; }
.v103-fld { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.v103-fld th {
  position: sticky; top: 0; z-index: 2; background: #f6fafc; color: #5b7383;
  font-weight: 600; font-size: 11.5px; text-align: left; padding: 7px 10px;
  border-bottom: 1px solid #e8f0f4; white-space: nowrap;
}
.v103-fld td { padding: 6px 10px; border-bottom: 1px solid #f1f6f9; color: #2f4a5c; vertical-align: top; }
.v103-fld tr:last-child td { border-bottom: none; }
.v103-fld tr.v103-fh td {
  background: #f4faf8; border-top: 1px solid #e2efeb; padding: 7px 10px;
  font-size: 12.5px; color: #1d4a41;
}
.v103-fld tr.v103-fh:first-child td { border-top: none; }
.v103-fld tr.v103-fh b { font-family: Consolas, Menlo, monospace; color: #0d6b5f; margin-right: 4px; }
.v103-fld tr.v103-fh .sp { display: inline-block; width: 12px; }
.v103-fld tr.v103-fh .st {
  font-size: 11px; border-radius: 999px; padding: 1px 7px; margin-left: 6px;
  background: #eef4f8; color: #6b8090;
}
.v103-fld tr.v103-fh .st.done { background: #e8f7f4; color: #0b7d5e; }
.v103-fld tr.v103-fh .st.draft { background: #fdf3e3; color: #a16207; }
.v103-fld tr.v103-fh .st.nc { background: #fef3c7; color: #92400e; }
/* 未采集原因：跟在黄色「未采集」标记后，超长省略、悬停看全文 */
.v103-fld tr.v103-fh .v103-ncr {
  display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom;
  font-size: 11.5px; color: #92400e; background: #fffaeb;
  border: 1px dashed #e3b04b; border-radius: 4px; padding: 0 6px; margin-left: 6px;
}
.v103-fld tr.v103-fh .q { background: #fdeceb; color: #b3261e; }
.v103-fld .v103-go { color: #0d6b5f; font-size: 12px; margin-left: 10px; white-space: nowrap; }
.v103-fld .v103-go:hover { text-decoration: underline; }
.v103-fld td.fc { color: #8ba0ae; font-family: Consolas, Menlo, monospace; font-size: 11.5px; }
.v103-fld td.fk { color: #5b7383; word-break: break-all; }
.v103-fld td.fv { color: #16303f; word-break: break-word; }
.v103-fld td.fq .q {
  display: inline-block; min-width: 18px; text-align: center;
  font-size: 11px; color: #b3261e; background: #fdeceb; border-radius: 999px; padding: 0 5px;
}
.v103-fld .v103-more { color: #8ba0ae; font-size: 11.5px; text-align: center; }
.v103-na { color: #92400e; background: #fef3c7; border-radius: 4px; padding: 0 4px; font-size: 11.5px; }


/* ---------------- 三、未采集弹窗 ---------------- */
.v103-ov {
  position: fixed; inset: 0; z-index: 9999; background: rgba(11, 32, 48, .42);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.v103-dlg {
  width: 100%; max-width: 560px; max-height: 86vh; background: #fff;
  border-radius: 14px; box-shadow: 0 24px 60px rgba(9, 30, 45, .28);
  display: flex; flex-direction: column; overflow: hidden;
}
.v103-dlg .hd {
  padding: 14px 18px; border-bottom: 1px solid #eef3f6; display: flex; align-items: center; gap: 10px;
}
.v103-dlg .hd b { font-size: 15px; color: #12324a; }
.v103-dlg .hd .x { margin-left: auto; color: #8ba0ae; font-size: 20px; line-height: 1; cursor: pointer; }
.v103-dlg .bd { padding: 14px 18px; overflow: auto; }
/* 表单清单单独滚动：原因选择与说明保持在一屏内可见（18 张表单时原因区会被挤出视口） */
.v103-ncforms { max-height: 34vh; overflow: auto; padding-right: 4px; }
.v103-dlg .ft {
  padding: 12px 18px; border-top: 1px solid #eef3f6; display: flex; gap: 10px; justify-content: flex-end;
}
.v103-dlg .hint { font-size: 12px; color: #7b8f9d; line-height: 1.8; margin-bottom: 10px; }
.v103-frm {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: 1px solid #eef3f6; border-radius: 8px; margin-bottom: 6px; cursor: pointer;
}
.v103-frm:hover { border-color: #b9dfd6; background: #f7fdfb; }
.v103-frm input { width: 15px; height: 15px; accent-color: #0d6b5f; }
.v103-frm b { font-size: 12.5px; color: #24404f; }
.v103-frm .fn { font-size: 12px; color: #6b8090; }
.v103-frm .st { margin-left: auto; font-size: 11px; }
.v103-frm .st.done { color: #0b7d5e; }
.v103-frm .st.nc { color: #92400e; }
.v103-frm .st.none { color: #9aabb8; }
.v103-frm.dis { opacity: .55; cursor: not-allowed; }
.v103-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.v103-reasons span {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid #e2ecf1; background: #f8fbfd; color: #4a6573;
}
.v103-reasons span.on { background: #e8f7f4; border-color: #7fcdbd; color: #0b6b5c; font-weight: 600; }
.v103-dlg textarea {
  width: 100%; min-height: 62px; border: 1px solid #e2ecf1; border-radius: 8px;
  padding: 8px 10px; font-size: 13px; color: #24384a; resize: vertical;
  font-family: inherit;
}
.v103-dlg textarea:focus { outline: none; border-color: #7fcdbd; box-shadow: 0 0 0 3px rgba(24, 193, 171, .12); }
.v103-dlg .row2 { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: #5b7383; white-space: nowrap; }
.v103-dlg .row2 input { flex: none; }

/* ---------------- 四、右上角数据词典维护 ---------------- */
.v103-dict { position: relative; display: inline-flex; }
.v103-dict > a {
  display: inline-flex; align-items: center; gap: 6px;
  height: 29px; padding: 0 11px; border-radius: 7px;
  border: 1px solid #d9e6ee; background: #fff; color: #35586c;
  font-size: 12.5px; white-space: nowrap;
}
.v103-dict > a:hover { border-color: #b9dfd6; color: #0d6b5f; background: #f7fdfb; }
.v103-dict > a.on { border-color: #0d6b5f; color: #0d6b5f; background: #f2fbf8; }
.v103-dict-menu {
  position: absolute; right: 0; top: 36px; z-index: 60; min-width: 232px;
  background: #fff; border: 1px solid #e3ebf1; border-radius: 10px;
  box-shadow: 0 14px 34px rgba(14, 40, 60, .14); padding: 7px; display: none;
}
.v103-dict-menu.on { display: block; }
.v103-dict-menu .t {
  font-size: 10.5px; color: #93a6b3; letter-spacing: .8px; padding: 5px 9px 6px;
}
.v103-dict-menu a {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 7px;
  color: #2f4a5c; font-size: 13px;
}
.v103-dict-menu a:hover { background: #f2fbf8; color: #0d6b5f; }
.v103-dict-menu a i { font-style: normal; font-size: 11px; color: #93a6b3; margin-left: auto; }
.v103-dict-menu .ft {
  border-top: 1px solid #eef3f6; margin-top: 5px; padding: 7px 9px 3px;
  font-size: 11px; color: #93a6b3; line-height: 1.7;
}

/* ---------------- 五、访视日程：日历前置 + 今日绿色 ---------------- */
.v97-sch-tabs { display: flex; gap: 6px; }
.v97-sch-tabs a[data-view="cal"].on { background: #0d6b5f; border-color: #0d6b5f; }
.v97-cal-cell.today {
  background: #eafaf3 !important;
  box-shadow: inset 0 0 0 2px #12a06f !important;
}
.v97-cal-cell.today .d {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 4px; border-radius: 6px;
  background: #12a06f; color: #fff; font-weight: 800;
}
.v97-cal-cell.today::after {
  content: '今天'; position: absolute; right: 6px; top: 6px;
  font-size: 9.5px; color: #0b7d5e; font-weight: 700;
}
.v97-cal-cell { position: relative; }
.v97-cal-cell.sel { outline: 2px solid #0d6b5f; outline-offset: -2px; }
.v97-cal-legend span:first-child i { background: #12a06f !important; }

/* ---------------- 六、侧栏 ---------------- */
.v52-rail { scrollbar-width: thin; }
.v52-rail::-webkit-scrollbar { width: 6px; }
.v52-rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }
.v52-rail a.v103-miss svg { opacity: .0; }
.v52-rail .v67-rgt { padding-top: 8px; }
.v52-rail a.on { position: relative; }
.v52-rail a.on::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: #4fe0c8; border-radius: 0 3px 3px 0;
}

/* ---------------- 移动端 ---------------- */
@media (max-width: 767px) {
  .v103-vtabs { padding: 8px 10px; gap: 6px; }
  .v103-vt { padding: 5px 9px; font-size: 12px; }
  .v103-vt .nm { display: none; }
  .v103-dict-menu { right: -6px; }
  .v99-vgrid.v103-one .v99-vcard .v99-vwrap { max-height: 58vh; }
  .v103-dlg { max-height: 92vh; }
}
