/* ===================== 设计变量 ===================== */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #ebedf0;
  --border-strong: #dfe2e7;
  --text: #1f2329;
  --muted: #8a909c;
  --primary: #3b6ef5;
  --primary-d: #2f5bd6;
  --primary-soft: #eef3ff;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --ok: #18a058;
  --ok-soft: #e8f7ee;
  --warn: #e3a008;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(20,28,46,.06);
  --shadow-hover: 0 4px 14px rgba(20,28,46,.10);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text); background: var(--bg);
  font-size: 13.5px; line-height: 1.5;
}
a { color: var(--primary); }

/* ===================== 顶部栏 ===================== */
header.topbar {
  background: #fff; color: var(--text);
  padding: 12px 22px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
header.topbar h1 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: .2px; }
header.topbar .tag {
  font-size: 11.5px; background: var(--primary-soft); color: var(--primary-d);
  padding: 3px 9px; border-radius: 20px; font-weight: 500;
}
/* 公网同步状态徽标 */
.sync-badge {
  margin-left: auto; font-size: 11.5px; padding: 3px 10px; border-radius: 20px; font-weight: 500;
  white-space: nowrap;
}
.sync-badge.ok { background: #e7f7ec; color: #1a7f37; }
.sync-badge.off { background: #f1f2f4; color: #8a909c; }
@media (max-width: 720px) {
  .sync-badge { margin-left: 0; width: 100%; text-align: center; }
}

/* ===================== 导航 ===================== */
nav.tabs {
  display: flex; gap: 2px; background: #fff; padding: 0 16px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
nav.tabs button {
  border: none; background: transparent; padding: 13px 16px; cursor: pointer;
  font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
nav.tabs button:hover { color: var(--text); }
nav.tabs button.active { color: var(--primary-d); font-weight: 600; border-bottom-color: var(--primary); }

/* ===================== 面板 ===================== */
main { padding: 18px; max-width: 1120px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; }

/* ===================== 卡片 / 表单 ===================== */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h2 .num {
  background: var(--primary); color: #fff; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600;
}
.hint { color: var(--muted); font-size: 12px; margin: 0 0 14px; line-height: 1.6; }

/* Grid 主布局：IE11 用 flexbox 降级，现代浏览器用 grid */
.grid2 {
  display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
.grid2 > * {
  -ms-flex: 1 1 auto; flex: 1 1 auto; width: calc(50% - 16px); margin: 6px 8px;
}
.grid3 {
  display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
.grid3 > * {
  -ms-flex: 1 1 auto; flex: 1 1 auto; width: calc(33.333% - 16px); margin: 6px 8px;
}
@supports (display: grid) {
  .grid2 {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px;
  }
  .grid2 > * { -ms-flex: none; flex: none; width: auto; margin: 0; }
  .grid3 {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px;
  }
  .grid3 > * { -ms-flex: none; flex: none; width: auto; margin: 0; }
}
@media (max-width: 720px) {
  .grid2 > *, .grid3 > * { width: 100%; margin-left: 0; margin-right: 0; }
  @supports (display: grid) {
    .grid2, .grid3 { grid-template-columns: 1fr; }
    .grid2 > *, .grid3 > * { width: auto; margin: 0; }
  }
}

/* 生成区：大屏两列（表单 | 预览） */
@media (min-width: 880px) {
  #gen.active {
    display: -ms-flexbox; display: flex; -ms-flex-align: start; align-items: flex-start;
  }
  #gen.active > .card {
    -ms-flex: 1 1 auto; flex: 1 1 auto; width: calc(100% - 392px); margin: 0 8px;
  }
  #gen.active > .card:last-child {
    -ms-flex: 0 0 auto; flex: 0 0 auto; width: 360px;
  }
  @supports (display: grid) {
    #gen.active { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
    #gen.active > .card { -ms-flex: none; flex: none; width: auto; margin: 0; }
    #gen.active > .card:last-child { -ms-flex: none; flex: none; width: auto; }
  }
  #gen.active .card { margin-bottom: 0; }
}

.field label { display: block; font-size: 12.5px; color: #4b5563; margin-bottom: 5px; font-weight: 500; }
.field .sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.field .req { color: var(--danger); font-weight: 700; }
.field input, .field select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,110,245,.12); }
.field.narrow { max-width: 260px; }

/* ===================== 按钮 ===================== */
.btn {
  border: none; border-radius: var(--radius-sm); padding: 9px 16px; font-size: 13.5px; cursor: pointer;
  font-weight: 500; background: var(--primary); color: #fff; transition: background .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-d); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #eef0f3; color: var(--text); }
.btn.secondary:hover { background: #e3e6ea; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #cf3a3f; }
.btn.ghost { background: #fff; color: var(--primary-d); border: 1px solid #c9d8fb; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ===================== 预览（标签样张） ===================== */
.preview-box {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; max-width: 360px; margin: 0 auto; box-shadow: var(--shadow);
}
.preview-box svg { max-width: 100%; height: auto; }
.preview-box .pv-info {
  font-size: 12.5px; color: var(--text); background: #f7f8fa; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; margin-bottom: 12px; text-align: left; line-height: 1.7;
}
.preview-box .qr-label { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; text-align: center; }
.preview-box .pv-qr { display: flex; justify-content: center; margin-top: 8px; }
.preview-box .pv-qr svg { width: 110px !important; height: 110px !important; }
.code-display { font-family: "SF Mono", Consolas, monospace; font-size: 12px; letter-spacing: .5px; margin-top: 6px; color: var(--text); text-align: center; white-space: nowrap; }
.code-display .chk { color: var(--danger); font-weight: 700; }
.preview-box .anti-text { font-size: 12px; color: var(--text); margin-top: 4px; text-align: center; }
.preview-box .anti-text .anti-code { font-family: "SF Mono", Consolas, monospace; font-weight: 600; letter-spacing: .5px; font-size: 12px; }

/* ===================== 标签网格 ===================== */
#labelGrid {
  display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
#labelGrid > .label-card {
  -ms-flex: 1 1 auto; flex: 1 1 auto; width: 220px; margin: 6px;
}
@supports (display: grid) {
  #labelGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
  #labelGrid > .label-card { -ms-flex: none; flex: none; width: auto; margin: 0; }
}
.label-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: #fff;
  position: relative; box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s;
}
.label-card:hover { box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.label-card .pinfo {
  font-size: 12px; color: var(--text); background: #f7f8fa; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 9px; margin-bottom: 8px; line-height: 1.55; word-break: break-all;
}
.label-card .meta { font-size: 11px; color: var(--muted); margin: 4px 0; text-align: center; }
.label-card svg { max-width: 100%; height: auto; }
.label-card .anti-text { font-size: 11.5px; color: var(--text); word-break: break-all; text-align: center; margin-top: 2px; }
.label-card .anti-text .anti-code { font-family: "SF Mono", Consolas, monospace; letter-spacing: .8px; font-weight: 600; }
.label-card .qr { display: flex; justify-content: center; margin: 8px 0; }
.label-card .qr img, .label-card .qr canvas, .label-card .qr svg { width: 84px !important; height: 84px !important; }
.label-card .chkbox { position: absolute; top: 9px; right: 9px; width: 15px; height: 15px; cursor: pointer; }
.label-card .del { position: absolute; bottom: 9px; right: 9px; font-size: 11px; padding: 4px 9px; }
.label-card .printed-tag { position: absolute; top: 9px; left: 9px; font-size: 10px; background: var(--ok-soft); color: #0f7a3d; border: 1px solid #b6e3c8; border-radius: 6px; padding: 1px 6px; }
.empty { color: var(--muted); text-align: center; padding: 28px; }

/* ===================== 扫码 ===================== */
.scan-wrap { max-width: 620px; }
.scan-input {
  width: 100%; padding: 15px; font-size: 19px; letter-spacing: 1px; border: 2px solid var(--primary);
  border-radius: var(--radius); text-align: center; font-family: monospace; background: #fff; color: var(--text);
}
.scan-input:focus { outline: none; box-shadow: 0 0 0 4px rgba(59,110,245,.15); }
.result { margin-top: 14px; border-radius: var(--radius); padding: 14px 16px; display: none; }
.result.ok { display: block; background: var(--ok-soft); border: 1px solid #b6e3c8; }
.result.warn { display: block; background: var(--danger-soft); border: 1px solid #f3b9bb; }
.result.miss { display: block; background: #fff8e6; border: 1px solid #f0d89a; }
.result .big { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.result .result-ean { font-size: 14px; font-weight: 600; color: #1e3a8a; background: #eaf0ff; border: 1px solid #c8d6f5; border-radius: 6px; padding: 7px 12px; margin: 6px 0 10px; font-family: ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .5px; }
.result .result-ean b { color: #1d4ed8; font-weight: 700; }
.result table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 12.5px; }
.result td { padding: 5px 6px; border-bottom: 1px solid rgba(0,0,0,.05); vertical-align: top; }
.result td:first-child { color: var(--muted); width: 84px; white-space: nowrap; }

.log-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
.log-table th, .log-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.log-table th { background: #f7f8fa; color: #4b5563; font-weight: 600; }
.log-table td { color: var(--text); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge.green { background: var(--ok-soft); color: #0f7a3d; }
.badge.red { background: var(--danger-soft); color: #b3261e; }
.badge.gray { background: #eef0f3; color: #5a616e; }

/* ===================== 提示条 ===================== */
.danger-note { background: var(--danger-soft); border: 1px solid #f3b9bb; color: #b3261e; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-top: 10px; }
.ok-note { background: var(--ok-soft); border: 1px solid #b6e3c8; color: #0f7a3d; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-top: 10px; }

/* ===================== 打印 ===================== */
@media print {
  header.topbar, nav.tabs, .no-print, .card, .actions, #scanPanel { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  #printArea { display: block !important; }
  .print-label {
    border: 1px dashed #999; border-radius: 6px; padding: 8px; break-inside: avoid;
    page-break-inside: avoid; display: inline-block; vertical-align: top; margin: 4px;
  }
  .print-label svg { max-width: 100%; height: auto; }
}
#printArea { display: none; }
.print-sheet {
  display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
.print-sheet > .print-label {
  -ms-flex: 1 1 auto; flex: 1 1 auto; width: calc(33.333% - 12px); margin: 6px;
}
@supports (display: grid) {
  .print-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .print-sheet > .print-label { -ms-flex: none; flex: none; width: auto; margin: 0; }
}
.print-label { background: #fff; }
.print-label .pl-info { font-size: 10.5px; color: var(--text); border: 1px solid #ddd; border-radius: 5px; padding: 5px 7px; margin-bottom: 5px; line-height: 1.5; word-break: break-all; }
.print-label .pl-meta { font-size: 9.5px; color: #555; text-align: center; }
.print-label .pl-anti { font-size: 10.5px; text-align: center; margin-top: 2px; }
.print-label .pl-anti .anti-code { font-family: "SF Mono", Consolas, monospace; font-weight: 600; letter-spacing: .8px; }
.print-label .pl-qr { display: flex; justify-content: center; margin: 5px 0; }
.print-label .pl-qr svg { width: 80px !important; height: 80px !important; }
.print-label .pl-qr-bare svg { width: 80px !important; height: 80px !important; }
.print-label .pl-cut { border-top: 1px dotted #bbb; margin-top: 5px; }

/* ===================== 带产品信息开关 ===================== */
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin-bottom: 14px; user-select: none; color: var(--text); }
.switch-row input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
#infoFields { transition: opacity .15s; }
#infoFields.disabled-fields { opacity: .45; pointer-events: none; filter: grayscale(1); }

/* 商品码区：有信息=条码，无信息=二维码（884 数字仍显示） */
.pv-pc { text-align: center; }
.pv-pc .pc-qr { display: flex; justify-content: center; margin-bottom: 8px; }
.pv-pc .pc-qr img, .pv-pc .pc-qr canvas, .pv-pc .pc-qr svg { width: 96px !important; height: 96px !important; }
.label-card .pc-slot { text-align: center; }
.label-card .pc-slot .pc-qr { display: flex; justify-content: center; margin: 6px 0; }
.label-card .pc-qr img, .label-card .pc-qr canvas, .label-card .pc-qr svg { width: 84px !important; height: 84px !important; }
.print-label .pl-pc { text-align: center; }
.print-label .pl-qr-bare { display: flex; justify-content: center; margin: 6px 0; }
.print-label .pl-qr-bare img, .print-label .pl-qr-bare canvas { width: 84px !important; height: 84px !important; }

/* ===================== 码查询 ===================== */
.query-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.query-row .q-input { flex: 1; min-width: 200px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text); }
.query-row .q-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,110,245,.12); }
.query-row select { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text); }

/* ===================== 自定义确认弹窗 ===================== */
.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(20,28,46,.45); display: none; align-items: center; justify-content: center; z-index: 999; }
.modal.show { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 20px; max-width: 360px; width: calc(100% - 40px); box-shadow: var(--shadow-hover); }
.modal-msg { font-size: 13.5px; margin-bottom: 16px; line-height: 1.6; color: var(--text); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ===================== 扫码模式切换 / 绑定 ===================== */
.mode-switch { display: flex; gap: 6px; margin-bottom: 12px; }
.mode-btn { border: 1px solid var(--border-strong); background: #fff; color: var(--muted); padding: 7px 14px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: all .15s; }
.mode-btn:hover { border-color: var(--primary); color: var(--primary-d); }
.mode-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.bind-panel { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: #f7f8fa; }
.bind-steps { display: flex; flex-direction: column; gap: 6px; }
.bind-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.bind-step.done { color: var(--text); }
.bind-dot { width: 18px; height: 18px; border-radius: 50%; background: #dfe2e7; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.bind-step.done .bind-dot { background: var(--ok); }

/* ===================== ⑥ 库存台账 ===================== */
.seg { display: inline-flex; border: 1px solid #dfe2e7; border-radius: 10px; overflow: hidden; }
.seg-btn { border: 0; background: #fff; color: #1f2329; padding: 8px 18px; cursor: pointer; font-size: 14px; }
.seg-btn:hover { background: #f0f3fb; }
.seg-btn.active { background: #3b6ef5; color: #fff; }
.seg-btn.active:hover { background: #2f5bd6; }

.grp { margin-bottom: 16px; border: 1px solid #ebedf0; border-radius: 12px; overflow: hidden; }
.grp-h { background: #f6f7f9; padding: 10px 14px; font-weight: 600; color: #1f2329; }
.grp-meta { color: #8a909c; font-weight: 400; font-size: 13px; margin-left: 8px; }
.grp2 { padding: 10px 14px; border-top: 1px dashed #ebedf0; }
.grp2-h { font-weight: 600; margin-bottom: 8px; color: #1f2329; }

/* ===================== 摄像头扫码覆盖层 ===================== */
.scan-overlay { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #0b0e14; z-index: 1000; -ms-flex-direction: column; flex-direction: column; }
.scan-overlay-bar { display: -ms-flexbox; display: flex; -ms-flex-pack: justify; justify-content: space-between; -ms-flex-align: center; align-items: center; padding: 12px 14px; color: #fff; background: #11151c; }
.scan-title { font-size: 16px; font-weight: 600; }
.scanner-video { -ms-flex: 1 1 auto; flex: 1 1 auto; display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; overflow: hidden; }
.scanner-video video { width: 100%; max-height: 100%; object-fit: contain; }
.scan-hint { color: #c7ccd6; text-align: center; padding: 14px; font-size: 14px; }
.scan-foot { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; gap: 10px; padding: 12px 14px; background: #11151c; border-top: 1px solid #222; }
.scan-tip { color: #9aa0ab; font-size: 12px; }

/* 分享链接行（供微信/钉钉/WhatsApp/Telegram 打开） */
.share-row { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -ms-flex-align: center; align-items: center; gap: 8px; margin-top: 12px; }
.url-readonly { -ms-flex: 1 1 220px; flex: 1 1 220px; min-width: 0; padding: 7px 10px; font-size: 12px; color: #555; background: #f6f7f9; border: 1px solid #dfe2e7; border-radius: 8px; }

/* 扫码批次（连扫去重 + 精简列表） */
.scan-session { margin-top: 14px; border: 1px dashed #cfd6e4; border-radius: 12px; padding: 12px; }
.ss-head { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; gap: 8px; margin-bottom: 8px; }
.ss-stat { font-weight: 600; color: #1f2329; font-size: 14px; }
.ss-spacer { -ms-flex: 1 1 auto; flex: 1 1 auto; }
.ss-list { list-style: none; margin: 0; padding: 0; }
.ss-item { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: #f6f7f9; margin-bottom: 6px; font-size: 13px; }
.ss-idx { width: 20px; height: 20px; border-radius: 50%; background: #3b6ef5; color: #fff; font-size: 11px; display: -ms-inline-flexbox; display: inline-flex; -ms-flex-align: center; align-items: center; -ms-flex-pack: center; justify-content: center; -ms-flex-negative: 0; flex-shrink: 0; }
.ss-info { font-weight: 600; color: #1f2329; white-space: nowrap; }
.ss-serial { -ms-flex: 1 1 auto; flex: 1 1 auto; color: #8a909c; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-hist { color: #e08a00; font-size: 12px; margin-left: 4px; }
.ss-del { border: 0; background: transparent; color: #e5484d; font-size: 18px; line-height: 1; cursor: pointer; -ms-flex-negative: 0; flex-shrink: 0; padding: 0 4px; }
.ss-empty { color: #8a909c; font-size: 13px; padding: 8px 2px; }
.ss-item.miss { background: #fdeaea; }
.ss-item.miss .ss-info { color: #e5484d; }

/* 轻提示 toast */
.toast { position: fixed; left: 50%; bottom: 40px; -ms-transform: translateX(-50%) translateY(10px); transform: translateX(-50%) translateY(10px); background: rgba(20,24,33,.92); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 2000; pointer-events: none; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; -ms-transform: translateX(-50%) translateY(0); transform: translateX(-50%) translateY(0); }

/* 手机端：分段控件铺满、按钮易点 */
@media (max-width: 720px) {
  #stock .seg { display: -ms-flexbox; display: flex; width: 100%; }
  #stock .seg-btn { -ms-flex: 1 1 0; flex: 1 1 0; text-align: center; }
  #stock .actions .btn { width: 100%; }
  #stock .query-row > * { width: 100%; }
  #stock .grid2 > .field { width: 100%; }
  .share-row { -ms-flex-direction: column; flex-direction: column; -ms-flex-align: stretch; align-items: stretch; }
  .share-row .btn { width: 100%; }
  .url-readonly { width: 100%; }
  .ss-head { -ms-flex-wrap: wrap; flex-wrap: wrap; }
}

/* ===================== IE10/IE11 降级兼容 =====================
   布局已在主样式中通过 @supports 提供 flexbox 降级；
   这里只补 IE11 不支持的 CSS 变量颜色与 flex gap。 */
.legacy-ie body { color: #1f2329; background: #f6f7f9; }
.legacy-ie header.topbar { background: #fff; border-bottom-color: #ebedf0; }
.legacy-ie header.topbar > * { margin-right: 10px; }
.legacy-ie nav.tabs { background: #fff; border-bottom-color: #ebedf0; }
.legacy-ie .card { background: #fff; border-color: #ebedf0; }
.legacy-ie .card h2 > * { margin-right: 8px; }
.legacy-ie .hint { color: #8a909c; }
.legacy-ie .field label { color: #4b5563; }
.legacy-ie .field input,
.legacy-ie .field select { background: #fff; color: #1f2329; border-color: #dfe2e7; }
.legacy-ie .btn { background: #3b6ef5; color: #fff; }
.legacy-ie .btn.secondary { background: #eef0f3; color: #1f2329; }
.legacy-ie .btn.danger { background: #e5484d; }
.legacy-ie .btn.ghost { background: #fff; color: #2f5bd6; border-color: #c9d8fb; }

/* flex gap 在 IE11 中不生效，用子元素 margin 模拟 */
.legacy-ie .actions { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.legacy-ie .actions > .btn { margin-right: 8px; margin-bottom: 8px; }
.legacy-ie .query-row { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.legacy-ie .query-row > * { margin-right: 8px; margin-bottom: 8px; }
.legacy-ie .switch-row > * { margin-right: 8px; }
.legacy-ie .switch-row input { margin-right: 8px; }
.legacy-ie .modal-actions > * { margin-right: 8px; }
.legacy-ie .mode-switch > * { margin-right: 6px; }
.legacy-ie .bind-steps > * { margin-bottom: 6px; }
.legacy-ie .bind-step > * { margin-right: 8px; }
.legacy-ie .seg { display: -ms-inline-flexbox; }
.legacy-ie .seg-btn { display: -ms-flexbox; display: flex; -ms-flex-align: center; align-items: center; }
.legacy-ie .grp-h { color: #1f2329; }
.legacy-ie .grp-meta { color: #8a909c; }
.legacy-ie .grp2-h { color: #1f2329; }
