.widget-customize-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary, #2563eb);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.widget-customize-btn:hover {
  background: var(--primary-dark, #1d4ed8);
  transform: translateY(-1px);
}

.widget-customize-btn i {
  font-size: 0.9rem;
}

.widget-customize-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s;
}

.widget-customize-overlay.open {
  opacity: 1;
}

.widget-customize-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-primary, #fff);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
}

.widget-customize-panel.open {
  right: 0;
}

.widget-customize-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.widget-customize-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
}

.widget-customize-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.widget-customize-close:hover {
  background: var(--bg-accent, #f1f5f9);
}

.widget-customize-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.widget-customize-hint {
  font-size: 0.8125rem;
  color: var(--text-light, #94a3b8);
  margin: 0 0 16px;
}

.widget-customize-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.widget-customize-empty {
  text-align: center;
  color: var(--text-light, #94a3b8);
  padding: 24px 0;
}

.widget-customize-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.widget-customize-item:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.widget-customize-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.widget-customize-item.drag-over-top {
  border-top: 2px solid var(--primary, #2563eb);
}

.widget-customize-item.drag-over-bottom {
  border-bottom: 2px solid var(--primary, #2563eb);
}

.widget-customize-item-drag {
  color: var(--text-light, #94a3b8);
  font-size: 0.875rem;
  cursor: grab;
}

.widget-customize-item-label {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #1e293b);
}

.widget-customize-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.widget-customize-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.widget-customize-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  transition: background 0.2s;
}

.widget-customize-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.widget-customize-toggle input:checked + .widget-customize-toggle-slider {
  background: var(--primary, #2563eb);
}

.widget-customize-toggle input:checked + .widget-customize-toggle-slider::before {
  transform: translateX(20px);
}

.widget-customize-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  gap: 12px;
}

.widget-customize-reset {
  padding: 8px 16px;
  background: none;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: background 0.2s;
}

.widget-customize-reset:hover {
  background: var(--bg-accent, #f1f5f9);
}

.widget-customize-save {
  padding: 8px 20px;
  background: var(--primary, #2563eb);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.widget-customize-save:hover {
  background: var(--primary-dark, #1d4ed8);
}

@media (max-width: 480px) {
  .widget-customize-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .widget-customize-btn span {
    display: none;
  }
}
