/*!
 * 织造司 SCM · 企划开发（研发）界面重设计皮肤
 * 纯 CSS 覆盖，不改 React 结构；配合 scm-plan-ui.js 生成右侧概览栏
 * 设计口径：浅灰底 + 白卡片、12px 圆角、统一 13/14px 字阶、主色 #1677ff
 */
:root {
  --zz-bg: #f4f6f9;
  --zz-card: #fff;
  --zz-line: #eceff4;
  --zz-line-strong: #e3e8ef;
  --zz-text: #1f2733;
  --zz-text-2: #667085;
  --zz-text-3: #98a2b3;
  --zz-accent: #1677ff;
  --zz-accent-soft: #eef4ff;
  --zz-danger: #cf1322;
  --zz-radius: 12px;
  --zz-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
}

/* ---------- 页面底板 ---------- */
body.zzui-plan .kou-content { background: var(--zz-bg); }
body.zzui-plan .ant-pro-page-container,
body.zzui-plan .ant-pro-grid-content,
body.zzui-plan .ant-pro-grid-content-children { background: transparent; }
body.zzui-plan .ant-pro-page-container-children-container {
  padding: 0 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- 顶部标题栏（吸顶） ---------- */
body.zzui-plan .ant-page-header.ant-pro-page-container-warp-page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--zz-line);
  padding: 10px 20px !important;
  margin: 0 -20px;
}
body.zzui-plan .ant-page-header-heading { align-items: center; }
body.zzui-plan .ant-page-header-heading-title {
  font-size: 16px !important;
  font-weight: 600;
  color: var(--zz-text);
  letter-spacing: .2px;
}
body.zzui-plan .ant-page-header-back { margin-right: 12px; }
body.zzui-plan .ant-page-header-heading-left { gap: 8px; }
body.zzui-plan .ant-page-header-heading-extra .ant-btn { height: 30px; border-radius: 8px; font-size: 13px; }

/* ---------- 流程卡（步骤条 + 主操作） ---------- */
body.zzui-plan .ant-pro-page-container-children-container > .ant-card {
  border-radius: var(--zz-radius);
  border: 1px solid var(--zz-line);
  box-shadow: var(--zz-shadow);
  background: var(--zz-card);
}
body.zzui-plan .ant-pro-page-container-children-container > .ant-card:has(.ant-steps) {
  position: sticky;
  top: 52px;
  z-index: 15;
}
body.zzui-plan .ant-pro-page-container-children-container > .ant-card .ant-card-body { padding: 14px 18px; }

/* 步骤条：紧凑、当前节点高亮 */
body.zzui-plan .ant-steps-small .ant-steps-item-title { font-size: 12.5px !important; line-height: 22px; }
body.zzui-plan .ant-steps-item-wait .ant-steps-item-title { color: var(--zz-text-3) !important; }
body.zzui-plan .ant-steps-item-process .ant-steps-item-title { color: var(--zz-text) !important; font-weight: 600; }
body.zzui-plan .ant-steps-item-finish .ant-steps-item-title { color: var(--zz-text-2) !important; }
body.zzui-plan .ant-steps-item-icon { width: 22px !important; height: 22px !important; line-height: 20px !important; font-size: 12px !important; }
body.zzui-plan .ant-steps-item-process .ant-steps-item-icon { background: var(--zz-accent); border-color: var(--zz-accent); }
body.zzui-plan .ant-steps-item-process .ant-steps-item-icon .ant-steps-icon { color: #fff; }
body.zzui-plan .ant-steps-small .ant-steps-item-tail { margin-inline-start: 26px !important; }
body.zzui-plan .ant-steps-item-title[style*="cursor"]:hover { color: var(--zz-accent) !important; }

/* 主操作按钮 */
body.zzui-plan .ant-btn-primary {
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(22, 119, 255, .18);
  font-weight: 500;
}
body.zzui-plan .ant-btn { border-radius: 9px; }
body.zzui-plan .ant-btn-default { border-color: var(--zz-line-strong); }

/* ---------- 表单区：主列 + 右侧概览 ---------- */
body.zzui-plan #plan-form-area .ant-tabs-nav { display: none !important; }
body.zzui-plan #plan-form-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 16px;
  align-items: start;
}
body.zzui-plan #plan-form-area > .ant-tabs { grid-column: 1; min-width: 0; }
body.zzui-plan #plan-form-area .ant-tabs-content-holder,
body.zzui-plan #plan-form-area .ant-tabs-content { display: block; }
body.zzui-plan #plan-form-area .ant-tabs-tabpane:not(.ant-tabs-tabpane-active) { display: none !important; }

