/* ============================================================
 * 提交新工单 · 重设计样式
 * 命名空间 .of-* 不污染全局
 * ============================================================ */
.of-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ===== 顶部标题 ===== */
.of-head {
  padding: 8px 4px 24px;
}
.of-head h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.of-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* ===== 审核提示 ===== */
.of-tip {
  background: linear-gradient(180deg, #fff7ed, #fffbeb);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #92400e;
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.of-tip b {
  color: #b45309;
  font-weight: 600;
}

/* ===== 卡片 ===== */
.of-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.of-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fafbfc, #fff);
}
.of-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.of-hd-t {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.of-hd-d {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.of-body {
  padding: 18px;
}

/* ===== 网格与表单字段 ===== */
.of-grid {
  display: grid;
  gap: 14px;
}
.of-g2 {
  grid-template-columns: 1fr 1fr;
}
.of-f {
  display: flex;
  flex-direction: column;
}
.of-f label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.of-f label em {
  color: var(--danger);
  font-style: normal;
  margin-left: 2px;
}
.of-f input,
.of-f select,
.of-f textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.of-f textarea {
  height: auto;
  min-height: 76px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}
.of-f input:focus,
.of-f select:focus,
.of-f textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.of-f input::placeholder,
.of-f textarea::placeholder {
  color: #94a3b8;
}

/* 隐藏但可被 label 关联触发的 select */
.of-hide {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* ===== 行容器（产品 / 寄件人） ===== */
.of-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.of-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1.5fr 76px 1.7fr 36px;
  gap: 12px;
  padding: 14px 14px 14px 38px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fcfdfe;
  align-items: end;
}
.of-row:hover {
  border-color: #c7d2fe;
}
.of-row-no {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 22px;
  height: 22px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.of-ri {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.of-rl {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.of-rl em {
  color: var(--danger);
  font-style: normal;
}
.of-ri input,
.of-ri select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  font-size: 13.5px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.of-ri input:hover,
.of-ri select:hover { border-color: #93c5fd; }
.of-ri input:focus,
.of-ri select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.of-ri-qty input {
  text-align: center;
}
.of-ri-qty {
  max-width: 110px;
}
.of-del {
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  align-self: end;
}
.of-del:hover {
  background: #fef2f2;
  border-color: var(--danger);
  color: var(--danger);
}

/* 多人寄件行（字段更多） */
.of-row.of-ship {
  grid-template-columns: 1fr 1.2fr 1.3fr 1.3fr 76px 1.4fr 36px;
}

/* 添加按钮 */
.of-add {
  width: 100%;
  height: 40px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  background: #fafbfc;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.of-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f7ff;
}

/* ===== 寄件模式分段控件 ===== */
.of-segs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.of-seg {
  position: relative;
  display: block;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  background: #fcfdfe;
  transition: all 0.15s;
}
.of-seg:hover {
  border-color: #93c5fd;
}
.of-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.of-seg.is-on {
  border-color: var(--primary);
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.of-seg-t {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  display: block;
}
.of-seg.is-on .of-seg-t {
  color: var(--primary);
}
.of-seg-d {
  font-size: 12px;
  color: var(--muted);
  display: block;
}

/* 单人寄件输入 */
.of-lb {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.of-lb em {
  color: var(--danger);
  font-style: normal;
}
.of-lb input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.of-lb input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.of-lb input::placeholder {
  color: #94a3b8;
}

/* ===== 服务类型 chips ===== */
.of-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.of-chip {
  height: 34px;
  padding: 0 16px;
  border: 1px solid #dbe2ea;
  background: #fcfdfe;
  border-radius: 17px;
  color: #475569;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.of-chip:hover {
  border-color: #93c5fd;
  color: var(--primary);
}
.of-chip.is-on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* ===== 提交区 ===== */
.of-foot {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.of-foot .err-msg {
  margin-bottom: 10px;
  min-height: 18px;
}
.of-submit {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  font-family: inherit;
  letter-spacing: 0.02em;
}
.of-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.of-submit:active:not(:disabled) {
  transform: translateY(0);
}
.of-submit:disabled,
.of-submit.is-loading {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

/* ===== 响应式 ===== */
@media (max-width: 760px) {
  .of-wrap {
    padding: 16px 12px 40px;
  }
  .of-head h2 {
    font-size: 19px;
  }
  .of-g2 {
    grid-template-columns: 1fr;
  }
  .of-segs {
    grid-template-columns: 1fr;
  }
  .of-row {
    grid-template-columns: 1fr 1fr;
    padding-left: 14px;
  }
  .of-row-no {
    display: none;
  }
  .of-ri-qty {
    max-width: none;
    grid-column: 1 / 2;
  }
  .of-del {
    grid-column: 2 / 3;
    justify-self: end;
  }
  .of-row.of-ship {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==== 强制关联的规格下拉：未选产品时禁用 ==== */
.of-ri select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border-style: dashed;
}
.of-ri select:disabled:hover { border-color: #dbe3ec; }
