:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --panel-soft: #fafafa;
  --text: #17202a;
  --muted: #667085;
  --border: #d8dee5;
  --border-strong: #b8c2cc;
  --primary: #087f8c;
  --primary-hover: #076d78;
  --primary-soft: #e6f4f5;
  --danger: #c2413a;
  --danger-soft: #fdecea;
  --warning: #a15c07;
  --warning-soft: #fff3d6;
  --success: #16794c;
  --success-soft: #e9f7ef;
  --info: #2563a6;
  --info-soft: #eaf2fb;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  -webkit-tap-highlight-color: rgba(8, 127, 140, .12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
a {
  touch-action: manipulation;
}

button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

button:hover {
  border-color: var(--border-strong);
  background: var(--panel-soft);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(8, 127, 140, .28);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: calc(8px + env(safe-area-inset-left));
  z-index: 1000;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  padding: 8px 10px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid rgba(8, 127, 140, .28);
  outline-offset: 2px;
}

.content:focus-visible {
  outline: 2px solid rgba(8, 127, 140, .22);
  outline-offset: -2px;
}

button:disabled {
  color: #98a2b3;
  background: #f2f4f7;
  cursor: default;
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.button-danger {
  color: var(--danger);
  border-color: #efb8b4;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 40;
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
}

.brand {
  min-width: 0;
  flex: 1 1 auto;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.brand-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid #b8c9ff;
  border-radius: 6px;
  color: var(--primary);
  background: #eef3ff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.brand-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  max-width: 128px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.success {
  border-color: #a8dfc3;
  color: var(--success);
  background: var(--success-soft);
}

.status-pill.warning {
  border-color: #f4c46b;
  color: #8a5b00;
  background: #fff6dd;
}

.busy-live {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 80;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #f4c46b;
  border-radius: 10px;
  color: #8a5b00;
  background: rgba(255, 246, 221, .98);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  font-size: 12px;
  line-height: 1.35;
}

.busy-live[hidden] {
  display: none;
}

.app-shell.app-busy button[data-action]:not([data-busy-locked]):not([data-action^="inline-confirm-"]),
.app-shell.app-busy button[data-tab]:not([data-busy-locked]) {
  pointer-events: none;
}

.tabs {
  position: sticky;
  top: 50px;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 42px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  overflow-x: auto;
}

.compact-tabs {
  overflow: visible;
}

.tab-button {
  flex: 0 0 auto;
  min-width: 56px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.tab-button.active {
  color: var(--primary);
  border-color: #b9dce1;
  background: var(--primary-soft);
}

.tab-button:disabled {
  color: #a8b0bb;
  background: transparent;
  border-bottom-color: transparent;
  cursor: default;
}

.utility-menu {
  position: relative;
  margin-left: auto;
  flex: 0 0 auto;
}

.utility-menu summary {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.utility-menu summary::-webkit-details-marker {
  display: none;
}

.utility-menu[open] summary {
  color: var(--primary);
  border-color: #b9dce1;
  background: var(--primary-soft);
}

.utility-menu-body {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
  display: grid;
  gap: 4px;
  min-width: 216px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
}

.utility-menu-body .tab-button {
  min-width: 0;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  text-align: left;
  justify-content: flex-start;
}

.utility-menu-body .tab-button.active,
.utility-menu-body .tab-button:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.utility-account {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.utility-account span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.utility-account strong,
.utility-account em,
.utility-account small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.utility-account strong {
  font-size: 12px;
}

.utility-account em,
.utility-account small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: #98a2b3;
}

.status-dot.success {
  background: var(--success);
}

.content {
  flex: 1;
  padding: 12px;
}

.section {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 14px;
  font-weight: 700;
}

.section-body {
  padding: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}



.lite-flow-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #f3fafb 0%, var(--panel) 42%);
  border-color: #cfe6e9;
}

.lite-flow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.lite-flow-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lite-flow-head span,
.lite-flow-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.lite-flow-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.lite-flow-primary {
  width: 100%;
  min-height: 52px;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(8, 127, 140, .28);
}

.lite-flow-primary:hover {
  box-shadow: 0 6px 16px rgba(8, 127, 140, .34);
}

.lite-flow-primary.is-processing,
.lite-flow-primary[aria-busy="true"]:disabled {
  color: var(--primary);
  border-color: rgba(9, 134, 142, .55);
  background: #eefafb;
  box-shadow: inset 0 0 0 1px rgba(9, 134, 142, .08);
}

.lite-flow-primary.is-processing img,
.lite-flow-primary[aria-busy="true"]:disabled img {
  opacity: .75;
  filter: none;
}

.lite-import-actions {
  display: grid;
  gap: 8px;
}

.lite-import-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lite-import-secondary button {
  min-height: 38px;
}

.auto-execute-field {
  gap: 8px;
}

.auto-execute-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.lite-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.lite-flow-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 28px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  white-space: nowrap;
}

.lite-flow-steps i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #e5eaf0;
  color: #475467;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.lite-flow-steps span.active {
  border-color: #b9dce1;
  color: var(--primary);
  background: var(--primary-soft);
}

