/* 单模型训练 — 1024×720 绝对定位 */

/* 机器人 WebView：功能页勿用 flex 列布局，改 block + 绝对铺满 */
.app > .view.view-single-train:not([hidden]) {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  flex: none;
  display: block;
  overflow: hidden;
}

.view-single-train {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  color: #ffffff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: left;
}

.view-single-train {
  --st-gradient: linear-gradient(270deg, #bfe6fc 0%, #5197f1 100%);
  --st-slider-pct: 100%;
}

/* 标题 244×55 top 47 */
.st-row--head {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 102px;
  pointer-events: none;
}

.st-title-img {
  position: absolute;
  left: 50%;
  top: 47px;
  width: 244px;
  height: 55px;
  margin-left: -122px;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.st-reset-btn {
  position: absolute;
  right: 71px;
  top: 30px;
  width: 164px;
  height: 71px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: url("../img/classify-train/ui/jiqi-fenlei-reset.png") no-repeat center / 164px 71px;
  color: #ffffff;
  font-size: 30px;
  font-weight: 400;
  font-family: inherit;
  line-height: 71px;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
}

.st-reset-btn[hidden] {
  display: none !important;
}

.st-reset-btn:hover {
  filter: brightness(1.08);
}

/* 提示条 948×67 top 116 */
.st-row--tip {
  position: absolute;
  left: 39px;
  top: 116px;
  width: 948px;
  height: 67px;
  box-sizing: border-box;
  background: url("../img/single-train/ui/st-tip-bg.png") no-repeat center / 948px 67px;
  display: flex;
  align-items: center;
  padding: 0 24px 0 22px;
}

.st-tip-icon {
  flex-shrink: 0;
  width: 23px;
  height: 31px;
  margin-right: 10px;
  background: url("../img/speech/jiqiai-yuyin-dengpao.png") no-repeat center / 23px 31px;
}

.st-tip-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.35;
  color: #ffffff;
}

/* 主区 top 197（机器人 WebView 不支持 flex gap，用 margin 分栏） */
.st-row--main {
  position: absolute;
  left: 39px;
  top: 197px;
  width: 948px;
  height: 503px;
  display: block;
  font-size: 0;
  line-height: 0;
}

.st-left-panel {
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: 648px;
  height: 503px;
  box-sizing: border-box;
  background: url("../img/single-train/ui/st-left-panel.png") no-repeat center / 648px 503px;
  overflow: hidden;
  font-size: 26px;
  line-height: 1.35;
}

.st-right-panel {
  position: relative;
  display: inline-block;
  vertical-align: top;
  width: 286px;
  height: 503px;
  margin-left: 14px;
  box-sizing: border-box;
  background: url("../img/single-train/ui/st-right-panel.png") no-repeat center / 286px 503px;
  overflow: visible;
  z-index: 2;
  font-size: 26px;
  line-height: 1.35;
}

/* —— 左侧：样本列表（第一步） —— */
.st-left-sample-grid {
  position: absolute;
  left: 0;
  top: 23px;
  width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
  font-size: 0;
  line-height: 0;
  white-space: nowrap;
}

.st-left-sample-grid[hidden] {
  display: none !important;
}

.st-left-sample-item {
  display: inline-block;
  vertical-align: top;
  width: 129px;
  height: 129px;
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 12, 32, 0.6);
  cursor: pointer;
  line-height: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.st-left-sample-item + .st-left-sample-item {
  margin-left: 28px;
}

.st-left-sample-item.is-selected {
  border-color: #00ffff;
}

.st-left-sample-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* —— 左侧：训练库（第三步） —— */
.st-left-lib {
  position: absolute;
  left: 0;
  top: 0;
  width: 648px;
  height: 503px;
  z-index: 1;
}

.st-left-lib[hidden] {
  display: none !important;
}

.st-lib-title-wrap {
  position: absolute;
  left: 24px;
  top: 20px;
  width: 158px;
  height: 44px;
  box-sizing: border-box;
  background: url("../img/single-train/ui/st-lib-title-bg.png") no-repeat center / 158px 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.st-lib-title-text {
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: #5197f1;
  background: var(--st-gradient);
  -webkit-background-clip: text;
  background-clip: text;
}

@supports (-webkit-background-clip: text) {
  .st-lib-title-text {
    -webkit-text-fill-color: transparent;
  }
}

.st-photo-grid {
  position: absolute;
  left: 24px;
  top: 78px;
  width: 600px;
  height: 349px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 200, 255, 0.55) transparent;
  z-index: 1;
  font-size: 0;
  box-sizing: border-box;
  padding-bottom: 4px;
}

.st-photo-grid::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

.st-photo-grid::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.st-photo-grid::-webkit-scrollbar-track {
  background: transparent;
}

.st-photo-grid::-webkit-scrollbar-thumb {
  background: rgba(120, 200, 255, 0.55);
  border-radius: 1px;
}

.st-photo-item {
  display: inline-block;
  vertical-align: top;
  width: 128px;
  height: 129px;
  padding: 0;
  margin: 0 26px 10px 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 12, 32, 0.6);
  cursor: pointer;
  line-height: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.st-photo-item:nth-child(4n) {
  margin-right: 0;
}

.st-photo-item.is-selected {
  border-color: #00ffff;
}

.st-photo-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.st-slider-wrap {
  position: absolute;
  left: 0;
  top: 427px;
  width: 648px;
  height: 76px;
  box-sizing: border-box;
  background: url("../img/single-train/ui/st-slider-bg.png") no-repeat center / 648px 76px;
  padding: 8px 32px 0;
  z-index: 2;
}

.st-slider-label {
  margin: 0 0 3px;
  font-size: 20px;
  font-weight: 400;
  line-height: 20px;
  color: #ffffff;
}

.st-slider-bar {
  position: relative;
  width: 100%;
  height: 24px;
}

.st-slider-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  margin-top: -4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    #1365ff 0%,
    #1365ff var(--st-slider-pct, 100%),
    #051c47 var(--st-slider-pct, 100%),
    #051c47 100%
  );
  pointer-events: none;
}

