
/* ============================================================
   门店 IOC · 真实接口数据层样式（加载态 / 失败态 / 状态条）
   配套：gateway.showLoading/showError/hideBar、withRealData 闸门
   唯一来源：2026-11-12 由 index.html 内联 <style> 合并而来，取内联最终生效值
   ============================================================ */

/* 全局异常提示（2026-11-19）：顶部居中的胶囊弹窗，白底 / 细边框 / 圆角 / 轻阴影 /
   左侧圆形 i 图标 / 右侧 × 关闭。全页仅此一个节点，由 gateway.showError/showWarn 复用。
   加载反馈仍统一由页内骨架屏承担，本弹窗仅承载错误 / 警告提示。 */
.ioc-databar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147482999;
  display: none;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  max-width: min(560px, calc(100vw - 32px));
  min-height: 40px;
  padding: 8px 12px 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .13), 0 2px 6px rgba(0, 0, 0, .06);
  font: var(--fs-sm)/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}
/* 左侧圆形信息图标：黑底白 i（示意截图样式）；warn 用琥珀色、err 用主色做语义区分 */
.ioc-databar .idb-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font: 700 13px/1 Georgia, "Times New Roman", serif;
  font-style: italic;
}
.ioc-databar.err .idb-icon { background: var(--primary); }
.ioc-databar.warn .idb-icon { background: #E8A33D; }
.ioc-databar .idb-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ioc-databar .idb-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: -4px -4px -4px 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ioc-databar .idb-close:hover { background: var(--border-light); color: var(--ink); }
.ioc-databar.err { border-color: var(--primary-border, #F0C2C2); }
.ioc-databar.warn { border-color: #F0D9A8; }
.ioc-databar small { opacity: .85; font-weight: 400; }

/* ============================================================
   页面级加载占位（闸门拦截时整页显示）
   参考阿里 / 拼多多做法：骨架屏（shimmer 扫光）+ 品牌旋转环 +
   节奏圆点，用「内容正在成形」的观感降低等待焦虑。
   ============================================================ */
.ioc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 32px 16px 40px;
  text-align: center;
  color: var(--ink-dim);
  font-size: var(--fs-base);
}
/* 品牌标记：旋转渐变环 + 中心静止红点 */
.ioc-loading .il-mark {
  position: relative;
  width: 46px;
  height: 46px;
  display: block;
  margin-bottom: 16px;
}
.ioc-loading .il-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    var(--primary) 0deg, #F2A0AD 110deg, rgba(200, 16, 46, .08) 300deg, var(--primary) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: il-spin 1s linear infinite;
}
.ioc-loading .il-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(200, 16, 46, .1);
  animation: il-pulse 1.6s ease-in-out infinite;
}
.ioc-loading .il-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
}
.ioc-loading .il-sub {
  margin-top: 4px;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.ioc-loading .il-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 10px;
}
.ioc-loading .il-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .45;
  animation: il-bounce 1.05s ease-in-out infinite;
}
.ioc-loading .il-dots i:nth-child(2) { animation-delay: .14s; }
.ioc-loading .il-dots i:nth-child(3) { animation-delay: .28s; }
/* 骨架屏：模拟 KPI 卡 + 图表的真实布局轮廓 */
.ioc-loading .il-skeleton {
  width: min(880px, 92%);
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ioc-loading .il-skel-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.ioc-loading .il-skel-row.charts {
  grid-template-columns: 1.6fr 1fr;
}
.ioc-loading .il-skel {
  border-radius: 10px;
  background: linear-gradient(100deg, #EDEEF1 18%, #F8F9FB 38%, #EDEEF1 58%);
  background-size: 220% 100%;
  animation: il-shimmer 1.5s ease-in-out infinite;
}
.ioc-loading .il-skel.card { height: 74px; }
.ioc-loading .il-skel.chart { height: 132px; }

/* 加载动效关键帧（统一 il- 前缀，避免与其它模块冲突） */
@keyframes il-spin { to { transform: rotate(360deg); } }
@keyframes il-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 5px rgba(200, 16, 46, .1); }
  50% { transform: scale(.82); box-shadow: 0 0 0 9px rgba(200, 16, 46, .04); }
}
@keyframes il-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-6px); opacity: 1; }
}
@keyframes il-shimmer {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}
/* 无障碍：用户偏好减少动效时关闭循环动画，保留静态骨架 */
@media (prefers-reduced-motion: reduce) {
  .ioc-loading .il-orbit,
  .ioc-loading .il-core,
  .ioc-loading .il-dots i,
  .ioc-loading .il-skel { animation: none; }
}

/* 页面级失败占位 */
.ioc-error {
  margin: 40px auto;
  max-width: 560px;
  padding: 32px 16px;
  text-align: center;
  color: var(--red, var(--primary));
  font-size:var(--fs-base);
  line-height: 1.7;
  border: 1px solid #F0C2C2;
  border-radius: 12px;
  background: #FFF5F5;
}
.ioc-error small {
  display: block;
  margin-top: 8px;
  color: var(--ink-dim, var(--ink-dim));
  font-size:var(--fs-sm);
  line-height: 1.6;
}

/* 真实数据缺失时的迷你图占位 */
.spark-empty {
  padding: 6px 8px;
  font-size:var(--fs-xs);
  color: var(--ink-muted, var(--ink-muted));
}

/* 单个指标缺字段时的行内占位 */
.nd {
  color: var(--ink-muted, var(--ink-muted));
  font-size:var(--fs-sm);
  font-style: normal;
}

/* 无经销商授权 · 整页缺省页（插画 + 原因 + 刷新按钮，Ant Design 空态三件套） */
.ioc-noscope {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 32px 20px;
  text-align: center;
}

/* 缺省页刷新按钮：整页主操作，放大为图 2 的醒目胶囊（仅覆盖本页，不影响全局空态按钮）
   —— 更大的内边距与字号、更明显的浅红描边，与说明文案拉开间距 */
.ioc-noscope .ioc-eb-action {
  margin-top: 20px;
  padding: 10px 28px;
  font-size: var(--fs-base);
  font-weight: 700;
  border: 1px solid var(--primary-border);
  background: var(--card);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .04);
  transition: background .15s ease, box-shadow .15s ease;
}

.ioc-noscope .ioc-eb-action:hover {
  background: var(--primary-bg);
  box-shadow: 0 2px 6px 0 rgba(200, 16, 46, .10);
}

/* 认证未就绪的首屏占位（短暂显示，不渲染业务假数据） */
.ioc-auth-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  font-size: var(--fs-sm);
  color: var(--ink-muted, #8E8E93);
}
