:root {
  --bg: #edf3f7;
  --panel: rgba(255, 255, 255, 0.86);
  --line: #d7e1ea;
  --text: #25364a;
  --muted: #688096;
  --accent: #2f6f9f;
  --accent-soft: #dce9f3;
  --warn: #fff5d8;
  --warn-border: #e6c979;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.9), transparent 30%),
    linear-gradient(180deg, #dfe9f2 0%, #edf3f7 100%);
}

.page { max-width: 1540px; margin: 0 auto; padding: 32px 24px 48px; }
.hero { display: flex; gap: 24px; justify-content: space-between; margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; font-weight: 700; }
h1 { margin: 0; font-size: 52px; line-height: 1.05; }
.intro { max-width: 760px; color: var(--muted); line-height: 1.7; }
.hero-card { min-width: 300px; padding: 24px; border-radius: 28px; background: linear-gradient(180deg, rgba(42,82,117,0.95), rgba(61,112,153,0.92)); color: white; box-shadow: 0 20px 50px rgba(44,78,112,0.22); }
.stat + .stat { margin-top: 20px; }
.stat span { display: block; font-size: 13px; opacity: 0.8; }
.stat strong { display: block; margin-top: 6px; font-size: 24px; }

.layout { display: grid; grid-template-columns: 460px 1fr; gap: 24px; }
.panel { background: var(--panel); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,0.6); border-radius: 28px; padding: 24px; box-shadow: 0 18px 48px rgba(57,92,123,0.12); }
.panel h2 { margin: 0; font-size: 26px; }
.panel-head, .result-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 20px; }
.result-actions { display: flex; gap: 12px; align-items: start; }

.upload-box { display: block; margin-bottom: 18px; padding: 20px; border: 2px dashed #bad0de; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(232,241,247,0.85)); }
.upload-box input { display: block; width: 100%; margin-bottom: 12px; }
.upload-box span { display: block; font-weight: 700; }
.images-info { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 14px 18px; border-radius: 16px; background: rgba(255,255,255,0.92); border: 1px solid var(--line); }
.images-info span { font-weight: 600; color: var(--text); flex: 1; }
.btn-outline-sm { padding: 7px 16px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 13px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.btn-outline-sm:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-danger-sm:hover { background: #fef2f2; border-color: #f87171; color: #ef4444; }
.template-section { margin-bottom: 18px; }
.template-options { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.template-option { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 14px; border: 2px solid transparent; background: rgba(255,255,255,0.7); cursor: pointer; transition: all 0.15s; min-width: 90px; }
.template-option:hover { border-color: var(--line); }
.template-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.template-option input { display: none; }
.template-thumb { width: 72px; height: 108px; border-radius: 8px; overflow: hidden; background: #e8ecf0; display: flex; align-items: center; justify-content: center; }
.template-thumb img { width: 100%; height: 100%; object-fit: cover; }
.template-option span { font-size: 13px; font-weight: 600; color: var(--text); }
.template-mode-row { display: flex; gap: 16px; padding: 8px 0; }
.template-mode { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--muted); }
.template-mode input { accent-color: var(--accent); }
.upload-box small, label span, .tip-list, #status-text, .meta, .sample-box pre, .schema-head span, .picker-head span, .modal-tip { color: var(--muted); }

.tip-list, .sample-box {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--accent-soft);
  line-height: 1.6;
}

.schema-panel { margin-bottom: 18px; padding: 16px; border-radius: 20px; background: rgba(229,239,246,0.8); }
.schema-head, .picker-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mapping-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.field-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.field-check { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 999px; background: rgba(255,255,255,0.9); border: 1px solid rgba(190,210,225,0.9); }
.multi-select-label { margin-bottom: 14px; }
.multi-select-label span { font-weight: 600; color: var(--text); }
.multi-select-label select { min-height: 120px; }

/* 自定义多选下拉框 */
.multi-select-wrapper { position: relative; margin-bottom: 14px; }
.multi-select-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; border-radius: 16px; border: 1px solid var(--line);
  padding: 12px 14px; background: rgba(255,255,255,0.92); color: var(--text);
  cursor: pointer; min-height: 46px; user-select: none;
}
.multi-select-trigger:hover { border-color: var(--accent); }
.multi-select-placeholder { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; line-height: 1.4; }
.multi-select-placeholder:not(.empty) { color: var(--text); font-weight: 500; }
.multi-select-arrow { font-size: 14px; color: var(--muted); margin-left: 8px; flex-shrink: 0; }
.multi-select-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  border-radius: 16px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.98); box-shadow: 0 8px 24px rgba(57,92,123,0.12);
  max-height: 220px; overflow-y: auto;
}
.multi-select-list { padding: 6px 0; }
.multi-select-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; border-radius: 10px; margin: 2px 6px;
  transition: background 0.15s;
}
.multi-select-item:hover { background: var(--accent-soft); }
.multi-select-item input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer;
}
.multi-select-item span { font-size: 14px; color: var(--text); }

