/* 插件 style.css 同步 + 网页嵌入覆盖 */

#shopee-four-in-one-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2147483647;
  width: 380px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

#shopee-four-in-one-panel .panel-header {
  background: #007bff;
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  cursor: move;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#shopee-four-in-one-panel .min-btn {
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
}

#shopee-four-in-one-panel .min-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

#shopee-four-in-one-panel #pageTip.page-tip {
  display: none;
  padding: 10px 16px;
  background: #fff5f5;
  color: #c00;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid #ffcccc;
}

#shopee-four-in-one-panel .panel-body {
  padding: 16px;
}

#shopee-four-in-one-panel .setting-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

#shopee-four-in-one-panel .setting-item label {
  width: 90px;
  font-size: 14px;
  color: #333;
  flex-shrink: 0;
}

#shopee-four-in-one-panel .setting-item input,
#shopee-four-in-one-panel .setting-item select,
#shopee-four-in-one-panel .setting-item textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

#shopee-four-in-one-panel .setting-item input:focus,
#shopee-four-in-one-panel .setting-item select:focus,
#shopee-four-in-one-panel .setting-item textarea:focus {
  border-color: #007bff;
}

#shopee-four-in-one-panel .btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.2s;
}

#shopee-four-in-one-panel .primary {
  background: #007bff;
  color: white;
}

#shopee-four-in-one-panel .primary:hover {
  background: #0069d9;
}

#shopee-four-in-one-panel .primary:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

#shopee-four-in-one-panel .danger {
  background: #dc3545;
  color: white;
}

#shopee-four-in-one-panel .danger:hover {
  background: #c82333;
}

#shopee-four-in-one-panel .danger:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

#shopee-four-in-one-panel .btn.rollback {
  background: #f0ad4e;
  color: #fff;
}

#shopee-four-in-one-panel .btn.rollback:hover:not(:disabled) {
  background: #ec971f;
}

#shopee-four-in-one-panel .btn.rollback:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

#shopee-four-in-one-panel .log-area {
  margin-top: 12px;
  padding: 10px;
  height: 200px;
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 4px;
  font-size: 12px;
  color: #333;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.4;
}

#shopee-four-in-one-panel .schedule-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  font-size: 13px;
  color: #856404;
}

#shopee-four-in-one-panel .schedule-info #scheduleCountdown {
  font-weight: 600;
}

#shopee-four-in-one-panel .cancel-schedule {
  width: auto;
  padding: 5px 12px;
  margin: 0;
  font-size: 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#shopee-four-in-one-panel .cancel-schedule:hover {
  background: #c82333;
}

#shopee-four-in-one-panel .time-picker-wrap {
  flex: 1;
  display: flex;
  gap: 6px;
  align-items: center;
}

#shopee-four-in-one-panel .time-select {
  width: 70px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  outline: none;
  cursor: pointer;
}

#shopee-four-in-one-panel .time-select:focus {
  border-color: #007bff;
}

#shopee-four-in-one-panel .time-separator {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

/* —— 网页嵌入：脱离 fixed，随页面排版 —— */
#panelRoot #shopee-four-in-one-panel {
  position: relative;
  bottom: auto;
  right: auto;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

#panelRoot #shopee-four-in-one-panel .panel-header {
  cursor: default;
}

#panelRoot #shopee-four-in-one-panel .log-area {
  height: 280px;
}

#panelRoot #shopee-four-in-one-panel.panel-minimized .panel-body {
  display: none;
}

/* —— 扩展浮窗嵌入：仅显示参数控制区（全屏） —— */
body.dd-embed-ext {
  margin: 0;
  padding: 0;
  background: #f0f2f5;
}

body.dd-embed-ext .page-inner {
  max-width: none;
  width: 100%;
  margin: 0;
}

body.dd-embed-ext #panelRoot {
  margin: 0;
  padding: 0;
}

body.dd-embed-ext #panelRoot #shopee-four-in-one-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

body.dd-embed-ext #panelRoot #shopee-four-in-one-panel .panel-header,
body.dd-embed-ext #panelRoot #shopee-four-in-one-panel #pageTip {
  display: none !important;
}

body.dd-embed-ext #panelRoot #shopee-four-in-one-panel .panel-body {
  padding: 12px;
}
