/* ==========================================================================
   shared.css —— 全局补充工具类（在 app.css 之后加载）
   ========================================================================== */

/* 启动页淡出 */
.boot.boot-out { opacity: 0; pointer-events: none; }

/* 页面切换动画 */
.page-root { animation: pagein .18s ease; }
@keyframes pagein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* loading 旋转 */
.spin {
  width: 22px; height: 22px; margin: 0 auto; border-radius: 50%;
  border: 2.5px solid #dbe6f5; border-top-color: var(--brand-2);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin-sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }

/* 侧边栏补充 */
.brand-txt { min-width: 0; overflow: hidden; }
.brand-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .ic { display: inline-grid; place-items: center; }
.nav-item .badge-num { margin-left: auto; background: #e05252; color: #fff; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; line-height: 17px; padding: 0 5px; border-radius: 9px; text-align: center; }
.nav-group > h5 { text-transform: none; }
.sidebar-foot .sf-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.sidebar-foot .sf-row:last-child { margin-bottom: 0; }

/* 顶栏补充 */
.top-notice { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ok); background: var(--ok-bg); border: 1px solid #cdeade; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(23,147,106,.16); display: inline-block; flex: 0 0 auto; }
.who { cursor: pointer; border-radius: 8px; padding: 3px 8px 3px 4px; }
.who:hover { background: var(--line-2); }
@media (max-width: 1100px) { .top-notice { display: none; } .who .nm, .who .dp { display: none; } }

/* 间距工具 */
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt28 { margin-top: 28px; }
.mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; } .mb20 { margin-bottom: 20px; }
.ml4 { margin-left: 4px; } .ml8 { margin-left: 8px; } .ml12 { margin-left: 12px; } .ml16 { margin-left: 16px; }
.mr4 { margin-right: 4px; } .mr8 { margin-right: 8px; } .mr12 { margin-right: 12px; }
.pt0 { padding-top: 0 !important; } .pb0 { padding-bottom: 0 !important; } .p0 { padding: 0 !important; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap16 { gap: 16px; } .gap20 { gap: 20px; }

/* 字体 / 颜色 */
.fs11 { font-size: 11px; } .fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs14 { font-size: 14px; } .fs16 { font-size: 16px; } .fs18 { font-size: 18px; } .fs22 { font-size: 22px; } .fs28 { font-size: 28px; }
.fw5 { font-weight: 500; } .fw6 { font-weight: 600; } .fw7 { font-weight: 700; }
.text-ok { color: var(--ok); } .text-bad { color: var(--bad); } .text-warn { color: var(--warn); } .text-brand { color: var(--brand); } .text-accent { color: var(--accent); } .text-ink2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ellipsis-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.break { word-break: break-all; }
.hl { background: linear-gradient(180deg, transparent 58%, #ffe9bd 58%); padding: 0 1px; border-radius: 2px; }
.mark-hl { background: #fff3d6; color: #8a5a08; border-radius: 3px; padding: 0 2px; }

/* 通用小标签 */
.section-t { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink); margin-bottom: 10px; }
.section-t::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--brand-2); }
.section-t .sub { font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.section-t .acts { margin-left: auto; font-weight: 400; }

/* 行内表单 */
.form-inline { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; }
.form-inline .form-item { flex: 0 0 auto; min-width: 150px; }

/* 选中高亮 / 计算值展示 */
.ro-value { height: 32px; line-height: 32px; padding: 0 10px; border: 1px solid #d4ddec; border-radius: 7px; background: #f4f6fa; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ro-value.big { font-size: 16px; font-weight: 700; color: var(--brand); }
.field-yellow { background: #fffcc8 !important; border-color: #e6d98a !important; }
.field-yellow:focus { background: #fffde0 !important; border-color: var(--brand-2) !important; }

/* 图片缩略 / 上传 */
.img-thumb { position: relative; width: 76px; height: 56px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #f4f7fc center/cover no-repeat; cursor: pointer; display: inline-block; }
.img-thumb .x { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; display: grid; place-items: center; }
.slot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot-label { min-width: 132px; text-align: right; font-size: 12.5px; color: var(--ink-2); }
.slot-files { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 表格补充 */
table.table td .sub { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; }
table.table tr.row-warn td { background: #fffdf7; }
table.table tr.row-bad td { background: #fffafa; }
table.table th.center, table.table td.center { text-align: center; }
.table-wrap-card { border-radius: var(--radius); overflow: hidden; }
.tbl-acts { display: inline-flex; gap: 2px; }

/* 卡片补充 */
.card.hoverable { transition: box-shadow .16s, transform .16s, border-color .16s; cursor: pointer; }
.card.hoverable:hover { box-shadow: var(--shadow-2); border-color: #cfdcee; transform: translateY(-1px); }
.card-head.tint { background: linear-gradient(90deg, #f6faff, #fdfefe); }
.card-body.sep { border-bottom: 1px solid var(--line-2); }

/* 描述块 */
.desc-block { font-size: 13px; line-height: 1.78; color: var(--ink-2); }
.desc-block h4 { font-size: 13.5px; color: var(--ink); margin: 14px 0 6px; }
.desc-block h4:first-child { margin-top: 0; }
.desc-block p { margin: 0 0 8px; }
.desc-block ul { margin: 0 0 8px; padding-left: 20px; }
.desc-block li { margin: 2px 0; }

/* 时间线补充（首页动态） */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .ft { font-size: 11px; color: var(--ink-3); white-space: nowrap; min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }
.feed-item .fx { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* 消息列表（纵向：标题行 + 正文行 + 操作行） */
.msg-feed { display: flex; flex-direction: column; }
.msg-item { padding: 10px 4px; border-bottom: 1px dashed var(--line-2); }
.msg-item:last-child { border-bottom: 0; }
.msg-item .ft { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.msg-item .ft b { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52%; }
.msg-item .fx { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }

/* 提示行 */
.alert { display: flex; gap: 9px; align-items: flex-start; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.65; }
.alert .ai { flex: 0 0 auto; margin-top: 1px; }
.alert-info { background: #f4f9ff; border: 1px solid #d8e7fb; color: #1b4f8f; }
.alert-ok { background: var(--ok-bg); border: 1px solid #c8e9dc; color: #0b6b4b; }
.alert-warn { background: var(--warn-bg); border: 1px solid #f2dcb5; color: #7d5106; }
.alert-bad { background: var(--bad-bg); border: 1px solid #f3cbc6; color: #93241c; }

/* 标签页补充 */
.tabs-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; padding: 0 14px; border-bottom: 0; }
.tabs-card .tabs { border-bottom: 0; margin-bottom: 0; }

/* 进度条补充 */
.progress-row { display: grid; grid-template-columns: 1fr 52px; gap: 10px; align-items: center; }
.progress-row .pv { text-align: right; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* 空块高亮边补充 */
.drop-hint { border: 1px dashed #cfdcee; border-radius: 8px; padding: 18px; text-align: center; color: var(--ink-3); font-size: 12.5px; background: #fbfdff; }

/* 打印 */
@media print {
  .no-print { display: none !important; }
  .card { break-inside: avoid; }
}

/* ===== 组件类名冲突复位 ===== */
/* .stat 的 accent / brand / ok / bad 等修饰类与侧边栏 .brand 同名，会继承 flex 布局，这里统一复位 */
.stat, .stat.brand, .stat.accent, .stat.ok, .stat.bad, .stat.info, .stat.warn {
  display: block; padding: 14px 16px; border-bottom: 0; gap: 0; align-items: initial;
}
.stat .v { white-space: nowrap; }
.stat .d { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 表格内短内容不折行（状态、标签、日期、操作列） ===== */
.tablewrap table .tag,
.tablewrap table .pill,
.tablewrap table .cell-date,
.tablewrap table .date,
.tablewrap table .ops,
.tablewrap table .tbl-acts { white-space: nowrap; }
.tablewrap table .ops .btn,
.tablewrap table .tbl-acts .btn { white-space: nowrap; }
.tablewrap table .cell-strong { font-weight: 600; color: var(--ink); white-space: nowrap; }

/* ===== 桌面端「移动端演示」页：手机外框 + 页面直达 ===== */
.mob-body { display: grid; grid-template-columns: 392px minmax(0, 1fr); gap: 20px; align-items: start; }
.mob-frame { width: 392px; height: min(780px, calc(100vh - 270px)); padding: 10px; border-radius: 40px; background: #10161f; box-shadow: 0 24px 60px rgba(16, 22, 31, .28), inset 0 0 0 2px #2a3444; position: relative; transition: width .25s ease, height .25s ease; }
.mob-frame::before { content: ''; position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 108px; height: 22px; border-radius: 0 0 14px 14px; background: #10161f; z-index: 3; }
.mob-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 32px; background: #f2f5fa; display: block; }
.mob-frame.wide { width: 560px; height: min(800px, calc(100vh - 265px)); }
.mob-side { min-width: 0; }
.mob-group-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); margin: 2px 0 8px; }
.mob-routes { display: grid; gap: 8px; max-height: 560px; overflow: auto; padding-right: 4px; }
.mob-route { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; transition: .15s; }
.mob-route:hover { border-color: var(--brand-2); background: var(--brand-3); transform: translateX(2px); }
.mob-route .ic { color: var(--brand); flex: 0 0 auto; margin-top: 2px; }
.mob-route b { display: block; font-size: 13px; color: var(--ink); font-weight: 600; }
.mob-route em { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
@media (max-width: 1180px) {
  .mob-body { grid-template-columns: 1fr; }
  .mob-frame, .mob-frame.wide { width: min(392px, 100%); height: 760px; margin: 0 auto; }
  .mob-routes { max-height: none; }
}

/* ===== 指标卡网格兼容写法（.grid.cols-N 等价于 .grid-N） ===== */
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1280px) {
  .grid.cols-5, .grid.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5, .grid.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

