#tool-body {
  --primary: #16baaa;
  --card-bg: #ffffff;
  --panel-bg: #f7fafc;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  max-width: 100%;
  margin: 0 auto;
  color: var(--text-main);
}

.theme-dark-mode #tool-body {
  --card-bg: #25272b;
  --panel-bg: #1f2125;
  --text-main: #f3f4f6;
  --text-muted: #a8b0bd;
  --border-color: #3a3d44;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

#tool-body * {
  box-sizing: border-box;
}

#tool-body .embed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

#tool-body .embed-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 220px;
}

#tool-body .embed-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 186, 170, 0.12);
  color: var(--primary);
  flex-shrink: 0;
  font-size: 16px;
}

#tool-body .embed-title {
  font-size: 15px;
  font-weight: bolder;
  line-height: 1.35;
  color: var(--text-main);
}

#tool-body .embed-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-top: 2px;
}

#tool-body .embed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

#tool-body .embed-frame-wrap {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  background: #0b0f14;
  box-shadow: var(--shadow);
  min-height: 620px;
}

#tool-body .embed-frame {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
}

#tool-body .embed-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(11, 15, 20, 0.92);
  color: #d1d5db;
  z-index: 2;
  transition: opacity 0.25s ease;
}

#tool-body .embed-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

#tool-body .embed-loading .layui-icon {
  font-size: 28px;
  color: var(--primary);
}

#tool-body .embed-loading-text {
  font-size: 14px;
  color: #9ca3af;
}

#tool-body .embed-fallback {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: var(--card-bg);
}

#tool-body .embed-fallback.show {
  display: flex;
}

#tool-body .embed-fallback-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

#tool-body .embed-fallback-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  #tool-body .embed-toolbar {
    padding: 10px 12px;
  }

  #tool-body .embed-actions {
    width: 100%;
  }

  #tool-body .embed-actions .layui-btn {
    flex: 1;
  }

  #tool-body .embed-frame-wrap {
    min-height: 460px;
    border-radius: 10px;
  }
}
#tool-body .embed-frame {
  height: min(900px, calc(100vh - 180px));
  min-height: 400px;
}