.lite-flow-steps span.active i {
  color: #fff;
  background: var(--primary);
}

.lite-flow-steps span.done {
  border-color: #a8dfc3;
  color: var(--success);
  background: var(--success-soft);
}

.lite-flow-steps span.done i {
  color: #fff;
  background: var(--success);
}

.lite-flow-steps span.danger {
  border-color: #efb8b4;
  color: var(--danger);
  background: var(--danger-soft);
}

.lite-flow-steps span.danger i {
  color: #fff;
  background: var(--danger);
}

.lite-flow-hint {
  margin: 0;
  color: #344054;
  font-size: 12px;
  line-height: 1.55;
}

.lite-template-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.lite-template-strip > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lite-template-strip span,
.lite-template-strip em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.lite-template-strip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.lite-template-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.lite-template-actions button {
  min-height: 34px;
  padding: 0 9px;
  background: var(--panel-soft);
}

.lite-more-tools {
  position: relative;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

.lite-more-tools summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  list-style: none;
}

.lite-more-tools summary::-webkit-details-marker {
  display: none;
}

/* 悬停即展开：鼠标移到“更多操作/打开模板”上就浮出菜单，点击也能锁定展开（无障碍兜底）。 */
.lite-more-tools > div {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 6px;
}

.lite-more-tools:hover > div,
.lite-more-tools:focus-within > div,
.lite-more-tools[open] > div {
  display: grid;
}

.lite-more-tools button {
  min-height: 34px;
  padding: 0 9px;
  background: var(--panel-soft);
}

/* “打开模板”下拉浮层：不挤压布局，悬停在按钮下方浮出。 */
.template-open-menu {
  border-top: none;
  padding-top: 0;
}

.template-open-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  background: #fff;
}

.template-open-menu:hover summary {
  border-color: var(--primary);
}

.template-open-menu > div {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  min-width: 180px;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.14);
}














































































.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 11px;
}

.action-button img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.action-button.button-primary img {
  filter: none;
}

.action-button:disabled img {
  opacity: .45;
  filter: grayscale(1);
}


.account-panel .section-body {
  display: grid;
  gap: 12px;
}

.account-summary {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--success-soft);
}

.account-summary strong,
.account-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-summary span {
  color: var(--muted);
  font-size: 12px;
}

.field-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.field-table th,
.field-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.field-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--panel-soft);
}

.field-table tr:last-child td {
  border-bottom: 0;
}

.mapping-table th:nth-child(1),
.mapping-table td:nth-child(1) {
  width: 30%;
}

.mapping-table th:nth-child(3),
.mapping-table td:nth-child(3) {
  width: 54px;
}

.mapping-panel {
  display: grid;
  gap: 10px;
}

.current-template-strip {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--primary-soft);
}

.current-template-strip span {
  color: var(--muted);
  font-size: 12px;
}

.current-template-strip strong,
.current-template-strip em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.current-template-strip strong {
  font-size: 14px;
}

