#tool-body .te-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; box-sizing: border-box; }
#tool-body .te-wrap * { box-sizing: border-box; }

#tool-body .te-upload-box { padding: 50px 20px; text-align: center; border: 2px dashed #ccc; border-radius: 12px; background: #fdfdfd; cursor: pointer; transition: 0.3s; margin-bottom: 20px; }
#tool-body .te-upload-box:hover, #tool-body .te-upload-box.dragover { border-color: #009688; background: #f2fafa; box-shadow: 0 4px 12px rgba(0, 150, 136, 0.1); }
#tool-body .te-upload-box i.fa-image { font-size: 60px; color: #009688; margin-bottom: 15px; }
#tool-body .te-upload-box .te-title { font-size: 18px; font-weight: 600; color: #333; margin-bottom: 8px; }
#tool-body .te-upload-box .te-subtitle { font-size: 13px; color: #888; }
#tool-body .te-upload-box .te-paste-tag { display: inline-block; background: #eee; padding: 2px 8px; border-radius: 4px; font-weight: bold; color: #555; font-size: 12px; margin: 0 4px; vertical-align: middle; }

#tool-body .te-workspace { display: flex; gap: 20px; align-items: stretch; background: #f5f6f7; padding: 15px; border-radius: 12px; border: 1px solid #e5e5e5; }

#tool-body .te-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #e5e5e5; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }

#tool-body .te-toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 15px; background: #fff; border-top: 1px solid #eee; align-items: center; }
#tool-body .te-tool-group { display: flex; background: #f0f0f0; border-radius: 6px; padding: 3px; }
#tool-body .te-btn-icon { background: transparent; border: none; color: #555; width: 32px; height: 32px; border-radius: 4px; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
#tool-body .te-btn-icon:hover { background: #e4e4e4; color: #333; }
#tool-body .te-btn-icon.active { background: #fff; color: #009688; box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-weight: bold; }
#tool-body .te-tool-divider { width: 1px; height: 20px; background: #ddd; margin: 0 5px; }

#tool-body .te-canvas-wrap { flex: 1; min-height: 500px; max-height: 700px; position: relative; background-image: linear-gradient(45deg,#eee 25%,transparent 25%,transparent 75%,#eee 75%,#eee),linear-gradient(45deg,#eee 25%,transparent 25%,transparent 75%,#eee 75%,#eee); background-position: 0 0,10px 10px; background-size: 20px 20px; background-color: #fafafa; }
#tool-body .te-canvas-wrap img { display: block; max-width: 100%; }

#tool-body .te-crop-info-badge { position: absolute; top: 15px; left: 15px; background: rgba(0, 0, 0, 0.6); color: #fff; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-family: monospace; z-index: 10; backdrop-filter: blur(4px); pointer-events: none; letter-spacing: 0.5px; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }

#tool-body .te-sidebar { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 15px; }

#tool-body .te-card { background: #fff; border-radius: 8px; border: 1px solid #e5e5e5; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
#tool-body .te-card-title { font-size: 14px; font-weight: bold; color: #333; margin-bottom: 12px; display: flex; align-items: center; }
#tool-body .te-card-title i { color: #009688; margin-right: 6px; font-size: 15px; }

#tool-body .te-ratio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#tool-body .te-ratio-btn { border: 1px solid #ddd; background: #fff; padding: 8px 0; border-radius: 6px; text-align: center; cursor: pointer; font-size: 12px; color: #555; transition: 0.2s; font-weight: 500; }
#tool-body .te-ratio-btn:hover { border-color: #009688; color: #009688; background: #f2fafa; }
#tool-body .te-ratio-btn.active,
#tool-body .te-btn-apply.active{ border-color: #009688!important; background: #009688!important; color: #fff!important; }

#tool-body .te-custom-ratio { display: flex; align-items: center; gap: 8px; margin-top: 10px; background: #f9f9f9; padding: 8px; border-radius: 6px; border: 1px solid #eee; }
#tool-body .te-custom-ratio input { flex: 1; width: 100%; height: 30px; text-align: center; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; outline: none; transition: 0.2s; }
#tool-body .te-custom-ratio input:focus { border-color: #009688; }
#tool-body .te-custom-ratio span { color: #888; font-weight: bold; }
#tool-body .te-btn-apply { background: #fff; border: 1px solid #ddd; padding: 0 12px; height: 30px; border-radius: 4px; cursor: pointer; color: #333; font-size: 12px; transition: 0.2s; }
#tool-body .te-btn-apply:hover { background: #009688; color: #fff; border-color: #009688; }

#tool-body .te-checkbox-group {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px dashed #eee;
}

#tool-body .te-label.te-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 0;
  color: #555;
  width: fit-content;
}

#tool-body .te-checkbox-input {
  margin-right: 8px;
  width: 15px;
  height: 15px;
  cursor: pointer;
}