/* 表单卡 */
body.zzui-plan #plan-form-area .ant-tabs-tabpane > div {
  background: var(--zz-card);
  border: 1px solid var(--zz-line);
  border-radius: var(--zz-radius);
  box-shadow: var(--zz-shadow);
  padding: 18px 20px 6px;
}
body.zzui-plan #plan-form-area .ant-alert { border-radius: 10px; }

/* 表单两列排布 */
body.zzui-plan #plan-form-area form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
  row-gap: 2px;
  max-width: 100% !important;
}
body.zzui-plan #plan-form-area form > * { grid-column: 1 / -1; }
body.zzui-plan #plan-form-area form > .ant-form-item { grid-column: span 1; }
body.zzui-plan #plan-form-area form > .ant-form-item:has(textarea),
body.zzui-plan #plan-form-area form > .ant-form-item:has(.ant-upload),
body.zzui-plan #plan-form-area form > .ant-form-item:has(.ant-select-multiple),
body.zzui-plan #plan-form-area form > .ant-form-item:has(.ant-picker-range),
body.zzui-plan #plan-form-area form > .ant-form-item:has(.ant-space),
body.zzui-plan #plan-form-area form > .ant-form-item:has(button) { grid-column: 1 / -1; }
body.zzui-plan #plan-form-area form > *[style*="width:100%"] { grid-column: 1 / -1; }

/* 表单项细节 */
body.zzui-plan #plan-form-area .ant-form-item { margin-bottom: 14px; }
body.zzui-plan #plan-form-area .ant-form-item-label { padding-bottom: 4px !important; }
body.zzui-plan #plan-form-area .ant-form-item-label > label {
  font-size: 13px;
  font-weight: 500;
  color: var(--zz-text-2);
  height: auto;
}
body.zzui-plan #plan-form-area .ant-form-item-label > label.ant-form-item-required::before { color: #f5222d; }
body.zzui-plan #plan-form-area .ant-input,
body.zzui-plan #plan-form-area .ant-input-affix-wrapper,
body.zzui-plan #plan-form-area .ant-select-selector,
body.zzui-plan #plan-form-area .ant-picker {
  border-radius: 9px !important;
  border-color: var(--zz-line-strong) !important;
  font-size: 13px;
}
body.zzui-plan #plan-form-area .ant-input,
body.zzui-plan #plan-form-area .ant-select-single,
body.zzui-plan #plan-form-area .ant-select-single .ant-select-selector { min-height: 34px; }
body.zzui-plan #plan-form-area .ant-input:hover,
body.zzui-plan #plan-form-area .ant-select:hover .ant-select-selector { border-color: #b9c6d6 !important; }
body.zzui-plan #plan-form-area .ant-input:focus,
body.zzui-plan #plan-form-area .ant-select-focused .ant-select-selector {
  border-color: var(--zz-accent) !important;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .1) !important;
}
body.zzui-plan #plan-form-area textarea.ant-input { padding: 8px 10px; line-height: 1.65; }

/* 上传区 */
body.zzui-plan #plan-form-area .ant-upload-wrapper .ant-upload-drag,
body.zzui-plan #plan-form-area .ant-upload-list-item-container { border-radius: 10px; }
body.zzui-plan #plan-form-area .zzpi { border-radius: 12px; }

/* 表单底部操作行 */
body.zzui-plan #plan-form-area .ant-space { row-gap: 8px !important; }
body.zzui-plan #plan-form-area .ant-btn { height: 32px; font-size: 13px; }
body.zzui-plan #plan-form-area .ant-btn-primary { height: 34px; }