.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: flex; flex-direction: column; gap: 8px; }
.toggle { justify-content: end; padding-top: 30px; }
.toggle input { width: auto; }

input, select, button { font: inherit; }
input[type="text"], input[type="password"], select { width: 100%; border-radius: 16px; border: 1px solid var(--line); padding: 12px 14px; background: rgba(255,255,255,0.92); color: var(--text); }
input[type="checkbox"] { transform: translateY(1px); }

.primary, .secondary {
  border: 0;
  border-radius: 18px;
  padding: 12px 16px;
  cursor: pointer;
}
.primary { margin-top: 20px; width: 100%; background: linear-gradient(180deg, #2d6e9d, #24597e); color: white; font-weight: 700; }
.secondary { background: rgba(230,239,246,0.95); color: #2a587c; font-weight: 700; }
.primary:disabled { opacity: 0.5; cursor: progress; }

.toolbar { margin-bottom: 18px; }
.warning { max-width: 420px; padding: 12px 14px; border-radius: 16px; background: var(--warn); border: 1px solid var(--warn-border); color: #7d5e0e; line-height: 1.6; white-space: pre-wrap; }
.hidden { display: none !important; }

.table-wrap { overflow: auto; border-radius: 22px; border: 1px solid rgba(215,225,234,0.8); background: rgba(255,255,255,0.85); }
.result-table { width: 100%; border-collapse: collapse; min-width: 1080px; }
.result-table th, .result-table td { padding: 14px 12px; border-bottom: 1px solid rgba(220,230,238,0.9); text-align: left; vertical-align: middle; }
.result-table th { position: sticky; top: 0; background: #f4f8fb; z-index: 1; }
.empty-cell { text-align: center; color: var(--muted); }

.thumb-btn { border: 0; background: transparent; padding: 0; cursor: zoom-in; }
.thumb-btn img { width: 88px; height: 88px; object-fit: contain; display: block; border-radius: 14px; background: linear-gradient(180deg, #fff, #eef3f7); border: 1px solid rgba(215,225,234,0.8); }

.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16,28,41,0.55); }
.modal-dialog { position: relative; z-index: 1; width: min(640px, calc(100vw - 32px)); margin: 8vh auto 0; padding: 24px; border-radius: 24px; background: white; box-shadow: 0 20px 60px rgba(22,38,55,0.3); }
.image-viewer { width: min(1000px, calc(100vw - 32px)); }
.image-viewer img { width: 100%; max-height: 80vh; object-fit: contain; display: block; border-radius: 16px; background: #f5f8fb; }
.modal-close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border: 0; border-radius: 999px; background: rgba(229,236,243,0.95); font-size: 24px; cursor: pointer; }
.modal-actions { margin-top: 16px; display: flex; justify-content: flex-end; }

@media (max-width: 1220px) {
  .hero, .layout, .mapping-grid, .grid.two { grid-template-columns: 1fr; display: grid; }
  .toggle { padding-top: 0; }
}
