@charset "UTF-8";
/* AI 护栏（Tim 10-13 定稿，设计稿 qa/audit/ai-guard-plan-1012.html）的界面：
   右上角「AI 动态」、登记增减的方向选择、采购单详情的账本记录与截图、领料缺料清单。
   颜色、圆角、字号按 docs/design/WORKBENCH-STYLE.md：钢蓝强调、墨黑选中、状态色浅底深字。 */

/* ── 右上角「AI 动态」 ── */
.ai-feed{position:relative;flex:none;margin-left:auto}
.ai-feed[hidden]{display:none}
.ai-feed-button{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 10px;border:1px solid #dde0e5;border-radius:8px;background:#fff;color:#14181d;font-size:13px;font-weight:500;white-space:nowrap}
.ai-feed-button:hover{background:#f7f9fb}
.ai-feed-button[aria-expanded=true]{border-color:#14181d}
.ai-feed-count{min-width:18px;height:18px;padding:0 6px;border-radius:999px;background:#b23a2b;color:#fff;font-size:12px;font-weight:500;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}
.ai-feed-count[hidden]{display:none}
.ai-feed-panel{position:absolute;top:calc(100% + 10px);right:0;z-index:80;width:min(460px,calc(100vw - 32px));max-height:min(72vh,680px);overflow:auto;overscroll-behavior:contain;background:#fff;border:1px solid #ebedf0;border-radius:10px;box-shadow:0 8px 24px rgba(20,24,29,.10);color:#14181d;font-size:14px;line-height:1.5;text-align:left}
.ai-feed-panel[hidden]{display:none}
.ai-feed-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 8px 10px 16px;background:#fff;border-bottom:1px solid #ebedf0}
.ai-feed-tabs{display:flex;flex-wrap:wrap;gap:6px}
.ai-feed-tabs button{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 12px;border-radius:8px;background:#f3f5f7;color:#4a5159;font-size:13px}
.ai-feed-tabs button[aria-pressed=true]{background:#14181d;color:#fff}
.ai-feed-tabs button span{font-variant-numeric:tabular-nums}
.ai-feed-close{flex:none;width:32px;height:32px;font-size:20px;line-height:1;border-radius:6px;color:#98a0aa}
.ai-feed-close:hover{background:#f3f5f7;color:#14181d}
.ai-feed-note{margin:0;padding:10px 16px;border-bottom:1px solid #ebedf0;background:#eaf2ec;color:#2f6b46;font-size:13px;overflow-wrap:anywhere}
.ai-feed-note.is-error{background:#fbf1ef;color:#b23a2b}
.ai-feed-note[hidden]{display:none}
.ai-feed-sub{margin:0;padding:12px 16px 6px;border-bottom:1px solid #ebedf0;background:#fafafa;color:#6b747f;font-size:13px;font-weight:600}
.ai-feed-empty{margin:0;padding:20px 16px;color:#5b636d;font-size:13px}
.ai-row{display:grid;gap:4px;padding:12px 16px;border-bottom:1px solid #ebedf0}
.ai-row:last-child{border-bottom:0}
.ai-row p{margin:0}
.ai-row.is-new{background:#f7f9fb}
.ai-row-l1{color:#6b747f;font-size:13px}
.ai-row-l1 b{color:#14181d;font-weight:600}
.ai-row-time{font-variant-numeric:tabular-nums}
.ai-row-l2{color:#5b636d;font-size:13px;overflow-wrap:anywhere}
.ai-row-outcome{color:#6b747f}
.ai-row-acts{display:flex;justify-content:flex-end;gap:18px;margin-top:2px}
.ai-act{min-height:32px;padding:0 2px;background:none;color:#3d6e8c;font-size:14px;font-weight:500}
.ai-act:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}
.ai-act.is-danger{color:#b23a2b}
.ai-tag{display:inline-block;margin-left:4px;padding:1px 8px;border-radius:6px;background:#eef0f3;color:#5b636d;font-size:12px;font-weight:400;vertical-align:1px;white-space:nowrap}
.ai-tag.is-ok{background:#eaf2ec;color:#2f6b46}
.ai-tag.is-bad{background:#fbf1ef;color:#b23a2b}
.ai-tag.is-run{background:#eff5f9;color:#3d6e8c}
.ai-new-dot{display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:50%;background:#3d6e8c;vertical-align:1px}
.ai-mono,.po-mono{font-family:"Cascadia Mono",Consolas,monospace;font-size:12px}

/* ── 登记增减：先选方向。外购件「增加」划掉不可选 ── */
.adjust-seg{display:flex;flex-wrap:wrap;gap:6px;margin:18px 0 0;padding:0;border:0;min-width:0}
.adjust-seg legend{float:left;width:100%;margin:0 0 8px;padding:0;font-size:13px;font-weight:600}
#editor .adjust-seg .adjust-seg-option{position:relative;display:inline-flex;margin:0;font-weight:400}
.adjust-seg-option input{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer}
.adjust-seg-option span{display:inline-flex;align-items:center;min-height:38px;padding:0 18px;border-radius:8px;background:#f3f5f7;color:#4a5159;font-size:14px}
.adjust-seg-option input:checked+span{background:#14181d;color:#fff}
.adjust-seg-option input:focus-visible+span{outline:3px solid #d98225;outline-offset:3px}
.adjust-seg-option.is-off span{color:#98a0aa;text-decoration:line-through}
.adjust-seg-option.is-off input{cursor:not-allowed}
.adjust-hint{margin:10px 0 0;padding:8px 10px;border:1px solid #ebedf0;border-radius:8px;color:#5b636d;font-size:13px;line-height:1.6}

/* ── 领料缺料：后端原话逐条列出，不截断 ── */
#issue-shortage:empty{display:none}
.issue-shortage{margin:16px 0 0}
.issue-shortage ul{margin:4px 0}
.issue-shortage li{overflow-wrap:anywhere}
.issue-shortage p{margin:6px 0 0}

/* ── 采购单详情：账本记录、手动附的截图、手机上传链接 ── */
.po-extras{display:grid;gap:18px;margin-top:22px}
.po-extras:empty{display:none}
.po-extra{padding-top:14px;border-top:1px solid #ebedf0}
.po-extra-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 12px;margin-bottom:8px}
.po-extra-head h3{margin:0;color:#14181d;font-size:16px;font-weight:600}
.po-extra-head .po-head-act{margin-left:auto;border:0;font-size:14px}
.po-extra-head .po-head-act+.po-head-act{margin-left:0}
.po-muted{margin:4px 0;color:#6b747f;font-size:13px}
.po-ledger-item{display:grid;gap:8px;margin-bottom:8px;padding:10px 12px;border:1px solid #ebedf0;border-radius:8px}
.po-ledger-line{margin:0;color:#5b636d;font-size:14px;overflow-wrap:anywhere}
.po-ledger-line b{color:#14181d;font-weight:600}
.po-ledger-acts{display:flex;justify-content:flex-end}
.po-danger{padding:0;background:none;color:#b23a2b;font-size:13px}
.po-danger:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}
.po-shots{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start}
.po-shot{display:grid;place-items:center;box-sizing:border-box;width:72px;height:96px;padding:0;overflow:hidden;border:1px solid #dde0e5;border-radius:8px;background:#f3f5f7;color:#98a0aa;font-size:11px;line-height:1.4;text-align:center;text-decoration:none}
.po-shot img{display:block;width:100%;height:100%;object-fit:cover}
.po-shot.is-note{padding:6px}
#editor .po-shots .po-shot.is-add{margin:0;border-style:dashed;background:#fff;color:#3d6e8c;font-size:13px;font-weight:400;cursor:pointer}
.po-shot.is-add:hover{background:#f7f9fb}
.po-file{position:absolute;width:1px;height:1px;margin:0;padding:0;overflow:hidden;opacity:0;border:0}
.po-file:focus-visible+.po-shot{outline:3px solid #d98225;outline-offset:3px}
.po-attachment{display:grid;justify-items:center;gap:4px;margin:0}
.po-attachment figcaption{display:flex;align-items:center;gap:6px;color:#6b747f;font-size:11px}
.po-attachment .po-danger{font-size:11px}
.po-suggest{display:grid;gap:8px;margin-top:8px;padding:10px 12px;border:1px solid #ebedf0;border-radius:8px;background:#fafafa}
.po-suggest>.po-muted{margin:0}
.po-suggest-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:8px;border-top:1px solid #ebedf0;font-size:14px;overflow-wrap:anywhere}
.po-suggest-item b{font-weight:600}
.po-suggest-item .secondary{flex:none}
.po-suggest-why{display:block;margin:2px 0 0}
.po-suggest-empty{margin:0;color:#14181d;font-size:14px}
.po-tag{display:inline-block;padding:1px 8px;border-radius:6px;background:#eef0f3;color:#5b636d;font-size:12px;white-space:nowrap}
#editor .po-manual label,#editor .po-link label{margin:0 0 6px;color:#6b747f;font-size:13px;font-weight:400}
.po-manual-row{display:flex;gap:8px}
.po-manual-row input{flex:1;min-width:0}
.po-manual-row .secondary{flex:none}
.po-link{margin-top:12px}
.po-link input{font-family:"Cascadia Mono",Consolas,monospace;font-size:13px}
.po-notice{margin:0;color:#2f6b46;font-size:13px}
.po-error{margin:0;color:#b23a2b;font-size:13px;overflow-wrap:anywhere}
.po-notice[hidden],.po-error[hidden]{display:none}
.po-skeleton{display:block;width:60%;height:14px}
.po-pick-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.po-pick-row .po-ledger-line{flex:1;min-width:0}
.po-pick-row>button{flex:none}
.po-pick-row .secondary{padding:7px 14px}
.po-extra-dialog{margin-top:6px}
.po-extra-dialog .po-extra-head{align-items:center}

/* 采购单列表：有截图的行带一个「截图」小图标 */
.po-shots-chip{display:inline-flex;align-items:center;gap:4px;margin-left:8px;padding:1px 7px;border:1px solid #dde0e5;border-radius:6px;background:#fff;color:#3d6e8c;font-size:12px;line-height:18px;vertical-align:1px}
.po-shots-chip:hover{background:#eff5f9;border-color:#a7c1d9}
.po-shots-chip svg{flex:none}

/* 看图层：大图居中，左右翻，底下一排缩略图 */
.po-viewer{width:min(960px,calc(100vw - 32px));max-width:none;max-height:calc(100vh - 32px);padding:0;border:0;border-radius:14px;background:#fff;color:#14181d}
.po-viewer::backdrop{background:rgba(20,24,29,.72)}
.po-viewer-inner{display:flex;flex-direction:column;max-height:calc(100vh - 32px)}
.po-viewer-head{display:flex;align-items:center;gap:12px;padding:12px 12px 12px 20px;border-bottom:1px solid #ebedf0}
.po-viewer-head h2{margin:0;font-size:16px;font-weight:600}
.po-viewer-count{color:#6b747f;font-size:13px;font-variant-numeric:tabular-nums}
.po-viewer-close{margin-left:auto}
.po-viewer-stage{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-height:240px;padding:16px 56px;background:#fafafa;overflow:hidden}
.po-viewer-body{display:flex;align-items:center;justify-content:center;width:100%}
.po-viewer-body img{display:block;max-width:100%;max-height:calc(100vh - 260px);object-fit:contain;border-radius:6px;background:#fff}
.po-viewer-empty{margin:0;color:#5b636d;font-size:14px}
.po-viewer-loading{width:200px;height:12px}
.po-viewer-nav{position:absolute;top:50%;width:40px;height:40px;margin-top:-20px;border:1px solid #dde0e5;border-radius:999px;background:#fff;color:#14181d;font-size:22px;line-height:1}
.po-viewer-nav:hover{background:#f3f5f7}
.po-viewer-nav[hidden]{display:none}
.po-viewer-nav.is-prev{left:10px}
.po-viewer-nav.is-next{right:10px}
.po-viewer-caption{margin:0;padding:10px 20px 0;color:#5b636d;font-size:13px;overflow-wrap:anywhere}
.po-viewer-strip{display:flex;gap:6px;padding:10px 20px 16px;overflow-x:auto}
.po-viewer-strip:empty{padding-top:0}
.po-viewer-thumb{flex:none;width:48px;height:64px;padding:0;border:1px solid #dde0e5;border-radius:6px;background:#f3f5f7;overflow:hidden;color:#98a0aa;font-size:10px}
.po-viewer-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.po-viewer-thumb.is-on{border-color:#14181d;box-shadow:inset 0 0 0 1px #14181d}

@media (max-width:720px){
  /* 手机上顶栏收起了：按钮挪到顶部窄栏「菜单」左边，面板铺满窄栏下面 */
  .sidebar>.ai-feed{margin-left:auto}
  .ai-feed-button{min-height:44px;padding:0 12px;font-size:15px}
  .ai-feed-panel{position:fixed;top:56px;right:0;bottom:0;left:0;width:auto;max-height:none;border:0;border-top:1px solid #ebedf0;border-radius:0;box-shadow:none}
  .ai-feed-tabs button{min-height:40px;font-size:14px}
  .ai-feed-close{width:44px;height:44px}
  .ai-act{min-height:44px;padding:0 6px}
  .adjust-seg-option span{min-height:44px}
  .po-shot{width:84px;height:112px}
  .po-danger,.po-extra-head .po-head-act{min-height:44px}
  .po-attachment .po-danger{min-height:32px}
  .po-suggest-item{flex-wrap:wrap}
  .po-manual-row .secondary{min-height:44px}
  .po-pick-row{flex-wrap:wrap}
  .po-pick-row .secondary{min-height:44px}
  .po-shots-chip{min-height:32px;margin:4px 0 0 0}
  .po-viewer{width:100vw;max-height:100dvh;height:100dvh;border-radius:0}
  .po-viewer-inner{height:100%;max-height:none}
  .po-viewer-stage{padding:12px 50px}
  .po-viewer-body img{max-height:calc(100dvh - 230px)}
  .po-viewer-nav{width:44px;height:44px;margin-top:-22px}
}
@media (prefers-reduced-motion:no-preference){
  .ai-feed-panel:not([hidden]){animation:motion-fade-in var(--dur-in,200ms) var(--ease-standard,ease-out) both}
}
