/* ============================================================================
 * V9.2 版式修复与新功能样式（V1.0.0 build b4）
 * 1) 项目壳吸顶基准修正（原 58px 假设平台顶栏，项目页并无顶栏 → 顶部漏出内容）
 * 2) 横向溢出收敛（表格/长文本不再把整页撑宽，侧栏不再被推出视口）
 * 3) 概览信息栅格与图表空态
 * 4) 一般审核员标识 / 授权码邮件发送 / 锁库归档刻盘
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. 吸顶基准：项目壳（.v52-app）内没有平台顶栏，sticky 必须贴 0；
 *    测试环境顶部有 30px 警示条，则整体让位 30px。
 *    用 .v52-app 作用域限定，不影响平台壳（.pnav 仍按 58px 布局）。
 * ------------------------------------------------------------------------- */
body .v52-app .v52-rail { top: 0; height: 100vh; }
body .v52-app .v52-top { top: 0; }
body.env-test .v52-app .v52-rail { top: 30px; height: calc(100vh - 30px); }
body.env-test .v52-app .v52-top { top: 30px; }

/* 项目壳高度按整屏算（原 calc(100vh - 58px) 会在底部留白） */
.v52-app { min-height: 100vh; }
body.env-test .v52-app { min-height: calc(100vh - 30px); }

/* 侧栏「折叠」按钮：原来独占据一块空方块压住品牌文字，改为右上角小图标 */
/* V9.3 修复：此处旧写法 `.v52-rail{position:sticky}` 未加断点，加载顺序又晚于 v81.css，
   同权重覆盖了手机端的 position:fixed，导致手机上侧栏回到普通文档流、按 100dvh 撑满
   一屏，把正文整体推到第二屏（实测 #page 起始 y=802、视口高仅 752）。
   桌面侧需要 sticky 吸顶，手机侧必须保持抽屉定位，故按断点分开。 */
@media (min-width: 768px) {
  .v52-rail { position: sticky; }
}
@media (max-width: 767px) {
  body .v52-app .v52-rail {
    position: fixed; top: 0; left: 0; bottom: 0;
    height: 100dvh; flex: none;
    transform: translateX(-102%);
    overflow-y: auto; overflow-x: hidden;
  }
  body.nav-open .v52-app .v52-rail { transform: translateX(0); }
  body.env-test .v52-app .v52-rail { top: 30px; height: calc(100dvh - 30px); }
}
.v52-rail:not(.v68-fold) .rail-brand { width: 46px; height: 46px; min-height: 46px; border-radius: 12px; margin: 0 0 10px; align-self: flex-start; }
.v52-rail .rail-brand { margin: 0 0 10px; align-self: flex-start; }
.v52-rail .rail-brand img { width: 30px; height: 30px; }
.v52-rail .v68-fold-btn {
  position: absolute; top: 12px; right: 8px; width: 22px; height: 22px;
  padding: 0; opacity: .5; border-radius: 6px;
}
.v52-rail .v68-fold-btn:hover { opacity: 1; }
.v52-rail .v68-fold-btn svg { width: 13px; height: 13px; }

/* 吸顶栏贴住页面顶端时，下方内容不应再从栏上方漏出 */
.v52-top { box-shadow: 0 1px 0 rgba(15, 40, 50, .04); }

/* ---------------------------------------------------------------------------
 * 2. 横向溢出收敛
 *    用 overflow-x:clip 而非 hidden：clip 不建立滚动容器，不影响 sticky 生效。
 * ------------------------------------------------------------------------- */
html, body { overflow-x: clip; }
.v52-app { overflow-x: clip; }