#tool-body .te-form-group { margin-bottom: 12px; }
#tool-body .te-form-group:last-child { margin-bottom: 0; }
#tool-body .te-label { display: block; font-size: 12px; color: #666; margin-bottom: 6px; }
#tool-body .te-input, #tool-body .te-select { width: 100%; height: 36px; border: 1px solid #ddd; border-radius: 6px; padding: 0 10px; font-size: 13px; outline: none; background: #fff; transition: 0.2s; color: #333; }
#tool-body .te-input:focus, #tool-body .te-select:focus { border-color: #009688; box-shadow: 0 0 0 2px rgba(0,150,136,0.1); }
#tool-body .te-size-flex { display: flex; align-items: center; gap: 10px; }
#tool-body .te-size-flex i { color: #aaa; font-size: 12px; }

#tool-body .te-range-wrap { display: flex; align-items: center; gap: 10px; }
#tool-body .te-range { flex: 1; height: 4px; background: #ddd; border-radius: 2px; outline: none; -webkit-appearance: none; cursor: pointer; }
#tool-body .te-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: #009688; border-radius: 50%; cursor: pointer; transition: 0.2s; }
#tool-body .te-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
#tool-body .te-range-val { font-size: 13px; font-weight: bold; color: #009688; width: 40px; text-align: right; }

#tool-body .te-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
#tool-body .te-btn-primary { background: #009688; color: #fff; border: none; height: 44px; border-radius: 6px; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 10px rgba(0,150,136,0.2); }
#tool-body .te-btn-primary:hover { background: #00796b; transform: translateY(-1px); box-shadow: 0 6px 12px rgba(0,150,136,0.3); }
#tool-body .te-btn-danger { background: #fff; color: #ff5722; border: 1px solid #ff5722; height: 38px; border-radius: 6px; font-size: 13px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 6px; }
#tool-body .te-btn-danger:hover { background: #fff3f0; }

@media screen and (max-width: 800px) {
  #tool-body .te-workspace { flex-direction: column; padding: 0; border: 0; background: inherit !important; }
  #tool-body .te-sidebar { width: 100%; }
  #tool-body .te-canvas-wrap { min-height: 350px;max-height: 60vh; }
  #tool-body .te-toolbar { justify-content: center;gap: 3px; }
  #tool-body .te-btn-icon { width: 22px; }
}

.theme-dark-mode #tool-body .te-upload-box { background: #1e1e1e; border-color: #444; }
.theme-dark-mode #tool-body .te-upload-box:hover, .theme-dark-mode #tool-body .te-upload-box.dragover { background: #262626; border-color: #009688; }
.theme-dark-mode #tool-body .te-upload-box .te-title { color: #eee; }
.theme-dark-mode #tool-body .te-upload-box .te-paste-tag { background: #333; color: #ccc; }

.theme-dark-mode #tool-body .te-workspace { background: #121212; border-color: #222; }
.theme-dark-mode #tool-body .te-main { background: #1e1e1e; border-color: #333; }
.theme-dark-mode #tool-body .te-toolbar { background: #1e1e1e; border-color: #333; }
.theme-dark-mode #tool-body .te-tool-group { background: #2a2a2a; }
.theme-dark-mode #tool-body .te-btn-icon { color: #aaa; }
.theme-dark-mode #tool-body .te-btn-icon:hover { background: #3a3a3a; color: #eee; }
.theme-dark-mode #tool-body .te-btn-icon.active { background: #444; color: #009688; }
.theme-dark-mode #tool-body .te-tool-divider { background: #444; }
.theme-dark-mode #tool-body .te-canvas-wrap { background-color: #111; background-image: linear-gradient(45deg,#1a1a1a 25%,transparent 25%,transparent 75%,#1a1a1a 75%,#1a1a1a),linear-gradient(45deg,#1a1a1a 25%,transparent 25%,transparent 75%,#1a1a1a 75%,#1a1a1a); }

.theme-dark-mode #tool-body .te-card { background: #1e1e1e; border-color: #333; }
.theme-dark-mode #tool-body .te-card-title { color: #eee; }
.theme-dark-mode #tool-body .te-ratio-btn { background: #2a2a2a; border-color: #444; color: #ccc; }
.theme-dark-mode #tool-body .te-ratio-btn:hover { border-color: #009688; color: #009688; background: #222; }
.theme-dark-mode #tool-body .te-ratio-btn.active { background: #009688; border-color: #009688; color: #fff; }

.theme-dark-mode #tool-body .te-custom-ratio { background: #262626; border-color: #444; }
.theme-dark-mode #tool-body .te-input, .theme-dark-mode #tool-body .te-select, .theme-dark-mode #tool-body .te-custom-ratio input { background: #2a2a2a; border-color: #444; color: #eee; }
.theme-dark-mode #tool-body .te-btn-apply { background: #333; border-color: #555; color: #ccc; }
.theme-dark-mode #tool-body .te-btn-apply:hover { background: #009688; color: #fff; border-color: #009688; }
.theme-dark-mode #tool-body .te-label { color: #aaa; }
.theme-dark-mode #tool-body .te-range { background: #444; }
.theme-dark-mode #tool-body .te-btn-danger { background: transparent; border-color: #555; color: #ff5722; }
.theme-dark-mode #tool-body .te-btn-danger:hover { background: rgba(255,87,34,0.1); border-color: #ff5722; }

.theme-dark-mode #tool-body .te-checkbox-group {
  border-top-color: #444;
}
.theme-dark-mode #tool-body .te-checkbox-label {
  color: #aaa;
}