/* ============================================================
 * 子页外壳统一规范（2026-09-30）
 * 基准：商单管理 deals.html
 * 适用：workshop / ledger / keywords / rules / deals
 * 用法：在页面 inline <style> 之后的最后一个 <link> 之后引入，靠「同优先级后置」覆盖。
 * ============================================================ */

/* ---- 1. 容器：最大宽度与左右留白统一 ---- */
.wrap { max-width: 1120px; margin: 0 auto; padding: var(--s-20) var(--s-18) 60px; }

/* ---- 2. 顶栏：高度节奏、标题图标对齐、右侧返回链接 ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  margin-bottom: var(--s-18);
  flex-wrap: wrap;
}
.topbar h1 {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
}
.topbar h1 > .icon { width: 20px; height: 20px; flex: none; color: var(--xhs-red-text, #D81B37); }
.topbar .back {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--s-6);
  font-size: 13px;
  line-height: 1;
  color: #5B5457;
  text-decoration: none;
}
.topbar .back > .icon { width: 15px; height: 15px; flex: none; }
.topbar .back:hover { color: var(--xhs-red-text, #D81B37); }

/* ---- 3. 卡片：圆角 / 内距 / 间距统一 ---- */
.card {
  background: #fff;
  border-radius: 14px;
  padding: var(--s-18);
  margin-bottom: var(--s-16);
  box-shadow: var(--shadow-xs);
}
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: var(--s-12); }

/* ---- 4. 按钮：圆角与内距统一 ---- */
.btn {
  border-radius: 10px;
  padding: var(--s-8) var(--s-18);
  font-size: 14px;
  font-weight: 600;
}
.btn-sm { padding: var(--s-4) var(--s-12); font-size: 12px; border-radius: 8px; }

/* ---- 5. 统计卡：与商单页一致 ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-12); margin-bottom: var(--s-16); }
.stat { background: #fff; border-radius: 14px; padding: var(--s-16); box-shadow: var(--shadow-xs); }

/* ---- 6. 移动端收紧 ---- */
@media (max-width: 640px) {
  .wrap { padding: var(--s-16) var(--s-12) var(--s-48); }
  .card { padding: var(--s-14); }
  .topbar { margin-bottom: var(--s-14); }
  .topbar h1 { font-size: 17px; }
}