/* 顶栏内容过长时换行而不是把页面撑宽；项目选择器可收缩 */
.v52-top { flex-wrap: wrap; row-gap: 6px; }
.v52-top .crumb { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v52-top select { min-width: 0; max-width: 46vw; }
@media (max-width: 1180px) {
  .v52-top { padding: 8px 14px; }
  .v52-top select { max-width: 60vw; }
}

/* 卡片内的宽表格改为卡片内滚动，避免整页横向滚动 */
.ov-body, .v67-card, .v52-body > .card { overflow-x: auto; }
.ov-body > table, .v67-card > table { min-width: 0; }

/* 平台壳内容区同样收敛 */
.v52-content { overflow-x: clip; }

/* ---------------------------------------------------------------------------
 * 3. 概览页：信息栅格 / 待办 / 图表空态
 * ------------------------------------------------------------------------- */
/* 项目信息：标签列稍宽，长文本可悬浮查看完整值 */
.oi dt { flex: 0 0 88px; }
.oi dd { cursor: default; }
@media (min-width: 1360px) {
  .oi-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* 项目状态复合标签：主状态 + 补充说明 */
.v92-st { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.v92-st .st-main { font-weight: 600; }
.v92-st .st-sub { font-size: 11px; color: #8b9aab; }
.v92-st .st-sub.warn { color: #b45309; }
.v92-st .st-sub.lock { color: #6b5bd2; }

/* 图表空态（无入组数据时替代一条贴底平线） */
.v92-chart-empty {
  height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #a4b2c0; font-size: 12.5px;
  background: repeating-linear-gradient(0deg, #f7fafb 0 1px, transparent 1px 40px);
  border: 1px dashed #e6eef3; border-radius: 8px;
}
.v92-chart-empty b { font-size: 13px; color: #7b8b9a; font-weight: 600; }

/* 角色指南：宽度自适应（原 640px 定宽导致右侧大片空白） */
.v91-guide { max-width: min(100%, 880px); }
@media (max-width: 900px) { .v91-guide { max-width: 100%; } }

/* ---------------------------------------------------------------------------
 * 4. 一般审核员（Reviewer）
 * ------------------------------------------------------------------------- */
.v92-rev-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px;
  border: 1px solid #d8d2f5; background: #f4f1fe; color: #5b4bc4;
  border-radius: 4px; padding: 0 5px; line-height: 17px;
}
/* 审核员不可见的数据位：整块隐藏而不是留空，避免误以为加载失败 */
.v92-hide { display: none !important; }
/* 审核员概览页顶部的范围提示条 */
.v92-scope-note {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px;
  background: #f6f5fe; border: 1px solid #e3ddfa; border-left: 3px solid #6c5ce7;
  border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #4a3fa8; line-height: 1.65;
}
.v92-scope-note b { color: #3b3193; }
.v92-scope-note i { font-style: normal; flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: #6c5ce7; color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

/* 项目授权（审核员视角）卡片 */
.v92-auth-card { background: #fff; border: 1px solid #e6eef3; border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.v92-auth-card h4 { margin: 0 0 4px; font-size: 13.5px; color: #1e3340; }
.v92-auth-card p { margin: 0; font-size: 12px; color: #71878f; line-height: 1.6; }
.v92-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 18px; margin-top: 10px; }
.v92-kv div { font-size: 12px; color: #8b9aab; }
.v92-kv b { display: block; font-size: 13px; color: #1e3340; font-weight: 600; margin-top: 2px; }

/* ---------------------------------------------------------------------------
 * 5. 授权码邮件发送
 * ------------------------------------------------------------------------- */
.v92-mail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.v92-mail-grid .wide { grid-column: 1 / -1; }
.v92-mail-grid label { display: block; font-size: 11.5px; color: #7b8b9a; margin-bottom: 4px; }
.v92-mail-grid input, .v92-mail-grid select, .v92-mail-grid textarea {
  width: 100%; border: 1px solid #dde7ee; border-radius: 7px; padding: 7px 9px; font-size: 13px;
  color: #22384a; background: #fff; font-family: inherit;
}
.v92-mail-grid input[readonly] { background: #f7fafb; color: #5b6d7c; }
.v92-mail-preview {
  margin-top: 12px; border: 1px solid #e6eef3; border-radius: 10px; overflow: hidden; background: #fbfdfd;
}
.v92-mail-preview .hd { padding: 9px 12px; background: #f2f8f7; border-bottom: 1px solid #e6eef3;
  font-size: 11.5px; color: #2b7d6c; display: flex; align-items: center; gap: 8px; }
.v92-mail-preview .bd { padding: 12px 14px; font-size: 12.5px; color: #33475b; line-height: 1.85; }
.v92-mail-preview .bd table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.v92-mail-preview .bd th, .v92-mail-preview .bd td { border: 1px solid #e6eef3; padding: 6px 9px; text-align: left; font-size: 12.5px; }
.v92-mail-preview .bd th { background: #f7fafb; color: #5b6d7c; font-weight: 500; width: 96px; }
.v92-mail-preview .bd .code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: 1.2px;
  color: #0b5c50; background: #eefaf7; border: 1px dashed #b7e3da; border-radius: 6px;
  padding: 7px 12px; display: inline-block; margin: 4px 0;
}
.v92-mail-tip { margin-top: 10px; font-size: 11.5px; color: #8b9aab; line-height: 1.7; }
.v92-mail-tip b { color: #b45309; }

/* 发送记录 */
.v92-maillog { margin-top: 14px; }
.v92-maillog table { width: 100%; border-collapse: collapse; }
.v92-maillog th, .v92-maillog td { border-bottom: 1px solid #eef3f6; padding: 7px 9px; font-size: 12px; text-align: left; color: #33475b; }
.v92-maillog th { color: #8b9aab; font-weight: 500; background: #fbfdfd; }

/* ---------------------------------------------------------------------------
 * 6. 锁库与归档刻盘
 * ------------------------------------------------------------------------- */
.v92-lock-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #f6f4fe; border: 1px solid #ded7fb; border-left: 4px solid #6c5ce7;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.v92-lock-banner .ic { width: 30px; height: 30px; border-radius: 8px; background: #6c5ce7; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.v92-lock-banner .tx { flex: 1; min-width: 220px; }
.v92-lock-banner .tx b { display: block; font-size: 13.5px; color: #3b3193; }
.v92-lock-banner .tx span { font-size: 12px; color: #6b62a8; line-height: 1.6; }

.v92-arch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.v92-arch-item {
  border: 1px solid #e6eef3; border-radius: 10px; padding: 12px 14px; background: #fff;
}
.v92-arch-item .t { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1e3340; font-weight: 600; }
.v92-arch-item .t em { font-style: normal; font-size: 10.5px; color: #0b8b7d; background: #e8f7f4; border-radius: 4px; padding: 0 5px; }
.v92-arch-item p { margin: 6px 0 0; font-size: 11.5px; color: #8b9aab; line-height: 1.65; }
.v92-arch-item .n { font-size: 20px; color: #0b5c50; font-weight: 700; margin-top: 6px; }

.v92-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.v92-steps li { position: relative; padding-left: 30px; margin-bottom: 12px; font-size: 12.5px; color: #33475b; line-height: 1.7; }
.v92-steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: #eef7f5; color: #2b7d6c; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.v92-steps li b { color: #1e3340; }
.v92-steps li code { background: #f1f5f8; border-radius: 4px; padding: 1px 5px; font-size: 11.5px; color: #4a5b6b; }

/* 归档进度 */
.v92-prog { height: 8px; border-radius: 4px; background: #eef3f6; overflow: hidden; margin: 10px 0 4px; }
.v92-prog > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #18c1ab, #0b8b7d); transition: width .25s; }
.v92-prog-tx { font-size: 11.5px; color: #8b9aab; }

/* 归档页按钮：.btn-p/.btn-o 只给了配色，没有盒模型，链接形态会挤成一排文字 */
#v92aBuild, #v92aDisc, #v92aLockGo {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 16px; border-radius: 8px;
  font-size: 13px; line-height: 1; text-decoration: none; white-space: nowrap;
}
#v92aBuild[style*="pointer-events:none"], #v92aDisc[style*="pointer-events:none"] { cursor: not-allowed; }

/* ---------------------------------------------------------------------------
 * 7. 窄屏兜底
 * ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .v92-mail-grid { grid-template-columns: 1fr; }
  .v92-auth-card { padding: 12px; }
  .v52-top select { max-width: 100%; }
}
@media print {
  .v91-guide, .v92-lock-banner, .v92-scope-note { display: none !important; }
}
