/*
 * LinsGeek ERP —— 扫描发货（/order/scan-ship）新布局（配合 41-scan-ship.js）
 * 电脑：左侧「扫描 + 统计 + 已扫列表」，右侧「订单详情」固定在视野内。
 * 平板/手机：单列，顺序为 扫描框 → 订单详情 → 统计 → 已扫列表（扫完立刻看到详情）。
 * 回滚：删除 41-scan-ship.css + 41-scan-ship.js。
 */

/* ---------- 外层：取消宽度下限和左右 100px 空白 ---------- */
body.lg-scan #app .min-w-\[1272px\],
body.lg-scan #app .min-w-\[1136px\] { min-width: 0 !important; }
body.lg-scan #app .w-full.bg-white:has(> [data-scan="root"]) { background: #f3f6f5 !important; min-height: 100vh; }
body.lg-scan #app .p-main:has([data-scan="root"]) { padding: 0 !important; background: #f3f6f5; }
body.lg-scan [data-scan="root"] {
  margin: 0 auto !important; max-width: 1440px; padding: 20px 24px 32px;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #0f1a18;
}

/* ---------- 提示条 ---------- */
body.lg-scan [data-scan="alert"] { align-items: center; gap: 12px; margin-bottom: 16px; }
body.lg-scan [data-scan="alert"] > div:first-child {
  flex: 1; min-width: 0; border-radius: 12px; padding: 10px 4px !important;
  background: #fff7ea !important; border: 1px solid #f5e1bd;
}
body.lg-scan [data-scan="alert"] > div:first-child .mx-\[20px\] { margin: 0 14px 0 10px !important; font-size: 13px; line-height: 1.6; color: #7a5a1e; }
body.lg-scan [data-scan="alert"] > i { margin: 0 !important; flex: 0 0 auto; padding: 8px; border-radius: 999px; color: #8a9794; }
body.lg-scan [data-scan="alert"] > i:hover { background: #e7ecea; color: #0f1a18; }

/* ---------- 主体：网格 ---------- */
body.lg-scan [data-scan="main"] {
  display: grid !important; margin: 0 !important; height: auto !important;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  grid-template-areas: "box detail" "stats detail" "tabs detail" "table detail";
  grid-template-rows: auto auto auto 1fr;
  gap: 16px 24px; align-items: start;
}
body.lg-scan [data-scan="left"] { display: contents !important; }
body.lg-scan [data-scan="box"] { grid-area: box; }
body.lg-scan [data-scan="stats"] { grid-area: stats; }
body.lg-scan [data-scan="tabs"] { grid-area: tabs; }
body.lg-scan [data-scan="table"] { grid-area: table; }
body.lg-scan [data-scan="detail"] { grid-area: detail; }

/* 卡片通用 */
body.lg-scan [data-scan="box"],
body.lg-scan [data-scan="table"],
body.lg-scan [data-scan="detail"] {
  background: #fff !important; border: 1px solid rgba(15, 35, 30, .08); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 30px -22px rgba(13,123,109,.35);
  width: auto !important; margin: 0 !important; min-width: 0 !important;
}

/* ---------- 扫描框 ---------- */
body.lg-scan [data-scan="box"] {
  height: auto !important; padding: 22px;
  background: linear-gradient(135deg, #0d7b6d 0%, #13b8a6 100%) !important; border: 0;
  position: relative; overflow: hidden;
}
body.lg-scan [data-scan="box"]::before {
  content: "扫描或输入单号，自动发货"; display: block; position: relative; z-index: 1;
  color: #fff; font-size: 17px; font-weight: 700;
}
html[lang^="pt"] body.lg-scan [data-scan="box"]::before { content: "Escaneie ou digite o código para enviar"; }
body.lg-scan [data-scan="box"]::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none;
}
body.lg-scan [data-scan="box"] > div { margin: 0 !important; padding: 0 !important; position: relative; z-index: 1; color: rgba(255,255,255,.92); }
body.lg-scan [data-scan="box"] > div:first-child:not(:has(*)) { display: none; }
body.lg-scan [data-scan="box"] > div:first-child { font-size: 13px; margin-top: 8px !important; }
body.lg-scan [data-scan="search"] { display: flex !important; flex-wrap: nowrap !important; gap: 10px; align-items: stretch !important; margin-top: 14px; }
body.lg-scan [data-scan="search"] .el-input { flex: 1 1 auto; min-width: 0; width: auto !important; }
body.lg-scan [data-scan="search"] .el-input__wrapper {
  height: 54px; border-radius: 14px !important; padding: 0 16px !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.4) inset !important; background: #fff;
}
body.lg-scan [data-scan="search"] .el-input__wrapper.is-focus { box-shadow: 0 0 0 3px rgba(255,255,255,.55) !important; }
body.lg-scan [data-scan="search"] .el-input__inner { font-size: 18px !important; height: 54px !important; color: #0f1a18; }
body.lg-scan [data-scan="search"] .el-input__inner::placeholder { font-size: 16px; color: #9aa6a3; }
body.lg-scan [data-scan="btn"] {
  margin: 0 !important; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 28px !important; white-space: nowrap; border-radius: 14px !important;
  background: #0b3f38 !important; color: #fff !important; font-size: 16px; font-weight: 700; letter-spacing: .1em;
  box-shadow: 0 10px 20px -12px rgba(0,0,0,.5);
}
body.lg-scan [data-scan="btn"]:hover { background: #072d28 !important; }
/* 搜索框下方的扫描结果提示（如"未找到订单"）：白底小标签，绿色背景上也看得清 */
body.lg-scan [data-scan="search"] + div:not(:empty) {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; max-width: 100%;
  padding: 6px 12px; border-radius: 10px; background: #fff; font-size: 13px; line-height: 1.5;
  box-shadow: 0 6px 14px -10px rgba(0,0,0,.4); overflow-wrap: anywhere;
}

/* ---------- 统计：数字胶囊 ---------- */
body.lg-scan [data-scan="stats"] {
  margin: 0 !important; display: flex !important; flex-wrap: wrap !important; gap: 10px; justify-content: flex-start !important;
}
body.lg-scan [data-scan="stats"] > div { display: contents !important; }
body.lg-scan [data-scan="stats"] > div > div {
  display: inline-flex !important; align-items: center; gap: 4px; margin: 0 !important;
  padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid rgba(15,35,30,.08);
  font-size: 14px !important; font-weight: 600; white-space: nowrap;
}
body.lg-scan [data-scan="stats"] i { margin: 0 2px 0 4px !important; }

/* ---------- 发货成功 / 失败 切换 ---------- */
body.lg-scan [data-scan="tabs"] { display: inline-flex !important; flex-wrap: nowrap !important; justify-self: start; padding: 4px; background: #e6eeec; border-radius: 999px; }
body.lg-scan [data-scan="tabs"] > div {
  border: 0 !important; border-radius: 999px !important; padding: 7px 18px !important; background: transparent !important;
  color: #4b5a57; font-weight: 600; white-space: nowrap;
}
body.lg-scan [data-scan="tabs"] > div.text-main { background: #fff !important; color: #0d7b6d !important; box-shadow: 0 2px 6px -2px rgba(0,0,0,.15); }

/* ---------- 已扫列表 ---------- */
body.lg-scan [data-scan="table"] { height: auto !important; min-height: 260px; overflow: auto !important; padding: 6px; }
body.lg-scan [data-scan="table"] table { min-width: 560px; border: 0 !important; }
body.lg-scan [data-scan="table"] th {
  white-space: nowrap; background: #f5f8f7 !important; color: #4b5a57; font-weight: 600; border: 0 !important;
}
body.lg-scan [data-scan="table"] th:first-child { border-radius: 12px 0 0 12px; }
body.lg-scan [data-scan="table"] th:last-child { border-radius: 0 12px 12px 0; }
body.lg-scan [data-scan="table"] td { border-left: 0 !important; border-right: 0 !important; }

/* ---------- 订单详情 ---------- */
body.lg-scan [data-scan="detail"] {
  display: block !important; padding: 20px 20px 22px;
  position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto !important;
}
body.lg-scan [data-scan="detail-in"] { margin: 0 !important; width: 100% !important; }
body.lg-scan [data-scan="info"] { min-height: 0 !important; display: grid !important; grid-template-columns: minmax(0, 1fr); align-items: stretch !important; }
body.lg-scan [data-scan="info"] > div:first-child { font-size: 18px !important; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
body.lg-scan [data-scan="info"] > div:first-child::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: #13b8a6; }
body.lg-scan [data-scan="info"] > div:not(:first-child) {
  padding: 9px 2px; border-bottom: 1px dashed rgba(15,35,30,.1); font-size: 13.5px; line-height: 1.5;
  overflow-wrap: anywhere; min-width: 0;
}
body.lg-scan [data-scan="info"] > div:last-child { border-bottom: 0; }
body.lg-scan [data-scan="line"] { display: none !important; }
body.lg-scan [data-scan="goods"] { height: auto !important; margin-top: 14px; }
body.lg-scan [data-scan="goods"] .el-table { border-radius: 12px; overflow: hidden; }

/* ---------- 平板/手机：单列 ---------- */
@media (max-width: 1023px) {
  body.lg-scan [data-scan="root"] { padding: 14px 14px 28px; }
  body.lg-scan [data-scan="main"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "box" "detail" "stats" "tabs" "table";
    grid-template-rows: none; gap: 14px;
  }
  body.lg-scan [data-scan="detail"] { position: static; max-height: none; }
  body.lg-scan [data-scan="info"] { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  body.lg-scan [data-scan="info"] > div:first-child { grid-column: 1 / -1; }
  body.lg-scan [data-scan="info"] > div:nth-last-child(2) { border-bottom: 0; }
}
@media (max-width: 767px) {
  body.lg-scan [data-scan="root"] { padding: 10px 10px 24px; }
  body.lg-scan [data-scan="alert"] { margin-bottom: 10px; }
  body.lg-scan [data-scan="box"] { padding: 16px; border-radius: 16px; }
  body.lg-scan [data-scan="box"]::before { font-size: 15px; }
  body.lg-scan [data-scan="search"] .el-input__wrapper,
  body.lg-scan [data-scan="search"] .el-input__inner,
  body.lg-scan [data-scan="btn"] { height: 48px !important; }
  body.lg-scan [data-scan="search"] .el-input__inner { font-size: 16px !important; }
  body.lg-scan [data-scan="search"] .el-input__inner::placeholder { font-size: 14px; }
  body.lg-scan [data-scan="btn"] { padding: 0 18px !important; font-size: 15px; letter-spacing: 0; }
  body.lg-scan [data-scan="detail"] { padding: 16px; border-radius: 16px; }
  body.lg-scan [data-scan="stats"] > div > div { padding: 7px 12px; font-size: 13px !important; }
}
@media (max-width: 420px) {
  body.lg-scan [data-scan="info"] { grid-template-columns: minmax(0, 1fr); }
  body.lg-scan [data-scan="info"] > div:nth-last-child(2) { border-bottom: 1px dashed rgba(15,35,30,.1); }
}
