/* ============ 寻欢条码 - 条形码/二维码批量生成工具 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #303133;
  background: #f5f7fa;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部导航 ---------- */
.top-header {
  height: 60px;
  background: #409eff;
  box-shadow: 0 2px 4px rgba(0, 21, 41, 0.12);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.logo {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ---------- 左侧工具导航栏 ---------- */
.tool-rail {
  width: 48px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  gap: 4px;
}
.rail-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  color: #606266;
  text-decoration: none;
  opacity: 0.6;
  transition: all 0.2s;
}
.rail-item:hover { opacity: 1; background: #ecf5ff; }
.rail-item.active { opacity: 1; background: #ecf5ff; border-left: 3px solid #409eff; }
.rail-item svg { flex-shrink: 0; }

/* ---------- 主体三栏 ---------- */
.tool-container {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 1440px;
  margin: 16px auto;
  padding: 0 20px;
}
.left-section { flex: 1; min-width: 0; }
.right-section { width: 370px; flex-shrink: 0; }

/* ---------- 左侧输入面板 ---------- */
.input-panel {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 16px;
}
.panel-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}
#barcodeContent {
  width: 100%;
  min-height: 120px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
#barcodeContent:focus { border-color: #409eff; }

.separator-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.sep-label { color: #606266; }
.radio { display: inline-flex; align-items: center; cursor: pointer; color: #606266; }
.radio input { margin-right: 4px; accent-color: #409eff; }
.custom-sep-input {
  width: 120px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
  outline: none;
}
.custom-sep-input:disabled { background: #f5f7fa; color: #c0c4cc; }
.custom-sep-input:focus { border-color: #409eff; }

.generate-buttons {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #606266;
  border-radius: 4px;
  padding: 9px 16px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:hover { color: #409eff; border-color: #c6e2ff; background: #ecf5ff; }
.btn:active { color: #3a8ee6; }
.btn-primary {
  background: #409eff;
  border-color: #409eff;
  color: #fff;
}
.btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; }
.btn-primary:active { background: #3a8ee6; }
.btn-block { display: block; width: 100%; margin-bottom: 10px; }
.btn-half { flex: 1; }
.btn-row { display: flex; gap: 10px; margin-bottom: 10px; }
.btn-mini { padding: 5px 12px; font-size: 13px; }

/* ---------- 收起/展开 ---------- */
.collapse-toggle {
  height: 24px;
  margin: 8px auto 0;
  width: 80px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-bottom: none;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  color: #666;
  font-size: 13px;
  line-height: 23px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  letter-spacing: 2px;
  transition: color 0.2s;
}
.collapse-toggle:hover { color: #409eff; }

/* ---------- 条码预览列表 ---------- */
.barcode-list-area {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 16px;
  min-height: 320px;
  position: relative;
  transition: all 0.3s;
}
.barcode-list-area:fullscreen {
  background: #fff;
  padding: 40px;
  overflow: auto;
}
.barcode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  transition: transform 0.3s;
}
.barcode-list.horizontal {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
}
.barcode-item {
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.2s;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.barcode-item:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
.barcode-serial {
  font-size: 12px;
  color: #909399;
  margin-bottom: 8px;
}
.barcode-svg-wrap svg { display: block; max-width: 100%; }

.list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  border: 1px dashed #dcdfe6;
  border-radius: 4px;
  color: #c0c4cc;
}
.empty-icon { font-size: 42px; letter-spacing: 6px; margin-bottom: 12px; }
.empty-text { font-size: 14px; }

/* ---------- 分页 ---------- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #ebeef5;
}
.page-hint { color: #909399; font-size: 13px; }
.page-info { color: #606266; font-size: 14px; }

/* ---------- 右侧设置 ---------- */
.setting-block {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
}
.setting-label {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
}

/* ---------- 自定义下拉（条码类型） ---------- */
.custom-select { position: relative; }
.select-trigger {
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: #fff;
  font-size: 14px;
  color: #303133;
  transition: border-color 0.2s;
}
.select-trigger:hover, .custom-select.open .select-trigger { border-color: #409eff; }
.select-arrow { color: #c0c4cc; font-size: 12px; }
.select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  z-index: 100;
}
.custom-select.open .select-dropdown { display: block; }
.select-group-title {
  padding: 8px 12px 4px;
  font-size: 12px;
  color: #909399;
  background: #f5f7fa;
  border-top: 1px solid #ebeef5;
}
.select-group-title:first-child { border-top: none; }
.select-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #606266;
}
.select-option:hover { background: #f5f7fa; color: #409eff; }
.select-option.selected { color: #409eff; font-weight: 700; }

/* ---------- 折叠面板 ---------- */
.collapse-panel {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  margin-bottom: 16px;
}
.collapse-header {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.collapse-arrow { color: #c0c4cc; font-size: 12px; transition: transform 0.2s; }
.collapse-panel.open .collapse-arrow { transform: rotate(180deg); }
.collapse-body { padding: 4px 16px 16px; border-top: 1px solid #ebeef5; }

/* ---------- 表单行 ---------- */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 10px;
}
.form-label { color: #606266; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.slider-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.slider-wrap input[type="range"] { flex: 1; min-width: 60px; accent-color: #409eff; }
.input-number {
  width: 68px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  outline: none;
}
.input-number:focus { border-color: #409eff; }
.input-text {
  flex: 1;
  min-width: 0;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
}
.input-text:focus { border-color: #409eff; }
.select {
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 13px;
  background: #fff;
  outline: none;
  color: #303133;
}
.select:focus { border-color: #409eff; }
.color-wrap { display: flex; align-items: center; gap: 8px; }
.color-wrap input[type="color"] {
  width: 32px;
  height: 26px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 0 2px;
  background: #fff;
  cursor: pointer;
}
.color-wrap .input-text { width: 90px; flex: none; }
.help-tip {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 50%;
  background: #e4e7ed;
  color: #606266;
  font-size: 12px;
  cursor: help;
}

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: #dcdfe6;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .switch-slider { background: #409eff; }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ---------- 底部介绍 ---------- */
.tool-intro {
  max-width: 1440px;
  margin: 0 auto 40px;
  padding: 0 20px;
}
.intro-main {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 20px;
  font-size: 16px;
  color: #303133;
  margin-bottom: 12px;
}
.intro-desc {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 16px 20px;
  font-size: 14px;
  color: #606266;
  line-height: 1.8;
  margin-bottom: 12px;
}
.intro-title { font-size: 15px; font-weight: 700; color: #303133; margin: 16px 0 8px; }
.intro-steps {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 16px 20px 16px 40px;
  color: #606266;
  line-height: 2;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  padding: 10px 18px;
  font-size: 14px;
  color: #303133;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.loading { background: rgba(0, 0, 0, 0.7); color: #fff; border: none; }

/* ---------- 右键菜单 ---------- */
.context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  min-width: 140px;
  padding: 4px 0;
}
.menu-item {
  padding: 9px 16px;
  cursor: pointer;
  color: #303133;
  font-size: 14px;
}
.menu-item:hover { background: #f5f7fa; color: #409eff; }

/* ---------- 对话框 ---------- */
.dialog-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
}
.dialog {
  background: #fff;
  border-radius: 6px;
  width: 500px;
  max-width: 92vw;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.dialog-header {
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid #ebeef5;
}
.dialog-body { padding: 20px; overflow-y: auto; }
.dialog-footer {
  padding: 12px 20px;
  border-top: 1px solid #ebeef5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.dialog-form .form-row { margin-top: 14px; }
.dialog-form .form-row:first-child { margin-top: 0; }
.range-wrap { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; }
.range-label { font-size: 13px; color: #909399; }
.dialog-preview { margin-top: 14px; }
.preview-label { font-size: 13px; color: #606266; margin-bottom: 6px; }
.preview-lines {
  max-height: 120px;
  overflow-y: auto;
  background: #f5f7fa;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  color: #606266;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- 上传 ---------- */
.upload-zone {
  border: 1px dashed #dcdfe6;
  border-radius: 4px;
  padding: 32px 20px;
  text-align: center;
  color: #909399;
  cursor: pointer;
  transition: border-color 0.2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: #409eff; color: #409eff; }
.upload-text { margin-bottom: 12px; font-size: 14px; }
.upload-tip { margin-top: 12px; font-size: 12px; color: #c0c4cc; }
.excel-config { margin-top: 16px; }
.export-options { display: flex; flex-direction: column; gap: 8px; }
.export-tip { margin-top: 10px; font-size: 12px; color: #909399; }

/* ---------- 错误表格 ---------- */
.error-table-wrap { max-height: 300px; overflow-y: auto; border: 1px solid #ebeef5; }
.error-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.error-table th, .error-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #ebeef5;
  text-align: left;
  word-break: break-all;
}
.error-table th { background: #f5f7fa; color: #606266; font-weight: 700; }
.error-table tr:last-child td { border-bottom: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .tool-container { flex-direction: column; }
  .right-section { width: 100%; }
}

/* ============ 二维码工具页 ============ */
.btn-success {
  background: #67c23a;
  border-color: #67c23a;
  color: #fff;
}
.btn-success:hover { background: #85ce61; border-color: #85ce61; color: #fff; }
.btn-success:active { background: #5daf34; }

.qrcode-list-area {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 16px;
  margin-top: 16px;
  overflow-y: auto;
}
.qrcode-list {
  display: flex;
  gap: 16px;
  align-content: flex-start;
}
.qrcode-list.horizontal { flex-wrap: wrap; }
.qrcode-list.vertical { flex-direction: column; align-items: center; }
.qrcode-list:empty { display: none; }
.qrcode-item {
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.2s;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.qrcode-item:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); }
.qrcode-serial { font-size: 12px; color: #909399; margin-bottom: 8px; }
.qrcode-svg-wrap svg { display: block; max-width: 100%; height: auto; }

/* 空态工具介绍 */
.tool-introduction { width: 100%; min-height: 260px; display: flex; align-items: center; justify-content: center; }
.tool-introduction-content { padding: 24px 0; text-align: center; }
.tool-introduction-content > p { color: #606266; font-size: 16px; line-height: 1.8; }
.tool-introduction-align-left { text-align: left; margin-top: 24px; display: inline-block; }
.tool-introduction-align-left h3 { font-size: 16px; color: #303133; margin-bottom: 10px; }
.tool-introduction-align-left p { color: #909399; line-height: 1.9; }

/* 二维码样式分隔线 */
.style-divider {
  margin: 20px 0 8px;
  border-top: 1px solid #dcdfe6;
  text-align: center;
  position: relative;
}
.style-divider span {
  position: relative;
  top: -10px;
  background: #fff;
  padding: 0 16px;
  color: #909399;
  font-size: 13px;
}

/* 自定义图片上传 */
.upload-group { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.upload-btn { flex-shrink: 0; padding: 6px 12px; }
.upload-filename { flex: 1; min-width: 0; }
.upload-delete { flex-shrink: 0; padding: 6px 10px; color: #f56c6c; line-height: 1; }

/* 容错率 */
.radio-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 眼颜色行禁用态 */
.form-row.dimmed { opacity: 0.5; pointer-events: none; }
