:root {
  --bg: #f0f2f5;
  --bg2: #ffffff;
  --card: #ffffff;
  --line: #e4e7ed;
  --text: #303133;
  --muted: #606266;
  --pri: #1677ff;
  --pri2: #0958d9;
  --pri-soft: rgba(22, 119, 255, 0.08);
  --ok: #52c41a;
  --danger: #ff4d4f;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --header-h: 56px;
  --max: 1200px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.tool-screen {
  display: block;
  min-height: calc(100vh - var(--header-h));
}

.scroll-hint {
  text-align: center;
  padding: 6px 0 10px;
  background: var(--bg);
}

.scroll-hint a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.scroll-hint a:hover { color: var(--pri); }

.scroll-hint .arrow {
  display: inline-block;
  animation: scroll-bounce 1.6s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.wrap { width: min(var(--max), calc(100% - 32px)); margin: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.topbar-inner {
  width: min(calc(100% - 24px), 1600px);
  margin: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--pri), #4096ff);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.35);
}

.brand strong { display: block; font-size: 16px; color: var(--text); }

.tag {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  padding: 7px 14px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--pri);
  background: var(--pri-soft);
}

.nav-link.is-active {
  color: var(--pri);
  font-weight: 600;
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 56px;
  z-index: 90;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--pri);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(22, 119, 255, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, background 0.2s;
}

.back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--pri2);
  color: #fff;
}

.workspace {
  width: 100%;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  align-items: stretch;
  min-height: calc(100vh - var(--header-h) - 40px);
  box-sizing: border-box;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h) - 52px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-left {
  min-width: 280px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.panel-head h2 { margin: 0; font-size: 17px; color: var(--text); }

.count {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  line-height: 1.45;
  flex-shrink: 1;
  max-width: 55%;
}

.left-toolbar {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

.list-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  flex: 0 1 auto;
  overflow: auto;
  min-height: 0;
}

.item-list:empty { display: none; }

.list-shell.has-items .dropzone-wrap {
  flex: 0 0 auto;
  padding: 8px 12px;
  justify-content: center;
}

.list-shell.has-items .dropzone {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-shell.has-items .drop-title,
.list-shell.has-items .drop-hint { display: none; }

.list-shell.has-items .drop-icon { display: block; }

.list-shell.has-items .item-list { flex: 1; }

.dropzone-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  min-height: 0;
}

.drop-icon {
  display: none;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  color: var(--pri);
  pointer-events: none;
}

.dropzone {
  position: relative;
  border: 1px dashed #91caff;
  border-radius: 8px;
  padding: 18px 14px;
  text-align: center;
  background: #f0f7ff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
  width: 100%;
}

.dropzone:focus-visible {
  outline: 2px solid var(--pri);
  outline-offset: 2px;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--pri);
  background: #e6f4ff;
}

.file-input-offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.drop-title { margin: 0 0 6px; font-weight: 600; color: var(--text); }
.drop-hint { margin: 0; font-size: 12px; color: var(--muted); }

.item-list li {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
}

.item-list li:last-child { border-bottom: none; }
.item-list li:hover { background: #f5f7fa; }

.item-list li.active {
  background: var(--pri-soft);
  border-left: 3px solid var(--pri);
  padding-left: 7px;
}

.item-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--pri);
  cursor: pointer;
}

.item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.item-badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f6ffed;
  color: #389e0d;
  border: 1px solid #b7eb8f;
}

.item-group {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f0f2f5;
  border-bottom: 1px solid var(--line);
  cursor: default;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-row-compact {
  margin-bottom: 0;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-height: 36px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn:hover {
  color: var(--pri);
  border-color: var(--pri);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  border: none;
  background: var(--pri);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--pri2);
  color: #fff;
}

.btn-ghost { background: transparent; }

.btn-danger {
  color: var(--danger);
  border-color: #ffccc7;
}

.btn-danger:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-sm {
  flex: 1 1 auto;
  min-height: 30px;
  font-size: 13px;
  border-radius: 6px;
}

.btn-block { width: 100%; }

.panel-right { min-width: 0; }

.preview-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f5f5;
  display: grid;
  place-items: center;
  overflow: auto;
}

#previewCanvas {
  max-width: 100%;
  max-height: 100%;
  display: none;
}

.preview-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 20px;
  text-align: center;
}

.preview-tip {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 60%;
  text-align: right;
}