/* ---------- 右侧概览栏 ---------- */
.zzui-side { grid-column: 2; position: sticky; top: 128px; display: flex; flex-direction: column; gap: 12px; }
.zzui-side-card {
  background: var(--zz-card);
  border: 1px solid var(--zz-line);
  border-radius: var(--zz-radius);
  box-shadow: var(--zz-shadow);
  padding: 14px 16px;
}
.zzui-side-h { font-size: 13px; font-weight: 600; color: var(--zz-text); display: flex; align-items: center; justify-content: space-between; }
.zzui-side-h .zzui-side-more { font-size: 12px; font-weight: 400; color: var(--zz-text-3); }
.zzui-node { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.zzui-node b { font-size: 18px; font-weight: 600; color: var(--zz-accent); letter-spacing: .3px; }
.zzui-node span { font-size: 12px; color: var(--zz-text-3); }
.zzui-bar { height: 6px; border-radius: 4px; background: #eef1f6; margin-top: 10px; overflow: hidden; }
.zzui-bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4d9bff, #1677ff); }
.zzui-kv { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.zzui-kv > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; line-height: 1.5; }
.zzui-kv > div > span:first-child { color: var(--zz-text-3); flex: none; }
.zzui-kv > div > span:last-child { color: var(--zz-text); text-align: right; word-break: break-all; }
.zzui-flow { margin-top: 10px; display: flex; flex-direction: column; gap: 9px; }
.zzui-flow > div { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.zzui-flow i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #c8d3e0; margin-top: 6px; }
.zzui-flow .zzui-flow-t { color: var(--zz-text); }
.zzui-flow .zzui-flow-d { color: var(--zz-text-3); font-size: 11.5px; }
/* 打回原因：跟在流转条目后面 */
.zzui-flow .zzui-flow-why { color: #cf1322; font-size: 11.5px; line-height: 1.6; margin-top: 1px; word-break: break-word; }
.zzui-empty { font-size: 12.5px; color: var(--zz-text-3); margin-top: 8px; }

/* 窄屏退回单列 */
@media (max-width: 1180px) {
  body.zzui-plan #plan-form-area { grid-template-columns: minmax(0, 1fr); }
  .zzui-side { position: static; grid-column: 1; flex-direction: row; flex-wrap: wrap; }
  .zzui-side-card { flex: 1 1 260px; }
}

/* ---------- 企划列表页 ---------- */
body.zzui-planlist .kou-content { background: var(--zz-bg); }
body.zzui-planlist .ant-pro-page-container-children-container { padding: 0 20px 24px; }
body.zzui-planlist .ant-card {
  border-radius: var(--zz-radius);
  border: 1px solid var(--zz-line);
  box-shadow: var(--zz-shadow);
}
body.zzui-planlist .ant-table-thead > tr > th {
  background: #fafbfd;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--zz-text-2);
  border-bottom: 1px solid var(--zz-line);
}
body.zzui-planlist .ant-table-tbody > tr > td { font-size: 13px; }
body.zzui-planlist .ant-table-tbody > tr:hover > td { background: #f7faff !important; }
body.zzui-planlist .ant-btn { border-radius: 9px; }
body.zzui-planlist .ant-segmented { border-radius: 10px; background: #eef1f6; }
body.zzui-planlist .ant-segmented-item-selected { box-shadow: 0 1px 3px rgba(16, 24, 40, .08); }

/* 审核/意见面板与新皮肤对齐 */
.zzpr-wrap { margin: 0; }
.zzpr-left, .zzpr-card, .zzpr-acts { border-radius: var(--zz-radius) !important; }
.zzpr-right { top: 128px !important; }

/* ---------- 企划列表页（母页面）：结构化选择器版本 ----------
   说明：不依赖注入类名（React 重渲染会清掉类导致闪烁/失效），
   全部按容器位置匹配；body.zzui-cardview 由脚本按原生视图切换器同步 */

/* 工具栏（第一个子块） */
body.zzui-planlist .ant-pro-page-container-children-container > div:first-child {
  background: var(--zz-card);
  border: 1px solid var(--zz-line);
  border-radius: var(--zz-radius);
  box-shadow: var(--zz-shadow);
  padding: 12px 14px;
}
body.zzui-planlist .ant-pro-page-container-children-container > div:first-child .ant-btn,
body.zzui-planlist .ant-pro-page-container-children-container > div:first-child .ant-select-selector { border-radius: 9px; }

/* 原生批量操作条：仅当我方悬浮批量条挂载时才隐藏（body.zzui-hasbatch 由 scm-plan-ui.js 切换）。
   条件式而非无条件：避免误伤同容器内的其它危险按钮，也避免我方组件未挂载时把原生条一起藏掉。 */
body.zzui-planlist.zzui-hasbatch .ant-pro-page-container-children-container > div:not(:first-child):has(.ant-btn-dangerous) { display: none !important; }

/* 我的悬浮批量条（由勾选状态驱动） */
#zzui-my-batch {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: 12px;
  background: rgba(28, 34, 47, .96); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .38);
  padding: 10px 18px;
  animation: zzuiBarIn .18s ease-out;
}
@keyframes zzuiBarIn { from { transform: translateX(-50%) translateY(14px); opacity: 0 } to { transform: translateX(-50%) translateY(0); opacity: 1 } }
#zzui-my-batch .zzui-count { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
#zzui-my-batch .zzui-count b { color: #69b1ff; }
#zzui-my-batch button {
  height: 30px; padding: 0 14px; border-radius: 9px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 13px; font-family: inherit;
  transition: background .15s;
}
#zzui-my-batch button:hover { background: rgba(255, 255, 255, .24); }
#zzui-my-batch button.zzui-danger { background: rgba(255, 77, 79, .92); }
#zzui-my-batch button.zzui-danger:hover { background: rgba(255, 77, 79, 1); }
#zzui-my-batch button.zzui-ghost { background: transparent; color: #b8c2d0; }

/* 企划提交 / 设计草图：原生表单**仅在我方接管层真正挂载时**才隐藏（:has 条件式）。
   之前的无条件写法会在脚本未挂载（无权限/阶段不匹配/接口失败）时把面板清空，是「空白或叠加」的根源。 */
body.zzui-plan #plan-form-area [id$="-panel-basic"]:has(> .zzps-wrap) > *:not(.zzps-wrap) { display: none !important; }
body.zzui-plan #plan-form-area [id$="-panel-design"]:has(> .zzpd-wrap) > *:not(.zzpd-wrap) { display: none !important; }

/* ---------- 新建企划：模式选择弹窗 ---------- */
.zzmp-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);backdrop-filter:blur(3px);z-index:3000;display:flex;align-items:center;justify-content:center;animation:zzmpFade .15s ease-out}
@keyframes zzmpFade{from{opacity:0}to{opacity:1}}
.zzmp{width:600px;max-width:92vw;background:#fff;border-radius:16px;box-shadow:0 24px 64px rgba(15,23,42,.28);overflow:hidden;animation:zzmpIn .2s cubic-bezier(.2,.8,.3,1)}
@keyframes zzmpIn{from{transform:translateY(14px) scale(.97);opacity:0}to{transform:none;opacity:1}}
.zzmp-h{padding:20px 24px 0}
.zzmp-title{font-size:16.5px;font-weight:600;color:#1f2733}
.zzmp-title em{font-style:normal;color:#1677ff}
.zzmp-sub{font-size:12.5px;color:#98a2b3;margin-top:5px;line-height:1.6}
.zzmp-body{padding:16px 24px 6px;display:flex;flex-direction:column;gap:12px}
.zzmp-card{display:flex;align-items:center;gap:14px;border:1.5px solid #e6eaf1;border-radius:13px;padding:14px 16px;cursor:pointer;transition:all .16s;position:relative;background:#fff;text-align:left;width:100%;font-family:inherit}
.zzmp-card:hover{border-color:#8ab4ff;background:#f7faff;transform:translateY(-1px);box-shadow:0 8px 20px rgba(22,119,255,.12)}
.zzmp-card.sel{border-color:#1677ff;background:#f0f6ff;box-shadow:0 0 0 3px rgba(22,119,255,.12)}
.zzmp-ico{width:46px;height:46px;border-radius:13px;display:flex;align-items:center;justify-content:center;font-size:22px;flex:none}
.zzmp-name{font-size:14.5px;font-weight:600;color:#1f2733}
.zzmp-desc{font-size:12.5px;color:#98a2b3;margin-top:3px;line-height:1.5}
.zzmp-check{position:absolute;right:16px;top:50%;transform:translateY(-50%) scale(.6);width:20px;height:20px;border-radius:50%;border:2px solid #d5dce6;display:flex;align-items:center;justify-content:center;color:#fff;font-size:12px;opacity:.4;transition:all .16s}
.zzmp-card.sel .zzmp-check{background:#1677ff;border-color:#1677ff;opacity:1;transform:translateY(-50%) scale(1)}
.zzmp-f{display:flex;align-items:center;justify-content:space-between;padding:16px 24px 20px}
.zzmp-note{font-size:12px;color:#b0b7c3}
.zzmp-btns{display:flex;gap:10px}
.zzmp-btn{height:34px;padding:0 18px;border-radius:9px;border:1px solid #e3e8ef;background:#fff;cursor:pointer;font-size:13.5px;color:#1f2733;font-family:inherit}
.zzmp-btn:hover{border-color:#1677ff;color:#1677ff}
.zzmp-btn.primary{background:#1677ff;border-color:#1677ff;color:#fff;font-weight:500}
.zzmp-btn.primary:hover{background:#4096ff}
.zzmp-btn:disabled{opacity:.55;cursor:not-allowed}

/* 企划波段联想下拉 */
.zzps-item { position: relative; }
.zzps-dd { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; box-shadow: 0 10px 28px rgba(16,24,40,.14); max-height: 240px; overflow: auto; padding: 4px; }
.zzps-dd.open { display: block; }
.zzps-dd-opt { padding: 8px 10px; font-size: 13px; color: #1f2733; cursor: pointer; border-radius: 7px; line-height: 1.5; }
.zzps-dd-opt:hover { background: #f0f6ff; color: #1677ff; }
.zzps-dd-create { color: #1677ff; font-weight: 500; border-top: 1px dashed #eef0f4; border-radius: 0 0 7px 7px; margin-top: 2px; }
.zzps-dd-empty { padding: 10px; font-size: 12.5px; color: #b0b7c3; }
.zzps-dd-path { display: block; margin-top: 1px; font-size: 11.5px; color: #a8b0bd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== v300：紧凑表单（新增/编辑全幅弹窗通用）=====
 * 用法：Form 加 className="zz-form-compact"，Form.Item 加 zz-col-* 控制栅格。
 * 横向标签（label 在左）+ 小行距，长表单一屏放下。
 */
.zz-form-compact .ant-form-item {
  margin-bottom: 8px;
}
.zz-form-compact .ant-form-item .ant-form-item-label > label {
  font-size: 13px;
  color: #606266;
  height: 24px;
}
.zz-form-compact .ant-divider-horizontal {
  margin: 8px 0;
}
.zz-form-compact .ant-divider-inner-text {
  font-size: 14px;
  color: #1677ff;
  font-weight: 600;
}
/* v553：横向布局 + 固定标签列时，长标签必须换行。
 * antd Form 的 labelWrap 默认为 false，标签不换行会直接压到输入框上（用户反馈「文字和文本框叠加」）。 */
.zz-form-compact .ant-form-item-label > label {
  white-space: normal;
  height: auto;
  min-height: 24px;
  line-height: 18px;
  padding-top: 3px;
  word-break: break-word;
}
.zz-form-compact .ant-form-item-label {
  padding-right: 8px;
}

/* ===== 商品资料新增：四列紧凑布局（对齐原站输入框宽度与密度）===== */
.goods-create .ant-col-6 { flex: 0 0 25%; max-width: 25%; }
.goods-create .ant-form-item-label { flex: 0 0 84px !important; max-width: 84px !important; }
.goods-create .ant-form-item-label > label { justify-content: flex-end; color: #606266; }
.goods-create .ant-form-item-control-input { max-width: 216px; }
/* 文本域、备注等长字段保持全宽 */
.goods-create .ant-form-item-control-input:has(textarea) { max-width: none; }
.goods-create .goods-wide .ant-form-item-control-input { max-width: none; }
.goods-create .ant-form-item-label > label { white-space: nowrap !important; }