.current-template-strip em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.system-template-strip {
  border-color: #c7dde0;
  background: linear-gradient(180deg, #f2fbfb 0%, #f7fbfc 100%);
}

.system-template-strip p {
  margin: 4px 0 0;
  color: #4f6670;
  font-size: 12px;
  line-height: 1.45;
}

.template-type-switch {
  display: grid;
  gap: 6px;
  margin: 4px 0 10px;
}

.template-type-switch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.template-type-switch-head span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.template-type-switch-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 左右分段切换：两段连成一条、等宽平分，选中段填充主色。 */
.template-type-chips {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.template-type-chip {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.template-type-chip:first-child {
  border-left: none;
}

.template-type-chip em {
  font-style: normal;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.template-type-chip:hover:not(:disabled):not(.active) {
  background: var(--primary-soft);
}

.template-type-chip.active {
  background: var(--primary);
  color: #fff;
}

.template-type-chip.active em {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.template-type-chip:disabled {
  opacity: 0.6;
  cursor: default;
}

.mapping-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.mapping-toolbar {
  gap: 6px;
}

.mapping-toolbar-primary {
  padding-top: 2px;
}

.mapping-toolbar button {
  min-height: 32px;
}

.template-action-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.template-action-details .mapping-toolbar {
  padding: 8px;
}

.template-advanced-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.template-advanced-body {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.template-advanced-body > .mapping-details {
  background: var(--panel);
}


.mapping-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}




.template-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.template-library-head span {
  color: var(--muted);
  font-size: 12px;
}

.template-search-input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 9px;
}








.template-dashboard-body {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.template-dashboard > summary,
.mapping-editor-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.saved-template-list {
  display: grid;
  gap: 8px;
}

.saved-template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  content-visibility: auto;
  contain-intrinsic-size: 94px;
}

.saved-template-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.saved-template-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.saved-template-main strong,
.saved-template-main span,
.saved-template-main em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.saved-template-main span,
.saved-template-main em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.saved-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.saved-template-actions button {
  min-height: 30px;
}











.mapping-details {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
}

.mapping-details summary,
.mapping-details-title {
  min-height: 36px;
  padding: 9px 10px;
  cursor: pointer;
  font-weight: 700;
}

.mapping-details-title {
  display: flex;
  align-items: center;
}



.mapping-details.nested {
  margin: 8px;
  background: var(--panel);
}

.mapping-edit-table {
  background: var(--panel);
}

.mapping-edit-row {
  content-visibility: auto;
  contain-intrinsic-size: 42px;
}

.mapping-edit-table td:first-child strong,
.mapping-edit-table td:first-child span {
  display: block;
}

.mapping-edit-table td:first-child span {
  margin-top: 3px;
  font-size: 12px;
}

.mapping-input,
.doc-mapping-input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 8px;
}

.mapping-cell-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.mapping-cell-picker button {
  min-width: 64px;
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.notice {
  padding: 8px 10px;
  border: 1px solid #b7dfe4;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--muted);
  white-space: nowrap;
}

.badge.success {
  color: var(--success);
  background: var(--success-soft);
  border-color: #b9e3cc;
}

.badge.warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #f2d28b;
}

.badge.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efb8b4;
}


.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf0;
}

.progress-fill {
  height: 100%;
  width: var(--value, 0%);
  background: var(--primary);
  transition: width .18s ease;
}




.upload-log {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.upload-log-row {
  display: grid;
  grid-template-columns: 52px 58px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-soft);
  content-visibility: auto;
  contain-intrinsic-size: 58px;
}


.upload-log-main {
  min-width: 0;
}

.upload-log-main strong,
.upload-log-main em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.upload-log-main em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: #344054;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 9px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: #344054;
  font-weight: 600;
}

.check-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.empty,
.error,
.loading {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.error {
  color: var(--danger);
  border-color: #efb8b4;
  background: var(--danger-soft);
}

.error-version {
  float: right;
  color: #8f2f2a;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.error-details {
  margin-top: 8px;
  color: #7f1d1d;
  font-size: 12px;
}

.error-details summary {
  cursor: pointer;
  font-weight: 700;
}

.error-details p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}


.muted {
  color: var(--muted);
}

@media (max-width: 420px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 6px 8px;
  }

  .status-pill {
    padding: 0 6px;
    max-width: 100%;
  }




  .upload-log-row {
    grid-template-columns: 1fr;
  }

  .toolbar button {
    width: 100%;
  }

  .mapping-toolbar button {
    flex: 1 1 calc(50% - 4px);
    width: auto;
  }

  .mapping-toolbar .button-primary {
    order: -1;
    flex-basis: 100%;
  }





  .lite-flow-head {
    display: grid;
  }

  .lite-flow-steps {
    grid-template-columns: 1fr 1fr;
  }

  .lite-template-actions {
    grid-template-columns: 1fr;
  }

















  .utility-menu-body {
    right: -4px;
  }
}

.decision-backdrop {
  display: none;
}

.decision-card {
  margin: 10px 12px 0;
  border: 1px solid var(--warning);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .10);
  padding: 14px;
}

.decision-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.decision-head h2 {
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 1.2;
}

.decision-close {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.decision-desc {
  margin: 10px 0 12px;
  color: var(--muted);
  line-height: 1.55;
}

.decision-options {
  display: grid;
  gap: 8px;
}

.decision-option {
  min-height: auto;
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 10px;
  padding: 10px;
}

.decision-option strong,
.decision-option span {
  display: block;
}

.decision-option strong {
  margin-bottom: 4px;
  color: var(--text);
}

.decision-option span {
  color: var(--muted);
  line-height: 1.45;
}

.decision-option.recommended {
  border-color: #9ed5db;
  background: var(--primary-soft);
}

.decision-option.recommended strong::after {
  content: " 推荐";
  margin-left: 6px;
  color: var(--primary);
  font-size: 12px;
}

.decision-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--text);
}

.decision-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.mapping-save-card {
  position: sticky;
  top: 96px;
  z-index: 24;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d6e6e8;
  border-radius: 12px;
  background: rgba(251, 254, 254, .98);
  box-shadow: 0 8px 18px rgba(16, 24, 40, .08);
  backdrop-filter: blur(8px);
}

.mapping-save-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.mapping-save-head strong {
  font-size: 14px;
}

.mapping-save-head span {
  color: var(--muted);
  line-height: 1.45;
}