.export-panel {
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.export-grid {
  display: grid;
  grid-template-columns: 140px 160px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.export-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
}

.export-field select,
.text-input {
  width: 100%;
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid #d9d9d9;
  background: var(--card);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.range-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.range-row .text-input { flex: 1; }
.range-row .btn { flex: 0 0 auto; min-width: 64px; }

.export-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.export-actions .field-hint {
  flex: 1 1 auto;
  margin: 0;
}

.btn-export {
  flex: 0 0 auto;
  min-width: 200px;
  min-height: 42px;
  font-size: 15px;
  border-radius: 6px;
  padding: 0 20px;
}

.field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.statusbar {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
  background: #fafafa;
}

.statusbar.busy .wrap,
.statusbar .wrap.busy { color: #d48806; }

.landing-section {
  padding: 48px 0 56px;
  border-top: 1px solid var(--line);
}

.landing-wrap { max-width: 960px; }

.landing-header { margin-bottom: 32px; }
.landing-header-compact { margin-bottom: 28px; }

.intro-section { background: var(--bg2); }
.guide-section { background: #fff; }

.landing-title {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.landing-lead {
  margin: 0;
  max-width: 720px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.intro-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.intro-panel-title {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.feature-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.85;
  color: #434343;
  font-size: 14px;
}

.feature-list li + li { margin-top: 10px; }

.guide-steps { display: grid; gap: 20px; }

.guide-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.step-num {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: var(--pri);
}

.step-body h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text);
}

.step-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  background: var(--bg2);
}

.site-footer-inner { text-align: center; }

.site-footer-inner p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.site-footer-inner .copyright {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.85;
}

body.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
}

.modal-overlay[hidden] { display: none; }

.modal {
  width: min(400px, 100%);
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; font-size: 17px; }

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #f0f0f0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pri), #69b1ff);
  transition: width 0.2s ease;
}

.progress-percent {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .panel {
    min-height: 420px;
  }

  .panel-left {
    min-width: 0;
    max-height: none;
  }

  .panel-right {
    min-height: 560px;
  }

  .export-grid {
    grid-template-columns: 1fr 1fr;
  }

  .export-field-grow { grid-column: 1 / -1; }

  .intro-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .brand .tag { display: none; }

  .export-grid { grid-template-columns: 1fr; }

  .export-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-export {
    width: 100%;
    min-width: 0;
  }

  .guide-step { grid-template-columns: 1fr; }
}

.intro-free-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f0f7ff;
  border: 1px solid #bae0ff;
  color: #0958d9;
  font-size: 13px;
  line-height: 1.65;
}



/* commercial activation */
.btn-activate-cta {
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #fa8c16, #fa541c);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(250, 84, 28, 0.35);
  cursor: pointer;
}

.btn-activate-cta:hover {
  filter: brightness(1.05);
}

.result-summary {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f0f7ff;
  border: 1px solid #91caff;
  color: #0958d9;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.modal-tip-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #f5f5f5;
  color: var(--text);
}

.modal-body {
  padding: 16px 18px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
}

.modal-foot-actions {
  justify-content: center;
}

.modal-foot-actions .btn {
  flex: 1;
  max-width: 120px;
}

.modal-tip {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.modal-tip-sub {
  padding: 10px 12px;
  border-radius: 6px;
  background: #f0f7ff;
  border: 1px solid #bae0ff;
  color: #0958d9;
}

.modal-warn {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  color: #ad6800;
  font-size: 13px;
}

.modal-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.modal-input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: var(--card);
}

.modal-input:focus {
  outline: none;
  border-color: var(--pri);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.modal-error {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.nav-activate {
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-activate.is-licensed .activate-badge {
  background: #f6ffed;
  color: #389e0d;
  border-color: #b7eb8f;
}

.modal-foot #btnGetActivation:not(:disabled) {
  color: var(--pri);
  border-color: var(--pri);
}

.modal-foot #btnGetActivation:not(:disabled):hover {
  background: var(--pri-soft);
}

.modal-foot #btnGetActivation:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-progress {
  width: min(420px, 100%);
}

.modal-progress .modal-body {
  padding-bottom: 22px;
}

.progress-track {
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  background: #f0f0f0;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1677ff, #4096ff);
  transition: width 0.15s ease;
}

.progress-percent {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.dropzone.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.btn.is-disabled,
label.btn.is-disabled {
  pointer-events: none;
  opacity: 0.55;
  cursor: not-allowed;
}

.activate-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #ffd591;
  background: #fff7e6;
  color: #ad6800;
}

.activate-badge.is-active {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #389e0d;
}



.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
