/* ZXERP_V2 S1 极简骨架样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", system-ui, sans-serif; background: #f4f6f8; color: #222; }
.v2 { color: #e67e22; font-size: .7em; vertical-align: super; }

.login-bg { display: flex; align-items: center; justify-content: center; min-height: 100vh;
            background: linear-gradient(135deg, #22303f 0%, #37536e 100%); }
.login-card { background: #fff; border-radius: 12px; padding: 36px 40px; width: 340px; margin-top: 60px;
              box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.login-card h1 { font-size: 26px; margin-bottom: 4px; }
.login-card .sub { color: #888; font-size: 12px; margin-bottom: 22px; }
.login-card label { display: block; font-size: 13px; color: #555; margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
.login-card button { width: 100%; margin-top: 20px; padding: 11px; border: 0; border-radius: 6px;
                     background: #e67e22; color: #fff; font-size: 15px; cursor: pointer; }
.login-card button:hover { background: #d35400; }
.err { background: #fdecea; color: #c0392b; border: 1px solid #f5b7b1; border-radius: 6px;
       padding: 8px; font-size: 13px; margin-bottom: 8px; }

header { display: flex; justify-content: space-between; align-items: center;
         background: #22303f; color: #fff; padding: 12px 24px; }
header .brand { font-size: 18px; font-weight: bold; }
header .user { font-size: 13px; }
header .ghost { background: transparent; border: 1px solid #888; color: #ddd; border-radius: 5px;
                padding: 4px 12px; margin-left: 12px; cursor: pointer; }
main { max-width: 720px; margin: 32px auto; background: #fff; border-radius: 10px; padding: 28px;
       box-shadow: 0 2px 10px rgba(0,0,0,.06); }
main h2 { font-size: 18px; margin-bottom: 16px; }
.cards { width: 100%; border-collapse: collapse; }
.cards td { padding: 10px 8px; border-bottom: 1px solid #eef1f4; font-size: 14px; }
.cards a { color: #2980b9; text-decoration: none; font-family: Consolas, monospace; font-size: 13px; }
.tip { color: #999; font-size: 12px; margin-top: 18px; }

/* ===== S2 业务列表页（物料/订单） ===== */
main.wide { max-width: 1280px; }
.nav { display: flex; gap: 10px; margin-bottom: 14px; }
.nav a { color: #2980b9; text-decoration: none; font-size: 14px; padding: 6px 12px;
         border: 1px solid #d5dde5; border-radius: 6px; background: #fff; }
.nav a.on { background: #e67e22; color: #fff; border-color: #e67e22; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { padding: 7px 9px; border: 1px solid #ccd5dd; border-radius: 6px;
                                  font-size: 13px; background: #fff; }
.toolbar input.q { width: 220px; }
.toolbar button { padding: 7px 16px; border: 0; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-main { background: #e67e22; color: #fff; }
.btn-main:hover { background: #d35400; }
.btn-ghost { background: #fff; color: #444; border: 1px solid #ccd5dd !important; }
.btn-ghost:hover { background: #f0f4f8; }
.btn-danger { background: #c0392b; color: #fff; }

table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { background: #f0f4f8; color: #4a5a6a; text-align: left; padding: 8px 8px;
                border-bottom: 2px solid #d9e1e8; white-space: nowrap; }
table.list td { padding: 7px 8px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
table.list tr:hover td { background: #fafcfe; }
table.list td.num { text-align: right; font-variant-numeric: tabular-nums; }
.owe0 { color: #27ae60; font-weight: bold; }
.oweN { color: #c0392b; font-weight: bold; }
.muted { color: #98a3ad; font-size: 12px; }
.nowrap { white-space: nowrap; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: #555; }
.pager button { padding: 5px 14px; }

/* 模态框（不用 alert/confirm/prompt —— 内嵌浏览器不可靠） */
.mask { position: fixed; inset: 0; background: rgba(20,30,40,.45); display: flex;
        align-items: flex-start; justify-content: center; z-index: 50; overflow: auto; padding: 40px 0; }
/* P1 修复(2026-08-18): .mask 的 display:flex 特异性盖过 [hidden]{display:none}, 致遮罩常驻拦截点击. 加更高优先级规则 */
.mask[hidden] { display: none !important; }
.modal { background: #fff; border-radius: 10px; padding: 22px 24px; width: min(860px, 94vw);
         box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; }
.modal .grid label { display: block; font-size: 12px; color: #667; }
.modal .grid input, .modal .grid select, .modal .grid textarea {
    width: 100%; padding: 7px 8px; border: 1px solid #ccd5dd; border-radius: 6px; font-size: 13px; }
.modal .grid .full { grid-column: 1 / -1; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal .err { background: #fdecea; color: #c0392b; border: 1px solid #f5b7b1; border-radius: 6px;
              padding: 7px 10px; font-size: 13px; margin-bottom: 10px; }
.req::after { content: " *"; color: #c0392b; }

/* 明细展开区 */
.detail-box { background: #f8fafc; border: 1px solid #e3e9ef; border-radius: 8px;
              padding: 12px; margin: 6px 0 14px; }
.detail-box h4 { font-size: 13px; color: #4a5a6a; margin-bottom: 8px; }
.changes { margin-top: 10px; font-size: 12px; color: #678; }
.changes li { margin: 3px 0 3px 16px; }

/* 物料选择器 */
.pick-wrap { position: relative; }
.pick-list { position: absolute; top: 34px; left: 0; z-index: 20; background: #fff;
             border: 1px solid #ccd5dd; border-radius: 6px; box-shadow: 0 8px 22px rgba(0,0,0,.18);
             max-height: 240px; overflow: auto; width: 480px; font-size: 12px; }
.pick-list div { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid #f0f4f8; }
.pick-list div:hover { background: #fdf3ea; }

.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 99;
         background: #22303f; color: #fff; padding: 9px 20px; border-radius: 6px; font-size: 13px; }
.toast.ok { background: #1e8449; }
.toast.bad { background: #c0392b; }

/* 订单生命周期可视化 */
.lc-summary { min-width: 360px; }
.lc-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.lc-done { color: #1e8449; background: #eaf7ef; }
.lc-doing { color: #1f6feb; background: #eaf2ff; }
.lc-pending { color: #b56a00; background: #fff4df; }
.lc-unknown { color: #6b7280; background: #f1f3f5; }
.lc-na { color: #8a94a0; background: #f5f6f7; }
.lc-blocked, .lc-cancelled { color: #c0392b; background: #fdecea; }
.lc-strip { display: flex; align-items: center; gap: 2px; margin-top: 5px; overflow-x: auto; padding-bottom: 2px; }
.lc-node { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px; border-radius: 5px; font-size: 11px; white-space: nowrap; }
.lc-node .lc-ic { font-size: 12px; }
.lc-node .lc-name { font-weight: 700; }
.lc-node .lc-label { color: #667; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.lc-arrow { color: #aab3bd; font-size: 12px; }
.lc-qty { margin-top: 4px; color: #5b6775; font-size: 11px; white-space: nowrap; }
.lc-cell { cursor: pointer; max-width: 520px; }
.lc-cell:hover { background: #fff8ef; }
.lc-detail { min-width: 720px; }
.lc-detail .lc-strip { margin: 10px 0 14px; }
.lc-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.lc-link { padding: 3px 8px; border: 1px solid #d7e0e8; border-radius: 5px; color: #245b86; text-decoration: none; font-size: 12px; }
.lc-link:hover { background: #eef6fc; }
.lc-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 12px 0; }
.lc-cards > div { background: #f8fafc; border: 1px solid #e3e9ef; border-radius: 7px; padding: 8px; }
.lc-cards span { display: block; color: #6b7280; font-size: 11px; }
.lc-cards b { display: block; margin-top: 3px; font-size: 15px; }
.lc-warn { margin-top: 12px; padding: 9px 12px; border: 1px solid #f3d19c; background: #fffaf0; border-radius: 7px; color: #8a5a00; font-size: 12px; }
.lc-warn ul { margin: 5px 0 0 18px; }
@media (max-width: 900px) { .lc-cards { grid-template-columns: repeat(3, 1fr); } .lc-summary { min-width: 300px; } }

/* 生产进度受控关键字下拉（跨浏览器可见，不依赖原生 datalist） */
.progress-picker { position: relative; display: inline-block; width: 270px; vertical-align: middle; }
.progress-picker-input { width: 100%; padding-right: 32px !important; }
.progress-picker-toggle { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 28px; border: 0;
  border-left: 1px solid #d7e0e8; background: transparent; color: #5b6775; cursor: pointer; border-radius: 0 5px 5px 0; }
.progress-picker-toggle:hover { background: #eef4fa; }
.progress-picker-panel { position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 40;
  max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid #93c5fd; border-radius: 7px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .22); padding: 4px; }
.progress-picker-panel[hidden] { display: none !important; }
.progress-picker-option { display: block; width: 100%; border: 0; background: #fff; text-align: left;
  padding: 8px 10px; border-radius: 4px; color: #1f2937; font: 14px/1.35 "Microsoft YaHei", sans-serif; cursor: pointer; }
.progress-picker-option:hover, .progress-picker-option.is-active { background: #eaf2ff; color: #1f6feb; }
.progress-picker-empty { padding: 9px 10px; color: #6b7280; font-size: 13px; }