.mapping-lazy-placeholder {
  display: grid;
  gap: 4px;
  margin: 8px;
  padding: 12px;
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: 6px;
  background: var(--panel-muted, #f7f9fc);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.mapping-lazy-placeholder strong {
  color: var(--text);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

.confirm-card {
  border-color: var(--warning);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .10);
}

.confirm-card .section-title {
  color: var(--warning);
}

.confirm-card-items {
  margin: 0 0 10px;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.confirm-card-fields {
  margin: 0 0 12px;
  display: grid;
  gap: 10px;
}

.confirm-card-field {
  display: grid;
  gap: 4px;
}

.confirm-card-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.confirm-card-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.confirm-card-input:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .18);
}

.confirm-card-field-hint {
  font-size: 12px;
  color: var(--muted, #64748b);
  font-style: normal;
}

.confirm-card-actions {
  display: flex;
  gap: 8px;
}

.confirm-card-actions button {
  min-width: 96px;
}

.outcome-card {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft, #fafbfc);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.outcome-card.has-issues {
  border-color: var(--danger);
}

.outcome-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.outcome-fail-list {
  display: grid;
  gap: 6px;
}

.outcome-fail-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.outcome-fail-row button {
  flex: none;
  min-height: 24px;
  padding: 2px 8px;
  font-size: 12px;
}

.outcome-fail-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.outcome-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.outcome-foot button {
  flex: none;
}

.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 12px 0;
  padding: 10px 12px;
  border: 1px solid #9fd4da;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.update-banner button {
  flex: none;
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--panel);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(15, 23, 42, .06);
}

.bottom-bar-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  font-weight: 600;
}

.bottom-bar-button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.bottom-bar-account {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-start;
}

.bottom-bar-account-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  padding-bottom: 64px;
}

.mapping-suggestions {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px dashed #cfe6e9;
  border-radius: 10px;
  background: #f6fbfc;
}

.mapping-suggestions-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.mapping-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid rgba(15, 23, 42, .05);
}

.mapping-suggestion-row:first-of-type {
  border-top: 0;
}

.mapping-suggestion-header {
  flex: 1 1 100%;
  font-weight: 600;
}

.mapping-suggestion-header em {
  margin-left: 6px;
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.mapping-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mapping-suggestion-actions button {
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eefafb;
  border-color: #bfe0e4;
  color: var(--primary);
  font-size: 12px;
}

.mapping-suggestion-dismiss {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--muted) !important;
}

/* 字段映射入口卡 + 二级页 */
.mapping-entry-card .mapping-entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mapping-entry-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mapping-entry-info span {
  font-size: 12px;
  color: var(--muted);
}
.mapping-entry-info strong {
  font-size: 14px;
}
.mapping-entry-info em {
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
}
.mapping-page-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mapping-back-button {
  background: transparent;
  border: none;
  color: var(--primary, #0a7);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
}
.mapping-back-button:hover {
  text-decoration: underline;
}
.horizontal-kv-card table {
  margin-top: 8px;
}
.mapping-preview-table select {
  width: 100%;
  min-width: 96px;
  max-width: 160px;
  padding: 3px 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
}
.mapping-preview-table td {
  vertical-align: middle;
}
.mapping-preview-table .mapping-del-btn {
  padding: 2px 8px;
  font-size: 12px;
}
.mapping-preview-table tr.mapping-row-off {
  opacity: 0.55;
}
/* 方案A：可定位的映射行 —— 点击可在 WPS 表格里选中对应单元格，鼠标悬停给出提示。 */
.mapping-preview-table tr.mapping-locatable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.mapping-preview-table tr.mapping-locatable:hover {
  background: rgba(37, 99, 235, 0.06);
}
/* 双向联动高亮：点侧面板行→选中表格格，或选中表格格→高亮此行。 */
.mapping-preview-table tr.mapping-located {
  background: rgba(37, 99, 235, 0.16);
  box-shadow: inset 3px 0 0 #2563eb;
  animation: mapping-locate-pulse 0.6s ease;
}
@keyframes mapping-locate-pulse {
  0% { background: rgba(37, 99, 235, 0.38); }
  100% { background: rgba(37, 99, 235, 0.16); }
}


.kv-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.kv-subhead .muted {
  font-weight: 400;
  font-size: 12px;
}

.kv-direction-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

.kv-dir-chip {
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.kv-dir-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.header-map-table th:first-child,
.header-map-table td:first-child {
  width: 34px;
  text-align: center;
}

.header-map-table td:last-child {
  text-align: right;
}

.link-danger {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #f1b8b4;
  border-radius: 4px;
  background: #fffafa;
  color: var(--danger, #c2413a);
  font-size: 12px;
  cursor: pointer;
}

.link-danger:hover {
  background: #fff1f0;
}