.st-count-slider {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.st-count-slider:focus {
  outline: none;
}

.st-count-slider::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
  border: none;
}

.st-count-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.st-count-slider::-moz-range-track {
  height: 8px;
  background: transparent;
  border: none;
}

.st-count-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

/* —— 右侧：初始化预测按钮 —— */
.st-action-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 233px;
  height: 90px;
  padding: 0;
  border: none;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 233px 90px;
  cursor: pointer;
  font-family: inherit;
  font-size: 26px;
  font-weight: 500;
  color: #ffffff;
  text-align: left;
  padding-left: 105px;
  box-sizing: border-box;
}

.st-action-btn--predict {
  top: 207px;
  background-image: url("../img/single-train/ui/st-predict-btn.png");
}

.st-action-btn--next {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin: 28px auto 0;
  display: block;
  background-image: url("../img/single-train/ui/st-next-btn.png");
}

.st-action-btn--train {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin: 24px auto 0;
  display: block;
  background-image: url("../img/single-train/ui/st-train-btn.png");
}

.st-action-btn--recognize {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin: 24px auto 0;
  display: block;
  background-image: url("../img/single-train/ui/st-recognize-btn.png");
}

.st-action-btn[hidden],
.st-right-body[hidden],
.st-training[hidden],
.st-comparing[hidden],
.st-dataset-section[hidden],
.st-result-section[hidden] {
  display: none !important;
}

.st-right-panel:not([data-scene="init"]) .st-action-btn--predict {
  display: none !important;
}

/* —— 右侧：样本 + 操作区 —— */
.st-right-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  text-align: center;
  overflow: visible;
  z-index: 1;
}

.st-sample-preview {
  display: block;
  width: 122px;
  height: 122px;
  margin: 0 auto;
  object-fit: cover;
  border-radius: 4px;
  pointer-events: none;
}

.st-predict-label {
  margin: 10px 0 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  color: #ffffff;
  text-align: center;
}

.st-dataset-section {
  margin-top: 28px;
  text-align: left;
  padding-left: 27px;
}

.st-lib-select {
  position: relative;
  margin-top: 0;
  width: 233px;
  z-index: 5;
}

.st-lib-select.is-open {
  z-index: 30;
}

.st-lib-trigger {
  position: relative;
  width: 233px;
  height: 49px;
  padding: 0 44px 0 16px;
  border: none;
  background: url("../img/single-train/ui/st-lib-dropdown.png") no-repeat center / 233px 49px;
  color: #ffffff;
  font-size: 24px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-lib-trigger.is-placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.st-lib-select.is-open .st-lib-menu {
  display: block;
}

.st-lib-arrow {
  position: absolute;
  right: 11px;
  top: 16px;
  width: 29px;
  height: 18px;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.st-lib-select.is-open .st-lib-arrow {
  transform: rotate(180deg);
}

.st-lib-menu {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  bottom: auto;
  z-index: 40;
  width: 233px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  border-radius: 8px;
  background: rgba(6, 28, 72, 0.98);
  border: 1px solid rgba(126, 200, 251, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 200, 255, 0.55) transparent;
}

.st-lib-menu::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

.st-lib-menu::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.st-lib-menu::-webkit-scrollbar-track {
  background: transparent;
}

.st-lib-menu::-webkit-scrollbar-thumb {
  background: rgba(120, 200, 255, 0.55);
  border-radius: 1px;
}

.st-lib-menu li {
  padding: 8px 16px;
  font-size: 20px;
  color: #ffffff;
  cursor: pointer;
}

.st-lib-menu li:hover,
.st-lib-menu li.is-active {
  background: rgba(0, 120, 220, 0.35);
}

/* —— 识别结果 —— */
.st-result-section {
  margin-top: 28px;
  text-align: center;
}

.st-result-title {
  display: block;
  width: 188px;
  height: 38px;
  margin: 0 auto;
  object-fit: contain;
  pointer-events: none;
}

.st-value-box {
  position: relative;
  width: 233px;
  height: 64px;
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("../img/single-train/ui/st-result-box.png") no-repeat center / 233px 64px;
}

.st-confidence-value {
  font-size: 20px;
  font-weight: 400;
  color: #ffffff;
}

/* —— 训练中 / 识别中 —— */
.st-training,
.st-comparing {
  position: absolute;
  left: 50%;
  top: 175px;
  transform: translateX(-50%);
  width: 165px;
  text-align: center;
  z-index: 5;
}

.st-training-icon,
.st-comparing-icon {
  display: block;
  width: 165px;
  height: 152px;
  margin: 0 auto;
  object-fit: contain;
  pointer-events: none;
}

.st-right-panel[data-scene="training"] .st-right-body,
.st-right-panel[data-scene="comparing"] .st-right-body {
  display: none !important;
}

.st-right-panel[data-scene="comparing"] .st-action-btn--predict {
  display: none !important;
}
